Types
IAccount
Name | Type | Required | Default | Description |
---|---|---|---|---|
accountID | string | yes | - | The account ID of the account used to sign the transaction. |
publicKey | PublicKey | string | yes | - | The public key of the access key that will be used to sign the transaction. The key must have write access for the account. For details on managing keys see the NEAR API docs. |
IGetOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
keys | string[] | yes | - | A set of key patterns to return. Each key is in the form of a pattern to return data from. For example alice.near/profile/** or alice.near/profile/name . |
useApiServer | boolean | no | true | If true, the data will be fetched from api server instead of network rpc node. |
returnDeleted | boolean | no | false | If true, will include deleted keys with the value null . |
withBlockHeight | boolean | no | false | If true, for every value and a node will add the block height of the data with the key :block . |
withNodeId | boolean | no | false | If true, for every node will add the node index with the key :node . |
IKeysOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
keys | string[] | yes | - | A set of key patterns to return. Each key is in the form of a pattern to return data from. |
blockHeight | bigint | no | - | The block height to query from. |
returnDeleted | boolean | no | false | If true, will include deleted keys with the value null . |
returnType | boolean | no | false | If true, will return the type of the value (e.g., 'string', 'object') along with the value. |
valuesOnly | boolean | no | false | If true, returns only values without keys. |
useApiServer | boolean | no | true | If true, the data will be fetched from the API server instead of the network RPC node. |
IIndexOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
action | string | yes | - | The index_type from the standard (e.g., 'like', 'follow'). |
key | string | { type?: string; path?: string; blockHeight?: number } | yes | - | The inner indexed value. Can be a string or an object with optional type, path, and blockHeight properties. |
accountId | string | string[] | no | - | A string or array of account IDs to filter values. |
order | 'asc' | 'desc' | no | 'asc' | The order of results. Either 'asc' or 'desc'. |
limit | number | no | 100 | The number of values to return. |
from | number | string | no | 0 | The starting point for fetching results. Can be a number or string, depending on the context. |
IGrantWritePermissionOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
account | IAccount | yes | - | An object that contains the account ID and the public key that will be used to sign the transaction. |
blockHash | string | yes | - | The block hash that is returned from getAccessKeys() . See the AccessKeyView object for more information. |
granteeAccountId | string | yes | - | The account ID to give write permission to. |
keys | string[] | yes | - | A set of keys to give the grantee write permission. For example alice.near/profile/** or alice.near/profile/name . |
nonce | bigint | yes | - | The access key's nonce. See the AccessKeyView object for more information. |
IIsWritePermissionGrantedOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
granteeAccountId | string | yes | - | The account ID to check if it has write permissions for a key. |
key | string | yes | - | The key to check if the grantee has write permission. |
INewSocialOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
contractId | string | no | social.near | The account ID of the social contract. This defaults to the mainnet social contract account ID: social.near . |
network | string | IRPCOptions | no | mainnet | This can be a network ID string (betanet , localnet , mainnet or testnet ) which will use a public RPC provider, or you can use a custom RPC URL with an API key. |
IRPCOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
apiKey | string | no | - | An API key that is used in the X-Api-Key header for all RPC provider requests. |
url | string | yes | - | The RPC provider URL. |
ISetOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
account | IAccount | yes | - | An object that contains the account ID and the public key that will be used to sign the transaction. |
blockHash | string | no | - | A current block hash (within 24 hours). Defaults to the latest block hash. |
data | object | yes | - | Each top-level property must be the account ID. The nested objects/properties will be written to the contract, however, if any nested properties are null values, this signals a deletion of that key. |
nonce | bigint | no | - | The access key's nonce. See the AccessKeyView object for more information. Defaults to the current access key nonce incremented by 1. |
refundUnusedDeposit | boolean | no | false | If true, will refund any left over deposit to the signer's account. |
IStorageDepositOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
account | IAccount | yes | - | An object that contains the account ID and the public key that will be used to sign the transaction. |
account_id | string | no | - | The account ID for which to deposit storage. Defaults to the signer account if not provided. |
registration_only | boolean | no | false | If true, deposits the minimum amount required for account registration without additional storage. |
deposit | string | yes | - | The amount of NEAR to deposit for storage, in yoctoNEAR. |
blockHash | string | no | - | A current block hash (within 24 hours). Defaults to the latest block hash. |
nonce | bigint | no | - | The access key's nonce. Defaults to the current access key nonce incremented by 1. |
IStorageWithdrawOptions
Name | Type | Required | Default | Description |
---|---|---|---|---|
account | IAccount | yes | - | An object that contains the account ID and the public key that will be used to sign the transaction. |
amount | string | no | - | The amount of NEAR to withdraw, in yoctoNEAR. If not specified, withdraws all available NEAR. |
blockHash | string | no | - | A current block hash (within 24 hours). Defaults to the latest block hash. |
nonce | bigint | no | - | The access key's nonce. Defaults to the current access key nonce incremented by 1. |