@btc-vision/transaction
Version:
OPNet transaction library allows you to create and sign transactions for the OPNet network.
43 lines (42 loc) • 1.76 kB
TypeScript
import { P2TRPayment, Psbt, PsbtInput, Stack } from '@btc-vision/bitcoin';
import { TransactionType } from '../enums/TransactionType.js';
import { TapLeafScript } from '../interfaces/Tap.js';
import { SharedInteractionParameters } from '../interfaces/ITransactionParameters.js';
import { TransactionBuilder } from './TransactionBuilder.js';
export interface ICustomTransactionParameters extends Omit<SharedInteractionParameters, 'challenge'> {
script: (Buffer | Stack)[];
witnesses: Buffer[];
annex?: Buffer;
to: string;
}
export declare class CustomScriptTransaction extends TransactionBuilder<TransactionType.CUSTOM_CODE> {
type: TransactionType.CUSTOM_CODE;
protected readonly _scriptAddress: string;
protected tapLeafScript: TapLeafScript | null;
private targetScriptRedeem;
private leftOverFundsScriptRedeem;
private readonly compiledTargetScript;
private readonly scriptTree;
private generator;
private readonly scriptSeed;
private readonly contractSigner;
private readonly randomBytes;
private readonly witnesses;
private readonly annexData?;
constructor(parameters: ICustomTransactionParameters);
get scriptAddress(): string;
get p2trAddress(): string;
getRndBytes(): Buffer;
protected contractSignerXOnlyPubKey(): Buffer;
protected buildTransaction(): Promise<void>;
protected signInputs(transaction: Psbt): Promise<void>;
protected generateScriptAddress(): P2TRPayment;
protected generateTapData(): P2TRPayment;
protected getScriptSolution(input: PsbtInput): Buffer[];
private getContractSeed;
private customFinalizer;
private getPubKeys;
private generateRedeemScripts;
private getLeafScript;
private getScriptTree;
}