Comprehensive JavaScript SDK for building Solana blockchain applications with modern architecture and type safety
93
Evaluation — 93%
↑ 1.29xAgent success when using this tile
A utility that retrieves and displays account balance information from the Solana blockchain, including both SOL and SPL token balances.
@generates
/**
* Retrieves the SOL balance for a given wallet address.
*
* @param {string} publicKeyStr - The wallet address as a base58 string.
* @param {string} clusterUrl - The Solana cluster RPC URL (e.g., "https://api.mainnet-beta.solana.com").
* @returns {Promise<number>} The balance in lamports.
* @throws {Error} If the public key is invalid.
*/
async function getSolBalance(publicKeyStr, clusterUrl) {
// IMPLEMENTATION HERE
}
/**
* Retrieves all SPL token accounts owned by a wallet.
*
* @param {string} ownerPublicKeyStr - The owner wallet address as a base58 string.
* @param {string} clusterUrl - The Solana cluster RPC URL.
* @returns {Promise<Array<Object>>} Array of token account objects with pubkey and account info.
* @throws {Error} If the public key is invalid.
*/
async function getTokenAccounts(ownerPublicKeyStr, clusterUrl) {
// IMPLEMENTATION HERE
}
/**
* Retrieves the token balance for a specific token account.
*
* @param {string} tokenAccountPublicKeyStr - The token account address as a base58 string.
* @param {string} clusterUrl - The Solana cluster RPC URL.
* @returns {Promise<Object>} Object containing balance information with amount and decimals.
* @throws {Error} If the token account public key is invalid.
*/
async function getTokenBalance(tokenAccountPublicKeyStr, clusterUrl) {
// IMPLEMENTATION HERE
}
module.exports = {
getSolBalance,
getTokenAccounts,
getTokenBalance,
};Provides Solana blockchain interaction capabilities including connection management, account queries, and balance retrieval.
Install with Tessl CLI
npx tessl i tessl/npm-solana--web3-jsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10