Class DeploymentGenerator

Bitcoin Script Generator

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 a bitcoin script representing a contract deployment

    Parameters

    • contractBytecode: Buffer

      The contract bytecode

    • contractSalt: Buffer

      The contract salt

    • Optionalcalldata: Buffer

      The calldata to be passed to the contract

    Returns Buffer

    • The compiled script
  • 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