Skip to content

Wallet Overview & Multi-Currency

The Wallet module handles all financial data for the user. It supports Multi-Currency Wallets, meaning a single user can hold balances in multiple currencies simultaneously (e.g., a USD wallet and a EUR wallet).

All wallet methods require a valid, authenticated session. If the user's session expires, the SDK will automatically attempt a silent token refresh before retrying the request.

Fetching User Wallets

Instead of a single balance, the SDK returns an array of wallets. Each wallet tracks realBalance and bonusBalance separately.

javascript
const wallets = await sdk.wallet.getWallets();

wallets.forEach(wallet => {
  console.log(`${wallet.currency} Wallet:`);
  console.log(`  Real Cash: ${wallet.realBalance}`);
  console.log(`  Bonus Funds: ${wallet.bonusBalance}`);
  console.log(`  Status: ${wallet.status}`);
  
  if (wallet.isDefault) {
    console.log('  (This is the primary wallet)');
  }
});

Wallet Interface

typescript
interface Wallet {
  id: string;
  currency: string;       // e.g., 'USD', 'EUR', 'BTC'
  isDefault: boolean;
  realBalance: number;     // Deposited cash (withdrawable)
  bonusBalance: number;    // Promotional funds (usually non-withdrawable)
  status: 'ACTIVE' | 'FROZEN' | 'CLOSED';
}

Important Notes

  • Wallet ID: Every action (deposit, withdraw, view transactions) requires a walletId. You must prompt the user to select a wallet if they have multiple.
  • Frozen Wallets: If a wallet status is FROZEN (e.g., during a bonus wagering requirement), the SDK will reject withdrawal attempts for that wallet.