From 17bea9f1ac756443cdf0cccb9e9bdb11c2ff8b08 Mon Sep 17 00:00:00 2001 From: RanaBug Date: Thu, 26 Sep 2024 12:16:42 +0100 Subject: [PATCH 1/2] fix metamask login overrides --- package-lock.json | 396 +++++++++++++++----------------- src/apps/sign-message/index.tsx | 2 +- src/containers/Main.tsx | 32 ++- 3 files changed, 208 insertions(+), 222 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e73753b..7a12b35d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7683,6 +7683,11 @@ "version": "0.7.5", "license": "MIT" }, + "node_modules/@privy-io/react-auth/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + }, "node_modules/@privy-io/react-auth/node_modules/dotenv": { "version": "16.3.1", "license": "BSD-2-Clause", @@ -7742,6 +7747,23 @@ "node": ">=4" } }, + "node_modules/@privy-io/react-auth/node_modules/web3-core": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.4.tgz", + "integrity": "sha512-B6elffYm81MYZDTrat7aEhnhdtVE3lDBUZft16Z8awYMZYJDbnykEbJVS+l3mnA7AQTnSDr/1MjWofGDLBJPww==", + "dependencies": { + "@types/bn.js": "^5.1.1", + "@types/node": "^12.12.6", + "bignumber.js": "^9.0.0", + "web3-core-helpers": "1.10.4", + "web3-core-method": "1.10.4", + "web3-core-requestmanager": "1.10.4", + "web3-utils": "1.10.4" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -8731,25 +8753,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@solana/web3.js/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/@solana/web3.js/node_modules/superstruct": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", @@ -8758,25 +8761,6 @@ "node": ">=14.0.0" } }, - "node_modules/@solana/web3.js/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/@solana/web3.js/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/@solana/web3.js/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/@stablelib/aead": { "version": "1.0.1", "license": "MIT" @@ -10993,7 +10977,8 @@ }, "node_modules/abortcontroller-polyfill": { "version": "1.7.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", + "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" }, "node_modules/abstract-level": { "version": "1.0.4", @@ -13311,40 +13296,6 @@ "node-fetch": "^2.6.12" } }, - "node_modules/cross-fetch/node_modules/node-fetch": { - "version": "2.7.0", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/cross-fetch/node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, - "node_modules/cross-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "node_modules/cross-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "license": "MIT", @@ -13769,11 +13720,15 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/d": { - "version": "1.0.1", - "license": "ISC", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" + "es5-ext": "^0.10.64", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/damerau-levenshtein": { @@ -14638,12 +14593,14 @@ } }, "node_modules/es5-ext": { - "version": "0.10.62", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "hasInstallScript": true, - "license": "ISC", "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", "next-tick": "^1.1.0" }, "engines": { @@ -14652,7 +14609,8 @@ }, "node_modules/es6-iterator": { "version": "2.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "dependencies": { "d": "1", "es5-ext": "^0.10.35", @@ -14672,11 +14630,15 @@ } }, "node_modules/es6-symbol": { - "version": "3.1.3", - "license": "ISC", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", + "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" + "d": "^1.0.2", + "ext": "^1.7.0" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/escalade": { @@ -15629,6 +15591,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -15948,6 +15924,15 @@ "npm": ">=3" } }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "node_modules/event-target-shim": { "version": "5.0.1", "license": "MIT", @@ -16099,15 +16084,12 @@ }, "node_modules/ext": { "version": "1.7.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", "dependencies": { "type": "^2.7.2" } }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "license": "ISC" - }, "node_modules/extract-files": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-9.0.0.tgz", @@ -17709,7 +17691,8 @@ }, "node_modules/http-https": { "version": "1.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg==" }, "node_modules/http-parser-js": { "version": "0.5.8", @@ -22267,7 +22250,8 @@ }, "node_modules/next-tick": { "version": "1.1.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" }, "node_modules/no-case": { "version": "3.0.4", @@ -22294,8 +22278,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.7", - "license": "MIT", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -22564,7 +22549,8 @@ }, "node_modules/oboe": { "version": "2.1.5", - "license": "BSD", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.5.tgz", + "integrity": "sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==", "dependencies": { "http-https": "^1.0.0" } @@ -29108,8 +29094,9 @@ "license": "Unlicense" }, "node_modules/type": { - "version": "1.2.0", - "license": "ISC" + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==" }, "node_modules/type-check": { "version": "0.4.0", @@ -29584,7 +29571,8 @@ }, "node_modules/util": { "version": "0.12.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -29841,50 +29829,37 @@ "minimalistic-assert": "^1.0.0" } }, - "node_modules/web3-core": { - "version": "1.10.3", - "license": "LGPL-3.0", - "dependencies": { - "@types/bn.js": "^5.1.1", - "@types/node": "^12.12.6", - "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-requestmanager": "1.10.3", - "web3-utils": "1.10.3" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/web3-core-helpers": { - "version": "1.10.3", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.4.tgz", + "integrity": "sha512-r+L5ylA17JlD1vwS8rjhWr0qg7zVoVMDvWhajWA5r5+USdh91jRUYosp19Kd1m2vE034v7Dfqe1xYRoH2zvG0g==", "dependencies": { - "web3-eth-iban": "1.10.3", - "web3-utils": "1.10.3" + "web3-eth-iban": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-method": { - "version": "1.10.3", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.10.4.tgz", + "integrity": "sha512-uZTb7flr+Xl6LaDsyTeE2L1TylokCJwTDrIVfIfnrGmnwLc6bmTWCCrm71sSrQ0hqs6vp/MKbQYIYqUN0J8WyA==", "dependencies": { "@ethersproject/transactions": "^5.6.2", - "web3-core-helpers": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-utils": "1.10.3" + "web3-core-helpers": "1.10.4", + "web3-core-promievent": "1.10.4", + "web3-core-subscriptions": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-promievent": { - "version": "1.10.3", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.10.4.tgz", + "integrity": "sha512-2de5WnJQ72YcIhYwV/jHLc4/cWJnznuoGTJGD29ncFQHAfwW/MItHFSVKPPA5v8AhJe+r6y4Y12EKvZKjQVBvQ==", "dependencies": { "eventemitter3": "4.0.4" }, @@ -29894,136 +29869,109 @@ }, "node_modules/web3-core-promievent/node_modules/eventemitter3": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" }, "node_modules/web3-core-requestmanager": { - "version": "1.10.3", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.4.tgz", + "integrity": "sha512-vqP6pKH8RrhT/2MoaU+DY/OsYK9h7HmEBNCdoMj+4ZwujQtw/Mq2JifjwsJ7gits7Q+HWJwx8q6WmQoVZAWugg==", "dependencies": { "util": "^0.12.5", - "web3-core-helpers": "1.10.3", - "web3-providers-http": "1.10.3", - "web3-providers-ipc": "1.10.3", - "web3-providers-ws": "1.10.3" + "web3-core-helpers": "1.10.4", + "web3-providers-http": "1.10.4", + "web3-providers-ipc": "1.10.4", + "web3-providers-ws": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, - "node_modules/web3-core-subscriptions": { - "version": "1.10.3", - "license": "LGPL-3.0", + "node_modules/web3-core-requestmanager/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", "dependencies": { - "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.3" - }, - "engines": { - "node": ">=8.0.0" + "node-fetch": "^2.6.12" } }, - "node_modules/web3-core-subscriptions/node_modules/eventemitter3": { + "node_modules/web3-core-requestmanager/node_modules/eventemitter3": { "version": "4.0.4", - "license": "MIT" - }, - "node_modules/web3-core/node_modules/@types/node": { - "version": "12.20.55", - "license": "MIT" - }, - "node_modules/web3-eth-iban": { - "version": "1.10.3", - "license": "LGPL-3.0", - "dependencies": { - "bn.js": "^5.2.1", - "web3-utils": "1.10.3" - }, - "engines": { - "node": ">=8.0.0" - } + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" }, - "node_modules/web3-providers-http": { - "version": "1.10.3", - "license": "LGPL-3.0", + "node_modules/web3-core-requestmanager/node_modules/web3-providers-http": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.10.4.tgz", + "integrity": "sha512-m2P5Idc8hdiO0l60O6DSCPw0kw64Zgi0pMjbEFRmxKIck2Py57RQMu4bxvkxJwkF06SlGaEQF8rFZBmuX7aagQ==", "dependencies": { "abortcontroller-polyfill": "^1.7.5", "cross-fetch": "^4.0.0", "es6-promise": "^4.2.8", - "web3-core-helpers": "1.10.3" + "web3-core-helpers": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, - "node_modules/web3-providers-http/node_modules/cross-fetch": { - "version": "4.0.0", - "license": "MIT", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "node_modules/web3-providers-http/node_modules/node-fetch": { - "version": "2.7.0", - "license": "MIT", + "node_modules/web3-core-requestmanager/node_modules/web3-providers-ipc": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.10.4.tgz", + "integrity": "sha512-YRF/bpQk9z3WwjT+A6FI/GmWRCASgd+gC0si7f9zbBWLXjwzYAKG73bQBaFRAHex1hl4CVcM5WUMaQXf3Opeuw==", "dependencies": { - "whatwg-url": "^5.0.0" + "oboe": "2.1.5", + "web3-core-helpers": "1.10.4" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/web3-providers-http/node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, - "node_modules/web3-providers-http/node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "node_modules/web3-providers-http/node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "node": ">=8.0.0" } }, - "node_modules/web3-providers-ipc": { - "version": "1.10.3", - "license": "LGPL-3.0", + "node_modules/web3-core-requestmanager/node_modules/web3-providers-ws": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.10.4.tgz", + "integrity": "sha512-j3FBMifyuFFmUIPVQR4pj+t5ILhAexAui0opgcpu9R5LxQrLRUZxHSnU+YO25UycSOa/NAX8A+qkqZNpcFAlxA==", "dependencies": { - "oboe": "2.1.5", - "web3-core-helpers": "1.10.3" + "eventemitter3": "4.0.4", + "web3-core-helpers": "1.10.4", + "websocket": "^1.0.32" }, "engines": { "node": ">=8.0.0" } }, - "node_modules/web3-providers-ws": { - "version": "1.10.3", - "license": "LGPL-3.0", + "node_modules/web3-core-subscriptions": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.4.tgz", + "integrity": "sha512-o0lSQo/N/f7/L76C0HV63+S54loXiE9fUPfHFcTtpJRQNDBVsSDdWRdePbWwR206XlsBqD5VHApck1//jEafTw==", "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.3", - "websocket": "^1.0.32" + "web3-core-helpers": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, - "node_modules/web3-providers-ws/node_modules/eventemitter3": { + "node_modules/web3-core-subscriptions/node_modules/eventemitter3": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" + }, + "node_modules/web3-eth-iban": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.4.tgz", + "integrity": "sha512-0gE5iNmOkmtBmbKH2aTodeompnNE8jEyvwFJ6s/AF6jkw9ky9Op9cqfzS56AYAbrqEFuClsqB/AoRves7LDELw==", + "dependencies": { + "bn.js": "^5.2.1", + "web3-utils": "1.10.4" + }, + "engines": { + "node": ">=8.0.0" + } }, "node_modules/web3-utils": { - "version": "1.10.3", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", + "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", "dependencies": { "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", @@ -30381,12 +30329,13 @@ } }, "node_modules/websocket": { - "version": "1.0.34", - "license": "Apache-2.0", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.35.tgz", + "integrity": "sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q==", "dependencies": { "bufferutil": "^4.0.1", "debug": "^2.2.0", - "es5-ext": "^0.10.50", + "es5-ext": "^0.10.63", "typedarray-to-buffer": "^3.1.5", "utf-8-validate": "^5.0.2", "yaeti": "^0.0.6" @@ -30416,14 +30365,16 @@ }, "node_modules/websocket/node_modules/debug": { "version": "2.6.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dependencies": { "ms": "2.0.0" } }, "node_modules/websocket/node_modules/ms": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/whatwg-encoding": { "version": "2.0.0", @@ -30933,7 +30884,8 @@ }, "node_modules/yaeti": { "version": "0.0.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", "engines": { "node": ">=0.10.32" } @@ -31030,6 +30982,16 @@ "dependencies": { "zen-observable": "0.8.15" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "optional": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/src/apps/sign-message/index.tsx b/src/apps/sign-message/index.tsx index e5ae9d11..b05c5b68 100644 --- a/src/apps/sign-message/index.tsx +++ b/src/apps/sign-message/index.tsx @@ -1,6 +1,6 @@ +import { useWallets } from '@privy-io/react-auth'; import React, { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; -import { useWallets } from '@privy-io/react-auth'; import styled from 'styled-components'; // components diff --git a/src/containers/Main.tsx b/src/containers/Main.tsx index 30fd3c15..10fc99c4 100644 --- a/src/containers/Main.tsx +++ b/src/containers/Main.tsx @@ -71,22 +71,45 @@ const AuthLayout = () => { */ useEffect(() => { let expired = false; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let privyEthereumProvider: any; + let timer: NodeJS.Timeout; const updateProvider = async () => { if (!wallets.length) return; // not yet ready - const privyEthereumProvider = await wallets[0].getWeb3jsProvider(); + // if there is only one wallet detectable by privy, it picks it + if (wallets.length === 1) { + privyEthereumProvider = await wallets[0].getWeb3jsProvider(); + } + + // if there are multiple wallets, we try to find the privy one, and if not we pick the first one in the list + if (wallets.length > 1) { + const privyWallet = wallets.find( + (wallet) => wallet.walletClientType === 'privy' + ); + if (privyWallet) { + privyEthereumProvider = await privyWallet.getWeb3jsProvider(); + } + if (!privyWallet) { + privyEthereumProvider = await wallets[0].getWeb3jsProvider(); + } + } - // TODO: fix provider types by either updating @etherspot/prime-sdk or @etherspot/transaction-kit const newProvider = new Web3eip1193WalletProvider( - // @ts-expect-error: provider type mismatch privyEthereumProvider.walletProvider ); await newProvider.refresh(); if (expired) return; - setProvider(newProvider); + // We set a timer here because it takes less than a 500ms for privy to fetch all wallets + // that are embedded or injected into privy. This timing is what could make the wrong + // provider to be chosen by Etherspot + timer = setTimeout(() => { + setProvider(newProvider); + }, 500); + const walletChainId = +wallets[0].chainId.split(':')[1]; // extract from CAIP-2 const isWithinVisibleChains = visibleChains.some( (chain) => chain.id === walletChainId @@ -102,6 +125,7 @@ const AuthLayout = () => { return () => { expired = true; + clearTimeout(timer); }; }, [wallets]); From 0532f22652cc29f9da6d2dfd4cba107090ae392d Mon Sep 17 00:00:00 2001 From: RanaBug Date: Fri, 27 Sep 2024 16:56:51 +0100 Subject: [PATCH 2/2] fix overrides of several connected wallets --- package-lock.json | 101 ++-- .../DisplayCollectionImage.test.tsx.snap | 462 ++---------------- src/containers/Main.tsx | 55 +-- .../__snapshots__/Main.test.tsx.snap | 92 ++-- 4 files changed, 160 insertions(+), 550 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a12b35d..0f3950e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2891,13 +2891,16 @@ }, "node_modules/@etherspot/eip1271-verification-util": { "version": "0.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@etherspot/eip1271-verification-util/-/eip1271-verification-util-0.1.2.tgz", + "integrity": "sha512-pgmhYPEfOYO6FJVMhnSSzq6hO3zrhZd5pZ+JeaHA2PgBJT8+9oNS+o5xcKuVA/VZIkL6x3j4towbqUUaYw0j2A==", "dependencies": { "ethers": "5.6.9" } }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/abi": { "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.4.tgz", + "integrity": "sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg==", "funding": [ { "type": "individual", @@ -2908,7 +2911,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/address": "^5.6.1", "@ethersproject/bignumber": "^5.6.2", @@ -2923,6 +2925,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/abstract-provider": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz", + "integrity": "sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ==", "funding": [ { "type": "individual", @@ -2933,7 +2937,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.2", "@ethersproject/bytes": "^5.6.1", @@ -2946,6 +2949,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/abstract-signer": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz", + "integrity": "sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ==", "funding": [ { "type": "individual", @@ -2956,7 +2961,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abstract-provider": "^5.6.1", "@ethersproject/bignumber": "^5.6.2", @@ -2967,6 +2971,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/address": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", + "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", "funding": [ { "type": "individual", @@ -2977,7 +2983,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.2", "@ethersproject/bytes": "^5.6.1", @@ -2988,6 +2993,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/base64": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.1.tgz", + "integrity": "sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw==", "funding": [ { "type": "individual", @@ -2998,13 +3005,14 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1" } }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/basex": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.1.tgz", + "integrity": "sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA==", "funding": [ { "type": "individual", @@ -3015,7 +3023,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/properties": "^5.6.0" @@ -3023,6 +3030,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/bignumber": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.2.tgz", + "integrity": "sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw==", "funding": [ { "type": "individual", @@ -3033,7 +3042,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/logger": "^5.6.0", @@ -3042,6 +3050,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/bytes": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "funding": [ { "type": "individual", @@ -3052,13 +3062,14 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/logger": "^5.6.0" } }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/constants": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.1.tgz", + "integrity": "sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg==", "funding": [ { "type": "individual", @@ -3069,13 +3080,14 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.2" } }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/contracts": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.2.tgz", + "integrity": "sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g==", "funding": [ { "type": "individual", @@ -3086,7 +3098,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abi": "^5.6.3", "@ethersproject/abstract-provider": "^5.6.1", @@ -3102,6 +3113,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/hash": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", + "integrity": "sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA==", "funding": [ { "type": "individual", @@ -3112,7 +3125,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abstract-signer": "^5.6.2", "@ethersproject/address": "^5.6.1", @@ -3126,6 +3138,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/hdnode": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.2.tgz", + "integrity": "sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q==", "funding": [ { "type": "individual", @@ -3136,7 +3150,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abstract-signer": "^5.6.2", "@ethersproject/basex": "^5.6.1", @@ -3154,6 +3167,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/json-wallets": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz", + "integrity": "sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ==", "funding": [ { "type": "individual", @@ -3164,7 +3179,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abstract-signer": "^5.6.2", "@ethersproject/address": "^5.6.1", @@ -3183,6 +3197,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/keccak256": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.1.tgz", + "integrity": "sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA==", "funding": [ { "type": "individual", @@ -3193,7 +3209,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "js-sha3": "0.8.0" @@ -3201,6 +3216,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/logger": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "funding": [ { "type": "individual", @@ -3210,11 +3227,12 @@ "type": "individual", "url": "https://www.buymeacoffee.com/ricmoo" } - ], - "license": "MIT" + ] }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/networks": { "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.4.tgz", + "integrity": "sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ==", "funding": [ { "type": "individual", @@ -3225,13 +3243,14 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/logger": "^5.6.0" } }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/pbkdf2": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz", + "integrity": "sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ==", "funding": [ { "type": "individual", @@ -3242,7 +3261,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/sha2": "^5.6.1" @@ -3250,6 +3268,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/properties": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "funding": [ { "type": "individual", @@ -3260,13 +3280,14 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/logger": "^5.6.0" } }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/providers": { "version": "5.6.8", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.8.tgz", + "integrity": "sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w==", "funding": [ { "type": "individual", @@ -3277,7 +3298,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abstract-provider": "^5.6.1", "@ethersproject/abstract-signer": "^5.6.2", @@ -3303,6 +3323,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/random": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.1.tgz", + "integrity": "sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA==", "funding": [ { "type": "individual", @@ -3313,7 +3335,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/logger": "^5.6.0" @@ -3321,6 +3342,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/rlp": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.1.tgz", + "integrity": "sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ==", "funding": [ { "type": "individual", @@ -3331,7 +3354,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/logger": "^5.6.0" @@ -3339,6 +3361,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/sha2": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.1.tgz", + "integrity": "sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g==", "funding": [ { "type": "individual", @@ -3349,7 +3373,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/logger": "^5.6.0", @@ -3358,6 +3381,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/signing-key": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.2.tgz", + "integrity": "sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ==", "funding": [ { "type": "individual", @@ -3368,7 +3393,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/logger": "^5.6.0", @@ -3380,6 +3404,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/solidity": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.1.tgz", + "integrity": "sha512-KWqVLkUUoLBfL1iwdzUVlkNqAUIFMpbbeH0rgCfKmJp0vFtY4AsaN91gHKo9ZZLkC4UOm3cI3BmMV4N53BOq4g==", "funding": [ { "type": "individual", @@ -3390,7 +3416,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.2", "@ethersproject/bytes": "^5.6.1", @@ -3402,6 +3427,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/strings": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.1.tgz", + "integrity": "sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw==", "funding": [ { "type": "individual", @@ -3412,7 +3439,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/constants": "^5.6.1", @@ -3421,6 +3447,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/transactions": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.2.tgz", + "integrity": "sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q==", "funding": [ { "type": "individual", @@ -3431,7 +3459,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/address": "^5.6.1", "@ethersproject/bignumber": "^5.6.2", @@ -3446,6 +3473,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/units": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.1.tgz", + "integrity": "sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw==", "funding": [ { "type": "individual", @@ -3456,7 +3485,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bignumber": "^5.6.2", "@ethersproject/constants": "^5.6.1", @@ -3465,6 +3493,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/wallet": { "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.2.tgz", + "integrity": "sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg==", "funding": [ { "type": "individual", @@ -3475,7 +3505,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abstract-provider": "^5.6.1", "@ethersproject/abstract-signer": "^5.6.2", @@ -3496,6 +3525,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/web": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.1.tgz", + "integrity": "sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA==", "funding": [ { "type": "individual", @@ -3506,7 +3537,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/base64": "^5.6.1", "@ethersproject/bytes": "^5.6.1", @@ -3517,6 +3547,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/@ethersproject/wordlists": { "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.1.tgz", + "integrity": "sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw==", "funding": [ { "type": "individual", @@ -3527,7 +3559,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.6.1", "@ethersproject/hash": "^5.6.1", @@ -3538,6 +3569,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/ethers": { "version": "5.6.9", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.9.tgz", + "integrity": "sha512-lMGC2zv9HC5EC+8r429WaWu3uWJUCgUCt8xxKCFqkrFuBDZXDYIdzDUECxzjf2BMF8IVBByY1EBoGSL3RTm8RA==", "funding": [ { "type": "individual", @@ -3548,7 +3581,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@ethersproject/abi": "5.6.4", "@ethersproject/abstract-provider": "5.6.1", @@ -3584,7 +3616,8 @@ }, "node_modules/@etherspot/eip1271-verification-util/node_modules/ws": { "version": "7.4.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "engines": { "node": ">=8.3.0" }, diff --git a/src/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/DisplayCollectionImage.test.tsx.snap b/src/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/DisplayCollectionImage.test.tsx.snap index 723a3282..c6cf8ad1 100644 --- a/src/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/DisplayCollectionImage.test.tsx.snap +++ b/src/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/DisplayCollectionImage.test.tsx.snap @@ -29,7 +29,6 @@ exports[` renders correctly and matches snapshot witho renders correctly and matches snapshot witho - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + `; diff --git a/src/containers/Main.tsx b/src/containers/Main.tsx index 10fc99c4..9e266c49 100644 --- a/src/containers/Main.tsx +++ b/src/containers/Main.tsx @@ -51,7 +51,7 @@ const AuthLayout = () => { * we will need to determine what authentication * state the user is in. */ - const { ready, authenticated } = usePrivy(); + const { ready, authenticated, user } = usePrivy(); const { wallets } = useWallets(); const [provider, setProvider] = useState( undefined @@ -70,45 +70,29 @@ const AuthLayout = () => { * state. */ useEffect(() => { - let expired = false; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let privyEthereumProvider: any; - let timer: NodeJS.Timeout; + if (!wallets.length) return; const updateProvider = async () => { - if (!wallets.length) return; // not yet ready + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let privyEthereumProvider: any; - // if there is only one wallet detectable by privy, it picks it - if (wallets.length === 1) { - privyEthereumProvider = await wallets[0].getWeb3jsProvider(); - } + const privyWalletAddress = user?.wallet?.address; - // if there are multiple wallets, we try to find the privy one, and if not we pick the first one in the list - if (wallets.length > 1) { - const privyWallet = wallets.find( - (wallet) => wallet.walletClientType === 'privy' - ); - if (privyWallet) { - privyEthereumProvider = await privyWallet.getWeb3jsProvider(); - } - if (!privyWallet) { - privyEthereumProvider = await wallets[0].getWeb3jsProvider(); - } - } - - const newProvider = new Web3eip1193WalletProvider( - privyEthereumProvider.walletProvider + const walletProvider = wallets.find( + (wallet) => wallet.address === privyWalletAddress ); - await newProvider.refresh(); - if (expired) return; + if (walletProvider) { + privyEthereumProvider = await walletProvider.getWeb3jsProvider(); + + const newProvider = new Web3eip1193WalletProvider( + privyEthereumProvider.walletProvider + ); + + await newProvider.refresh(); - // We set a timer here because it takes less than a 500ms for privy to fetch all wallets - // that are embedded or injected into privy. This timing is what could make the wrong - // provider to be chosen by Etherspot - timer = setTimeout(() => { setProvider(newProvider); - }, 500); + } const walletChainId = +wallets[0].chainId.split(':')[1]; // extract from CAIP-2 const isWithinVisibleChains = visibleChains.some( @@ -122,12 +106,7 @@ const AuthLayout = () => { }; updateProvider(); - - return () => { - expired = true; - clearTimeout(timer); - }; - }, [wallets]); + }, [wallets, user]); /** * If all the following variables are truthy within the if diff --git a/src/containers/__snapshots__/Main.test.tsx.snap b/src/containers/__snapshots__/Main.test.tsx.snap index 6ae5b03b..f5debbde 100644 --- a/src/containers/__snapshots__/Main.test.tsx.snap +++ b/src/containers/__snapshots__/Main.test.tsx.snap @@ -6,37 +6,13 @@ exports[`
renders correctly 1`] = ` className="header " id="header" > -
-
-

- 🚀 Secure Your Spot in the PillarX Testing Campaign! - - - Join the Waitlist - -

- - - Join the Waitlist - - -
-
, +
+
+
+
+

+ What is PX? +

+

+ PillarX is the next evolution in the Pillar Project story, built on the pillars of controlling your assets and data, PillarX will provide an unparalleled experience in interacting with the Web3 ecosystem. +

+ PillarX Dashboard +
+
+
+
,
@@ -436,6 +425,5 @@ exports[`
renders correctly 1`] = ` , -
, ] `;