Skip to main content

Types

IAccount

NameTypeRequiredDefaultDescription
accountIDstringyes-The account ID of the account used to sign the transaction.
publicKeyPublicKey | stringyes-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

NameTypeRequiredDefaultDescription
keysstring[]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.
useApiServerbooleannotrueIf true, the data will be fetched from api server instead of network rpc node.
returnDeletedbooleannofalseIf true, will include deleted keys with the value null.
withBlockHeightbooleannofalseIf true, for every value and a node will add the block height of the data with the key :block.
withNodeIdbooleannofalseIf true, for every node will add the node index with the key :node.

IKeysOptions

NameTypeRequiredDefaultDescription
keysstring[]yes-A set of key patterns to return. Each key is in the form of a pattern to return data from.
blockHeightbigintno-The block height to query from.
returnDeletedbooleannofalseIf true, will include deleted keys with the value null.
returnTypebooleannofalseIf true, will return the type of the value (e.g., 'string', 'object') along with the value.
valuesOnlybooleannofalseIf true, returns only values without keys.
useApiServerbooleannotrueIf true, the data will be fetched from the API server instead of the network RPC node.

IIndexOptions

NameTypeRequiredDefaultDescription
actionstringyes-The index_type from the standard (e.g., 'like', 'follow').
keystring | { 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.
accountIdstring | 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'.
limitnumberno100The number of values to return.
fromnumber | stringno0The starting point for fetching results. Can be a number or string, depending on the context.

IGrantWritePermissionOptions

NameTypeRequiredDefaultDescription
accountIAccountyes-An object that contains the account ID and the public key that will be used to sign the transaction.
blockHashstringyes-The block hash that is returned from getAccessKeys(). See the AccessKeyView object for more information.
granteeAccountIdstringyes-The account ID to give write permission to.
keysstring[]yes-A set of keys to give the grantee write permission. For example alice.near/profile/** or alice.near/profile/name.
noncebigintyes-The access key's nonce. See the AccessKeyView object for more information.

IIsWritePermissionGrantedOptions

NameTypeRequiredDefaultDescription
granteeAccountIdstringyes-The account ID to check if it has write permissions for a key.
keystringyes-The key to check if the grantee has write permission.

INewSocialOptions

NameTypeRequiredDefaultDescription
contractIdstringnosocial.nearThe account ID of the social contract. This defaults to the mainnet social contract account ID: social.near.
networkstring | IRPCOptionsnomainnetThis 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

NameTypeRequiredDefaultDescription
apiKeystringno-An API key that is used in the X-Api-Key header for all RPC provider requests.
urlstringyes-The RPC provider URL.

ISetOptions

NameTypeRequiredDefaultDescription
accountIAccountyes-An object that contains the account ID and the public key that will be used to sign the transaction.
blockHashstringno-A current block hash (within 24 hours). Defaults to the latest block hash.
dataobjectyes-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.
noncebigintno-The access key's nonce. See the AccessKeyView object for more information. Defaults to the current access key nonce incremented by 1.
refundUnusedDepositbooleannofalseIf true, will refund any left over deposit to the signer's account.

IStorageDepositOptions

NameTypeRequiredDefaultDescription
accountIAccountyes-An object that contains the account ID and the public key that will be used to sign the transaction.
account_idstringno-The account ID for which to deposit storage. Defaults to the signer account if not provided.
registration_onlybooleannofalseIf true, deposits the minimum amount required for account registration without additional storage.
depositstringyes-The amount of NEAR to deposit for storage, in yoctoNEAR.
blockHashstringno-A current block hash (within 24 hours). Defaults to the latest block hash.
noncebigintno-The access key's nonce. Defaults to the current access key nonce incremented by 1.

IStorageWithdrawOptions

NameTypeRequiredDefaultDescription
accountIAccountyes-An object that contains the account ID and the public key that will be used to sign the transaction.
amountstringno-The amount of NEAR to withdraw, in yoctoNEAR. If not specified, withdraws all available NEAR.
blockHashstringno-A current block hash (within 24 hours). Defaults to the latest block hash.
noncebigintno-The access key's nonce. Defaults to the current access key nonce incremented by 1.