Creates a client for an account; does not create the account on-chain.
Account to query or sign transactions for.
RPC provider instance or endpoint URL.
Optionalsigner: KeyPairString | Signer
Optional signer or curve-prefixed secret key. Read-only operations do not require one.
Add a full access gas key to the account. Its balance starts at 0, fund it with transferToGasKey
The public key to be added
The number of independent nonce lanes (1-1024, default 1)
Add a full access key to the account
The public key to be added
Adds an access key restricted to function calls on one contract.
Key permission options.
Optionalallowance?: string | number | bigintOptionalmethodNames?: string[]The submitted add-key transaction response.
Add a function call gas key to the account. Its balance starts at 0, fund it with transferToGasKey
OptionalmethodNames?: string[]OptionalnumNonces?: numberCall a function on a smart contract and return parsed transaction result
Expected result type; no runtime result validation is performed.
Call function parameters
Optionalargs?: Uint8Array<ArrayBufferLike> | Record<string, any>Optionaldeposit?: string | number | bigintOptionalgas?: string | number | bigintOptionalwaitUntil?: TxExecutionStatusThe final success value decoded as JSON when possible, otherwise as a string.
Returns null when no success value is available at the requested execution milestone.
callFunctionRaw for logs, receipt outcomes, and transaction metadata.
Call a function on a smart contract and return raw transaction outcome
Call function parameters
Optionalargs?: Uint8Array<ArrayBufferLike> | Record<string, any>Optionaldeposit?: string | number | bigintOptionalgas?: string | number | bigintOptionalwaitUntil?: TxExecutionStatusThe RPC transaction response, including execution logs and receipt outcomes when available.
Creates a new NEAR account with a given ID and public key.
This method can create two types of accounts:
Top-level accounts of the form name.tla (e.g., bob.near):
Sub-accounts of the current account (e.g., sub.ana.near):
ana.near, you can create sub.ana.nearCreating name.tla outside this account's subtree calls create_account on the tla account;
that account must implement the account-creation contract method.
Account creation options
OptionalnearToTransfer?: string | number | bigintCreates or initializes a NEP-616 account at the ID derived from its state initialization.
Initialization and funding options.
Optionaldeposit?: string | bigintStorage deposit in yoctoNEAR. Defaults to 0; excess is refunded by the protocol.
Global contract reference and raw initial storage used to derive the account ID.
The submitted transaction response. This account's signer pays for initialization.
Create a meta transaction ready to be signed by a Signer
Meta transaction options
An unsigned delegate action. Does not reserve a nonce locally or submit a transaction.
Create a signed MetaTransaction that can be broadcasted to a relayer
Signed meta transaction options
An object containing delegateHash and signedDelegate, ready for a relayer.
Create a signed transaction ready to be broadcast by a Provider
Transaction options.
A signed transaction, without submitting it to the network.
Creates a sub account of this account. For example, if the account is ana.near, you can create sub.ana.near.
Sub-account creation options
OptionalnearToTransfer?: string | number | bigintCreate a transaction that can be later signed with a Signer
Transaction options
An unsigned transaction with a locally reserved nonce and a recent finalized block hash. Does not sign or submit it; creating another transaction may advance the local nonce reservation.
Initializes a protocol-88 universal account at the ID derived from the supplied state-init bytes.
Initialization and funding options.
Optionaldeposit?: string | bigintDeposit in yoctoNEAR. Defaults to 0.
Raw versioned state-init bytes, such as the result of UniversalStateInit.encode().
The submitted transaction response. This account's signer pays for initialization.
Deletes the account, transferring all remaining NEAR to a beneficiary account
Important: Deleting an account does not transfer FTs or NFTs
Will receive the account's remaining balance
The public key to be deleted
Deploy a smart contract in the account
The compiled contract code bytes
Deploy a global contract that can be reused by multiple accounts
The compiled contract code bytes
Deploy mode - "codeHash" for immutable contracts, "accountId" for updateable contracts
Calls Provider.viewAccessKey to retrieve information for a specific key in the account
Calls Provider.viewAccessKeyList to retrieve one page of the account's keys.
Pass the returned last_key unchanged as afterKey to request the next page.
Without pagination options, accounts exceeding the node's key limit may be rejected.
Optional page size and cursor
Queries the token balance available to this account.
The token to check the balance of. Defaults to Native NEAR.
The available balance of the account in units (e.g. yoctoNEAR).
Calls Provider.viewContractCode to retrieve the account's contract code and its hash
Calls Provider.viewContractState to retrieve the keys and values stored on the account's contract
Optionalprefix: stringReturns an overview of the account's state, including the account's balance, storage usage, and code hash
Relay a meta-transaction signed by a different account
The signed delegate action to relay
The transaction response from the relayed meta-transaction
Allows to set the signer used to control the account
holds the private key and can sign Transactions
Creates a transaction, signs it and broadcast it to the network
Sign and send transaction options
Optionalretries?: numberOptionalsigner?: SignerOptionalthrowOnFailure?: booleanOptionalwaitUntil?: TxExecutionStatusThe RPC transaction response at the requested execution milestone.
Signs and submits multiple independent transactions concurrently.
Batch submission options.
Optionalsigner?: SignerOptionalthrowOnFailure?: booleanOptionalwaitUntil?: TxExecutionStatusResponses in input order. The batch is not atomic: other transactions can succeed if one fails.
This function simply calls the signNep413Message method of the Signer
Nep413 message signing arguments
OptionalcallbackUrl?: stringThe signed message with account ID, public key, and raw signature bytes; no transaction is submitted.
Transfers a token to the specified receiver.
Supports sending either the native NEAR token or any supported Fungible Token (FT).
Transfer options
Optionaltoken?: NativeToken | FungibleTokenThe transfer transaction response.
Fund a gas key balance. The gas key can belong to any account
The account that owns the gas key
The public key of the gas key
The amount of yoctoNEAR to transfer to the gas key
Use a previously deployed global contract on this account
The global contract identifier - either { accountId: string } or { codeHash: string | Uint8Array }
Move balance from one of this account's gas keys back to the account
The public key of the gas key
The amount of yoctoNEAR to withdraw
This class allows to access common account information. If a Signer is provider, then the account can be used to perform all common actions such as transferring tokens and calling functions