txline
Devnet-only Rust SDK for TxLINE.
This crate intentionally supports TxLINE Devnet only. Mainnet constants, feature flags, examples, and transaction flows are out of scope for this SDK version.
Overview
txline provides typed Rust helpers for the current TxLINE Devnet APIs and
Solana program addresses:
- Devnet configuration and client construction.
- Guest JWT and activated API token handling.
- REST clients for fixtures, odds, scores, validation, and purchase quotes.
- SSE odds and scores streams with reconnect support and heartbeat filtering.
- Legacy and V2 score stat-validation DTOs.
- Devnet PDA and Token-2022 ATA helpers.
- High-level Devnet setup flow for wallet, pricing matrix, subscribe, activation, and API token storage.
subscribe,request_devnet_faucet,purchase_subscription_token_usdt, and on-chain validation instruction builders.- View-like validation simulation helpers for fixtures, odds, legacy stats, and V2 stats.
- Paid purchase quote transaction safety checks.
Quick Start
use ;
# async
Wallet setup is available through client.devnet_user_setup(). It fetches the
pricing matrix, ensures the user's Token-2022 ATA exists, submits
subscribe(service_level_id, weeks), signs the activation preimage, calls
/api/token/activate, and stores the returned API token on the client. If an
existing API token is supplied, on-chain subscribe and activation are skipped.
The activation preimage is:
${txSig}:${selectedLeagues.join(",")}:${jwt}
For the standard bundle with no selected leagues:
${txSig}::${jwt}
Documentation
- Repository: https://github.com/Berektassuly/txline-rs
- API docs: https://docs.rs/txline
- TxLINE docs: https://txline.txodds.com/documentation/quickstart
- Devnet IDL docs: https://github.com/txodds/tx-on-chain/blob/main/documentation/programs/devnet.mdx
- Devnet PR examples source: https://github.com/txodds/tx-on-chain/tree/nojira-re-adding-examples
Normal Rust tests use checked-in validation golden fixtures and do not require
Node, Anchor, or a local txodds/tx-on-chain checkout.
License
Licensed under either of:
- Apache License, Version 2.0
- MIT license
at your option.