UNPKG

@btc-vision/transaction

Version:

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

56 lines 1.98 kB
import { type Network, type PublicKey, type XOnlyPublicKey } from '@btc-vision/bitcoin'; import { BinaryWriter } from '../buffer/BinaryWriter.js'; import { type Feature, Features } from './Features.js'; /** Bitcoin Script Generator */ export declare abstract class Generator { /** * The maximum size of a data chunk */ static readonly DATA_CHUNK_SIZE: number; /** * The magic number of OPNet */ static readonly MAGIC: Uint8Array; /** * The public key of the sender * @protected */ protected readonly senderPubKey: Uint8Array; /** * The public key of the sender * @protected */ protected readonly xSenderPubKey: Uint8Array; /** * The public key of the contract salt * @protected */ protected readonly contractSaltPubKey?: Uint8Array | undefined; /** * The network to use * @protected */ protected readonly network: Network; protected constructor(senderPubKey: PublicKey | XOnlyPublicKey, contractSaltPubKey?: Uint8Array, network?: Network); buildHeader(features: Features[]): Uint8Array; getHeader(maxPriority: bigint, features?: Features[]): Uint8Array; /** * Compile the script * @param args - The arguments to use when compiling the script * @returns {Uint8Array} - The compiled script */ abstract compile(...args: unknown[]): Uint8Array; /** * Split a buffer into chunks * @param {Uint8Array} buffer - The buffer to split * @param {number} chunkSize - The size of each chunk * @protected * @returns {Array<Uint8Array[]>} - The chunks */ protected splitBufferIntoChunks(buffer: Uint8Array, chunkSize?: number): Array<Uint8Array[]>; protected encodeFeature(feature: Feature<Features>, finalBuffer: BinaryWriter): void; private encodeAccessListFeature; private encodeChallengeSubmission; private encodeLinkRequest; } //# sourceMappingURL=Generator.d.ts.map