EOSJS中文手册【V20】

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

api.serializeTransaction()

serializeTransaction()方法将指定的交易对象序列化为字节数组。

函数原型

serializeTransaction(transaction: any): Uint8Array

参数

transaction:交易对象

返回值

serializeTransaction()方法返回序列化结果,一个字节数组。

示例代码

let tx = {
  actions: [{
    account: 'tommy',
    name: 'hi',
    authorization: [{
      actor: 'tommy',
      permission: 'active',
    }],
    data: {
      user: 'tommy'
    },
  }]
}
let seTx = api.serializeTransaction(tx)
console.log(seTx)