@cetusprotocol/sui-clmm-sdk
Introduction
Cetus-CLMM-SUI-SDK is the official software development kit (SDK) specifically designed for seamless integration with Cetus-CLMM. It provides developers with the necessary tools and resources to easily connect and interact with Cetus-CLMM, enabling the development of robust and efficient applications.
Getting Started
To integrate our SDK into your local project, please follow the example steps provided below. Please see details in document.
Prerequisites
npm i @cetusprotocol/sui-clmm-sdk
SDK Initialization
The SDK provides a convenient initialization method src/config/initCetusSDK
for quick setup and configuration of the Cetus SDK.
Network Options
mainnet
(Production Network)testnet
(Test Network)
Important Note
Before performing swaps or other asset-related operations, ensure:
A wallet is properly configured
The wallet has sufficient token balance for the intended operation
import { CetusClmmSDK } from '@cetusprotocol/sui-clmm-sdk'
If you would like to use the mainnet network and the official Sui rpc url, you can do so as follows:
const sdk = CetusClmmSDK.createSDK()
If you wish to set your own full node URL or network (You have the option to select either 'mainnet' or 'testnet' for the network), you can do so as follows:
const env = 'mainnet'
const full_rpc_url = 'YOUR_FULL_NODE_URL'
const wallet = 'YOUR_WALLET_ADDRESS'
const sdk = CetusClmmSDK.createSDK({ env })
If you wish to set your own full node URL or SuiClient, you can do so as follows:
const sdk = CetusClmmSDK.createSDK({ env, sui_client })
//or
const sdk = CetusClmmSDK.createSDK({ env, full_rpc_url })
After linking your wallet, if you need use your wallet address to do something, you should set it by CetusClmmSDK.setSenderAddress("YOUR_SUI_ADDRESS_HERE")
const wallet = 'YOUR_WALLET_ADDRESS'
sdk.setSenderAddress(wallet)
Now, you can start using Cetus SDK.
Last updated