@btc-vision/transaction
Version:
OPNet transaction library allows you to create and sign transactions for the OPNet network.
44 lines (43 loc) • 2.34 kB
TypeScript
import { P2TRPayment, Psbt, PsbtInput, Signer, Taptree } from '@btc-vision/bitcoin';
import { ECPairInterface } from 'ecpair';
import { TransactionBuilder } from './TransactionBuilder.js';
import { TransactionType } from '../enums/TransactionType.js';
import { CalldataGenerator } from '../../generators/builders/CalldataGenerator.js';
import { SharedInteractionParameters } from '../interfaces/ITransactionParameters.js';
import { ChallengeSolution } from '../../epoch/ChallengeSolution.js';
import { IP2WSHAddress } from '../mineable/IP2WSHAddress.js';
export declare abstract class SharedInteractionTransaction<T extends TransactionType> extends TransactionBuilder<T> {
static readonly MAXIMUM_CALLDATA_SIZE: number;
readonly randomBytes: Buffer;
protected targetScriptRedeem: P2TRPayment | null;
protected leftOverFundsScriptRedeem: P2TRPayment | null;
protected abstract readonly compiledTargetScript: Buffer;
protected abstract readonly scriptTree: Taptree;
protected readonly challenge: ChallengeSolution;
protected readonly epochChallenge: IP2WSHAddress;
protected calldataGenerator: CalldataGenerator;
protected readonly calldata: Buffer;
protected abstract readonly contractSecret: Buffer;
protected readonly scriptSigner: Signer | ECPairInterface;
protected readonly disableAutoRefund: boolean;
protected constructor(parameters: SharedInteractionParameters);
getContractSecret(): Buffer;
getRndBytes(): Buffer;
getChallenge(): ChallengeSolution;
protected scriptSignerXOnlyPubKey(): Buffer;
protected generateKeyPairFromSeed(): ECPairInterface;
protected buildTransaction(): Promise<void>;
protected signInputs(transaction: Psbt): Promise<void>;
protected generateScriptAddress(): P2TRPayment;
protected generateTapData(): P2TRPayment;
protected getScriptSolution(input: PsbtInput): Buffer[];
protected getScriptTree(): Taptree;
protected customFinalizer: (_inputIndex: number, input: PsbtInput) => {
finalScriptWitness: Buffer<ArrayBufferLike>;
};
protected signInputsWalletBased(transaction: Psbt): Promise<void>;
protected signInputsNonWalletBased(transaction: Psbt): Promise<void>;
protected createMineableRewardOutputs(): Promise<void>;
private getPubKeys;
private generateRedeemScripts;
}