CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-solana--web3-js

Comprehensive JavaScript SDK for building Solana blockchain applications with modern architecture and type safety

93

1.29x

Evaluation93%

1.29x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-3/

Solana Account Monitor

A utility that retrieves and displays information about Solana blockchain accounts, including balance, ownership, and data details.

Requirements

Create a module that queries Solana account information and provides formatted output. The module should:

  1. Connect to a Solana cluster and retrieve account information for a given public key
  2. Display the account balance in SOL (lamports converted to SOL)
  3. Show the account owner (program that owns the account)
  4. Indicate whether the account is executable
  5. Display the size of the account data in bytes
  6. Handle cases where the account does not exist

Functionality

The module should provide a function that accepts a public key string and cluster URL, then returns structured account information including:

  • Balance in both lamports and SOL
  • Owner public key
  • Whether the account is executable
  • Data size
  • Account existence status

Test Cases

  • Query an account that exists and verify all fields are populated @test
  • Query a system program account and verify it is marked as executable @test
  • Query a non-existent account and handle gracefully @test

Implementation

@generates

API

/**
 * Retrieves and formats information about a Solana account
 *
 * @param {string} publicKeyString - The base58-encoded public key of the account
 * @param {string} clusterUrl - The Solana cluster RPC URL to connect to
 * @returns {Promise<object>} Account information with balance, owner, executable status, and data size
 */
async function getAccountInfo(publicKeyString, clusterUrl) {
  // IMPLEMENTATION HERE
}

module.exports = { getAccountInfo };

Dependencies { .dependencies }

@solana/web3.js { .dependency }

Provides Solana blockchain interaction capabilities.

Install with Tessl CLI

npx tessl i tessl/npm-solana--web3-js

tile.json