Counterpartyd create_issuance APIを使ってアセットの数量を増やす
はじめに
前回はcreate_issuance APIを使用してアセット("XSTAR")の新規作成を行いましたが、今回はそのアセットの数量を増やします。使用するAPIは新規作成時と同じです。
目次
- アセットオーナーが保有するアセット
- create_issuance API実行
- 結果確認
アセットオーナーが保有するアセット
(ビットコインアドレス)1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy
(保有しているアセット)
$ curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"get_balances", "params":{"filters": {"field": "address", "op": "==", "value": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy"}}}' {"result": [{"asset": "XCP", "quantity": 120900000, "address": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy"}, {"asset": "XSTAR", "quantity": 10, "address": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy"}, {"asset": "XZCOIN", "quantity": 99495, "address": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy"}], "id": 0, "jsonrpc": "2.0"}
create_issuance API実行
curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create_issuance", "params":{"source":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "quantity":90, "asset":"XSTAR"}}' ...signとbroadcastは省略。broadcast後のtx_hashは以下です。 {"result": "81e6d7617b55b37fcaa029d9aaa9f372a461d85bad91702baad53985dc2cb130", "jsonrpc": "2.0", "id": 0}
結果確認
blockscanから確認することができます。
$ curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"get_balances", "params":{"filters": {"field": "address", "op": "==", "value": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy"}}}' {"result": [{"quantity": 120900000, "address": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "asset": "XCP"}, {"quantity": 100, "address": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "asset": "XSTAR"}, {"quantity": 99495, "address": "1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "asset": "XZCOIN"}], "jsonrpc": "2.0", "id": 0}
まとめ
アセット"XSTAR"の数量が10->100に増加していることが分かります。
次回からはbetについて何回かに分けて書いていきます。