The getBalanceByMnemonic function is used to retrieve the account balance associated with a specified mnemonic and account ID. It allows you to query the balance of a Near Protocol account by providing the mnemonic, the account ID, and the environment (e.g., testnet, mainnet) in which the account exists.



Example Request and Response


Before making requests with Nest SDK, you must have it installed.

You can install Nest SDK using either npm or yarn. Use the following commands to install Nest SDK:

npm install @nest25/wallet-lib
yarn add @nest25/wallet-lib


Here is an example of how to make a txStatus request using the Nest SDK:

// import wallet from the nest SDK
const { Wallet } = require('@nest25/wallet-lib');
// create a new wallet instance
const wallet = new Wallet('');
// set the mnemonic to use for the wallet
const testMnemonic = 'exchange fun mixed elevator laundry length trap script boost purchase genuine arrest';

async function main() {
  // get the balance of the wallet
  const response = await wallet.getBalanceByMnemonic(
  // log the response



Use Cases

  • Online Wallets: Online wallets can use this function to retrieve the status of transactions made on their platform. By querying the account balance using the getBalanceByMnemonic function, online wallets can provide users with real-time information about their account balances.

  • Trading Platforms: Trading platforms can use this function to verify the status of transactions made by their users on different blockchain networks. By checking the account balance of a specific Near Protocol account using the getBalanceByMnemonic function, trading platforms can ensure that the necessary funds are available for executing transactions and updating the user's portfolio accordingly.

Last updated