KardiaChain JS SDK
  • Overview
  • Getting Started
  • Guides
    • Connecting to KardiaChain
      • Front-end
      • Back-end
    • Working with wallet
    • Sending your first transaction
    • Smart Contract: decentralize application
    • KRC20 tokens
    • KAI Chain module
    • Utilities
  • Reference
    • KardiaClient
    • Account
    • Transaction
    • KAI Chain
    • Smart contract
    • KRC20
    • Objects reference
Powered by GitBook
On this page
  • constructor
  • Methods
  • getBalance
  • getNonce
  • Static method
  • static getWalletFromPK
  • static getWalletFromMnemonic
  • static generateWallet
  • static isAddress
  • static toChecksumAddress

Was this helpful?

  1. Reference

Account

PreviousKardiaClientNextTransaction

Last updated 3 years ago

Was this helpful?

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 .

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

Wallet's balance (default to 0). To get latest balance, use method.

Wallet's balance (default to 0). To get latest balance, use method.

Wallet's balance (default to 0). To get latest balance, use method.

getBalance
getBalance
getBalance
this utility function