Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • HancockEthereumWalletService

Index

Constructors

Methods

Constructors

constructor

Methods

generate

  • Generates a new wallet

    Returns EthereumWallet

    address, publicKey, and privateKey of the new wallet

getBalance

  • getBalance(address: string): Promise<BigNumber>
  • Retrieves the ethers balance of an account

    Parameters

    • address: string

      The token owner's address

    Returns Promise<BigNumber>

    The account balance (in weis)

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc