发行VRC-10代币

HTTP接口:

wallet/createassetissue
作用:创建未签名的发行VRC10 通证交易
示例:curl -X POST  https://vtest.infragrid.v.network/wallet/createassetissue -d '{
     "owner_address": "46bed31c10a7670fbf4377da31d11804a825666ca9",
     "name": "76726331305f74657374",
     "abbr": "76726331305f61626272",
     "total_supply": 100000,
     "vs_num": 2,
     "num": 3,
     "start_time": 1711483775000,
     "end_time": 1812483780000,
     "description": "6d4b8bd553d1884c7672633130901a8bc1",
     "url": "68747470733a2f2f636e2e646576656c6f706572732e762e6e6574776f726b2f",
     "free_asset_net_limit": 100000,
     "public_free_asset_net_limit": 1000,
     "frozen_supply": {
          "frozen_amount": 100,
          "frozen_days": 10
     },
     "precision": 1
}'
参数说明:
owner_address发行人地址    
name是通证名称    
abbr是通证简称  
total_supply是发行总量  
vs_num和num是通证和vs的兑换价值  
precision是精度,也就是小数点个数  
start_time和end_time是通证发行起止时间  
description是通证说明,需要是hexString格式 
url是通证发行方的官网,需要是hexString格式 
free_asset_net_limit是通证的总的免费光量子数 
public_free_asset_net_limit是每个token拥护者能使用本通证的免费光量子  
frozen_supply是通证发行者可以在发行的时候指定冻结的通证 

返回值:发行通证的Transaction

Vision-Web示例:

const privateKey = "...";
var createAssetAddress = "VM2TmqauSEiRf16CyFgzHV2BVxBejY9iyR";
const options = {
      name : "test", 
      abbreviation : "tt",  
      description : "fortest", 
      url : "www.baidu.com",
      totalSupply : 10000000,
      vsRatio : 1,
      tokenRatio : 1,
      saleStart : 1581929489000,
      saleEnd : 1581938187000,
      freeBandwidth : 0,
      freeBandwidthLimit : 0,
      frozenAmount : 0,
      frozenDuration : 0,
      precision : 6
}
//创建一个未签名的交易,用于发行vrc10代币,相当于 createToken
tradeobj = await vsWeb.transactionBuilder.createAsset(
      options,
      createAssetAddress
).then(output => {
  console.log('- Output:', output, '\n');
  return output;
});
//签名
const signedtxn = await vsWeb.trx.sign(
      tradeobj,
      privateKey
);
//广播
const receipt = await vsWeb.trx.sendRawTransaction(
      signedtxn
).then(output => {
  console.log('- Output:', output, '\n');
  return output;
});

Wallet-cli示例:

#用法: AssetIssue [OwnerAddress] AssetName AbbrName TotalSupply TrxNum AssetNum Precision StartDate EndDate Description Url FreeNetLimitPerAccount PublicFreeNetLimit FrozenAmount0 FrozenDays0 ... FrozenAmountN FrozenDaysN
AssetIssue TestVS VS 75000000000000000 1 1 2 "2019-10-02 15:10:00" "2020-07-11" "just for test121212" www.test.com 100 100000 10000 10 10000 1

请按照以下说明步骤完成本次交易:
1.提示:“Please confirm and input your permission id, if input y or Y means default 0, other non-numeric characters will cancel transaction.”,输入“y” 或是“Y”, 确认本次交易;
2.提示:“lease choose your key for sign. …… Please choose between 1 and 2”,选择签名账户的序号;
3.提示:“Please input your password.”,输入本地密码;
4.提示:“AssetIssue TestToken successful !!” 表示成功发行VRC10 代币。