WTFAcademy / WTF-Ethers

我最近在重新学ethers.js,巩固一下细节,也写一个“WTF Ethers.js极简入门”,供小白们使用,每周更新1-3讲。Now supports English! 官网: https://wtf.academy
https://wtf.academy
Other
3.03k stars 489 forks source link

Update 20_DecodeTx #109

Closed jackleeio closed 11 months ago

jackleeio commented 11 months ago

1.Ethers v6中获取函数选择器为:interface.getFunction("funName").selector

参考:https://github.com/ethers-io/ethers.js/discussions/3893

2.打印解码交易详情时加入handleBigInt函数,避免JSON.stringify转换数据时出现BigInt类型报错

> `打印解码交易详情: ${JSON.stringify(
>                           ^
> 
> TypeError: Do not know how to serialize a BigInt
>     at JSON.stringify (<anonymous>)

3.替换一些v6中已弃用的方法