addUpdateData

为一个未签名的交易,添加备注

用法

tronWeb.transactionBuilder.addUpdateData(unsignedTransaction,memo);

参数类型

参数

描述

类型

unsignedTransaction

未签名的交易对象

JSON

memo

要给交易添加的备注信息

string

返回类型
object

示例

>var txn = await tronWeb.transactionBuilder.sendTrx("TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM", 100, "TUznHJfHe6gdYY7gvWmf6bNZHuPHDZtowf");
>tronWeb.transactionBuilder.addUpdateData(tx,"test")
Promise { <pending> }
< {
  visible: false,
  txID: "8c3a4b4c20cfdf8df340905949a8241aee639492e0c4d73f1bf18847346444f1",
  raw_data: {
    contract: [ [Object] ],
    data: "74657374", // this is the HexString of memo
        expiration: 1628073045000,
        ref_block_bytes: "7254",
        ref_block_hash: "c45fff3a6a0347cc",
        timestamp: 1628072986845
  },
  raw_data_hex: "0a0272542208c45fff3a6a0347cc4088d8dc85b12f5204746573745a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541d0b69631440f0a494bb51f7eee68ff5c593c00f0121541ce8a0cf0c16d48bcf22825f6053248df653c89ca186470dd91d985b12f"
}