/wallet Command#
The /wallet command provides access to all wallet management features, allowing users to view balances, create wallets, set default wallets, and generate deposit addresses.Command Overview#
Purpose: Manage cryptocurrency wallets
Authentication Required: Yes
Implementation File: src/bot/handlers/wallet.handler.ts
Features#
The wallet command provides the following functionality:1.
View Wallet List: Display all wallets across different networks
2.
View Wallet Details: Show balance and details of a specific wallet
3.
View All Balances: Display balances across all wallets
4.
Set Default Wallet: Set a specific wallet as the default for transactions
5.
Generate Deposit Address: Display a wallet address for receiving funds
6.
Create New Wallet: Create a new wallet on a supported network
Wallet Flows#
Main Wallet Flow#
/wallet → View Wallet List → Select Wallet → View Wallet Details →
↓
Set as Default or View Deposit Address
Create Wallet Flow#
/wallet → View Wallet List → Create a Wallet → Select Network → Wallet Created
Response Examples#
Wallet List#
🏦 Your CopperX Wallets
Select a wallet to set as Default and view its details:
With buttons for each wallet:ethereum - web3_auth_copperx (Default)
polygon - web3_auth_copperx
Wallet Details#
💼 Wallet Details
Network: ethereum
Wallet ID: 12345abcde
Address: 0x1234...5678
Balance: 100.50 USDT
✅ Default Wallet
What would you like to do with this wallet?
Set as Default (if not default)
All Balances#
💰 Your Wallet Balances
Network: ethereum
Balance: 100.50 USDT
Address: 0x1234...5678
Network: polygon
Balance: 25.75 MATIC
Address: 0xabcd...efgh
Deposit Instructions#
📥 Deposit to your ethereum wallet
Send funds to this address:
0x1234567890abcdef1234567890abcdef12345678
Only send ethereum network tokens to this address. Sending other tokens may result in permanent loss.
Implementation Details#
Wallet Command Handler#
Display Wallet List#
Wallet Service Integration#
The wallet command integrates with the WalletService to perform operations:Callback Handlers#
The wallet feature uses various callback handlers for different operations:Wallet Details Callback#
Set Default Wallet Callback#
Deposit Callback#
Wallet Data Structures#
The wallet feature uses these key data structures:Error Handling#
The wallet command handles various error scenarios:API errors when fetching wallets
API errors when setting default wallet
src/bot/messages/wallet.messages.ts - Contains wallet message templates
src/services/wallet.service.ts - Service for wallet operations
src/utils/copperxApi/copperxApi.wallet.ts - API client for wallet operations
src/types/wallet.types.ts - Wallet data type definitions
Best Practices#
Always show clear instructions for deposits, especially regarding network compatibility
Provide a way to easily set and identify the default wallet
Display wallet addresses in a copyable format with <code> tags
Show confirmation messages after actions like setting a default wallet
Always include a way to navigate back to the wallet list
Modified at 2025-03-23 17:08:20