Class TransformKind

Represents different types of transformation that can be applied. Used for parsing and processing transformation data in a transaction.

Hierarchy

  • TransformKind

Constructors

Properties

data: any

Accessors

  • get transformationData(): any
  • Getter for transformation data.

    Returns

    The transformation data.

    Returns any

Methods

  • Recursively checks if any key in the provided object (including nested objects) contains the specified name.

    Returns

    true if a key containing the name is found; otherwise, false.

    Parameters

    • obj: any

      The object to search through.

    • name: string

      The transformation name to search for within the keys.

    Returns boolean

  • Checks if the transformation is an AddUInt512.

    Returns

    true if the transformation is AddUInt512, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteCLValue.

    Returns

    true if the transformation is a WriteCLValue, otherwise false.

    Returns boolean

  • Checks if TransformKind has the transformation specified by name.

    Returns

    true if the transformation is a WriteTransfer, otherwise false.

    Parameters

    • name: string

    Returns boolean

  • Checks if the transformation is a WriteAccount.

    Returns

    true if the transformation is a WriteAccount, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteAddressableEntity.

    Returns

    true if the transformation is a WriteAddressableEntity, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteBid.

    Returns

    true if the transformation is a WriteBid, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteBidKind.

    Returns

    true if the transformation is a WriteBidKind, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteCLValue.

    Returns

    true if the transformation is a WriteCLValue, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteContract.

    Returns

    true if the transformation is a WriteContract, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteContractPackage.

    Returns

    true if the transformation is a WriteContractPackage, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteDeployInfo.

    Returns

    true if the transformation is a WriteDeployInfo, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteMessage.

    Returns

    true if the transformation is a WriteMessage, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteMessageTopic.

    Returns

    true if the transformation is a WriteMessageTopic, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteNamedKey.

    Returns

    true if the transformation is a WriteNamedKey, otherwise false.

    Returns boolean

  • Checks if the transformation is a WritePackage.

    Returns

    true if the transformation is a WritePackage, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteTransfer.

    Returns

    true if the transformation is a WriteTransfer, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteUnbonding.

    Returns

    true if the transformation is a WriteUnbonding, otherwise false.

    Returns boolean

  • Checks if the transformation is a WriteWithdraw.

    Returns

    true if the transformation is a WriteWithdraw, otherwise false.

    Returns boolean

  • Attempts to parse the transformation data as a WriteAccount transformation.

    This method supports two JSON formats:

    • 2.x Format:

      {
      "Write": {
      "Account": {
      "account_hash": "..."
      }
      }
      }

      If the parsed accountHash is not equal to the zero account hash, this value is returned.

    • 1.x Format:

      {
      "WriteAccount": "..."
      }

      If the 2.x format is not matched or the parsed account hash equals the zero hash, the method falls back to this format.

    Returns

    The parsed AccountHash.

    Throws

    Error if the transformation data cannot be parsed as a valid WriteAccount.

    Returns AccountHash

  • Attempts to parse the transformation as a WriteBidKind.

    Returns

    A BidKind object if the data matches, otherwise throw an error.

    Returns BidKind

  • Attempts to parse the transformation as a WriteCLValue.

    Returns

    The Args object if the data matches, otherwise throw an error.

    Returns CLValue

  • Attempts to parse the transformation as a WriteContract.

    Returns

    A Contract object if the data matches, otherwise throw an error.

    Returns Contract

  • Attempts to parse the transformation as a WriteMessage.

    Returns

    A MessageChecksum if the data matches, otherwise throw an error.

    Returns string

  • Attempts to parse the transformation as a WritePackage.

    Returns

    A Package object if the data matches, otherwise throw an error.

    Returns Package

  • Attempts to parse the transformation as a WriteTransfer.

    Returns

    A WriteTransfer object if the data matches, otherwise throw an error`.

    Returns WriteTransfer

  • Converts the transformation data into a JSON string.

    Returns

    The transformation data as a string.

    Returns any

  • Creates a TransformKind instance from a JSON string.

    Returns

    The TransformKind instance.

    Parameters

    • json: any

      The transformation data as a string.

    Returns undefined | TransformKind

Generated using TypeDoc