UNPKG

@btc-vision/transaction

Version:

OPNet transaction library allows you to create and sign transactions for the OPNet network.

43 lines (42 loc) 2.24 kB
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 { IMineableReward } from '../mineable/ChallengeGenerator.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 preimage: Buffer; protected readonly rewardChallenge: IMineableReward; 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; getPreimage(): Buffer; 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>; private createMineableRewardOutputs; private getPubKeys; private generateRedeemScripts; }