SDK Initialization
Configure and initialize the Ferra DLMM SDK for your application.
Basic Setup
import { initFerraDlmmSDK } from '@ferra-labs/dlmm'
const sdk = initFerraDlmmSDK({
network: 'mainnet',
fullNodeUrl: 'https://fullnode.mainnet.sui.io:443',
wallet: '0x...' // Your wallet address
})Configuration Options
Required Parameters
Parameter
Type
Description
network
'mainnet' | 'testnet'
Target network
fullNodeUrl
string
Sui RPC endpoint URL
senderAddress
string
Default sender for transactions
Network Configurations
Mainnet
const sdk = initFerraDlmmSDK({
network: 'mainnet',
fullNodeUrl: 'https://fullnode.mainnet.sui.io:443',
wallet: '0x...'
})Testnet
const sdk = initFerraDlmmSDK({
network: 'testnet',
fullNodeUrl: 'https://fullnode.testnet.sui.io:443',
wallet: '0x...'
})Custom RPC
const sdk = initFerraDlmmSDK({
network: 'mainnet',
fullNodeUrl: 'https://your-custom-rpc.com',
wallet: '0x...'
})Error Handling
try {
const sdk = initFerraDlmmSDK({
network: 'mainnet',
fullNodeUrl: 'invalid-url',
wallet: '0x...'
})
} catch (error) {
if (error.message.includes('Invalid RPC')) {
console.error('Please check your RPC URL')
}
}Best Practices
Single Instance: Create one SDK instance per app
Error Handling: Always wrap initialization in try-catch
Network Matching: Ensure wallet and SDK use same network
RPC Selection: Use reliable RPC providers for production
Address Validation: Validate sender address format
Next Steps
SDK initialized! Continue to:
Key Concepts - Understand DLMM fundamentals
Create Pair - Deploy a trading pair
Get All Pairs - Explore existing pairs
Last updated