Skip to content

@liquality.bitcoin ledger.<internal>.ChainProvider

Krasimir Raykov edited this page Mar 30, 2022 · 2 revisions

Interface: ChainProvider

@liquality/bitcoin-ledger..ChainProvider

Implemented by

Table of contents

Methods

Methods

getBalance

getBalance(addresses, assets): Promise<BigNumber[]>

Get the balance of an account given its addresses.

Parameters

Name Type Description
addresses AddressType[] A list of addresses.
assets Asset[] -

Returns

Promise<BigNumber[]>

If addresses is given, returns the cumulative balance of the given addresses. Otherwise returns the balance of the addresses that the signing provider controls. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Chain.d.ts:56


getBlockByHash

getBlockByHash(blockHash, includeTx?): Promise<Block<any, any>>

Get a block given its hash.

Parameters

Name Type Description
blockHash string A hexadecimal string that represents the hash of the desired block.
includeTx? boolean -

Returns

Promise<Block<any, any>>

Resolves with a Block with the same hash as the given input. If includeTx is true, the transaction property is an array of Transactions; otherwise, it is a list of transaction hashes. Rejects with TypeError if input is invalid. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Chain.d.ts:18


getBlockByNumber

getBlockByNumber(blockNumber, includeTx?): Promise<Block<any, any>>

Get a block given its number.

Parameters

Name Type Description
blockNumber number The number of the desired block.
includeTx? boolean -

Returns

Promise<Block<any, any>>

Resolves with a Block with the same number as the given input. If includeTx is true, the transaction property is an array of Transactions; otherwise, it is a list of transaction hashes. Rejects with TypeError if input is invalid. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Chain.d.ts:30


getBlockHeight

getBlockHeight(): Promise<number>

Get current block height of the chain.

Returns

Promise<number>

Resolves with chain height. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Chain.d.ts:37


getTransactionByHash

getTransactionByHash(txHash): Promise<Transaction<any>>

Get a transaction given its hash.

Parameters

Name Type Description
txHash string A hexadecimal string that represents the hash of the desired transaction.

Returns

Promise<Transaction<any>>

Resolves with a Transaction with the same hash as the given input. Rejects with TypeError if input is invalid. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Chain.d.ts:47

Clone this wiki locally