From 25770c3842934612edf47f1bac1c8cd16962ea4d Mon Sep 17 00:00:00 2001 From: William Kennedy Date: Fri, 4 Oct 2024 11:26:41 -0400 Subject: [PATCH] fixing metamask code --- app/services/ui/website/index.html | 2 +- app/services/ui/website/scripts/backend/wallet.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/services/ui/website/index.html b/app/services/ui/website/index.html index 06886e79..0d64ebed 100644 --- a/app/services/ui/website/index.html +++ b/app/services/ui/website/index.html @@ -16,4 +16,4 @@

- \ No newline at end of file + diff --git a/app/services/ui/website/scripts/backend/wallet.js b/app/services/ui/website/scripts/backend/wallet.js index 2aeb500b..eb70c65f 100644 --- a/app/services/ui/website/scripts/backend/wallet.js +++ b/app/services/ui/website/scripts/backend/wallet.js @@ -4,7 +4,7 @@ const sdk = new MetaMaskSDK.MetaMaskSDK({ url: 'http://' + window.location.host, }, logging: { - sdk: false, + sdk: true, }, }); @@ -92,7 +92,7 @@ export default Wallet; function parseError(e) { switch (true) { case 'message' in e: - return e.message; + return e.ReferenceError; } return 'no error field identified'; @@ -124,12 +124,7 @@ function toUTF8Array(str) { // subtracting 0x10000 and splitting the // 20 bits of 0x0-0xFFFFF into two halves charcode = 0x10000 + (((charcode & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff)); - utf8.push( - 0xf0 | (charcode >> 18), - 0x80 | ((charcode >> 12) & 0x3f), - 0x80 | ((charcode >> 6) & 0x3f), - 0x80 | (charcode & 0x3f) - ); + utf8.push(0xf0 | (charcode >> 18), 0x80 | ((charcode >> 12) & 0x3f), 0x80 | ((charcode >> 6) & 0x3f), 0x80 | (charcode & 0x3f)); } }