pub enum ActionErrorKind {
Show 23 variants
AccountAlreadyExists {
account_id: AccountId,
},
AccountDoesNotExist {
account_id: AccountId,
},
CreateAccountOnlyByRegistrar {
account_id: AccountId,
predecessor_id: AccountId,
registrar_account_id: AccountId,
},
CreateAccountNotAllowed {
account_id: AccountId,
predecessor_id: AccountId,
},
ActorNoPermission {
account_id: AccountId,
actor_id: AccountId,
},
DeleteKeyDoesNotExist {
account_id: AccountId,
public_key: PublicKey,
},
AddKeyAlreadyExists {
account_id: AccountId,
public_key: PublicKey,
},
DeleteAccountStaking {
account_id: AccountId,
},
LackBalanceForState {
account_id: AccountId,
amount: String,
},
TriesToUnstake {
account_id: AccountId,
},
TriesToStake {
account_id: AccountId,
balance: String,
locked: String,
stake: String,
},
InsufficientStake {
account_id: AccountId,
minimum_stake: String,
stake: String,
},
FunctionCallError(FunctionCallError),
NewReceiptValidationError(ReceiptValidationError),
OnlyImplicitAccountCreationAllowed {
account_id: AccountId,
},
DeleteAccountWithLargeState {
account_id: AccountId,
},
DelegateActionInvalidSignature,
DelegateActionSenderDoesNotMatchTxReceiver {
receiver_id: AccountId,
sender_id: AccountId,
},
DelegateActionExpired,
DelegateActionAccessKeyError(InvalidAccessKeyError),
DelegateActionInvalidNonce {
ak_nonce: u64,
delegate_nonce: u64,
},
DelegateActionNonceTooLarge {
delegate_nonce: u64,
upper_bound: u64,
},
GlobalContractDoesNotExist {
identifier: GlobalContractIdentifier,
},
}
Expand description
ActionErrorKind
JSON schema
{
"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": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/AccountId"
},
"predecessor_id": {
"$ref": "#/components/schemas/AccountId"
},
"registrar_account_id": {
"$ref": "#/components/schemas/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": "#/components/schemas/AccountId"
},
"predecessor_id": {
"$ref": "#/components/schemas/AccountId"
}
}
}
},
"additionalProperties": false
},
{
"description": "Administrative actions like `DeployContract`, `Stake`, `AddKey`, `DeleteKey`. can be proceed only if sender=receiver\nor 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": "#/components/schemas/AccountId"
},
"actor_id": {
"$ref": "#/components/schemas/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": "#/components/schemas/AccountId"
},
"public_key": {
"$ref": "#/components/schemas/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": "#/components/schemas/AccountId"
},
"public_key": {
"$ref": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/FunctionCallError"
}
},
"additionalProperties": false
},
{
"description": "Error occurs when a new `ActionReceipt` created by the `FunctionCall` action fails\nreceipt validation.",
"type": "object",
"required": [
"NewReceiptValidationError"
],
"properties": {
"NewReceiptValidationError": {
"$ref": "#/components/schemas/ReceiptValidationError"
}
},
"additionalProperties": false
},
{
"description": "Error occurs when a `CreateAccount` action is called on a NEAR-implicit or ETH-implicit account.\nSee NEAR-implicit account creation NEP: <https://github.com/nearprotocol/NEPs/pull/71>.\nAlso, 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\n`OnlyNamedAccountCreationAllowed`.",
"type": "object",
"required": [
"OnlyImplicitAccountCreationAllowed"
],
"properties": {
"OnlyImplicitAccountCreationAllowed": {
"type": "object",
"required": [
"account_id"
],
"properties": {
"account_id": {
"$ref": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/AccountId"
},
"sender_id": {
"$ref": "#/components/schemas/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": "#/components/schemas/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": "#/components/schemas/GlobalContractIdentifier"
}
}
}
},
"additionalProperties": false
}
]
}
Variants§
AccountAlreadyExists
Happens when CreateAccount action tries to create an account with account_id which is already exists in the storage
AccountDoesNotExist
Happens when TX receiver_id doesn’t exist (but action is not Action::CreateAccount)
CreateAccountOnlyByRegistrar
A top-level account ID can only be created by registrar.
CreateAccountNotAllowed
A newly created account must be under a namespace of the creator account
ActorNoPermission
Administrative actions like DeployContract
, Stake
, AddKey
, DeleteKey
. can be proceed only if sender=receiver
or the first TX action is a CreateAccount
action
DeleteKeyDoesNotExist
Account tries to remove an access key that doesn’t exist
AddKeyAlreadyExists
The public key is already used for an existing access key
DeleteAccountStaking
Account is staking and can not be deleted
LackBalanceForState
ActionReceipt can’t be completed, because the remaining balance will not be enough to cover storage.
Fields
TriesToUnstake
Account is not yet staked, but tries to unstake
TriesToStake
The account doesn’t have enough balance to increase the stake.
InsufficientStake
FunctionCallError(FunctionCallError)
An error occurred during a FunctionCall
Action, parameter is debug message.
NewReceiptValidationError(ReceiptValidationError)
Error occurs when a new ActionReceipt
created by the FunctionCall
action fails
receipt validation.
OnlyImplicitAccountCreationAllowed
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.
TODO(#8598): This error is named very poorly. A better name would be
OnlyNamedAccountCreationAllowed
.
DeleteAccountWithLargeState
Delete account whose state is large is temporarily banned.
DelegateActionInvalidSignature
Signature does not match the provided actions and given signer public key.
DelegateActionSenderDoesNotMatchTxReceiver
Receiver of the transaction doesn’t match Sender of the delegate action
DelegateActionExpired
Delegate action has expired. max_block_height
is less than actual block height.
DelegateActionAccessKeyError(InvalidAccessKeyError)
The given public key doesn’t exist for Sender account
DelegateActionInvalidNonce
DelegateAction nonce must be greater sender[public_key].nonce
DelegateActionNonceTooLarge
DelegateAction nonce is larger than the upper bound given by the block height
GlobalContractDoesNotExist
Fields
identifier: GlobalContractIdentifier
Trait Implementations§
Source§impl Clone for ActionErrorKind
impl Clone for ActionErrorKind
Source§fn clone(&self) -> ActionErrorKind
fn clone(&self) -> ActionErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more