LogoLogo
ston.fi/docs
ston.fi/docs
  • User section
    • About
    • STON.fi Protocol
    • Fees
    • Glossary
    • Procedure for Adding Tokens to the Default List
    • Whitepaper
  • Developer section
    • Architecture
    • SDK
      • DEX v1 guide
        • reference
        • swap
        • provide liquidity
        • refund liquidity
        • burn liquidity tokens
      • DEX v2 guide
        • swap
        • provide liquidity
        • refund liquidity
        • burn liquidity tokens
        • withdraw fee from vault
      • Farm guide
        • stake in farm
        • claim farm rewards
        • unstake from farm
        • destroy farm NFT
      • Transaction sending guide
        • via ton
        • via tonweb
        • via tonconnect
      • v0.5 > v1.0.0 migration guide
      • v0.5 (deprecated)
        • DEX guide
          • swap
          • provide liquidity
          • refund liquidity
          • burn liquidity tokens
        • Farm guide
          • stake in farm
          • claim farm rewards
          • unstake from farm
          • destroy farm NFT
        • Transaction sending guide
          • via ton
          • via tonweb
          • via tonconnect
      • v0.4 > v0.5 migration guide
      • v0.4 (deprecated)
        • perform a swap operation
        • provide liquidity
        • refund liquidity
        • burn liquidity tokens
        • using get methods
        • create a custom router revision
    • API reference v1
      • Router
      • Pool
      • LpAccount
      • LpWallet
    • API reference v2
      • Router
      • Pool
      • LpAccount
      • LpWallet
      • Vault
      • Swap examples
      • LpProvide examples
      • Vault examples
      • Op Codes
    • DEX API
    • OMNISTON
      • Resolvers (How to become a resolver)
      • Swap overview
      • Swap extra
      • Swap grpc
      • React
      • Nodejs
      • Referral fees
    • Quickstart Guides
      • Swap Guide
      • Omniston Guide
  • Help
    • Contact Us
Powered by GitBook
On this page
  • Getting Started
  • Installation
  • Installation of release candidate version
  • Usage
  • Live demo
Export as PDF
  1. Developer section

SDK

This section contains information about SDK for STON.fi protocol

PreviousArchitectureNextDEX v1 guide

Last updated 24 days ago

Welcome to the 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 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 with a rate limit of 1 request per second. You can obtain higher limits by:

  • requesting an API key from with a 10 request per minute limit

  • use open TON API instance, for example, from

  • found a paid instance of TON API with suitable rate limits for your case

  • selfhost an instance of TON API

Installation

Then, add SDK package using the package manager of your choice.

npm install @ston-fi/sdk
yarn add @ston-fi/sdk
pnpm install @ston-fi/sdk

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.

npm install @ston-fi/sdk@latest
yarn add @ston-fi/sdk@latest
pnpm install @ston-fi/sdk@latest

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

Firstly install the package following their

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 . Try this app at

STON.fi
SDK
SDK source code
SDK on NPM
@ton
uses toncenter API
toncenter
ORBS
@ton/ton
installation guide
DEX
Farm
here
sdk-demo-app.ston.fi