SDK
This section contains information about SDK for STON.fi protocol
Welcome to the STON.fi SDK docs section.
Getting Started
Overview
The SDK is written in TypeScript and designed to be a thin wrapper on top of the STON.fi contracts, which will help STON.fi protocol to be used more easily in JS/TS projects
The SDK reflects the structure of contracts so that access to contract methods is possible through the use of the corresponding class from the SDK.
@ton package
SDK is built based on the @ton package, which provides primitives for working with data on the TON blockchain, as well as bare contract instances that our SDK expands with unique contract methods
The @ton library allows you to make on-chain requests and for that uses toncenter API with a rate limit of 1 request per second. You can obtain higher limits by:
requesting an API key from toncenter with a 10 request per minute limit
use open TON API instance, for example, from ORBS
found a paid instance of TON API with suitable rate limits for your case
selfhost an instance of TON API
Installation
Firstly install the @ton/ton package following their installation guide
Then, add SDK package using the package manager of your choice.
Installation of release candidate version
Sometimes, we publish a release candidate version of the SDK package to give you early access to the next version. To install this version, you need to expressly specify that you are interested in the next version during the installation.
Usage
We recommend you check the documentation sections dedicated to the architecture of contracts and their methods to get more context about STON.fi protocol in general before starting to interact with the contracts via the SDK
The remaining sections of the documentation will demonstrate specific examples of the SDK usage:
Live demo
We are providing a simple but fully functional demo app with the SDK usage in the next.js app to demonstrate the SDK functionality. The source code is open-sourced and can be found here. Try this app at sdk-demo-app.ston.fi
Last updated