From 3e8dfcfe2d01435b70c5271acccc9f82cc56804c Mon Sep 17 00:00:00 2001 From: Gancho Radkov Date: Sat, 16 Nov 2024 17:45:16 +0200 Subject: [PATCH] chore: updates to walletkit --- .vscode/settings.json | 9 +- examples/wallet/package.json | 2 +- examples/wallet/src/components/Modal.tsx | 2 - .../hooks/useWalletConnectEventsManager.ts | 9 - examples/wallet/src/store/ModalStore.ts | 1 - .../wallet/src/views/AuthRequestModal.tsx | 84 ----- examples/wallet/yarn.lock | 286 ++++-------------- package.json | 4 +- src/client.ts | 18 -- src/controllers/engine.ts | 67 ++-- src/types/client.ts | 26 +- src/types/engine.ts | 13 +- test/auth.spec.ts | 161 ---------- yarn.lock | 280 ++++------------- 14 files changed, 162 insertions(+), 800 deletions(-) delete mode 100644 examples/wallet/src/views/AuthRequestModal.tsx delete mode 100644 test/auth.spec.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 1e95b94..fed95f5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,17 +15,12 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "editor.codeActionsOnSave": { - "source.organizeImports": false + "source.organizeImports": "never" }, "editor.formatOnSave": true, "editor.tabSize": 2, "editor.wordWrapColumn": 90, - "eslint.validate": [ - "javascript", - "javascriptreact", - "typescript", - "typescriptreact" - ], + "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], "files.exclude": { "**/.rollup.cache": true, "**/.git": true, diff --git a/examples/wallet/package.json b/examples/wallet/package.json index 8822ee4..d9fcac2 100644 --- a/examples/wallet/package.json +++ b/examples/wallet/package.json @@ -13,7 +13,7 @@ "dependencies": { "@json-rpc-tools/utils": "1.7.6", "@nextui-org/react": "1.0.0-beta.12", - "@walletconnect/se-sdk": "1.10.0-rc.0", + "@walletconnect/se-sdk": "1.11.0-rc-1", "ethers": "5.7.2", "framer-motion": "9.0.2", "next": "12.2.0", diff --git a/examples/wallet/src/components/Modal.tsx b/examples/wallet/src/components/Modal.tsx index 2fbfc34..06beb39 100644 --- a/examples/wallet/src/components/Modal.tsx +++ b/examples/wallet/src/components/Modal.tsx @@ -1,5 +1,4 @@ import ModalStore from "@/store/ModalStore"; -import AuthRequestModal from "@/views/AuthRequestModal"; import SessionProposalModal from "@/views/SessionProposalModal"; import SessionSendTransactionModal from "@/views/SessionSendTransactionModal"; import SessionRequestModal from "@/views/SessionSignModal"; @@ -20,7 +19,6 @@ export default function Modal() { {view === "SessionSendTransactionModal" && } {view === "SessionUnsuportedMethodModal" && } {view === "SwitchChainModal" && } - {view === "AuthRequestModal" && } ); } diff --git a/examples/wallet/src/hooks/useWalletConnectEventsManager.ts b/examples/wallet/src/hooks/useWalletConnectEventsManager.ts index 1f0e651..10f9eb4 100644 --- a/examples/wallet/src/hooks/useWalletConnectEventsManager.ts +++ b/examples/wallet/src/hooks/useWalletConnectEventsManager.ts @@ -70,13 +70,6 @@ export default function useWalletConnectEventsManager() { [], ); - const onAuthRequest = useCallback( - (request: SingleEthereumTypes.EventArguments["auth_request"]) => { - ModalStore.open("AuthRequestModal", { authRequest: request }); - }, - [], - ); - /****************************************************************************** * Set up WalletConnect event listeners *****************************************************************************/ @@ -87,7 +80,6 @@ export default function useWalletConnectEventsManager() { web3wallet.on("session_delete", (data: any) => { console.log("delete", data); }); - web3wallet.on("auth_request", onAuthRequest); } return () => { @@ -97,7 +89,6 @@ export default function useWalletConnectEventsManager() { web3wallet.off("session_delete", (data: any) => { console.log("delete", data); }); - web3wallet.off("auth_request", onAuthRequest); } }; }, [web3WalletReady, onSessionProposal, onSessionRequest]); diff --git a/examples/wallet/src/store/ModalStore.ts b/examples/wallet/src/store/ModalStore.ts index c33f1ad..566e601 100644 --- a/examples/wallet/src/store/ModalStore.ts +++ b/examples/wallet/src/store/ModalStore.ts @@ -9,7 +9,6 @@ interface ModalData { proposal?: SingleEthereumTypes.EventArguments["session_proposal"]; requestEvent?: SingleEthereumTypes.EventArguments["session_request"]; requestSession?: SessionTypes.Struct; - authRequest?: SingleEthereumTypes.AuthRequest; } interface State { open: boolean; diff --git a/examples/wallet/src/views/AuthRequestModal.tsx b/examples/wallet/src/views/AuthRequestModal.tsx deleted file mode 100644 index eaa601d..0000000 --- a/examples/wallet/src/views/AuthRequestModal.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import ProjectInfoCard from "@/components/ProjectInfoCard"; -import RequesDetailsCard from "@/components/RequestDetalilsCard"; -import RequestMethodCard from "@/components/RequestMethodCard"; -import RequestModalContainer from "@/components/RequestModalContainer"; -import ModalStore from "@/store/ModalStore"; -import { - approveEIP155Request, - rejectEIP155Request, - signWithEthereum, -} from "@/utils/EIP155RequestHandlerUtil"; -import { getSignParamsMessage } from "@/utils/HelperUtil"; -import { web3wallet } from "@/utils/WalletConnectUtil"; -import { Button, Col, Divider, Modal, Row, Text } from "@nextui-org/react"; -import { getSdkError } from "@walletconnect/utils"; -import { Fragment, useCallback, useEffect, useState } from "react"; -import { eip155Addresses } from "@/utils/EIP155WalletUtil"; -import AccountSelectCard from "@/components/AccountSelectCard"; - -export default function AuthRequestModal() { - const authRequest = ModalStore.state.data?.authRequest; - const id = authRequest?.id || 0; - const [message, setMessage] = useState(); - const [selectedAdress, setSelectedAddress] = useState(eip155Addresses[0]); - useEffect(() => { - if (!authRequest) return; - setMessage(web3wallet.formatAuthMessage(authRequest.params.cacaoPayload, selectedAdress)); - }, [authRequest?.params.cacaoPayload, selectedAdress, message]); - - const onApprove = useCallback(async () => { - if (message) { - const signature = await signWithEthereum(selectedAdress, message); - await web3wallet.approveAuthRequest({ - id, - signature, - address: selectedAdress, - }); - ModalStore.close(); - } - }, [selectedAdress, id, message]); - - if (!authRequest) { - return Missing authentication request; - } - - // Handle reject action - async function onReject() { - await web3wallet.rejectAuthRequest({ id, error: getSdkError("USER_REJECTED") }); - ModalStore.close(); - } - - return ( - - - - - Message - - {message} - - - - {eip155Addresses.map((address, i) => { - return ( - setSelectedAddress(address)} - selected={selectedAdress === address ?? false} - /> - ); - })} - - - - - - - ); -} diff --git a/examples/wallet/yarn.lock b/examples/wallet/yarn.lock index dc4a90f..094570a 100644 --- a/examples/wallet/yarn.lock +++ b/examples/wallet/yarn.lock @@ -1648,6 +1648,19 @@ "@react-types/grid" "^3.1.8" "@react-types/shared" "^3.18.1" +"@reown/walletkit@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@reown/walletkit/-/walletkit-1.1.1.tgz#8d4e77a1fd92d16827dbb11338d60fd6000eab08" + integrity sha512-GTPksxBO6VAsqiQ0oH2jt8C845Y7redpI4OxRy31vf7KKDPPGfldbsTYZ+FP9xSda00dCJJKuXhzewZT/xHuDg== + dependencies: + "@walletconnect/core" "2.17.1" + "@walletconnect/jsonrpc-provider" "1.0.14" + "@walletconnect/jsonrpc-utils" "1.0.8" + "@walletconnect/logger" "2.1.2" + "@walletconnect/sign-client" "2.17.1" + "@walletconnect/types" "2.17.1" + "@walletconnect/utils" "2.17.1" + "@rushstack/eslint-patch@^1.1.3": version "1.3.2" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz#31b9c510d8cada9683549e1dbb4284cca5001faf" @@ -1755,7 +1768,7 @@ "@stablelib/binary" "^1.0.1" "@stablelib/wipe" "^1.0.1" -"@stablelib/sha256@1.0.1", "@stablelib/sha256@^1.0.1": +"@stablelib/sha256@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/sha256/-/sha256-1.0.1.tgz#77b6675b67f9b0ea081d2e31bda4866297a3ae4f" integrity sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ== @@ -1778,7 +1791,7 @@ resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36" integrity sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg== -"@stablelib/x25519@1.0.3", "@stablelib/x25519@^1.0.3": +"@stablelib/x25519@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@stablelib/x25519/-/x25519-1.0.3.tgz#13c8174f774ea9f3e5e42213cbf9fc68a3c7b7fd" integrity sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw== @@ -1879,29 +1892,10 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@walletconnect/auth-client@2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@walletconnect/auth-client/-/auth-client-2.1.2.tgz#cee304fb0cdca76f6bf4aafac96ef9301862a7e8" - integrity sha512-ubJLn+vGb8sTdBFX6xAh4kjR5idrtS3RBngQWaJJJpEPBQmxMb8pM2q0FIRs8Is4K6jKy+uEhusMV+7ZBmTzjw== - dependencies: - "@ethersproject/hash" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@stablelib/random" "^1.0.2" - "@stablelib/sha256" "^1.0.1" - "@walletconnect/core" "^2.10.1" - "@walletconnect/events" "^1.0.1" - "@walletconnect/heartbeat" "^1.2.1" - "@walletconnect/jsonrpc-utils" "^1.0.8" - "@walletconnect/logger" "^2.0.1" - "@walletconnect/time" "^1.0.2" - "@walletconnect/utils" "^2.10.1" - events "^3.3.0" - isomorphic-unfetch "^3.1.0" - -"@walletconnect/core@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.15.0.tgz#0d15e48964f99f2073964ec3776bd032fb6fa3b3" - integrity sha512-QekYQlpxyn2bcQXMkMxo0+v7nUOQKyu3j5ZKzTg/HGU1eSgTRLIvYIEkC8VVflIgOw7meOAb5pFChX51wShksQ== +"@walletconnect/core@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.17.1.tgz#8ee51d630068e4450014fe62a76af895ab1d349d" + integrity sha512-SMgJR5hEyEE/tENIuvlEb4aB9tmMXPzQ38Y61VgYBmwAFEhOHtpt8EDfnfRWqEhMyXuBXG4K70Yh8c67Yry+Xw== dependencies: "@walletconnect/heartbeat" "1.2.2" "@walletconnect/jsonrpc-provider" "1.0.14" @@ -1914,34 +1908,13 @@ "@walletconnect/relay-auth" "1.0.4" "@walletconnect/safe-json" "1.0.2" "@walletconnect/time" "1.0.2" - "@walletconnect/types" "2.15.0" - "@walletconnect/utils" "2.15.0" + "@walletconnect/types" "2.17.1" + "@walletconnect/utils" "2.17.1" + "@walletconnect/window-getters" "1.0.1" events "3.3.0" lodash.isequal "4.5.0" uint8arrays "3.1.0" -"@walletconnect/core@^2.10.1": - version "2.10.1" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.1.tgz#d1fb442bd77424666bacdb0f5a07f7708fb3d984" - integrity sha512-WAoXfmj+Zy5q48TnrKUjmHXJCBahzKwbul+noepRZf7JDtUAZ9IOWpUjg+UPRbfK5EiWZ0TF42S6SXidf7EHoQ== - dependencies: - "@walletconnect/heartbeat" "1.2.1" - "@walletconnect/jsonrpc-provider" "1.0.13" - "@walletconnect/jsonrpc-types" "1.0.3" - "@walletconnect/jsonrpc-utils" "1.0.8" - "@walletconnect/jsonrpc-ws-connection" "1.0.13" - "@walletconnect/keyvaluestorage" "^1.0.2" - "@walletconnect/logger" "^2.0.1" - "@walletconnect/relay-api" "^1.0.9" - "@walletconnect/relay-auth" "^1.0.4" - "@walletconnect/safe-json" "^1.0.2" - "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.1" - "@walletconnect/utils" "2.10.1" - events "^3.3.0" - lodash.isequal "4.5.0" - uint8arrays "^3.1.0" - "@walletconnect/environment@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/environment/-/environment-1.0.1.tgz#1d7f82f0009ab821a2ba5ad5e5a7b8ae3b214cd7" @@ -1957,15 +1930,6 @@ keyvaluestorage-interface "^1.0.0" tslib "1.14.1" -"@walletconnect/heartbeat@1.2.1", "@walletconnect/heartbeat@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@walletconnect/heartbeat/-/heartbeat-1.2.1.tgz#afaa3a53232ae182d7c9cff41c1084472d8f32e9" - integrity sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q== - dependencies: - "@walletconnect/events" "^1.0.1" - "@walletconnect/time" "^1.0.2" - tslib "1.14.1" - "@walletconnect/heartbeat@1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@walletconnect/heartbeat/-/heartbeat-1.2.2.tgz#e8dc5179db7769950c6f9cf59b23516d9b95227d" @@ -1975,15 +1939,6 @@ "@walletconnect/time" "^1.0.2" events "^3.3.0" -"@walletconnect/jsonrpc-provider@1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.13.tgz#9a74da648d015e1fffc745f0c7d629457f53648b" - integrity sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g== - dependencies: - "@walletconnect/jsonrpc-utils" "^1.0.8" - "@walletconnect/safe-json" "^1.0.2" - tslib "1.14.1" - "@walletconnect/jsonrpc-provider@1.0.14": version "1.0.14" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.14.tgz#696f3e3b6d728b361f2e8b853cfc6afbdf2e4e3e" @@ -1993,14 +1948,6 @@ "@walletconnect/safe-json" "^1.0.2" events "^3.3.0" -"@walletconnect/jsonrpc-types@1.0.3", "@walletconnect/jsonrpc-types@^1.0.2", "@walletconnect/jsonrpc-types@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz#65e3b77046f1a7fa8347ae02bc1b841abe6f290c" - integrity sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw== - dependencies: - keyvaluestorage-interface "^1.0.0" - tslib "1.14.1" - "@walletconnect/jsonrpc-types@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz#ce1a667d79eadf2a2d9d002c152ceb68739c230c" @@ -2009,6 +1956,14 @@ events "^3.3.0" keyvaluestorage-interface "^1.0.0" +"@walletconnect/jsonrpc-types@^1.0.2", "@walletconnect/jsonrpc-types@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz#65e3b77046f1a7fa8347ae02bc1b841abe6f290c" + integrity sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw== + dependencies: + keyvaluestorage-interface "^1.0.0" + tslib "1.14.1" + "@walletconnect/jsonrpc-utils@1.0.8", "@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.8": version "1.0.8" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.8.tgz#82d0cc6a5d6ff0ecc277cb35f71402c91ad48d72" @@ -2018,17 +1973,6 @@ "@walletconnect/jsonrpc-types" "^1.0.3" tslib "1.14.1" -"@walletconnect/jsonrpc-ws-connection@1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.13.tgz#23b0cdd899801bfbb44a6556936ec2b93ef2adf4" - integrity sha512-mfOM7uFH4lGtQxG+XklYuFBj6dwVvseTt5/ahOkkmpcAEgz2umuzu7fTR+h5EmjQBdrmYyEBOWADbeaFNxdySg== - dependencies: - "@walletconnect/jsonrpc-utils" "^1.0.6" - "@walletconnect/safe-json" "^1.0.2" - events "^3.3.0" - tslib "1.14.1" - ws "^7.5.1" - "@walletconnect/jsonrpc-ws-connection@1.0.14": version "1.0.14" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.14.tgz#eec700e74766c7887de2bd76c91a0206628732aa" @@ -2048,14 +1992,6 @@ idb-keyval "^6.2.1" unstorage "^1.9.0" -"@walletconnect/keyvaluestorage@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.0.2.tgz#92f5ca0f54c1a88a093778842ce0c874d86369c8" - integrity sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ== - dependencies: - safe-json-utils "^1.1.1" - tslib "1.14.1" - "@walletconnect/logger@2.1.2": version "2.1.2" resolved "https://registry.yarnpkg.com/@walletconnect/logger/-/logger-2.1.2.tgz#813c9af61b96323a99f16c10089bfeb525e2a272" @@ -2064,14 +2000,6 @@ "@walletconnect/safe-json" "^1.0.2" pino "7.11.0" -"@walletconnect/logger@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@walletconnect/logger/-/logger-2.0.1.tgz#7f489b96e9a1ff6bf3e58f0fbd6d69718bf844a8" - integrity sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ== - dependencies: - pino "7.11.0" - tslib "1.14.1" - "@walletconnect/relay-api@1.0.11": version "1.0.11" resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.11.tgz#80ab7ef2e83c6c173be1a59756f95e515fb63224" @@ -2079,15 +2007,7 @@ dependencies: "@walletconnect/jsonrpc-types" "^1.0.2" -"@walletconnect/relay-api@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.9.tgz#f8c2c3993dddaa9f33ed42197fc9bfebd790ecaf" - integrity sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg== - dependencies: - "@walletconnect/jsonrpc-types" "^1.0.2" - tslib "1.14.1" - -"@walletconnect/relay-auth@1.0.4", "@walletconnect/relay-auth@^1.0.4": +"@walletconnect/relay-auth@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@walletconnect/relay-auth/-/relay-auth-1.0.4.tgz#0b5c55c9aa3b0ef61f526ce679f3ff8a5c4c2c7c" integrity sha512-kKJcS6+WxYq5kshpPaxGHdwf5y98ZwbfuS4EE/NkQzqrDFm5Cj+dP8LofzWvjrrLkZq7Afy7WrQMXdLy8Sx7HQ== @@ -2106,26 +2026,26 @@ dependencies: tslib "1.14.1" -"@walletconnect/se-sdk@1.10.0-rc.0": - version "1.10.0-rc.0" - resolved "https://registry.yarnpkg.com/@walletconnect/se-sdk/-/se-sdk-1.10.0-rc.0.tgz#59cb52dcf93eaa6583218e2d66430eb3cfe1f6bc" - integrity sha512-7L6A69PHljBpSJroDN04evY2Hsv6GL6ytGYMTJaObQV061gZIZvJB+AkxINCe2iXyrFZc/QBmpuHjND7EP3O9w== +"@walletconnect/se-sdk@1.11.0-rc-1": + version "1.11.0-rc-1" + resolved "https://registry.yarnpkg.com/@walletconnect/se-sdk/-/se-sdk-1.11.0-rc-1.tgz#32a1216f3a0ea329788d0e085b15bcb8ad60ffa5" + integrity sha512-1xCbi5bTyykRrEu++G4VZ7I2PoEH905znbELeWf2PPB+q7UeKstA+0ZINAXZaRJ4r7WLtOB6Pmvzsu/RyphmUg== dependencies: - "@walletconnect/web3wallet" "1.14.0" + "@reown/walletkit" "1.1.1" -"@walletconnect/sign-client@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.15.0.tgz#bad69a2850dac26d011ba54be86073455fc398c8" - integrity sha512-efwrPfIwKWKeku44TGBCnQqPZGCILI1wBKK9bTF0F0/qrLR/zRe6RWpM3/L4+jOMr/BktxPZ5lRozBh+c2U7Pg== +"@walletconnect/sign-client@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.17.1.tgz#0777536427eba1b725c111ecc08eb301e05a8c55" + integrity sha512-6rLw6YNy0smslH9wrFTbNiYrGsL3DrOsS5FcuU4gIN6oh8pGYOFZ5FiSyTTroc5tngOk3/Sd7dlGY9S7O4nveg== dependencies: - "@walletconnect/core" "2.15.0" + "@walletconnect/core" "2.17.1" "@walletconnect/events" "1.0.1" "@walletconnect/heartbeat" "1.2.2" "@walletconnect/jsonrpc-utils" "1.0.8" "@walletconnect/logger" "2.1.2" "@walletconnect/time" "1.0.2" - "@walletconnect/types" "2.15.0" - "@walletconnect/utils" "2.15.0" + "@walletconnect/types" "2.17.1" + "@walletconnect/utils" "2.17.1" events "3.3.0" "@walletconnect/time@1.0.2", "@walletconnect/time@^1.0.2": @@ -2135,22 +2055,10 @@ dependencies: tslib "1.14.1" -"@walletconnect/types@2.10.1": - version "2.10.1" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.1.tgz#1355bce236f3eef575716ea3efe4beed98a873ef" - integrity sha512-7pccAhajQdiH2kYywjE1XI64IqRI+4ioyGy0wvz8d0UFQ/DSG3MLKR8jHf5aTOafQQ/HRLz6xvlzN4a7gIVkUQ== - dependencies: - "@walletconnect/events" "^1.0.1" - "@walletconnect/heartbeat" "1.2.1" - "@walletconnect/jsonrpc-types" "1.0.3" - "@walletconnect/keyvaluestorage" "^1.0.2" - "@walletconnect/logger" "^2.0.1" - events "^3.3.0" - -"@walletconnect/types@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.15.0.tgz#4593a138fbf31bf7dc4317f59de643c20d3c8dbb" - integrity sha512-hLffDKKe70jIrK+YcLkAnzi6vqNki1SDBWjV+M/72mKcU2KzXxk0G2STFsWsQDx8DoqxMiuGehd0DlD1jwQmBg== +"@walletconnect/types@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.17.1.tgz#425dedbe5853231252d081f61448c55ecd341c96" + integrity sha512-aiUeBE3EZZTsZBv5Cju3D0PWAsZCMks1g3hzQs9oNtrbuLL6pKKU0/zpKwk4vGywszxPvC3U0tBCku9LLsH/0A== dependencies: "@walletconnect/events" "1.0.1" "@walletconnect/heartbeat" "1.2.2" @@ -2159,61 +2067,32 @@ "@walletconnect/logger" "2.1.2" events "3.3.0" -"@walletconnect/utils@2.10.1", "@walletconnect/utils@^2.10.1": - version "2.10.1" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.1.tgz#65b37c9800eb0e80a08385b6987471fb46e1e22e" - integrity sha512-DM0dKgm9O58l7VqJEyV2OVv16XRePhDAReI23let6WdW1dSpw/Y/A89Lp99ZJOjLm2FxyblMRF3YRaZtHwBffw== - dependencies: - "@stablelib/chacha20poly1305" "1.0.1" - "@stablelib/hkdf" "1.0.1" - "@stablelib/random" "^1.0.2" - "@stablelib/sha256" "1.0.1" - "@stablelib/x25519" "^1.0.3" - "@walletconnect/relay-api" "^1.0.9" - "@walletconnect/safe-json" "^1.0.2" - "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.1" - "@walletconnect/window-getters" "^1.0.1" - "@walletconnect/window-metadata" "^1.0.1" - detect-browser "5.3.0" - query-string "7.1.3" - uint8arrays "^3.1.0" - -"@walletconnect/utils@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.15.0.tgz#864f800e7cccdabc631215119f8ab3f1c71d4e41" - integrity sha512-xaazgCMyr5fUPm2QuZ76G+W8beDfKMILqJ3INL6wyuaLil2YQNdsCSvWMNhSP+EZeKD3SUqqBmQaM/maP0YHTg== +"@walletconnect/utils@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.17.1.tgz#fc57ffb89fc101fa1bf015de016ea01091d10ae0" + integrity sha512-KL7pPwq7qUC+zcTmvxGqIyYanfHgBQ+PFd0TEblg88jM7EjuDLhjyyjtkhyE/2q7QgR7OanIK7pCpilhWvBsBQ== dependencies: + "@ethersproject/hash" "5.7.0" + "@ethersproject/transactions" "5.7.0" "@stablelib/chacha20poly1305" "1.0.1" "@stablelib/hkdf" "1.0.1" "@stablelib/random" "1.0.2" "@stablelib/sha256" "1.0.1" "@stablelib/x25519" "1.0.3" + "@walletconnect/jsonrpc-utils" "1.0.8" + "@walletconnect/keyvaluestorage" "1.1.1" "@walletconnect/relay-api" "1.0.11" + "@walletconnect/relay-auth" "1.0.4" "@walletconnect/safe-json" "1.0.2" "@walletconnect/time" "1.0.2" - "@walletconnect/types" "2.15.0" + "@walletconnect/types" "2.17.1" "@walletconnect/window-getters" "1.0.1" "@walletconnect/window-metadata" "1.0.1" detect-browser "5.3.0" - elliptic "^6.5.7" + elliptic "6.5.7" query-string "7.1.3" uint8arrays "3.1.0" -"@walletconnect/web3wallet@1.14.0": - version "1.14.0" - resolved "https://registry.yarnpkg.com/@walletconnect/web3wallet/-/web3wallet-1.14.0.tgz#e30c917de593728af81c6be3cef6b8f1a80b91c1" - integrity sha512-vBBicK4PJGwmiU1NgxSnflTJlbbZjmuTlbdTGCCL4w6eW/CtsY4zNnTNmrGhlej0CkGr0M+Jw6RbFtxpMEYqZA== - dependencies: - "@walletconnect/auth-client" "2.1.2" - "@walletconnect/core" "2.15.0" - "@walletconnect/jsonrpc-provider" "1.0.14" - "@walletconnect/jsonrpc-utils" "1.0.8" - "@walletconnect/logger" "2.1.2" - "@walletconnect/sign-client" "2.15.0" - "@walletconnect/types" "2.15.0" - "@walletconnect/utils" "2.15.0" - "@walletconnect/window-getters@1.0.1", "@walletconnect/window-getters@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-getters/-/window-getters-1.0.1.tgz#f36d1c72558a7f6b87ecc4451fc8bd44f63cbbdc" @@ -2221,7 +2100,7 @@ dependencies: tslib "1.14.1" -"@walletconnect/window-metadata@1.0.1", "@walletconnect/window-metadata@^1.0.1": +"@walletconnect/window-metadata@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz#2124f75447b7e989e4e4e1581d55d25bc75f7be5" integrity sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA== @@ -2776,7 +2655,7 @@ elliptic@6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -elliptic@^6.5.7: +elliptic@6.5.7: version "6.5.7" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== @@ -3846,14 +3725,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isomorphic-unfetch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" - integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== - dependencies: - node-fetch "^2.6.1" - unfetch "^4.2.0" - jiti@^1.20.0: version "1.21.0" resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" @@ -4166,13 +4037,6 @@ node-fetch-native@^1.4.0, node-fetch-native@^1.4.1: resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.1.tgz#f95c74917d3cebc794cdae0cd2a9c7594aad0cb4" integrity sha512-bW9T/uJDPAJB2YNYEpWzE54U5O3MQidXsOyTfnbKYtTtFexRvGzb1waphBN4ZwP6EcIvYYEOwW0b72BpAqydTw== -node-fetch@^2.6.1: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== - dependencies: - whatwg-url "^5.0.0" - node-forge@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -4692,11 +4556,6 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-json-utils@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/safe-json-utils/-/safe-json-utils-1.1.1.tgz#0e883874467d95ab914c3f511096b89bfb3e63b1" - integrity sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ== - safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" @@ -4990,11 +4849,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - tsconfig-paths@^3.14.1: version "3.14.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" @@ -5060,7 +4914,7 @@ uint8arrays@3.1.0: dependencies: multiformats "^9.4.2" -uint8arrays@^3.0.0, uint8arrays@^3.1.0: +uint8arrays@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.1.1.tgz#2d8762acce159ccd9936057572dade9459f65ae0" integrity sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg== @@ -5093,11 +4947,6 @@ unenv@^1.7.4: node-fetch-native "^1.4.1" pathe "^1.1.1" -unfetch@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" - integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== - unstorage@^1.9.0: version "1.10.1" resolved "https://registry.yarnpkg.com/unstorage/-/unstorage-1.10.1.tgz#bf8cc00a406e40a6293e893da9807057d95875b0" @@ -5164,19 +5013,6 @@ valtio@1.10.2: proxy-compare "2.5.0" use-sync-external-store "1.2.0" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" diff --git a/package.json b/package.json index ccb375a..cf73763 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@walletconnect/se-sdk", "description": "Single-Ethreum-SDK for WalletConnect Protocol", "private": false, - "version": "1.10.0", + "version": "1.11.0", "author": "WalletConnect, Inc. ", "homepage": "https://github.com/walletconnect/walletconnect-monorepo/", "license": "Apache-2.0", @@ -33,7 +33,7 @@ "install:all": "yarn && cd ./examples/dapp && yarn && cd ./../wallet && yarn" }, "dependencies": { - "@walletconnect/web3wallet": "1.14.0" + "@reown/walletkit": "1.1.1" }, "devDependencies": { "@ethersproject/wallet": "^5.7.0", diff --git a/src/client.ts b/src/client.ts index 2c02278..10a0c3d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -143,15 +143,6 @@ export class SingleEthereum extends ISingleEthereum { // ---------- Auth ----------------------------------------------- // - public formatAuthMessage: ISingleEthereum["formatAuthMessage"] = (payload, address) => { - try { - return this.engine.formatAuthMessage(payload, address); - } catch (error: any) { - this.logger.error(error.message); - throw error; - } - }; - public approveAuthRequest: ISingleEthereum["approveAuthRequest"] = (payload) => { try { return this.engine.approveAuthRequest(payload); @@ -170,15 +161,6 @@ export class SingleEthereum extends ISingleEthereum { } }; - public getPendingAuthRequests: ISingleEthereum["getPendingAuthRequests"] = () => { - try { - return this.engine.getPendingAuthRequests(); - } catch (error: any) { - this.logger.error(error.message); - throw error; - } - }; - // ---------- Private ----------------------------------------------- // private async initialize() { diff --git a/src/controllers/engine.ts b/src/controllers/engine.ts index ae46fa4..1cfc99f 100644 --- a/src/controllers/engine.ts +++ b/src/controllers/engine.ts @@ -1,6 +1,6 @@ import { formatJsonRpcError, formatJsonRpcResult } from "@walletconnect/jsonrpc-utils"; import { getSdkError, normalizeNamespaces } from "@walletconnect/utils"; -import { Web3Wallet, IWeb3Wallet } from "@walletconnect/web3wallet"; +import { IWalletKit, WalletKit } from "@reown/walletkit"; import { EVM_IDENTIFIER, SWITCH_CHAIN_METHODS } from "../constants"; import { ISingleEthereumEngine, SingleEthereumTypes } from "../types"; import { @@ -14,11 +14,10 @@ import { parseProposals, parseProposal, accountsAlreadyInSession, - formatAuthAddress, } from "../utils"; export class Engine extends ISingleEthereumEngine { - public web3wallet: IWeb3Wallet; + public web3wallet: IWalletKit; public chainId: number; private pendingInternalRequests: { id: number; @@ -32,12 +31,12 @@ export class Engine extends ISingleEthereumEngine { super(client); this.chainId = 1; // initialized in init() - this.web3wallet = {} as IWeb3Wallet; + this.web3wallet = {} as IWalletKit; } public init = async () => { this.chainId = this.client.chainId; - this.web3wallet = await Web3Wallet.init({ + this.web3wallet = await WalletKit.init({ core: this.client.core, metadata: this.client.metadata, signConfig: this.client.signConfig || { @@ -212,37 +211,31 @@ export class Engine extends ISingleEthereumEngine { // ---------- Auth ----------------------------------------------- // - public approveAuthRequest: ISingleEthereumEngine["approveAuthRequest"] = async (params) => { - const { id, signature, address } = params; - return await this.web3wallet.respondAuthRequest( - { - id, - signature: { - s: signature, - t: "eip191", - }, - }, - formatAuthAddress(address), - ); - }; - - public rejectAuthRequest: ISingleEthereumEngine["rejectAuthRequest"] = async (params) => { - const { id, error } = params; - return await this.web3wallet.respondAuthRequest( - { - id, - error, - }, - "", - ); - }; - - public getPendingAuthRequests: ISingleEthereumEngine["getPendingAuthRequests"] = () => { - return this.web3wallet.getPendingAuthRequests(); + public approveAuthRequest: ISingleEthereumEngine["approveAuthRequest"] = async (_params) => { + // const { id, signature, address } = params; + return {} as any; + // return await this.web3wallet.respondAuthRequest( + // { + // id, + // signature: { + // s: signature, + // t: "eip191", + // }, + // }, + // formatAuthAddress(address), + // ); }; - public formatAuthMessage: ISingleEthereumEngine["formatAuthMessage"] = (payload, address) => { - return this.web3wallet.formatMessage(payload, formatAuthAddress(address)); + public rejectAuthRequest: ISingleEthereumEngine["rejectAuthRequest"] = async (_params) => { + // const { id, error } = params; + return {} as any; + // return await this.web3wallet.respondAuthRequest( + // { + // id, + // error, + // }, + // "", + // ); }; // ---------- Private ----------------------------------------------- // @@ -311,15 +304,11 @@ export class Engine extends ISingleEthereumEngine { await this.disconnectPairings(); }; - private onAuthRequest = (event: SingleEthereumTypes.AuthRequest) => { - this.client.events.emit("auth_request", event); - }; - private initializeEventListeners = () => { this.web3wallet.on("session_proposal", this.onSessionProposal); this.web3wallet.on("session_request", this.onSessionRequest); this.web3wallet.on("session_delete", this.onSessionDelete); - this.web3wallet.on("auth_request", this.onAuthRequest); + // this.web3wallet.on("auth_request", this.onAuthRequest); }; private disconnectPairings = async () => { diff --git a/src/types/client.ts b/src/types/client.ts index 1d9f1ef..8fe84a1 100644 --- a/src/types/client.ts +++ b/src/types/client.ts @@ -2,16 +2,10 @@ import EventEmmiter, { EventEmitter } from "events"; import { CoreTypes, ICore, Verify } from "@walletconnect/types"; import { ISingleEthereumEngine } from "./engine"; import { Logger } from "@walletconnect/logger"; -import { AuthEngineTypes } from "@walletconnect/auth-client"; -import { Web3WalletTypes } from "@walletconnect/web3wallet"; +import { WalletKitTypes } from "@reown/walletkit"; export declare namespace SingleEthereumTypes { - type Event = - | "session_proposal" - | "session_proposal_error" - | "session_request" - | "session_delete" - | "auth_request"; + type Event = "session_proposal" | "session_proposal_error" | "session_request" | "session_delete"; interface BaseEventArgs { id: number; @@ -26,12 +20,10 @@ export declare namespace SingleEthereumTypes { verifyContext: Verify.Context; }; - type SessionProposal = Web3WalletTypes.SessionProposal; + type SessionProposal = WalletKitTypes.SessionProposal; type SessionDelete = Omit; - type AuthRequest = Web3WalletTypes.AuthRequest; - type SessionProposalError = { message: string; code: number; @@ -42,18 +34,14 @@ export declare namespace SingleEthereumTypes { session_proposal_error: SessionProposalError; session_request: SessionRequest; session_delete: SessionDelete; - auth_request: AuthRequest; } - type CacaoRequestPayload = AuthEngineTypes.CacaoRequestPayload; - type PendingAuthRequest = AuthEngineTypes.PendingRequest; - interface Options { core: ICore; metadata: Metadata; name?: string; chainId: number; - signConfig?: Web3WalletTypes.SignConfig; + signConfig?: WalletKitTypes.SignConfig; } type Metadata = CoreTypes.Metadata; @@ -98,7 +86,7 @@ export abstract class ISingleEthereum { public abstract core: ICore; public abstract metadata: SingleEthereumTypes.Metadata; public abstract chainId: number; - public abstract signConfig: Web3WalletTypes.SignConfig; + public abstract signConfig: WalletKitTypes.SignConfig; constructor(public opts: SingleEthereumTypes.Options) {} @@ -118,10 +106,10 @@ export abstract class ISingleEthereum { public abstract getPendingSessionRequests: ISingleEthereumEngine["getPendingSessionRequests"]; // auth // - public abstract formatAuthMessage: ISingleEthereumEngine["formatAuthMessage"]; + // public abstract formatAuthMessage: ISingleEthereumEngine["formatAuthMessage"]; public abstract approveAuthRequest: ISingleEthereumEngine["approveAuthRequest"]; public abstract rejectAuthRequest: ISingleEthereumEngine["rejectAuthRequest"]; - public abstract getPendingAuthRequests: ISingleEthereumEngine["getPendingAuthRequests"]; + // public abstract getPendingAuthRequests: ISingleEthereumEngine["getPendingAuthRequests"]; // ---------- Event Handlers ----------------------------------------------- // public abstract on: ( diff --git a/src/types/engine.ts b/src/types/engine.ts index 7eb155a..87cc5a1 100644 --- a/src/types/engine.ts +++ b/src/types/engine.ts @@ -1,9 +1,9 @@ import { ErrorResponse } from "@walletconnect/jsonrpc-utils"; import { PendingRequestTypes, ProposalTypes, SessionTypes } from "@walletconnect/types"; -import { IWeb3Wallet } from "@walletconnect/web3wallet"; -import { ISingleEthereum, SingleEthereumTypes } from "./client"; +import { ISingleEthereum } from "./client"; +import { IWalletKit } from "@reown/walletkit"; export abstract class ISingleEthereumEngine { - public abstract web3wallet: IWeb3Wallet; + public abstract web3wallet: IWalletKit; public abstract chainId?: number; constructor(public client: ISingleEthereum) {} @@ -60,12 +60,5 @@ export abstract class ISingleEthereumEngine { address: string; }): Promise; - public abstract formatAuthMessage( - payload: SingleEthereumTypes.CacaoRequestPayload, - address: string, - ): string; - public abstract rejectAuthRequest(params: { id: number; error: ErrorResponse }): Promise; - - public abstract getPendingAuthRequests(): Record; } diff --git a/test/auth.spec.ts b/test/auth.spec.ts deleted file mode 100644 index 25b922c..0000000 --- a/test/auth.spec.ts +++ /dev/null @@ -1,161 +0,0 @@ -import { Core } from "@walletconnect/core"; -import { ICore } from "@walletconnect/types"; -import { Wallet as CryptoWallet } from "@ethersproject/wallet"; - -import { expect, describe, it, beforeEach, beforeAll, afterAll } from "vitest"; -import { SingleEthereum, ISingleEthereum } from "../src"; -import { disconnect, TEST_CORE_OPTIONS } from "./shared"; -import { - AuthClient, - AuthEngineTypes, - generateNonce, - IAuthClient, -} from "@walletconnect/auth-client"; -import { formatAuthAddress } from "../src/utils"; - -const defaultRequestParams: AuthEngineTypes.RequestParams = { - aud: "http://localhost:3000/login", - domain: "localhost:3000", - chainId: "eip155:1", - nonce: generateNonce(), -}; - -describe("Auth Integration", () => { - let core: ICore; - let wallet: ISingleEthereum; - let dapp: IAuthClient; - let uriString: string; - let cryptoWallet: CryptoWallet; - - beforeAll(() => { - cryptoWallet = CryptoWallet.createRandom(); - }); - - afterAll(async () => { - await disconnect(core); - }); - - beforeEach(async () => { - core = new Core(TEST_CORE_OPTIONS); - dapp = await AuthClient.init({ - projectId: TEST_CORE_OPTIONS.projectId, - metadata: {} as any, - name: "dapp", - }); - wallet = await SingleEthereum.init({ core, name: "wallet", metadata: {} as any, chainId: 1 }); - expect(wallet).to.be.exist; - expect(dapp).to.be.exist; - expect(core).to.be.exist; - }); - - it("should respond to auth request", async () => { - const request = await dapp.request(defaultRequestParams); - uriString = request.uri!; - - await Promise.all([ - new Promise((resolve) => { - wallet.on("auth_request", async (authRequest) => { - const { id, params } = authRequest; - expect(params.cacaoPayload.aud).to.toMatchObject(defaultRequestParams.aud); - expect(params.cacaoPayload.domain).to.toMatchObject(defaultRequestParams.domain); - expect(params.cacaoPayload.nonce).to.toMatchObject(defaultRequestParams.nonce); - - const message = wallet.formatAuthMessage(params.cacaoPayload, cryptoWallet.address); - const signature = await cryptoWallet.signMessage(message); - - resolve( - await wallet.approveAuthRequest({ - id, - signature, - address: cryptoWallet.address, - }), - ); - }); - }), - new Promise((resolve) => { - dapp.on("auth_response", (authResponse: any) => { - expect(authResponse).to.be.exist; - expect(authResponse).to.have.property("id"); - expect(authResponse).to.have.property("topic"); - expect(authResponse.params.result.p.iss).to.eq(formatAuthAddress(cryptoWallet.address)); - resolve(); - }); - }), - wallet.pair({ uri: request.uri!, activatePairing: true }), - ]); - }); - - it("should reject auth request", async () => { - const request = await dapp.request(defaultRequestParams); - uriString = request.uri!; - const errorResponse = { - code: 14001, - message: "Can not login", - }; - await Promise.all([ - new Promise((resolve) => { - wallet.on("auth_request", async (authRequest) => { - const { id, params } = authRequest; - expect(params.cacaoPayload.aud).to.toMatchObject(defaultRequestParams.aud); - expect(params.cacaoPayload.domain).to.toMatchObject(defaultRequestParams.domain); - expect(params.cacaoPayload.nonce).to.toMatchObject(defaultRequestParams.nonce); - resolve( - await wallet.rejectAuthRequest({ - id, - error: errorResponse, - }), - ); - }); - }), - new Promise((resolve) => { - dapp.on("auth_response", (authResponse: any) => { - expect(authResponse).to.be.exist; - expect(authResponse).to.have.property("id"); - expect(authResponse).to.have.property("topic"); - expect(authResponse.params.error).to.toMatchObject(errorResponse); - resolve(); - }); - }), - wallet.pair({ uri: request.uri!, activatePairing: true }), - ]); - }); - - it("should get pending auth request", async () => { - const request = await dapp.request(defaultRequestParams); - uriString = request.uri!; - - await Promise.all([ - new Promise((resolve) => { - wallet.on("auth_request", async (authRequest) => { - const pendingRequest = wallet.getPendingAuthRequests(); - const { id, cacaoPayload } = pendingRequest[0]; - - expect(cacaoPayload.aud).to.toMatchObject(defaultRequestParams.aud); - expect(cacaoPayload.domain).to.toMatchObject(defaultRequestParams.domain); - expect(cacaoPayload.nonce).to.toMatchObject(defaultRequestParams.nonce); - - const message = wallet.formatAuthMessage(cacaoPayload, cryptoWallet.address); - const signature = await cryptoWallet.signMessage(message); - - resolve( - await wallet.approveAuthRequest({ - id, - signature, - address: cryptoWallet.address, - }), - ); - }); - }), - new Promise((resolve) => { - dapp.on("auth_response", async (authResponse: any) => { - expect(authResponse).to.be.exist; - expect(authResponse).to.have.property("id"); - expect(authResponse).to.have.property("topic"); - expect(authResponse.params.result.p.iss).to.eq(formatAuthAddress(cryptoWallet.address)); - resolve(); - }); - }), - wallet.pair({ uri: request.uri!, activatePairing: true }), - ]); - }); -}); diff --git a/yarn.lock b/yarn.lock index 1722b93..b9dd627 100644 --- a/yarn.lock +++ b/yarn.lock @@ -205,7 +205,7 @@ dependencies: "@ethersproject/bignumber" "^5.7.0" -"@ethersproject/hash@^5.7.0": +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -338,7 +338,7 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -538,6 +538,19 @@ "@parcel/watcher-win32-ia32" "2.3.0" "@parcel/watcher-win32-x64" "2.3.0" +"@reown/walletkit@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@reown/walletkit/-/walletkit-1.1.1.tgz#8d4e77a1fd92d16827dbb11338d60fd6000eab08" + integrity sha512-GTPksxBO6VAsqiQ0oH2jt8C845Y7redpI4OxRy31vf7KKDPPGfldbsTYZ+FP9xSda00dCJJKuXhzewZT/xHuDg== + dependencies: + "@walletconnect/core" "2.17.1" + "@walletconnect/jsonrpc-provider" "1.0.14" + "@walletconnect/jsonrpc-utils" "1.0.8" + "@walletconnect/logger" "2.1.2" + "@walletconnect/sign-client" "2.17.1" + "@walletconnect/types" "2.17.1" + "@walletconnect/utils" "2.17.1" + "@rollup/plugin-commonjs@24.0.1": version "24.0.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz#d54ba26a3e3c495dc332bd27a81f7e9e2df46f90" @@ -715,7 +728,7 @@ "@stablelib/binary" "^1.0.1" "@stablelib/wipe" "^1.0.1" -"@stablelib/sha256@1.0.1", "@stablelib/sha256@^1.0.1": +"@stablelib/sha256@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/sha256/-/sha256-1.0.1.tgz#77b6675b67f9b0ea081d2e31bda4866297a3ae4f" integrity sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ== @@ -738,7 +751,7 @@ resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36" integrity sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg== -"@stablelib/x25519@1.0.3", "@stablelib/x25519@^1.0.3": +"@stablelib/x25519@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@stablelib/x25519/-/x25519-1.0.3.tgz#13c8174f774ea9f3e5e42213cbf9fc68a3c7b7fd" integrity sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw== @@ -915,29 +928,10 @@ loupe "^2.3.6" pretty-format "^27.5.1" -"@walletconnect/auth-client@2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@walletconnect/auth-client/-/auth-client-2.1.2.tgz#cee304fb0cdca76f6bf4aafac96ef9301862a7e8" - integrity sha512-ubJLn+vGb8sTdBFX6xAh4kjR5idrtS3RBngQWaJJJpEPBQmxMb8pM2q0FIRs8Is4K6jKy+uEhusMV+7ZBmTzjw== - dependencies: - "@ethersproject/hash" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@stablelib/random" "^1.0.2" - "@stablelib/sha256" "^1.0.1" - "@walletconnect/core" "^2.10.1" - "@walletconnect/events" "^1.0.1" - "@walletconnect/heartbeat" "^1.2.1" - "@walletconnect/jsonrpc-utils" "^1.0.8" - "@walletconnect/logger" "^2.0.1" - "@walletconnect/time" "^1.0.2" - "@walletconnect/utils" "^2.10.1" - events "^3.3.0" - isomorphic-unfetch "^3.1.0" - -"@walletconnect/core@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.15.0.tgz#0d15e48964f99f2073964ec3776bd032fb6fa3b3" - integrity sha512-QekYQlpxyn2bcQXMkMxo0+v7nUOQKyu3j5ZKzTg/HGU1eSgTRLIvYIEkC8VVflIgOw7meOAb5pFChX51wShksQ== +"@walletconnect/core@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.17.1.tgz#8ee51d630068e4450014fe62a76af895ab1d349d" + integrity sha512-SMgJR5hEyEE/tENIuvlEb4aB9tmMXPzQ38Y61VgYBmwAFEhOHtpt8EDfnfRWqEhMyXuBXG4K70Yh8c67Yry+Xw== dependencies: "@walletconnect/heartbeat" "1.2.2" "@walletconnect/jsonrpc-provider" "1.0.14" @@ -950,34 +944,13 @@ "@walletconnect/relay-auth" "1.0.4" "@walletconnect/safe-json" "1.0.2" "@walletconnect/time" "1.0.2" - "@walletconnect/types" "2.15.0" - "@walletconnect/utils" "2.15.0" + "@walletconnect/types" "2.17.1" + "@walletconnect/utils" "2.17.1" + "@walletconnect/window-getters" "1.0.1" events "3.3.0" lodash.isequal "4.5.0" uint8arrays "3.1.0" -"@walletconnect/core@^2.10.1": - version "2.10.1" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.1.tgz#d1fb442bd77424666bacdb0f5a07f7708fb3d984" - integrity sha512-WAoXfmj+Zy5q48TnrKUjmHXJCBahzKwbul+noepRZf7JDtUAZ9IOWpUjg+UPRbfK5EiWZ0TF42S6SXidf7EHoQ== - dependencies: - "@walletconnect/heartbeat" "1.2.1" - "@walletconnect/jsonrpc-provider" "1.0.13" - "@walletconnect/jsonrpc-types" "1.0.3" - "@walletconnect/jsonrpc-utils" "1.0.8" - "@walletconnect/jsonrpc-ws-connection" "1.0.13" - "@walletconnect/keyvaluestorage" "^1.0.2" - "@walletconnect/logger" "^2.0.1" - "@walletconnect/relay-api" "^1.0.9" - "@walletconnect/relay-auth" "^1.0.4" - "@walletconnect/safe-json" "^1.0.2" - "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.1" - "@walletconnect/utils" "2.10.1" - events "^3.3.0" - lodash.isequal "4.5.0" - uint8arrays "^3.1.0" - "@walletconnect/environment@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/environment/-/environment-1.0.1.tgz#1d7f82f0009ab821a2ba5ad5e5a7b8ae3b214cd7" @@ -993,15 +966,6 @@ keyvaluestorage-interface "^1.0.0" tslib "1.14.1" -"@walletconnect/heartbeat@1.2.1", "@walletconnect/heartbeat@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@walletconnect/heartbeat/-/heartbeat-1.2.1.tgz#afaa3a53232ae182d7c9cff41c1084472d8f32e9" - integrity sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q== - dependencies: - "@walletconnect/events" "^1.0.1" - "@walletconnect/time" "^1.0.2" - tslib "1.14.1" - "@walletconnect/heartbeat@1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@walletconnect/heartbeat/-/heartbeat-1.2.2.tgz#e8dc5179db7769950c6f9cf59b23516d9b95227d" @@ -1011,15 +975,6 @@ "@walletconnect/time" "^1.0.2" events "^3.3.0" -"@walletconnect/jsonrpc-provider@1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.13.tgz#9a74da648d015e1fffc745f0c7d629457f53648b" - integrity sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g== - dependencies: - "@walletconnect/jsonrpc-utils" "^1.0.8" - "@walletconnect/safe-json" "^1.0.2" - tslib "1.14.1" - "@walletconnect/jsonrpc-provider@1.0.14": version "1.0.14" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.14.tgz#696f3e3b6d728b361f2e8b853cfc6afbdf2e4e3e" @@ -1029,14 +984,6 @@ "@walletconnect/safe-json" "^1.0.2" events "^3.3.0" -"@walletconnect/jsonrpc-types@1.0.3", "@walletconnect/jsonrpc-types@^1.0.2", "@walletconnect/jsonrpc-types@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz#65e3b77046f1a7fa8347ae02bc1b841abe6f290c" - integrity sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw== - dependencies: - keyvaluestorage-interface "^1.0.0" - tslib "1.14.1" - "@walletconnect/jsonrpc-types@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz#ce1a667d79eadf2a2d9d002c152ceb68739c230c" @@ -1045,6 +992,14 @@ events "^3.3.0" keyvaluestorage-interface "^1.0.0" +"@walletconnect/jsonrpc-types@^1.0.2", "@walletconnect/jsonrpc-types@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz#65e3b77046f1a7fa8347ae02bc1b841abe6f290c" + integrity sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw== + dependencies: + keyvaluestorage-interface "^1.0.0" + tslib "1.14.1" + "@walletconnect/jsonrpc-utils@1.0.8", "@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.8": version "1.0.8" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.8.tgz#82d0cc6a5d6ff0ecc277cb35f71402c91ad48d72" @@ -1054,17 +1009,6 @@ "@walletconnect/jsonrpc-types" "^1.0.3" tslib "1.14.1" -"@walletconnect/jsonrpc-ws-connection@1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.13.tgz#23b0cdd899801bfbb44a6556936ec2b93ef2adf4" - integrity sha512-mfOM7uFH4lGtQxG+XklYuFBj6dwVvseTt5/ahOkkmpcAEgz2umuzu7fTR+h5EmjQBdrmYyEBOWADbeaFNxdySg== - dependencies: - "@walletconnect/jsonrpc-utils" "^1.0.6" - "@walletconnect/safe-json" "^1.0.2" - events "^3.3.0" - tslib "1.14.1" - ws "^7.5.1" - "@walletconnect/jsonrpc-ws-connection@1.0.14": version "1.0.14" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.14.tgz#eec700e74766c7887de2bd76c91a0206628732aa" @@ -1084,14 +1028,6 @@ idb-keyval "^6.2.1" unstorage "^1.9.0" -"@walletconnect/keyvaluestorage@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.0.2.tgz#92f5ca0f54c1a88a093778842ce0c874d86369c8" - integrity sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ== - dependencies: - safe-json-utils "^1.1.1" - tslib "1.14.1" - "@walletconnect/logger@2.1.2": version "2.1.2" resolved "https://registry.yarnpkg.com/@walletconnect/logger/-/logger-2.1.2.tgz#813c9af61b96323a99f16c10089bfeb525e2a272" @@ -1100,14 +1036,6 @@ "@walletconnect/safe-json" "^1.0.2" pino "7.11.0" -"@walletconnect/logger@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@walletconnect/logger/-/logger-2.0.1.tgz#7f489b96e9a1ff6bf3e58f0fbd6d69718bf844a8" - integrity sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ== - dependencies: - pino "7.11.0" - tslib "1.14.1" - "@walletconnect/relay-api@1.0.11": version "1.0.11" resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.11.tgz#80ab7ef2e83c6c173be1a59756f95e515fb63224" @@ -1115,15 +1043,7 @@ dependencies: "@walletconnect/jsonrpc-types" "^1.0.2" -"@walletconnect/relay-api@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.9.tgz#f8c2c3993dddaa9f33ed42197fc9bfebd790ecaf" - integrity sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg== - dependencies: - "@walletconnect/jsonrpc-types" "^1.0.2" - tslib "1.14.1" - -"@walletconnect/relay-auth@1.0.4", "@walletconnect/relay-auth@^1.0.4": +"@walletconnect/relay-auth@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@walletconnect/relay-auth/-/relay-auth-1.0.4.tgz#0b5c55c9aa3b0ef61f526ce679f3ff8a5c4c2c7c" integrity sha512-kKJcS6+WxYq5kshpPaxGHdwf5y98ZwbfuS4EE/NkQzqrDFm5Cj+dP8LofzWvjrrLkZq7Afy7WrQMXdLy8Sx7HQ== @@ -1142,19 +1062,19 @@ dependencies: tslib "1.14.1" -"@walletconnect/sign-client@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.15.0.tgz#bad69a2850dac26d011ba54be86073455fc398c8" - integrity sha512-efwrPfIwKWKeku44TGBCnQqPZGCILI1wBKK9bTF0F0/qrLR/zRe6RWpM3/L4+jOMr/BktxPZ5lRozBh+c2U7Pg== +"@walletconnect/sign-client@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.17.1.tgz#0777536427eba1b725c111ecc08eb301e05a8c55" + integrity sha512-6rLw6YNy0smslH9wrFTbNiYrGsL3DrOsS5FcuU4gIN6oh8pGYOFZ5FiSyTTroc5tngOk3/Sd7dlGY9S7O4nveg== dependencies: - "@walletconnect/core" "2.15.0" + "@walletconnect/core" "2.17.1" "@walletconnect/events" "1.0.1" "@walletconnect/heartbeat" "1.2.2" "@walletconnect/jsonrpc-utils" "1.0.8" "@walletconnect/logger" "2.1.2" "@walletconnect/time" "1.0.2" - "@walletconnect/types" "2.15.0" - "@walletconnect/utils" "2.15.0" + "@walletconnect/types" "2.17.1" + "@walletconnect/utils" "2.17.1" events "3.3.0" "@walletconnect/time@1.0.2", "@walletconnect/time@^1.0.2": @@ -1164,22 +1084,10 @@ dependencies: tslib "1.14.1" -"@walletconnect/types@2.10.1": - version "2.10.1" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.1.tgz#1355bce236f3eef575716ea3efe4beed98a873ef" - integrity sha512-7pccAhajQdiH2kYywjE1XI64IqRI+4ioyGy0wvz8d0UFQ/DSG3MLKR8jHf5aTOafQQ/HRLz6xvlzN4a7gIVkUQ== - dependencies: - "@walletconnect/events" "^1.0.1" - "@walletconnect/heartbeat" "1.2.1" - "@walletconnect/jsonrpc-types" "1.0.3" - "@walletconnect/keyvaluestorage" "^1.0.2" - "@walletconnect/logger" "^2.0.1" - events "^3.3.0" - -"@walletconnect/types@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.15.0.tgz#4593a138fbf31bf7dc4317f59de643c20d3c8dbb" - integrity sha512-hLffDKKe70jIrK+YcLkAnzi6vqNki1SDBWjV+M/72mKcU2KzXxk0G2STFsWsQDx8DoqxMiuGehd0DlD1jwQmBg== +"@walletconnect/types@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.17.1.tgz#425dedbe5853231252d081f61448c55ecd341c96" + integrity sha512-aiUeBE3EZZTsZBv5Cju3D0PWAsZCMks1g3hzQs9oNtrbuLL6pKKU0/zpKwk4vGywszxPvC3U0tBCku9LLsH/0A== dependencies: "@walletconnect/events" "1.0.1" "@walletconnect/heartbeat" "1.2.2" @@ -1188,61 +1096,32 @@ "@walletconnect/logger" "2.1.2" events "3.3.0" -"@walletconnect/utils@2.10.1", "@walletconnect/utils@^2.10.1": - version "2.10.1" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.1.tgz#65b37c9800eb0e80a08385b6987471fb46e1e22e" - integrity sha512-DM0dKgm9O58l7VqJEyV2OVv16XRePhDAReI23let6WdW1dSpw/Y/A89Lp99ZJOjLm2FxyblMRF3YRaZtHwBffw== - dependencies: - "@stablelib/chacha20poly1305" "1.0.1" - "@stablelib/hkdf" "1.0.1" - "@stablelib/random" "^1.0.2" - "@stablelib/sha256" "1.0.1" - "@stablelib/x25519" "^1.0.3" - "@walletconnect/relay-api" "^1.0.9" - "@walletconnect/safe-json" "^1.0.2" - "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.1" - "@walletconnect/window-getters" "^1.0.1" - "@walletconnect/window-metadata" "^1.0.1" - detect-browser "5.3.0" - query-string "7.1.3" - uint8arrays "^3.1.0" - -"@walletconnect/utils@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.15.0.tgz#864f800e7cccdabc631215119f8ab3f1c71d4e41" - integrity sha512-xaazgCMyr5fUPm2QuZ76G+W8beDfKMILqJ3INL6wyuaLil2YQNdsCSvWMNhSP+EZeKD3SUqqBmQaM/maP0YHTg== +"@walletconnect/utils@2.17.1": + version "2.17.1" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.17.1.tgz#fc57ffb89fc101fa1bf015de016ea01091d10ae0" + integrity sha512-KL7pPwq7qUC+zcTmvxGqIyYanfHgBQ+PFd0TEblg88jM7EjuDLhjyyjtkhyE/2q7QgR7OanIK7pCpilhWvBsBQ== dependencies: + "@ethersproject/hash" "5.7.0" + "@ethersproject/transactions" "5.7.0" "@stablelib/chacha20poly1305" "1.0.1" "@stablelib/hkdf" "1.0.1" "@stablelib/random" "1.0.2" "@stablelib/sha256" "1.0.1" "@stablelib/x25519" "1.0.3" + "@walletconnect/jsonrpc-utils" "1.0.8" + "@walletconnect/keyvaluestorage" "1.1.1" "@walletconnect/relay-api" "1.0.11" + "@walletconnect/relay-auth" "1.0.4" "@walletconnect/safe-json" "1.0.2" "@walletconnect/time" "1.0.2" - "@walletconnect/types" "2.15.0" + "@walletconnect/types" "2.17.1" "@walletconnect/window-getters" "1.0.1" "@walletconnect/window-metadata" "1.0.1" detect-browser "5.3.0" - elliptic "^6.5.7" + elliptic "6.5.7" query-string "7.1.3" uint8arrays "3.1.0" -"@walletconnect/web3wallet@1.14.0": - version "1.14.0" - resolved "https://registry.yarnpkg.com/@walletconnect/web3wallet/-/web3wallet-1.14.0.tgz#e30c917de593728af81c6be3cef6b8f1a80b91c1" - integrity sha512-vBBicK4PJGwmiU1NgxSnflTJlbbZjmuTlbdTGCCL4w6eW/CtsY4zNnTNmrGhlej0CkGr0M+Jw6RbFtxpMEYqZA== - dependencies: - "@walletconnect/auth-client" "2.1.2" - "@walletconnect/core" "2.15.0" - "@walletconnect/jsonrpc-provider" "1.0.14" - "@walletconnect/jsonrpc-utils" "1.0.8" - "@walletconnect/logger" "2.1.2" - "@walletconnect/sign-client" "2.15.0" - "@walletconnect/types" "2.15.0" - "@walletconnect/utils" "2.15.0" - "@walletconnect/window-getters@1.0.1", "@walletconnect/window-getters@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-getters/-/window-getters-1.0.1.tgz#f36d1c72558a7f6b87ecc4451fc8bd44f63cbbdc" @@ -1250,7 +1129,7 @@ dependencies: tslib "1.14.1" -"@walletconnect/window-metadata@1.0.1", "@walletconnect/window-metadata@^1.0.1": +"@walletconnect/window-metadata@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz#2124f75447b7e989e4e4e1581d55d25bc75f7be5" integrity sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA== @@ -1720,7 +1599,7 @@ elliptic@6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -elliptic@^6.5.7: +elliptic@6.5.7: version "6.5.7" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== @@ -2678,14 +2557,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isomorphic-unfetch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" - integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== - dependencies: - node-fetch "^2.6.1" - unfetch "^4.2.0" - jiti@^1.20.0: version "1.21.0" resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" @@ -3009,13 +2880,6 @@ node-fetch-native@^1.4.0, node-fetch-native@^1.4.1: resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.1.tgz#f95c74917d3cebc794cdae0cd2a9c7594aad0cb4" integrity sha512-bW9T/uJDPAJB2YNYEpWzE54U5O3MQidXsOyTfnbKYtTtFexRvGzb1waphBN4ZwP6EcIvYYEOwW0b72BpAqydTw== -node-fetch@^2.6.1: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== - dependencies: - whatwg-url "^5.0.0" - node-forge@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -3475,11 +3339,6 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-json-utils@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/safe-json-utils/-/safe-json-utils-1.1.1.tgz#0e883874467d95ab914c3f511096b89bfb3e63b1" - integrity sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ== - safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" @@ -3732,11 +3591,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - tsconfig-paths@^3.14.1: version "3.14.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" @@ -3837,7 +3691,7 @@ uint8arrays@3.1.0: dependencies: multiformats "^9.4.2" -uint8arrays@^3.0.0, uint8arrays@^3.1.0: +uint8arrays@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.1.1.tgz#2d8762acce159ccd9936057572dade9459f65ae0" integrity sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg== @@ -3870,11 +3724,6 @@ unenv@^1.7.4: node-fetch-native "^1.4.1" pathe "^1.1.1" -unfetch@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" - integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== - unstorage@^1.9.0: version "1.10.1" resolved "https://registry.yarnpkg.com/unstorage/-/unstorage-1.10.1.tgz#bf8cc00a406e40a6293e893da9807057d95875b0" @@ -3984,24 +3833,11 @@ vitest@^0.31.1: vite-node "0.31.4" why-is-node-running "^2.2.2" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - well-known-symbols@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-2.0.0.tgz#e9c7c07dbd132b7b84212c8174391ec1f9871ba5" integrity sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q== -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"