Class Deploy

Represents a deploy in the blockchain, including the header, payment, session, and approvals. A Deploy object is used to package the logic for executing a contract, payment, or transfer on the blockchain.

Hierarchy

  • Deploy

Constructors

Properties

approvals: Approval[] = []

A list of approvals, including signatures from accounts that have approved the deploy.

hash: Hash

The unique hash that identifies this deploy. This hash is used to verify the integrity of the deploy.

header: DeployHeader

The header of the deploy, which contains metadata such as the account, gas price, timestamp, and TTL.

The executable item representing the payment logic of the deploy.

The executable item representing the session logic of the deploy.

Methods

  • Identifies whether this Deploy represents a standard payment, like a gas payment.

    Returns

    true if the deploy is a standard payment, otherwise false.

    Returns boolean

  • Identifies whether this Deploy represents a transfer of CSPR.

    Returns

    true if the deploy is a transfer, otherwise false.

    Returns boolean

  • Signs the deploy with a given private key and adds the signature to the approvals list.

    Parameters

    • keys: PrivateKey

      The private key used to sign the deploy.

    Returns void

  • Converts the deploy object into a byte array for transmission or storage.

    Returns

    A Uint8Array representing the deploy in byte format.

    Returns Uint8Array

  • Validates the deploy by checking its body hash, deploy hash, and approval signatures.

    Returns

    true if the deploy is valid, otherwise throws an error.

    Returns boolean

  • Converts a JSON representation of a deploy to a Deploy object.

    Returns

    A Deploy object if successful, or throws an error if parsing fails.

    Parameters

    • json: any

      The JSON representation of a Deploy.

    Returns Deploy

  • Gets the byte-size of a deploy

    Returns

    The size of the Deploy in its serialized representation

    Parameters

    • deploy: Deploy

      The Deploy for which to calculate the size

    Returns number

  • Converts the Deploy into a Transaction object. This method creates a transaction based on the deploy, including its payment and session logic.

    Returns

    A new Transaction object created from the deploy.

    Parameters

    • deploy: Deploy

      The deploy object.

    Returns Transaction

  • Sets an already generated signature for the deploy.

    Returns

    A new Deploy instance with the added signature.

    Parameters

    • deploy: Deploy

      The deploy instance.

    • signature: Uint8Array

      The Ed25519 or Secp256K1 signature.

    • publicKey: PublicKey

      The public key used to generate the signature.

    Returns Deploy

  • Converts the Deploy object into a JSON representation.

    Returns

    A JSON representation of the deploy.

    Parameters

    • deploy: Deploy

      The deploy object to convert to JSON.

    Returns JsonTypes

Generated using TypeDoc