🏗 Summary of Changes
Account Architecture Overview
In v1, the architecture relied on a Prime Wallet and Sub-Wallet model (1:N), where a single central Prime Wallet managed liquidity and treasury operations across multiple sub-wallets. In v2, infrastructure hierarchy transitions to an Accounts container model:- Account-Based Isolation: You can create an account specifically for your application or business unit. All wallets generated can be attached directly to that account.
- Fund & Access Control Segregation: This structure ensures complete separation of funds, permissions, policies, and operational controls at both the Account and Wallet levels.
- Settlement Account: Serves as the primary operational or treasury container for managing enterprise funds, sweeps, and global balances.
- Users Account: Acts as an isolated container assigned to individual end-users to manage dedicated smart wallet instances and balances.
Base URL Updates
Update your base request URL across all API client configurations:- v1 Base URL:
[https://api.openxswitch.com/v1] - v2 Base URL:
[https://api.openxswitch.com/v2]
Step-by-Step Migration Walkthrough
Step 1: User Onboarding (sub-wallet ➔ users)
In v1, user identities were represented as sub-wallet records. In v2, this primitive is renamed to users. Existing sub-wallet IDs are maintained throughout the migration.
🔄 Action: Create Sub-Wallet ➔ Create User
- v1 :
POST /v1/sub-wallet/create - v2:
POST /v2/users
Request Changes
ReplaceclientUserId with refId, rename name to displayName, and drop canTrade.
v1 (POST /v1/sub-wallet/create):
POST /v2/users):
📘 Migration Note Existing sub-wallets maintain their original identifiers during migration. To retrieve or update migrated records, replace/v1/sub-wallet?subWalletId={id}with/v2/users?userId={id}in your endpoints.
Step 2: Blockchain Wallets & Addresses (sub-wallet/address ➔ wallets)
In v1, distinct addresses had to be generated per token and network. In v2, a single wallet address handles deposits across all supported tokens on a given network protocol.
🔄 Action: Generate Deposit Address ➔ Create Smart Wallet
- v1:
POST /v1/sub-wallet/address - v2:
POST /v2/wallets
Request Changes
PassuserId and accountId directly in the payload, provide an idempotencyKey, and designate the specific target blockchain network string (e.g., ethereum-mainnet).
v1 (POST /v1/sub-wallet/address):
POST /v2/wallets):
Step 3: Checking Balances (sub-wallet/assets ➔ users/balances)
🔄 Action: Get Sub-Wallet Assets ➔ Get User Balances
- v1 :
GET /v1/sub-wallet/assets?subWalletId={id} - v2 :
GET /v2/users/balances?userId={id}
Response Comparison
v2 provides comprehensive token metadata (standards, contract addresses, raw/formatted amounts) instead of single-string outputs.⚠️ Deprecation Notice: Internal Off-Chain Transfers Off-chain free internal transfers available in v1 are deprecated. In v2, all asset movements are executed transparently on-chain.
Step 4: Outbound Transactions (withdraw/create ➔ transactions/withdraw)
🔄 Action: Create Sub-Wallet Withdrawal ➔ Execute Withdrawal Transaction
- v1:
POST /v1/withdraw/create - v2:
POST /v2/transactions/withdraw
Request Changes
PasswalletId instead of subWalletId, supply toAddress instead of withdrawalAddress, and include an idempotencyKey.
🔄 Action: Fetch Transaction History
Transaction lookup endpoints have been unified under a consolidated GET /v2/transactions resource with filtering options:
- Fetch Deposits:
- v1:
GET /v1/sub-wallet/deposit - v2:
GET /v2/transactions?txType=incoming
- v1:
- Fetch Withdrawals:
- v1:
GET /v1/sub-wallet/withdraw - v2:
GET /v2/transactions?txType=outgoing
- v1:
Step 5: Instant Swaps (instant-swap ➔ swap)
🔄 Action: Execute Instant Swap ➔ Create Swap Transaction
- v1:
POST /v1/instant-swap - v2:
POST /v2/swap
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)