Torch DEX
WebsiteSwap
  • Overview
  • Terms of Use
  • Getting Started
    • Introduction
    • Challenges on TON
    • Solution for TON
    • Architecture
      • Concept
      • Core Components
        • Factory
        • Vault
        • Pool
        • LP Account
        • Oracle
      • Comparison
      • Interoperability
      • Meesage Flows
        • Deposit
        • Swap
        • Withdraw
        • Cross-Pool Operations
  • Developer Guide
    • DEX SDK Guide
      • Setup
      • Perform Swap
      • Deposit Liquidity
      • Withdraw Liquidity
      • How to send transaction
        • Mnemonic (Node JS)
        • TonConnect (React)
      • Deployments
  • USER Guide
    • Getting Started
  • Protocol
    • Audits
    • Tokenomics
  • Other
    • Brand Kit
    • Contacts
    • Achievements
  • FAQ
    • How to get Transaction hash by Message hash
    • React (Vite) - Buffer Issues
Powered by GitBook
On this page
  • Installation
  • Initialize (Mainnet)
  • Initialize (Testnet / Custom Network)
  • Configuration
  1. Developer Guide
  2. DEX SDK Guide

Setup

Installation

yarn add @torch-finance/sdk @ton/ton @ton/crypto @ton/core

Initialize (Mainnet)

import { TorchSDK } from '@torch-finance/sdk';
const sdk = new TorchSDK();

Initialize (Testnet / Custom Network)

import { TonClient4 } from '@ton/ton';
import { TorchSDK, TorchSDKOptions } from '@torch-finance/sdk';

const tonClient = new TonClient4({ endpoint: "https://testnet-v4.tonhubapi.com/" });
const factoryAddress = Address.parse("testnet factory address")
const testnetOracle = "https://testnet-oracle.torch.finance"
const testnetAPI = "https://testnet-api.torch.finance"
const config: TorchSDKOptions = {
    tonClient: tonClient,
    factoryAddress: factoryAddress,
    oracleEndpoint: testnetOracle,
    apiEndpoint: testnetAPI,
  };
const sdk = new TorchSDK(config)

Configuration

  • Factory Address

Network
Factory Address

Mainnet

EQDQIhFLSzUlaHKM9L2ZQS-o0iNHTbOSBtzNC0VLxPbNFH6E

Testnet

EQCNvyhu-VxeL7i-Uk5Uu0m7TO0qQaWQlHmGOUyUh1hoF7au

  • Indexer Endpoint

Network
Indexer Endpoint

Mainnet

Testnet

  • Oracle Endpoint

Network
Oracle Endpoint

Mainnet

Testnet

PreviousDEX SDK GuideNextPerform Swap

Last updated 2 months ago

https://indexer.torch.finance/
https://testnet-indexer.torch.finance/
https://oracle.torch.finance
https://testnet-oracle.torch.finance