使用 web3.eth.getAccounts 和 eth_requestAccounts 时,相同的地址看起来大写和小写

发布于 2025-01-18 08:02:01 字数 381 浏览 1 评论 0原文

我在 dapp 中使用 Metamask 作为 ethereum 提供程序

当我调用 web3.eth.getAccounts() 时,

它返回 0xaBCd12baabcd7be123B6123DabCD484321ABcd3

当我发送 ethereum.send("eth_requestAccounts")

它返回相同的地址,但是基于一些奇怪的逻辑0xabcD12BAAbcd7BE123b6123Dabcd484321abCD3,字符是小写或大写。

除此之外,地址没有其他变化,没有数字丢失,顺序也正确。

为什么会发生这种事?

I'm using Metamask as ethereum provider in dapp

When I'm calling web3.eth.getAccounts()

It returns 0xaBCd12baabcd7be123B6123DabCD484321ABcd3

When i'm sending ethereum.send("eth_requestAccounts")

It returns same address but chars are lower cased or capitalized based on some weird logic 0xabcD12BAAbcd7BE123b6123Dabcd484321abCD3.

There's no other change to the address rather than that, no digit is missing and order is correct.

Why wuold that be happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文