From 9e2bbeadba4abeda6b55142e92b220236404fed1 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Mon, 16 Dec 2024 15:44:37 +0100 Subject: [PATCH] fix: wip: agw --- lib/hooks/ethereum/EthereumProvider.tsx | 2 + package.json | 9 +- yarn.lock | 331 +++++++++++++++++++++++- 3 files changed, 331 insertions(+), 11 deletions(-) diff --git a/lib/hooks/ethereum/EthereumProvider.tsx b/lib/hooks/ethereum/EthereumProvider.tsx index 512c6937..8baf5944 100644 --- a/lib/hooks/ethereum/EthereumProvider.tsx +++ b/lib/hooks/ethereum/EthereumProvider.tsx @@ -1,5 +1,6 @@ 'use client'; +import { abstractWalletConnector } from '@abstract-foundation/agw-react/connectors'; import { useCsrRouter } from 'lib/i18n/csr-navigation'; import { usePathname } from 'lib/i18n/navigation'; import { ORDERED_CHAINS, createViemPublicClientForChain, getViemChainConfig } from 'lib/utils/chains'; @@ -26,6 +27,7 @@ export const connectors = [ }, }), coinbaseWallet({ appName: 'Revoke.cash' }), + abstractWalletConnector(), ]; export const wagmiConfig = createConfig({ diff --git a/package.json b/package.json index e877a23e..2c36537b 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,13 @@ }, "private": true, "dependencies": { + "@abstract-foundation/agw-client": "^0.0.1-beta.22", + "@abstract-foundation/agw-react": "^0.0.1-beta.22", "@dotenvx/dotenvx": "^1.14.2", "@headlessui/react": "^2.1.2", "@heroicons/react": "^2.1.5", "@neondatabase/serverless": "^0.10.1", + "@privy-io/cross-app-connect": "^0.0.8", "@revoke.cash/chains": "^56.0.0", "@tanstack/query-sync-storage-persister": "^5.52.0", "@tanstack/react-query": "^5.52.0", @@ -77,6 +80,7 @@ "@cypress/grep": "^4.1.0", "@lavamoat/allow-scripts": "^3.2.0", "@localazy/cli": "^1.7.14", + "@rainbow-me/rainbowkit": "^2.2.1", "@tailwindcss/typography": "^0.5.14", "@types/md5": "^2.3.5", "@types/mixpanel-browser": "^2.49.1", @@ -111,6 +115,8 @@ "lavamoat": { "allowScripts": { "$root$": true, + "@abstract-foundation/agw-react>secp256k1": false, + "@biomejs/biome": true, "@vercel/speed-insights": false, "cypress": true, "sharp": true, @@ -118,8 +124,7 @@ "viem>ws>bufferutil": true, "viem>ws>utf-8-validate": true, "wagmi>@wagmi/connectors>cbw-sdk>keccak": false, - "wagmi>@wagmi/connectors>@metamask/sdk>eciesjs>secp256k1": false, - "@biomejs/biome": true + "wagmi>@wagmi/connectors>@metamask/sdk>eciesjs>secp256k1": false } }, "mocha": { diff --git a/yarn.lock b/yarn.lock index b898e399..ac4e5ed6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,43 @@ __metadata: version: 6 cacheKey: 8 +"@abstract-foundation/agw-client@npm:^0.0.1-beta.22": + version: 0.0.1-beta.22 + resolution: "@abstract-foundation/agw-client@npm:0.0.1-beta.22" + peerDependencies: + abitype: ^1.0.0 + typescript: ">=5.0.4" + viem: ^2.21.26 + peerDependenciesMeta: + typescript: + optional: true + checksum: 1d4207965fe824c7af941d817cdee8cd1a8662a3a2c3fb687f74e8c82dbb41ffca71d308fc3283acdbdd350fea60c462f559860dcb4790acca7d527abb93805d + languageName: node + linkType: hard + +"@abstract-foundation/agw-react@npm:^0.0.1-beta.22": + version: 0.0.1-beta.22 + resolution: "@abstract-foundation/agw-react@npm:0.0.1-beta.22" + peerDependencies: + "@abstract-foundation/agw-client": ^0.0.1-beta.22 + "@privy-io/cross-app-connect": ^0.0.8 + "@privy-io/react-auth": ^1.95.2 + "@tanstack/react-query": ^5 + react: ">=18" + secp256k1: ">=5.0.1" + thirdweb: ^5.68.0 + typescript: ">=5.0.4" + viem: ^2.21.26 + wagmi: ^2 + peerDependenciesMeta: + thirdweb: + optional: true + typescript: + optional: true + checksum: 4d4180b65ced4d585b04a32ff346f81b85d595a0eb8e48ed07567db40408edc2921116bcf4ca393a8fbc40589ca196b9a89437f94d6fe6437348cc91a594b03e + languageName: node + linkType: hard + "@adraffy/ens-normalize@npm:1.10.0": version: 1.10.0 resolution: "@adraffy/ens-normalize@npm:1.10.0" @@ -588,6 +625,13 @@ __metadata: languageName: node linkType: hard +"@emotion/hash@npm:^0.9.0": + version: 0.9.2 + resolution: "@emotion/hash@npm:0.9.2" + checksum: 379bde2830ccb0328c2617ec009642321c0e009a46aa383dfbe75b679c6aea977ca698c832d225a893901f29d7b3eef0e38cf341f560f6b2b56f1ff23c172387 + languageName: node + linkType: hard + "@emotion/hash@npm:^0.9.1": version: 0.9.1 resolution: "@emotion/hash@npm:0.9.1" @@ -1734,7 +1778,7 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:^1.6.0": +"@noble/curves@npm:^1.5.0, @noble/curves@npm:^1.6.0": version: 1.7.0 resolution: "@noble/curves@npm:1.7.0" dependencies: @@ -1743,6 +1787,13 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:1.3.2": + version: 1.3.2 + resolution: "@noble/hashes@npm:1.3.2" + checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 + languageName: node + linkType: hard + "@noble/hashes@npm:1.4.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:~1.4.0": version: 1.4.0 resolution: "@noble/hashes@npm:1.4.0" @@ -2048,6 +2099,45 @@ __metadata: languageName: node linkType: hard +"@privy-io/cross-app-connect@npm:^0.0.8": + version: 0.0.8 + resolution: "@privy-io/cross-app-connect@npm:0.0.8" + dependencies: + "@noble/curves": ^1.5.0 + "@noble/hashes": 1.3.2 + "@scure/base": ~1.1.2 + peerDependencies: + "@rainbow-me/rainbowkit": ^2.1.5 + "@wagmi/core": ^2.13.4 + viem: ^2.21.3 + peerDependenciesMeta: + "@rainbow-me/rainbowkit": + optional: true + checksum: 5b153ba80d51c725c6193e3f2fef897f59dc85f2255211f5f08bd348b5d7e9e7be6d748365fdf5742c4a25c6f65cdf306667e2a5b162ee2e2828dc6c4bbbe477 + languageName: node + linkType: hard + +"@rainbow-me/rainbowkit@npm:^2.2.1": + version: 2.2.1 + resolution: "@rainbow-me/rainbowkit@npm:2.2.1" + dependencies: + "@vanilla-extract/css": 1.15.5 + "@vanilla-extract/dynamic": 2.1.2 + "@vanilla-extract/sprinkles": 1.6.3 + clsx: 2.1.1 + qrcode: 1.5.4 + react-remove-scroll: 2.6.0 + ua-parser-js: ^1.0.37 + peerDependencies: + "@tanstack/react-query": ">=5.0.0" + react: ">=18" + react-dom: ">=18" + viem: 2.x + wagmi: ^2.9.0 + checksum: 0647344590fe2970b2d0446b08a4b4d29af015992df0e8da47c17388fd7e8d1334d3a7aae4e574306950bb0ce51faef11d8713ed557e04d8bd92627938d91915 + languageName: node + linkType: hard + "@react-aria/focus@npm:^3.17.1": version: 3.18.2 resolution: "@react-aria/focus@npm:3.18.2" @@ -2173,6 +2263,13 @@ __metadata: languageName: node linkType: hard +"@scure/base@npm:~1.1.2": + version: 1.1.9 + resolution: "@scure/base@npm:1.1.9" + checksum: 120820a37dfe9dfe4cab2b7b7460552d08e67dee8057ed5354eb68d8e3440890ae983ce3bee957d2b45684950b454a2b6d71d5ee77c1fd3fddc022e2a510337f + languageName: node + linkType: hard + "@scure/bip32@npm:1.4.0": version: 1.4.0 resolution: "@scure/bip32@npm:1.4.0" @@ -2795,6 +2892,51 @@ __metadata: languageName: node linkType: hard +"@vanilla-extract/css@npm:1.15.5": + version: 1.15.5 + resolution: "@vanilla-extract/css@npm:1.15.5" + dependencies: + "@emotion/hash": ^0.9.0 + "@vanilla-extract/private": ^1.0.6 + css-what: ^6.1.0 + cssesc: ^3.0.0 + csstype: ^3.0.7 + dedent: ^1.5.3 + deep-object-diff: ^1.1.9 + deepmerge: ^4.2.2 + lru-cache: ^10.4.3 + media-query-parser: ^2.0.2 + modern-ahocorasick: ^1.0.0 + picocolors: ^1.0.0 + checksum: 0c260e55a1648a827df74cae4475a1a61767e4ef3a7a3a299853ae3f77ed220d7a4b604737886140ea9e72a379eda4ee45b7349a4651cf3d5a4f2c8697448d6d + languageName: node + linkType: hard + +"@vanilla-extract/dynamic@npm:2.1.2": + version: 2.1.2 + resolution: "@vanilla-extract/dynamic@npm:2.1.2" + dependencies: + "@vanilla-extract/private": ^1.0.6 + checksum: ec6ec9b02c7ec8a9d60aebf63225fd3f930c06ad824321f03f683f1948eb6d4e554d934303da140b3230b4af2fa15bab494c6da2a3b9a172e4118c245b4f942a + languageName: node + linkType: hard + +"@vanilla-extract/private@npm:^1.0.6": + version: 1.0.6 + resolution: "@vanilla-extract/private@npm:1.0.6" + checksum: 2265b02af29d8cd40f6ddeeed197fb2df1a7695f5a9821d5e3597677179be8b83bcd8fe4df4a6178544f89123d745a3c6a13599d4fe4e5873b065a8ad329f690 + languageName: node + linkType: hard + +"@vanilla-extract/sprinkles@npm:1.6.3": + version: 1.6.3 + resolution: "@vanilla-extract/sprinkles@npm:1.6.3" + peerDependencies: + "@vanilla-extract/css": ^1.0.0 + checksum: 7eb4fe0f1a6048bf5ffb5ffab964c2d127ff95244da79dca2e448af380b591c7af3b4f63ab243584baa8a42c7694d8fe9eeb366587a2da381a481fe1a9e02af8 + languageName: node + linkType: hard + "@vercel/speed-insights@npm:^1.0.12": version: 1.0.12 resolution: "@vercel/speed-insights@npm:1.0.12" @@ -4091,6 +4233,13 @@ __metadata: languageName: node linkType: hard +"clsx@npm:2.1.1, clsx@npm:^2.0.0, clsx@npm:^2.1.0": + version: 2.1.1 + resolution: "clsx@npm:2.1.1" + checksum: acd3e1ab9d8a433ecb3cc2f6a05ab95fe50b4a3cfc5ba47abb6cbf3754585fcb87b84e90c822a1f256c4198e3b41c7f6c391577ffc8678ad587fc0976b24fd57 + languageName: node + linkType: hard + "clsx@npm:^1.2.1": version: 1.2.1 resolution: "clsx@npm:1.2.1" @@ -4098,13 +4247,6 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^2.0.0, clsx@npm:^2.1.0": - version: 2.1.1 - resolution: "clsx@npm:2.1.1" - checksum: acd3e1ab9d8a433ecb3cc2f6a05ab95fe50b4a3cfc5ba47abb6cbf3754585fcb87b84e90c822a1f256c4198e3b41c7f6c391577ffc8678ad587fc0976b24fd57 - languageName: node - linkType: hard - "cmd-shim@npm:^6.0.0": version: 6.0.3 resolution: "cmd-shim@npm:6.0.3" @@ -4427,6 +4569,13 @@ __metadata: languageName: node linkType: hard +"css-what@npm:^6.1.0": + version: 6.1.0 + resolution: "css-what@npm:6.1.0" + checksum: b975e547e1e90b79625918f84e67db5d33d896e6de846c9b584094e529f0c63e2ab85ee33b9daffd05bff3a146a1916bec664e18bb76dd5f66cbff9fc13b2bbe + languageName: node + linkType: hard + "cssesc@npm:^3.0.0": version: 3.0.0 resolution: "cssesc@npm:3.0.0" @@ -4436,7 +4585,7 @@ __metadata: languageName: node linkType: hard -"csstype@npm:^3.0.2": +"csstype@npm:^3.0.2, csstype@npm:^3.0.7": version: 3.1.3 resolution: "csstype@npm:3.1.3" checksum: 8db785cc92d259102725b3c694ec0c823f5619a84741b5c7991b8ad135dfaa66093038a1cc63e03361a6cd28d122be48f2106ae72334e067dd619a51f49eddf7 @@ -4585,6 +4734,18 @@ __metadata: languageName: node linkType: hard +"dedent@npm:^1.5.3": + version: 1.5.3 + resolution: "dedent@npm:1.5.3" + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: 045b595557b2a8ea2eb9b0b4623d764e9a87326486fe2b61191b4342ed93dc01245644d8a09f3108a50c0ee7965f1eedd92e4a3a503ed89ea8e810566ea27f9a + languageName: node + linkType: hard + "deep-eql@npm:^5.0.1": version: 5.0.2 resolution: "deep-eql@npm:5.0.2" @@ -4592,6 +4753,20 @@ __metadata: languageName: node linkType: hard +"deep-object-diff@npm:^1.1.9": + version: 1.1.9 + resolution: "deep-object-diff@npm:1.1.9" + checksum: ecd42455e4773f653595d28070295e7aaa8402db5f8ab21d0bec115a7cb4de5e207a5665514767da5f025c96597f1d3a0a4888aeb4dd49e03c996871a3aa05ef + languageName: node + linkType: hard + +"deepmerge@npm:^4.2.2": + version: 4.3.1 + resolution: "deepmerge@npm:4.3.1" + checksum: 2024c6a980a1b7128084170c4cf56b0fd58a63f2da1660dcfe977415f27b17dbe5888668b59d0b063753f3220719d5e400b7f113609489c90160bb9a5518d052 + languageName: node + linkType: hard + "define-data-property@npm:^1.1.4": version: 1.1.4 resolution: "define-data-property@npm:1.1.4" @@ -4661,6 +4836,13 @@ __metadata: languageName: node linkType: hard +"detect-node-es@npm:^1.1.0": + version: 1.1.0 + resolution: "detect-node-es@npm:1.1.0" + checksum: e46307d7264644975b71c104b9f028ed1d3d34b83a15b8a22373640ce5ea630e5640b1078b8ea15f202b54641da71e4aa7597093bd4b91f113db520a26a37449 + languageName: node + linkType: hard + "devlop@npm:^1.0.0, devlop@npm:^1.1.0": version: 1.1.0 resolution: "devlop@npm:1.1.0" @@ -5612,6 +5794,13 @@ __metadata: languageName: node linkType: hard +"get-nonce@npm:^1.0.0": + version: 1.0.1 + resolution: "get-nonce@npm:1.0.1" + checksum: e2614e43b4694c78277bb61b0f04583d45786881289285c73770b07ded246a98be7e1f78b940c80cbe6f2b07f55f0b724e6db6fd6f1bcbd1e8bdac16521074ed + languageName: node + linkType: hard + "get-port-please@npm:^3.1.2": version: 3.1.2 resolution: "get-port-please@npm:3.1.2" @@ -7483,6 +7672,15 @@ __metadata: languageName: node linkType: hard +"media-query-parser@npm:^2.0.2": + version: 2.0.2 + resolution: "media-query-parser@npm:2.0.2" + dependencies: + "@babel/runtime": ^7.12.5 + checksum: 8ef956d9e63fe6f4041988beda69843b3a6bb48228ea2923a066f6e7c8f7c5dba75fae357318c48a97ed5beae840b8425cb7e727fc1bb77acc65f2005f8945ab + languageName: node + linkType: hard + "memoize-one@npm:^6.0.0": version: 6.0.0 resolution: "memoize-one@npm:6.0.0" @@ -8130,6 +8328,13 @@ __metadata: languageName: node linkType: hard +"modern-ahocorasick@npm:^1.0.0": + version: 1.1.0 + resolution: "modern-ahocorasick@npm:1.1.0" + checksum: 78b99840c9af086c1e36a594ee85bebd8c19d48e2ef31a67d1bad0e673ac12fc931e5961abb5b16daaf820af4923e700f76b1793b7413e18782230162866a0af + languageName: node + linkType: hard + "motion@npm:10.16.2": version: 10.16.2 resolution: "motion@npm:10.16.2" @@ -9387,6 +9592,19 @@ __metadata: languageName: node linkType: hard +"qrcode@npm:1.5.4": + version: 1.5.4 + resolution: "qrcode@npm:1.5.4" + dependencies: + dijkstrajs: ^1.0.1 + pngjs: ^5.0.0 + yargs: ^15.3.1 + bin: + qrcode: bin/qrcode + checksum: 0a162822e12c02b0333315462fd4ccad22255002130f86806773be7592aec5ef295efaffa3eb148cbf00e290839c7b610f63b0d62a0c5efc5bc52a68f4189684 + languageName: node + linkType: hard + "qs@npm:6.10.4": version: 6.10.4 resolution: "qs@npm:6.10.4" @@ -9533,6 +9751,41 @@ __metadata: languageName: node linkType: hard +"react-remove-scroll-bar@npm:^2.3.6": + version: 2.3.8 + resolution: "react-remove-scroll-bar@npm:2.3.8" + dependencies: + react-style-singleton: ^2.2.2 + tslib: ^2.0.0 + peerDependencies: + "@types/react": "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: c4663247f689dbe51c370836edf735487f6d8796acb7f15b09e8a1c14e84c7997360e8e3d54de2bc9c0e782fed2b2c4127d15b4053e4d2cf26839e809e57605f + languageName: node + linkType: hard + +"react-remove-scroll@npm:2.6.0": + version: 2.6.0 + resolution: "react-remove-scroll@npm:2.6.0" + dependencies: + react-remove-scroll-bar: ^2.3.6 + react-style-singleton: ^2.2.1 + tslib: ^2.1.0 + use-callback-ref: ^1.3.0 + use-sidecar: ^1.1.2 + peerDependencies: + "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: e7ad2383ce20d63cf28f3ed14e63f684e139301fc4a5c1573da330d4465b733e6084c33b2bfcaee448c9b1df0e37993a15d6cba8a1dd80fe631f803e48e9f798 + languageName: node + linkType: hard + "react-select@npm:^5.8.0": version: 5.8.0 resolution: "react-select@npm:5.8.0" @@ -9571,6 +9824,22 @@ __metadata: languageName: node linkType: hard +"react-style-singleton@npm:^2.2.1, react-style-singleton@npm:^2.2.2": + version: 2.2.3 + resolution: "react-style-singleton@npm:2.2.3" + dependencies: + get-nonce: ^1.0.0 + tslib: ^2.0.0 + peerDependencies: + "@types/react": "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: a7b0bf493c9231065ebafa84c4237aed997c746c561196121b7de82fe155a5355b372db5070a3ac9fe980cf7f60dc0f1e8cf6402a2aa5b2957392932ccf76e76 + languageName: node + linkType: hard + "react-syntax-highlighter@npm:^15.5.0": version: 15.5.0 resolution: "react-syntax-highlighter@npm:15.5.0" @@ -9899,6 +10168,8 @@ __metadata: version: 0.0.0-use.local resolution: "revoke.cash@workspace:." dependencies: + "@abstract-foundation/agw-client": ^0.0.1-beta.22 + "@abstract-foundation/agw-react": ^0.0.1-beta.22 "@biomejs/biome": ^1.9.4 "@commitlint/cli": ^19.6.0 "@commitlint/config-conventional": ^19.6.0 @@ -9909,6 +10180,8 @@ __metadata: "@lavamoat/allow-scripts": ^3.2.0 "@localazy/cli": ^1.7.14 "@neondatabase/serverless": ^0.10.1 + "@privy-io/cross-app-connect": ^0.0.8 + "@rainbow-me/rainbowkit": ^2.2.1 "@revoke.cash/chains": ^56.0.0 "@tailwindcss/typography": ^0.5.14 "@tanstack/query-sync-storage-persister": ^5.52.0 @@ -11065,6 +11338,15 @@ __metadata: languageName: node linkType: hard +"ua-parser-js@npm:^1.0.37": + version: 1.0.39 + resolution: "ua-parser-js@npm:1.0.39" + bin: + ua-parser-js: script/cli.js + checksum: 19455df8c2348ef53f2e150e7406d3a025a619c2fd69722a1e63363d5ba8d91731ef7585f2dce7d8f14c8782734b4d704c05f246dca5f7565b5ae7d318084f2a + languageName: node + linkType: hard + "ufo@npm:^1.4.0, ufo@npm:^1.5.3, ufo@npm:^1.5.4": version: 1.5.4 resolution: "ufo@npm:1.5.4" @@ -11339,6 +11621,21 @@ __metadata: languageName: node linkType: hard +"use-callback-ref@npm:^1.3.0": + version: 1.3.2 + resolution: "use-callback-ref@npm:1.3.2" + dependencies: + tslib: ^2.0.0 + peerDependencies: + "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: df690f2032d56aabcea0400313a04621429f45bceb4d65d38829b3680cae3856470ce72958cb7224b332189d8faef54662a283c0867dd7c769f9a5beff61787d + languageName: node + linkType: hard + "use-intl@npm:^3.19.1": version: 3.19.1 resolution: "use-intl@npm:3.19.1" @@ -11372,6 +11669,22 @@ __metadata: languageName: node linkType: hard +"use-sidecar@npm:^1.1.2": + version: 1.1.3 + resolution: "use-sidecar@npm:1.1.3" + dependencies: + detect-node-es: ^1.1.0 + tslib: ^2.0.0 + peerDependencies: + "@types/react": "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 88664c6b2c5b6e53e4d5d987694c9053cea806da43130248c74ca058945c8caa6ccb7b1787205a9eb5b9d124633e42153848904002828acabccdc48cda026622 + languageName: node + linkType: hard + "use-sync-external-store@npm:1.2.0": version: 1.2.0 resolution: "use-sync-external-store@npm:1.2.0"