Guards API
This document describes the Guards API functions, which allow the suspension and resumption of payable API calls, as well as the addition and removal of guard accounts. The suspend and resume functions can be called by the owner or guards, while the extend and remove guard accounts functions can only be called by the owner. Examples of Near command line calls for each function are provided, along with the required input parameters for each.
All calls to the API return the PayableAPISuspended
error if API is suspended.
Suspend and resume
suspend_payable_api
(transaction)
Suspend payable API.
Arguments
None.
Attached NEAR
None.
Returns
Nothing.
Prerequisites
- The caller must be a guard or the owner of Veax.
- API is not suspended.
Errors
PermissionDenied
: the caller is not a guard.GuardChangeStateDenied
: API is already suspended.
Example
near call "veax.near" suspend_payable_api --args '{}' --accountId "guard.veax.near"
resume_payable_api
(transaction)
Resume payable API.
Arguments
None.
Attached NEAR
None.
Returns
Nothing.
Prerequisites
- The caller must be a guard or the owner of Veax.
- API is suspended.
Errors
PermissionDenied
: the caller is not a guard.GuardChangeStateDenied
: API is not suspended.
Example
near call "veax.near" resume_payable_api --args '{}' --accountId "guard.veax.near"
Adding and removing
extend_guard_accounts
(transaction)
Extend a set of guards with new accounts.
Arguments
guard_accounts
: AccountId
: a list of guards to add.
Attached NEAR
None.
Returns
Nothing.
Prerequisites
- The caller must be Veax owner.
- API is not suspended.
Errors
PermissionDenied
: the caller is not Veax owner.PayableAPISuspended
: payable API is suspended.
Example
near call "veax.near" extend_guard_accounts --args '{"guard_accounts": ["guard1.veax.near", "guard2.veax.near"]}' --accountId "veax.near"
remove_guard_accounts
(transaction)
Remove guard accounts.
Arguments
guard_accounts
: AccountId
: a list of guards to remove.
Attached NEAR
None.
Returns
None.
Prerequisites
- The caller must be Veax owner.
- API is not suspended.
Errors
PermissionDenied
: the caller is not Veax owner.PayableAPISuspended
: payable API is suspended.
Example
near call "veax.near" remove_guard_accounts --args '{"guard_accounts": ["guard1.veax.near", "guard2.veax.near"]}' --accountId "veax.near"