freezeBalance

创建一个未签名的交易,用于冻结 vs。

用法

visionWeb.transactionBuilder.freezeBalance(
  amount,
  duration,
  resource,
  ownerAddress,
  receiverAddress,
  parentAddress,
  options
);

入参

参数描述类型默认值
amount冻结数量,单位为 vdtnumber0
duration冻结天数,最少为 3 天number3
resource冻结 vs 获取的资源PHOTON | ENTROPY|CommunityVoting|FVGUARANTEEPHOTON
ownerAddress冻结的 vs 所有者账户地址string默认账户地址
receiverAddress冻结的 vs 获得的资源受益者string-
parentAddress冻结的社区节点地址,resource为CommunityVoting类型时,必填,其他类型,无需填写string-
freezeBalanceStage熵和光量子冻结档位、余额[balanceStage]-
options可选参数,具体参数见下方object-

balanceStage: {stage: number, frozen_balance: number}

参数描述类型默认值
stage冻结档位number-
frozen_balance冻结金额number-

options 参数

参数描述类型默认值
permissionId设置多重签名时使用number-

返回值

object,创建的 transaction 对象。

示例

visionWeb.transactionBuilder.freezeBalance(100000000,3,"ENTROPY","VEoh3WDXviqcPZ1qVNCQpqLHYzigrQWTPL","VJJKvvPZ1cLkRoeYmswWPYdwi9Y2mkK8c8");
> {
  visible: false,
  txID: '89aa361b66777330af9fdf4394227c99e3bce30bc5b088297836715cadf94727',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: '475d',
    ref_block_hash: 'd544241ca7a794eb',
    expiration: 1608467445000,
    timestamp: 1608467386756
  },
  raw_data_hex: '0a02475d2208d544241ca7a794eb4088ea8581e82e5a71080b126d0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412370a154653cd48c2723cb985679f4e44d99c64d22d89f41d1080ade204180350017a15462d7a77f8bef6fe225bf5e353dd6a380f588a14967084a38281e82e'
}