transfer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTransfer 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:
- (required) — Stacks address of the recipient (starts with SP or ST)
--recipient - (required) — Amount in micro-STX (e.g.,
--amountfor 2 STX)2000000 - (optional) — Memo text to attach to the transfer (max 34 bytes)
--memo - (optional) — Fee preset (
--fee,low,medium) or micro-STX amount; auto-estimated if omittedhigh
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>]选项:
- (必填)——接收方的Stacks地址(以SP或ST开头)
--recipient - (必填)——微STX单位的金额(例如,
--amount代表2 STX)2000000 - (可选)——附加到转账的备注文本(最大34字节)
--memo - (可选)——手续费预设值(
--fee、low、medium)或微STX金额;若省略则自动估算high
输出:
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 (, , , ) or a full contract ID.
sBTCUSDCxALEXDIKObun run transfer/transfer.ts token \
--recipient <address> \
--amount <uint> \
--contract <token-symbol-or-contract-id> \
[--memo <text>] \
[--fee low|medium|high|<microStx>]Options:
- (required) — Stacks address of the recipient
--recipient - (required) — Amount in the token's smallest unit (check token decimals)
--amount - (required) — Token symbol (e.g.,
--contract) or full contract ID (e.g.,sBTC)SP2...my-token - (optional) — Memo text (max 34 bytes)
--memo - (optional) — Fee preset or micro-STX amount; auto-estimated if omitted
--fee
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同质化代币。支持知名代币符号(、、、)或完整合约ID。
sBTCUSDCxALEXDIKObun run transfer/transfer.ts token \
--recipient <address> \
--amount <uint> \
--contract <token-symbol-or-contract-id> \
[--memo <text>] \
[--fee low|medium|high|<microStx>]选项:
- (必填)——接收方的Stacks地址
--recipient - (必填)——代币最小单位的金额(请查看代币的小数位数)
--amount - (必填)——代币符号(例如
--contract)或完整合约ID(例如sBTC)SP2...my-token - (可选)——备注文本(最大34字节)
--memo - (可选)——手续费预设值或微STX金额;若省略则自动估算
--fee
输出:
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:
- (required) — Stacks address of the recipient
--recipient - (required) — Integer token ID of the NFT to transfer
--token-id - (required) — NFT collection contract ID (e.g.,
--contract)SP2...my-nft - (optional) — Fee preset or micro-STX amount; auto-estimated if omitted
--fee
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>]选项:
- (必填)——接收方的Stacks地址
--recipient - (必填)——要转账的NFT的整数代币ID
--token-id - (必填)——NFT集合合约ID(例如
--contract)SP2...my-nft - (可选)——手续费预设值或微STX金额;若省略则自动估算
--fee
输出:
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 first.
bun run wallet/wallet.ts unlock - For STX, 1 STX = 1,000,000 micro-STX. For tokens, check decimals with the skill's
tokenssubcommand.get-info - NFT token IDs are integers. Use the skill's
nftsubcommand to list owned token IDs.get-holdings - Fee is paid in STX regardless of the asset being transferred. Ensure sufficient STX balance for the fee.
- The option is available for STX and token transfers, but not NFT transfers (not part of the SIP-009 standard).
--memo
- 任何转账操作前必须解锁钱包。请先使用 命令。
bun run wallet/wallet.ts unlock - 对于STX,1 STX = 1,000,000 微STX。对于代币,请使用skill的
tokens子命令查看小数位数。get-info - NFT代币ID为整数。请使用skill的
nft子命令列出持有的代币ID。get-holdings - 无论转账何种资产,手续费均以STX支付。请确保有足够的STX余额支付手续费。
- 选项适用于STX和代币转账,但不适用于NFT转账(不属于SIP-009标准的一部分)。
--memo