Wallet Module
1.1 Create Wallet
create_walletfrom crypto_com_developer_platform_client import Wallet wallet = Wallet.create_wallet() print(wallet)
The address of the new wallet.ValueError: If the Wallet class is not initialized with a Client instance.{'status': 'Success', 'data': {'address': 'example-address', 'privateKey': 'example-private-key', 'mnemonic': 'example-mnemonic'}}
createimport { Wallet } from '@crypto.com/developer-platform-client'; try { const wallet = await Wallet.create(); console.log(wallet); } catch(err) { console.log(err); }
{Promise<ApiResponse<CreateWalletData>>}: A promise that resolves to the newly created wallet details.{Error}: Throws an error if the request fails.{ status: 'Success', data: { address: 'example-address', privateKey:'example-private-key', mnemonic: 'example-mnemonic' } }
1.2 Get Wallet Balance
get_balancewallet_address (str): The address to get the balance for (CronosIds with the `.cro` suffix are supported, e.g. `xyz.cro`)from crypto_com_developer_platform_client import Wallet balance = Wallet.get_balance('example-wallet') print(balance)
The balance of the wallet.ValueError: If the Wallet class is not initialized with a Client instance.{'status': 'Success', 'data': {'balance': 'example-balance'}}
balance{string} walletAddress: The wallet address to fetch the balance for (CronosIds with the `.cro` suffix are supported, e.g. `XXX.cro`)import { Wallet } from '@crypto.com/developer-platform-client'; try { const balance = await Wallet.balance('example-wallet'); console.log(balance); } catch(err) { console.log(err); }
{Promise<ApiResponse<Balance>>}: A promise that resolves to the balance of the wallet.{Error}: Throws an error if the request fails.{ status: 'Success', data: { balance: 'example-balance' } }
Last updated
Was this helpful?