pub struct FunctionCallPermission {
pub allowance: Option<NearToken>,
pub method_names: Vec<String>,
pub receiver_id: String,
}Expand 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.
JSON schema
{
"description": "Grants limited permission to make transactions with FunctionCallActions\nThe permission can limit the allowed balance to be spent on the prepaid gas.\nIt also restrict the account ID of the receiver for this function call.\nIt also can restrict the method name for the allowed function calls.",
"type": "object",
"required": [
"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\ntransaction fees. When this access key is used, both account balance and the allowance is\ndecreased by the same value.\n`None` means unlimited allowance.\nNOTE: To change or increase the allowance, the old access key needs to be deleted and a new\naccess key should be created.",
"anyOf": [
{
"$ref": "#/components/schemas/NearToken"
},
{
"type": "null"
}
]
},
"method_names": {
"description": "A list of method names that can be used. The access key only allows transactions with the\nfunction call of one of the given method names.\nEmpty 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"
}
}
}Fields§
§allowance: Option<NearToken>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.
method_names: Vec<String>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.
receiver_id: StringThe access key only allows transactions with the given receiver’s account id.
Trait Implementations§
Source§impl Clone for FunctionCallPermission
impl Clone for FunctionCallPermission
Source§fn clone(&self) -> FunctionCallPermission
fn clone(&self) -> FunctionCallPermission
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FunctionCallPermission
impl Debug for FunctionCallPermission
Source§impl<'de> Deserialize<'de> for FunctionCallPermission
impl<'de> Deserialize<'de> for FunctionCallPermission
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&FunctionCallPermission> for FunctionCallPermission
impl From<&FunctionCallPermission> for FunctionCallPermission
Source§fn from(value: &FunctionCallPermission) -> Self
fn from(value: &FunctionCallPermission) -> Self
Source§impl From<FunctionCallPermission> for AccessKeyPermission
impl From<FunctionCallPermission> for AccessKeyPermission
Source§fn from(value: FunctionCallPermission) -> Self
fn from(value: FunctionCallPermission) -> Self
Auto Trait Implementations§
impl Freeze for FunctionCallPermission
impl RefUnwindSafe for FunctionCallPermission
impl Send for FunctionCallPermission
impl Sync for FunctionCallPermission
impl Unpin for FunctionCallPermission
impl UnwindSafe for FunctionCallPermission
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)