Integration
Цей контент ще не доступний вашою мовою.
You can integrate Tegro Finance data and trading into your own product.
Use the SDK
Section titled “Use the SDK”The fastest path is the official TypeScript SDK — @tegroton/tegro-finance. It wraps the endpoints below with full types, BigInt-exact amount math, and a TON Connect adapter, and can build transactions either via the API or fully client-side.
npm install @tegroton/tegro-financeSee the TypeScript SDK page for quick-start examples. Prefer raw HTTP? The endpoints are documented below.
Read data
Section titled “Read data”Use the API to pull pools, assets and quotes. Always treat the live API and on-chain state as the source of truth for addresses and reserves.
Build transactions
Section titled “Build transactions”Trading actions (swap, add/remove liquidity, stake) are signed by the user’s wallet via TON Connect. The backend returns a prepared message payload; your client passes it to the wallet to sign. Do not hardcode contract addresses — read current ones from the API.
Best practices
Section titled “Best practices”- Resolve token metadata from
/api/v1/assets; handle tokens with missing metadata gracefully. - Show fees and price impact before the user confirms.
- Verify token addresses; warn on look-alike symbols.