account_add_access_key
Add an access key to a NEAR account to enable contract interactions. Specify permissions, public key, and network ID for secure and functional API access.
Instructions
Add an access key to an account. This will allow the account to interact with the 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"
}