import { HexString } from "./encoding"; export type BitcoinNetwork = "mainnet" | "testnet" | "regtest"; export type BlockHeader = { merkleRoot: HexString; target: HexString; timestamp: number; version: number; hash_: HexString; hashPrevBlock: HexString; nonce: number; }; export type MerkleProof = { blockHeader: BlockHeader; flagBits: Array; transactionsCount: number; hashes: Array; }; export type TransactionInputSource = "coinbase" | { fromOutput: [HexString, number]; }; export interface TransactionInput { source: TransactionInputSource; script: HexString; sequence: number; witness: Array; } export interface TransactionOutput { value: number; script: { bytes: HexString; }; } export type TransactionLocktime = { time: number; } | { blockHeight: number; }; export type Transaction = { version: number; inputs: Array; outputs: Array; lockAt: TransactionLocktime; }; export type TxStatus = { confirmed: boolean; confirmations: number; blockHeight?: number; blockHash?: string; };