获取RAM价格

方式1)命令行中输入:
cleos -u http://nodes.get-scatter.com:80 get table eosio eosio rammarket
方式2)使用eosjs:

eos.getTableRows({"json": true,"code":
"eosio","scope":"eosio","table":"rammarket"}).then(rs => console.log(rs));

结果:
{ "rows": [{ "supply": "10000000000.0000 RAMCORE", "base": { "balance":
"26352582837 RAM", "weight": "0.50000000000000000" }, "quote": { "balance":
"2607707.4971 EOS", "weight": "0.50000000000000000" } } ], "more": false }
然后使用Bancor算法,计算出需要nKB的RAM的价格:
RAM价格 = (n * quote.balance) / (n + base.balance / 1024)
 

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信