Readonly
accountReadonly
connectionAccount2FA has options object where you can provide callbacks for:
A public key to be associated with the contract
Optional
contractId: stringNEAR account where the contract is deployed
Optional
methodNames: string | string[]The method names on the contract that should be allowed to be called. Pass null for no method names and '' or [] for any method names.
Optional
amount: bigintPayment in yoctoⓃ that is sent to the contract during this function call
This method submits a canary transaction that is expected to always fail in order to determine whether the contract currently has valid multisig state and whether it is initialized. The canary transaction attempts to delete a request at index u32_max and will go through if a request exists at that index. a u32_max + 1 and -1 value cannot be used for the canary due to expected u32 error thrown before deserialization attempt.
Optional
contractBytes: Uint8ArrayThe bytecode of the multisig contract.
A promise that resolves to the status of the code and state.
NEAR account name to be created
A public key created from the masterAccount
Create a new account and deploy a contract to it
NEAR account where the contract is deployed
The public key to add to the created contract account
The compiled contract code
of NEAR to transfer to the created contract account. Transfer enough to pay for storage https://docs.near.org/docs/concepts/storage-staking
The NEAR account that will receive the remaining Ⓝ balance from the account being deleted
Delete all multisig requests associated with the account.
A promise that resolves when all requests are deleted.
The public key to be deleted
Delete a multisig request by its ID.
The ID of the multisig request to be deleted.
A promise that resolves to the final execution outcome of the deletion.
Delete unconfirmed multisig requests associated with the account.
A promise that resolves when unconfirmed requests are deleted.
The compiled contract code
Deploy a multisig contract with 2FA and handle the deployment process.
The bytecode of the multisig contract.
A promise that resolves to the final execution outcome of the deployment.
This method converts LAKs back to FAKs, clears state and deploys an 'empty' contract (contractBytes param)
Optional
contractBytes: Uint8ArrayOptional
cleanupContractBytes: Uint8ArrayA promise that resolves to the final execution outcome of the operation.
Disable 2FA with the option to clean up contract state.
Options for disabling 2FA.
Optional
cleanupContractBytes?: Uint8ArrayThe bytecode of the cleanup contract (optional).
The bytecode of the contract to deploy.
A promise that resolves to the final execution outcome of the operation.
Finds the AccessKeyView associated with the accounts PublicKey stored in the Keystore.
currently unused (see todo)
currently unused (see todo)
{ publicKey PublicKey; accessKey: AccessKeyView }
Execute a function call.
The options for the function call.
Options used to initiate a function call (especially a change function call)
Optional
args?: objectnamed arguments to pass the method { messageText: 'my message' }
Optional
attachedDeposit?: bigintamount of NEAR (in yoctoNEAR) to send together with the call
The NEAR account id where the contract is deployed
Optional
gas?: bigintmax amount of gas that method call can use
Optional
jsContract?: booleanIs contract from JS SDK, automatically encodes args from JS SDK to binary.
The name of the method to invoke
Optional
stringify?: (input: any) => BufferConvert input arguments into bytes array.
Optional
walletCallbackUrl?: stringCallback url to send the NEAR Wallet if using it to sign transactions.
Optional
walletMeta?: stringMetadata to send the NEAR Wallet if using it to sign transactions.
A promise that resolves to the final execution outcome of the function call.
Retrieves cleanup actions for disabling 2FA.
The bytecode of the cleanup contract.
Retrieves key conversion actions for disabling 2FA.
Gets the 2FA method (kind and detail).
A promise that resolves to the 2FA method.
Get all access keys for the account
Returns calculated account balance
Returns a list of authorized apps
Returns the NEAR tokens balance and validators of a given account that is delegated to the staking pools that are part of the validators set in the current epoch.
NOTE: If the tokens are delegated to a staking pool that is currently on pause or does not have enough tokens to participate in validation, they won't be accounted for.
Retrieves recovery methods for the account.
Sends a signed JSON request to a specified path.
The path for the request.
The request body.
Prompts the user to enter and verify the 2FA code.
Default implementation for sending the 2FA code.
NEAR account receiving Ⓝ
Amount to send in yoctoⓃ
Sign a transaction to preform a list of actions and broadcast it using the RPC API.
Options for the transaction.
Options used to initiate sining and sending transactions
A promise that resolves to the final execution outcome of the transaction.
Sign and send a transaction with the multisig account as the sender.
The NEAR account ID of the transaction receiver.
The list of actions to be included in the transaction.
A promise that resolves to the final execution outcome of the transaction.
Generates a signature for the latest finalized block.
Compose and sign a SignedDelegate action to be executed in a transaction on behalf of this Account instance
Options for the transaction.
Actions to be included in the meta transaction
Number of blocks past the current block height for which the SignedDelegate action may be included in a meta transaction
Receiver account of the meta transaction
Protected
signCreate a signed transaction which can be broadcast to the network
NEAR account receiving the transaction
list of actions to perform as part of the transaction
The public key for the account that's staking
The account to stake in yoctoⓃ
Returns basic NEAR account information via the view_account
RPC query method
Verify the 2FA code using the default method.
The security code to verify.
A promise that resolves to the verification result.
Invoke a contract view function using the RPC API.
Function call options.
Options used to initiate a function call (especially a change function call)
Optional
args?: objectnamed arguments to pass the method { messageText: 'my message' }
Optional
attachedDeposit?: bigintamount of NEAR (in yoctoNEAR) to send together with the call
Optional
blockQuery?: BlockReferenceThe NEAR account id where the contract is deployed
Optional
gas?: bigintmax amount of gas that method call can use
Optional
jsContract?: booleanIs contract from JS SDK, automatically encodes args from JS SDK to binary.
The name of the method to invoke
Optional
parse?: (response: Uint8Array) => anyOptional
stringify?: (input: any) => BufferConvert input arguments into bytes array.
Returns the state (key value pairs) of this account's contract based on the key prefix. Pass an empty string for prefix if you would like to return the entire state.
allows to filter which keys should be returned. Empty prefix means all keys. String prefix is utf-8 encoded.
specifies which block to query state at. By default returns last "optimistic" block (i.e. not necessarily finalized).
This class provides common account related RPC calls including signing transactions with a KeyPair.