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.
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
- pnpm
- Yarn
- Bun
npm install --save @ton/core @ton/ton @ton/crypto
pnpm add @ton/core @ton/ton @ton/crypto
yarn add @ton/core @ton/ton @ton/crypto
bun add @ton/core @ton/ton @ton/crypto
Install DeDust SDK
- npm
- pnpm
- Yarn
- Bun
npm install --save @dedust/sdk
pnpm add @dedust/sdk
yarn add @dedust/sdk
bun add @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.