This API reference provides detailed information about interacting with the ONTON Finance platform, which leverages the TON blockchain to offer a revolutionary DeFi trading experience.

Welcome to ONTON Finance

ONTON Finance is your gateway to decentralized finance, harnessing the unique advantages of the TON blockchain to provide an unparalleled trading experience. With ONTON, you can enjoy the lowest fees, tight spreads, and a streamlined user experience.

ONTON Finance SDK

Explore the ONTON Finance SDK on GitHub

Getting Started

To start building with the ONTON Finance SDK, follow these steps:

  1. Install the SDK:
npm install onton-sdk
  1. Import the SDK in your project:
import { OntonSDK } from 'onton-sdk';
  1. Create an instance of the OntonSDK with your private key:
const onton = new OntonSDK({
  privateKey: 'YOUR_PRIVATE_KEY'
});

Now you’re ready to interact with the ONTON Finance platform!

Authentication

Authentication is handled through the OntonSDK instance, which requires your private key during initialization. All API endpoints are authenticated using this SDK instance.

Example Usage

Here’s an example of how to use the ONTON Finance SDK to perform common actions:

import { OntonSDK } from 'onton-sdk';

// Create an instance of OntonSDK with the provided private key
const onton = new OntonSDK({
    privateKey: 'PRIVATE_KEY'
});

export async function performActions() {
    // Get and log the RFQ price between USDT and ONTON
    console.log(await onton.getRfqPrice('USDT', 'ONTON'));

    // Perform a token swap from USDT to ONTON with an amount of 100
    console.log(await onton.swap('USDT', 'ONTON', 100));

    // Add liquidity to the USDT-ONTON pool with 500 of each token
    console.log(await onton.addLiquidity('USDT', 'ONTON', 500, 500));
}