sign

交易签名。

用法

visionWeb.vs.sign(transaction, privateKey);

入参

参数描述类型默认值
transactiontransaction 对象object-
privateKey私钥string-

返回值

object,查询到的账户资源信息。

示例

  const transaction = await visionWeb.transactionBuilder.sendVs(
    '462d7a77f8bef6fe225bf5e353dd6a380f588a1496',
    100
  );
  const signedtx = await visionWeb.vs.sign(transaction, PrivateKey);
  console.log(signedtx);
> {
  visible: false,
  txID: 'fb31a41bbecd4bb9b33f56c440d1e1c5db60024c6988e32b7a96a943e35c7862',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: 'd2be',
    ref_block_hash: '3594a5fc3033cd51',
    expiration: 1608376056000,
    timestamp: 1608375998027
  },
  raw_data_hex: '0a02d2be22083594a5fc3033cd5140c0f1bbd5e72e5a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a154653cd48c2723cb985679f4e44d99c64d22d89f41d1215462d7a77f8bef6fe225bf5e353dd6a380f588a1496186470cbacb8d5e72e',
  signature: [
    'e3eac4fa47fbcf715e562ce0eb72445dc5f1ddbaba9329e2b115e11022da010c3f95459ae872ffaa29b93ef155f6e4bc8b82389dd1cc015d8b010537c953db6600'
  ]
}