mcpField
T
transfer

transfer

github.com/aibtcdev其他11174 次安装1 天前更新
代码仓库

关于 transfer

Stacks L2 资产转账技能,可通过命令行向指定地址发送 STX、SIP-010 代币和 SIP-009 NFT。各操作均要求钱包已解锁,并支持费用设置。

主要功能

  1. 01发送 STX、SIP-010 代币和 SIP-009 NFT
  2. 02支持代币符号或合约 ID
  3. 03设置转账备注与费用
  4. 04费用可自动估算

适用场景

  1. 01向地址转移 STX
  2. 02发送指定合约的代币或 NFT

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/aibtcdev/skills --skill transfer

安装后在 Claude Code 中输入/transfer确认已加载。

附带文件AGENT.mdtransfer.ts

详细介绍

转账技能

适用于 Stacks L2 的统一资产转账技能 — 可向收款地址发送 STX、SIP-010 同质化代币和 SIP-009 NFT。三个子命令都要求钱包已解锁。

用法

bun run transfer/transfer.ts <subcommand> [options]

子命令

stx

向收款地址转账 STX。金额以 micro-STX 为单位(1 STX = 1,000,000 micro-STX)。

bun run transfer/transfer.ts stx \
  --recipient <address> \
  --amount <microStx> \
  [--memo <text>] \
  [--fee low|medium|high|<microStx>]

选项:

  • --recipient(必需)— 收款方的 Stacks 地址(以 SP 或 ST 开头)
  • --amount(必需)— 以 micro-STX 为单位的金额(例如,2000000 表示 2 STX)
  • --memo(可选)— 附加到转账的备注文本(最多 34 字节)
  • --fee(可选)— 费用预设(low、medium、high)或 micro-STX 金额;未指定时自动估算

输出:

{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "amount": "2 STX",
  "amountMicroStx": "2000000",
  "memo": null,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123..."
}
token

向收款方转账任意 SIP-010 同质化代币。可使用常见代币符号(sBTC、USDCx、ALEX、DIKO)或完整合约 ID。

bun run transfer/transfer.ts token \
  --recipient <address> \
  --amount <uint> \
  --contract <token-symbol-or-contract-id> \
  [--memo <text>] \
  [--fee low|medium|high|<microStx>]

选项:

  • --recipient(必需)— 收款方的 Stacks 地址
  • --amount(必需)— 以代币最小单位表示的金额(请查看代币精度)
  • --contract(必需)— 代币符号(例如,sBTC)或完整合约 ID(例如,SP2...my-token)
  • --memo(可选)— 备注文本(最多 34 字节)
  • --fee(可选)— 费用预设或 micro-STX 金额;未指定时自动估算

输出:

{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "contract": "SP2...my-token",
  "amount": "1000000",
  "memo": null,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123..."
}
nft

向收款方转账 SIP-009 NFT。需要 NFT 系列合约 ID 和特定的代币 ID。

bun run transfer/transfer.ts nft \
  --recipient <address> \
  --token-id <uint> \
  --contract <contract-id> \
  [--fee low|medium|high|<microStx>]

选项:

  • --recipient(必需)— 收款方的 Stacks 地址
  • --token-id(必需)— 要转账的 NFT 的整数代币 ID
  • --contract(必需)— NFT 系列合约 ID(例如,SP2...my-nft)
  • --fee(可选)— 费用预设或 micro-STX 金额;未指定时自动估算

输出:

{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "contract": "SP2...my-nft",
  "tokenId": 42,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123..."
}

注意事项

  • 任何转账前都必须先解锁钱包。请先运行 bun run wallet/wallet.ts unlock。
  • 对于 STX,1 STX = 1,000,000 micro-STX。对于代币,请使用 tokens 技能的 get-info 子命令查看精度。
  • NFT 代币 ID 为整数。请使用 nft 技能的 get-holdings 子命令列出持有的代币 ID。
  • 无论转账的资产是什么,费用都以 STX 支付。请确保 STX 余额足以支付费用。
  • STX 和代币转账可使用 --memo 选项,但 NFT 转账不支持(SIP-009 标准不包含此功能)。

评论

支持 Markdown