transfer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Transfer Skill

转账Skill

Unified asset transfer skill for the Stacks L2 — sends STX, SIP-010 fungible tokens, and SIP-009 NFTs to a recipient address. All three subcommands require an unlocked wallet.
适用于Stacks L2的统一资产转账Skill——可向接收地址发送STX、SIP-010同质化代币和SIP-009 NFT。所有三个子命令均要求钱包处于解锁状态。

Usage

使用方法

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

Subcommands

子命令

stx

stx

Transfer STX to a recipient address. Amount is specified in 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>]
Options:
  • --recipient
    (required) — Stacks address of the recipient (starts with SP or ST)
  • --amount
    (required) — Amount in micro-STX (e.g.,
    2000000
    for 2 STX)
  • --memo
    (optional) — Memo text to attach to the transfer (max 34 bytes)
  • --fee
    (optional) — Fee preset (
    low
    ,
    medium
    ,
    high
    ) or micro-STX amount; auto-estimated if omitted
Output:
json
{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "amount": "2 STX",
  "amountMicroStx": "2000000",
  "memo": null,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123..."
}
向接收地址转账STX。金额以微STX为单位(1 STX = 1,000,000 微STX)。
bun run transfer/transfer.ts stx \
  --recipient <address> \
  --amount <microStx> \
  [--memo <text>] \
  [--fee low|medium|high|<microStx>]
选项:
  • --recipient
    (必填)——接收方的Stacks地址(以SP或ST开头)
  • --amount
    (必填)——微STX单位的金额(例如,
    2000000
    代表2 STX)
  • --memo
    (可选)——附加到转账的备注文本(最大34字节)
  • --fee
    (可选)——手续费预设值(
    low
    medium
    high
    )或微STX金额;若省略则自动估算
输出:
json
{
  "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

token

Transfer any SIP-010 fungible token to a recipient. Accepts a well-known token symbol (
sBTC
,
USDCx
,
ALEX
,
DIKO
) or a full contract ID.
bun run transfer/transfer.ts token \
  --recipient <address> \
  --amount <uint> \
  --contract <token-symbol-or-contract-id> \
  [--memo <text>] \
  [--fee low|medium|high|<microStx>]
Options:
  • --recipient
    (required) — Stacks address of the recipient
  • --amount
    (required) — Amount in the token's smallest unit (check token decimals)
  • --contract
    (required) — Token symbol (e.g.,
    sBTC
    ) or full contract ID (e.g.,
    SP2...my-token
    )
  • --memo
    (optional) — Memo text (max 34 bytes)
  • --fee
    (optional) — Fee preset or micro-STX amount; auto-estimated if omitted
Output:
json
{
  "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..."
}
向接收方转账任意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
    (可选)——手续费预设值或微STX金额;若省略则自动估算
输出:
json
{
  "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

nft

Transfer a SIP-009 NFT to a recipient. Requires the NFT collection contract ID and the specific token ID.
bun run transfer/transfer.ts nft \
  --recipient <address> \
  --token-id <uint> \
  --contract <contract-id> \
  [--fee low|medium|high|<microStx>]
Options:
  • --recipient
    (required) — Stacks address of the recipient
  • --token-id
    (required) — Integer token ID of the NFT to transfer
  • --contract
    (required) — NFT collection contract ID (e.g.,
    SP2...my-nft
    )
  • --fee
    (optional) — Fee preset or micro-STX amount; auto-estimated if omitted
Output:
json
{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "contract": "SP2...my-nft",
  "tokenId": 42,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123..."
}
向接收方转账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
    (可选)——手续费预设值或微STX金额;若省略则自动估算
输出:
json
{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "contract": "SP2...my-nft",
  "tokenId": 42,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123..."
}

Notes

注意事项

  • Wallet must be unlocked before any transfer. Use
    bun run wallet/wallet.ts unlock
    first.
  • For STX, 1 STX = 1,000,000 micro-STX. For tokens, check decimals with the
    tokens
    skill's
    get-info
    subcommand.
  • NFT token IDs are integers. Use the
    nft
    skill's
    get-holdings
    subcommand to list owned token IDs.
  • Fee is paid in STX regardless of the asset being transferred. Ensure sufficient STX balance for the fee.
  • The
    --memo
    option is available for STX and token transfers, but not NFT transfers (not part of the SIP-009 standard).
  • 任何转账操作前必须解锁钱包。请先使用
    bun run wallet/wallet.ts unlock
    命令。
  • 对于STX,1 STX = 1,000,000 微STX。对于代币,请使用
    tokens
    skill的
    get-info
    子命令查看小数位数。
  • NFT代币ID为整数。请使用
    nft
    skill的
    get-holdings
    子命令列出持有的代币ID。
  • 无论转账何种资产,手续费均以STX支付。请确保有足够的STX余额支付手续费。
  • --memo
    选项适用于STX和代币转账,但不适用于NFT转账(不属于SIP-009标准的一部分)。