Fix buy crash on wallets that return a numeric chainId

The chain guard did cur.toLowerCase() on the eth_chainId result. Per EIP-695
that's a hex string, but some wallets (Orlando's) return a number, so
cur.toLowerCase was undefined -> "cur.toLowerCase is not a function" aborted the
purchase. Compare chain ids numerically via a chainNum() normalizer (handles
hex string, decimal string, and number) in both the sendTx guard and ensureChain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-08 11:51:42 -05:00
parent 2cc21457bd
commit 8be30bef13
3 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -439,7 +439,7 @@
</section>
<script src="/assets/common.js?v=20260908c"></script>
<script src="/assets/wallet.js?v=20260908q"></script>
<script src="/assets/wallet.js?v=20260908r"></script>
<script src="/assets/home.js?v=20260906m"></script>
<script src="/assets/chat.js?v=20260906m"></script>
</body>