import { ElectrumClient, ElectrumClientEvents, ElectrumNetworkOptions, ElectrumSocket, RPCBase } from "@electrum-cash/network"; //#region source/interfaces/electrum/protocol.d.ts /** * This file documents externally defined 3rd party interfaces, * so we need to disable some linting rules that cannot be enforced. * * Furthermore, the descriptions of theses interfaces are copied almost * verbatim from https://electrum-cash-protocol.readthedocs.io/en/latest/ */ /** * Name for a method that can be used to request data from an electrum server. * @ignore */ type RequestMethod = string; /** * Hash of data that relates to the current history and state of a blockchain address. * @ignore */ type AddressStatus = string; /** * Hash of data that relates to the current history and state of a blockchain lockscript. * @ignore */ type ScriptHashStatus = string; /** * Number indicating a transactions blockchain inclusion height, with 0 for mempool transactions and null if the transaction could not be found. * @ignore */ type TransactionStatus = number | null; /** * ... * @ignore */ type DoubleSpendProofStatus = string; /** Number of tokens. */ type TokenAmount = string; /** Category that identifies the token type. */ type TokenCategory = string; /** Current commitment data for the specific NFT. */ type TokenCommitment = string; /** Capability information on the specific NFT. */ type TokenCapabilities = 'none' | 'mutable' | 'minting'; /** Configures the request to include or exclude token data, or exclude non-token data. */ type TokenFilter = 'include_tokens' | 'exclude_tokens' | 'tokens_only'; /** * Structured token data used in various electrum cash methods. */ interface TokenData { token_data?: { amount: TokenAmount; category: TokenCategory; nft?: { capability: TokenCapabilities; commitment: TokenCommitment; }; }; } /** * * @ignore */ type VersionNumbers = { major: number; minor: number; patch: number; }; //#endregion //#region source/interfaces/blockchain/blockchain.d.ts type Satoshis = number; type TransactionHex = string; type TransactionHash = string; type BlockHeight = number; type BlockHeaderHash = string; type BlockHeaderHex = string; type Address = string; type ScriptHex = string; type ScriptHash = string; type DoubleSpendProofHash = string; type DoubleSpendProofHex = string; type OutputIndex = number; type OutputIdentifier = string; type InputIndex = number; type InputIdentifier = string; type BlockMerkleRoot = string; type BlockMerkleProof = BlockHeaderHash[]; type BlockMerklePosition = number; type TransactionMerkleRoot = string; type TransactionMerkleProof = TransactionHash[]; type TransactionMerklePosition = number; interface BlockHeaderObject { version: number; previousBlockHash: BlockHeaderHash; merkleRoot: BlockMerkleRoot; timestamp: number; compressedTarget: Uint8Array; nonce: unknown; } interface Transaction { bytes: Uint8Array; blockHeight?: BlockHeight; blockHash?: Uint8Array; merkleProof?: TransactionMerkleProof; } //#endregion //#region source/interfaces/electrum/blockchain.d.ts /** * Return the estimated transaction fee per kilobyte for a transaction to be confirmed within a certain number of blocks. * * @memberof Blockchain */ type EstimateFeeRequest = { /** Must be: 'blockchain.estimatefee'. */method: 'blockchain.estimatefee'; /** The number of blocks to target for confirmation. */ number: number; }; /** * The estimated transaction fee in coin units per kilobyte, as a floating point number. If the daemon does not have enough information to make an estimate, the integer -1 is returned. * * @memberof Blockchain */ type EstimateFeeResponse = Satoshis; /** * Return the minimum fee a low-priority transaction must pay in order to be accepted to the daemon’s memory pool. * * @memberof Blockchain */ type RelayFeeRequest = { /** Must be: 'blockchain.relayfee'. */method: 'blockchain.relayfee'; }; /** * The fee in whole coin units (BTC, not satoshis for Bitcoin) as a floating point number. * * @memberof Blockchain */ type RelayFeeResponse = Satoshis; //#endregion //#region source/interfaces/electrum/address.d.ts /** * Request the confirmed and unconfirmed balances of a Bitcoin Cash address * @todo RECONSIDER THIS STRUCTURE FOR INTERFACE DOCUMENTATION. */ type AddressGetBalance = { /** @interface */Request: { /** the method name according to the electrum protocol specification. */method: 'blockchain.address.get_balance'; /** the address to get balance for. */ address: Address; /** ... */ token_filter: TokenFilter; }; /** @interface */ Response: { /** number of satoshis in UTXOs that have been confirmed in a block. */confirmed: Satoshis; /** number of satoshis in UTXOs that are still in the mempool. */ unconfirmed: Satoshis; }; }; /** * Return the confirmed and unconfirmed balances of a Bitcoin Cash address. * * @property method {string} - Must be: 'blockchain.address.get_balance' * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressGetBalanceRequest { method: 'blockchain.address.get_balance'; address: Address; token_filter: TokenFilter; } /** * A dictionary with keys confirmed and unconfirmed. The value of each is the appropriate balance in satoshis. * * @property confirmed {Satoshis} - number of satoshis in UTXOs that have been confirmed in a block. * @property unconfirmed {Satoshis} - number of satoshis in UTXOs that are still in the mempool. */ interface AddressGetBalanceResponse { confirmed: Satoshis; unconfirmed: Satoshis; } /** * Retrieve information on the first occurrence of an address on the block chain. * * @property method {string} - Must be: 'blockchain.address.get_first_use' * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressGetFirstUseRequest { method: 'blockchain.address.get_first_use'; address: Address; } /** * TODO: Document me. */ interface AddressGetFirstUseEntry { block_hash: BlockHeaderHash; height: BlockHeight; tx_hash: TransactionHash; } /** * If the address in question does not appear either on the block chain or in the mempool, then null is returned. * Otherwise, a dictionary containing the following keys: block_hash, height, tx_hash. * * If the transaction that first uses this address is in the mempool, the returned values are all zeroes (0). */ type AddressGetFirstUseResponse = null | AddressGetFirstUseEntry; /** * Return the confirmed and unconfirmed history of a Bitcoin Cash address. * @property method {string} - Must be: 'blockchain.address.get_history'. * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressGetHistoryRequest { method: 'blockchain.address.get_history'; address: Address; from_height?: BlockHeight; to_height?: BlockHeight | -1; } /** * A list of confirmed transactions in blockchain order, with the output of blockchain.address.get_mempool() appended to the list. * * @property tx_hash {TransactionHash} - transaction hash used to identify a transaction. * @property height {BlockHeight} - block height for the block that the transaction has been included in, or 0 for unconfirmed, or -1 for unconfirmed if one or more parents are also unconfirmed. * @property fee? {Satoshis} - satoshis paid as fee for the transaction if it is currently in the mempool. */ interface AddressGetHistoryEntry { tx_hash: TransactionHash; height: BlockHeight; fee?: Satoshis; } /** * A list of confirmed transactions in blockchain order, with the output of blockchain.address.get_mempool() appended to the list. * @typedef AddressGetHistoryResponse * @type Array */ type AddressGetHistoryResponse = Array; /** * Return the unconfirmed transactions of a Bitcoin Cash address. * @property method {string} - Must be: 'blockchain.address.get_mempool' * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressGetMempoolRequest { method: 'blockchain.address.get_mempool'; address: Address; } /** * @property tx_hash {TransactionHash} - transaction hash used to identify a transaction. * @property height {BlockHeight} - 0 if all inputs are confirmed, and -1 otherwise. * @property fee {Satoshis} - satoshis paid as fee for the transaction. */ interface AddressGetMempoolEntry { tx_hash: TransactionHash; height: BlockHeight; fee: Satoshis; } /** * A list of mempool transactions in arbitrary order. */ type AddressGetMempoolResponse = Array; /** * Translate a Bitcoin Cash address to a script hash. This method is potentially useful for clients preferring to work with script hashes but lacking the local libraries necessary to generate them. * * @property method {string} - Must be: 'blockchain.address.get_scripthash'. * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive) */ interface AddressGetScripthashRequest { method: 'blockchain.address.get_scripthash'; address: Address; } /** * The unique 32-byte hex-encoded script hash that corresponds to the decoded address. */ type AddressGetScripthashResponse = ScriptHash; /** * Return an ordered list of UTXOs sent to a Bitcoin Cash address. * @property method {string} - Must be: 'blockchain.address.list_unspent'. * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressListUnspentRequest { method: 'blockchain.address.list_unspent'; address: Address; } /** * A list of unspent outputs in blockchain order. This function takes the mempool into account. Mempool transactions paying to the address are included at the end of the list in an undefined order. Any output that is spent in the mempool does not appear. * @property tx_pos {TransactionMerklePosition} - TODO: Document me. * @property tx_hash {TransactionHash} - TODO: Document me. * @property height {BlockHeight} - TODO: Document me. * @property value {Satoshis} - TODO: Document me. * @property token_data {TokenData} - TODO: Document me. */ interface AddressListUnspentEntry extends TokenData { tx_pos: TransactionMerklePosition; tx_hash: TransactionHash; height: BlockHeight; value: Satoshis; } /** * */ type AddressListUnspentResponse = Array; /** * Subscribe to a Bitcoin Cash address. * @property method {string} - Must be: 'blockchain.address.subscribe'. * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressSubscribeRequest { method: 'blockchain.address.subscribe'; address: Address; } /** * The status of the address. */ type AddressSubscribeResponse = AddressStatus; /** * Notification for blockchain.address.subscribe * * @event blockchain.address.subscribe */ interface AddressSubscribeNotification extends RPCBase { method: 'blockchain.address.subscribe'; params: [Address, AddressStatus]; } /** * Unsubscribe from a Bitcoin Cash address, preventing future notifications if its status changes. * @property method {string} - Must be: 'blockchain.address.unsubscribe'. * @property address {Address} - The address as a Cash Address string (with or without prefix, case insensitive). */ interface AddressUnsubscribeRequest { method: 'blockchain.address.unsubscribe'; address: Address; } /** * Returns True if the address was subscribed to, otherwise False. Note that False might be returned even for something subscribed to earlier, because the server can drop subscriptions in rare circumstances. */ type AddressUnsubscribeResponse = boolean; //#endregion //#region source/interfaces/electrum/block.d.ts /** * Return the block header at the given height. * * @memberof Blockchain.Block */ type BlockHeaderRequest = { /** Must be: 'blockchain.block.header'. */method: 'blockchain.block.header'; /** The height of the block, a non-negative integer. */ height: BlockHeight; /** Checkpoint height, a non-negative integer. Ignored if zero, otherwise the following must hold: height <= cp_height */ cp_height?: BlockHeight; }; /** * Response typing for blockchain.block.header. * * @memberof Blockchain.Block */ type BlockHeaderResponse = string; type BlockHeaderWithProofResponse = { branch: BlockMerkleProof; header: BlockHeaderHex; root: BlockMerkleRoot; }; /** * Return a concatenated chunk of block headers from the main chain. * * @memberof Blockchain.Block */ type BlockHeadersRequest = { /** Must be: 'blockchain.block.headers'. */method: 'blockchain.block.headers'; /** The height of the first header requested, a non-negative integer. */ start_height: BlockHeight; /** The number of headers requested, a non-negative integer. */ count: number; /** Checkpoint height, a non-negative integer. Ignored if zero, otherwise the following must hold: start_height + (count - 1) <= cp_height */ cp_height?: BlockHeight; }; /** * Response typing for blockchain.block.headers. * * @memberof Blockchain.Block */ type BlockHeadersResponse = { count: number; hex: BlockHeaderHex; max: number; }; type BlockHeadersWithProofResponse = BlockHeadersResponse & { root: BlockMerkleRoot; branch: BlockMerkleProof; }; //#endregion //#region source/interfaces/electrum/header.d.ts /** * Subscribe to receive block headers when a new block is found. * * @memberof Blockchain.Headers */ type HeadersSubscribeRequest = { /** Must be: 'blockchain.headers.subscribe'. */method: 'blockchain.headers.subscribe'; }; /** * blockchain.headers.subscribe * * @memberof Blockchain.Headers */ type HeadersSubscribeResponse = { height: BlockHeight; hex: BlockHeaderHex; }; /** * Notification for blockchain.headers.subscribe * * @event blockchain.headers.subscribe * @memberof Blockchain.Headers */ interface HeadersSubscribeNotification extends RPCBase { method: string; params: [HeadersSubscribeResponse]; } /** * Unsubscribes from receiving block headers when a new block is found. * * @memberof Blockchain.Headers */ type HeadersUnsubscribeRequest = { /** Must be: 'blockchain.headers.unsubscribe'. */method: 'blockchain.headers.unsubscribe'; }; /** * blockchain.headers.unsubscribe * * @memberof Blockchain.Headers */ type HeadersUnsubscribeResponse = boolean; /** * Get the latest block’s height and header. * * @memberof Blockchain.Headers */ type HeadersGetTipRequest = { /** Must be: 'blockchain.headers.get_tip'. */method: 'blockchain.headers.get_tip'; }; /** * blockchain.headers.get_tip */ type HeadersGetTipResponse = HeadersSubscribeResponse; /** * Get a specific block header, by either its hash or height in the current chain. * * @memberof Blockchain.Headers */ type HeaderGetRequest = { /** Must be: 'blockchain.headers.get'. */method: 'blockchain.header.get'; /** The hash of the block header, or the height of the block in the current chain. */ blockHashOrHeight: BlockHeaderHash | BlockHeight; }; /** * blockchain.header.get */ type HeaderGetResponse = HeadersSubscribeResponse; //#endregion //#region source/interfaces/electrum/scripthash.d.ts /** * Request the confirmed and unconfirmed balances of a Bitcoin Cash script hash * @todo RECONSIDER THIS STRUCTURE FOR INTERFACE DOCUMENTATION. */ type ScriptHashGetBalance = { /** @interface */Request: { /** the method name according to the electrum protocol specification. */method: 'blockchain.scripthash.get_balance'; /** the script hash to get balance for. */ scriptHash: ScriptHash; /** ... */ token_filter: TokenFilter; }; /** @interface */ Response: { /** number of satoshis in UTXOs that have been confirmed in a block. */confirmed: Satoshis; /** number of satoshis in UTXOs that are still in the mempool. */ unconfirmed: Satoshis; }; }; /** * Return the confirmed and unconfirmed balances of a Bitcoin Cash script hash. * * @property method {string} - Must be: 'blockchain.scripthash.get_balance' * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashGetBalanceRequest { method: 'blockchain.scripthash.get_balance'; scriptHash: ScriptHash; token_filter: TokenFilter; } /** * A dictionary with keys confirmed and unconfirmed. The value of each is the appropriate balance in satoshis. * * @property confirmed {Satoshis} - number of satoshis in UTXOs that have been confirmed in a block. * @property unconfirmed {Satoshis} - number of satoshis in UTXOs that are still in the mempool. */ interface ScriptHashGetBalanceResponse { confirmed: Satoshis; unconfirmed: Satoshis; } /** * Retrieve information on the first occurrence of a script hash on the block chain. * * @property method {string} - Must be: 'blockchain.scripthash.get_first_use' * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashGetFirstUseRequest { method: 'blockchain.scripthash.get_first_use'; scriptHash: ScriptHash; } /** * TODO: Document me. */ interface ScriptHashGetFirstUseEntry { block_hash: BlockHeaderHash; height: BlockHeight; tx_hash: TransactionHash; } /** * If the script hash in question does not appear either on the block chain or in the mempool, then null is returned. * Otherwise, a dictionary containing the following keys: block_hash, height, tx_hash. * * If the transaction that first uses this script hash is in the mempool, the returned values are all zeroes (0). */ type ScriptHashGetFirstUseResponse = null | ScriptHashGetFirstUseEntry; /** * Return the confirmed and unconfirmed history of a Bitcoin Cash script hash. * @property method {string} - Must be: 'blockchain.scripthash.get_history'. * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashGetHistoryRequest { method: 'blockchain.scripthash.get_history'; scriptHash: ScriptHash; from_height?: BlockHeight; to_height?: BlockHeight | -1; } /** * A list of confirmed transactions in blockchain order, with the output of blockchain.scripthash.get_mempool() appended to the list. * * @property tx_hash {TransactionHash} - transaction hash used to identify a transaction. * @property height {BlockHeight} - block height for the block that the transaction has been included in, or 0 for unconfirmed, or -1 for unconfirmed if one or more parents are also unconfirmed. * @property fee? {Satoshis} - satoshis paid as fee for the transaction if it is currently in the mempool. */ interface ScriptHashGetHistoryEntry { tx_hash: TransactionHash; height: BlockHeight; fee?: Satoshis; } /** * A list of confirmed transactions in blockchain order, with the output of blockchain.scripthash.get_mempool() appended to the list. * @typedef ScriptHashGetHistoryResponse * @type Array */ type ScriptHashGetHistoryResponse = Array; /** * Return the unconfirmed transactions of a Bitcoin Cash script hash. * @property method {string} - Must be: 'blockchain.scripthash.get_mempool' * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashGetMempoolRequest { method: 'blockchain.scripthash.get_mempool'; scriptHash: ScriptHash; } /** * @property tx_hash {TransactionHash} - transaction hash used to identify a transaction. * @property height {BlockHeight} - 0 if all inputs are confirmed, and -1 otherwise. * @property fee {Satoshis} - satoshis paid as fee for the transaction. */ interface ScriptHashGetMempoolEntry { tx_hash: TransactionHash; height: BlockHeight; fee: Satoshis; } /** * A list of mempool transactions in arbitrary order. */ type ScriptHashGetMempoolResponse = Array; /** * Return an ordered list of UTXOs sent to a Bitcoin Cash script hash. * @property method {string} - Must be: 'blockchain.scripthash.list_unspent'. * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashListUnspentRequest { method: 'blockchain.scripthash.list_unspent'; scriptHash: ScriptHash; } /** * A list of unspent outputs in blockchain order. This function takes the mempool into account. Mempool transactions paying to the script hash are included at the end of the list in an undefined order. Any output that is spent in the mempool does not appear. * @property tx_pos {TransactionMerklePosition} - TODO: Document me. * @property tx_hash {TransactionHash} - TODO: Document me. * @property height {BlockHeight} - TODO: Document me. * @property value {Satoshis} - TODO: Document me. * @property token_data {TokenData} - TODO: Document me. */ interface ScriptHashListUnspentEntry extends TokenData { tx_pos: TransactionMerklePosition; tx_hash: TransactionHash; height: BlockHeight; value: Satoshis; } /** * */ type ScriptHashListUnspentResponse = Array; /** * Subscribe to a Bitcoin Cash script hash. * @property method {string} - Must be: 'blockchain.scripthash.subscribe'. * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashSubscribeRequest { method: 'blockchain.scripthash.subscribe'; scriptHash: ScriptHash; } /** * The status of the script hash. */ type ScriptHashSubscribeResponse = AddressStatus; /** * Notification for blockchain.scripthash.subscribe * * @event blockchain.scripthash.subscribe */ interface ScriptHashSubscribeNotification extends RPCBase { method: 'blockchain.scripthash.subscribe'; params: [ScriptHash, AddressStatus]; } /** * Unsubscribe from a Bitcoin Cash script hash, preventing future notifications if its status changes. * @property method {string} - Must be: 'blockchain.scripthash.unsubscribe'. * @property scriptHash {ScriptHash} - The script hash as a hexadecimal string (32 bytes, 64 characters). */ interface ScriptHashUnsubscribeRequest { method: 'blockchain.scripthash.unsubscribe'; scriptHash: ScriptHash; } /** * Returns True if the script hash was subscribed to, otherwise False. Note that False might be returned even for something subscribed to earlier, because the server can drop subscriptions in rare circumstances. */ type ScriptHashUnsubscribeResponse = boolean; //#endregion //#region source/interfaces/electrum/vendor.d.ts /** * BCHN specific implementation of get transaction, with verbose flag set to true. * * NOTE: This was valid as of 2024-10-15, when using electrum protocol version 1.5.2. */ interface TransactionGetVerboseBCHN { blockhash: string; blocktime: number; confirmations: number; hash: string; hex: string; locktime: number; size: number; time: number; txid: string; version: number; vin: Array<{ scriptSig: { asm: string; hex: string; }; sequence: number; txid: string; vout: number; }>; vout: Array<{ n: number; scriptPubKey: { addresses: string[]; asm: string; hex: string; reqSigs: number; type: string; }; value: number; }>; } //#endregion //#region source/interfaces/electrum/transaction.d.ts /** * Broadcast a transaction to the network. * * @memberof Blockchain.Transaction */ type TransactionBroadcastRequest = { /** Must be: 'blockchain.transaction.broadcast'. */method: 'blockchain.transaction.broadcast'; /** The raw transaction as a hexadecimal string. */ raw_tx: TransactionHex; }; /** * The transaction hash as a hexadecimal string. * * @memberof Blockchain.Transaction */ type TransactionBroadcastResponse = TransactionHash; /** * Returns information on a double-spend proof. The query can be by either tx_hash or dspid. * * @memberof Blockchain.Transaction */ type TransactionDoublespendProofGetRequest = { /** Must be: 'blockchain.transaction.dsproof.get'. */method: 'blockchain.transaction.dsproof.get'; /** The transaction hash (or dspid) as a hexadecimal string. */ hash: TransactionHash | DoubleSpendProofHash; }; /** * If the transaction in question has an associated dsproof, then a JSON object. Otherwise null. * * @memberof Blockchain.Transaction */ type TransactionDoublespendProofEntryGet = { dspid: DoubleSpendProofHash; txid: TransactionHash; hex: DoubleSpendProofHex; outpoint: { txid: TransactionHash; vout: OutputIndex; }; descendants: TransactionHash[]; }; type TransactionDoublespendProofGetResponse = null | TransactionDoublespendProofEntryGet; /** * List all of the transactions that currently have double-spend proofs associated with them. * * @memberof Blockchain.Transaction */ type TransactionListDsProofsRequest = { /** Must be: 'blockchain.transaction.dsproof.list'. */method: 'blockchain.transaction.dsproof.list'; }; /** * A JSON array of hexadecimal strings. May be empty. * Each string is a transaction hash of an in-mempool transaction that has a double-spend proof associated with it. * Each of the hashes appearing in the list may be given as an argument to blockchain.transaction.dsproof.get() in order to obtain the associated double-spend proof for that transaction. * * @memberof Blockchain.Transaction */ type TransactionListDsProofsResponse = TransactionHash[]; /** * Subscribe for double spend proof notifications for a transaction. * * @memberof Blockchain.Block */ type TransactionDsProofSubscribeRequest = { /** Must be: 'blockchain.transaction.dsproof.subscribe'. */method: 'blockchain.transaction.dsproof.subscribe'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; }; /** * If the transaction in question has an associated dsproof, then a JSON object. Otherwise null. * * @memberof Blockchain.Transaction */ type TransactionDoublespendProofSubscribeResponse = TransactionDoublespendProofGetResponse; /** * Notification for blockchain.transaction.dsproof.subscribe * * @event blockchain.transaction.dsproof.subscribe * @memberof Blockchain.Transaction */ interface TransactionDsProofNotification extends RPCBase { method: string; params: [TransactionDoublespendProofGetResponse]; } /** * Unsubscribe from receiving any further dsproof notifications for a transaction. * * @memberof Blockchain.Transaction */ type TransactionDoublespendProofUnsubscribeRequest = { /** Must be: 'blockchain.transaction.dsproof.unsubscribe'. */method: 'blockchain.transaction.dsproof.unsubscribe'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; }; /** * Returns true if the transaction was previously subscribed-to for dsproof notifications, otherwise false. * Note that false might be returned even for something subscribed-to earlier, because the server can drop subscriptions in rare circumstances. * * @memberof Blockchain.Transaction */ type TransactionDsProofUnsubscribeResponse = boolean; /** * Return a raw transaction. * * @memberof Blockchain.Transaction */ type TransactionGetRequest = { /** Must be: 'blockchain.transaction.get'. */method: 'blockchain.transaction.get'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; /** Whether a verbose coin-specific response is required. */ verbose?: boolean; }; /** * blockchain.transaction.get * * @memberof Blockchain.Transaction */ type TransactionGetVerboseResponse = unknown | TransactionGetVerboseBCHN; type TransactionGetResponse = TransactionHex | TransactionGetVerboseResponse; /** * Returns the block height for a confirmed transaction, or 0 for a mempool transaction, given its hash. * * @memberof Blockchain.Transaction */ type TransactionGetHeightRequest = { /** Must be: 'blockchain.transaction.get_height'. */method: 'blockchain.transaction.get_height'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; }; /** * blockchain.transaction.get_height * * @memberof Blockchain.Transaction */ type TransactionGetHeightUnknown = null; type TransactionGetHeightUnconfirmed = 0; type TransactionGetHeightResponse = BlockHeight | TransactionGetHeightUnconfirmed | TransactionGetHeightUnknown; /** * Returns the block hash of the block that contains a particular transaction. * * @memberof Blockchain.Transaction */ type TransactionGetConfirmedBlockHashRequest = { /** Must be: 'blockchain.transaction.get_confirmed_blockhash'. */method: 'blockchain.transaction.get_confirmed_blockhash'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; /** If set to true, response will include the optional block header. */ include_header: boolean; }; /** * blockchain.transaction.get_confirmed_blockhash * * @memberof Blockchain.Transaction */ type TransactionGetConfirmedBlockHashResponse = { block_hash: BlockHeaderHash; block_header: BlockHeaderHex; block_height: BlockHeight; }; /** * Return the merkle branch to a confirmed transaction given its hash and height. * * @memberof Blockchain.Transaction */ type TransactionGetMerkleRequest = { /** Must be: 'blockchain.transaction.get_merkle'. */method: 'blockchain.transaction.get_merkle'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; /** The height at which it was confirmed, an integer. */ height: BlockHeight; }; /** * blockchain.transaction.get_merkle * * @memberof Blockchain.Transaction */ type TransactionGetMerkleResponse = { merkle: TransactionMerkleProof; block_height: BlockHeight; pos: TransactionMerklePosition; }; /** * Return a transaction hash and optionally a merkle proof, given a block height and a position in the block. * * @memberof Blockchain.Transaction */ type TransactionIdFromPosRequest = { /** Must be: 'blockchain.transaction.id_from_pos'. */method: 'blockchain.transaction.id_from_pos'; /** The main chain block height, a non-negative integer. */ height: BlockHeight; /** A zero-based index of the transaction in the given block, an integer. */ tx_pos: TransactionMerklePosition; /** Whether a merkle proof should also be returned, a boolean. */ merkle?: boolean; }; /** * Transaction hash, or a dictionary with the transaction hash and merkle proof if requested. * * @memberof Blockchain.Transaction */ type TransactionIdFromPosWithProofResponse = { tx_hash: TransactionHash; merkle: TransactionMerkleProof; }; type TransactionIdFromPosResponse = TransactionHash | TransactionIdFromPosWithProofResponse; /** * Subscribe to a transaction in order to receive future notifications if its confirmation status changes. * * @memberof Blockchain.Transaction */ type TransactionSubscribeRequest = { /** Must be: 'blockchain.transaction.subscribe'. */method: 'blockchain.transaction.subscribe'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; }; /** * blockchain.transaction.subscribe * * @memberof Blockchain.Transaction */ type TransactionSubscribeResponse = TransactionGetHeightResponse; /** * Notification for blockchain.transaction.subscribe * * @event blockchain.transaction.subscribe * @memberof Blockchain.Transaction */ interface TransactionSubscribeNotification extends RPCBase { method: string; params: [TransactionHash, TransactionStatus]; } /** * Unsubscribe from a transaction, preventing future notifications if its confirmation status changes. * * @memberof Blockchain.Transaction */ type TransactionUnsubscribeRequest = { /** Must be: 'blockchain.transaction.unsubscribe'. */method: 'blockchain.transaction.unsubscribe'; /** The transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; }; /** * blockchain.transaction.unsubscribe * * @memberof Blockchain.Transaction */ type TransactionUnsubscribeResponse = boolean; //#endregion //#region source/interfaces/electrum/utxo.d.ts /** * Return information for an unspent transaction output. * * @memberof Blockchain.UTXO */ type UtxoGetInfoRequest = { /** Must be: 'blockchain.utxo.get_info'. */method: 'blockchain.utxo.get_info'; /** The UTXO’s transaction hash as a hexadecimal string. */ tx_hash: TransactionHash; /** The UTXO’s transaction output number. */ out_n: OutputIndex; }; /** * blockchain.utxo.get_info * * @memberof Blockchain.UTXO */ type UtxoGetInfoEntry = { confirmed_height?: BlockHeight; scripthash: string; value: Satoshis; token_data?: TokenData; }; type UtxoGetInfoResponse = null | UtxoGetInfoEntry; //#endregion //#region source/interfaces/electrum/mempool.d.ts /** * This file documents externally defined 3rd party interfaces, * so we need to disable some linting rules that cannot be enforced. * * Furthermore, the descriptions of theses interfaces are copied almost * verbatim from https://electrum-cash-protocol.readthedocs.io/en/latest/ */ /** * Return a histogram of the fee rates paid by transactions in the memory pool, weighted by transaction size. * * @memberof Mempool */ type GetFeeHistogramRequest = { /** Must be: 'mempool.get_fee_histogram'. */method: 'mempool.get_fee_histogram'; }; /** * The histogram is an array of [fee, vsize] pairs, where vsize is the cumulative virtual size of mempool transactions with a fee rate in the interval [fee n-1, fee n], and fee n-1 > fee n. * * Fee intervals may have variable size. The choice of appropriate intervals is currently not part of the protocol. * * @memberof Mempool */ type GetFeeHistogramEntry = []; type GetFeeHistogramResponse = GetFeeHistogramEntry[]; //#endregion //#region source/interfaces/electrum/server.d.ts /** * This file documents externally defined 3rd party interfaces, * so we need to disable some linting rules that cannot be enforced. * * Furthermore, the descriptions of theses interfaces are copied almost * verbatim from https://electrum-cash-protocol.readthedocs.io/en/latest/ */ /** * A newly-started server uses this call to get itself into other servers’ peers lists. It should not be used by wallet clients. * * @memberof Blockchain.Server */ type AddPeerRequest = { /** Must be: 'server.add_peer'. */method: 'server.add_peer'; /** TODO: Document the features and set correct type for it. */ features: unknown; }; /** * A boolean indicating whether the request was tentatively accepted. The requesting server will appear in server.peers.subscribe() when further sanity checks complete successfully. * * @memberof Blockchain.Server */ type AddPeerResponse = boolean; /** * Return a banner to be shown in the Electrum console. * * @memberof Server */ type BannerRequest = { /** Must be: 'server.banner'. */method: 'server.banner'; }; /** * A string. * * @memberof Blockchain.Server */ type BannerResponse = string; /** * Return a server donation address. * * @memberof Blockchain.Server */ type DonationAddressRequest = { /** Must be: 'server.donation_address'. */method: 'server.donation_address'; }; /** * A string. * * @memberof Blockchain.Server */ type DonationAddressResponse = string; /** * Return a list of features and services supported by the server. * * @memberof Blockchain.Server */ type FeaturesRequest = { /** Must be: 'server.features'. */method: 'server.features'; }; /** * A dictionary of keys and values. Each key represents a feature or service of the server, and the value gives additional information. * * @memberof Blockchain.Server */ type FeaturesResponse = unknown; /** * Return a list of peer servers. * * @note Despite the name this is not a subscription and the server will send no notifications. * * @memberof Blockchain.Server */ type PeersSubscribeRequest = { /** Must be: 'server.peers.subscribe'. */method: 'server.peers.subscribe'; }; /** * An array of peer servers, each returned as a 3-element array. * * @memberof Blockchain.Server */ type PeersSubscribeFeatures = { [index: number]: string; }; type PeersSubscribeEntry = { [index: number]: string | PeersSubscribeFeatures; }; type PeersSubscribeResponse = PeersSubscribeEntry; /** * Ping the server to ensure it is responding, and to keep the session alive. * * @memberof Blockchain.Server */ type PingRequest = { /** Must be: 'server.ping'. */method: 'server.ping'; }; /** * Returns null. * * @memberof Blockchain.Server */ type PingResponse = null; /** * Identify the client to the server and negotiate the protocol version. * * @note Only the first server.version() message is accepted. * * @memberof Blockchain.Server */ type VersionRequest = { /** Must be: 'server.version'. */method: 'server.version'; /** A string identifying the connecting client software. */ client_name?: string; /** An array [protocol_min, protocol_max], each of which is a string. If protocol_min and protocol_max are the same, they can be passed as a single string rather than as an array of two strings, as for the default value. */ protocol_version?: string | string[]; }; /** * An array of 2 strings: [server_software_version, protocol_version], * identifying the server and the protocol version that will be used for future communication. * * @memberof Blockchain.Server */ type VersionResponseEntry = { [index: number]: string; }; type VersionResponse = VersionResponseEntry; //#endregion //#region source/interfaces/electrum/notifications.d.ts type ElectrumNotification = AddressSubscribeNotification | TransactionSubscribeNotification | TransactionDsProofNotification | HeadersSubscribeNotification | ScriptHashSubscribeNotification; //#endregion //#region source/interfaces/protocol.d.ts interface ElectrumProtocolEvents extends ElectrumClientEvents { /** * ... * @eventProperty */ 'blockchain.address.subscribe': [AddressSubscribeNotification]; /** * ... * @eventProperty */ 'blockchain.scripthash.subscribe': [ScriptHashSubscribeNotification]; /** * ... * @eventProperty */ 'blockchain.transaction.subscribe': [TransactionSubscribeNotification]; /** * ... * @eventProperty */ 'blockchain.transaction.dsproof.subscribe': [TransactionDsProofNotification]; /** * ... * @eventProperty */ 'blockchain.headers.subscribe': [HeadersSubscribeNotification]; } //#endregion //#region source/requests/address.d.ts /** * @module Address * @memberof Network */ /** * Fetches a balance for a given address. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param address - The address to fetch balance for. * @param includeSatoshis - If the balance should include outputs that does not have tokens on them. * @param includeTokens - If the balance should include outputs that have tokens on them. * * @returns the number of confirmed and unconfirmed satoshis on the relevant outputs. */ declare const fetchBalance: (electrumClient: ElectrumClient, address: Address, includeSatoshis?: boolean, includeTokens?: boolean) => Promise; /** * Fetches the first time an address was used on-chain or in mempool. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param address - The address to fetch first on-chain presence for. * * @returns the block height, block hash and transaction hash relating to this address first usage on-chain. */ declare const fetchAddressFirstUse: (electrumClient: ElectrumClient, address: Address) => Promise; /** * Fetches the transaction history for an address. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param address - The address to fetch transaction history for. * @param fromHeight - Limit transactions to those included in this and later blocks, if provided. * @param toHeightExclusive - Limit transactions to those included before this block, if provided. * * @returns the transactions that make up the on-chain history requested. */ declare const fetchHistory: (electrumClient: ElectrumClient, address: Address, fromHeight?: BlockHeight, toHeightExclusive?: BlockHeight) => Promise; /** * Fetches a list of transactions related to an address, that are currently unconfirmed in the mempool. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param address - The address to fetch mempool transactions for. * * @returns the list of related transactions in the mempool. */ declare const fetchPendingTransactions: (electrumClient: ElectrumClient, address: Address) => Promise; /** * Fetches a list of transaction outputs that are ready to be spent. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param address - The address to fetch a list of unspent transaction outputs for. * @param includeSatoshis - If the list should include outputs that does not have tokens on them. * @param includeTokens - If the list should include outputs that have tokens on them. * * @return a list of unspent transaction outputs. */ declare const fetchUnspentTransactionOutputs: (electrumClient: ElectrumClient, address: Address, includeSatoshis?: boolean, includeTokens?: boolean) => Promise; /** * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * * @note before calling a subscription related method, you should set up an event listener to handle the generated notifications. */ declare const subscribeToAddressUpdates: (electrumClient: ElectrumClient, address: Address) => Promise; /** * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. */ declare const unsubscribeFromAddressUpdates: (electrumClient: ElectrumClient, address: Address) => Promise; //#endregion //#region source/requests/headers.d.ts /** * @module Blockchain * @memberof Network */ /** * Fetches the current block header for a given block height from the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param blockHeight - block height to get block header for. * * @returns the block header as a hex-encoded string. */ declare const fetchBlockHeaderFromBlockHeight: (electrumClient: ElectrumClient, blockHeight: BlockHeight) => Promise; /** * Fetches the current block header with an inclusion proof for a given block height from the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param blockHeight - block height to get block header for. * @param checkpointHeight - block height of the checkpoint to use as the base of the inclusion proof. * * @returns the block header with inclusion proof. */ declare const fetchBlockHeaderWithProofFromBlockHeight: (electrumClient: ElectrumClient, blockHeight: BlockHeight, checkpointHeight: BlockHeight) => Promise; /** * Fetches the one or more block headers starting at a given height. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param startingBlockHeight - block height for the first block header to request. * @param count - the maximum number of block headers to request. * * @returns a list of block headers. */ declare const fetchBlockHeaders: (electrumClient: ElectrumClient, startingBlockHeight: BlockHeight, count: number) => Promise>; /** * Fetches a given header from the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param blockheaderHashOrHeight - the hash of the header to fetch, or the block height of the headers inclusion in the current chain. * * @returns the header requested from the network. */ declare const fetchBlockHeader: (electrumClient: ElectrumClient, blockheaderHashOrHeight: BlockHeaderHash | BlockHeight) => Promise; /** * Fetches the current chain tip from the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * * @returns the current block height and block hash of the current chain tip. */ declare const fetchCurrentChainTip: (electrumClient: ElectrumClient) => Promise; /** * Subscribes to new block headers. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * * @note before calling a subscription related method, you should set up an event listener to handle the generated notifications. */ declare const subscribeToBlockheaderUpdates: (electrumClient: ElectrumClient) => Promise; /** * Unsubscribes from new block headers. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. */ declare const unsubscribeFromBlockheaderUpdates: (electrumClient: ElectrumClient) => Promise; //#endregion //#region source/requests/scripthash.d.ts /** * @module Scripthash * @memberof Network */ /** * Fetches a balance for a given script hash. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - The script hash to fetch balance for. * @param includeSatoshis - If the balance should include outputs that does not have tokens on them. * @param includeTokens - If the balance should include outputs that have tokens on them. * * @returns the number of confirmed and unconfirmed satoshis on the relevant outputs. */ declare const fetchScriptHashBalance: (electrumClient: ElectrumClient, scriptHash: ScriptHash, includeSatoshis?: boolean, includeTokens?: boolean) => Promise; /** * Fetches the first time a script hash was used on-chain or in mempool. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - The script hash to fetch first on-chain presence for. * * @returns the block height, block hash and transaction hash relating to this script hash first usage on-chain. */ declare const fetchScriptHashFirstUse: (electrumClient: ElectrumClient, scriptHash: ScriptHash) => Promise; /** * Fetches the transaction history for a script hash. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - The script hash to fetch transaction history for. * @param fromHeight - Limit transactions to those included in this and later blocks, if provided. * @param toHeightExclusive - Limit transactions to those included before this block, if provided. * * @returns the transactions that make up the on-chain history requested. */ declare const fetchScriptHashHistory: (electrumClient: ElectrumClient, scriptHash: ScriptHash, fromHeight?: BlockHeight, toHeightExclusive?: BlockHeight) => Promise; /** * Fetches a list of transactions related to a script hash, that are currently unconfirmed in the mempool. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - The script hash to fetch mempool transactions for. * * @returns the list of related transactions in the mempool. */ declare const fetchScriptHashPendingTransactions: (electrumClient: ElectrumClient, scriptHash: ScriptHash) => Promise; /** * Fetches a list of transaction outputs that are ready to be spent. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - The script hash to fetch a list of unspent transaction outputs for. * @param includeSatoshis - If the list should include outputs that does not have tokens on them. * @param includeTokens - If the list should include outputs that have tokens on them. * * @return a list of unspent transaction outputs. */ declare const fetchScriptHashUnspentTransactionOutputs: (electrumClient: ElectrumClient, scriptHash: ScriptHash, includeSatoshis?: boolean, includeTokens?: boolean) => Promise; /** * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - the script hash to monitor for status updates. * * @note before calling a subscription related method, you should set up an event listener to handle the generated notifications. */ declare const subscribeToScriptHashUpdates: (electrumClient: ElectrumClient, scriptHash: ScriptHash) => Promise; /** * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param scriptHash - the script hash to stop monitoring for status updates. */ declare const unsubscribeFromScriptHashUpdates: (electrumClient: ElectrumClient, scriptHash: ScriptHash) => Promise; //#endregion //#region source/requests/transaction.d.ts /** * @module Transactions * @memberof Network */ /** * TODO: (later/never?) * blockchain.transaction.id_from_pos * blockchain.transaction.dsproof.list */ /** * Broadcasts a raw transaction to the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param transactionHex - the raw transaction to broadcast, as a hex-encoded string. * * @returns the transactionHash of the broadcasted transaction. */ declare const broadcastTransaction: (electrumClient: ElectrumClient, transactionHex: TransactionHex) => Promise; /** * Fetches a transaction from the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param transactionHash - hash of the transaction to fetch, as a hex-encoded string. * * @returns the transaction as a hex-encoded string. */ declare const fetchTransaction: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; /** * Fetches the block height that a given transaction was included in, or a number indicating it is present in the mempool * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param transactionHash - hash of the transaction to fetch a block height for. * * @returns the block height the transaction was included in, if available. */ declare const fetchTransactionBlockHeight: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; /** * Fetches the block hash, height and optionally header that a given transaction was included in. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param transactionHash - hash of the transaction to fetch a block height for. * @param includeHeader - if set to true, response includes the optional block header. * * @returns the block hash, height and header the transaction was included in, if available. */ declare const fetchTransactionConfirmation: (electrumClient: ElectrumClient, transactionHash: TransactionHash, includeHeader?: boolean) => Promise; /** * Fetches the transaction's merkle proof from the network. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * @param transactionHash - hex-encoded string of the transaction hash * @param blockHeight - number for the blockheight that transaction was stored in * * @throws if the network returns an invalid merkle proof. * @returns the merkle proof for the transaction, or undefined if transaction is still unconfirmed. */ declare const fetchTransactionProof: (electrumClient: ElectrumClient, transactionHash: TransactionHash, blockHeight: BlockHeight) => Promise; /** * TODO: Document me. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * * @note before calling a subscription related method, you should set up an event listener to handle the generated notifications. */ declare const subscribeToTransactionUpdates: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; /** * TODO: Document me. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. */ declare const unsubscribeFromTransactionUpdates: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; /** * TODO: Document me. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. */ declare const fetchDoublespendProof: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; /** * TODO: Document me. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. * * @note before calling a subscription related method, you should set up an event listener to handle the generated notifications. */ declare const subscribeToDoublespendUpdates: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; /** * TODO: Document me. * @group Requests * * @param electrumClient - an Electrum Client used to connect to the network. */ declare const unsubscribeFromDoublespendUpdates: (electrumClient: ElectrumClient, transactionHash: TransactionHash) => Promise; //#endregion //#region source/network.d.ts /** * Defines the required version of the electrum cash protocol * @group Setup */ declare const requiredProtocolVersion = "1.5.2"; /** * Extracts the major, minor and patch numbers from an electrum version string. * @ignore */ declare const extractVersionNumbers: (versionString: string) => Promise; /** * Utility function that verifies that a provided electrum version string is sufficient for usage in this library. * @group Setup * @internal */ declare const sufficientProtocolVersion: (providedVersion: string) => Promise; /** * Handler function for all electrum notifications. * * This function determines what type of notification has been provided and emits the * same notification it received, but with added type information. * @ignore */ declare const processElectrumNotifications: (notification: ElectrumNotification) => Promise; /** * Creates and initializes an electrum client in order * to provide typed electrum notification events. * * @emits blockchain.address.subscribe * @emits blockchain.scripthash.subscribe * @emits blockchain.transaction.subscribe * @emits blockchain.transaction.dsproof.subscribe * @emits blockchain.headers.subscribe * * @group Setup * * @param application - your application name, used to identify to the electrum host. * @param socketOrHostname - pre-configured electrum socket or fully qualified domain name or IP number of the host * @param options - optional settings that change the default behavior of the network connection. * * @returns an electrum client that provides fully typed electrum notifications. */ declare const initializeElectrumClient: (application: string, socketOrHostname: ElectrumSocket | string, options?: ElectrumNetworkOptions) => Promise>; //#endregion export { AddPeerRequest, AddPeerResponse, Address, AddressGetBalance, AddressGetBalanceRequest, AddressGetBalanceResponse, AddressGetFirstUseEntry, AddressGetFirstUseRequest, AddressGetFirstUseResponse, AddressGetHistoryEntry, AddressGetHistoryRequest, AddressGetHistoryResponse, AddressGetMempoolEntry, AddressGetMempoolRequest, AddressGetMempoolResponse, AddressGetScripthashRequest, AddressGetScripthashResponse, AddressListUnspentEntry, AddressListUnspentRequest, AddressListUnspentResponse, AddressStatus, AddressSubscribeNotification, AddressSubscribeRequest, AddressSubscribeResponse, AddressUnsubscribeRequest, AddressUnsubscribeResponse, BannerRequest, BannerResponse, BlockHeaderHash, BlockHeaderHex, BlockHeaderObject, BlockHeaderRequest, BlockHeaderResponse, BlockHeaderWithProofResponse, BlockHeadersRequest, BlockHeadersResponse, BlockHeadersWithProofResponse, BlockHeight, BlockMerklePosition, BlockMerkleProof, BlockMerkleRoot, DonationAddressRequest, DonationAddressResponse, DoubleSpendProofHash, DoubleSpendProofHex, DoubleSpendProofStatus, ElectrumNotification, ElectrumProtocolEvents, EstimateFeeRequest, EstimateFeeResponse, FeaturesRequest, FeaturesResponse, GetFeeHistogramEntry, GetFeeHistogramRequest, GetFeeHistogramResponse, HeaderGetRequest, HeaderGetResponse, HeadersGetTipRequest, HeadersGetTipResponse, HeadersSubscribeNotification, HeadersSubscribeRequest, HeadersSubscribeResponse, HeadersUnsubscribeRequest, HeadersUnsubscribeResponse, InputIdentifier, InputIndex, OutputIdentifier, OutputIndex, PeersSubscribeEntry, PeersSubscribeFeatures, PeersSubscribeRequest, PeersSubscribeResponse, PingRequest, PingResponse, RelayFeeRequest, RelayFeeResponse, RequestMethod, Satoshis, ScriptHash, ScriptHashGetBalance, ScriptHashGetBalanceRequest, ScriptHashGetBalanceResponse, ScriptHashGetFirstUseEntry, ScriptHashGetFirstUseRequest, ScriptHashGetFirstUseResponse, ScriptHashGetHistoryEntry, ScriptHashGetHistoryRequest, ScriptHashGetHistoryResponse, ScriptHashGetMempoolEntry, ScriptHashGetMempoolRequest, ScriptHashGetMempoolResponse, ScriptHashListUnspentEntry, ScriptHashListUnspentRequest, ScriptHashListUnspentResponse, ScriptHashStatus, ScriptHashSubscribeNotification, ScriptHashSubscribeRequest, ScriptHashSubscribeResponse, ScriptHashUnsubscribeRequest, ScriptHashUnsubscribeResponse, ScriptHex, TokenAmount, TokenCapabilities, TokenCategory, TokenCommitment, TokenData, TokenFilter, Transaction, TransactionBroadcastRequest, TransactionBroadcastResponse, TransactionDoublespendProofEntryGet, TransactionDoublespendProofGetRequest, TransactionDoublespendProofGetResponse, TransactionDoublespendProofSubscribeResponse, TransactionDoublespendProofUnsubscribeRequest, TransactionDsProofNotification, TransactionDsProofSubscribeRequest, TransactionDsProofUnsubscribeResponse, TransactionGetConfirmedBlockHashRequest, TransactionGetConfirmedBlockHashResponse, TransactionGetHeightRequest, TransactionGetHeightResponse, TransactionGetHeightUnconfirmed, TransactionGetHeightUnknown, TransactionGetMerkleRequest, TransactionGetMerkleResponse, TransactionGetRequest, TransactionGetResponse, TransactionGetVerboseBCHN, TransactionGetVerboseResponse, TransactionHash, TransactionHex, TransactionIdFromPosRequest, TransactionIdFromPosResponse, TransactionIdFromPosWithProofResponse, TransactionListDsProofsRequest, TransactionListDsProofsResponse, TransactionMerklePosition, TransactionMerkleProof, TransactionMerkleRoot, TransactionStatus, TransactionSubscribeNotification, TransactionSubscribeRequest, TransactionSubscribeResponse, TransactionUnsubscribeRequest, TransactionUnsubscribeResponse, UtxoGetInfoEntry, UtxoGetInfoRequest, UtxoGetInfoResponse, VersionNumbers, VersionRequest, VersionResponse, VersionResponseEntry, broadcastTransaction, extractVersionNumbers, fetchAddressFirstUse, fetchBalance, fetchBlockHeader, fetchBlockHeaderFromBlockHeight, fetchBlockHeaderWithProofFromBlockHeight, fetchBlockHeaders, fetchCurrentChainTip, fetchDoublespendProof, fetchHistory, fetchPendingTransactions, fetchScriptHashBalance, fetchScriptHashFirstUse, fetchScriptHashHistory, fetchScriptHashPendingTransactions, fetchScriptHashUnspentTransactionOutputs, fetchTransaction, fetchTransactionBlockHeight, fetchTransactionConfirmation, fetchTransactionProof, fetchUnspentTransactionOutputs, initializeElectrumClient, processElectrumNotifications, requiredProtocolVersion, subscribeToAddressUpdates, subscribeToBlockheaderUpdates, subscribeToDoublespendUpdates, subscribeToScriptHashUpdates, subscribeToTransactionUpdates, sufficientProtocolVersion, unsubscribeFromAddressUpdates, unsubscribeFromBlockheaderUpdates, unsubscribeFromDoublespendUpdates, unsubscribeFromScriptHashUpdates, unsubscribeFromTransactionUpdates }; //# sourceMappingURL=index.d.mts.map