Prerequisites

1. NPM install

npm install @cetusprotocol/aggregator-sdk@0.2.0

2. Setting Up Configuration

  1. Initialize mainnet Aggregator client.

Example

// used to do simulate swap and swap
// https://fullnode.mainnet.sui.io:443
const fullNodeURL = process.env.SUI_RPC!

const suiClient = new SuiClient({
    url: fullNodeURL,
})

// provider by cetus
const aggregatorURL = "https://api-sui.cetus.zone/router_v2"

// set your wallet address, used to do simulate
const wallet = "0x..."

// import { Env } from "@cetusprotocol/aggregator-sdk"
// Currently, we provide full support for Mainnet, 
// while Testnet is only supported for Cetus and DeepBook providers.
const client = new AggregatorClient(aggregatorURL, wallet, sui.Client, Env.Mainnet)

Last updated