Skip to main content

DeDust V2 SDK

The DeDust SDK is a toolkit designed for TypeScript / JavaScript, allowing seamless interaction with the DeDust Protocol. It covers contract actions, calculations, the DeDust API client, and more.

image

Some features of the SDK can be accessed via the DeDust API for developers not using TypeScript. Refer to the Technical Reference for further details.

Install prerequisites

npm install --save @ton/core @ton/ton @ton/crypto

Install DeDust SDK

npm install --save @dedust/sdk

Initialize DeDust SDK

TypeScript
import { Factory, MAINNET_FACTORY_ADDR } from '@dedust/sdk';
import { Address, TonClient4 } from "@ton/ton";

const tonClient = new TonClient4({ endpoint: "https://mainnet-v4.tonhubapi.com" });
const factory = tonClient.open(Factory.createFromAddress(MAINNET_FACTORY_ADDR));
note

The Factory contract serves as a hub to locate other contracts.