Xspoonai official solana toolkit

From jiayaoqijia/cryptoskill · View interactive version

Xspoonai official solana toolkit is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Comprehensive Solana blockchain interaction using Helius APIs and Jupiter. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses.

How to use this skill

Skill file

Solana Toolkit

A comprehensive toolkit for interacting with the Solana blockchain, leveraging Helius for RPC/API services and Jupiter for DeFi swaps.

Prerequisites

  1. Helius API Key: Get free at dashboard.helius.dev.
  2. Configuration: Store your key in ~/.config/solana-skill/config.json:

```json

{

"heliusApiKey": "your-api-key",

"network": "mainnet-beta"

}

```

Core Capabilities

Wallet Management

Transactions

DeFi (Jupiter)

Monitoring

Quick Reference

Check Balance

import { createHelius } from "helius-sdk";

const helius = createHelius({ apiKey: "YOUR_KEY" });
const assets = await helius.getAssetsByOwner({
  ownerAddress: "WALLET_ADDRESS",
  displayOptions: {
    showFungible: true,
    showNativeBalance: true,
  },
});

Send SOL

import {
  Connection,
  SystemProgram,
  Transaction,
  sendAndConfirmTransaction,
  LAMPORTS_PER_SOL,
} from "@solana/web3.js";

const connection = new Connection(
  "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY",
);
const tx = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: recipientPubkey,
    lamports: amount * LAMPORTS_PER_SOL,
  }),
);
await sendAndConfirmTransaction(connection, tx, [sender]);

Jupiter Swap

// 1. Get quote
const quote = await fetch(
  `https://quote-api.jup.ag/v6/quote?inputMint=${inputMint}&outputMint=${outputMint}&amount=${amount}`,
);

// 2. Build swap transaction
const swap = await fetch("https://quote-api.jup.ag/v6/swap", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    quoteResponse: await quote.json(),
    userPublicKey: wallet.publicKey.toString(),
  }),
});

// 3. Sign and send

API Endpoints

| Service | Base URL |

| :---------------- | :-------------------------------------------- |

| Helius RPC | https://mainnet.helius-rpc.com/?api-key=KEY |

| Jupiter Quote | https://quote-api.jup.ag/v6/quote |

| Jupiter Swap | https://quote-api.jup.ag/v6/swap |

Security Best Practices

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.