参与VRC-10代币

HTTP接口:

wallet/participateassetissue
作用:参与通证发行
demo:curl -X POST https://vtest.infragrid.v.network/wallet/participateassetissue -d '{
"to_address": "46bf97a54f4b829c4e9253b26024b1829e1a3b1120",
"owner_address":"46010D3A8E0D80F8C83148240202DD17", 
"amount":100, 
"asset_name":"3230313271756265696a696e67"
}'

参数说明:
to_address是通证发行人的地址,需要是hexString格式
owner_address是参与通证人的地址,需要是hexString格式
amount是参与通证发行的vs数量
asset_name是通证的名称,需要是hexString格式

返回值:参与通证发行的transaction

Visionweb示例

const privateKey = "..."; 
var issuerAddress = "VM2TmqauSEiRf16CyFgzHV2BVxBejY9iyR"; 
var tokenID= "1000088";
var amount = 1000;
var buyerAddress = "VVDGpn4hCSzJ5nkHPLetk8KQBtwaTppnkr";
//创建未签名的 ICO 通证购买交易。
tradeobj = await vsWeb.transactionBuilder.purchaseToken(
      issuerAddress,
      tokenID,
      amount,
      buyerAddress,    
).then(output => {
  console.log('- Output:', output, '\n');
  return output;
});
//签名
const signedtxn = await vsWeb.vs.sign(
      tradeobj,
      privateKey
);
//广播
const receipt = await vsWeb.vs.sendRawTransaction(
      signedtxn
).then(output => {
  console.log('- Output:', output, '\n');
  return output;
});

Wallet-cli示例:

#用法:ParticipateAssetIssue [OwnerAddress] ToAddress AssetID Amount
ParticipateAssetIssue VQmDzierQxEFJm1dT5YXnTXqVAfdN9HtXj 1000099 1000

请按照以下说明步骤完成本次交易:
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.提示:“ParticipateAssetIssue 1000099 1000 from VQmDzierQxEFJm1dT5YXnTXqVAfdN9HtXj successful !!” ,表示参与成功VRC10代币发行。