Hierarchy

  • {
        $host: string;
        intAsString?: boolean;
        getAccountByPubkey(...args) => Promise<{
            authFun?: string;
            balance: bigint;
            contractId?: string;
            id: string;
            kind?: AccountKind;
            nonce: number;
            payable?: boolean;
        }>;
        getAccountByPubkeyAndHash(...args) => Promise<{
            authFun?: string;
            balance: bigint;
            contractId?: string;
            id: string;
            kind?: AccountKind;
            nonce: number;
            payable?: boolean;
        }>;
        getAccountByPubkeyAndHeight(...args) => Promise<{
            authFun?: string;
            balance: bigint;
            contractId?: string;
            id: string;
            kind?: AccountKind;
            nonce: number;
            payable?: boolean;
        }>;
        getAccountNextNonce(...args) => Promise<{
            nextNonce: number;
        }>;
        getChainEnds(...args) => Promise<{
            body: string[];
        }>;
        getChannelByPubkey(...args) => Promise<{
            channelAmount: bigint;
            channelReserve: bigint;
            delegateIds: { initiator?: string[] | undefined; responder?: string[] | undefined; };
            id: string;
            initiatorAmount: bigint;
            initiatorId: string;
            lockPeriod: string;
            lockedUntil: string;
            responderAmount: bigint;
            responderId: string;
            round: number;
            soloRound: string;
            stateHash: string;
        }>;
        getContract(...args) => Promise<{
            abiVersion: string;
            active: boolean;
            deposit: bigint;
            id: string;
            ownerId: string;
            referrerIds: string[];
            vmVersion: string;
        }>;
        getContractCode(...args) => Promise<{
            bytecode: `cb_${string}`;
        }>;
        getContractPoI(...args) => Promise<{
            poi: string;
        }>;
        getCurrentGeneration(...args) => Promise<{
            keyBlock: { hash: string; height: number; prevHash: string; prevKeyHash: string; stateHash: string; miner: string; beneficiary: string; target: string; pow?: string[] | undefined; nonce?: number | undefined; time: number; version: number; info: string; };
            microBlocks: string[];
        }>;
        getCurrentKeyBlock(...args) => Promise<{
            beneficiary: string;
            hash: string;
            height: number;
            info: string;
            miner: string;
            nonce?: number;
            pow?: string[];
            prevHash: string;
            prevKeyHash: string;
            stateHash: string;
            target: string;
            time: number;
            version: number;
        }>;
        getCurrentKeyBlockHash(...args) => Promise<{
            hash: string;
        }>;
        getCurrentKeyBlockHeight(...args) => Promise<{
            height: number;
        }>;
        getGenerationByHash(...args) => Promise<{
            keyBlock: { hash: string; height: number; prevHash: string; prevKeyHash: string; stateHash: string; miner: string; beneficiary: string; target: string; pow?: string[] | undefined; nonce?: number | undefined; time: number; version: number; info: string; };
            microBlocks: string[];
        }>;
        getGenerationByHeight(...args) => Promise<{
            keyBlock: { hash: string; height: number; prevHash: string; prevKeyHash: string; stateHash: string; miner: string; beneficiary: string; target: string; pow?: string[] | undefined; nonce?: number | undefined; time: number; version: number; info: string; };
            microBlocks: string[];
        }>;
        getKeyBlockByHash(...args) => Promise<{
            beneficiary: string;
            hash: string;
            height: number;
            info: string;
            miner: string;
            nonce?: number;
            pow?: string[];
            prevHash: string;
            prevKeyHash: string;
            stateHash: string;
            target: string;
            time: number;
            version: number;
        }>;
        getKeyBlockByHeight(...args) => Promise<{
            beneficiary: string;
            hash: string;
            height: number;
            info: string;
            miner: string;
            nonce?: number;
            pow?: string[];
            prevHash: string;
            prevKeyHash: string;
            stateHash: string;
            target: string;
            time: number;
            version: number;
        }>;
        getMicroBlockHeaderByHash(...args) => Promise<{
            hash: string;
            height: number;
            pofHash: string;
            prevHash: string;
            prevKeyHash: string;
            signature: string;
            stateHash: string;
            time: number;
            txsHash: string;
            version: number;
        }>;
        getMicroBlockTransactionByHashAndIndex(...args) => Promise<{
            blockHash: string;
            blockHeight: number;
            hash: string;
            signatures: string[];
            tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; };
        }>;
        getMicroBlockTransactionsByHash(...args) => Promise<{
            transactions: ({ tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; }; blockHeight: number; blockHash: string; hash: string; signatures: str...)[];
        }>;
        getMicroBlockTransactionsCountByHash(...args) => Promise<{
            count: string;
        }>;
        getNameEntryByName(...args) => Promise<{
            id: string;
            owner?: string;
            pointers: ({ key: string; id: string; })[];
            ttl: number;
        }>;
        getOracleByPubkey(...args) => Promise<{
            abiVersion: string;
            id: string;
            queryFee: bigint;
            queryFormat: string;
            responseFormat: string;
            ttl: number;
        }>;
        getOracleQueriesByPubkey(...args) => Promise<{
            oracleQueries: ({ id: string; senderId: string; senderNonce: string; oracleId: string; query: string; response: string; ttl: number; responseTtl: { type: TTLType; value: string; }; fee: bigint; })[];
        }>;
        getOracleQueryByPubkeyAndQueryId(...args) => Promise<{
            fee: bigint;
            id: string;
            oracleId: string;
            query: string;
            response: string;
            responseTtl: { type: TTLType; value: string; };
            senderId: string;
            senderNonce: string;
            ttl: number;
        }>;
        getPeerPubkey(...args) => Promise<{
            pubkey: string;
        }>;
        getPendingAccountTransactionsByPubkey(...args) => Promise<{
            transactions: ({ tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; }; blockHeight: number; blockHash: string; hash: string; signatures: str...)[];
        }>;
        getPendingKeyBlock(...args) => Promise<{
            beneficiary: string;
            hash: string;
            height: number;
            info: string;
            miner: string;
            nonce?: number;
            pow?: string[];
            prevHash: string;
            prevKeyHash: string;
            stateHash: string;
            target: string;
            time: number;
            version: number;
        }>;
        getStatus(...args) => Promise<{
            difficulty: string;
            genesisKeyBlockHash: string;
            listening: boolean;
            networkId: string;
            nodeRevision: string;
            nodeVersion: string;
            peerConnections: { inbound: number; outbound: number; };
            peerCount: number;
            peerPubkey: string;
            pendingTransactionsCount: number;
            protocols: ({ version: number; effectiveAtHeight: number; })[];
            solutions: number;
            syncProgress?: number;
            syncing: boolean;
            topBlockHeight: number;
            topKeyBlockHash: string;
        }>;
        getTopHeader(...args) => Promise<{
            beneficiary?: string;
            hash: string;
            height: number;
            info?: string;
            miner?: string;
            nonce?: number;
            pofHash?: string;
            pow?: string[];
            prevHash: string;
            prevKeyHash: string;
            signature?: string;
            stateHash: string;
            target?: string;
            time: number;
            txsHash?: string;
            version: number;
        }>;
        getTransactionByHash(...args) => Promise<{
            blockHash: string;
            blockHeight: number;
            hash: string;
            signatures: string[];
            tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; };
        }>;
        getTransactionInfoByHash(...args) => Promise<{
            callInfo?: { callerId: string; callerNonce: string; height: number; contractId: string; gasPrice: bigint; gasUsed: number; log: { address: string; topics: string[]; data: string; }[]; returnValue: string; returnType: ContractCallReturnType; };
            gaInfo?: { callerId: string; height: number; gasPrice: bigint; gasUsed: number; returnValue: string; returnType: GAReturnType; innerObject?: { callInfo?: { callerId: string; callerNonce: string; ... 6 more ...; returnType: ContractCallReturnType; } | undefined; gaInfo?: ... | undefined; txInfo?: string | undefined; } | undef...;
            txInfo?: string;
        }>;
        postTransaction(...args) => Promise<{
            txHash: `th_${string}`;
        }>;
        protectedDryRunTxs(...args) => Promise<{
            results: ({ type: string; result: string; reason?: string | undefined; callObj?: { callerId: string; callerNonce: string; height: number; contractId: string; gasPrice: bigint; gasUsed: number; log: { address: string; topics: string[]; data: string; }[]; returnValue: string; returnType: ContractCallReturnType; } | undefined; })[];
            txEvents?: ({ [x: string]: unknown; })[];
        }>;
    }
    • Node

Constructors

  • Parameters

    • url: string

      Url for node API

    • options: NodeOptionalParams & {
          ignoreVersion?: boolean;
          retryCount?: number;
          retryOverallDelay?: number;
      } = {}

      Options

    Returns Node

Properties

$host: string
intAsString?: boolean

Methods

  • Get an account by public key

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        authFun?: string;
        balance: bigint;
        contractId?: string;
        id: string;
        kind?: AccountKind;
        nonce: number;
        payable?: boolean;
    }>

  • Get an account by public key after the block indicated by hash. Can be either a micro block or a keyblock hash

    Parameters

    • Rest ...args: [string, string, ...(undefined | {})[]]

    Returns Promise<{
        authFun?: string;
        balance: bigint;
        contractId?: string;
        id: string;
        kind?: AccountKind;
        nonce: number;
        payable?: boolean;
    }>

  • Get an account by public key after the opening key block of the generation at height

    Parameters

    • Rest ...args: [string, number, ...(undefined | {})[]]

    Returns Promise<{
        authFun?: string;
        balance: bigint;
        contractId?: string;
        id: string;
        kind?: AccountKind;
        nonce: number;
        payable?: boolean;
    }>

  • Get an account's next nonce; This is computed according to whatever is the current account nonce and what transactions are currently present in the transaction pool

    Parameters

    • Rest ...args: [string, ...(undefined | {
          strategy?: NextNonceStrategy;
      })[]]

    Returns Promise<{
        nextNonce: number;
    }>

  • Get oldest keyblock hashes counting from genesis including orphans

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        body: string[];
    }>

  • Get channel by public key

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        channelAmount: bigint;
        channelReserve: bigint;
        delegateIds: { initiator?: string[] | undefined; responder?: string[] | undefined; };
        id: string;
        initiatorAmount: bigint;
        initiatorId: string;
        lockPeriod: string;
        lockedUntil: string;
        responderAmount: bigint;
        responderId: string;
        round: number;
        soloRound: string;
        stateHash: string;
    }>

  • Get a contract by pubkey

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        abiVersion: string;
        active: boolean;
        deposit: bigint;
        id: string;
        ownerId: string;
        referrerIds: string[];
        vmVersion: string;
    }>

  • Get contract code by pubkey

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        bytecode: `cb_${string}`;
    }>

  • Get a proof of inclusion for a contract

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        poi: string;
    }>

  • Get the current generation

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        keyBlock: { hash: string; height: number; prevHash: string; prevKeyHash: string; stateHash: string; miner: string; beneficiary: string; target: string; pow?: string[] | undefined; nonce?: number | undefined; time: number; version: number; info: string; };
        microBlocks: string[];
    }>

  • Get the current key block

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        beneficiary: string;
        hash: string;
        height: number;
        info: string;
        miner: string;
        nonce?: number;
        pow?: string[];
        prevHash: string;
        prevKeyHash: string;
        stateHash: string;
        target: string;
        time: number;
        version: number;
    }>

  • Get the hash of the current key block

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        hash: string;
    }>

  • Get the height of the current key block

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        height: number;
    }>

  • Get a generation by hash

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        keyBlock: { hash: string; height: number; prevHash: string; prevKeyHash: string; stateHash: string; miner: string; beneficiary: string; target: string; pow?: string[] | undefined; nonce?: number | undefined; time: number; version: number; info: string; };
        microBlocks: string[];
    }>

  • Get a generation by height

    Parameters

    • Rest ...args: [number, ...(undefined | {})[]]

    Returns Promise<{
        keyBlock: { hash: string; height: number; prevHash: string; prevKeyHash: string; stateHash: string; miner: string; beneficiary: string; target: string; pow?: string[] | undefined; nonce?: number | undefined; time: number; version: number; info: string; };
        microBlocks: string[];
    }>

  • Get a key block by hash

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        beneficiary: string;
        hash: string;
        height: number;
        info: string;
        miner: string;
        nonce?: number;
        pow?: string[];
        prevHash: string;
        prevKeyHash: string;
        stateHash: string;
        target: string;
        time: number;
        version: number;
    }>

  • Get a key block by height

    Parameters

    • Rest ...args: [number, ...(undefined | {})[]]

    Returns Promise<{
        beneficiary: string;
        hash: string;
        height: number;
        info: string;
        miner: string;
        nonce?: number;
        pow?: string[];
        prevHash: string;
        prevKeyHash: string;
        stateHash: string;
        target: string;
        time: number;
        version: number;
    }>

  • Get a micro block header by hash

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        hash: string;
        height: number;
        pofHash: string;
        prevHash: string;
        prevKeyHash: string;
        signature: string;
        stateHash: string;
        time: number;
        txsHash: string;
        version: number;
    }>

  • Get a micro block transaction by hash and index

    Parameters

    • Rest ...args: [string, number, ...(undefined | {})[]]

    Returns Promise<{
        blockHash: string;
        blockHeight: number;
        hash: string;
        signatures: string[];
        tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; };
    }>

  • Get micro block transactions by hash

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        transactions: ({ tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; }; blockHeight: number; blockHash: string; hash: string; signatures: str...)[];
    }>

  • Get micro block transaction count by hash

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        count: string;
    }>

  • Get name entry from naming system

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        id: string;
        owner?: string;
        pointers: ({ key: string; id: string; })[];
        ttl: number;
    }>

  • Returns Promise<string>

  • Get an oracle by public key

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        abiVersion: string;
        id: string;
        queryFee: bigint;
        queryFormat: string;
        responseFormat: string;
        ttl: number;
    }>

  • Get oracle queries by public key

    Parameters

    • Rest ...args: [string, ...(undefined | {
          from?: string;
          limit?: number;
          type?: OracleQueryType;
      })[]]

    Returns Promise<{
        oracleQueries: ({ id: string; senderId: string; senderNonce: string; oracleId: string; query: string; response: string; ttl: number; responseTtl: { type: TTLType; value: string; }; fee: bigint; })[];
    }>

  • Get an oracle query by public key and query ID

    Parameters

    • Rest ...args: [string, string, ...(undefined | {})[]]

    Returns Promise<{
        fee: bigint;
        id: string;
        oracleId: string;
        query: string;
        response: string;
        responseTtl: { type: TTLType; value: string; };
        senderId: string;
        senderNonce: string;
        ttl: number;
    }>

  • Get peer public key

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        pubkey: string;
    }>

  • Get pending account transactions by public key

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        transactions: ({ tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; }; blockHeight: number; blockHash: string; hash: string; signatures: str...)[];
    }>

  • Get the pending key block

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        beneficiary: string;
        hash: string;
        height: number;
        info: string;
        miner: string;
        nonce?: number;
        pow?: string[];
        prevHash: string;
        prevKeyHash: string;
        stateHash: string;
        target: string;
        time: number;
        version: number;
    }>

  • Get the status of a node

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        difficulty: string;
        genesisKeyBlockHash: string;
        listening: boolean;
        networkId: string;
        nodeRevision: string;
        nodeVersion: string;
        peerConnections: { inbound: number; outbound: number; };
        peerCount: number;
        peerPubkey: string;
        pendingTransactionsCount: number;
        protocols: ({ version: number; effectiveAtHeight: number; })[];
        solutions: number;
        syncProgress?: number;
        syncing: boolean;
        topBlockHeight: number;
        topKeyBlockHash: string;
    }>

  • Get the top header (either key or micro block)

    Parameters

    • Rest ...args: (undefined | {})[]

    Returns Promise<{
        beneficiary?: string;
        hash: string;
        height: number;
        info?: string;
        miner?: string;
        nonce?: number;
        pofHash?: string;
        pow?: string[];
        prevHash: string;
        prevKeyHash: string;
        signature?: string;
        stateHash: string;
        target?: string;
        time: number;
        txsHash?: string;
        version: number;
    }>

  • Get a transaction by hash

    Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        blockHash: string;
        blockHeight: number;
        hash: string;
        signatures: string[];
        tx: { type: "Tx"; recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 53 more ...; version: number; };
    }>

  • Parameters

    • Rest ...args: [string, ...(undefined | {})[]]

    Returns Promise<{
        callInfo?: { callerId: string; callerNonce: string; height: number; contractId: string; gasPrice: bigint; gasUsed: number; log: { address: string; topics: string[]; data: string; }[]; returnValue: string; returnType: ContractCallReturnType; };
        gaInfo?: { callerId: string; height: number; gasPrice: bigint; gasUsed: number; returnValue: string; returnType: GAReturnType; innerObject?: { callInfo?: { callerId: string; callerNonce: string; ... 6 more ...; returnType: ContractCallReturnType; } | undefined; gaInfo?: ... | undefined; txInfo?: string | undefined; } | undef...;
        txInfo?: string;
    }>

  • Post a new transaction

    Parameters

    • Rest ...args: [{
          tx: string;
      }, ...(undefined | {})[]]

    Returns Promise<{
        txHash: `th_${string}`;
    }>

  • Dry-run transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx and OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a default value of 1000000 is being used instead.

    Parameters

    • Rest ...args: [{
          accounts?: ({ pubKey: string; amount: bigint; })[];
          top?: string;
          txEvents?: boolean;
          txs: ({ tx?: string | undefined; callReq?: { calldata: string; contract: string; amount?: bigint | undefined; gas?: number | undefined; caller?: string | undefined; nonce?: number | undefined; abiVersion?: string | undefined; context?: { ...; } | undefined; } | undefined; })[];
      }, ...(undefined | {})[]]

    Returns Promise<{
        results: ({ type: string; result: string; reason?: string | undefined; callObj?: { callerId: string; callerNonce: string; height: number; contractId: string; gasPrice: bigint; gasUsed: number; log: { address: string; topics: string[]; data: string; }[]; returnValue: string; returnType: ContractCallReturnType; } | undefined; })[];
        txEvents?: ({ [x: string]: unknown; })[];
    }>

Generated using TypeDoc