Skip to main content

Overview

The @atxp/solana package provides Solana account implementations for using ATXP on the Solana blockchain. This package was extracted from @atxp/client in v0.9.0 to create a modular architecture with reduced dependencies.
New in v0.9.0: Solana functionality has been moved to this dedicated package. Users must now install @atxp/solana separately along with required Solana dependencies.

Installation

npm install @atxp/solana

Required Dependencies

You’ll also need to install Solana’s peer dependencies:
npm install @solana/web3.js @solana/pay bs58

SolanaAccount

The main class for managing Solana accounts with ATXP.

Constructor

SolanaAccount(
  solanaRpcUrl: string,
  sourceSecretKey: string
): SolanaAccount
Creates a Solana account object that can be used with ATXP clients for making payments on the Solana blockchain. Arguments Returns
SolanaAccount
SolanaAccount
Returns a configured SolanaAccount instance ready for use with ATXP clients.
Example Usage
import { atxpClient } from '@atxp/client';
import { SolanaAccount } from '@atxp/solana';

// Read the Solana account details from the environment variables
const solanaRpcUrl = process.env.SOLANA_RPC_URL;
const solanaPrivateKey = process.env.SOLANA_PRIVATE_KEY;

// Create a Solana account
const account = new SolanaAccount(solanaRpcUrl, solanaPrivateKey);

// Use with ATXP client
const client = await atxpClient({
  mcpServer: 'https://browse.mcp.atxp.ai/',
  account,
});

// Make MCP calls
const result = await client.callTool({
  name: 'atxp_browse',
  arguments: { query: 'Latest Solana news' }
});

Migration from v0.8.x

If you’re upgrading from ATXP SDK v0.8.x or earlier, follow these steps:
1

Install the new package

Install @atxp/solana and its peer dependencies:
npm install @atxp/solana @solana/web3.js @solana/pay bs58
2

Update your imports

Change your imports from @atxp/client to @atxp/solana:Before (v0.8.x):
import { atxpClient, SolanaAccount } from '@atxp/client';
After (v0.9.0+):
import { atxpClient } from '@atxp/client';
import { SolanaAccount } from '@atxp/solana';
3

Verify functionality

Test your application to ensure Solana payments work correctly with the new modular structure.

Benefits of the Modular Architecture

The separation of Solana functionality into @atxp/solana provides several advantages:
Applications that don’t use Solana no longer need to include Solana dependencies, significantly reducing bundle size.
The core @atxp/client package no longer includes the bigint-buffer vulnerability that was previously required for Solana support.
Users explicitly install only the blockchain packages they need, making dependency management more transparent and intentional.
Blockchain-specific code is isolated, making it easier to update Solana integrations without affecting the core package.

See Also