@bitcoinerlab/explorer - v0.4.2
    Preparing search index...

    Class EsploraExplorer

    Implements an Explorer Interface for an Esplora server.

    Implements

    Index

    Constructors

    • Parameters

      • params: {
            url?: string;
            irrevConfThresh?: number;
            maxTxPerScriptPubKey?: number;
            requestQueueParams?: RequestQueueParams;
            timeout?: number;
        } = {}
        • Optionalurl?: string

          Esplora's API url. Defaults to blockstream.info if service = ESPLORA.

        • OptionalirrevConfThresh?: number
        • OptionalmaxTxPerScriptPubKey?: number
        • OptionalrequestQueueParams?: RequestQueueParams
        • Optionaltimeout?: number

      Returns EsploraExplorer

    Methods

    • Implements Explorer#isConnected. Checks server connectivity by attempting to fetch the current block height. Returns true if successful, otherwise false.

      Returns Promise<boolean>

    • Returns true if connect has never been called or if close() was called after a connect().

      Returns boolean

    • Parameters

      • __namedParameters: { address?: string; scriptHash?: string }

      Returns Promise<
          {
              balance: number;
              txCount: number;
              unconfirmedBalance: number;
              unconfirmedTxCount: number;
          },
      >

    • Parameters

      • address: string

      Returns Promise<
          {
              balance: number;
              txCount: number;
              unconfirmedBalance: number;
              unconfirmedTxCount: number;
          },
      >

    • Parameters

      • scriptHash: string

      Returns Promise<
          {
              balance: number;
              txCount: number;
              unconfirmedBalance: number;
              unconfirmedTxCount: number;
          },
      >

    • Fetches the transaction history for a given address or script hash from an Esplora server. See interface.ts

      Parameters

      • __namedParameters: { address?: string; scriptHash?: string }

      Returns Promise<{ txId: string; blockHeight: number; irreversible: boolean }[]>

    • Fetches raw transaction data for a given transaction ID from an Esplora server.

      Parameters

      • txId: string

        The transaction ID to fetch data for.

      Returns Promise<string>

      A promise that resolves to the raw transaction data as a string.

    • Push a raw Bitcoin transaction to the network.

      Parameters

      • txHex: string

        A raw Bitcoin transaction in hexadecimal string format.

      Returns Promise<string>

      The transaction ID (txId) if the transaction was broadcasted successfully.

      If the transaction is invalid or fails to be broadcasted.