UNPKG

@btc-vision/transaction

Version:

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

138 lines 3.47 kB
import { Psbt, type PsbtInput } from '@btc-vision/bitcoin'; import { TransactionType } from '../enums/TransactionType.js'; import type { TapLeafScript } from '../interfaces/Tap.js'; import { TransactionBuilder } from './TransactionBuilder.js'; import type { TapPayment } from '../shared/TweakedTransaction.js'; import type { ICustomTransactionParameters } from '../interfaces/ICustomTransactionParameters.js'; /** * Class for interaction transactions * @class CustomScriptTransaction */ export declare class CustomScriptTransaction extends TransactionBuilder<TransactionType.CUSTOM_CODE> { type: TransactionType.CUSTOM_CODE; /** * The contract address * @protected */ protected readonly _scriptAddress: string; /** * The tap leaf script * @private */ protected tapLeafScript: TapLeafScript | null; /** * The target script redeem * @private */ private targetScriptRedeem; /** * The left over funds script redeem * @private */ private leftOverFundsScriptRedeem; /** * The compiled target script * @private */ private readonly compiledTargetScript; /** * The script tree * @private */ private readonly scriptTree; /** * The deployment bitcoin generator * @private */ private generator; /** * The contract seed * @private */ private readonly scriptSeed; /** * The contract signer * @private */ private readonly contractSigner; /** * The contract salt random bytes * @private */ private readonly randomBytes; /** * The witnesses * @private */ private readonly witnesses; private readonly annexData?; constructor(parameters: ICustomTransactionParameters); /** * @description Get the contract address (PKSH) */ get scriptAddress(): string; /** * @description Get the P2TR address */ get p2trAddress(): string; exportCompiledTargetScript(): Uint8Array; /** * Get the random bytes used for the interaction * @returns {Uint8Array} The random bytes */ getRndBytes(): Uint8Array; /** * Get the contract signer public key * @protected */ protected contractSignerXOnlyPubKey(): Uint8Array; /** * Build the transaction * @protected */ protected buildTransaction(): Promise<void>; /** * Sign the inputs * @param {Psbt} transaction The transaction to sign * @protected */ protected signInputs(transaction: Psbt): Promise<void>; /** * Get the tap output * @protected */ protected generateScriptAddress(): TapPayment; /** * Generate the tap data * @protected */ protected generateTapData(): TapPayment; protected getScriptSolution(input: PsbtInput): Uint8Array[]; /** * Generate the contract seed for the deployment * @private */ private getContractSeed; /** * Finalize the transaction * @param _inputIndex * @param input */ private customFinalizer; /** * Generate the redeem scripts * @private */ private generateRedeemScripts; /** * Get the second leaf script * @private */ private getLeafScript; /** * Get the script tree * @private */ private getScriptTree; } //# sourceMappingURL=CustomScriptTransaction.d.ts.map