Class CalldataGenerator

Class to generate bitcoin script for interaction transactions

Hierarchy (view full)

Constructors

Properties

contractSaltPubKey?: Buffer

The public key of the contract salt

network: Network = networks.bitcoin

The network to use

senderPubKey: Buffer

The public key of the sender

xSenderPubKey: Buffer

The public key of the sender

DATA_CHUNK_SIZE: number = 512

The maximum size of a data chunk

MAGIC: Buffer = ...

The magic number of OPNet

Accessors

Methods

  • Compile an interaction bitcoin script

    Parameters

    • calldata: Buffer

      The calldata to use

    • contractSecret: Buffer

      The contract secret

    • Optionalfeatures: UNWRAP[] = []

      The features to use (optional)

    • OptionalvaultPublicKeys: Buffer[] = []

      The public keys of the vault (optional)

    • OptionalminimumSignatures: number = 0

      The minimum number of signatures (optional)

    Returns Buffer

    • The compiled script
    • If something goes wrong
  • Protected

    Split a buffer into chunks

    Parameters

    • buffer: Buffer

      The buffer to split

    • chunkSize: number = Generator.DATA_CHUNK_SIZE

      The size of each chunk

    Returns Buffer[][]

    • The chunks