← 返回
未分类 中文

Solana Wallet Rpc

Portable Solana wallet operations for agents. Use when an agent needs a Solana wallet for devnet or mainnet workflows such as creating a wallet, getting a wa...
供智能体使用的便携式 Solana 钱包操作工具。适用于需要 Solana 钱包进行开发网或主网工作流(如创建钱包、获取钱包等)的场景。
zhentan
未分类 clawhub v1.5.0 1 版本 99791.7 Key: 无需
★ 0
Stars
📥 479
下载
💾 0
安装
1
版本
#latest

概述

Solana Wallet RPC

Warning: This skill creates and uses local Solana private key files. Treat all generated or configured keypair files as secrets. Default usage is intended for devnet testing unless the user explicitly asks for another network.

Use the bundled script in scripts/solana_wallet.cjs for wallet operations.

Scope

This skill is intentionally narrow.

It can:

  • create or load a local Solana wallet
  • print the wallet address
  • check SOL balance
  • request a devnet SOL airdrop
  • sign a text message and return base58 or base64 signatures
  • verify a signature against the local wallet
  • preview and, with explicit confirmation, optionally submit the RockPaperClaw deposit alias command

It cannot:

  • send SPL token transfers
  • submit arbitrary Anchor program instructions
  • replace a full Solana transaction-capable wallet or MCP

Safety rules

  • Default to devnet unless the user explicitly asks for another network.
  • Do not send funds or sign opaque payloads without explicit approval.
  • Fund-moving commands default to preview mode and require both an explicit keypair and --execute before sending a transaction.
  • Prefer printing structured JSON output so addresses, balances, and signatures are easy to reuse.
  • Treat private keys and keypair files as secrets.
  • create-wallet refuses to overwrite an existing keypair unless SOLANA_WALLET_OVERWRITE=1 is set.

Runtime requirements

This skill bundles a package.json with the runtime dependencies it needs, so the required packages are scoped to the skill directory rather than the whole project.

Install them from the skill directory before running the script:

cd skills/solana-wallet-rpc
npm install

Required packages:

  • @solana/spl-token
  • @solana/web3.js
  • tweetnacl
  • bs58

Why these are used:

  • @solana/spl-token — associated token account derivation and token-program constants for the RockPaperClaw deposit flow
  • @solana/web3.js — Solana-native keypair handling, RPC access, balance checks, and devnet airdrops
  • tweetnacl — Ed25519 message signing compatible with Solana wallet key material
  • bs58 — base58 encoding/decoding for Solana addresses and wallet-link signatures

These are standard Solana/crypto runtime dependencies, not arbitrary network or eval helpers.

Defaults and configuration

The script supports these env vars:

  • SOLANA_RPC_URL — defaults to https://api.devnet.solana.com
  • SOLANA_WALLET_KEYPAIR — path to a 64-byte Solana keypair JSON file
  • SOLANA_WALLET_OVERWRITE=1 — allows create-wallet to overwrite an existing keypair file

If SOLANA_WALLET_KEYPAIR is not set, the script tries common defaults such as:

  • ~/.config/solana/id.json
  • ~/.solana/id.json
  • ~/.openclaw/wallets/solana-devnet.json
  • ~/.openclaw/wallets/solana.json

When creating a new wallet without an explicit path, the script defaults to:

  • ~/.openclaw/wallets/solana-.json

Override the env vars when using a different wallet or network. Auto-discovery is intended for wallet lookup and signing workflows; fund-moving commands should use an explicit --keypair or SOLANA_WALLET_KEYPAIR.

For RockPaperClaw deposits, the program ID and USDC mint are pinned to the canonical devnet values unless you pass explicit CLI flags.

These environment variables are local script settings for this wallet helper only. They are not required by the main rockpaperclaw skill.

Commands

Run from the repo root unless there is a reason not to:

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet /path/to/keypair.json
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs address
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs balance
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs airdrop 1
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs sign-message "your message here"
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs verify-message "your message here" "<signature>"
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit <agent-id> <amount-micro-usdc> --keypair /path/to/keypair.json

verify-message accepts either base64 or base58 signatures.

Common workflows

Create a wallet

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet

This generates a new keypair and stores it at a safe default path such as ~/.openclaw/wallets/solana-devnet.json.

If you want a specific file path:

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet ~/.config/solana/id.json

Get wallet address

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs address

Use this when another tool or service needs the wallet public key.

Check balance

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs balance

Use this before attempting any onchain action.

Request devnet SOL

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs airdrop 0.25

Notes:

  • Devnet faucets often rate-limit or run dry.
  • If the faucet returns 429, report that clearly and stop retrying aggressively.

Important:

  • This airdrop funds SOL for fees only.
  • It does not fund the wallet with USDC for RockPaperClaw deposits.

Get devnet USDC for RockPaperClaw

RockPaperClaw bankroll funding uses canonical devnet USDC, not SOL.

  • Use this skill to get the wallet address and, if needed, some devnet SOL for fees.
  • Then use the official Circle faucet at https://faucet.circle.com/ to send canonical test USDC to that same wallet address when the faucet supports your target network.
  • In the faucet UI, confirm the network selection matches the network you are using before submitting the request.
  • Circle's faucet page indicates rate limits can apply per stablecoin and test network pairing.
  • The canonical devnet USDC mint used by RockPaperClaw is 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU.
  • After the wallet has both fee SOL and devnet USDC, continue with get_deposit_info and the RockPaperClaw deposit flow.

Sign a message

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs sign-message "wallet link for agent <agent-id>"

Return the JSON fields clearly:

  • address
  • message
  • signatureBase58
  • signatureBase64

RockPaperClaw deposit alias

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit <agent-id> <amount-micro-usdc> --keypair /path/to/keypair.json

Preview example:

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit 87a28ffe-5870-4789-ac52-ba5f4c49b38a 1000000 --keypair ~/.config/solana/id.json

Execute example:

node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit 87a28ffe-5870-4789-ac52-ba5f4c49b38a 1000000 --keypair ~/.config/solana/id.json --execute

This is a convenience signer path for RockPaperClaw users who are already in the wallet skill. The canonical RockPaperClaw flow is: use the main rockpaperclaw skill for get_profile and get_deposit_info, then use a separate wallet tool such as this one for the actual signed transaction. Without --execute, this command only prints a preview.

RockPaperClaw note

For RockPaperClaw, the likely sequence is:

  1. Create or locate a wallet.
  2. Get the wallet address.
  3. Construct the exact message the service expects.
  4. Sign that exact message.
  5. Pass wallet_address, message, and the base58 signature into link_wallet.
  6. When funding chips, call get_deposit_info in the main rockpaperclaw skill to confirm the current program ID, vault, mint, and agent ID.
  7. Use a separate wallet tool for the actual deposit signing step. This wallet helper can do that if you explicitly want a local script-based signer.

If a service rejects the signature, verify whether it expects base58, base64, or hex before changing anything else.

For deposits specifically, think of the RockPaperClaw flow as:

  • get_profile to get agent_id
  • get_deposit_info to confirm deposit metadata
  • fund the wallet with canonical devnet USDC from the Circle faucet
  • use rockpaperclaw to verify deposit metadata, then use a separate wallet tool to sign and send the Anchor deposit transaction

This wallet skill can perform the same deposit transaction through rockpaperclaw-deposit, but that command is a convenience path when you are already in this skill for wallet setup.

RockPaperClaw example flows

Wallet-link flow

  1. In RockPaperClaw, call get_profile and copy the agent_id.
  2. Run node skills/solana-wallet-rpc/scripts/solana_wallet.cjs address and copy address.
  3. Build the exact message RockPaperClaw wallet link: .
  4. Run node skills/solana-wallet-rpc/scripts/solana_wallet.cjs sign-message "RockPaperClaw wallet link: ".
  5. Copy signatureBase58 from the JSON output.
  6. Call link_wallet in RockPaperClaw with the wallet address, exact message, and base58 signature.

Deposit-prep flow

  1. In RockPaperClaw, call get_profile and copy the agent_id.
  2. In RockPaperClaw, call get_deposit_info and copy the program ID, mint, vault, and config PDA.
  3. Run node skills/solana-wallet-rpc/scripts/solana_wallet.cjs balance to confirm SOL for fees.
  4. If needed on devnet, run node skills/solana-wallet-rpc/scripts/solana_wallet.cjs airdrop 0.25.
  5. Use the Circle faucet to fund that same wallet with canonical devnet USDC.
  6. Make sure the wallet now holds the canonical devnet USDC balance.
  7. If you want this wallet helper to act as the signer, run node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit --keypair /path/to/keypair.json.
  8. Verify the preview matches get_deposit_info.
  9. Rerun with --execute to send funds.
  10. Poll get_profile in RockPaperClaw until the webhook credit appears.

If the task is only the RockPaperClaw deposit flow, use the main rockpaperclaw skill for arena metadata and this wallet skill only if you want a local script to perform the signing step. Use this skill when the same conversation also needs wallet creation, address lookup, airdrops, or link-message signing.

版本历史

共 1 个版本

  • v1.5.0 当前
    2026-03-30 14:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

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

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,212 📥 266,257
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,057 📥 796,818