Class ContractHash

Represents a contract hash within the system, providing various prefixed representations.

Hierarchy

  • ContractHash

Constructors

  • Constructs a new ContractHash instance.

    Parameters

    • hash: Hash

      The Hash object representing the contract hash.

    • originPrefix: string

      The original prefix of the contract hash string.

    Returns ContractHash

Properties

hash: Hash

The hash object representing the contract.

originPrefix: string

The prefix of the original contract hash string, if any (e.g., "hash-", "contract-wasm-", "contract-").

Methods

  • Converts the ContractHash instance to its JSON representation.

    Returns

    A string representation of the ContractHash, including the original prefix.

    Returns string

  • Returns the contract hash as a general prefixed string.

    Returns

    The contract hash prefixed with Contract.

    Returns string

  • Returns the contract hash as a WASM-prefixed string.

    Returns

    The contract hash prefixed with ContractWasm.

    Returns string

  • Creates a ContractHash instance from its JSON representation.

    Returns

    A new ContractHash instance.

    Parameters

    • json: string

      The JSON string representation of the ContractHash.

    Returns ContractHash

  • Creates a new ContractHash instance from a string representation.

    Returns

    A new ContractHash instance.

    Parameters

    • source: string

      The string representation of the contract hash.

    Returns ContractHash

Generated using TypeDoc