Account

constructor

Params

Name

Type

Required

Description

client

Client

RPC client that will be used to interact with KardiaChain

Return

Return an Account instance .

Methods

getBalance

Params

Name

Type

Required

Description

address

string

Required

Wallet's address to get balance

options

BlockQuery

Block options to get balance. Will get from latest block if omitted

options.blockHash

string

Block hash to get balance

options.blockHeight

number

Block height to get balance

Return

Balance in HYDRO. To convert to KAI, use this utility function.

getNonce

Params

Name

Type

Required

Description

address

string

Required

Wallet's address to get nonce

Return

Latest nonce (used for new transaction)

Static method

static getWalletFromPK

Params

Name

Type

Required

Description

privateKey

string

Required

Private key to access wallet

Return

New wallet object

Name

Type

Description

address

string

Wallet's address

privateKey

string

Wallet's private key

mnemonic

object

mnemonic.phrase

string

Wallet's mnemonic phrase

mnemonic.path

string

HD path

mnemonic.locale

string

Mnemonic phrase's locale

balance

number

static getWalletFromMnemonic

Params

Name

Type

Required

Description

mnemonic

string

Required

Mnemonic phrase to access wallet

Return

New wallet object

Name

Type

Description

address

string

Wallet's address

privateKey

string

Wallet's private key

balance

number

static generateWallet

Params

None

Return

New wallet object

Name

Type

Description

address

string

Wallet's address

privateKey

string

Wallet's private key

balance

number

static isAddress

Params

Name

Type

Required

Description

address

string

Required

String to check

Return

Return true if is address, otherwise false

static toChecksumAddress

Params

Name

Type

Required

Description

address

string

Required

String to check

Return

Checksum version of original address

Last updated