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-5/

Memo Transaction Builder

Build a utility for creating and managing memo transactions on Solana. The utility should create transaction instructions that write string messages to the blockchain using a memo program.

Requirements

Your implementation should:

  1. Create a function that builds a transaction instruction for writing a memo to the blockchain
  2. Accept a memo string message and a payer public key as inputs
  3. Properly configure the instruction with the correct program ID, accounts, and data
  4. Support the standard Solana memo program (program ID: MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr)
  5. Encode the memo message as UTF-8 bytes in the instruction data

Test Cases

  • Given a memo message "Hello Solana" and a payer public key, the function creates a transaction instruction with the correct program ID @test
  • The instruction data contains the UTF-8 encoded memo message @test
  • The instruction includes the payer as a signer account @test

Implementation

@generates

API

import { PublicKey, TransactionInstruction } from '@solana/web3.js';

/**
 * Creates a transaction instruction for writing a memo to the Solana blockchain.
 *
 * @param message - The memo message to write (will be UTF-8 encoded)
 * @param payer - The public key of the account paying for and signing the transaction
 * @returns A TransactionInstruction configured for the memo program
 */
export function createMemoInstruction(
  message: string,
  payer: PublicKey
): TransactionInstruction;

Dependencies { .dependencies }

@solana/web3.js { .dependency }

Provides Solana blockchain interaction capabilities including transaction instruction construction.

Install with Tessl CLI

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

tile.json