Skip to main content

Requirements

  • Node.js 18+
  • npm or yarn
  • Solana CLI (optional, for key management)

Install

npm install aether-agent-sdk

Environment Setup

Create a .env file in your project root:
.env
# Solana Network (devnet or mainnet-beta)
SOLANA_NETWORK=devnet

# RPC URL (optional - uses public endpoints by default)
SOLANA_RPC_URL=https://api.devnet.solana.com

# Agent wallet (base58 encoded private key)
AGENT_PRIVATE_KEY=your_private_key_here

# Or use a keypair file path
AGENT_WALLET_PATH=/path/to/keypair.json

# USDC Mint Address
# Devnet: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
# Mainnet: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDC_MINT=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU

# Merchant wallet (recipient for payments)
MERCHANT_WALLET_ADDRESS=your_merchant_wallet

Generate a Wallet

If you don’t have a Solana wallet, you can generate one:
# Using Solana CLI
solana-keygen new --outfile ~/.config/solana/agent-keypair.json

# Get the public key
solana-keygen pubkey ~/.config/solana/agent-keypair.json
Or programmatically:
import { Keypair } from '@solana/web3.js';
import fs from 'fs';

// Generate new keypair
const keypair = Keypair.generate();

// Save to file
fs.writeFileSync(
  'agent-keypair.json',
  JSON.stringify(Array.from(keypair.secretKey))
);

console.log('Public Key:', keypair.publicKey.toBase58());

Fund Your Wallet (Devnet)

For testing on devnet, get free SOL and USDC:
# Airdrop SOL (for transaction fees)
solana airdrop 2 YOUR_WALLET_ADDRESS --url devnet
For devnet USDC, use the Solana Devnet Faucet.

Verify Installation

import { SettlementAgent, VERSION } from 'aether-agent-sdk';

console.log('Aether SDK Version:', VERSION);

const agent = new SettlementAgent();
await agent.init();

console.log('Agent initialized successfully!');

TypeScript Configuration

The SDK includes TypeScript types. Recommended tsconfig.json:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "lib": ["ES2020"],
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "declaration": true,
    "outDir": "./dist"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules"]
}

Next Steps

Quickstart

Build your first agent in 5 minutes