> ## Documentation Index
> Fetch the complete documentation index at: https://txline-docs.txodds.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Program Addresses

> TxLINE Solana program addresses and key accounts

## Mainnet Addresses

| Type           | Address                                        |
| -------------- | ---------------------------------------------- |
| Program ID     | `9ExbZjAapQww1vfcisDmrngPinHTEfpjYRWMunJgcKaA` |
| TxL Token Mint | `Zhw9TVKp68a1QrftncMSd6ELXKDtpVMNuMGr1jNwdeL`  |
| USDT Mint      | `Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB` |
| API Endpoint   | `https://txline.txodds.com/api/`               |

## Devnet Addresses

| Type           | Address                                        |
| -------------- | ---------------------------------------------- |
| Program ID     | `6pW64gN1s2uqjHkn1unFeEjAwJkPGHoppGvS715wyP2J` |
| TxL Token Mint | `4Zao8ocPhmMgq7PdsYWyxvqySMGx7xb9cMftPMkEokRG` |
| USDT Mint      | `ELWTKspHKCnCfCiCiqYw1EDH77k8VCP74dK9qytG2Ujh` |
| API Endpoint   | `https://txline-dev.txodds.com/api/`           |

<Warning>
  Use all values from one network only. A devnet subscribe transaction from `6pW64gN1s2uqjHkn1unFeEjAwJkPGHoppGvS715wyP2J` must be activated with `https://txline-dev.txodds.com`, and a mainnet subscribe transaction from `9ExbZjAapQww1vfcisDmrngPinHTEfpjYRWMunJgcKaA` must be activated with `https://txline.txodds.com`.
</Warning>

## API Hosts

| Network | Guest Auth                                       | API Base                             |
| ------- | ------------------------------------------------ | ------------------------------------ |
| Mainnet | `https://txline.txodds.com/auth/guest/start`     | `https://txline.txodds.com/api/`     |
| Devnet  | `https://txline-dev.txodds.com/auth/guest/start` | `https://txline-dev.txodds.com/api/` |

Use the host root for `/auth/guest/start`, then use the matching `/api/token/activate` endpoint after the on-chain `subscribe` transaction confirms.

## Deriving Program Derived Addresses (PDAs)

The program uses several PDAs that you'll need to derive when interacting with it:

```typescript theme={null}
import { PublicKey } from "@solana/web3.js";
import { getAssociatedTokenAddressSync, TOKEN_2022_PROGRAM_ID } from "@solana/spl-token";
import { BN } from "@coral-xyz/anchor";

const programId = new PublicKey("9ExbZjAapQww1vfcisDmrngPinHTEfpjYRWMunJgcKaA");
const txlTokenMint = new PublicKey("Zhw9TVKp68a1QrftncMSd6ELXKDtpVMNuMGr1jNwdeL");

// For devnet, replace both constants with the devnet values above.

// Token Treasury PDA - owns the vault that collects subscription fees
const [tokenTreasuryPda] = PublicKey.findProgramAddressSync(
  [Buffer.from("token_treasury_v2")],
  programId
);

// Token Treasury Vault - the ATA that holds collected TxL tokens
const tokenTreasuryVault = getAssociatedTokenAddressSync(
  txlTokenMint,
  tokenTreasuryPda,
  true, // Allow PDA owner
  TOKEN_2022_PROGRAM_ID
);

// Pricing Matrix PDA - contains service tier pricing information
const [pricingMatrixPda] = PublicKey.findProgramAddressSync(
  [Buffer.from("pricing_matrix")],
  programId
);

// USDT Treasury PDA - owns the vault that collects USDT for token purchases
const [usdtTreasuryPda] = PublicKey.findProgramAddressSync(
  [Buffer.from("usdt_treasury")],
  programId
);

const usdtMint = new PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB");

// USDT Treasury Vault - the ATA that holds collected USDT
const usdtTreasuryVault = getAssociatedTokenAddressSync(
  usdtMint,
  usdtTreasuryPda,
  true,
  TOKEN_2022_PROGRAM_ID
);

// Daily Scores Merkle Roots PDA - for validating scores data
const epochDay = Math.floor(Date.now() / (24 * 60 * 60 * 1000));
const [dailyScoresPda] = PublicKey.findProgramAddressSync(
  [
    Buffer.from("daily_scores_roots"),
    new BN(epochDay).toArrayLike(Buffer, "le", 2)
  ],
  programId
);

// Daily Batch Roots PDA - for validating odds data
const [dailyBatchRootsPda] = PublicKey.findProgramAddressSync(
  [
    Buffer.from("daily_batch_roots"),
    new BN(epochDay).toArrayLike(Buffer, "le", 2)
  ],
  programId
);

// Ten Daily Fixtures Roots PDA - for validating fixtures data
const alignedEpochDay = Math.floor(epochDay / 10) * 10;
const [tenDailyFixturesRootsPda] = PublicKey.findProgramAddressSync(
  [
    Buffer.from("ten_daily_fixtures_roots"),
    new BN(alignedEpochDay).toArrayLike(Buffer, "le", 2)
  ],
  programId
);

console.log("Token Treasury PDA:", tokenTreasuryPda.toBase58());
console.log("Token Treasury Vault:", tokenTreasuryVault.toBase58());
console.log("USDT Treasury PDA:", usdtTreasuryPda.toBase58());
console.log("USDT Treasury Vault:", usdtTreasuryVault.toBase58());
console.log("Pricing Matrix PDA:", pricingMatrixPda.toBase58());
console.log("Daily Scores PDA:", dailyScoresPda.toBase58());
console.log("Daily Batch Roots PDA:", dailyBatchRootsPda.toBase58());
console.log("Ten Daily Fixtures Roots PDA:", tenDailyFixturesRootsPda.toBase58());
```
