Migration
Using SDK Config and Constants
import {
ICON_MAINNET_CHAIN_ID,
SONIC_MAINNET_CHAIN_ID,
type HubChainId,
type SpokeChainId
} from "@sodax/sdk"
// Supported migration chains
const hubChainId: HubChainId = SONIC_MAINNET_CHAIN_ID;
const iconChainId: SpokeChainId = ICON_MAINNET_CHAIN_ID;
// Migration tokens
const migrationTokens = ['ICX', 'bnUSD', 'BALN'] as const;Initialising Providers
Migration Types
Common Operations
Check Allowance
Approve Tokens
Stellar Trustline Requirements
ICX Migration (ICX/wICX → SODA)
Migrate ICX to SODA
Reverse ICX Migration (SODA → wICX)
Revert SODA to ICX
bnUSD Migration (Legacy ↔ New bnUSD)
bnUSD Constants and Helper Functions
Migrate Legacy bnUSD to New bnUSD
Reverse Migrate New bnUSD to Legacy bnUSD
BALN Migration (BALN → SODA)
Migrate BALN to SODA
Complete Examples
ICX Migration Example
Reverse ICX Migration Example
bnUSD Migration Example
BALN Migration Example
Error Handling
Configuration
Last updated