Overview
TxLINE provides cryptographically verifiable sports data through a hybrid Solana on-chain and TxODDS off-chain system. Access fixtures, odds, and scores with time-limited API tokens secured by on-chain subscriptions.
Getting Started
Want to try for free? Check out our World Cup Free Tier for instant access to EPL and World Cup data with no payment required.
Purchase TxL
In order to purchase TxL, your wallet will need to be funded with USDT. If you don’t have USDT on Solana, you can swap for it using Jupiter or another exchange.
TxL purchases use a 2-step process: request a quote from the backend, then verify and sign the transaction locally.
Step 1: Request Purchase Quote
// Get guest JWT
const authResponse = await axios.post("https://txline.txodds.com/auth/guest/start");
const jwt = authResponse.data.token;
// Request purchase quote
const txlineAmount = 50; // Amount of TxL tokens to purchase
const quoteResponse = await fetch("https://txline.txodds.com/api/guest/purchase/quote", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${jwt}`
},
body: JSON.stringify({
buyerPubkey: wallet.publicKey.toBase58(),
txlineAmount: txlineAmount
})
});
const quoteData = await quoteResponse.json();
console.log(`Base Cost: ${quoteData.baseUsdtCost} USDT`);
console.log(`Premium Fee: ${quoteData.feeUsdtAmount} USDT`);
console.log(`Total: ${quoteData.totalUsdtCharged} USDT`);
Step 2: Verify and Sign Transaction
// Deserialize the transaction from the quote
const txBuffer = Buffer.from(quoteData.transactionBase64, "base64");
const transaction = anchor.web3.Transaction.from(txBuffer);
// Verify transaction safety locally (recommended)
// This ensures the transaction matches what you requested
// Sign the transaction
transaction.partialSign(wallet);
// Broadcast to Solana
const txSignature = await connection.sendRawTransaction(transaction.serialize(), {
skipPreflight: false,
preflightCommitment: "confirmed"
});
// Confirm transaction
await connection.confirmTransaction(txSignature, "confirmed");
console.log("Purchase successful:", txSignature);
TxODDS may refuse purchase requests and ask for KYC (Know Your Customer) verification in accordance with compliance requirements.
Subscribe On-Chain
Subscribe to the TxLINE by paying with TxL. Choose between a standard subscription or a custom league selection.
Standard Subscription
Custom Leagues
const SERVICE_LEVEL_ID = 1;
const DURATION_WEEKS = 1;
const SELECTED_LEAGUES: number[] = []; // Standard bundle
const txSig = await program.methods
.subscribe(SERVICE_LEVEL_ID, DURATION_WEEKS)
.accounts({
user: provider.wallet.publicKey,
pricingMatrix: pricingMatrixPda,
tokenMint: SUBSCRIPTION_TOKEN_MINT,
userTokenAccount: userTokenAccount.address,
tokenTreasuryVault,
tokenTreasuryPda,
tokenProgram: TOKEN_2022_PROGRAM_ID,
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
systemProgram: SystemProgram.programId,
})
.rpc();
const SERVICE_LEVEL_ID = 3;
const DURATION_WEEKS = 1;
const SELECTED_LEAGUES = [500001]; // Your league IDs
const txSig = await program.methods
.subscribe(SERVICE_LEVEL_ID, DURATION_WEEKS)
.accounts({
user: provider.wallet.publicKey,
pricingMatrix: pricingMatrixPda,
tokenMint: SUBSCRIPTION_TOKEN_MINT,
userTokenAccount: userTokenAccount.address,
tokenTreasuryVault,
tokenTreasuryPda,
tokenProgram: TOKEN_2022_PROGRAM_ID,
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
systemProgram: SystemProgram.programId,
})
.rpc();
Activate Your API Token
After subscribing on-chain, activate your API access by signing the transaction and calling the activation endpoint.
// Get guest JWT
const authResponse = await axios.post("https://txline.txodds.com/auth/guest/start");
const jwt = authResponse.data.token;
// Sign the subscription transaction
const messageString = `${txSig}:${SELECTED_LEAGUES.join(",")}:${jwt}`;
const message = new TextEncoder().encode(messageString);
const signatureBytes = nacl.sign.detached(message, provider.wallet.payer!.secretKey);
const walletSignature = Buffer.from(signatureBytes).toString("base64");
// Activate API access
const activationResponse = await axios.post(
"https://txline.txodds.com/api/token/activate",
{
txSig,
walletSignature,
leagues: SELECTED_LEAGUES,
},
{ headers: { Authorization: `Bearer ${jwt}` } }
);
const apiToken = activationResponse.data.token || activationResponse.data;
You’re now ready to use the API! Use the jwt and apiToken to authenticate your requests.
Next Steps