Initialize SDK

You have 4 ways to create sdk service.

Way 1

Only tell sdk network, and using default node url according to network.

import { Network, TurbosSdk } from 'turbos-clmm-sdk';

export const sdk = new TurbosSdk(Network.mainnet);

Way 2

Customize your own node url

import { Network, TurbosSdk } from 'turbos-clmm-sdk';

export const sdk = new TurbosSdk(Network.mainnet, {
  url: 'https://your_full_node_url.com',
});

Way 3

Customize your own transport

import { Network, TurbosSdk } from 'turbos-clmm-sdk';

export const sdk = new TurbosSdk(Network.mainnet, {
  transport: {
    async request(input) { ... },
    async subscript(input) { ... }
  },
});

Way 4

Provide a client instance explicitly

import { Network, TurbosSdk } from 'turbos-clmm-sdk';
import { SuiClient, SuiClientOptions, getFullnodeUrl } from '@mysten/sui/client';

const sui = new SuiClient({ ... });

export const sdk = new TurbosSdk(Network.mainnet, sui);

Last updated