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

    Class ElectrumExplorer

    Implements

    Index

    Constructors

    • Parameters

      • __namedParameters: {
            host?: string;
            port?: number;
            protocol?: "tcp" | "ssl";
            network?: Network;
            irrevConfThresh?: number;
            maxTxPerScriptPubKey?: number;
            timeout?: number;
        } = {}

      Returns ElectrumExplorer

    Methods

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

      Returns boolean

    • 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 Electrum 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.