This monorepo contains the TypeScript SDKs for STON.fi contracts and a React example app showing how to integrate them.
Read the SDK documentation for integration guides and API references.
We maintain a React example app illustrating how to use the SDKs, with source code available.
All SDKs can be found in the packages/ directory. They are thin wrappers around STON.fi contracts, built on @ton/ton for use in JavaScript and TypeScript applications.
The DEX SDK provides typed access to STON.fi contracts, including Router, Pool, LpAccount, and pTON (proxyTON), for token swaps and liquidity provision and withdrawal. Use it to read contract state and build transaction messages for your wallet integration.
Router information ties together a router's address, contract version and type, and pTON configuration. The SDK's dexFactory and routerFactory helpers use this information to select the matching contract wrappers. If you don't know the router or need a list of available routers, use GET /v1/routers or GET /v1/routers/{address} from the public STON.fi API (Swagger), or call getRouters() or getRouter(address) through @ston-fi/api, a thin TypeScript wrapper around the public API.
The staking SDK provides typed access to STON.fi staking contracts (StakeNftMinter and StakeNftItem). Use it to stake tokens and manage positions represented as NFTs, including unstaking, claiming rewards, re-staking, and burning stake NFTs.