Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PR to enable JsonSchema for RPC endpoints #12961

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

PolyProgrammist
Copy link

No description provided.

@PolyProgrammist PolyProgrammist changed the title prototype-for-block Draft PR to enable JsonSchema for RPC endpoints Feb 20, 2025
@PolyProgrammist
Copy link
Author

PolyProgrammist commented Feb 20, 2025

Example of JsonSchema for `near_primitives::views::BlockView`
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "BlockView",
  "type": "object",
  "required": [
    "author",
    "chunks",
    "header"
  ],
  "properties": {
    "author": {
      "$ref": "#/definitions/AccountId"
    },
    "chunks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ChunkHeaderView"
      }
    },
    "header": {
      "$ref": "#/definitions/BlockHeaderView"
    }
  },
  "definitions": {
    "AccountId": {
      "description": "NEAR Account Identifier.\n\nThis is a unique, syntactically valid, human-readable account identifier on the NEAR network.\n\n[See the crate-level docs for information about validation.](index.html#account-id-rules)\n\nAlso see [Error kind precedence](AccountId#error-kind-precedence).\n\n## Examples\n\n``` use near_account_id::AccountId;\n\nlet alice: AccountId = \"alice.near\".parse().unwrap();\n\nassert!(\"ƒelicia.near\".parse::<AccountId>().is_err()); // (ƒ is not f) ```",
      "type": "string"
    },
    "BandwidthRequest": {
      "description": "`BandwidthRequest` describes the size of receipts that a shard would like to send to another shard. When a shard wants to send a lot of receipts to another shard, it needs to create a request and wait for a bandwidth grant from the bandwidth scheduler.",
      "type": "object",
      "required": [
        "requested_values_bitmap",
        "to_shard"
      ],
      "properties": {
        "requested_values_bitmap": {
          "description": "Bitmap which describes what values of bandwidth are requested.",
          "allOf": [
            {
              "$ref": "#/definitions/BandwidthRequestBitmap"
            }
          ]
        },
        "to_shard": {
          "description": "Requesting bandwidth to this shard.",
          "type": "integer",
          "format": "uint16",
          "minimum": 0.0
        }
      }
    },
    "BandwidthRequestBitmap": {
      "description": "Bitmap which describes which values from the predefined list are being requested. The nth bit is set to 1 when the nth value from the list is being requested.",
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "uint8",
            "minimum": 0.0
          },
          "maxItems": 5,
          "minItems": 5
        }
      }
    },
    "BandwidthRequests": {
      "description": "A list of shard's bandwidth requests. Describes how much the shard would like to send to other shards.",
      "oneOf": [
        {
          "type": "object",
          "required": [
            "V1"
          ],
          "properties": {
            "V1": {
              "$ref": "#/definitions/BandwidthRequestsV1"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BandwidthRequestsV1": {
      "type": "object",
      "required": [
        "requests"
      ],
      "properties": {
        "requests": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BandwidthRequest"
          }
        }
      }
    },
    "BlockHeaderView": {
      "type": "object",
      "required": [
        "approvals",
        "block_merkle_root",
        "challenges_result",
        "challenges_root",
        "chunk_headers_root",
        "chunk_mask",
        "chunk_receipts_root",
        "chunk_tx_root",
        "chunks_included",
        "epoch_id",
        "gas_price",
        "hash",
        "height",
        "last_ds_final_block",
        "last_final_block",
        "latest_protocol_version",
        "next_bp_hash",
        "next_epoch_id",
        "outcome_root",
        "prev_hash",
        "prev_state_root",
        "random_value",
        "rent_paid",
        "signature",
        "timestamp",
        "timestamp_nanosec",
        "total_supply",
        "validator_proposals",
        "validator_reward"
      ],
      "properties": {
        "approvals": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/definitions/ExternalStruct"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "block_body_hash": {
          "anyOf": [
            {
              "$ref": "#/definitions/CryptoHash"
            },
            {
              "type": "null"
            }
          ]
        },
        "block_merkle_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "block_ordinal": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0.0
        },
        "challenges_result": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SlashedValidator"
          }
        },
        "challenges_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "chunk_endorsements": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "uint8",
              "minimum": 0.0
            }
          }
        },
        "chunk_headers_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "chunk_mask": {
          "type": "array",
          "items": {
            "type": "boolean"
          }
        },
        "chunk_receipts_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "chunk_tx_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "chunks_included": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "epoch_id": {
          "$ref": "#/definitions/CryptoHash"
        },
        "epoch_sync_data_hash": {
          "anyOf": [
            {
              "$ref": "#/definitions/CryptoHash"
            },
            {
              "type": "null"
            }
          ]
        },
        "gas_price": {
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "height": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "last_ds_final_block": {
          "$ref": "#/definitions/CryptoHash"
        },
        "last_final_block": {
          "$ref": "#/definitions/CryptoHash"
        },
        "latest_protocol_version": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0.0
        },
        "next_bp_hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "next_epoch_id": {
          "$ref": "#/definitions/CryptoHash"
        },
        "outcome_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "prev_hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "prev_height": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0.0
        },
        "prev_state_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "random_value": {
          "$ref": "#/definitions/CryptoHash"
        },
        "rent_paid": {
          "description": "TODO(2271): deprecated.",
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "signature": {
          "$ref": "#/definitions/ExternalStruct"
        },
        "timestamp": {
          "description": "Legacy json number. Should not be used.",
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "timestamp_nanosec": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "total_supply": {
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "validator_proposals": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ValidatorStakeView"
          }
        },
        "validator_reward": {
          "description": "TODO(2271): deprecated.",
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        }
      }
    },
    "ChunkHeaderView": {
      "type": "object",
      "required": [
        "balance_burnt",
        "chunk_hash",
        "encoded_length",
        "encoded_merkle_root",
        "gas_limit",
        "gas_used",
        "height_created",
        "height_included",
        "outcome_root",
        "outgoing_receipts_root",
        "prev_block_hash",
        "prev_state_root",
        "rent_paid",
        "shard_id",
        "signature",
        "tx_root",
        "validator_proposals",
        "validator_reward"
      ],
      "properties": {
        "balance_burnt": {
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "bandwidth_requests": {
          "anyOf": [
            {
              "$ref": "#/definitions/BandwidthRequests"
            },
            {
              "type": "null"
            }
          ]
        },
        "chunk_hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "congestion_info": {
          "anyOf": [
            {
              "$ref": "#/definitions/CongestionInfoView"
            },
            {
              "type": "null"
            }
          ]
        },
        "encoded_length": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "encoded_merkle_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "gas_limit": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "gas_used": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "height_created": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "height_included": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "outcome_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "outgoing_receipts_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "prev_block_hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "prev_state_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "rent_paid": {
          "description": "TODO(2271): deprecated.",
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "shard_id": {
          "$ref": "#/definitions/ShardId"
        },
        "signature": {
          "$ref": "#/definitions/ExternalStruct"
        },
        "tx_root": {
          "$ref": "#/definitions/CryptoHash"
        },
        "validator_proposals": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ValidatorStakeView"
          }
        },
        "validator_reward": {
          "description": "TODO(2271): deprecated.",
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        }
      }
    },
    "CongestionInfoView": {
      "type": "object",
      "required": [
        "allowed_shard",
        "buffered_receipts_gas",
        "delayed_receipts_gas",
        "receipt_bytes"
      ],
      "properties": {
        "allowed_shard": {
          "type": "integer",
          "format": "uint16",
          "minimum": 0.0
        },
        "buffered_receipts_gas": {
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "delayed_receipts_gas": {
          "type": "integer",
          "format": "uint128",
          "minimum": 0.0
        },
        "receipt_bytes": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        }
      }
    },
    "CryptoHash": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0.0
      },
      "maxItems": 32,
      "minItems": 32
    },
    "ED25519PublicKey": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0.0
      },
      "maxItems": 32,
      "minItems": 32
    },
    "ExternalStruct": {
      "type": "integer",
      "format": "uint64",
      "minimum": 0.0
    },
    "PublicKey": {
      "description": "Public key container supporting different curves.",
      "oneOf": [
        {
          "description": "256 bit elliptic curve based public-key.",
          "type": "object",
          "required": [
            "ED25519"
          ],
          "properties": {
            "ED25519": {
              "$ref": "#/definitions/ED25519PublicKey"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "512 bit elliptic curve based public-key used in Bitcoin's public-key cryptography.",
          "type": "object",
          "required": [
            "SECP256K1"
          ],
          "properties": {
            "SECP256K1": {
              "$ref": "#/definitions/Secp256K1PublicKey"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "Secp256K1PublicKey": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0.0
      }
    },
    "ShardId": {
      "description": "The shard identifier. It may be an arbitrary number - it does not need to be a number in the range 0..NUM_SHARDS. The shard ids do not need to be sequential or contiguous.\n\nThe shard id is wrapped in a new type to prevent the old pattern of using indices in range 0..NUM_SHARDS and casting to ShardId. Once the transition if fully complete it potentially may be simplified to a regular type alias.",
      "type": "integer",
      "format": "uint64",
      "minimum": 0.0
    },
    "SlashedValidator": {
      "type": "object",
      "required": [
        "account_id",
        "is_double_sign"
      ],
      "properties": {
        "account_id": {
          "$ref": "#/definitions/AccountId"
        },
        "is_double_sign": {
          "type": "boolean"
        }
      }
    },
    "ValidatorStakeView": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "account_id",
            "public_key",
            "stake",
            "validator_stake_struct_version"
          ],
          "properties": {
            "account_id": {
              "$ref": "#/definitions/AccountId"
            },
            "public_key": {
              "$ref": "#/definitions/PublicKey"
            },
            "stake": {
              "type": "integer",
              "format": "uint128",
              "minimum": 0.0
            },
            "validator_stake_struct_version": {
              "type": "string",
              "enum": [
                "V1"
              ]
            }
          }
        }
      ]
    }
  }
}
Schema for RpcTransactionResponse
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "RpcTransactionResponse",
  "type": "object",
  "anyOf": [
    {
      "$ref": "#/definitions/FinalExecutionOutcomeWithReceiptView"
    },
    {
      "$ref": "#/definitions/FinalExecutionOutcomeView"
    }
  ],
  "required": [
    "final_execution_status"
  ],
  "properties": {
    "final_execution_status": {
      "$ref": "#/definitions/TxExecutionStatus"
    }
  },
  "definitions": {
    "AccessKey": {
      "description": "Access key provides limited access to an account. Each access key belongs to some account and is identified by a unique (within the account) public key. One account may have large number of access keys. Access keys allow to act on behalf of the account by restricting transactions that can be issued. `account_id,public_key` is a key in the state",
      "type": "object",
      "required": [
        "nonce",
        "permission"
      ],
      "properties": {
        "nonce": {
          "description": "Nonce for this access key, used for tx nonce generation. When access key is created, nonce is set to `(block_height - 1) * 1e6` to avoid tx hash collision on access key re-creation. See <https://github.com/near/nearcore/issues/3779> for more details.",
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "permission": {
          "description": "Defines permissions for this access key.",
          "allOf": [
            {
              "$ref": "#/definitions/AccessKeyPermission"
            }
          ]
        }
      }
    },
    "AccessKeyPermission": {
      "description": "Defines permissions for AccessKey",
      "oneOf": [
        {
          "type": "object",
          "required": [
            "FunctionCall"
          ],
          "properties": {
            "FunctionCall": {
              "$ref": "#/definitions/FunctionCallPermission"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Grants full access to the account. NOTE: It's used to replace account-level public keys.",
          "type": "string",
          "enum": [
            "FullAccess"
          ]
        }
      ]
    },
    "AccessKeyPermissionView": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "FullAccess"
          ]
        },
        {
          "type": "object",
          "required": [
            "FunctionCall"
          ],
          "properties": {
            "FunctionCall": {
              "type": "object",
              "required": [
                "allowance",
                "method_names",
                "receiver_id"
              ],
              "properties": {
                "allowance": {
                  "type": "string"
                },
                "method_names": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "receiver_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "AccessKeyView": {
      "type": "object",
      "required": [
        "nonce",
        "permission"
      ],
      "properties": {
        "nonce": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "permission": {
          "$ref": "#/definitions/AccessKeyPermissionView"
        }
      }
    },
    "AccountId": {
      "description": "NEAR Account Identifier.\n\nThis is a unique, syntactically valid, human-readable account identifier on the NEAR network.\n\n[See the crate-level docs for information about validation.](index.html#account-id-rules)\n\nAlso see [Error kind precedence](AccountId#error-kind-precedence).\n\n## Examples\n\n``` use near_account_id::AccountId;\n\nlet alice: AccountId = \"alice.near\".parse().unwrap();\n\nassert!(\"ƒelicia.near\".parse::<AccountId>().is_err()); // (ƒ is not f) ```",
      "type": "string"
    },
    "Action": {
      "oneOf": [
        {
          "description": "Create an (sub)account using a transaction `receiver_id` as an ID for a new account ID must pass validation rules described here <http://nomicon.io/Primitives/Account.html>.",
          "type": "object",
          "required": [
            "CreateAccount"
          ],
          "properties": {
            "CreateAccount": {
              "$ref": "#/definitions/CreateAccountAction"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Sets a Wasm code to a receiver_id",
          "type": "object",
          "required": [
            "DeployContract"
          ],
          "properties": {
            "DeployContract": {
              "$ref": "#/definitions/DeployContractAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "FunctionCall"
          ],
          "properties": {
            "FunctionCall": {
              "$ref": "#/definitions/FunctionCallAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Transfer"
          ],
          "properties": {
            "Transfer": {
              "$ref": "#/definitions/TransferAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Stake"
          ],
          "properties": {
            "Stake": {
              "$ref": "#/definitions/StakeAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "AddKey"
          ],
          "properties": {
            "AddKey": {
              "$ref": "#/definitions/AddKeyAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeleteKey"
          ],
          "properties": {
            "DeleteKey": {
              "$ref": "#/definitions/DeleteKeyAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeleteAccount"
          ],
          "properties": {
            "DeleteAccount": {
              "$ref": "#/definitions/DeleteAccountAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Delegate"
          ],
          "properties": {
            "Delegate": {
              "$ref": "#/definitions/SignedDelegateAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeployGlobalContract"
          ],
          "properties": {
            "DeployGlobalContract": {
              "$ref": "#/definitions/DeployGlobalContractAction"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "UseGlobalContract"
          ],
          "properties": {
            "UseGlobalContract": {
              "$ref": "#/definitions/UseGlobalContractAction"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ActionError": {
      "description": "An error happened during Action execution",
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "index": {
          "description": "Index of the failed action in the transaction. Action index is not defined if ActionError.kind is `ActionErrorKind::LackBalanceForState`",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0.0
        },
        "kind": {
          "description": "The kind of ActionError happened",
          "allOf": [
            {
              "$ref": "#/definitions/ActionErrorKind"
            }
          ]
        }
      }
    },
    "ActionErrorKind": {
      "oneOf": [
        {
          "description": "Happens when CreateAccount action tries to create an account with account_id which is already exists in the storage",
          "type": "object",
          "required": [
            "AccountAlreadyExists"
          ],
          "properties": {
            "AccountAlreadyExists": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Happens when TX receiver_id doesn't exist (but action is not Action::CreateAccount)",
          "type": "object",
          "required": [
            "AccountDoesNotExist"
          ],
          "properties": {
            "AccountDoesNotExist": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A top-level account ID can only be created by registrar.",
          "type": "object",
          "required": [
            "CreateAccountOnlyByRegistrar"
          ],
          "properties": {
            "CreateAccountOnlyByRegistrar": {
              "type": "object",
              "required": [
                "account_id",
                "predecessor_id",
                "registrar_account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "predecessor_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "registrar_account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A newly created account must be under a namespace of the creator account",
          "type": "object",
          "required": [
            "CreateAccountNotAllowed"
          ],
          "properties": {
            "CreateAccountNotAllowed": {
              "type": "object",
              "required": [
                "account_id",
                "predecessor_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "predecessor_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Administrative actions like `DeployContract`, `Stake`, `AddKey`, `DeleteKey`. can be proceed only if sender=receiver or the first TX action is a `CreateAccount` action",
          "type": "object",
          "required": [
            "ActorNoPermission"
          ],
          "properties": {
            "ActorNoPermission": {
              "type": "object",
              "required": [
                "account_id",
                "actor_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "actor_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Account tries to remove an access key that doesn't exist",
          "type": "object",
          "required": [
            "DeleteKeyDoesNotExist"
          ],
          "properties": {
            "DeleteKeyDoesNotExist": {
              "type": "object",
              "required": [
                "account_id",
                "public_key"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The public key is already used for an existing access key",
          "type": "object",
          "required": [
            "AddKeyAlreadyExists"
          ],
          "properties": {
            "AddKeyAlreadyExists": {
              "type": "object",
              "required": [
                "account_id",
                "public_key"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Account is staking and can not be deleted",
          "type": "object",
          "required": [
            "DeleteAccountStaking"
          ],
          "properties": {
            "DeleteAccountStaking": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "ActionReceipt can't be completed, because the remaining balance will not be enough to cover storage.",
          "type": "object",
          "required": [
            "LackBalanceForState"
          ],
          "properties": {
            "LackBalanceForState": {
              "type": "object",
              "required": [
                "account_id",
                "amount"
              ],
              "properties": {
                "account_id": {
                  "description": "An account which needs balance",
                  "allOf": [
                    {
                      "$ref": "#/definitions/AccountId"
                    }
                  ]
                },
                "amount": {
                  "description": "Balance required to complete an action.",
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Account is not yet staked, but tries to unstake",
          "type": "object",
          "required": [
            "TriesToUnstake"
          ],
          "properties": {
            "TriesToUnstake": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The account doesn't have enough balance to increase the stake.",
          "type": "object",
          "required": [
            "TriesToStake"
          ],
          "properties": {
            "TriesToStake": {
              "type": "object",
              "required": [
                "account_id",
                "balance",
                "locked",
                "stake"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "balance": {
                  "type": "string"
                },
                "locked": {
                  "type": "string"
                },
                "stake": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "InsufficientStake"
          ],
          "properties": {
            "InsufficientStake": {
              "type": "object",
              "required": [
                "account_id",
                "minimum_stake",
                "stake"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "minimum_stake": {
                  "type": "string"
                },
                "stake": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "An error occurred during a `FunctionCall` Action, parameter is debug message.",
          "type": "object",
          "required": [
            "FunctionCallError"
          ],
          "properties": {
            "FunctionCallError": {
              "$ref": "#/definitions/FunctionCallError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Error occurs when a new `ActionReceipt` created by the `FunctionCall` action fails receipt validation.",
          "type": "object",
          "required": [
            "NewReceiptValidationError"
          ],
          "properties": {
            "NewReceiptValidationError": {
              "$ref": "#/definitions/ReceiptValidationError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Error occurs when a `CreateAccount` action is called on a NEAR-implicit or ETH-implicit account. See NEAR-implicit account creation NEP: <https://github.com/nearprotocol/NEPs/pull/71>. Also, see ETH-implicit account creation NEP: <https://github.com/near/NEPs/issues/518>.\n\nTODO(#8598): This error is named very poorly. A better name would be `OnlyNamedAccountCreationAllowed`.",
          "type": "object",
          "required": [
            "OnlyImplicitAccountCreationAllowed"
          ],
          "properties": {
            "OnlyImplicitAccountCreationAllowed": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Delete account whose state is large is temporarily banned.",
          "type": "object",
          "required": [
            "DeleteAccountWithLargeState"
          ],
          "properties": {
            "DeleteAccountWithLargeState": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Signature does not match the provided actions and given signer public key.",
          "type": "string",
          "enum": [
            "DelegateActionInvalidSignature"
          ]
        },
        {
          "description": "Receiver of the transaction doesn't match Sender of the delegate action",
          "type": "object",
          "required": [
            "DelegateActionSenderDoesNotMatchTxReceiver"
          ],
          "properties": {
            "DelegateActionSenderDoesNotMatchTxReceiver": {
              "type": "object",
              "required": [
                "receiver_id",
                "sender_id"
              ],
              "properties": {
                "receiver_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "sender_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Delegate action has expired. `max_block_height` is less than actual block height.",
          "type": "string",
          "enum": [
            "DelegateActionExpired"
          ]
        },
        {
          "description": "The given public key doesn't exist for Sender account",
          "type": "object",
          "required": [
            "DelegateActionAccessKeyError"
          ],
          "properties": {
            "DelegateActionAccessKeyError": {
              "$ref": "#/definitions/InvalidAccessKeyError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "DelegateAction nonce must be greater sender[public_key].nonce",
          "type": "object",
          "required": [
            "DelegateActionInvalidNonce"
          ],
          "properties": {
            "DelegateActionInvalidNonce": {
              "type": "object",
              "required": [
                "ak_nonce",
                "delegate_nonce"
              ],
              "properties": {
                "ak_nonce": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "delegate_nonce": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "DelegateAction nonce is larger than the upper bound given by the block height",
          "type": "object",
          "required": [
            "DelegateActionNonceTooLarge"
          ],
          "properties": {
            "DelegateActionNonceTooLarge": {
              "type": "object",
              "required": [
                "delegate_nonce",
                "upper_bound"
              ],
              "properties": {
                "delegate_nonce": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "upper_bound": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "GlobalContractDoesNotExist"
          ],
          "properties": {
            "GlobalContractDoesNotExist": {
              "type": "object",
              "required": [
                "identifier"
              ],
              "properties": {
                "identifier": {
                  "$ref": "#/definitions/GlobalContractIdentifier"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ActionView": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "CreateAccount"
          ]
        },
        {
          "type": "object",
          "required": [
            "DeployContract"
          ],
          "properties": {
            "DeployContract": {
              "type": "object",
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "FunctionCall"
          ],
          "properties": {
            "FunctionCall": {
              "type": "object",
              "required": [
                "args",
                "deposit",
                "gas",
                "method_name"
              ],
              "properties": {
                "args": {
                  "type": "string"
                },
                "deposit": {
                  "type": "string"
                },
                "gas": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "method_name": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Transfer"
          ],
          "properties": {
            "Transfer": {
              "type": "object",
              "required": [
                "deposit"
              ],
              "properties": {
                "deposit": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Stake"
          ],
          "properties": {
            "Stake": {
              "type": "object",
              "required": [
                "public_key",
                "stake"
              ],
              "properties": {
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                },
                "stake": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "AddKey"
          ],
          "properties": {
            "AddKey": {
              "type": "object",
              "required": [
                "access_key",
                "public_key"
              ],
              "properties": {
                "access_key": {
                  "$ref": "#/definitions/AccessKeyView"
                },
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeleteKey"
          ],
          "properties": {
            "DeleteKey": {
              "type": "object",
              "required": [
                "public_key"
              ],
              "properties": {
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeleteAccount"
          ],
          "properties": {
            "DeleteAccount": {
              "type": "object",
              "required": [
                "beneficiary_id"
              ],
              "properties": {
                "beneficiary_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Delegate"
          ],
          "properties": {
            "Delegate": {
              "type": "object",
              "required": [
                "delegate_action",
                "signature"
              ],
              "properties": {
                "delegate_action": {
                  "$ref": "#/definitions/DelegateAction"
                },
                "signature": {
                  "$ref": "#/definitions/ExternalStruct"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeployGlobalContract"
          ],
          "properties": {
            "DeployGlobalContract": {
              "type": "object",
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "DeployGlobalContractByAccountId"
          ],
          "properties": {
            "DeployGlobalContractByAccountId": {
              "type": "object",
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "UseGlobalContract"
          ],
          "properties": {
            "UseGlobalContract": {
              "type": "object",
              "required": [
                "code_hash"
              ],
              "properties": {
                "code_hash": {
                  "$ref": "#/definitions/CryptoHash"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "UseGlobalContractByAccountId"
          ],
          "properties": {
            "UseGlobalContractByAccountId": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ActionsValidationError": {
      "description": "Describes the error for validating a list of actions.",
      "oneOf": [
        {
          "description": "The delete action must be a final action in transaction",
          "type": "string",
          "enum": [
            "DeleteActionMustBeFinal"
          ]
        },
        {
          "description": "The total prepaid gas (for all given actions) exceeded the limit.",
          "type": "object",
          "required": [
            "TotalPrepaidGasExceeded"
          ],
          "properties": {
            "TotalPrepaidGasExceeded": {
              "type": "object",
              "required": [
                "limit",
                "total_prepaid_gas"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "total_prepaid_gas": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The number of actions exceeded the given limit.",
          "type": "object",
          "required": [
            "TotalNumberOfActionsExceeded"
          ],
          "properties": {
            "TotalNumberOfActionsExceeded": {
              "type": "object",
              "required": [
                "limit",
                "total_number_of_actions"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "total_number_of_actions": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The total number of bytes of the method names exceeded the limit in a Add Key action.",
          "type": "object",
          "required": [
            "AddKeyMethodNamesNumberOfBytesExceeded"
          ],
          "properties": {
            "AddKeyMethodNamesNumberOfBytesExceeded": {
              "type": "object",
              "required": [
                "limit",
                "total_number_of_bytes"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "total_number_of_bytes": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The length of some method name exceeded the limit in a Add Key action.",
          "type": "object",
          "required": [
            "AddKeyMethodNameLengthExceeded"
          ],
          "properties": {
            "AddKeyMethodNameLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Integer overflow during a compute.",
          "type": "string",
          "enum": [
            "IntegerOverflow"
          ]
        },
        {
          "description": "Invalid account ID.",
          "type": "object",
          "required": [
            "InvalidAccountId"
          ],
          "properties": {
            "InvalidAccountId": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The size of the contract code exceeded the limit in a DeployContract action.",
          "type": "object",
          "required": [
            "ContractSizeExceeded"
          ],
          "properties": {
            "ContractSizeExceeded": {
              "type": "object",
              "required": [
                "limit",
                "size"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "size": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The length of the method name exceeded the limit in a Function Call action.",
          "type": "object",
          "required": [
            "FunctionCallMethodNameLengthExceeded"
          ],
          "properties": {
            "FunctionCallMethodNameLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The length of the arguments exceeded the limit in a Function Call action.",
          "type": "object",
          "required": [
            "FunctionCallArgumentsLengthExceeded"
          ],
          "properties": {
            "FunctionCallArgumentsLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "An attempt to stake with a public key that is not convertible to ristretto.",
          "type": "object",
          "required": [
            "UnsuitableStakingKey"
          ],
          "properties": {
            "UnsuitableStakingKey": {
              "type": "object",
              "required": [
                "public_key"
              ],
              "properties": {
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The attached amount of gas in a FunctionCall action has to be a positive number.",
          "type": "string",
          "enum": [
            "FunctionCallZeroAttachedGas"
          ]
        },
        {
          "description": "There should be the only one DelegateAction",
          "type": "string",
          "enum": [
            "DelegateActionMustBeOnlyOne"
          ]
        },
        {
          "description": "The transaction includes a feature that the current protocol version does not support.\n\nNote: we stringify the protocol feature name instead of using `ProtocolFeature` here because we don't want to leak the internals of that type into observable borsh serialization.",
          "type": "object",
          "required": [
            "UnsupportedProtocolFeature"
          ],
          "properties": {
            "UnsupportedProtocolFeature": {
              "type": "object",
              "required": [
                "protocol_feature",
                "version"
              ],
              "properties": {
                "protocol_feature": {
                  "type": "string"
                },
                "version": {
                  "type": "integer",
                  "format": "uint32",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "AddKeyAction": {
      "type": "object",
      "required": [
        "access_key",
        "public_key"
      ],
      "properties": {
        "access_key": {
          "description": "An access key with the permission",
          "allOf": [
            {
              "$ref": "#/definitions/AccessKey"
            }
          ]
        },
        "public_key": {
          "description": "A public key which will be associated with an access_key",
          "allOf": [
            {
              "$ref": "#/definitions/PublicKey"
            }
          ]
        }
      }
    },
    "CompilationError": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "CodeDoesNotExist"
          ],
          "properties": {
            "CodeDoesNotExist": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "PrepareError"
          ],
          "properties": {
            "PrepareError": {
              "$ref": "#/definitions/PrepareError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "This is for defense in depth. We expect our runtime-independent preparation code to fully catch all invalid wasms, but, if it ever misses something we’ll emit this error",
          "type": "object",
          "required": [
            "WasmerCompileError"
          ],
          "properties": {
            "WasmerCompileError": {
              "type": "object",
              "required": [
                "msg"
              ],
              "properties": {
                "msg": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CostGasUsed": {
      "type": "object",
      "required": [
        "cost",
        "cost_category",
        "gas_used"
      ],
      "properties": {
        "cost": {
          "type": "string"
        },
        "cost_category": {
          "type": "string"
        },
        "gas_used": {
          "type": "string"
        }
      }
    },
    "CreateAccountAction": {
      "description": "Create account action",
      "type": "object"
    },
    "CryptoHash": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0.0
      },
      "maxItems": 32,
      "minItems": 32
    },
    "DataReceiverView": {
      "type": "object",
      "required": [
        "data_id",
        "receiver_id"
      ],
      "properties": {
        "data_id": {
          "$ref": "#/definitions/CryptoHash"
        },
        "receiver_id": {
          "$ref": "#/definitions/AccountId"
        }
      }
    },
    "DelegateAction": {
      "description": "This action allows to execute the inner actions behalf of the defined sender.",
      "type": "object",
      "required": [
        "actions",
        "max_block_height",
        "nonce",
        "public_key",
        "receiver_id",
        "sender_id"
      ],
      "properties": {
        "actions": {
          "description": "List of actions to be executed.\n\nWith the meta transactions MVP defined in NEP-366, nested DelegateActions are not allowed. A separate type is used to enforce it.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/NonDelegateAction"
          }
        },
        "max_block_height": {
          "description": "The maximal height of the block in the blockchain below which the given DelegateAction is valid.",
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "nonce": {
          "description": "Nonce to ensure that the same delegate action is not sent twice by a relayer and should match for given account's `public_key`. After this action is processed it will increment.",
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "public_key": {
          "description": "Public key used to sign this delegated action.",
          "allOf": [
            {
              "$ref": "#/definitions/PublicKey"
            }
          ]
        },
        "receiver_id": {
          "description": "Receiver of the delegated actions.",
          "allOf": [
            {
              "$ref": "#/definitions/AccountId"
            }
          ]
        },
        "sender_id": {
          "description": "Signer of the delegated actions",
          "allOf": [
            {
              "$ref": "#/definitions/AccountId"
            }
          ]
        }
      }
    },
    "DeleteAccountAction": {
      "type": "object",
      "required": [
        "beneficiary_id"
      ],
      "properties": {
        "beneficiary_id": {
          "$ref": "#/definitions/AccountId"
        }
      }
    },
    "DeleteKeyAction": {
      "type": "object",
      "required": [
        "public_key"
      ],
      "properties": {
        "public_key": {
          "description": "A public key associated with the access_key to be deleted.",
          "allOf": [
            {
              "$ref": "#/definitions/PublicKey"
            }
          ]
        }
      }
    },
    "DeployContractAction": {
      "description": "Deploy contract action",
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "description": "WebAssembly binary",
          "type": "string"
        }
      }
    },
    "DeployGlobalContractAction": {
      "description": "Deploy global contract action",
      "type": "object",
      "required": [
        "code",
        "deploy_mode"
      ],
      "properties": {
        "code": {
          "description": "WebAssembly binary",
          "type": "string"
        },
        "deploy_mode": {
          "$ref": "#/definitions/GlobalContractDeployMode"
        }
      }
    },
    "Direction": {
      "type": "string",
      "enum": [
        "Left",
        "Right"
      ]
    },
    "ED25519PublicKey": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0.0
      },
      "maxItems": 32,
      "minItems": 32
    },
    "ExecutionMetadataView": {
      "type": "object",
      "required": [
        "version"
      ],
      "properties": {
        "gas_profile": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/CostGasUsed"
          }
        },
        "version": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0.0
        }
      }
    },
    "ExecutionOutcomeView": {
      "type": "object",
      "required": [
        "executor_id",
        "gas_burnt",
        "logs",
        "receipt_ids",
        "status",
        "tokens_burnt"
      ],
      "properties": {
        "executor_id": {
          "description": "The id of the account on which the execution happens. For transaction this is signer_id, for receipt this is receiver_id.",
          "allOf": [
            {
              "$ref": "#/definitions/AccountId"
            }
          ]
        },
        "gas_burnt": {
          "description": "The amount of the gas burnt by the given transaction or receipt.",
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "logs": {
          "description": "Logs from this transaction or receipt.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metadata": {
          "description": "Execution metadata, versioned",
          "default": {
            "version": 1,
            "gas_profile": null
          },
          "allOf": [
            {
              "$ref": "#/definitions/ExecutionMetadataView"
            }
          ]
        },
        "receipt_ids": {
          "description": "Receipt IDs generated by this transaction or receipt.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/CryptoHash"
          }
        },
        "status": {
          "description": "Execution status. Contains the result in case of successful execution.",
          "allOf": [
            {
              "$ref": "#/definitions/ExecutionStatusView"
            }
          ]
        },
        "tokens_burnt": {
          "description": "The amount of tokens burnt corresponding to the burnt gas amount. This value doesn't always equal to the `gas_burnt` multiplied by the gas price, because the prepaid gas price might be lower than the actual gas price and it creates a deficit.",
          "type": "string"
        }
      }
    },
    "ExecutionOutcomeWithIdView": {
      "type": "object",
      "required": [
        "block_hash",
        "id",
        "outcome",
        "proof"
      ],
      "properties": {
        "block_hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "id": {
          "$ref": "#/definitions/CryptoHash"
        },
        "outcome": {
          "$ref": "#/definitions/ExecutionOutcomeView"
        },
        "proof": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MerklePathItem"
          }
        }
      }
    },
    "ExecutionStatusView": {
      "oneOf": [
        {
          "description": "The execution is pending or unknown.",
          "type": "string",
          "enum": [
            "Unknown"
          ]
        },
        {
          "description": "The execution has failed.",
          "type": "object",
          "required": [
            "Failure"
          ],
          "properties": {
            "Failure": {
              "$ref": "#/definitions/TxExecutionError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The final action succeeded and returned some value or an empty vec encoded in base64.",
          "type": "object",
          "required": [
            "SuccessValue"
          ],
          "properties": {
            "SuccessValue": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The final action of the receipt returned a promise or the signed transaction was converted to a receipt. Contains the receipt_id of the generated receipt.",
          "type": "object",
          "required": [
            "SuccessReceiptId"
          ],
          "properties": {
            "SuccessReceiptId": {
              "$ref": "#/definitions/CryptoHash"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ExternalStruct": {
      "type": "integer",
      "format": "uint64",
      "minimum": 0.0
    },
    "FinalExecutionOutcomeView": {
      "description": "Execution outcome of the transaction and all the subsequent receipts. Could be not finalized yet",
      "type": "object",
      "required": [
        "receipts_outcome",
        "status",
        "transaction",
        "transaction_outcome"
      ],
      "properties": {
        "receipts_outcome": {
          "description": "The execution outcome of receipts.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExecutionOutcomeWithIdView"
          }
        },
        "status": {
          "description": "Execution status defined by chain.rs:get_final_transaction_result FinalExecutionStatus::NotStarted - the tx is not converted to the receipt yet FinalExecutionStatus::Started - we have at least 1 receipt, but the first leaf receipt_id (using dfs) hasn't finished the execution FinalExecutionStatus::Failure - the result of the first leaf receipt_id FinalExecutionStatus::SuccessValue - the result of the first leaf receipt_id",
          "allOf": [
            {
              "$ref": "#/definitions/FinalExecutionStatus"
            }
          ]
        },
        "transaction": {
          "description": "Signed Transaction",
          "allOf": [
            {
              "$ref": "#/definitions/SignedTransactionView"
            }
          ]
        },
        "transaction_outcome": {
          "description": "The execution outcome of the signed transaction.",
          "allOf": [
            {
              "$ref": "#/definitions/ExecutionOutcomeWithIdView"
            }
          ]
        }
      }
    },
    "FinalExecutionOutcomeWithReceiptView": {
      "description": "Final execution outcome of the transaction and all of subsequent the receipts. Also includes the generated receipt.",
      "type": "object",
      "required": [
        "receipts",
        "receipts_outcome",
        "status",
        "transaction",
        "transaction_outcome"
      ],
      "properties": {
        "receipts": {
          "description": "Receipts generated from the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ReceiptView"
          }
        },
        "receipts_outcome": {
          "description": "The execution outcome of receipts.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExecutionOutcomeWithIdView"
          }
        },
        "status": {
          "description": "Execution status defined by chain.rs:get_final_transaction_result FinalExecutionStatus::NotStarted - the tx is not converted to the receipt yet FinalExecutionStatus::Started - we have at least 1 receipt, but the first leaf receipt_id (using dfs) hasn't finished the execution FinalExecutionStatus::Failure - the result of the first leaf receipt_id FinalExecutionStatus::SuccessValue - the result of the first leaf receipt_id",
          "allOf": [
            {
              "$ref": "#/definitions/FinalExecutionStatus"
            }
          ]
        },
        "transaction": {
          "description": "Signed Transaction",
          "allOf": [
            {
              "$ref": "#/definitions/SignedTransactionView"
            }
          ]
        },
        "transaction_outcome": {
          "description": "The execution outcome of the signed transaction.",
          "allOf": [
            {
              "$ref": "#/definitions/ExecutionOutcomeWithIdView"
            }
          ]
        }
      }
    },
    "FinalExecutionStatus": {
      "oneOf": [
        {
          "description": "The execution has not yet started.",
          "type": "string",
          "enum": [
            "NotStarted"
          ]
        },
        {
          "description": "The execution has started and still going.",
          "type": "string",
          "enum": [
            "Started"
          ]
        },
        {
          "description": "The execution has failed with the given error.",
          "type": "object",
          "required": [
            "Failure"
          ],
          "properties": {
            "Failure": {
              "$ref": "#/definitions/TxExecutionError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The execution has succeeded and returned some value or an empty vec encoded in base64.",
          "type": "object",
          "required": [
            "SuccessValue"
          ],
          "properties": {
            "SuccessValue": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "FunctionCallAction": {
      "type": "object",
      "required": [
        "args",
        "deposit",
        "gas",
        "method_name"
      ],
      "properties": {
        "args": {
          "type": "string"
        },
        "deposit": {
          "type": "string"
        },
        "gas": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "method_name": {
          "type": "string"
        }
      }
    },
    "FunctionCallError": {
      "description": "Serializable version of `near-vm-runner::FunctionCallError`.\n\nMust never reorder/remove elements, can only add new variants at the end (but do that very carefully). It describes stable serialization format, and only used by serialization logic.",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "WasmUnknownError",
            "_EVMError"
          ]
        },
        {
          "description": "Wasm compilation error",
          "type": "object",
          "required": [
            "CompilationError"
          ],
          "properties": {
            "CompilationError": {
              "$ref": "#/definitions/CompilationError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Wasm binary env link error\n\nNote: this is only to deserialize old data, use execution error for new data",
          "type": "object",
          "required": [
            "LinkError"
          ],
          "properties": {
            "LinkError": {
              "type": "object",
              "required": [
                "msg"
              ],
              "properties": {
                "msg": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Import/export resolve error",
          "type": "object",
          "required": [
            "MethodResolveError"
          ],
          "properties": {
            "MethodResolveError": {
              "$ref": "#/definitions/MethodResolveError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A trap happened during execution of a binary\n\nNote: this is only to deserialize old data, use execution error for new data",
          "type": "object",
          "required": [
            "WasmTrap"
          ],
          "properties": {
            "WasmTrap": {
              "$ref": "#/definitions/WasmTrap"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Note: this is only to deserialize old data, use execution error for new data",
          "type": "object",
          "required": [
            "HostError"
          ],
          "properties": {
            "HostError": {
              "$ref": "#/definitions/HostError"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ExecutionError"
          ],
          "properties": {
            "ExecutionError": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "FunctionCallPermission": {
      "description": "Grants limited permission to make transactions with FunctionCallActions The permission can limit the allowed balance to be spent on the prepaid gas. It also restrict the account ID of the receiver for this function call. It also can restrict the method name for the allowed function calls.",
      "type": "object",
      "required": [
        "allowance",
        "method_names",
        "receiver_id"
      ],
      "properties": {
        "allowance": {
          "description": "Allowance is a balance limit to use by this access key to pay for function call gas and transaction fees. When this access key is used, both account balance and the allowance is decreased by the same value. `None` means unlimited allowance. NOTE: To change or increase the allowance, the old access key needs to be deleted and a new access key should be created.",
          "type": "string"
        },
        "method_names": {
          "description": "A list of method names that can be used. The access key only allows transactions with the function call of one of the given method names. Empty list means any method name can be used.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "receiver_id": {
          "description": "The access key only allows transactions with the given receiver's account id.",
          "type": "string"
        }
      }
    },
    "GlobalContractData": {
      "type": "object",
      "required": [
        "code",
        "id"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "id": {
          "$ref": "#/definitions/GlobalContractIdentifier"
        }
      }
    },
    "GlobalContractDeployMode": {
      "oneOf": [
        {
          "description": "Contract is deployed under its code hash. Users will be able reference it by that hash. This effectively makes the contract immutable.",
          "type": "string",
          "enum": [
            "CodeHash"
          ]
        },
        {
          "description": "Contract is deployed under the owner account id. Users will be able reference it by that account id. This allows the owner to update the contract for all its users.",
          "type": "string",
          "enum": [
            "AccountId"
          ]
        }
      ]
    },
    "GlobalContractIdentifier": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "CodeHash"
          ],
          "properties": {
            "CodeHash": {
              "$ref": "#/definitions/CryptoHash"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "AccountId"
          ],
          "properties": {
            "AccountId": {
              "$ref": "#/definitions/AccountId"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "HostError": {
      "oneOf": [
        {
          "description": "String encoding is bad UTF-16 sequence",
          "type": "string",
          "enum": [
            "BadUTF16"
          ]
        },
        {
          "description": "String encoding is bad UTF-8 sequence",
          "type": "string",
          "enum": [
            "BadUTF8"
          ]
        },
        {
          "description": "Exceeded the prepaid gas",
          "type": "string",
          "enum": [
            "GasExceeded"
          ]
        },
        {
          "description": "Exceeded the maximum amount of gas allowed to burn per contract",
          "type": "string",
          "enum": [
            "GasLimitExceeded"
          ]
        },
        {
          "description": "Exceeded the account balance",
          "type": "string",
          "enum": [
            "BalanceExceeded"
          ]
        },
        {
          "description": "Tried to call an empty method name",
          "type": "string",
          "enum": [
            "EmptyMethodName"
          ]
        },
        {
          "description": "Smart contract panicked",
          "type": "object",
          "required": [
            "GuestPanic"
          ],
          "properties": {
            "GuestPanic": {
              "type": "object",
              "required": [
                "panic_msg"
              ],
              "properties": {
                "panic_msg": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "IntegerOverflow happened during a contract execution",
          "type": "string",
          "enum": [
            "IntegerOverflow"
          ]
        },
        {
          "description": "`promise_idx` does not correspond to existing promises",
          "type": "object",
          "required": [
            "InvalidPromiseIndex"
          ],
          "properties": {
            "InvalidPromiseIndex": {
              "type": "object",
              "required": [
                "promise_idx"
              ],
              "properties": {
                "promise_idx": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Actions can only be appended to non-joint promise.",
          "type": "string",
          "enum": [
            "CannotAppendActionToJointPromise"
          ]
        },
        {
          "description": "Returning joint promise is currently prohibited",
          "type": "string",
          "enum": [
            "CannotReturnJointPromise"
          ]
        },
        {
          "description": "Accessed invalid promise result index",
          "type": "object",
          "required": [
            "InvalidPromiseResultIndex"
          ],
          "properties": {
            "InvalidPromiseResultIndex": {
              "type": "object",
              "required": [
                "result_idx"
              ],
              "properties": {
                "result_idx": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Accessed invalid register id",
          "type": "object",
          "required": [
            "InvalidRegisterId"
          ],
          "properties": {
            "InvalidRegisterId": {
              "type": "object",
              "required": [
                "register_id"
              ],
              "properties": {
                "register_id": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Iterator `iterator_index` was invalidated after its creation by performing a mutable operation on trie",
          "type": "object",
          "required": [
            "IteratorWasInvalidated"
          ],
          "properties": {
            "IteratorWasInvalidated": {
              "type": "object",
              "required": [
                "iterator_index"
              ],
              "properties": {
                "iterator_index": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Accessed memory outside the bounds",
          "type": "string",
          "enum": [
            "MemoryAccessViolation"
          ]
        },
        {
          "description": "VM Logic returned an invalid receipt index",
          "type": "object",
          "required": [
            "InvalidReceiptIndex"
          ],
          "properties": {
            "InvalidReceiptIndex": {
              "type": "object",
              "required": [
                "receipt_index"
              ],
              "properties": {
                "receipt_index": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Iterator index `iterator_index` does not exist",
          "type": "object",
          "required": [
            "InvalidIteratorIndex"
          ],
          "properties": {
            "InvalidIteratorIndex": {
              "type": "object",
              "required": [
                "iterator_index"
              ],
              "properties": {
                "iterator_index": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "VM Logic returned an invalid account id",
          "type": "string",
          "enum": [
            "InvalidAccountId"
          ]
        },
        {
          "description": "VM Logic returned an invalid method name",
          "type": "string",
          "enum": [
            "InvalidMethodName"
          ]
        },
        {
          "description": "VM Logic provided an invalid public key",
          "type": "string",
          "enum": [
            "InvalidPublicKey"
          ]
        },
        {
          "description": "`method_name` is not allowed in view calls",
          "type": "object",
          "required": [
            "ProhibitedInView"
          ],
          "properties": {
            "ProhibitedInView": {
              "type": "object",
              "required": [
                "method_name"
              ],
              "properties": {
                "method_name": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The total number of logs will exceed the limit.",
          "type": "object",
          "required": [
            "NumberOfLogsExceeded"
          ],
          "properties": {
            "NumberOfLogsExceeded": {
              "type": "object",
              "required": [
                "limit"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The storage key length exceeded the limit.",
          "type": "object",
          "required": [
            "KeyLengthExceeded"
          ],
          "properties": {
            "KeyLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The storage value length exceeded the limit.",
          "type": "object",
          "required": [
            "ValueLengthExceeded"
          ],
          "properties": {
            "ValueLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The total log length exceeded the limit.",
          "type": "object",
          "required": [
            "TotalLogLengthExceeded"
          ],
          "properties": {
            "TotalLogLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The maximum number of promises within a FunctionCall exceeded the limit.",
          "type": "object",
          "required": [
            "NumberPromisesExceeded"
          ],
          "properties": {
            "NumberPromisesExceeded": {
              "type": "object",
              "required": [
                "limit",
                "number_of_promises"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "number_of_promises": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The maximum number of input data dependencies exceeded the limit.",
          "type": "object",
          "required": [
            "NumberInputDataDependenciesExceeded"
          ],
          "properties": {
            "NumberInputDataDependenciesExceeded": {
              "type": "object",
              "required": [
                "limit",
                "number_of_input_data_dependencies"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "number_of_input_data_dependencies": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The returned value length exceeded the limit.",
          "type": "object",
          "required": [
            "ReturnedValueLengthExceeded"
          ],
          "properties": {
            "ReturnedValueLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The contract size for DeployContract action exceeded the limit.",
          "type": "object",
          "required": [
            "ContractSizeExceeded"
          ],
          "properties": {
            "ContractSizeExceeded": {
              "type": "object",
              "required": [
                "limit",
                "size"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "size": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The host function was deprecated.",
          "type": "object",
          "required": [
            "Deprecated"
          ],
          "properties": {
            "Deprecated": {
              "type": "object",
              "required": [
                "method_name"
              ],
              "properties": {
                "method_name": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "General errors for ECDSA recover.",
          "type": "object",
          "required": [
            "ECRecoverError"
          ],
          "properties": {
            "ECRecoverError": {
              "type": "object",
              "required": [
                "msg"
              ],
              "properties": {
                "msg": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Invalid input to alt_bn128 family of functions (e.g., point which isn't on the curve).",
          "type": "object",
          "required": [
            "AltBn128InvalidInput"
          ],
          "properties": {
            "AltBn128InvalidInput": {
              "type": "object",
              "required": [
                "msg"
              ],
              "properties": {
                "msg": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Invalid input to ed25519 signature verification function (e.g. signature cannot be derived from bytes).",
          "type": "object",
          "required": [
            "Ed25519VerifyInvalidInput"
          ],
          "properties": {
            "Ed25519VerifyInvalidInput": {
              "type": "object",
              "required": [
                "msg"
              ],
              "properties": {
                "msg": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "InvalidAccessKeyError": {
      "oneOf": [
        {
          "description": "The access key identified by the `public_key` doesn't exist for the account",
          "type": "object",
          "required": [
            "AccessKeyNotFound"
          ],
          "properties": {
            "AccessKeyNotFound": {
              "type": "object",
              "required": [
                "account_id",
                "public_key"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Transaction `receiver_id` doesn't match the access key receiver_id",
          "type": "object",
          "required": [
            "ReceiverMismatch"
          ],
          "properties": {
            "ReceiverMismatch": {
              "type": "object",
              "required": [
                "ak_receiver",
                "tx_receiver"
              ],
              "properties": {
                "ak_receiver": {
                  "type": "string"
                },
                "tx_receiver": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Transaction method name isn't allowed by the access key",
          "type": "object",
          "required": [
            "MethodNameMismatch"
          ],
          "properties": {
            "MethodNameMismatch": {
              "type": "object",
              "required": [
                "method_name"
              ],
              "properties": {
                "method_name": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Transaction requires a full permission access key.",
          "type": "string",
          "enum": [
            "RequiresFullAccess"
          ]
        },
        {
          "description": "Access Key does not have enough allowance to cover transaction cost",
          "type": "object",
          "required": [
            "NotEnoughAllowance"
          ],
          "properties": {
            "NotEnoughAllowance": {
              "type": "object",
              "required": [
                "account_id",
                "allowance",
                "cost",
                "public_key"
              ],
              "properties": {
                "account_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "allowance": {
                  "type": "string"
                },
                "cost": {
                  "type": "string"
                },
                "public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Having a deposit with a function call action is not allowed with a function call access key.",
          "type": "string",
          "enum": [
            "DepositWithFunctionCall"
          ]
        }
      ]
    },
    "InvalidTxError": {
      "description": "An error happened during TX execution",
      "oneOf": [
        {
          "description": "Happens if a wrong AccessKey used or AccessKey has not enough permissions",
          "type": "object",
          "required": [
            "InvalidAccessKeyError"
          ],
          "properties": {
            "InvalidAccessKeyError": {
              "$ref": "#/definitions/InvalidAccessKeyError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "TX signer_id is not a valid [`AccountId`]",
          "type": "object",
          "required": [
            "InvalidSignerId"
          ],
          "properties": {
            "InvalidSignerId": {
              "type": "object",
              "required": [
                "signer_id"
              ],
              "properties": {
                "signer_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "TX signer_id is not found in a storage",
          "type": "object",
          "required": [
            "SignerDoesNotExist"
          ],
          "properties": {
            "SignerDoesNotExist": {
              "type": "object",
              "required": [
                "signer_id"
              ],
              "properties": {
                "signer_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Transaction nonce must be `account[access_key].nonce + 1`.",
          "type": "object",
          "required": [
            "InvalidNonce"
          ],
          "properties": {
            "InvalidNonce": {
              "type": "object",
              "required": [
                "ak_nonce",
                "tx_nonce"
              ],
              "properties": {
                "ak_nonce": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "tx_nonce": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Transaction nonce is larger than the upper bound given by the block height",
          "type": "object",
          "required": [
            "NonceTooLarge"
          ],
          "properties": {
            "NonceTooLarge": {
              "type": "object",
              "required": [
                "tx_nonce",
                "upper_bound"
              ],
              "properties": {
                "tx_nonce": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "upper_bound": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "TX receiver_id is not a valid AccountId",
          "type": "object",
          "required": [
            "InvalidReceiverId"
          ],
          "properties": {
            "InvalidReceiverId": {
              "type": "object",
              "required": [
                "receiver_id"
              ],
              "properties": {
                "receiver_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "TX signature is not valid",
          "type": "string",
          "enum": [
            "InvalidSignature"
          ]
        },
        {
          "description": "Account does not have enough balance to cover TX cost",
          "type": "object",
          "required": [
            "NotEnoughBalance"
          ],
          "properties": {
            "NotEnoughBalance": {
              "type": "object",
              "required": [
                "balance",
                "cost",
                "signer_id"
              ],
              "properties": {
                "balance": {
                  "type": "string"
                },
                "cost": {
                  "type": "string"
                },
                "signer_id": {
                  "$ref": "#/definitions/AccountId"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Signer account doesn't have enough balance after transaction.",
          "type": "object",
          "required": [
            "LackBalanceForState"
          ],
          "properties": {
            "LackBalanceForState": {
              "type": "object",
              "required": [
                "amount",
                "signer_id"
              ],
              "properties": {
                "amount": {
                  "description": "Required balance to cover the state.",
                  "type": "string"
                },
                "signer_id": {
                  "description": "An account which doesn't have enough balance to cover storage.",
                  "allOf": [
                    {
                      "$ref": "#/definitions/AccountId"
                    }
                  ]
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "An integer overflow occurred during transaction cost estimation.",
          "type": "string",
          "enum": [
            "CostOverflow"
          ]
        },
        {
          "description": "Transaction parent block hash doesn't belong to the current chain",
          "type": "string",
          "enum": [
            "InvalidChain"
          ]
        },
        {
          "description": "Transaction has expired",
          "type": "string",
          "enum": [
            "Expired"
          ]
        },
        {
          "description": "An error occurred while validating actions of a Transaction.",
          "type": "object",
          "required": [
            "ActionsValidation"
          ],
          "properties": {
            "ActionsValidation": {
              "$ref": "#/definitions/ActionsValidationError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The size of serialized transaction exceeded the limit.",
          "type": "object",
          "required": [
            "TransactionSizeExceeded"
          ],
          "properties": {
            "TransactionSizeExceeded": {
              "type": "object",
              "required": [
                "limit",
                "size"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "size": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Transaction version is invalid.",
          "type": "string",
          "enum": [
            "InvalidTransactionVersion"
          ]
        },
        {
          "type": "object",
          "required": [
            "StorageError"
          ],
          "properties": {
            "StorageError": {
              "$ref": "#/definitions/StorageError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The receiver shard of the transaction is too congested to accept new transactions at the moment.",
          "type": "object",
          "required": [
            "ShardCongested"
          ],
          "properties": {
            "ShardCongested": {
              "type": "object",
              "required": [
                "congestion_level",
                "shard_id"
              ],
              "properties": {
                "congestion_level": {
                  "description": "A value between 0 (no congestion) and 1 (max congestion).",
                  "type": "number",
                  "format": "double"
                },
                "shard_id": {
                  "description": "The congested shard.",
                  "type": "integer",
                  "format": "uint32",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The receiver shard of the transaction missed several chunks and rejects new transaction until it can make progress again.",
          "type": "object",
          "required": [
            "ShardStuck"
          ],
          "properties": {
            "ShardStuck": {
              "type": "object",
              "required": [
                "missed_chunks",
                "shard_id"
              ],
              "properties": {
                "missed_chunks": {
                  "description": "The number of blocks since the last included chunk of the shard.",
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "shard_id": {
                  "description": "The shard that fails making progress.",
                  "type": "integer",
                  "format": "uint32",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "MerklePathItem": {
      "type": "object",
      "required": [
        "direction",
        "hash"
      ],
      "properties": {
        "direction": {
          "$ref": "#/definitions/Direction"
        },
        "hash": {
          "$ref": "#/definitions/CryptoHash"
        }
      }
    },
    "MethodResolveError": {
      "type": "string",
      "enum": [
        "MethodEmptyName",
        "MethodNotFound",
        "MethodInvalidSignature"
      ]
    },
    "MissingTrieValueContext": {
      "description": "Contexts in which `StorageError::MissingTrieValue` error might occur.",
      "oneOf": [
        {
          "description": "Missing trie value when reading from TrieIterator.",
          "type": "string",
          "enum": [
            "TrieIterator"
          ]
        },
        {
          "description": "Missing trie value when reading from TriePrefetchingStorage.",
          "type": "string",
          "enum": [
            "TriePrefetchingStorage"
          ]
        },
        {
          "description": "Missing trie value when reading from TrieMemoryPartialStorage.",
          "type": "string",
          "enum": [
            "TrieMemoryPartialStorage"
          ]
        },
        {
          "description": "Missing trie value when reading from TrieStorage.",
          "type": "string",
          "enum": [
            "TrieStorage"
          ]
        }
      ]
    },
    "NonDelegateAction": {
      "description": "This is Action which mustn't contain DelegateAction.\n\nThis struct is needed to avoid the recursion when Action/DelegateAction is deserialized.\n\nImportant: Don't make the inner Action public, this must only be constructed through the correct interface that ensures the inner Action is actually not a delegate action. That would break an assumption of this type, which we use in several places. For example, borsh de-/serialization relies on it. If the invariant is broken, we may end up with a `Transaction` or `Receipt` that we can serialize but deserializing it back causes a parsing error.",
      "allOf": [
        {
          "$ref": "#/definitions/Action"
        }
      ]
    },
    "PrepareError": {
      "description": "Error that can occur while preparing or executing Wasm smart-contract.",
      "oneOf": [
        {
          "description": "Error happened while serializing the module.",
          "type": "string",
          "enum": [
            "Serialization"
          ]
        },
        {
          "description": "Error happened while deserializing the module.",
          "type": "string",
          "enum": [
            "Deserialization"
          ]
        },
        {
          "description": "Internal memory declaration has been found in the module.",
          "type": "string",
          "enum": [
            "InternalMemoryDeclared"
          ]
        },
        {
          "description": "Gas instrumentation failed.\n\nThis most likely indicates the module isn't valid.",
          "type": "string",
          "enum": [
            "GasInstrumentation"
          ]
        },
        {
          "description": "Stack instrumentation failed.\n\nThis  most likely indicates the module isn't valid.",
          "type": "string",
          "enum": [
            "StackHeightInstrumentation"
          ]
        },
        {
          "description": "Error happened during instantiation.\n\nThis might indicate that `start` function trapped, or module isn't instantiable and/or un-linkable.",
          "type": "string",
          "enum": [
            "Instantiate"
          ]
        },
        {
          "description": "Error creating memory.",
          "type": "string",
          "enum": [
            "Memory"
          ]
        },
        {
          "description": "Contract contains too many functions.",
          "type": "string",
          "enum": [
            "TooManyFunctions"
          ]
        },
        {
          "description": "Contract contains too many locals.",
          "type": "string",
          "enum": [
            "TooManyLocals"
          ]
        }
      ]
    },
    "PublicKey": {
      "description": "Public key container supporting different curves.",
      "oneOf": [
        {
          "description": "256 bit elliptic curve based public-key.",
          "type": "object",
          "required": [
            "ED25519"
          ],
          "properties": {
            "ED25519": {
              "$ref": "#/definitions/ED25519PublicKey"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "512 bit elliptic curve based public-key used in Bitcoin's public-key cryptography.",
          "type": "object",
          "required": [
            "SECP256K1"
          ],
          "properties": {
            "SECP256K1": {
              "$ref": "#/definitions/Secp256K1PublicKey"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ReceiptEnumView": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "Action"
          ],
          "properties": {
            "Action": {
              "type": "object",
              "required": [
                "actions",
                "gas_price",
                "input_data_ids",
                "output_data_receivers",
                "signer_id",
                "signer_public_key"
              ],
              "properties": {
                "actions": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/ActionView"
                  }
                },
                "gas_price": {
                  "type": "string"
                },
                "input_data_ids": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/CryptoHash"
                  }
                },
                "is_promise_yield": {
                  "default": false,
                  "type": "boolean"
                },
                "output_data_receivers": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/DataReceiverView"
                  }
                },
                "signer_id": {
                  "$ref": "#/definitions/AccountId"
                },
                "signer_public_key": {
                  "$ref": "#/definitions/PublicKey"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "Data"
          ],
          "properties": {
            "Data": {
              "type": "object",
              "required": [
                "data_id"
              ],
              "properties": {
                "data": {
                  "default": null,
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "data_id": {
                  "$ref": "#/definitions/CryptoHash"
                },
                "is_promise_resume": {
                  "default": false,
                  "type": "boolean"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "GlobalContractDistribution"
          ],
          "properties": {
            "GlobalContractDistribution": {
              "type": "object",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "$ref": "#/definitions/GlobalContractData"
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ReceiptValidationError": {
      "description": "Describes the error for validating a receipt.",
      "oneOf": [
        {
          "description": "The `predecessor_id` of a Receipt is not valid.",
          "type": "object",
          "required": [
            "InvalidPredecessorId"
          ],
          "properties": {
            "InvalidPredecessorId": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The `receiver_id` of a Receipt is not valid.",
          "type": "object",
          "required": [
            "InvalidReceiverId"
          ],
          "properties": {
            "InvalidReceiverId": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The `signer_id` of an ActionReceipt is not valid.",
          "type": "object",
          "required": [
            "InvalidSignerId"
          ],
          "properties": {
            "InvalidSignerId": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The `receiver_id` of a DataReceiver within an ActionReceipt is not valid.",
          "type": "object",
          "required": [
            "InvalidDataReceiverId"
          ],
          "properties": {
            "InvalidDataReceiverId": {
              "type": "object",
              "required": [
                "account_id"
              ],
              "properties": {
                "account_id": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The length of the returned data exceeded the limit in a DataReceipt.",
          "type": "object",
          "required": [
            "ReturnedValueLengthExceeded"
          ],
          "properties": {
            "ReturnedValueLengthExceeded": {
              "type": "object",
              "required": [
                "length",
                "limit"
              ],
              "properties": {
                "length": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "The number of input data dependencies exceeds the limit in an ActionReceipt.",
          "type": "object",
          "required": [
            "NumberInputDataDependenciesExceeded"
          ],
          "properties": {
            "NumberInputDataDependenciesExceeded": {
              "type": "object",
              "required": [
                "limit",
                "number_of_input_data_dependencies"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "number_of_input_data_dependencies": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "An error occurred while validating actions of an ActionReceipt.",
          "type": "object",
          "required": [
            "ActionsValidation"
          ],
          "properties": {
            "ActionsValidation": {
              "$ref": "#/definitions/ActionsValidationError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Receipt is bigger than the limit.",
          "type": "object",
          "required": [
            "ReceiptSizeExceeded"
          ],
          "properties": {
            "ReceiptSizeExceeded": {
              "type": "object",
              "required": [
                "limit",
                "size"
              ],
              "properties": {
                "limit": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                },
                "size": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0.0
                }
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ReceiptView": {
      "type": "object",
      "required": [
        "predecessor_id",
        "receipt",
        "receipt_id",
        "receiver_id"
      ],
      "properties": {
        "predecessor_id": {
          "$ref": "#/definitions/AccountId"
        },
        "priority": {
          "default": 0,
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "receipt": {
          "$ref": "#/definitions/ReceiptEnumView"
        },
        "receipt_id": {
          "$ref": "#/definitions/CryptoHash"
        },
        "receiver_id": {
          "$ref": "#/definitions/AccountId"
        }
      }
    },
    "Secp256K1PublicKey": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0.0
      }
    },
    "SignedDelegateAction": {
      "type": "object",
      "required": [
        "delegate_action",
        "signature"
      ],
      "properties": {
        "delegate_action": {
          "$ref": "#/definitions/DelegateAction"
        },
        "signature": {
          "$ref": "#/definitions/ExternalStruct"
        }
      }
    },
    "SignedTransactionView": {
      "type": "object",
      "required": [
        "actions",
        "hash",
        "nonce",
        "public_key",
        "receiver_id",
        "signature",
        "signer_id"
      ],
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ActionView"
          }
        },
        "hash": {
          "$ref": "#/definitions/CryptoHash"
        },
        "nonce": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "priority_fee": {
          "default": 0,
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "public_key": {
          "$ref": "#/definitions/PublicKey"
        },
        "receiver_id": {
          "$ref": "#/definitions/AccountId"
        },
        "signature": {
          "$ref": "#/definitions/ExternalStruct"
        },
        "signer_id": {
          "$ref": "#/definitions/AccountId"
        }
      }
    },
    "StakeAction": {
      "description": "An action which stakes signer_id tokens and setup's validator public key",
      "type": "object",
      "required": [
        "public_key",
        "stake"
      ],
      "properties": {
        "public_key": {
          "description": "Validator key which will be used to sign transactions on behalf of signer_id",
          "allOf": [
            {
              "$ref": "#/definitions/PublicKey"
            }
          ]
        },
        "stake": {
          "description": "Amount of tokens to stake.",
          "type": "string"
        }
      }
    },
    "StorageError": {
      "description": "Errors which may occur during working with trie storages, storing trie values (trie nodes and state values) by their hashes.",
      "oneOf": [
        {
          "description": "Key-value db internal failure",
          "type": "string",
          "enum": [
            "StorageInternalError"
          ]
        },
        {
          "description": "Requested trie value by its hash which is missing in storage.",
          "type": "object",
          "required": [
            "MissingTrieValue"
          ],
          "properties": {
            "MissingTrieValue": {
              "type": "array",
              "items": [
                {
                  "$ref": "#/definitions/MissingTrieValueContext"
                },
                {
                  "$ref": "#/definitions/CryptoHash"
                }
              ],
              "maxItems": 2,
              "minItems": 2
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Found trie node which shouldn't be part of state. Raised during validation of state sync parts where incorrect node was passed. TODO (#8997): consider including hash of trie node.",
          "type": "string",
          "enum": [
            "UnexpectedTrieValue"
          ]
        },
        {
          "description": "Either invalid state or key-value db is corrupted. For PartialStorage it cannot be corrupted. Error message is unreliable and for debugging purposes only. It's also probably ok to panic in every place that produces this error. We can check if db is corrupted by verifying everything in the state trie.",
          "type": "object",
          "required": [
            "StorageInconsistentState"
          ],
          "properties": {
            "StorageInconsistentState": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Flat storage error, meaning that it doesn't support some block anymore. We guarantee that such block cannot become final, thus block processing must resume normally.",
          "type": "object",
          "required": [
            "FlatStorageBlockNotSupported"
          ],
          "properties": {
            "FlatStorageBlockNotSupported": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "In-memory trie could not be loaded for some reason.",
          "type": "object",
          "required": [
            "MemTrieLoadingError"
          ],
          "properties": {
            "MemTrieLoadingError": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Indicates that a resharding operation on flat storage is already in progress, when it wasn't expected to be so.",
          "type": "string",
          "enum": [
            "FlatStorageReshardingAlreadyInProgress"
          ]
        }
      ]
    },
    "TransferAction": {
      "type": "object",
      "required": [
        "deposit"
      ],
      "properties": {
        "deposit": {
          "type": "string"
        }
      }
    },
    "TxExecutionError": {
      "description": "Error returned in the ExecutionOutcome in case of failure",
      "oneOf": [
        {
          "description": "An error happened during Action execution",
          "type": "object",
          "required": [
            "ActionError"
          ],
          "properties": {
            "ActionError": {
              "$ref": "#/definitions/ActionError"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "An error happened during Transaction execution",
          "type": "object",
          "required": [
            "InvalidTxError"
          ],
          "properties": {
            "InvalidTxError": {
              "$ref": "#/definitions/InvalidTxError"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "TxExecutionStatus": {
      "oneOf": [
        {
          "description": "Transaction is waiting to be included into the block",
          "type": "string",
          "enum": [
            "NONE"
          ]
        },
        {
          "description": "Transaction is included into the block. The block may be not finalized yet",
          "type": "string",
          "enum": [
            "INCLUDED"
          ]
        },
        {
          "description": "Transaction is included into the block + All non-refund transaction receipts finished their execution. The corresponding blocks for tx and each receipt may be not finalized yet",
          "type": "string",
          "enum": [
            "EXECUTED_OPTIMISTIC"
          ]
        },
        {
          "description": "Transaction is included into finalized block",
          "type": "string",
          "enum": [
            "INCLUDED_FINAL"
          ]
        },
        {
          "description": "Transaction is included into finalized block + All non-refund transaction receipts finished their execution. The corresponding blocks for each receipt may be not finalized yet",
          "type": "string",
          "enum": [
            "EXECUTED"
          ]
        },
        {
          "description": "Transaction is included into finalized block + Execution of all transaction receipts is finalized, including refund receipts",
          "type": "string",
          "enum": [
            "FINAL"
          ]
        }
      ]
    },
    "UseGlobalContractAction": {
      "description": "Use global contract action",
      "type": "object",
      "required": [
        "contract_identifier"
      ],
      "properties": {
        "contract_identifier": {
          "$ref": "#/definitions/GlobalContractIdentifier"
        }
      }
    },
    "WasmTrap": {
      "description": "A kind of a trap happened during execution of a binary",
      "oneOf": [
        {
          "description": "An `unreachable` opcode was executed.",
          "type": "string",
          "enum": [
            "Unreachable"
          ]
        },
        {
          "description": "Call indirect incorrect signature trap.",
          "type": "string",
          "enum": [
            "IncorrectCallIndirectSignature"
          ]
        },
        {
          "description": "Memory out of bounds trap.",
          "type": "string",
          "enum": [
            "MemoryOutOfBounds"
          ]
        },
        {
          "description": "Call indirect out of bounds trap.",
          "type": "string",
          "enum": [
            "CallIndirectOOB"
          ]
        },
        {
          "description": "An arithmetic exception, e.g. divided by zero.",
          "type": "string",
          "enum": [
            "IllegalArithmetic"
          ]
        },
        {
          "description": "Misaligned atomic access trap.",
          "type": "string",
          "enum": [
            "MisalignedAtomicAccess"
          ]
        },
        {
          "description": "Indirect call to null.",
          "type": "string",
          "enum": [
            "IndirectCallToNull"
          ]
        },
        {
          "description": "Stack overflow.",
          "type": "string",
          "enum": [
            "StackOverflow"
          ]
        },
        {
          "description": "Generic trap.",
          "type": "string",
          "enum": [
            "GenericTrap"
          ]
        }
      ]
    }
  }
}

@PolyProgrammist
Copy link
Author

#12939

@frol
Copy link
Collaborator

frol commented Feb 21, 2025

This looks really promising in general, but I spotted a few obvious problems with custom serialization types: CryptoHash is serialized as base58 string value (not an array of numbers), PublicKey is serialized as : string (not enum)

@PolyProgrammist lets fix these with annotations and try to do the following exercise manually:

  1. Let’s use some codegen for Rust (https://crates.io/crates/typify looks promising) and generate Rust types from the schema
  2. Call the relevant endpoints from RPC and try to deserialize it with the generated types

@PolyProgrammist
Copy link
Author

PolyProgrammist commented Feb 21, 2025

current typify output for transaction
Variant1 {
  final_execution_status: Final,
  receipts_outcome: [
    ExecutionOutcomeWithIdView {
      block_hash: CryptoHash("9BKUhzXGUxwakPMniTcwtVao9TzEejq8ezvMkgP4XGKP"),
      id: CryptoHash("9vf2ceiCmSZ379ZW4dGzCnmQ2prtdo88VFfXvLqmFCZo"),
      outcome: ExecutionOutcomeView {
        executor_id: AccountId("itranscend.near"),
        gas_burnt: 223182562500,
        logs: [],
        metadata: ExecutionMetadataView {
          gas_profile: None,
          version: 1
        },
        receipt_ids: [
          CryptoHash("4g6WCeRxwyHAWHBFgcdzf3h56EgvJ2ipQ7GYhwwnbGiU")
        ],
        status: SuccessValue(""),
        tokens_burnt: "22318256250000000000"
      },
      proof: [
        MerklePathItem { direction: Right, hash: CryptoHash("9nA8gyWL1Q1zSEmQo1mP2f8dh7aPks1f58zg3MJHmCxH") },
        MerklePathItem { direction: Left, hash: CryptoHash("FYnyAEt5xC6iG5E7EwjpCPzEtrqH83VL6FdMfPdexHrw") },
        MerklePathItem { direction: Right, hash: CryptoHash("HsHnu9CfiTQuwAygXRvzdTbS8DnUxb3DBXmYGxFD3Kvh") },
        MerklePathItem { direction: Left, hash: CryptoHash("DqAp8HPWW7NeCzuDZSptFzEZfLWVunvzhHigFLco4nNB") }
      ]
    },
    ExecutionOutcomeWithIdView {
      block_hash: CryptoHash("4UcUR7gUZfXUraV7ksQDPTVkxvPuR57tiRpLLt1zhafx"),
      id: CryptoHash("4g6WCeRxwyHAWHBFgcdzf3h56EgvJ2ipQ7GYhwwnbGiU"),
      outcome: ExecutionOutcomeView {
        executor_id: AccountId("miraclx.near"),
        gas_burnt: 223182562500,
        logs: [],
        metadata: ExecutionMetadataView { gas_profile: None, version: 1 },
        receipt_ids: [],
        status: SuccessValue(""),
        tokens_burnt: "0"
      },
      proof: [
        MerklePathItem { direction: Left, hash: CryptoHash("C27G9kpwi8DVB3sWdBYYpo98z2DTjiEcWsLMhT1VZwgp") },
        MerklePathItem { direction: Left, hash: CryptoHash("GELQqVUtxW1dkYU6y973VT7m3t2qQvniDVcQLdZxcckR") },
        MerklePathItem { direction: Left, hash: CryptoHash("7Q57mfV9dPD2NH4scXe9eNu4pEmaDrZLhqmv1uqwMP7m") }
      ]
    }
  ],
  status: SuccessValue(""),
  transaction: SignedTransactionView {
    actions: [
      Transfer { deposit: "34000000000000000000000000" }
    ],
    hash: CryptoHash("9FtHUFBQsZ2MG77K3x3MJ9wjX3UT8zE1TczCrhZEcG8U"),
    nonce: 11,
    priority_fee: 0,
    public_key: PublicKey("ed25519:AYo1VygMsQUG85Myf5C8VB6XgSXhzHZxvKyWP9K7ZUfs"),
    receiver_id: AccountId("itranscend.near"),
    signature: Signature("ed25519:4viPVgAxULhzsf1yXiaw8Z85ptzNP9tZAJ1JnHSCzPYicF4tEAzUKBv9gpAUYTt8c9NeEF2Rt9UuRDavxN99dkYV"),
    signer_id: AccountId("miraclx.near")
  },
  transaction_outcome: ExecutionOutcomeWithIdView {
    block_hash: CryptoHash("8jvfhbzGnCcYjkCrnqnzDr8bXBbFLUXaoVt6jsRNB1pU"),
    id: CryptoHash("9FtHUFBQsZ2MG77K3x3MJ9wjX3UT8zE1TczCrhZEcG8U"),
    outcome: ExecutionOutcomeView {
      executor_id: AccountId("miraclx.near"),
      gas_burnt: 223182562500,
      logs: [],
      metadata: ExecutionMetadataView { gas_profile: None, version: 1 },
      receipt_ids: [CryptoHash("9vf2ceiCmSZ379ZW4dGzCnmQ2prtdo88VFfXvLqmFCZo")],
      status: SuccessReceiptId(CryptoHash("9vf2ceiCmSZ379ZW4dGzCnmQ2prtdo88VFfXvLqmFCZo")),
      tokens_burnt: "22318256250000000000"
    },
    proof: [
      MerklePathItem { direction: Right, hash: CryptoHash("4k2u6bAUJy5Y9aRHHfkkdQ1eyP4h5riKpg2VojH26Bi8") },
      MerklePathItem { direction: Left, hash: CryptoHash("8ReCWag8nHzPW3uaaieo71FB1jpVkEzz495vvKQzjXja") },
      MerklePathItem { direction: Right, hash: CryptoHash("EZAi6Lx2DkyjX2zwZ2jD2jLuaUfssM67KZ92Qyyzu9Gs") },
      MerklePathItem { direction: Right, hash: CryptoHash("CVAaUBU6EftUV9a7dmmBNhiv25YQFn3PhPSxosCM2DLx") }
    ]
  }
}
for block
RpcBlockResponse {
    author: AccountId(
        "hashquark.poolv1.near",
    ),
    chunks: [
        ChunkHeaderView {
            balance_burnt: "4432467475483600000000",
            bandwidth_requests: None,
            chunk_hash: CryptoHash(
                "BUSRqgxg2avghF6iYp5XULpEuKGunFA8m88KKoojVnTd",
            ),
            congestion_info: Some(
                CongestionInfoView {
                    allowed_shard: 2,
                    buffered_receipts_gas: "0",
                    delayed_receipts_gas: "0",
                    receipt_bytes: 0,
                },
            ),
            encoded_length: 47784,
            encoded_merkle_root: CryptoHash(
                "DxQ2Ro2oqd33MpoCLrwz2GrL7D8D8rHLSsJrbacshk1",
            ),
            gas_limit: 1000000000000000,
            gas_used: 79971602156822,
            height_created: 140474511,
            height_included: 140474511,
            outcome_root: CryptoHash(
                "76vxaTbVSRPKobMae8tYT4pimsFZz68wS7kayTDG9Cjb",
            ),
            outgoing_receipts_root: CryptoHash(
                "Bog9FbKwSbxC8gdYGEyAZCfTbCPS2LjEE27j2qwUa94B",
            ),
            prev_block_hash: CryptoHash(
                "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
            ),
            prev_state_root: CryptoHash(
                "DvWMZL9q7yq6jdR5mYzGuDobaCkMgFGeH3MK9JP42Vs3",
            ),
            rent_paid: "0",
            shard_id: ShardId(
                0,
            ),
            signature: Signature(
                "ed25519:3qxaSUCFzWRxyUjL5jouWgB6fGPu9s4zQZLLLuBKkJeYfstbJ2YNi314bLinSEGuYFzpd27Wr3SLmkPhXE2bZqrr",
            ),
            tx_root: CryptoHash(
                "3XZP2sSQ3EgPTTW6oocWAWthXUgbNswXifEdPMCqp4qX",
            ),
            validator_proposals: [],
            validator_reward: "0",
        },
        ChunkHeaderView {
            balance_burnt: "0",
            bandwidth_requests: None,
            chunk_hash: CryptoHash(
                "7yBM2Y5RFaXGC7HazuiqnGi8uNnjzmhvAP9euyoZ6N8R",
            ),
            congestion_info: Some(
                CongestionInfoView {
                    allowed_shard: 3,
                    buffered_receipts_gas: "0",
                    delayed_receipts_gas: "0",
                    receipt_bytes: 0,
                },
            ),
            encoded_length: 8,
            encoded_merkle_root: CryptoHash(
                "9zYue7drR1rhfzEEoc4WUXzaYRnRNihvRoGt1BgK7Lkk",
            ),
            gas_limit: 1000000000000000,
            gas_used: 0,
            height_created: 140474511,
            height_included: 140474511,
            outcome_root: CryptoHash(
                "11111111111111111111111111111111",
            ),
            outgoing_receipts_root: CryptoHash(
                "AChfy3dXeJjgD2w5zXkUTFb6w8kg3AYGnyyjsvc7hXLv",
            ),
            prev_block_hash: CryptoHash(
                "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
            ),
            prev_state_root: CryptoHash(
                "5PXqA7tp9Bar6AULz6ApSkPAF1RLoqjNzWvcCnk8LkoH",
            ),
            rent_paid: "0",
            shard_id: ShardId(
                1,
            ),
            signature: Signature(
                "ed25519:5DKG8QSM6ZxsPHnbkMTK1XLbdmWyhehfFyKtFdq4vkGvV37N3xUg7EtfnohDp68nTzQvBinfHeAe9ifSpLyw4NTS",
            ),
            tx_root: CryptoHash(
                "11111111111111111111111111111111",
            ),
            validator_proposals: [],
            validator_reward: "0",
        },
        ChunkHeaderView {
            balance_burnt: "17688338994299300000000",
            bandwidth_requests: None,
            chunk_hash: CryptoHash(
                "4bh18kP4LcxzZq2heqxQcZUeJcvQd1JUJeucpfMxMcma",
            ),
            congestion_info: Some(
                CongestionInfoView {
                    allowed_shard: 4,
                    buffered_receipts_gas: "0",
                    delayed_receipts_gas: "0",
                    receipt_bytes: 0,
                },
            ),
            encoded_length: 66897,
            encoded_merkle_root: CryptoHash(
                "9pZHzC33VY8ucjEV1LmnoPFUTPfXbMKqnsJPihpNXP3y",
            ),
            gas_limit: 1000000000000000,
            gas_used: 228297314593061,
            height_created: 140474511,
            height_included: 140474511,
            outcome_root: CryptoHash(
                "Hri6Z7pjUf12UyuQ5dbK5o9gDFegZS721KK9rfTETJ62",
            ),
            outgoing_receipts_root: CryptoHash(
                "DifjCdYF5GJ8qk8e1sBw97JoDBo6cXd48oUKUZFgmuGw",
            ),
            prev_block_hash: CryptoHash(
                "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
            ),
            prev_state_root: CryptoHash(
                "GQKsjsh12EJU9JMFrVm9xVggSUS9RPY4MErCP4ezciQt",
            ),
            rent_paid: "0",
            shard_id: ShardId(
                2,
            ),
            signature: Signature(
                "ed25519:GcDGH2gPbX8kCL7zv6VPmDmAap5PX6E8nCB78zgThNHZ3zmtqPSWbH73RJb4miuPvTmVFASXo9E4VKpDt1L4Sh9",
            ),
            tx_root: CryptoHash(
                "4TAgnVcrTst2AAJe1nAue8GDBwMTy5xi4GDCbP6VkFLC",
            ),
            validator_proposals: [],
            validator_reward: "0",
        },
        ChunkHeaderView {
            balance_burnt: "17693452303099200000000",
            bandwidth_requests: None,
            chunk_hash: CryptoHash(
                "YyAtuuG8H6wLC797uWrwwWJRzYnj3x6ZxtJcSy2wp6A",
            ),
            congestion_info: Some(
                CongestionInfoView {
                    allowed_shard: 5,
                    buffered_receipts_gas: "0",
                    delayed_receipts_gas: "0",
                    receipt_bytes: 0,
                },
            ),
            encoded_length: 58532,
            encoded_merkle_root: CryptoHash(
                "DyZpLFMzFwS57cZMmm8eWD9CNZMVWLBUCzGHMY5rGXMg",
            ),
            gas_limit: 1000000000000000,
            gas_used: 255165288174219,
            height_created: 140474511,
            height_included: 140474511,
            outcome_root: CryptoHash(
                "5mjVUqNfjwrakA2BPmCawdRm4fN8G9y42dj8SUmVrtyo",
            ),
            outgoing_receipts_root: CryptoHash(
                "E4uh2ug1p8eyHhLGokHskn5WBiDEJWcHoPcbKjhkzk1",
            ),
            prev_block_hash: CryptoHash(
                "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
            ),
            prev_state_root: CryptoHash(
                "BcGQdPgb9Fa6DJggMvCMTzqRujCvsQVNz8PCbWP52M15",
            ),
            rent_paid: "0",
            shard_id: ShardId(
                3,
            ),
            signature: Signature(
                "ed25519:23zymZnrgejMgVwiPLCWr7q2HxXFYSjpe7sMyACWuhbe8FmqYFqaHakbkW4sn5WWVKpQQRSmdC3PVEBKpTfnpWY7",
            ),
            tx_root: CryptoHash(
                "6PHSJnAF5mkAxica7UmnGEgkrVKSbpE4Py8b7hBKwz5w",
            ),
            validator_proposals: [],
            validator_reward: "0",
        },
        ChunkHeaderView {
            balance_burnt: "4915648577188300000000",
            bandwidth_requests: None,
            chunk_hash: CryptoHash(
                "3izRjwLo8n2LAgUZUtthGrWno5xLDwaXgH2SfgH6Uoht",
            ),
            congestion_info: Some(
                CongestionInfoView {
                    allowed_shard: 0,
                    buffered_receipts_gas: "0",
                    delayed_receipts_gas: "0",
                    receipt_bytes: 0,
                },
            ),
            encoded_length: 54896,
            encoded_merkle_root: CryptoHash(
                "9ymT6MAyFkrRMTjBatVAh3NxBJcm12zXtewcr2kZBU7n",
            ),
            gas_limit: 1000000000000000,
            gas_used: 72936801535136,
            height_created: 140474511,
            height_included: 140474511,
            outcome_root: CryptoHash(
                "DoAxbni64hJY8BLG9onVL39aXfwQVonC6RrrjdnjiQKU",
            ),
            outgoing_receipts_root: CryptoHash(
                "GmTQ9YdERb2cGQ98yL3t2PyYq9uHy8pvFKsP6rXReoTS",
            ),
            prev_block_hash: CryptoHash(
                "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
            ),
            prev_state_root: CryptoHash(
                "8jXHw9Czy1eVwwq3SAGmqvK6KSAdSj5qCjWUHSyVo5Z9",
            ),
            rent_paid: "0",
            shard_id: ShardId(
                4,
            ),
            signature: Signature(
                "ed25519:2FMBqP8S1YF4E4oyP23rqmRSsEJSATwLeNay2PBL5gM1EpLfbfjtArrR5QkdcpUqVj9D9vfx7Mo2vmPRHuSJxsD2",
            ),
            tx_root: CryptoHash(
                "AXdKiUXG5CQpRT82MrR89AzDAqA7HJUBa5cCh8W2bXAh",
            ),
            validator_proposals: [],
            validator_reward: "0",
        },
        ChunkHeaderView {
            balance_burnt: "10725673478494900000000",
            bandwidth_requests: None,
            chunk_hash: CryptoHash(
                "6nbX52tX7BEuxn1aTTBR9Sn7AtPZZJYkqs7K2r5XVcr5",
            ),
            congestion_info: Some(
                CongestionInfoView {
                    allowed_shard: 1,
                    buffered_receipts_gas: "0",
                    delayed_receipts_gas: "0",
                    receipt_bytes: 0,
                },
            ),
            encoded_length: 23763,
            encoded_merkle_root: CryptoHash(
                "7G2mzzQWb2J5EeHsJuFdMnGxWoXYv7u9dy25okNPBDPE",
            ),
            gas_limit: 1000000000000000,
            gas_used: 131615919538182,
            height_created: 140474511,
            height_included: 140474511,
            outcome_root: CryptoHash(
                "6MSf9MvCyHcChtLxXoDhzEWsSCfSszV9RUCUfj5XegLN",
            ),
            outgoing_receipts_root: CryptoHash(
                "GimZ3eSJcRjpvfWbebMtiso3TKNWVrzWY3Qo9d6zvGRs",
            ),
            prev_block_hash: CryptoHash(
                "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
            ),
            prev_state_root: CryptoHash(
                "26jScccsSL7vNqUTfBXumpWKdtEUAUrtFKPV83KmAgt4",
            ),
            rent_paid: "0",
            shard_id: ShardId(
                5,
            ),
            signature: Signature(
                "ed25519:J8fCy9pqD7M7RtQnqTyoFBsmRGdPJngnxkuvTT1KmJvwkotiH2vLU9kfXxdUeXNTU4V3GKLokr4wqzKKQtkxkzq",
            ),
            tx_root: CryptoHash(
                "636t5m5z61HkW3rzvcf2EhVU6Tai4v48FQGEjjFiZMt6",
            ),
            validator_proposals: [],
            validator_reward: "0",
        },
    ],
    header: BlockHeaderView {
        approvals: [
            Some(
                Signature(
                    "ed25519:4Jij2b2XgfJNHMz8iG1mBhFjPXmwUWopz4UxQ1weMhXarZz1MjvwbjkSkm5oCCqLCm9iM63LWxeCbZsvrG9Uh6d1",
                ),
            ),
            Some(
                Signature(
                    "ed25519:DCzuW31Ymbj6gUAbRCJfr9GPUAFexyvTnug3rTj479dfTems8vJGxAmsWePXrcjD3mzs3xkuD6wcRr46L4LrzA4",
                ),
            ),
            Some(
                Signature(
                    "ed25519:roQZjrn2cDVggCtWpv8D4Y9L8ZgBSz3ewoicapph1RkfPdkvPzUaqcMuY5akv7GnLo9U8Ai2b3WctfrpcSa1fjx",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4PN68zd4u7sjuA94D8pL8QEjy1GLcqbDRAb9vvEk5eiEa8pibbBziQ7fKQAV29eYoteHucdktGizJsPLtPPx5vfo",
                ),
            ),
            Some(
                Signature(
                    "ed25519:5cd6sLDJPumVRy7757dSD7bqvs624HD5hcqpo9pKKWhyuuMaimtGAx1FQ1Mbh5VpZVhAUvf6m8orCm4SiDb5uN59",
                ),
            ),
            Some(
                Signature(
                    "ed25519:67q7p4L4ccqsvPLyxZd3oNiLTuNq9Bhgr8hHQ8QpmQKyXNzTLBWUWrwQEvxkUNUfV3hCVVQGiVBxfbsy8Sf5fcBd",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:2zmtsPec1EpgyJVQPWEcJv3m8awwDz1bBXYhHinsgcqxKZWXcFvWY6ToN8YLqajw1XLgoYpBrkYMPFzSu1WMZgdC",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4PsZAZiS5C1sSG6dHtJnRfXg9D2j3uc3zDRQ8hcNVndx4B6jj85XtgpZjVR39cFKBkiELbMXBBpSDFE9iyQ1he45",
                ),
            ),
            Some(
                Signature(
                    "ed25519:54MRW9kk4nHssScEvW88FBmuvf3GTh4taYg51CLR3MXgs51BvJWT1K62hxY9oR9fNrqqGTsL5eih4Y4B4JK1PagV",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4fAEgpQ2amaPhNvgG4WLLcXwEKh7qdJwxV6Ng3pcpUXbuXPwLvFKRjKvkYQ2ZzYrioVenFCDcLBSYjvNn6hWtJme",
                ),
            ),
            Some(
                Signature(
                    "ed25519:2uRrbGwZN53gvJSvNWj8LnhKpcoh5EjpusdAMJGkx3RoPARovzs15QmPYU2kY3BtYNj6f65qnq9f4RDU7QPReRyp",
                ),
            ),
            None,
            None,
            None,
            Some(
                Signature(
                    "ed25519:2TMqbafaFCtSUeeiDicp1i12vGN4vu4zjkfR1STCaHcoera4mAWL7mFbvLpWkVo5MJx5eZyYdyZdK6VTZvky8WYt",
                ),
            ),
            Some(
                Signature(
                    "ed25519:Qpwa5adsDhk8shAS8UNK4snCyFW6AXCkMumvhgQ2mg8oDyCaoKSniHNZwwSXj8PU2h8TomrCbY84HRAYTVCJTC6",
                ),
            ),
            Some(
                Signature(
                    "ed25519:24cWfwmHPXxiyDshBi5eTzq2eMXr7VGMHTZoPBAUw7DeYngcVkUTNBaB1FCqqut4YScZXtSGz5wJTPKWuJiJD1rc",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3gUXP2fR5pMfvCQCYZ6eVz8DDza5dVjdMcGnNswRybcnH1W3Nd2kkgfpLzX65nZMq9pgABAjeYtps9hJs7FMgNZz",
                ),
            ),
            None,
            None,
            Some(
                Signature(
                    "ed25519:pQkQ1hVbmhwoKGZpqJJw9AxiHyzM677QnQhDPC4ff7p6NU7nbrNJAeZ3qF46etZZtmMYEY6K2rhsPAYNSzgwHM2",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4xCfopEVBS9we9TN37KZ8bQyd1XvsNqKgMiTFucccEETSc17JJviTHPLfChZZ8neyYyu5muWrSKhYqyvoBEtwJVE",
                ),
            ),
            Some(
                Signature(
                    "ed25519:w8pdJKZgWJSqZye5oHSU7Yq9XQcKnDRmtTr1SaiBWtsrtwL1ujq6nQvPRvjeJ9yrtUBMGt2GK6ArhSyYMZWUbb2",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:2iqD2qm8vFzHaHjxhCY5W43ewDBKYrFXps5wxS3FjHByGLU6y2QWpxhiff4bU5EAXEp1wCci2rQ1ct5qvZ2MPY4u",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:RSR9wZZDVeXzXr6GaBhJez5cDZ8NkqrhEv4gwrvo2BtrHuFhNtNYfakCUvoqRD9pCEu8uUQBHVD6kuJxgXrrqaJ",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4eRobbzuka567SF6TzVR8bPnFPm95inkaP7Q9Rnc65hthyabH55oi22PfquvqWbvPAFgx7XFcZqoW2krfm53NoRq",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4aAPDtdEFRCj8pDhBy6f81aer8updTRMhtGVV79jwhYCDfMR4C7J6DNYVDvW6SkqHgQQu4JTim4dze4EYNEKk6jW",
                ),
            ),
            Some(
                Signature(
                    "ed25519:2x7eKJxNMHSU55EoestrrtUWPTJyHx51mynUC45UZHStuJL24GqM4LcYYKeYnj35KVonCZbmoWzDBBNDQnPs8m5y",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3A9UHFAKfoiYc2qrUqeSiWhFuNGJJPN9bVzRC9yFAEJEthGg5XvSMUTdWjNEFxSToEvyFxnzddMDsMbQxnmxr3Ze",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:5FuHv2uKeWpexfxbGE12zF7AWygjutcbJW85k5jgY1GhwnMC5sfWamM2CkwdugcMTzp9gJPuDGTFFkrT7oCyPuwh",
                ),
            ),
            Some(
                Signature(
                    "ed25519:2mg2ZqJEJkD68b8aZbYnYW5rBq1C8E9nWcHZZxrKW2hYH7iFr6KJTUTZuWdi82jjWKAsuJ4J65cswATa7TXPH28k",
                ),
            ),
            None,
            None,
            Some(
                Signature(
                    "ed25519:5kAFu2YpFXZQ48ipJWb3mwGq5vSuFPAZLshWDm1Hp6Muyss4iM4uJ3CqfM9WfTjMwsw8FQyyqojgwHUFnybtG7T4",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4Spu6jfpMEHB2KDW9oFwdywLhzL9fPLkt5oFbqWj1kUzTV6sqDxe1gBTXrj4Wx4nmobDnLq6XMWnrB8CLekteDfY",
                ),
            ),
            Some(
                Signature(
                    "ed25519:NMbSoryUUNHNhebxuJnk25ww1pNxahBxJGET8N7JDora73H9BQHfhHUQQ5GZjsqM83Wm5qgV563Eg3tYHFVWuEw",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3o1gAW5ogHm5uxEB2sseA2ybz1hSCfr2cUpmB64d7J2gCSx8Acb3zymoq8PxvNGLWY8XJoJk7P2Z79QFv1kTBDSW",
                ),
            ),
            Some(
                Signature(
                    "ed25519:iYy1wEFGW7icNsNhjgSTpAw1fhVfeCQXDvU6NiSSAbj9eNUiTMsTquLwTTGyyA6KJkZu9AHy38a6yut5nsjVWZu",
                ),
            ),
            None,
            None,
            Some(
                Signature(
                    "ed25519:2DcbdJgaB8EXwpmH4gpzGhHa2YHHhRjCjwTdfd6dyV6TR9KMC4mBQgLyXKrEyv6yNErBi8Wr7cPcJ6y5yUCKU4Rv",
                ),
            ),
            None,
            None,
            Some(
                Signature(
                    "ed25519:2ZKW96JzMXF7XvN1M9U7qAmq8XwRVVgSp1d8gMCFfKyXNmCnMVjgMVbTcqdfciMcBzde8SQReXVn937iT4V9D5NR",
                ),
            ),
            Some(
                Signature(
                    "ed25519:47NAFdRQ8QvvhJM2HvkUSDCJLM7ofz1hYCznLDW3X9JN7hxJHPcEdq1XW5Uz83MJhbZpT1dpU5zjgtS5WiBh9gN3",
                ),
            ),
            Some(
                Signature(
                    "ed25519:23GEo8LLq8P651BK89uTfcAGAd7pEyNU4d7NzQBzxeCj1pf474xKmBRpr9s5FQZmQ9QMp6YgdnUvjwB8e1HLGUrQ",
                ),
            ),
            Some(
                Signature(
                    "ed25519:442dLgiV1jpwgxMxDnMmzNhG6fDP7273HcSkPY23BYqBAPc8BBLMprwS9uzKbMNLUPZ88KmrUG2kH7JXdC8Hb2Zo",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4ACjyQ18PQicKJJWFa9dwguD8ai8jGmbbQxA6QozsuRPA3haZFmN1fFe6TNc1QddskXcQBPGEZoPJhXAc7AvEPcG",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4nyN9oHXqT6zWMmScpbXPrNEfo6YcxTHYRvwiuMoFpxNA81B4F7MSi6UwmsQvEjMi9443Lo2uNoVk1SVy8iwG94h",
                ),
            ),
            Some(
                Signature(
                    "ed25519:2vkxR3rjDTr6w2g1GexypmVN2595WKxxiKXinS6VKZJEuyjms5i1XsM3eQqLrRCnzEmQWLRBgA5qqnpSpJ6hFnmd",
                ),
            ),
            Some(
                Signature(
                    "ed25519:2VcteJ4iP1ZKDA9qgedbWBEC97Kw4qVp9sM61ZxQhHqRuoFH8ZMsTYvfgdutw42xMN1pM22FnrzCN35TdSB5nA9q",
                ),
            ),
            Some(
                Signature(
                    "ed25519:2o6XR5scGAfXsqRXv66XwyTZDnYuhBHbTDsCJubyKY25iviSqfFzBdZVn1MDymTckVNNeQhFS8nGvdDexfHmGG9A",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3CywiwTwARY1n8rcVoUdAxQCabaGuZAQAtBkD6b4BLWxHNZZYFPo7uWzTXDQS57isAqhHhRLvHtE4N3cbgsBYwP3",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:3NpdJwiiCCfH7tedG3Gh7MHNe6TQBRYnPdaKQVZi9yJkoMwFQxB7Nd2qg6RD58rwcgXWMqPHebhGmJyn68Lj7MRN",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3oAK1v1fxPyRv8znhbKHzWrTZqG6LmtmxjvG5GGkoimNfcvv88aAhedtWRbwdpd48ZdXGZDd6pHooUcX5U3UBCYs",
                ),
            ),
            Some(
                Signature(
                    "ed25519:64FkcHMExUoV4F9gzFNsPAxjJLR6rX87P1jk4GWQYqVtx5qH8qEjP2MrLscA7yuKrmdrbMFQdKx7ZQPPb4ZJDtEv",
                ),
            ),
            Some(
                Signature(
                    "ed25519:Y7r8tNo3XEHiwSUxxJsZHeT5yHiZoLKR7tZFEndwRedkysVucmXRZAAjxW3sPLixmUDUtNiYr8gPeHVEUxis8qo",
                ),
            ),
            Some(
                Signature(
                    "ed25519:S3MKFu4v6iFwtXQKoHFx5raLscxUjed4JSN9DipCNnz42pbcbDtMpL9h1TiwjokihJ7wtzunAGWTFXRiGH2Jidf",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4npADb3Fwyke6ib9Ttx44KQHGtGmtHNSK8HGB6gbM6JoGT8ERTBwLkGdg7fmUQpmRbzBKjVbThZi56MwwYgWgsXi",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3aRY1vxH6rMpoB8UjX4FhbU95VWmTHTKvD2eb8giwyBov5p1AksxpeH2TnjRf8J5kurmxUtKjb5NprfWm8sgkgFy",
                ),
            ),
            Some(
                Signature(
                    "ed25519:62nSmGzxzHgXenktKzaWaWTFyZoRykPapMf9vuqwzQxq9KGA7wPwjPPTcEUhGGoWhoisJT3FUhKjThCEHrLstdk2",
                ),
            ),
            Some(
                Signature(
                    "ed25519:kT9eLL4aqXjJ766TD5eKuMsNewsY3rLM2soWy17hjUQyhU51spwK4RPhT7MzPkcFxpD6uBD5h3YJMLZmBHTnwdS",
                ),
            ),
            Some(
                Signature(
                    "ed25519:25wmh8ZMFgFc3xfnrsMVSMoQqZkU4mUcammdEEjNjmVm2CbQAstuuBevpbfXgLKW3mSbmdYjsNvi9s7TZWE4zagU",
                ),
            ),
            None,
            None,
            Some(
                Signature(
                    "ed25519:2aKcxja96WdLwBvPSfjT9fTQnn6zuoLCBxjrTtHL4fRzhsojm1d39AFfY8K4U2uAE3yB5Y2qg7n6JkBM9VuhMxvg",
                ),
            ),
            Some(
                Signature(
                    "ed25519:b4swTSAtBBFwU9GJa87ku9y4626bDtGUH1oyVDTUzGfb3XVmjofGXkenFGAXDp8EwMDHMvwM9Ybe19VkRkXCYjn",
                ),
            ),
            Some(
                Signature(
                    "ed25519:hYgzVCjftjdZFFTNkc9Td936Wcdfm2BVXYWoRckHCrtk1aSc6CnDdWVRU9Z2NQAvZYu33Mi1CYAAdJvPY1iZFbB",
                ),
            ),
            None,
            None,
            Some(
                Signature(
                    "ed25519:sfmcmetRtLF6tSS7tN5CTnsiDu2XqQuh7eW82agtL9a9kY4a1n9K5W7sT8ZbTYvaRjfd3fx16xWTNRZtvz4zuhn",
                ),
            ),
            Some(
                Signature(
                    "ed25519:oJewq8Ybt9fet7j33dgpch2gWGn37Pjn5of9JNnvbiJT2k1xEz8qdbvpx34sRY7ff5xfjdUnHAATuuC85arCLin",
                ),
            ),
            Some(
                Signature(
                    "ed25519:5dM3QxkSHdxvKAMRfePN3Cw1y8ZSJNsY8Q2mS3kBZAQqUo3R4mxBxMXs6js1oJGSxdvNpMCuNFRKPPVYmQtwR6CQ",
                ),
            ),
            Some(
                Signature(
                    "ed25519:u5RRa8Q6hHimBHNrk9eXzoVXRCmNqpqkYoyHgAowFpb1WDRbvKs539FMWhbr26fn7tz7z45Zi5GAMtoD5WzJjSQ",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3XZTV5CmkNchxAL9wUWdht79cexgaxZt1yGJEbeDS2TAh57V6RS7nUjEoHPHHukY9HKTSoin9JFKysXh2QFNo55Q",
                ),
            ),
            Some(
                Signature(
                    "ed25519:26iT21GdKf7qjNvwcnkjpMwACwjuxAmDuWvyCaqQdCPLjpWqytzhvgBwmvvrXvse5as8rYe14zSYfA2AMsbwNjfZ",
                ),
            ),
            Some(
                Signature(
                    "ed25519:FwbU2Dvx3THv67H76scvzNTBw9bAG3stojqP2KbbFwJZiFhTm6aavNvoyUEHBUqWoLhY8HYkGocsimHDn3a7wNm",
                ),
            ),
            Some(
                Signature(
                    "ed25519:27P4A3pcVv1AMJ2TWKTVSKrL5g4CTA8m6jXacV4xkGs6QC2cBhATnAXw65LnScHQajTeqSkoRimvMRdaUjwh1AVf",
                ),
            ),
            Some(
                Signature(
                    "ed25519:yxQsUNSUjL4Y6PguhijUysriK9t7JKys7TPCnRYv8Z2D2nfnEAyRV3yPTZciDsGz87AsRaXGwcgp17XzBKjwg6V",
                ),
            ),
            Some(
                Signature(
                    "ed25519:39p6GkfV6DBN2qjqJgyzy3dEDLKzJRKf2MMcGWiV4w1c59n42FYLyBETWU17ddJQSuem4BTx1RsVV9sNwfbXT6xt",
                ),
            ),
            Some(
                Signature(
                    "ed25519:5qZZ1sKGs9MfHgJkX4djxCb8YS9TQVqwPKdKPC29H46Acw2AD8U7GNvpnnj85U6a5FE35fjnBY3dwNSjD1JopDGL",
                ),
            ),
            Some(
                Signature(
                    "ed25519:4Vkgtjsp2hjUcNG6sN4oF1dS5ne38nCMXtb7bmCjy9rx9MdpL1K4276eQzBaZ9R4k7oSjUn5xv7tZ7JaeVbkjgog",
                ),
            ),
            Some(
                Signature(
                    "ed25519:455NkbYj5VVqMGsFCHKcv92vqJb8ECUbb7HBCuuhGumpF62db3B6wgmskMQPivkCWiez1FK3puJbRbFLWTZL1MEU",
                ),
            ),
            Some(
                Signature(
                    "ed25519:BtJEdGveB98u6XHcHHk9zxzsfkPXs5N3qc6FwLYvNsz2dbpXPnZGV1Qy9wdzpa7Hqe5hfRHdgfmQ6aVTZHAmy46",
                ),
            ),
            Some(
                Signature(
                    "ed25519:ViDnwLvTrMgy8dvriXcqHfxTXZA4FdXvm5aM1LfHuJuBWVPpFQQWB1MudpM7JtDE4CgcxaB8qGYumdv2vmMo7oU",
                ),
            ),
            Some(
                Signature(
                    "ed25519:5qNMuqoDQuQAmQJYYHYWCpXujU6m7TtW8wHYRui6AkhS4wZ5ftMQBP4Mime641a4Jaab1h6Fcg94Qpv6ZVNt6VXp",
                ),
            ),
            Some(
                Signature(
                    "ed25519:3HUJAmmKDi4pc8ZDBTytxuwsY2mu8y252StHrDmJju3JUuvrMa9LUVj5yQDM3YEjySSXegYm7vAt55chzhBprBFP",
                ),
            ),
            Some(
                Signature(
                    "ed25519:62hKdtEWSozZjK8Kokf2GfXp2Nj21zbtTrtvcZ5EZQVs2gX4uLyv4mqJyhkHhT1qLkszHUmJBMPuymTK31EXr4Nm",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:2jqFZ6fbNB7DTRvNAxmF6hgz2KMZEmM1gsQ7Kz6FUZu7qsuJVgMRR8XhDCeLHt8oB9aGgqFoBeD461LvUjbtMMCh",
                ),
            ),
            Some(
                Signature(
                    "ed25519:35w634XySe4XNUhmrMZEJq9J19SxBUtp9FnDgEcktyMAt2HSuLreNL3Qmanr3y1Y29eer2XgN39mEhpgE3wVpDC7",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:3v3FiLfncbRrpTy7my6sLLFKiS7VKuringKs1NNPM693JF7HUfbpzxJHRQVnPRnS53Pjr3wroHZxWn2CD6qU7vfU",
                ),
            ),
            None,
            Some(
                Signature(
                    "ed25519:5bV4juQyFAwRagQEURszxaeTfLQ8WZc1XknkiPURBHWpsj9rYGd1Qbabq4fQ7ioKiDvrQiqZMkJLYabozxwDWK6Q",
                ),
            ),
        ],
        block_body_hash: Some(
            CryptoHash(
                "Et5maVJr6398ymt9Qvp83DULhGjopDXhrQTB9mE6QqDe",
            ),
        ),
        block_merkle_root: CryptoHash(
            "4Bt8BGVmjRq1vEjAeV3xVue9bbJ5TUL2dYjQQsV8shX6",
        ),
        block_ordinal: Some(
            130311555,
        ),
        challenges_result: [],
        challenges_root: CryptoHash(
            "11111111111111111111111111111111",
        ),
        chunk_endorsements: Some(
            [
                [
                    255,
                    253,
                    255,
                    255,
                    255,
                    255,
                    254,
                    255,
                    7,
                ],
                [
                    255,
                    255,
                    253,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    1,
                ],
                [
                    255,
                    255,
                    253,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                ],
                [
                    255,
                    255,
                    255,
                    255,
                    255,
                    251,
                    255,
                    255,
                    191,
                    1,
                ],
                [
                    254,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    1,
                ],
                [
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    255,
                    7,
                ],
            ],
        ),
        chunk_headers_root: CryptoHash(
            "EWYi4quZpNX7JhvdqMotYFZjZbzRJ4Z3tX66qmHCUgzM",
        ),
        chunk_mask: [
            true,
            true,
            true,
            true,
            true,
            true,
        ],
        chunk_receipts_root: CryptoHash(
            "Ch278vnxKj4JSvh2QQdvZeHnCMxoas4JG9aCSwtfSp5i",
        ),
        chunk_tx_root: CryptoHash(
            "2gw7nqJf6Y1oXM2z1DGNNWREdWLGYM6MCfxMyJFprFGp",
        ),
        chunks_included: 6,
        epoch_id: CryptoHash(
            "BqyMSg25yqwtgMkUuSjPqzSEEQ9Ji8Q5f6qdNQqBycRU",
        ),
        epoch_sync_data_hash: None,
        gas_price: "100000000",
        hash: CryptoHash(
            "6ZWbbkgj2fpiaX3YVkBp4bYkPB1EgQH4P4LPfEzqVY6F",
        ),
        height: 140474511,
        last_ds_final_block: CryptoHash(
            "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
        ),
        last_final_block: CryptoHash(
            "CuWqaVJWchCK7WEKkeZ5e3Z8qXhGB5BsQyACokh3QNVh",
        ),
        latest_protocol_version: 73,
        next_bp_hash: CryptoHash(
            "B3TVQCCFzLgzKuJcVXpo8kugEYXgRMkGF4PkSoLUoifg",
        ),
        next_epoch_id: CryptoHash(
            "2pS4QYo3txJCx2MojLpxMsc1bNxz4JrrKhR8oH4BZu6h",
        ),
        outcome_root: CryptoHash(
            "5qxYDMsVWtmtTc24k4xEnn1M3FtQvmcDf6bcMZCFDLnm",
        ),
        prev_hash: CryptoHash(
            "9TJQc2y7y82dm3zuKVVr4cCW3jRbNoajYdKkj2AMUgEU",
        ),
        prev_height: Some(
            140474510,
        ),
        prev_state_root: CryptoHash(
            "Cdk59FeAyrcCQCYV1Y3FRpkRf2LfmmanC6iUS4hBYyCA",
        ),
        random_value: CryptoHash(
            "7CKxdv8vWb3yGrkbUGH4McvN5QNyMkDCpD85x8yKxsvW",
        ),
        rent_paid: "0",
        signature: Signature(
            "ed25519:3rYkp4JMradZuAH4P2LETxtfSPUWizgF8XyyyWYkkL3iPpCNuSL6vxQm9KhYsD8CxjtSCKn6VPWnhdJXGEk5HBwA",
        ),
        timestamp: 1740388208264713311,
        timestamp_nanosec: "1740388208264713311",
        total_supply: "1236934355618986318610999067538820",
        validator_proposals: [],
        validator_reward: "0",
    },
}

@frol
Copy link
Collaborator

frol commented Feb 23, 2025

@PolyProgrammist The fact that we can deserialize the pretty complex structure is amazing! Let's go ahead and apply schemars to all JSONRPC-involved structs and move on to generating the OpenAPI spec as per our discussion

@PolyProgrammist
Copy link
Author

temporary repo for typify https://github.com/PolyProgrammist/thetypify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants