Copperx Telegram Bot
  1. commands
Copperx Telegram Bot
  • index
  • readme
  • setup
  • development
  • api-integration
  • troubleshooting
  • architechture
  • callbacks
    • index (all callbacks)
    • wallet
    • transfer-callback
    • send
  • commands
    • help
    • index(all commands)
    • login
    • logout
    • start
    • transfer
    • transfer
  • notifications
    • deposite-notification
  • Register Telegram Webhook to your url
    POST
  1. commands

transfer

/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
KYC 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
View All Balances

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?
With buttons:
Deposit
Set as Default (if not default)
Back to Wallet List

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:
Authentication errors
KYC verification errors
API errors when fetching wallets
API errors when setting default wallet
Network errors

Related Files#

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
Previous
transfer
Next
deposite-notification
Built with