Skip to content

Instantly share code, notes, and snippets.

@Fraser999
Last active November 25, 2020 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fraser999/94ce7a16edfeff1ff88b52293d6c709f to your computer and use it in GitHub Desktop.
Save Fraser999/94ce7a16edfeff1ff88b52293d6c709f to your computer and use it in GitHub Desktop.
{
"components": {
"schemas": {
"Account": {
"description": "Structure representing a user's account, stored in global state.",
"properties": {
"account_hash": {
"$ref": "#/components/schemas/AccountHash"
},
"action_thresholds": {
"$ref": "#/components/schemas/ActionThresholds"
},
"associated_keys": {
"items": {
"$ref": "#/components/schemas/AssociatedKey"
},
"type": "array"
},
"main_purse": {
"$ref": "#/components/schemas/URef"
},
"named_keys": {
"items": {
"$ref": "#/components/schemas/NamedKey"
},
"type": "array"
}
},
"required": [
"account_hash",
"action_thresholds",
"associated_keys",
"main_purse",
"named_keys"
],
"type": "object"
},
"AccountHash": {
"description": "Hex-encoded account hash.",
"items": {
"format": "uint8",
"minimum": 0,
"type": "integer"
},
"maxItems": 32,
"minItems": 32,
"type": "array"
},
"ActionThresholds": {
"description": "Thresholds that have to be met when executing an action of a certain type.",
"properties": {
"deployment": {
"format": "uint8",
"minimum": 0,
"type": "integer"
},
"key_management": {
"format": "uint8",
"minimum": 0,
"type": "integer"
}
},
"required": [
"deployment",
"key_management"
],
"type": "object"
},
"Approval": {
"description": "A struct containing a signature and the public key of the signer.",
"properties": {
"signature": {
"$ref": "#/components/schemas/Signature"
},
"signer": {
"$ref": "#/components/schemas/PublicKey"
}
},
"required": [
"signature",
"signer"
],
"type": "object"
},
"AssociatedKey": {
"properties": {
"account_hash": {
"$ref": "#/components/schemas/AccountHash"
},
"weight": {
"format": "uint8",
"minimum": 0,
"type": "integer"
}
},
"required": [
"account_hash",
"weight"
],
"type": "object"
},
"AuctionState": {
"description": "Data structure summarizing auction contract data.",
"properties": {
"bids": {
"description": "All bids contained within a vector.",
"items": {
"$ref": "#/components/schemas/JsonBids"
},
"type": "array"
},
"block_height": {
"description": "Block height.",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"era_validators": {
"description": "Era validators.",
"items": {
"$ref": "#/components/schemas/JsonEraValidators"
},
"type": "array"
},
"state_root_hash": {
"allOf": [
{
"$ref": "#/components/schemas/Digest"
}
],
"description": "Global state hash."
}
},
"required": [
"bids",
"block_height",
"era_validators",
"state_root_hash"
],
"type": "object"
},
"BlockHash": {
"allOf": [
{
"$ref": "#/components/schemas/Digest"
}
],
"description": "A cryptographic hash identifying a [`Block`](struct.Block.html)."
},
"BlockIdentifier": {
"anyOf": [
{
"description": "Identify and retrieve the block with its hash.",
"properties": {
"Hash": {
"$ref": "#/components/schemas/BlockHash"
}
},
"required": [
"Hash"
],
"type": "object"
},
{
"description": "Identify and retrieve the block with its height.",
"properties": {
"Height": {
"format": "uint64",
"minimum": 0,
"type": "integer"
}
},
"required": [
"Height"
],
"type": "object"
}
],
"description": "Identifier for possible ways to retrieve a block."
},
"CLType": {
"anyOf": [
{
"enum": [
"Bool",
"I32",
"I64",
"U8",
"U32",
"U64",
"U128",
"U256",
"U512",
"Unit",
"String",
"Key",
"URef",
"PublicKey",
"Any"
],
"type": "string"
},
{
"description": "`Option` of a `CLType`.",
"properties": {
"Option": {
"$ref": "#/components/schemas/CLType"
}
},
"required": [
"Option"
],
"type": "object"
},
{
"description": "Variable-length list of a single `CLType` (comparable to a `Vec`).",
"properties": {
"List": {
"$ref": "#/components/schemas/CLType"
}
},
"required": [
"List"
],
"type": "object"
},
{
"description": "Fixed-length list of a single `CLType` (comparable to a Rust array).",
"properties": {
"ByteArray": {
"format": "uint32",
"minimum": 0,
"type": "integer"
}
},
"required": [
"ByteArray"
],
"type": "object"
},
{
"description": "`Result` with `Ok` and `Err` variants of `CLType`s.",
"properties": {
"Result": {
"properties": {
"err": {
"$ref": "#/components/schemas/CLType"
},
"ok": {
"$ref": "#/components/schemas/CLType"
}
},
"required": [
"err",
"ok"
],
"type": "object"
}
},
"required": [
"Result"
],
"type": "object"
},
{
"description": "Map with keys of a single `CLType` and values of a single `CLType`.",
"properties": {
"Map": {
"properties": {
"key": {
"$ref": "#/components/schemas/CLType"
},
"value": {
"$ref": "#/components/schemas/CLType"
}
},
"required": [
"key",
"value"
],
"type": "object"
}
},
"required": [
"Map"
],
"type": "object"
},
{
"description": "1-ary tuple of a `CLType`.",
"properties": {
"Tuple1": {
"items": {
"$ref": "#/components/schemas/CLType"
},
"maxItems": 1,
"minItems": 1,
"type": "array"
}
},
"required": [
"Tuple1"
],
"type": "object"
},
{
"description": "2-ary tuple of `CLType`s.",
"properties": {
"Tuple2": {
"items": {
"$ref": "#/components/schemas/CLType"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": [
"Tuple2"
],
"type": "object"
},
{
"description": "3-ary tuple of `CLType`s.",
"properties": {
"Tuple3": {
"items": {
"$ref": "#/components/schemas/CLType"
},
"maxItems": 3,
"minItems": 3,
"type": "array"
}
},
"required": [
"Tuple3"
],
"type": "object"
}
],
"description": "Casper types, i.e. types which can be stored and manipulated by smart contracts.\n\nProvides a description of the underlying data type of a [`CLValue`](crate::CLValue)."
},
"CLValue": {
"description": "A Casper value, i.e. a value which can be stored and manipulated by smart contracts.\n\nIt holds the underlying data as a type-erased, serialized `Vec<u8>` and also holds the [`CLType`] of the underlying data as a separate member.",
"properties": {
"bytes": {
"description": "Hex-encoded value, serialized using ToBytes.",
"type": "string"
},
"cl_type": {
"$ref": "#/components/schemas/CLType"
}
},
"required": [
"bytes",
"cl_type"
],
"type": "object"
},
"Delegator": {
"description": "Represents a party delegating their stake to a validator (or \"delegatee\")",
"properties": {
"bonding_purse": {
"$ref": "#/components/schemas/URef"
},
"delegatee": {
"$ref": "#/components/schemas/PublicKey"
},
"reward": {
"$ref": "#/components/schemas/U512"
},
"staked_amount": {
"$ref": "#/components/schemas/U512"
}
},
"required": [
"bonding_purse",
"delegatee",
"reward",
"staked_amount"
],
"type": "object"
},
"Deploy": {
"description": "A deploy; an item containing a smart contract along with the requester's signature(s).",
"properties": {
"approvals": {
"items": {
"$ref": "#/components/schemas/Approval"
},
"type": "array"
},
"hash": {
"$ref": "#/components/schemas/DeployHash"
},
"header": {
"$ref": "#/components/schemas/DeployHeader"
},
"payment": {
"$ref": "#/components/schemas/ExecutableDeployItem"
},
"session": {
"$ref": "#/components/schemas/ExecutableDeployItem"
}
},
"required": [
"approvals",
"hash",
"header",
"payment",
"session"
],
"type": "object"
},
"DeployHash": {
"allOf": [
{
"$ref": "#/components/schemas/Digest"
}
],
"description": "Hex-encoded deploy hash."
},
"DeployHeader": {
"description": "The header portion of a [`Deploy`](struct.Deploy.html).",
"properties": {
"account": {
"$ref": "#/components/schemas/PublicKey"
},
"body_hash": {
"$ref": "#/components/schemas/Digest"
},
"chain_name": {
"type": "string"
},
"dependencies": {
"items": {
"$ref": "#/components/schemas/DeployHash"
},
"type": "array"
},
"gas_price": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"timestamp": {
"$ref": "#/components/schemas/Timestamp"
},
"ttl": {
"$ref": "#/components/schemas/TimeDiff"
}
},
"required": [
"account",
"body_hash",
"chain_name",
"dependencies",
"gas_price",
"timestamp",
"ttl"
],
"type": "object"
},
"DeployInfo": {
"description": "Information relating to the given Deploy.",
"properties": {
"deploy_hash": {
"allOf": [
{
"$ref": "#/components/schemas/DeployHash"
}
],
"description": "The relevant Deploy."
},
"from": {
"allOf": [
{
"$ref": "#/components/schemas/AccountHash"
}
],
"description": "Account identifier of the creator of the Deploy."
},
"gas": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "Gas cost of executing the Deploy."
},
"source": {
"allOf": [
{
"$ref": "#/components/schemas/URef"
}
],
"description": "Source purse used for payment of the Deploy."
},
"transfers": {
"description": "Transfers performed by the Deploy.",
"items": {
"$ref": "#/components/schemas/TransferAddr"
},
"type": "array"
}
},
"required": [
"deploy_hash",
"from",
"gas",
"source",
"transfers"
],
"type": "object"
},
"Digest": {
"description": "Hex-encoded hash digest.",
"type": "string"
},
"EraId": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"ExecutableDeployItem": {
"anyOf": [
{
"properties": {
"ModuleBytes": {
"properties": {
"args": {
"description": "Hex-encoded contract args, serialized using ToBytes.",
"type": "string"
},
"module_bytes": {
"description": "Hex-encoded raw Wasm bytes.",
"type": "string"
}
},
"required": [
"args",
"module_bytes"
],
"type": "object"
}
},
"required": [
"ModuleBytes"
],
"type": "object"
},
{
"properties": {
"StoredContractByHash": {
"properties": {
"args": {
"description": "Hex-encoded contract args, serialized using ToBytes.",
"type": "string"
},
"entry_point": {
"type": "string"
},
"hash": {
"description": "Hex-encoded hash.",
"type": "string"
}
},
"required": [
"args",
"entry_point",
"hash"
],
"type": "object"
}
},
"required": [
"StoredContractByHash"
],
"type": "object"
},
{
"properties": {
"StoredContractByName": {
"properties": {
"args": {
"description": "Hex-encoded contract args, serialized using ToBytes.",
"type": "string"
},
"entry_point": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"args",
"entry_point",
"name"
],
"type": "object"
}
},
"required": [
"StoredContractByName"
],
"type": "object"
},
{
"properties": {
"StoredVersionedContractByHash": {
"properties": {
"args": {
"description": "Hex-encoded contract args, serialized using ToBytes.",
"type": "string"
},
"entry_point": {
"type": "string"
},
"hash": {
"description": "Hex-encoded hash.",
"type": "string"
},
"version": {
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"args",
"entry_point",
"hash"
],
"type": "object"
}
},
"required": [
"StoredVersionedContractByHash"
],
"type": "object"
},
{
"properties": {
"StoredVersionedContractByName": {
"properties": {
"args": {
"description": "Hex-encoded contract args, serialized using ToBytes.",
"type": "string"
},
"entry_point": {
"type": "string"
},
"name": {
"type": "string"
},
"version": {
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"args",
"entry_point",
"name"
],
"type": "object"
}
},
"required": [
"StoredVersionedContractByName"
],
"type": "object"
},
{
"properties": {
"Transfer": {
"properties": {
"args": {
"description": "Hex-encoded contract args, serialized using ToBytes.",
"type": "string"
}
},
"required": [
"args"
],
"type": "object"
}
},
"required": [
"Transfer"
],
"type": "object"
}
]
},
"ExecutionEffect": {
"description": "The effect of executing a single deploy.",
"properties": {
"operations": {
"description": "The resulting operations.",
"items": {
"$ref": "#/components/schemas/Operation"
},
"type": "array"
},
"transforms": {
"description": "The resulting transformations.",
"items": {
"$ref": "#/components/schemas/TransformEntry"
},
"type": "array"
}
},
"required": [
"operations",
"transforms"
],
"type": "object"
},
"ExecutionResult": {
"anyOf": [
{
"description": "The result of a failed execution.",
"properties": {
"Failure": {
"properties": {
"cost": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "The cost of executing the deploy."
},
"effect": {
"allOf": [
{
"$ref": "#/components/schemas/ExecutionEffect"
}
],
"description": "The effect of executing the deploy."
},
"error_message": {
"description": "The error message associated with executing the deploy.",
"type": "string"
},
"transfers": {
"description": "A record of Transfers performed while executing the deploy.",
"items": {
"$ref": "#/components/schemas/TransferAddr"
},
"type": "array"
}
},
"required": [
"cost",
"effect",
"error_message",
"transfers"
],
"type": "object"
}
},
"required": [
"Failure"
],
"type": "object"
},
{
"description": "The result of a successful execution.",
"properties": {
"Success": {
"properties": {
"cost": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "The cost of executing the deploy."
},
"effect": {
"allOf": [
{
"$ref": "#/components/schemas/ExecutionEffect"
}
],
"description": "The effect of executing the deploy."
},
"transfers": {
"description": "A record of Transfers performed while executing the deploy.",
"items": {
"$ref": "#/components/schemas/TransferAddr"
},
"type": "array"
}
},
"required": [
"cost",
"effect",
"transfers"
],
"type": "object"
}
},
"required": [
"Success"
],
"type": "object"
}
],
"description": "The result of executing a single deploy."
},
"JsonBid": {
"description": "An entry in a founding validator map representing a bid.",
"properties": {
"bonding_purse": {
"allOf": [
{
"$ref": "#/components/schemas/URef"
}
],
"description": "The purse that was used for bonding."
},
"delegation_rate": {
"description": "The delegation rate.",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"delegators": {
"description": "The delegators.",
"items": {
"$ref": "#/components/schemas/JsonDelegator"
},
"type": "array"
},
"release_era": {
"description": "A flag that represents a winning entry.\n\n`Some` indicates locked funds for a specific era and an autowin status, and `None` case means that funds are unlocked and autowin status is removed.",
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"reward": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "This validator's seigniorage reward."
},
"staked_amount": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "The amount of tokens staked by a validator (not including delegators)."
}
},
"required": [
"bonding_purse",
"delegation_rate",
"delegators",
"reward",
"staked_amount"
],
"type": "object"
},
"JsonBids": {
"description": "A Json representation of a single bid.",
"properties": {
"bid": {
"$ref": "#/components/schemas/JsonBid"
},
"public_key": {
"$ref": "#/components/schemas/PublicKey"
}
},
"required": [
"bid",
"public_key"
],
"type": "object"
},
"JsonBlock": {
"description": "A JSON-friendly representation of `Block`.",
"properties": {
"body": {
"type": "null"
},
"hash": {
"$ref": "#/components/schemas/BlockHash"
},
"header": {
"$ref": "#/components/schemas/JsonBlockHeader"
},
"proofs": {
"items": {
"$ref": "#/components/schemas/Signature"
},
"type": "array"
}
},
"required": [
"body",
"hash",
"header",
"proofs"
],
"type": "object"
},
"JsonBlockHeader": {
"properties": {
"accumulated_seed": {
"$ref": "#/components/schemas/Digest"
},
"body_hash": {
"$ref": "#/components/schemas/Digest"
},
"deploy_hashes": {
"items": {
"$ref": "#/components/schemas/DeployHash"
},
"type": "array"
},
"era_end": {
"anyOf": [
{
"$ref": "#/components/schemas/JsonEraEnd"
},
{
"type": "null"
}
]
},
"era_id": {
"$ref": "#/components/schemas/EraId"
},
"height": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"parent_hash": {
"$ref": "#/components/schemas/BlockHash"
},
"proposer": {
"$ref": "#/components/schemas/PublicKey"
},
"random_bit": {
"type": "boolean"
},
"state_root_hash": {
"$ref": "#/components/schemas/Digest"
},
"timestamp": {
"$ref": "#/components/schemas/Timestamp"
}
},
"required": [
"accumulated_seed",
"body_hash",
"deploy_hashes",
"era_id",
"height",
"parent_hash",
"proposer",
"random_bit",
"state_root_hash",
"timestamp"
],
"type": "object"
},
"JsonDelegator": {
"description": "A delegator associated with the given validator.",
"properties": {
"delegator": {
"$ref": "#/components/schemas/Delegator"
},
"public_key": {
"$ref": "#/components/schemas/PublicKey"
}
},
"required": [
"delegator",
"public_key"
],
"type": "object"
},
"JsonEraEnd": {
"description": "Equivocation and reward information to be included in the terminal block.",
"properties": {
"equivocators": {
"items": {
"$ref": "#/components/schemas/PublicKey"
},
"type": "array"
},
"rewards": {
"items": {
"$ref": "#/components/schemas/Reward"
},
"type": "array"
}
},
"required": [
"equivocators",
"rewards"
],
"type": "object"
},
"JsonEraValidators": {
"description": "The validators for the given era.",
"properties": {
"era_id": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"validator_weights": {
"items": {
"$ref": "#/components/schemas/JsonValidatorWeights"
},
"type": "array"
}
},
"required": [
"era_id",
"validator_weights"
],
"type": "object"
},
"JsonExecutionResult": {
"description": "The execution result of a single deploy.",
"properties": {
"block_hash": {
"allOf": [
{
"$ref": "#/components/schemas/BlockHash"
}
],
"description": "The block hash."
},
"result": {
"allOf": [
{
"$ref": "#/components/schemas/ExecutionResult"
}
],
"description": "Execution result."
}
},
"required": [
"block_hash",
"result"
],
"type": "object"
},
"JsonValidatorWeights": {
"description": "A validator's weight.",
"properties": {
"public_key": {
"$ref": "#/components/schemas/PublicKey"
},
"weight": {
"$ref": "#/components/schemas/U512"
}
},
"required": [
"public_key",
"weight"
],
"type": "object"
},
"MinimalBlockInfo": {
"description": "Minimal info of a `Block`.",
"properties": {
"era_id": {
"$ref": "#/components/schemas/EraId"
},
"hash": {
"$ref": "#/components/schemas/BlockHash"
},
"height": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"timestamp": {
"$ref": "#/components/schemas/Timestamp"
}
},
"required": [
"era_id",
"hash",
"height",
"timestamp"
],
"type": "object"
},
"NamedKey": {
"description": "A named key.",
"properties": {
"key": {
"description": "The value of the entry: a casper `Key` type.",
"type": "string"
},
"name": {
"description": "The name of the entry.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"OpKind": {
"description": "The type of operation performed while executing a deploy.",
"enum": [
"Read",
"Write",
"Add",
"NoOp"
],
"type": "string"
},
"Operation": {
"description": "An operation performed while executing a deploy.",
"properties": {
"key": {
"description": "The formatted string of the `Key`.",
"type": "string"
},
"kind": {
"allOf": [
{
"$ref": "#/components/schemas/OpKind"
}
],
"description": "The type of operation."
}
},
"required": [
"key",
"kind"
],
"type": "object"
},
"PeerEntry": {
"properties": {
"address": {
"type": "string"
},
"node_id": {
"type": "string"
}
},
"required": [
"address",
"node_id"
],
"type": "object"
},
"PeersMap": {
"description": "Map of peer IDs to network addresses.",
"items": {
"$ref": "#/components/schemas/PeerEntry"
},
"type": "array"
},
"PublicKey": {
"description": "Hex-encoded cryptographic public key, including the algorithm tag prefix.",
"type": "string"
},
"Reward": {
"properties": {
"amount": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"validator": {
"$ref": "#/components/schemas/PublicKey"
}
},
"required": [
"amount",
"validator"
],
"type": "object"
},
"Signature": {
"description": "Hex-encoded cryptographic signature, including the algorithm tag prefix.",
"type": "string"
},
"StoredValue": {
"anyOf": [
{
"description": "A CasperLabs value.",
"properties": {
"CLValue": {
"$ref": "#/components/schemas/CLValue"
}
},
"required": [
"CLValue"
],
"type": "object"
},
{
"description": "An account.",
"properties": {
"Account": {
"$ref": "#/components/schemas/Account"
}
},
"required": [
"Account"
],
"type": "object"
},
{
"description": "A contract's Wasm",
"properties": {
"ContractWasm": {
"type": "string"
}
},
"required": [
"ContractWasm"
],
"type": "object"
},
{
"description": "Methods and type signatures supported by a contract.",
"properties": {
"Contract": {
"type": "string"
}
},
"required": [
"Contract"
],
"type": "object"
},
{
"description": "A contract definition, metadata, and security container.",
"properties": {
"ContractPackage": {
"type": "string"
}
},
"required": [
"ContractPackage"
],
"type": "object"
},
{
"description": "A record of a transfer",
"properties": {
"Transfer": {
"$ref": "#/components/schemas/Transfer"
}
},
"required": [
"Transfer"
],
"type": "object"
},
{
"description": "A record of a deploy",
"properties": {
"DeployInfo": {
"$ref": "#/components/schemas/DeployInfo"
}
},
"required": [
"DeployInfo"
],
"type": "object"
}
],
"description": "Representation of a value stored in global state.\n\nAll variants other than `Account` are formed by serializing the variant using `ToBytes` and hex- encoding the resulting byte string.\n\n`Account` has its own `json_compatibility` representation (see its docs for further info)."
},
"TimeDiff": {
"description": "Human-readable duration.",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"Timestamp": {
"description": "Timestamp formatted as per RFC 3339",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"Transfer": {
"description": "Represents a transfer from one purse to another",
"properties": {
"amount": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "Transfer amount"
},
"deploy_hash": {
"allOf": [
{
"$ref": "#/components/schemas/DeployHash"
}
],
"description": "Deploy that created the transfer"
},
"from": {
"allOf": [
{
"$ref": "#/components/schemas/AccountHash"
}
],
"description": "Account from which transfer was executed"
},
"gas": {
"allOf": [
{
"$ref": "#/components/schemas/U512"
}
],
"description": "Gas"
},
"id": {
"description": "User-defined id",
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"source": {
"allOf": [
{
"$ref": "#/components/schemas/URef"
}
],
"description": "Source purse"
},
"target": {
"allOf": [
{
"$ref": "#/components/schemas/URef"
}
],
"description": "Target purse"
}
},
"required": [
"amount",
"deploy_hash",
"from",
"gas",
"source",
"target"
],
"type": "object"
},
"TransferAddr": {
"description": "Hex-encoded transfer address.",
"items": {
"format": "uint8",
"minimum": 0,
"type": "integer"
},
"maxItems": 32,
"minItems": 32,
"type": "array"
},
"Transform": {
"anyOf": [
{
"enum": [
"Identity",
"WriteContractWasm",
"WriteContract",
"WriteContractPackage"
],
"type": "string"
},
{
"description": "Writes the given CLValue to global state.",
"properties": {
"WriteCLValue": {
"$ref": "#/components/schemas/CLValue"
}
},
"required": [
"WriteCLValue"
],
"type": "object"
},
{
"description": "Writes the given Account to global state.",
"properties": {
"WriteAccount": {
"$ref": "#/components/schemas/AccountHash"
}
},
"required": [
"WriteAccount"
],
"type": "object"
},
{
"description": "Writes the given Deploy to global state.",
"properties": {
"WriteDeployInfo": {
"$ref": "#/components/schemas/DeployInfo"
}
},
"required": [
"WriteDeployInfo"
],
"type": "object"
},
{
"description": "Writes the given Transfer to global state.",
"properties": {
"WriteTransfer": {
"$ref": "#/components/schemas/Transfer"
}
},
"required": [
"WriteTransfer"
],
"type": "object"
},
{
"description": "Adds the given `i32`.",
"properties": {
"AddInt32": {
"format": "int32",
"type": "integer"
}
},
"required": [
"AddInt32"
],
"type": "object"
},
{
"description": "Adds the given `u64`.",
"properties": {
"AddUInt64": {
"format": "uint64",
"minimum": 0,
"type": "integer"
}
},
"required": [
"AddUInt64"
],
"type": "object"
},
{
"description": "Adds the given `U128`.",
"properties": {
"AddUInt128": {
"$ref": "#/components/schemas/U128"
}
},
"required": [
"AddUInt128"
],
"type": "object"
},
{
"description": "Adds the given `U256`.",
"properties": {
"AddUInt256": {
"$ref": "#/components/schemas/U256"
}
},
"required": [
"AddUInt256"
],
"type": "object"
},
{
"description": "Adds the given `U512`.",
"properties": {
"AddUInt512": {
"$ref": "#/components/schemas/U512"
}
},
"required": [
"AddUInt512"
],
"type": "object"
},
{
"description": "Adds the given collection of named keys.",
"properties": {
"AddKeys": {
"items": {
"$ref": "#/components/schemas/NamedKey"
},
"type": "array"
}
},
"required": [
"AddKeys"
],
"type": "object"
},
{
"description": "A failed transformation, containing an error message.",
"properties": {
"Failure": {
"type": "string"
}
},
"required": [
"Failure"
],
"type": "object"
}
],
"description": "The actual transformation performed while executing a deploy."
},
"TransformEntry": {
"description": "A transformation performed while executing a deploy.",
"properties": {
"key": {
"description": "The formatted string of the `Key`.",
"type": "string"
},
"transform": {
"allOf": [
{
"$ref": "#/components/schemas/Transform"
}
],
"description": "The transformation."
}
},
"required": [
"key",
"transform"
],
"type": "object"
},
"U128": {
"description": "Decimal representation of a 128-bit integer.",
"type": "string"
},
"U256": {
"description": "Decimal representation of a 256-bit integer.",
"type": "string"
},
"U512": {
"description": "Decimal representation of a 512-bit integer.",
"type": "string"
},
"URef": {
"description": "Hex-encoded, formatted URef.",
"type": "null"
}
}
},
"info": {
"contact": {
"name": "CasperLabs",
"url": "https://casperlabs.io"
},
"description": "This describes the JSON-RPC 2.0 API of a node on the Casper network.",
"license": {
"name": "CasperLabs Open Source License Version 1.0",
"url": "https://raw.githubusercontent.com/CasperLabs/casper-node/master/LICENSE"
},
"title": "Client API of Casper Node",
"version": "1.0.0"
},
"methods": [
{
"examples": [
{
"name": "account_put_deploy_example",
"params": [
{
"name": "deploy",
"value": {
"approvals": [
{
"signature": "012dbf03817a51794a8e19e0724884075e6d1fbec326b766ecfa6658b41f81290da85e23b24e88b1c8d9761185c961daee1adab0649912a6477bcd2e69bd91bd08",
"signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
}
],
"hash": "cdfcf70c3bf7ace84f08a0f47ba1fe8409c784dc813ca64af9027ebe46d906f9",
"header": {
"account": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"body_hash": "867d05f99d9770f5355d5201bdb8bf6272fcd5119e0e38ef327f98309575debc",
"chain_name": "casper-example",
"dependencies": [
"0101010101010101010101010101010101010101010101010101010101010101"
],
"gas_price": 1,
"timestamp": "2020-11-17T00:39:24.072Z",
"ttl": "1h"
},
"payment": {
"StoredContractByName": {
"args": "0101",
"entry_point": "example-entry-point",
"name": "casper-example"
}
},
"session": {
"Transfer": {
"args": "0202"
}
}
}
}
],
"result": {
"name": "account_put_deploy_example_result",
"value": {
"api_version": "1.0.0",
"deploy_hash": "cdfcf70c3bf7ace84f08a0f47ba1fe8409c784dc813ca64af9027ebe46d906f9"
}
}
}
],
"name": "account_put_deploy",
"params": [
{
"name": "deploy",
"required": true,
"schema": {
"$ref": "#/components/schemas/Deploy",
"description": "The `Deploy`."
}
}
],
"result": {
"name": "account_put_deploy_result",
"schema": {
"description": "Result for \"account_put_deploy\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"deploy_hash": {
"$ref": "#/components/schemas/DeployHash",
"description": "The deploy hash."
}
},
"required": [
"api_version",
"deploy_hash"
],
"type": "object"
}
},
"summary": "receives a Deploy to be executed by the network"
},
{
"examples": [
{
"name": "info_get_deploy_example",
"params": [
{
"name": "deploy_hash",
"value": "cdfcf70c3bf7ace84f08a0f47ba1fe8409c784dc813ca64af9027ebe46d906f9"
}
],
"result": {
"name": "info_get_deploy_example_result",
"value": {
"api_version": "1.0.0",
"deploy": {
"approvals": [
{
"signature": "012dbf03817a51794a8e19e0724884075e6d1fbec326b766ecfa6658b41f81290da85e23b24e88b1c8d9761185c961daee1adab0649912a6477bcd2e69bd91bd08",
"signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
}
],
"hash": "cdfcf70c3bf7ace84f08a0f47ba1fe8409c784dc813ca64af9027ebe46d906f9",
"header": {
"account": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"body_hash": "867d05f99d9770f5355d5201bdb8bf6272fcd5119e0e38ef327f98309575debc",
"chain_name": "casper-example",
"dependencies": [
"0101010101010101010101010101010101010101010101010101010101010101"
],
"gas_price": 1,
"timestamp": "2020-11-17T00:39:24.072Z",
"ttl": "1h"
},
"payment": {
"StoredContractByName": {
"args": "0101",
"entry_point": "example-entry-point",
"name": "casper-example"
}
},
"session": {
"Transfer": {
"args": "0202"
}
}
},
"execution_results": [
{
"block_hash": "6d0f070871c8b198775aef92b5bbb92ef6ea4936aa85bbbbb7bcea7d24e9e5f2",
"result": {
"Success": {
"cost": "123456",
"effect": {
"operations": [
{
"key": "account-hash-2c4a11c062a8a337bfc97e27fd66291caeb2c65865dcb5d3ef3759c4c97efecb",
"kind": "Write"
},
{
"key": "deploy-af684263911154d26fa05be9963171802801a0b6aff8f199b7391eacb8edc9e1",
"kind": "Read"
}
],
"transforms": [
{
"key": "uref-2c4a11c062a8a337bfc97e27fd66291caeb2c65865dcb5d3ef3759c4c97efecb-007",
"transform": {
"AddUInt64": 8
}
},
{
"key": "deploy-af684263911154d26fa05be9963171802801a0b6aff8f199b7391eacb8edc9e1",
"transform": "Identity"
}
]
},
"transfers": [
"transfer-5959595959595959595959595959595959595959595959595959595959595959",
"transfer-8282828282828282828282828282828282828282828282828282828282828282"
]
}
}
}
]
}
}
}
],
"name": "info_get_deploy",
"params": [
{
"name": "deploy_hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/DeployHash",
"description": "The deploy hash."
}
}
],
"result": {
"name": "info_get_deploy_result",
"schema": {
"description": "Result for \"info_get_deploy\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"deploy": {
"$ref": "#/components/schemas/Deploy",
"description": "The deploy."
},
"execution_results": {
"description": "The map of block hash to execution result.",
"items": {
"$ref": "#/components/schemas/JsonExecutionResult"
},
"type": "array"
}
},
"required": [
"api_version",
"deploy",
"execution_results"
],
"type": "object"
}
},
"summary": "returns a Deploy from the network"
},
{
"examples": [
{
"name": "info_get_peers_example",
"params": [],
"result": {
"name": "info_get_peers_example_result",
"value": {
"api_version": "1.0.0",
"peers": [
{
"address": "127.0.0.1:54321",
"node_id": "NodeId::Tls(0101..0101)"
}
]
}
}
}
],
"name": "info_get_peers",
"params": [],
"result": {
"name": "info_get_peers_result",
"schema": {
"description": "Result for \"info_get_peers\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"peers": {
"$ref": "#/components/schemas/PeersMap",
"description": "The node ID and network address of each connected peer."
}
},
"required": [
"api_version",
"peers"
],
"type": "object"
}
},
"summary": "returns a list of peers connected to the node"
},
{
"examples": [
{
"name": "info_get_status_example",
"params": [],
"result": {
"name": "info_get_status_example_result",
"value": {
"api_version": "0.0.0",
"build_version": "v0.1.3-1185-g3c14eace-3c14eace@DEBUG",
"chainspec_name": "casper-example",
"genesis_root_hash": "0202..0202",
"last_added_block_info": {
"era_id": 1,
"hash": "6d0f070871c8b198775aef92b5bbb92ef6ea4936aa85bbbbb7bcea7d24e9e5f2",
"height": 10,
"timestamp": "2020-11-17T00:39:24.072Z"
},
"peers": [
{
"address": "127.0.0.1:54321",
"node_id": "NodeId::Tls(0101..0101)"
}
]
}
}
}
],
"name": "info_get_status",
"params": [],
"result": {
"name": "info_get_status_result",
"schema": {
"description": "Result for \"info_get_status\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"build_version": {
"description": "The compiled node version.",
"type": "string"
},
"chainspec_name": {
"description": "The chainspec name.",
"type": "string"
},
"genesis_root_hash": {
"description": "The genesis root hash.",
"type": "string"
},
"last_added_block_info": {
"anyOf": [
{
"$ref": "#/components/schemas/MinimalBlockInfo"
},
{
"type": "null"
}
],
"description": "The minimal info of the last block from the linear chain."
},
"peers": {
"$ref": "#/components/schemas/PeersMap",
"description": "The node ID and network address of each connected peer."
}
},
"required": [
"api_version",
"build_version",
"chainspec_name",
"genesis_root_hash",
"peers"
],
"type": "object"
}
},
"summary": "returns the current status of the node"
},
{
"examples": [
{
"name": "chain_get_block_example",
"params": [
{
"name": "block_identifier",
"value": {
"Hash": "6d0f070871c8b198775aef92b5bbb92ef6ea4936aa85bbbbb7bcea7d24e9e5f2"
}
}
],
"result": {
"name": "chain_get_block_example_result",
"value": {
"api_version": "1.0.0",
"block": {
"body": null,
"hash": "6d0f070871c8b198775aef92b5bbb92ef6ea4936aa85bbbbb7bcea7d24e9e5f2",
"header": {
"accumulated_seed": "ac979f51525cfd979b14aa7dc0737c5154eabe0db9280eceaa8dc8d2905b20d5",
"body_hash": "0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8",
"deploy_hashes": [
"cdfcf70c3bf7ace84f08a0f47ba1fe8409c784dc813ca64af9027ebe46d906f9"
],
"era_end": {
"equivocators": [
"013b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29"
],
"rewards": [
{
"amount": 1000,
"validator": "018a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c"
}
]
},
"era_id": 1,
"height": 10,
"parent_hash": "0707070707070707070707070707070707070707070707070707070707070707",
"proposer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"random_bit": true,
"state_root_hash": "0808080808080808080808080808080808080808080808080808080808080808",
"timestamp": "2020-11-17T00:39:24.072Z"
},
"proofs": [
"01bd9a3d1fe100345702c4631ce1e22b7dd7c2cd5b3808744efd36fdfc900bff30b19d4fdc369c104924a9f62ccfa91f3a9fc013b9066224a7ebdfe39579892200"
]
}
}
}
}
],
"name": "chain_get_block",
"params": [
{
"name": "block_identifier",
"required": true,
"schema": {
"$ref": "#/components/schemas/BlockIdentifier",
"description": "The block hash."
}
}
],
"result": {
"name": "chain_get_block_result",
"schema": {
"description": "Result for \"chain_get_block\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"block": {
"anyOf": [
{
"$ref": "#/components/schemas/JsonBlock"
},
{
"type": "null"
}
],
"description": "The block, if found."
}
},
"required": [
"api_version"
],
"type": "object"
}
},
"summary": "returns a Block from the network"
},
{
"examples": [
{
"name": "chain_get_state_root_hash_example",
"params": [
{
"name": "block_identifier",
"value": {
"Height": 10
}
}
],
"result": {
"name": "chain_get_state_root_hash_example_result",
"value": {
"api_version": "1.0.0",
"state_root_hash": "0808080808080808080808080808080808080808080808080808080808080808"
}
}
}
],
"name": "chain_get_state_root_hash",
"params": [
{
"name": "block_identifier",
"required": true,
"schema": {
"$ref": "#/components/schemas/BlockIdentifier",
"description": "The block hash."
}
}
],
"result": {
"name": "chain_get_state_root_hash_result",
"schema": {
"description": "Result for \"chain_get_state_root_hash\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"state_root_hash": {
"anyOf": [
{
"$ref": "#/components/schemas/Digest"
},
{
"type": "null"
}
],
"description": "Hex-encoded hash of the state root."
}
},
"required": [
"api_version"
],
"type": "object"
}
},
"summary": "returns a state root hash at a given Block"
},
{
"examples": [
{
"name": "state_get_item_example",
"params": [
{
"name": "key",
"value": "deploy-af684263911154d26fa05be9963171802801a0b6aff8f199b7391eacb8edc9e1"
},
{
"name": "path",
"value": [
"inner"
]
},
{
"name": "state_root_hash",
"value": "0808080808080808080808080808080808080808080808080808080808080808"
}
],
"result": {
"name": "state_get_item_example_result",
"value": {
"api_version": "1.0.0",
"merkle_proof": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3",
"stored_value": {
"CLValue": {
"cl_type": "U64",
"parsed_to_json": 1,
"serialized_bytes": "0100000000000000"
}
}
}
}
}
],
"name": "state_get_item",
"params": [
{
"name": "state_root_hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/Digest",
"description": "Hash of the state root."
}
},
{
"name": "key",
"required": true,
"schema": {
"description": "`casper_types::Key` as formatted string.",
"type": "string"
}
},
{
"name": "path",
"required": true,
"schema": {
"description": "The path components starting from the key as base.",
"items": {
"type": "string"
},
"type": "array"
}
}
],
"result": {
"name": "state_get_item_result",
"schema": {
"description": "Result for \"state_get_item\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"merkle_proof": {
"description": "The merkle proof.",
"type": "string"
},
"stored_value": {
"$ref": "#/components/schemas/StoredValue",
"description": "The stored value."
}
},
"required": [
"api_version",
"merkle_proof",
"stored_value"
],
"type": "object"
}
},
"summary": "returns a stored value from the network"
},
{
"examples": [
{
"name": "state_get_balance_example",
"params": [
{
"name": "purse_uref",
"value": "uref-09480c3248ef76b603d386f3f4f8a5f87f597d4eaffd475433f861af187ab5db-007"
},
{
"name": "state_root_hash",
"value": "0808080808080808080808080808080808080808080808080808080808080808"
}
],
"result": {
"name": "state_get_balance_example_result",
"value": {
"api_version": "1.0.0",
"balance_value": "123456",
"merkle_proof": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3"
}
}
}
],
"name": "state_get_balance",
"params": [
{
"name": "state_root_hash",
"required": true,
"schema": {
"$ref": "#/components/schemas/Digest",
"description": "The hash of state root."
}
},
{
"name": "purse_uref",
"required": true,
"schema": {
"description": "Formatted URef.",
"type": "string"
}
}
],
"result": {
"name": "state_get_balance_result",
"schema": {
"description": "Result for \"state_get_balance\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"balance_value": {
"$ref": "#/components/schemas/U512",
"description": "The balance value."
},
"merkle_proof": {
"description": "The merkle proof.",
"type": "string"
}
},
"required": [
"api_version",
"balance_value",
"merkle_proof"
],
"type": "object"
}
},
"summary": "returns a purse's balance from the network"
},
{
"examples": [
{
"name": "state_get_auction_info_example",
"params": [],
"result": {
"name": "state_get_auction_info_example_result",
"value": {
"api_version": "1.0.0",
"auction_state": {
"bids": [
{
"bid": {
"bonding_purse": "uref-fafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafa-007",
"delegation_rate": 0,
"delegators": [],
"release_era": 42,
"reward": "0",
"staked_amount": "10"
},
"public_key": "012a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a"
}
],
"block_height": 10,
"era_validators": [
{
"era_id": 10,
"validator_weights": [
{
"public_key": "012a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a",
"weight": "10"
}
]
}
],
"state_root_hash": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"
}
}
}
}
],
"name": "state_get_auction_info",
"params": [],
"result": {
"name": "state_get_auction_info_result",
"schema": {
"description": "Result for \"state_get_auction_info\" RPC response.",
"properties": {
"api_version": {
"description": "The RPC API version.",
"type": "string"
},
"auction_state": {
"$ref": "#/components/schemas/AuctionState",
"description": "The auction state."
}
},
"required": [
"api_version",
"auction_state"
],
"type": "object"
}
},
"summary": "returns the bids and validators as of the most recently added Block"
}
],
"openrpc": "1.0.0-rc1",
"servers": [
{
"name": "any Casper Network node",
"url": "http://IP:PORT/rpc/"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment