Closed foreso-GitHub closed 3 years ago
看了重构之前的代码(之前的版本),第二个参数依然是issuer, 而不是current or validated(block tag), 看图片
(之前的代码,类型验证有bug, 如果上传的不是string参数就会报错,所以最近有时间把代码重构了一下,看下边图片) 如果这样改的话,rpc格式会有歧义,就是不知道第二个参数应该是帐号(issuer), 还是block tag, 而且block tag默认是validated, 如果不设置的话,大部分参数都是validated(已经验证过的区块及帐本)
这个是重构之后的代码,看图片
By design.
如果要使用tag参数,就一定要有issuer参数。
更新文档: https://github.com/caivega/ipfslib/wiki/chain%E7%9A%84JSON_RPC%E6%89%8B%E5%86%8C#jt_getCurrency https://github.com/caivega/ipfslib/wiki/chain%E7%9A%84JSON_RPC%E6%89%8B%E5%86%8C#jt_getBalance https://github.com/caivega/ipfslib/wiki/chain%E7%9A%84JSON_RPC%E6%89%8B%E5%86%8C#jt_getAccount
版本:20201114-v0.5.2-dev jt_getBalance, jt_getAccount,jt_getCurrency,查询原生币或global的代币时,如果有tag,且对应的issuer(jjjjjjjjjjjjjjjjjjjjjhoLvTp)没有填写会报错。 上一个版本没有这个问题。
请求:
结果: