跳到正文

sendTransaction · Stablecoin ​

返回 sendTransaction 总览

覆盖稳定币转移和 UTXO 合并。

STABLECOIN_TRANSFER ​

转移稳定币。

ts
const params = [
  {
    flag: "STABLECOIN_TRANSFER",     // 必填
    ft_contract_address: "",         // 必填,稳定币合约交易 ID
    address: "",                     // 必填,接收地址
    ft_amount: 1000,                 // 必填,转移数量,大数请使用 string
    tbc_amount: 0,                   // 可选,同时转 TBC 和稳定币时设置此值
    broadcastEnabled: true,          // 可选,默认 true
  },
];

const { txid } = await Turing.sendTransaction(params);
// const { txraw } = await Turing.sendTransaction(params); // broadcastEnabled 为 false 时
// const { error } = await Turing.sendTransaction(params); // 发生错误时

STABLECOIN_MERGE ​

合并稳定币 UTXO(要求所有 coinutxo 均已上链)。

ts
const params = [
  {
    flag: "STABLECOIN_MERGE",        // 必填
    ft_contract_address: "",         // 必填,稳定币合约交易 ID
  },
];

const { txid } = await Turing.sendTransaction(params); // txid 为多个 Merge 交易的 txid,用逗号隔开
// const { error } = await Turing.sendTransaction(params); // 发生错误时

在线示例 ​

在线示例

Turing.sendTransaction() / Stablecoin

正在检测钱包...

当前钱包网络为 未知,此方法需要 TBC。请切换钱包网络后重试。

必须填写当前钱包网络中已经存在的 64 位交易 ID;格式示例不能直接提交。

表单与 JSON 实时同步;依赖链上资源的交易 ID 需填写当前网络中的真实值。

正在检测钱包...
代码预览