We can use this interface to do operations related with blockchain wallets
const hancockEthClient = new HancockEthereumClient(config); const wallet = hancockEthClient.wallet.generate(); console.log(wallet);
Console output:
{ privateKey: '0xd06026d5b8664036bdec0a924b8c7360566e678a2291e9440156365b040a7b83'; publicKey: '0x274b9c789c110632d54a3a81bf177f8b94450c217d094b693c89557ff99b97d8'; address: '0x34C54CB0d5cD1c0f5240324618adAD15ad6646AF'; }
const hancockEthClient = new HancockEthereumClient(config); const balance = await hancockEthClient.wallet.getBalance('0x34C54CB0d5cD1c0f5240324618adAD15ad6646AF'); console.log(balance);
# Balance is given in weis 1000000000000000000
Generates a new wallet
address, publicKey, and privateKey of the new wallet
Retrieves the ethers balance of an account
The token owner's address
The account balance (in weis)
Generated using TypeDoc
HancockEthereumWalletService
Introduction
We can use this interface to do operations related with blockchain wallets
Generate new wallet
const hancockEthClient = new HancockEthereumClient(config); const wallet = hancockEthClient.wallet.generate(); console.log(wallet);
Console output:
{ privateKey: '0xd06026d5b8664036bdec0a924b8c7360566e678a2291e9440156365b040a7b83'; publicKey: '0x274b9c789c110632d54a3a81bf177f8b94450c217d094b693c89557ff99b97d8'; address: '0x34C54CB0d5cD1c0f5240324618adAD15ad6646AF'; }
Consult wallet balance
const hancockEthClient = new HancockEthereumClient(config); const balance = await hancockEthClient.wallet.getBalance('0x34C54CB0d5cD1c0f5240324618adAD15ad6646AF'); console.log(balance);
Console output:
# Balance is given in weis 1000000000000000000