Hierarchy

  • ElectrumExplorer

Implements

Constructors

  • Parameters

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

    Returns ElectrumExplorer

Properties

#irrevConfThresh: number
#tipBlockHeight: number
#maxTxPerScriptPubKey: number
#pingInterval: undefined | Timeout
#client: undefined | default
#blockStatusMap: Map<number, BlockStatus> = ...
#host: string
#port: number
#protocol: string
#network: Network

Methods

  • Returns Promise<default>

  • Parameters

    • header: {
          height: number;
          hex: string;
      }
      • height: number
      • hex: string

    Returns void

  • 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;
      }
      • Optional address?: string
      • Optional 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.

    Async

    Throws

    If the transaction is invalid or fails to be broadcasted.