π 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).
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
π What Does This Mean for Existing Integrations?
If you are migrating your existing integration to the upgraded infrastructure, use this guide to update your endpoints, identifiers, wallet provisioning, and webhook event handlers.π€ 1. Users Infrastructure (Zero-Friction User Migration)
- No User Re-creation Needed: You do not need to re-create users for your existing customers.
- Reused Identifiers: All existing sub-wallets created via the API have been migrated automatically. Your previous
subWalletIdnow acts directly as the newuserId. - What to Change: Update the base URL endpoint in your requestsβyour existing sub-wallet IDs continue to work seamlessly without additional mapping.
π 2. Address & Wallet Management
In the updated model, a user utilizes a single wallet container across supported assets, requiring you to provision chain-specific wallet addresses using the updated wallet creation endpoint.- Provisioning Wallets: Call the new wallet creation endpoint per supported chain:
accountId: Retrieve your Account ID by completing the workspace setup via the Accounts & Workspace Console.userId: Pass your existingsubWalletIddirectly into this field.- EVM Address Consistency: To ensure a user shares the exact same blockchain address across all EVM-compatible chains, pass the same
refIdstring for every EVM chain provisioning request. - Wallet-Level Auto-Sweep: Auto-sweep capabilities are now configured directly at the individual wallet level. Set
"autoSweep": trueif you want automatic fund sweeps enabled for that specific wallet.
πΈ 3. Transactions
- Endpoint Updates: Update all payment, deposit, and withdrawal endpoints to the new transaction URL paths.
- Idempotency Headers/Fields: Pass standard idempotency keys on state-changing transaction endpoints to ensure safe retry logic.
π 4. Webhook Event Consumption
Refer to the complete Webhook Event Documentation for the updated topic structure and full payload schema reference.- Update Event Names: Update your webhook listeners to match the new topic identifiers (e.g., replace legacy topics with
wallets:deposit.success,wallets:withdraw.success,wallets:swap.success). - Update Payload Parsing: Modify your application code to handle the updated event payload schema (e.g., parsing
params.amount.value,params.amount.rawValue, and structuredparams.walletobjects).
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)