Interface NetworkApi

Network API

This module provides methods about the network itself

interface NetworkApi {
    getBlockchainStatus: (() => Promise<BlockchainStatus>);
    getMiningInfo: (() => Promise<MiningInfo>);
    getNetworkInfo: (() => Promise<NetworkInfo>);
    getPeer: ((address: string) => Promise<Peer>);
    getPeers: ((active?: boolean) => Promise<PeerAddressList>);
    getServerStatus: (() => Promise<ServerStatus>);
    getSuggestedFees: (() => Promise<SuggestedFees>);
    getTime: (() => Promise<ChainTimestamp>);
}

Properties

getBlockchainStatus: (() => Promise<BlockchainStatus>)

Get the blockchain status.

Type declaration

getMiningInfo: (() => Promise<MiningInfo>)

Get the mining information.

Type declaration

getNetworkInfo: (() => Promise<NetworkInfo>)

Get detailed information about the Networks constants/settings.

Type declaration

getPeer: ((address: string) => Promise<Peer>)

Get a peer by a given IP address

Type declaration

    • (address): Promise<Peer>
    • Parameters

      • address: string

        The peer's address

      Returns Promise<Peer>

      The Peer

getPeers: ((active?: boolean) => Promise<PeerAddressList>)

Get a list of peers

Type declaration

    • (active?): Promise<PeerAddressList>
    • Parameters

      • Optionalactive: boolean

        Only return active peers (default: true)

      Returns Promise<PeerAddressList>

      The Peer Address List

getServerStatus: (() => Promise<ServerStatus>)

Get the state of the server node and network. Note: This request is pretty slow and might needs several seconds until reply.

Type declaration

getSuggestedFees: (() => Promise<SuggestedFees>)

Get the current suggested fees

Type declaration

getTime: (() => Promise<ChainTimestamp>)

Get the current blockchain timestamp in seconds since Genesis Block

Type declaration