← 返回
开发者工具 Key 中文

solana-skill

Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.
通过 Helius API 与 Solana 区块链交互。支持创建与管理钱包、查询 SOL 及代币余额、发送交易、通过 Jupiter 兑换代币及监控地址。适用于 Solana 链上操作、钱包管理、代币转账、DeFi 兑换及资产追踪。
chattyclaw
开发者工具 clawhub v1.0.0 1 版本 99272.3 Key: 需要
★ 4
Stars
📥 3,194
下载
💾 124
安装
1
版本
#crypto#defi#latest#solana#trading#wallet

概述

Solana Skill

Comprehensive Solana blockchain interaction using Helius infrastructure.

Prerequisites

  1. Helius API Key — Get free at https://dashboard.helius.dev/signup
  2. Store key in ~/.config/solana-skill/config.json:
  3. {
      "heliusApiKey": "your-api-key",
      "network": "mainnet-beta"
    }
    

Core Capabilities

Wallet Management

  • Create new wallets (keypair generation)
  • Import existing wallets (private key or seed phrase)
  • List managed wallets
  • Secure key storage (encrypted at rest)

Balance & Assets

  • Check SOL balance
  • Get all token balances (SPL tokens)
  • View NFTs and compressed NFTs
  • Portfolio valuation (via DAS API)

Transactions

  • Send SOL
  • Send SPL tokens
  • Transaction history (enhanced, human-readable)
  • Priority fee estimation

Swaps (Jupiter)

  • Get swap quotes
  • Execute token swaps
  • Slippage protection

Monitoring

  • Watch addresses for activity
  • Transaction notifications

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, Keypair, 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://api.jup.ag/swap/v1/quote?inputMint=${inputMint}&outputMint=${outputMint}&amount=${amount}`);

// 2. Build swap transaction
const swap = await fetch('https://api.jup.ag/swap/v1/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

ServiceBase URL
-------------------
Helius RPChttps://mainnet.helius-rpc.com/?api-key=KEY
Helius Senderhttps://sender.helius-rpc.com/fast
Jupiter Quotehttps://api.jup.ag/swap/v1/quote
Jupiter Swaphttps://api.jup.ag/swap/v1/swap

Security

Critical rules:

  • Never log or display private keys
  • Use encrypted storage for keys
  • Validate all addresses before transactions
  • Set reasonable slippage limits (default: 1%)
  • Always confirm large transactions with user

See references/security.md for detailed security practices.

Detailed References

Common Token Addresses

TokenMint Address
--------------------
SOLSo11111111111111111111111111111111111111112 (wrapped)
USDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
BONKDezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263

Error Handling

Common errors and solutions:

  • Insufficient SOL: Need SOL for rent + transaction fees
  • Token account not found: Create ATA before sending tokens
  • Transaction too large: Reduce instructions or use address lookup tables
  • Blockhash expired: Retry with fresh blockhash

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 13:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,847
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,799
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,727