import { TransportScheme, ElectrumClient } from "@electrum-cash/network"; import { ElectrumServers } from "@electrum-cash/servers"; import { BlockHeight, TransactionHash, TransactionHex, TransactionGetMerkleResponse, BlockHeaderHash, BlockHeaderHex, Address } from "@electrum-cash/protocol"; import { EventEmitter } from "events"; /** * Export the electrum network providers. * @ignore */ export const electrumClients: Map; /** * Connects to the electrum network with the provided servers. * @ignore * * @param application {string} name of the application to identify as with the servers. * @param transport {TransportScheme} which electrum transport to use when connecting with the servers. * @param servers {ElectrumServers} list of electrum backend servers to connect with. */ export function initializeElectrumNetwork(application: string, transport?: TransportScheme, servers?: ElectrumServers): Promise; /** * Disconnects from the electrum network and cleans up related resources. * @ignore */ export function stopElectrumNetwork(): Promise; /** * @module ElectrumApplication */ /** * Gets a raw transaction as a hex-encoded string. * @group Requests * * @param transactionHash {TransactionHash} - hash of the transaction to use as an identifier. * * @returns {Promise} the transaction as a hex-encoded string. */ export function getTransaction(transactionHash: TransactionHash): Promise; /** * Gets a transaction inclusion proof. * @group Requests * * @param transactionHash {TransactionHash} - hash of the transaction to use as an identifier. * @param blockHeight {BlockHeight} - the height in the blockchain the transaction was included in. * * @returns {Promise} the transaction inclusion proof, or undefined if it is still in the mempool. */ export function getTransactionInclusionProof(transactionHash: TransactionHash, blockHeight: BlockHeight): Promise; /** * @module Blockchain * @ignore */ /** * Validates the merkle proof used to verify block inclusion in the chain defined by a trusted checkpoint. * * @ignore */ export function verifyBlockInclusionProof(blockHash: BlockHeaderHash, blockHeight: BlockHeight, merkleBranches: Array, merkleRootHash: string): Promise; /** * Validates the merkle proof used to verify transaction inclusion in a provided block. * * @ignore */ export function verifyTransactionInclusionProof(transactionHash: TransactionHash, merklePosition: number, merkleBranches: Array, merkleRootHash: string): Promise; /** * TODO: Document me. * @group Requests */ export function getBlockHashFromHeader(header: string): Promise; /** * TODO: Document me. * @group Requests */ export function getMerkleRootFromHeader(header: string): Promise; /** * @module ElectrumApplication */ /** * Gets a raw block header as a hex-encoded string, based on the provided block header hash. * @group Requests * * @param blockHeaderHash {BlockHeaderHash} - hash of the block header to use as an identifier. * * @returns {Promise} the block header as a hex-encoded string. */ export function getBlockHeader(blockHeaderHash: BlockHeaderHash): Promise; /** * Gets the block height where the provided block header hash was included in the chain. * @group Requests * * @param blockHeaderHash {BlockHeaderHash} hash of the block header to store. * * @returns {Promise} */ export function getBlockHeightFromHash(blockHeaderHash: BlockHeaderHash): Promise; /** * Gets a raw block header as a hex-encoded string, based on the provided block height. * @group Requests * * @param blockHeight {BlockHeight} block height of the block * * @returns {Promise} */ export function getBlockHeaderFromHeight(blockHeight: BlockHeight): Promise; /** * Subscribes to block updates and emits events when the chain status updates. * @group Monitoring * * @emits BlockReceived * @emits BlockVerified * @emits ChainStatus */ export function monitorBlockchain(): Promise; /** * Subscribes to address updates and emits events when the address history changes. * * Note that any transaction that relates to the address history, will automatically be monitored as well. * @group Monitoring * * @emits AddressBalance? * @emits AddressHistory? * * @param address {Address} - The address to monitor for changes. */ export function monitorAddress(address: Address): Promise; /** * Subscribes to transaction updates and emits events when the transaction status changes. * @group Monitoring * * @emits TransactionReceived * @emits TransactionVerified * @emits TransactionDoubleSpendDetected * * @param transactionHash {TransactionHash} - The transaction to monitor for changes. */ export function monitorTransaction(transactionHash: TransactionHash): Promise; /** * Initializes a light client that implements the Simple Payment Verification protocol transparently for the user. * @group Setup * * @param application {string} name of the application to identify as with the servers. * @param transport {TransportScheme} which electrum transport to use when connecting with the servers. * @param servers {ElectrumServers} list of electrum backend servers to connect with. * * @returns an event emitter for the electrum application events. */ export function initializeElectrumApplication(application: string, transport?: TransportScheme, servers?: ElectrumServers): Promise; //# sourceMappingURL=index.d.ts.map