Class DelegationKind

Represents a delegation bid, which can be made from either a public key or a purse.

Hierarchy

  • DelegationKind

Constructors

Properties

Methods

Constructors

Properties

publicKey?: PublicKey

A delegation bid made using a public key.

purse?: URef

A delegation bid made using a purse.

Methods

  • Converts the DelegationKind into a hexadecimal string.

    The method ensures that exactly one of the fields is set. If both or neither are provided, it throws an error.

    Returns

    The hexadecimal string representation of the delegation.

    Throws

    If neither or both delegation fields are set.

    Returns string

  • Deserializes a JSON object into a DelegationKind instance.

    This method examines the input JSON. If it contains a PublicKey field, it will use that to populate the publicKey property. Otherwise, if it contains a Purse field, it will decode the hex string, append the default access byte (7), and create a URef instance.

    Returns

    A new DelegationKind instance reflecting the given JSON.

    Throws

    If the input JSON is null or undefined, or if it does not conform to the expected format.

    Parameters

    • json: any

      The JSON object to deserialize.

    Returns DelegationKind

Generated using TypeDoc