UNPKG

chaingate

Version:

A complete TypeScript library for connecting to and making transactions on different blockchains

99 lines (98 loc) 3.42 kB
import { CurrencyUtils } from '../../CurrencyUtils'; import { Client } from '@hey-api/client-fetch'; import { CurrencyInfo } from '../../../CurrencyInfo'; import { GlobalMarketsResponse, UtxoNetworkKey } from '../../../../Client'; import { TtlCache } from '../../../../InternalUtils/TtlCache'; import { CurrencyAmount } from '../../CurrencyAmount'; import { NetworkParams } from './NetworkParams'; export declare abstract class UtxoCurrencyUtils<CI extends CurrencyInfo> extends CurrencyUtils<CI> { protected readonly network: UtxoNetworkKey; protected readonly networkParams: NetworkParams; protected readonly signHeader: string; protected constructor(client: Client, currencyInfo: CI, markets: TtlCache<GlobalMarketsResponse>, network: UtxoNetworkKey, networkParams: NetworkParams, signHeader: string); addressUtxos(address: string, page?: number): Promise<{ page: number; utxos: { txid: string; script: Uint8Array<ArrayBufferLike>; amount: CurrencyAmount<CI>; n: number; }[]; }>; addressBalance(address: string): Promise<{ confirmed: CurrencyAmount<CI>; unconfirmed: CurrencyAmount<CI>; }>; addressHistory(address: string, page?: number): Promise<{ transactions: { amount: CurrencyAmount<CI>; addressBalance: CurrencyAmount<CI>; txid: string; height: number; }[]; page: number; }>; broadcastTransaction(transactionRaw: string | Uint8Array): Promise<{ transactionId: string; }>; transactionDetails(transactionId: string): Promise<{ blockHeight: number; fee: CurrencyAmount<CI>; feePerKb: CurrencyAmount<CI>; timestamp: number; inputs: { address: string; amount: CurrencyAmount<CI>; n: import("decimal.js").Decimal; script: Uint8Array<ArrayBufferLike>; scriptSig: Uint8Array<ArrayBufferLike>; }[]; outputs: { address: string; amount: CurrencyAmount<CI>; n: import("decimal.js").Decimal; script: Uint8Array<ArrayBufferLike>; }[]; rawTransaction: string; }>; getFeeRate(): Promise<{ low: { feePerKb: CurrencyAmount<CI>; confirmationTimeSecs: number; }; normal: { feePerKb: CurrencyAmount<CI>; confirmationTimeSecs: number; }; high: { feePerKb: CurrencyAmount<CI>; confirmationTimeSecs: number; }; maximum: { feePerKb: CurrencyAmount<CI>; confirmationTimeSecs: number; }; }>; latestBlock(): Promise<import("../../../../Client").Block>; mempoolTransactions(): Promise<import("../../../../Client").TxoMempoolResponse>; blockByHeight(blockHeight: number): Promise<{ txs: Array<string>; difficulty: number; nonce: number; sizeBytes: number; timestamp: number; height: number; parentHash: string; hash: string; }>; blocByHash(blockHash: string): Promise<{ txs: Array<string>; difficulty: number; nonce: number; sizeBytes: number; timestamp: number; height: number; parentHash: string; hash: string; }>; }