Class StacksNodeApi

Hierarchy

  • StacksNodeApi

Constructors

Properties

baseUrl: string
fetch: FetchFn
network: StacksNetwork

Methods

  • Broadcast a serialized transaction to a Stacks node (which will validate and forward to the network).

    Parameters

    • transaction: StacksTransaction

      The transaction to broadcast

    • Optional attachment: string | Uint8Array

      Optional attachment to include with the transaction

    • Optional network: StacksNetwork | "mainnet" | "testnet" | "devnet" | "mocknet"

    Returns Promise<TxBroadcastResult>

    a Promise that resolves to a TxBroadcastResult object

  • Estimate the total transaction fee in microstacks for a Stacks transaction

    Parameters

    • payload: string

      The transaction to estimate fees for

    • Optional estimatedLength: number

      Optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures

    Returns Promise<[FeeEstimation, FeeEstimation, FeeEstimation]>

    A promise that resolves to an array of FeeEstimate

  • Fetch a contract's ABI

    Parameters

    • contract: `${string}.${string}`

    Returns Promise<ClarityAbi>

    A promise that resolves to a ClarityAbi if the operation succeeds

  • Get account status

    Parameters

    • address: string

    Returns Promise<any>

  • Gets the value of a data-var if it exists in the given contract

    Parameters

    • contract: `${string}.${string}`
    • dataVarName: string

    Returns Promise<{
        raw: string;
        value: ClarityValue;
    }>

  • Get BTC reward holders for the an address

    Parameters

    Returns Promise<BaseErrorResponse | BurnchainRewardSlotHolderListResponse>

  • Get paginated BTC stacking rewards total for an address

    Parameters

    Returns Promise<BaseErrorResponse | BurnchainRewardListResponse>

  • Get the total BTC stacking rewards total for an address

    Parameters

    • address: string

      BTC or STX address

    Returns Promise<BaseErrorResponse | BurnchainRewardsTotal>

  • Lookup the nonce for an address from a core node

    Parameters

    • address: string

      The Stacks address to look up the next nonce for

    Returns Promise<bigint>

    A promise that resolves to a bigint of the next nonce

  • Get stacks node target block time

    Returns Promise<number>

  • Returns true if the network is configured to 'mainnet', based on the TransactionVersion

    Returns boolean

Generated using TypeDoc