Open lizhefeng opened 4 years ago
Please add details how to ReadContract directly from chain API. @lzxm160
The following is the way to get xrc20 related info from iotex-core,use ioctl or grpcurl,you can use other language to implement these:
1、decimals() 313ce567
./bin/ioctl action read io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn -b 313ce567 -s io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02
grpcurl -v -plaintext -d '{"execution":{"amount":"0","contract":"io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn","data":"MTzlZw=="}, "callerAddress": "io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02"}' api.testnet.iotex.one:80 iotexapi.APIService.ReadContract
2、name() 06fdde03
./bin/ioctl action read io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn -b 06fdde03 -s io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02
grpcurl -v -plaintext -d '{"execution":{"amount":"0","contract":"io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn","data":"Bv3eAw=="}, "callerAddress": "io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02"}' api.testnet.iotex.one:80 iotexapi.APIService.ReadContract
3、symbol() 95d89b41
./bin/ioctl action read io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn -b 95d89b41 -s io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02
grpcurl -v -plaintext -d '{"execution":{"amount":"0","contract":"io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn","data":"ldibQQ=="}, "callerAddress": "io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02"}' api.testnet.iotex.one:80 iotexapi.APIService.ReadContract
4、totalSupply() 18160ddd
./bin/ioctl action read io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn -b 18160ddd -s io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02
grpcurl -v -plaintext -d '{"execution":{"amount":"0","contract":"io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn","data":"GBYN3Q=="}, "callerAddress": "io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02"}' api.testnet.iotex.one:80 iotexapi.APIService.ReadContract
5、balanceOf(address) 70a08231 io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg
./bin/ioctl action read io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn -b 70a082310000000000000000000000000ddfc506136fb7c050cc2e9511eccd81b15e7426 -s io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02
grpcurl -v -plaintext -d '{"execution":{"amount":"0","contract":"io1zk6gqq0m2z9ytlu77t76e3632ezy39fa83xjnn","data":"cKCCMQAAAAAAAAAAAAAAAA3fxQYTb7fAUMwulRHszYGxXnQm"}, "callerAddress": "io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02"}' api.testnet.iotex.one:80 iotexapi.APIService.ReadContract
We want to have a separate page for each XRC token similar to the layout in etherscan: