account_add_access_key
Add an access key to a NEAR account to grant full or function-specific contract access. Specify account ID, network, and key permissions for secure account management.
Instructions
Add an access key to an account. This can be used to grant full access to an account, or allow the specified account to have specific function call access to a contract.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
accessKeyArgs | Yes | ||
accountId | Yes | ||
networkId | No | mainnet |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"accessKeyArgs": {
"additionalProperties": false,
"properties": {
"permission": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"publicKey": {
"description": "The public key of the access key.",
"type": "string"
},
"type": {
"const": "FullAccess",
"type": "string"
}
},
"required": [
"type",
"publicKey"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"FunctionCall": {
"additionalProperties": false,
"properties": {
"allowance": {
"default": 1.0000000000000001e-24,
"description": "The allowance of the function call access key.",
"type": [
"number",
"integer"
]
},
"contractId": {
"type": "string"
},
"methodNames": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"contractId",
"methodNames"
],
"type": "object"
},
"publicKey": {
"description": "The public key of the access key.",
"type": "string"
},
"type": {
"const": "FunctionCall",
"type": "string"
}
},
"required": [
"type",
"publicKey",
"FunctionCall"
],
"type": "object"
}
]
}
},
"required": [
"permission"
],
"type": "object"
},
"accountId": {
"type": "string"
},
"networkId": {
"default": "mainnet",
"enum": [
"testnet",
"mainnet"
],
"type": "string"
}
},
"required": [
"accountId",
"accessKeyArgs"
],
"type": "object"
}