UNPKG

@bsv/wallet-toolbox-client

Version:
71 lines 4.07 kB
import { Transaction as BsvTransaction, Beef, ChainTracker } from '@bsv/sdk'; import { ServiceCollection } from './ServiceCollection'; import { WhatsOnChain } from './providers/WhatsOnChain'; import { ARC } from './providers/ARC'; import { Bitails } from './providers/Bitails'; import { BaseBlockHeader, BlockHeader, FiatExchangeRates, GetMerklePathResult, GetMerklePathService, GetRawTxResult, GetRawTxService, GetScriptHashHistoryResult, GetScriptHashHistoryService, GetStatusForTxidsResult, GetStatusForTxidsService, GetUtxoStatusOutputFormat, GetUtxoStatusResult, GetUtxoStatusService, PostBeefResult, PostBeefService, ServicesCallHistory, UpdateFiatExchangeRateService, WalletServices, WalletServicesOptions } from '../sdk/WalletServices.interfaces'; import { Chain } from '../sdk/types'; import { TableOutput } from '../storage/schema/tables/TableOutput'; export declare class Services implements WalletServices { static createDefaultOptions(chain: Chain): WalletServicesOptions; options: WalletServicesOptions; whatsonchain: WhatsOnChain; arcTaal: ARC; arcGorillaPool?: ARC; bitails: Bitails; getMerklePathServices: ServiceCollection<GetMerklePathService>; getRawTxServices: ServiceCollection<GetRawTxService>; postBeefServices: ServiceCollection<PostBeefService>; getUtxoStatusServices: ServiceCollection<GetUtxoStatusService>; getStatusForTxidsServices: ServiceCollection<GetStatusForTxidsService>; getScriptHashHistoryServices: ServiceCollection<GetScriptHashHistoryService>; updateFiatExchangeRateServices: ServiceCollection<UpdateFiatExchangeRateService>; chain: Chain; constructor(optionsOrChain: Chain | WalletServicesOptions); getServicesCallHistory(reset?: boolean): ServicesCallHistory; getChainTracker(): Promise<ChainTracker>; getBsvExchangeRate(): Promise<number>; getFiatExchangeRate(currency: 'USD' | 'GBP' | 'EUR', base?: 'USD' | 'GBP' | 'EUR'): Promise<number>; get getProofsCount(): number; get getRawTxsCount(): number; get postBeefServicesCount(): number; get getUtxoStatsCount(): number; getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>; /** * @param script Output script to be hashed for `getUtxoStatus` default `outputFormat` * @returns script hash in 'hashLE' format, which is the default. */ hashOutputScript(script: string): string; isUtxo(output: TableOutput): Promise<boolean>; getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean): Promise<GetUtxoStatusResult>; getScriptHashHistory(hash: string, useNext?: boolean): Promise<GetScriptHashHistoryResult>; postBeefMode: 'PromiseAll' | 'UntilSuccess'; /** * * @param beef * @param chain * @returns */ postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult[]>; getRawTx(txid: string, useNext?: boolean): Promise<GetRawTxResult>; invokeChaintracksWithRetry<R>(method: () => Promise<R>): Promise<R>; getHeaderForHeight(height: number): Promise<number[]>; getHeight(): Promise<number>; hashToHeader(hash: string): Promise<BlockHeader>; getMerklePath(txid: string, useNext?: boolean): Promise<GetMerklePathResult>; targetCurrencies: string[]; updateFiatExchangeRates(rates?: FiatExchangeRates, updateMsecs?: number): Promise<FiatExchangeRates>; nLockTimeIsFinal(tx: string | number[] | BsvTransaction | number): Promise<boolean>; getBeefForTxid(txid: string): Promise<Beef>; } export declare function validateScriptHash(output: string, outputFormat?: GetUtxoStatusOutputFormat): string; /** * Serializes a block header as an 80 byte array. * The exact serialized format is defined in the Bitcoin White Paper * such that computing a double sha256 hash of the array computes * the block hash for the header. * @returns 80 byte array * @publicbody */ export declare function toBinaryBaseBlockHeader(header: BaseBlockHeader): number[]; //# sourceMappingURL=Services.d.ts.map