import { Reader, Writer, ReaderUint8Array, WriterUint8Array } from '../primitives/utils.js'; import Transaction from './Transaction.js'; /** * A single bitcoin transaction associated with a `Beef` validity proof set. * * Simple case is transaction data included directly, either as raw bytes or fully parsed data, or both. * * Supports 'known' transactions which are represented by just their txid. * It is assumed that intended consumer of this beef already has validity proof for such a transaction, * which they can merge if necessary to create a valid beef. */ export default class BeefTx { _bumpIndex?: number; _tx?: Transaction; _rawTx?: Uint8Array; _txid?: string; inputTxids: string[]; /** * true if `hasProof` or all inputs chain to `hasProof`. * * Typically set by sorting transactions by proven dependency chains. */ isValid?: boolean; get bumpIndex(): number | undefined; set bumpIndex(v: number | undefined); get hasProof(): boolean; get isTxidOnly(): boolean; get txid(): string; get tx(): Transaction | undefined; /** * Raw transaction bytes, if available as number[] */ get rawTx(): number[] | undefined; /** * Raw transaction bytes, if available as Uint8Array */ get rawTxUint8Array(): Uint8Array | undefined; /** * @param tx If string, must be a valid txid. If `number[]` must be a valid serialized transaction. * @param bumpIndex If transaction already has a proof in the beef to which it will be added. */ constructor(tx: Transaction | Uint8Array | number[] | string, bumpIndex?: number); static fromTx(tx: Transaction, bumpIndex?: number): BeefTx; static fromRawTx(rawTx: Uint8Array | number[], bumpIndex?: number): BeefTx; static fromTxid(txid: string, bumpIndex?: number): BeefTx; private updateInputTxids; toWriter(writer: Writer | WriterUint8Array, version: number): void; static fromReader(br: Reader | ReaderUint8Array, version: number): BeefTx; } //# sourceMappingURL=BeefTx.d.ts.map