版本说明

imToken WebView 升级与说明。

破坏性变更

不再自动修复 web3.js 的错误

web3.js1.3.0 版本中存在 send 函数未找到的错误,你可以在 web3.js 的仓库中找到关于此问题的更多讨论: issue#3790pr#3649 等。这个错误通常显示为:

Uncaught (in promise) TypeError: this.send is not a function
// or
TypeError: this._eip1193Send is not a function. (In 'this._eip1193Send(payload.method, payload.params)', 'this._eip1193Send' is undefined)

在之前的版本中,imToken 应用会自动添加一个补丁以修复 web3.js 的错误,但此行为带来了一些副作用。imToken 应用自 v2.9.4 版本开始将移除此自动修复补丁。

此问题来自 web3.js ,我们推荐你升级或降级 web3.js 包以修复此错误。

不再注入 web3.js

从 2021 年开始,imToken 应用不再注入 web3.js 。如果开发者仍旧需要此库,请将 web3.js 打包至你的应用中 (built in bundle package)。

与我们相同,MetaMask 也宣布从 2021 年初开始不会再注入 web3.js ,你也可以阅读这篇来自 MetaMask 的文章了解为什么 DApp 上下文环境不再注入 web3.js

最后更新于