import { SmartContractLib } from '../smartContractLib.js'; import { ByteString, TxOut, TxIn, Addr, UInt64 } from '../types/index.js'; /** * Library for parsing and constructing transactions * @category Library * @onchain */ export declare class TxUtils extends SmartContractLib { /** if a output satoshi value is zero */ static readonly ZERO_SATS: UInt64; /** * Build serialized tx output * @param script serialized locking script of the output * @param satoshis serialized satoshis of the output * @returns serialized tx output in format ByteString */ static buildOutput(scriptHash: ByteString, satoshis: UInt64): ByteString; /** * Build serialized tx output * @param script serialized locking script of the output * @param satoshis serialized satoshis of the output * @returns serialized tx output in format ByteString */ static buildDataOutput(scriptHash: ByteString, satoshis: UInt64, dataHash: ByteString): ByteString; /** * Build serialized change output * @param change change output to build * @returns serialized change output in format ByteString */ static buildChangeOutput(change: TxOut): ByteString; /** * Merge tx input into a ByteString * @param txInput tx input, must be a segwit input * @returns serialized tx input */ static mergeInput(txInput: TxIn): ByteString; /** * build `OP_RETURN` script from data payload * @param {ByteString} data the data payload * @returns {ByteString} a ByteString contains the data payload */ static buildOpReturnOutput(data: ByteString): ByteString; /** * constructs a P2PKH script from a given PubKeyHash * @param {PubKeyHash} pubKeyHash - the recipient's public key hash * @returns {ByteString} a `ByteString` representing the P2PKH script */ static buildP2PKHScript(addr: Addr): ByteString; /** * constructs a P2PKH output from a given PubKeyHash and satoshi amount * @param {Addr} addr - the recipient's public key hash * @param {Int32} amount - the satoshi amount * @returns {ByteString} a `ByteString` representing the P2PKH output */ static buildP2PKHOutput(amount: UInt64, addr: Addr): ByteString; /** * build `OP_FALSE OP_RETURN` script from data payload * @param {ByteString} data the data payload * @returns {ByteString} a ByteString contains the data payload */ static buildOpreturnScript(data: ByteString): ByteString; /** * convert a `UInt64` number to 8 bytes in little-end order. * @param {UInt64} n - the satoshi amount * @returns {ByteString} a `ByteString` */ static satoshisToByteString(n: UInt64): ByteString; /** * convert a `ByteString` to a `UInt64` number * @param {ByteString} bs - the satoshi amount * @returns {UInt64} a `UInt64` */ static byteStringToSatoshis(bs: ByteString): UInt64; } //# sourceMappingURL=txUtils.d.ts.map