@node-dlc/messaging
Version:
DLC Messaging Protocol
58 lines (57 loc) • 1.65 kB
TypeScript
/// <reference types="node" />
import { Sequence, Tx } from '@node-dlc/bitcoin';
import { MessageType } from '../MessageType';
import { IDlcMessage } from './DlcMessage';
export declare abstract class FundingInput {
static deserialize(buf: Buffer): FundingInputV0;
abstract type: number;
abstract length: bigint;
abstract toJSON(): IFundingInputV0JSON;
abstract serialize(): Buffer;
}
/**
* FundingInput V0 contains information about a specific input to be used
* in a funding transaction, as well as its corresponding on-chain UTXO.
*/
export declare class FundingInputV0 extends FundingInput implements IDlcMessage {
static type: MessageType;
/**
* Deserializes an funding_input_v0 message
* @param buf
*/
static deserialize(buf: Buffer): FundingInputV0;
/**
* The type for funding_input_v0 message. funding_input_v0 = 42772
*/
type: MessageType;
length: bigint;
inputSerialId: bigint;
prevTx: Tx;
prevTxVout: number;
sequence: Sequence;
maxWitnessLen: number;
redeemScript: Buffer;
scriptSigLength(): number;
/**
* Validates correctness of all fields
* @throws Will throw an error if validation fails
*/
validate(): void;
/**
* Converts funding_input_v0 to JSON
*/
toJSON(): IFundingInputV0JSON;
/**
* Serializes the funding_input_v0 message into a Buffer
*/
serialize(): Buffer;
}
export interface IFundingInputV0JSON {
type: number;
inputSerialId: number;
prevTx: string;
prevTxVout: number;
sequence: number;
maxWitnessLen: number;
redeemScript: string;
}