Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BlockchainConnection

A high-level interface to a blockchain node, abstracted over all blockchain types and communication channel. A direct connection or a proxy server should implement this. The implementation takes care to convert our internal types into the proper format for the blockchain.

BlockchainConnection is the minimal interface needed to be supported by any blockchain that is compatible with the BCP spec and IOV-Core library. This supports getting account balances, sending tokens, and observing the blockchain state.

There are other optional interfaces that extend this functionality with features like atomic swap, NFTs, etc which may be implemented by any connector to enable enhanced features in the clients.

Hierarchy

Index

Properties

chainId

chainId: function

Type declaration

disconnect

disconnect: function

Type declaration

    • (): void
    • Returns void

getAccount

getAccount: function

Get the current account information (e.g. balance)

If an account is not found on the blockchain, this returns undefined.

Type declaration

getAllTokens

getAllTokens: function

Type declaration

    • (): Promise<keyof Token[]>
    • Returns Promise<keyof Token[]>

getBlockHeader

getBlockHeader: function

Type declaration

getFeeQuote

getFeeQuote: function

Type declaration

getNonce

getNonce: function

Get a nonce for the next transaction signature.

Implementation defines a default value if blockchain does not provide a nonce.

Type declaration

getNonces

getNonces: function

Get multiple nonces at once to sign multiple transactions

This avoids querying the blockchain for every nonce and removes the need to wait for blocks before getting updated nonces.

Type declaration

getToken

getToken: function

Type declaration

getTx

getTx: function

height

height: function

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

listenTx

listenTx: function

Subscribes to all newly added transactions that match the query

liveTx

liveTx: function

Returns a stream for all historical transactions that match the query, along with all new transactions arriving from listenTx

postTx

postTx: function

Type declaration

searchTx

searchTx: function

Type declaration

    • (query: TransactionQuery): Promise<keyof (FailedTransaction | ConfirmedTransaction<LightTransaction>)[]>
    • Parameters

      Returns Promise<keyof (FailedTransaction | ConfirmedTransaction<LightTransaction>)[]>

watchAccount

watchAccount: function

Type declaration

watchBlockHeaders

watchBlockHeaders: function

Type declaration

withDefaultFee

withDefaultFee: function

Type declaration

    • <T>(tx: T): Promise<T>

Generated using TypeDoc