Skip to main content

Types

The following definitions expand on parameters seen elsewhere within the SDK standard and are provided for clarity and completeness.

Account

Structure representing a user's Account, stored in global state.

Required Parameters:

AccountHash

The AccountHash is a 32-byte hash derived from a supported PublicKey. Its role is to standardize keys that can vary in length.

ActionThresholds

Thresholds that have to be met when executing an action of a certain type.

Required Parameters:

  • deployment

  • key_management

ActivationPoint

The first era to which the associated protocol version applies.

Approval

A struct containing a signature and the public key of the signer.

Required Parameters:

AssociatedKey

A key granted limited permissions to an Account, for purposes such as multisig.

Required Parameters:

AuctionState

Data structure summarizing auction contract data.

Required Parameters:

Bid

An entry in the validator map.

Required Parameters:

  • bonding_purse The purse that was used for bonding.

  • delegation_rate The delegation rate.

  • delegators The validator's delegators, indexed by their public keys.

  • inactive true if validator has been "evicted".

  • staked_amount The amount of tokens staked by a validator (not including delegators).

  • validator_public_key Validator's public key.

Additional Parameters:

  • vesting_schedule Vesting schedule for a genesis validator. None if non-genesis validator.

BlockHash

A cryptographic hash identifying a Block.

BlockIdentifier

Identifier for possible ways to retrieve a Block.

  • Hash Identify and retrieve the Block with its hash.

  • Height Identify and retrieve the Block with its height.

Contract

A contract struct that can be serialized as a JSON object.

Required Parameters:

contract_package_hash

contract_wasm_hash

entry_points

named_keys

protocol_version

ContractHash

The hash address of the contract.

ContractPackage

Contract definition, metadata and security container.

Required Parameters:

ContractPackageHash

The hash address of the contract package.

ContractVersion

The version of the contract.

Required Parameters:

ContractWasmHash

The hash address of the contract Wasm.

Delegator

Represents a party delegating their stake to a validator (or "delegatee").

Required Parameters:

Additional Parameters:

Deploy

A Deploy; an item containing a smart contract along with the requester's signature(s).

Required properties:

DeployHash

Hex-encoded Deploy hash.

DeployHeader

The header portion of a Deploy.

Required Parameters:

DeployInfo

Information relating to the given Deploy.

Required Parameters:

  • deploy_hash The relevant Deploy.

  • from Account identifier of the creator of the Deploy.

  • gas Gas cost of executing the Deploy.

  • source Source purse used for payment of the Deploy.

  • transfers Transfers performed by the Deploy.

DictionaryIdentifier

Options for dictionary item lookups.

  • AccountNamedKey Lookup a dictionary item via an Account's named keys.

    Required Parameters:

    key The Account key as a formatted string whose named keys contain dictionary_name.

    dictionary_name The named key under which the dictionary seed URef is stored.

    dictionary_item_key The dictionary item key formatted as a string.

  • ContractNamedKey Lookup a dictionary item via a Contract's named keys.

    key The contract key as a formatted string whose named keys contains dictionary_name.

    dictionary_name The named key under which the dictionary seed URef is stored.

    dictionary_item_key The dictionary item key formatted as a string.

  • URef Lookup a dictionary item via its seed URef.

    seed_uref The dictionary's seed URef.

    dictionary_item_key The dictionary item key formatted as a string.

  • Dictionary Lookup a dictionary item via its unique key.

Digest

Hex-encoded hash digest.

DisabledVersions

Required Parameters:

  • contract_version

  • protocol_version_major

EntryPoint

Metadata describing a callable entry point and its return value, if any. All required parameters should be declared, whereas all non-required parameters should not be declared. Non-required parameters should not be confused with optional parameters.

Required Parameters:

EntryPointAccess

Enum describing the possible access control options for a contract entry point.

  • Public A public entry point is callable by any caller.

  • Groups Only callers from the authorized, listed groups may call this entry point. Note: If this list is empty then this entry point is not callable from outside the contract.

EntryPointType

Context of an entry point execution.

  • session Executes in the caller's context.

  • contract Executes in the callee's context.

EraID

Era ID newtype.

EraInfo

Auction metadata. Intended to be recorded at each era.

Required Parameters:

EraSummary

The summary of an era.

Required Parameters:

ExecutableDeployItem

Represents possible variants of an executable Deploy.

ModuleBytes

Executable specified as raw bytes that represent Wasm code and an instance of RuntimeArgs.

Required Parameters:

  • module_bytes Hex-encoded raw Wasm bytes. There are some special cases around passing module_bytes for payment code.

Additional Parameters:

  • args Runtime arguments.

StoredContractByHash

Stored contract referenced by its ContractHash, entry point and an instance of RuntimeArgs.

Required Parameters:

  • args Runtime arguments.

  • entry_point The name of an entry point.

  • hash A hex-encoded hash.

StoredContractByName

Stored contract referenced by a named key existing in the signer's Account context, entry point and an instance of RuntimeArgs.

Required Parameters:

  • args Runtime arguments.

  • entry_point The name of an entry point.

  • name A named key.

StoredVersionContractByHash

Stored versioned contract referenced by its ContractPackageHash, entry point and an instance of RuntimeArgs.

Required Parameters:

  • args Runtime arguments.

  • entry_point The name of an entry point.

  • hash A hex-encoded hash.

Additional Parameters:

  • version An optional version of the contract to call. It will default to the highest enabled version if no value is specified.

StoredVersionContractByName

Stored versioned contract referenced by a named key existing in the signer's Account context, entry point and an instance of RuntimeArgs.

Required Parameters:

  • args Runtime arguments.

  • entry_point The name of an entry point.

  • name A named key.

Additional Parameters:

  • version An optional version of the contract to call. It will default to the highest enabled version if no value is specified.

Transfer

A native transfer which does not contain or reference a Wasm code.

Required Parameters:

ExecutionEffect

The journal of execution transforms from a single Deploy.

Required Parameters:

ExecutionResult

The result of executing a single Deploy.

  • Failure The result of a failed execution`

    Required Parameters:

    effect

    transfers

    cost

    error_message The error message associated with executing the Deploy.

  • Success The result of a successful execution.

    Required Parameters:

    effect

    transfers

    cost

FinalizedApprovals

A boolean value that determines whether to return the deploy with the finalized approvals substituted. If false or omitted, returns the deploy with the approvals that were originally received by the node.

GlobalStateIdentifier

Identifier for possible ways to query global state.

Group

A (labelled) "user group". Each entry point of a versioned contract may be associated with one or more user groups which are allowed to call it.

Groups

Required Parameters:

JsonBid

An entry in a founding validator map representing a bid.

Required Parameters:

  • bonding_purse The purse that was used for bonding.

  • delegation_rate The delegation rate.

  • delegators The delegators.

  • inactive Is this an inactive validator.

  • staked_amount The amount of tokens staked by a validator (not including delegators).

JsonBids

A Json representation of a single bid.

Required Parameters:

JsonBlock

A JSON-friendly representation of Block.

Required Parameters:

  • body JSON-friendly Block body.

  • hash BlockHash.

  • header JSON-friendly Block header.

  • proofs JSON-friendly list of proofs for this Block.

JsonBlockBody

A JSON-friendly representation of Body.

Required Parameters:

JsonBlockHeader

JSON representation of a Block header.

Additional Parameters:

JsonDelegator

A delegator associated with the given validator.

Required Parameters:

JsonEraEnd

Required Parameters:

JsonEraReport

Equivocation and reward information to be included in the terminal Block.

Required Parameters:

JsonEraValidators

The validators for the given era.

Required Parameters:

JsonExecutionResult

The execution result of a single Deploy.

JsonProof

A JSON-friendly representation of a proof, i.e. a Block's finality signature.

Required Parameters:

JsonValidatorChanges

The changes in a validator's status.

Required Parameters:

JsonValidatorStatusChange

A single change to a validator's status in the given era.

Required Parameters:

JsonValidatorsWeights

A validator's weight.

Required Parameters:

Merkle_Proof

A merkle proof is a construction created using a merkle trie that allows verification of the associated hashes.

MinimalBlockInfo

Minimal info of a Block.

Required Parameters:

NamedArg

Named arguments to a contract.

NamedKey

A named key.

Required Parameters:

  • key The value of the entry: a casper Key type.

  • name The name of the entry.

NextUpgrade

Information about the next protocol upgrade.

Required Parameters:

NewValidator

The public key for the new validator in a re-delegation using UnbondingPurse.

Operation

An operation performed while executing a Deploy.

Required Parameters:

  • key The formatted string of the Key.

  • kind

OpKind

The type of operation performed while executing a Deploy.

Parameter

Parameter to an entry point.

Required Parameters:

PeerEntry

Required Parameters:

  • address

  • node_id

PeersMap

Map of peer IDs to network addresses.

ProtocolVersion

Casper Platform protocol version.

PublicKey

Hex-encoded cryptographic public key, including the algorithm tag prefix.

PurseIdentifier

The identifier to obtain the purse corresponding to a balance query. Valid identifiers include:

  • main_purse_under_public_key The main purse under a provided PublicKey.

  • main_purse_under_account_hash The main purse under a provided AccountHash.

  • purse_uref A specific purse identified by the associated URef.

Reward

Required Parameters:

RuntimeArgs

Represents a collection of arguments passed to a smart contract.

SeigniorageAllocation

Information about a seigniorage allocation.

Signature

Hex-encoded cryptographic signature, including the algorithm tag prefix.

StoredValue

Representation of a value stored in global state. Account, Contract and ContractPackage have their own json_compatibility representation (see their docs for further info).

TimeDiff

Human-readable duration.

Timestamp

Timestamp formatted as per RFC 3339.

Transfer

Represents a transfer from one purse to another.

Required Parameters:

Additional Parameters:

  • id User-defined ID.

  • to Account to which funds are transferred.

TransferAddr

Hex-encoded transfer address.

Transform

The actual transformation performed while executing a Deploy.

  • WriteCLValue Write the given CLValue to global state.

  • WriteAccount Writes the given Account to global state.

  • WriteDeployInfo Writes the given DeployInfo to global state.

  • WriteEraInfo Writes the given EraInfo to global state.

  • WriteTransfer Writes the given Transfer to global state.

  • WriteBid Writes the given Bid to global state.

  • WriteWithdraw Writes the given Withdraw to global state.

  • AddInt32 Adds the given i32.

  • AddUInt64 Adds the given u64.

  • AddUInt128 Adds the given U128.

  • AddUInt256 Adds the given U256.

  • AddUInt512 Adds the given U512.

  • AddKeys Adds the given collection of named keys.

  • Failure A failed transformation, containing an error message.

TransformEntry

A transformation performed while executing a Deploy.

Required Parameters:

  • key The formatted string of the Key.

  • transforms The transformation.

U128

Decimal representation of a 128-bit integer.

U256

Decimal representation of a 256-bit integer.

U512

Decimal representation of a 512-bit integer.

UnbondingPurse

Unbonding purse.

Required Parameters:

URef

Hex-encoded, formatted URef.

ValidatorChange

A change to a validator's status between two eras.

  • Added

  • Removed

  • Banned

  • CannotPropose

  • SeenAsFaulty

ValidatorWeight

Required Parameters:

VestingSchedule

Vesting schedule for a genesis validator.

WithdrawPurse

Withdraw purse, previously known as unbonding purse prior to 1.5. Withdraw purses remain as historical data.

Required Parameters: