From f3a2223022dea8b53e58d92dc38c990abbec52b2 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 23 Jul 2024 17:56:47 +0200 Subject: [PATCH 01/11] task: gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c2cb4e3..ae9891d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +.idea \ No newline at end of file From 58a7a8f78c83f7217950fbb59a0a76c5d16c0edf Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 23 Jul 2024 18:33:07 +0200 Subject: [PATCH 02/11] task: use provider form hosted --- package.json | 2 +- .../modules/wallet/hooks/useWalletAuth.tsx | 21 ++++++++++--------- .../modules/wallet/hooks/useWalletContext.ts | 8 +++---- src/app/modules/wallet/services/context.tsx | 16 +++++++------- yarn.lock | 11 +++++----- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 6382b42..edb646f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/connect-hosted-sdk": "^0.1.0-dev.6", + "@cometh/connect-hosted-sdk": "^0.1.0-dev.8", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", diff --git a/src/app/modules/wallet/hooks/useWalletAuth.tsx b/src/app/modules/wallet/hooks/useWalletAuth.tsx index 443c330..863f106 100644 --- a/src/app/modules/wallet/hooks/useWalletAuth.tsx +++ b/src/app/modules/wallet/hooks/useWalletAuth.tsx @@ -1,9 +1,9 @@ "use client"; -import {useEffect, useState} from "react"; +import {useState} from "react"; import {ethers} from "ethers"; import countContractAbi from "../../contract/counterABI.json"; -import {ComethAuth, ComethWallet, ComethWalletSigner} from "@cometh/connect-hosted-sdk"; +import {ComethAuth, ComethWallet, ComethProvider} from "@cometh/connect-hosted-sdk"; import {useWalletContext} from "@/app/modules/wallet/hooks/useWalletContext"; export function useWalletAuth() { @@ -12,8 +12,8 @@ export function useWalletAuth() { setWallet, auth, setAuth, - signer, - setSigner, + provider, + setProvider, counterContract, setCounterContract, } = useWalletContext(); @@ -45,22 +45,23 @@ export function useWalletAuth() { oidcUrl, connectUrl }) - const signer = new ComethWalletSigner(wallet) + await auth.login() + // with final UI, should refactor to force display modal of wallet.connect if not signup + await wallet.connect() + const provider = new ComethProvider(wallet) const counterContract = new ethers.Contract( counterContractAddress, countContractAbi, - signer + provider.signer ); - await auth.login() - // with final UI, should refactor to force display modal of wallet.connect if not signup - await wallet.connect() setIsConnected(true); setAuth(auth) setWallet(wallet) - setSigner(signer) + setProvider(provider) setCounterContract(counterContract) console.log('setup sdks: ', wallet, auth) } catch (e) { + console.error(e) displayError((e as Error).message); } finally { setIsConnecting(false); diff --git a/src/app/modules/wallet/hooks/useWalletContext.ts b/src/app/modules/wallet/hooks/useWalletContext.ts index 379f34d..0a32e57 100644 --- a/src/app/modules/wallet/hooks/useWalletContext.ts +++ b/src/app/modules/wallet/hooks/useWalletContext.ts @@ -5,8 +5,8 @@ export function useWalletContext() { const { wallet, setWallet, - signer, - setSigner, + provider, + setProvider, auth, setAuth, counterContract, @@ -15,8 +15,8 @@ export function useWalletContext() { return { wallet, setWallet, - signer, - setSigner, + provider, + setProvider, auth, setAuth, counterContract, diff --git a/src/app/modules/wallet/services/context.tsx b/src/app/modules/wallet/services/context.tsx index 272eb2b..66e97d6 100644 --- a/src/app/modules/wallet/services/context.tsx +++ b/src/app/modules/wallet/services/context.tsx @@ -1,13 +1,13 @@ "use client"; -import {ComethAuth, ComethWallet, ComethWalletSigner} from "@cometh/connect-hosted-sdk"; +import {ComethAuth, ComethProvider, ComethWallet} from "@cometh/connect-hosted-sdk"; import {ethers} from "ethers"; import {createContext, Dispatch, SetStateAction, useState} from "react"; export const WalletContext = createContext<{ wallet: ComethWallet | null; setWallet: Dispatch>; - signer: ComethWalletSigner | null; - setSigner: Dispatch>; + provider: ComethProvider | null; + setProvider: Dispatch>; auth: ComethAuth | null; setAuth: Dispatch>; counterContract: ethers.Contract | null; @@ -16,8 +16,8 @@ export const WalletContext = createContext<{ wallet: null, setWallet: () => { }, - signer: null, - setSigner: () => { + provider: null, + setProvider: () => { }, auth: null, setAuth: () => { @@ -33,7 +33,7 @@ export function WalletProvider({ children: React.ReactNode; }): JSX.Element { const [wallet, setWallet] = useState(null); - const [signer, setSigner] = useState(null); + const [provider, setProvider] = useState(null); const [auth, setAuth] = useState(null); const [counterContract, setCounterContract] = useState(null); @@ -43,8 +43,8 @@ export function WalletProvider({ value={{ wallet, setWallet, - signer, - setSigner, + provider, + setProvider, auth, setAuth, counterContract, diff --git a/yarn.lock b/yarn.lock index 3f19e7f..de6fec8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,15 +19,16 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/connect-hosted-sdk@^0.1.0-dev.6": - version "0.1.0-dev.6" - resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.6.tgz#c5c83aa74e2e53c8ad9f14fd20d96466467b3149" - integrity sha512-woDznAq8/0ne8praDliutQNwbHP8gY4/Z6Ja3EK/YM+kHXZQ4B51G4b9ekGyT6fLq+cnMOoi2FeMD/0NrTQs1w== +"@cometh/connect-hosted-sdk@^0.1.0-dev.8": + version "0.1.0-dev.8" + resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.8.tgz#d685998868e4470f40348d10392454f9da9b1d46" + integrity sha512-I5l3dHQcu+kDm4vQoi37fx6tPK5FH5wXONniCpABNEurHRL8j1Xq+abSsQtDe5WlMB7cTNDLccDWwxw/45BSWQ== dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" "@ethersproject/bignumber" "^5.7.0" "@ethersproject/bytes" "^5.7.0" + "@ethersproject/providers" "^5.7.2" "@ethersproject/transactions" "^5.7.0" axios "^1.6.8" ethers-multisend "^3.1.0" @@ -256,7 +257,7 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/providers@5.7.2": +"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": version "5.7.2" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== From a7845bfdf93a1db5ebed74570b7847c40a71ca8d Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 25 Jul 2024 10:55:25 +0200 Subject: [PATCH 03/11] task: use new UI --- src/app/modules/wallet/hooks/useWalletAuth.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/wallet/hooks/useWalletAuth.tsx b/src/app/modules/wallet/hooks/useWalletAuth.tsx index 863f106..4733185 100644 --- a/src/app/modules/wallet/hooks/useWalletAuth.tsx +++ b/src/app/modules/wallet/hooks/useWalletAuth.tsx @@ -45,7 +45,7 @@ export function useWalletAuth() { oidcUrl, connectUrl }) - await auth.login() + //await auth.login() // with final UI, should refactor to force display modal of wallet.connect if not signup await wallet.connect() const provider = new ComethProvider(wallet) From a0d4614411c673bb5c1e6555184a3e2f5362b12b Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 29 Jul 2024 12:17:34 +0200 Subject: [PATCH 04/11] task: use new auth --- package.json | 2 +- src/app/modules/wallet/hooks/useWalletAuth.tsx | 14 ++++++++------ yarn.lock | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index edb646f..67c4b03 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/connect-hosted-sdk": "^0.1.0-dev.8", + "@cometh/connect-hosted-sdk": "0.1.0-dev.14", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", diff --git a/src/app/modules/wallet/hooks/useWalletAuth.tsx b/src/app/modules/wallet/hooks/useWalletAuth.tsx index 4733185..6c1f842 100644 --- a/src/app/modules/wallet/hooks/useWalletAuth.tsx +++ b/src/app/modules/wallet/hooks/useWalletAuth.tsx @@ -3,7 +3,7 @@ import {useState} from "react"; import {ethers} from "ethers"; import countContractAbi from "../../contract/counterABI.json"; -import {ComethAuth, ComethWallet, ComethProvider} from "@cometh/connect-hosted-sdk"; +import {ComethAuth, ComethProvider, ComethWallet} from "@cometh/connect-hosted-sdk"; import {useWalletContext} from "@/app/modules/wallet/hooks/useWalletContext"; export function useWalletAuth() { @@ -25,6 +25,7 @@ export function useWalletAuth() { const apiKey = process.env.NEXT_PUBLIC_COMETH_API_KEY as string; const connectUrl = process.env.NEXT_PUBLIC_COMETH_CONNECT_API_URL as string; const oidcUrl = process.env.NEXT_PUBLIC_COMETH_OIDC_API_URL as string; + const oidcAppUrl = process.env.NEXT_PUBLIC_COMETH_OIDC_APP_URL as string; const counterContractAddress = process.env.NEXT_PUBLIC_COUNTER_CONTRACT_ADDRESS || "0x4FbF9EE4B2AF774D4617eAb027ac2901a41a7b5F"; @@ -37,15 +38,16 @@ export function useWalletAuth() { if (!apiKey) throw new Error("no apiKey provided"); setIsConnecting(true) try { + console.log('test: ', oidcAppUrl) const auth = new ComethAuth(apiKey, { - oidcUrl, - connectUrl + oidcApiURI: oidcUrl, + oidcAppURI: oidcAppUrl }) const wallet = new ComethWallet(apiKey, { - oidcUrl, - connectUrl + oidcAppURI: oidcAppUrl, + connectApiURI: connectUrl }) - //await auth.login() + await auth.login() // with final UI, should refactor to force display modal of wallet.connect if not signup await wallet.connect() const provider = new ComethProvider(wallet) diff --git a/yarn.lock b/yarn.lock index de6fec8..0b5143f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,10 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/connect-hosted-sdk@^0.1.0-dev.8": - version "0.1.0-dev.8" - resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.8.tgz#d685998868e4470f40348d10392454f9da9b1d46" - integrity sha512-I5l3dHQcu+kDm4vQoi37fx6tPK5FH5wXONniCpABNEurHRL8j1Xq+abSsQtDe5WlMB7cTNDLccDWwxw/45BSWQ== +"@cometh/connect-hosted-sdk@0.1.0-dev.14": + version "0.1.0-dev.14" + resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.14.tgz#a307a8a2c3293c380d786b4007f6452b49f92d2f" + integrity sha512-HhvHSc/AnDn6+yDvCFcusYZ2GlP+QApFrd5YkAHf/vi6cAmEf2qgF91KV7taDsJxz/cZFevWcENTikQHPS7bpQ== dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" From 768aab377205e4e1f223238d95cd6a0443785fde Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 29 Jul 2024 13:04:48 +0200 Subject: [PATCH 05/11] task: use new wallet --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 67c4b03..ad9884b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/connect-hosted-sdk": "0.1.0-dev.14", + "@cometh/connect-hosted-sdk": "0.1.0-dev.16", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", diff --git a/yarn.lock b/yarn.lock index 0b5143f..f0545de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,10 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/connect-hosted-sdk@0.1.0-dev.14": - version "0.1.0-dev.14" - resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.14.tgz#a307a8a2c3293c380d786b4007f6452b49f92d2f" - integrity sha512-HhvHSc/AnDn6+yDvCFcusYZ2GlP+QApFrd5YkAHf/vi6cAmEf2qgF91KV7taDsJxz/cZFevWcENTikQHPS7bpQ== +"@cometh/connect-hosted-sdk@0.1.0-dev.16": + version "0.1.0-dev.16" + resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.16.tgz#89de9378304d39656cdf1e70850498453505dbed" + integrity sha512-1xDTF9YGQjSIeQDxmPX243qqDUtXZqsYPWHh+Q8UHSLYRg34Sa4DHhqT91IeDJTdYfgord21y+cXk/g82nvLlw== dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" From 8241c7132d660792c97798feeed7f0805653ede2 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 29 Jul 2024 13:17:31 +0200 Subject: [PATCH 06/11] task: use new wallet --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ad9884b..2dbc867 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/connect-hosted-sdk": "0.1.0-dev.16", + "@cometh/connect-hosted-sdk": "0.1.0-dev.17", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", From a4628cbe0b09202a82605f3ede4b8735db04bc98 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 29 Jul 2024 15:19:01 +0200 Subject: [PATCH 07/11] task: up --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2dbc867..9a980f2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/connect-hosted-sdk": "0.1.0-dev.17", + "@cometh/connect-hosted-sdk": "0.1.0-dev.18", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", diff --git a/yarn.lock b/yarn.lock index f0545de..5524328 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,10 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/connect-hosted-sdk@0.1.0-dev.16": - version "0.1.0-dev.16" - resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.16.tgz#89de9378304d39656cdf1e70850498453505dbed" - integrity sha512-1xDTF9YGQjSIeQDxmPX243qqDUtXZqsYPWHh+Q8UHSLYRg34Sa4DHhqT91IeDJTdYfgord21y+cXk/g82nvLlw== +"@cometh/connect-hosted-sdk@0.1.0-dev.17": + version "0.1.0-dev.17" + resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.17.tgz#a7f4b9725560535eb00cbe3c3e4931e2ebc50261" + integrity sha512-CnTWikljk164ILK2nyFp2UaSwFScEvYba/43zxMVYonAEqyvZ4/PR0PRMvrKZTl00FTgfQWMksOUE+ZzRsI6Ww== dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" From fcd04248bf90c4e061b20b954722674e169d27ab Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 29 Jul 2024 15:19:14 +0200 Subject: [PATCH 08/11] task: up --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5524328..5a4a61a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,10 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/connect-hosted-sdk@0.1.0-dev.17": - version "0.1.0-dev.17" - resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.17.tgz#a7f4b9725560535eb00cbe3c3e4931e2ebc50261" - integrity sha512-CnTWikljk164ILK2nyFp2UaSwFScEvYba/43zxMVYonAEqyvZ4/PR0PRMvrKZTl00FTgfQWMksOUE+ZzRsI6Ww== +"@cometh/connect-hosted-sdk@0.1.0-dev.18": + version "0.1.0-dev.18" + resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.18.tgz#3acf17031775ae27143a438233564ca38b908299" + integrity sha512-qvEpKmBLYPYEAFrOV1mio+n3OPIweI5d+tk9KW7vmgdR3peD/zmkNlfB3Wt3IHROJqxPPRK75wMIgSkOZ9XYjg== dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" From 91dfc152f450f37d01d5a98166f55eff4fcf2493 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 6 Aug 2024 13:50:54 +0200 Subject: [PATCH 09/11] task: new version --- package.json | 2 +- src/app/components/ConnectWallet.tsx | 2 +- src/app/modules/wallet/hooks/useWalletAuth.tsx | 12 +++++++++--- src/app/modules/wallet/services/context.tsx | 2 +- yarn.lock | 6 ++---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 9a980f2..8ec7f8e 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/connect-hosted-sdk": "0.1.0-dev.18", + "@cometh/hosted-sdk-ethers": "file:.yalc/@cometh/hosted-sdk-ethers", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", diff --git a/src/app/components/ConnectWallet.tsx b/src/app/components/ConnectWallet.tsx index 74fa942..bf0640f 100644 --- a/src/app/components/ConnectWallet.tsx +++ b/src/app/components/ConnectWallet.tsx @@ -1,6 +1,6 @@ import { Icons } from "@/app/lib/ui/components"; import { CheckIcon } from "@radix-ui/react-icons"; -import {ComethWallet} from "@cometh/connect-hosted-sdk"; +import {ComethWallet} from "@cometh/hosted-sdk-ethers"; interface ConnectWalletProps { connectionError: string | null; diff --git a/src/app/modules/wallet/hooks/useWalletAuth.tsx b/src/app/modules/wallet/hooks/useWalletAuth.tsx index 6c1f842..02d8437 100644 --- a/src/app/modules/wallet/hooks/useWalletAuth.tsx +++ b/src/app/modules/wallet/hooks/useWalletAuth.tsx @@ -3,7 +3,7 @@ import {useState} from "react"; import {ethers} from "ethers"; import countContractAbi from "../../contract/counterABI.json"; -import {ComethAuth, ComethProvider, ComethWallet} from "@cometh/connect-hosted-sdk"; +import {ComethAuth, ComethProvider, ComethWallet, DisplayMode} from "@cometh/hosted-sdk-ethers"; import {useWalletContext} from "@/app/modules/wallet/hooks/useWalletContext"; export function useWalletAuth() { @@ -41,15 +41,21 @@ export function useWalletAuth() { console.log('test: ', oidcAppUrl) const auth = new ComethAuth(apiKey, { oidcApiURI: oidcUrl, - oidcAppURI: oidcAppUrl + oidcAppURI: oidcAppUrl, + display: DisplayMode.POPUP }) const wallet = new ComethWallet(apiKey, { oidcAppURI: oidcAppUrl, - connectApiURI: connectUrl + connectApiURI: connectUrl, + display: DisplayMode.POPUP }) + console.error('start login') await auth.login() + console.error('end login') // with final UI, should refactor to force display modal of wallet.connect if not signup + console.error('start connect') await wallet.connect() + console.error('end connect') const provider = new ComethProvider(wallet) const counterContract = new ethers.Contract( counterContractAddress, diff --git a/src/app/modules/wallet/services/context.tsx b/src/app/modules/wallet/services/context.tsx index 66e97d6..e6cc9fe 100644 --- a/src/app/modules/wallet/services/context.tsx +++ b/src/app/modules/wallet/services/context.tsx @@ -1,5 +1,5 @@ "use client"; -import {ComethAuth, ComethProvider, ComethWallet} from "@cometh/connect-hosted-sdk"; +import {ComethAuth, ComethProvider, ComethWallet} from "@cometh/hosted-sdk-ethers"; import {ethers} from "ethers"; import {createContext, Dispatch, SetStateAction, useState} from "react"; diff --git a/yarn.lock b/yarn.lock index 5a4a61a..ff0a7e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,8 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/connect-hosted-sdk@0.1.0-dev.18": - version "0.1.0-dev.18" - resolved "https://registry.yarnpkg.com/@cometh/connect-hosted-sdk/-/connect-hosted-sdk-0.1.0-dev.18.tgz#3acf17031775ae27143a438233564ca38b908299" - integrity sha512-qvEpKmBLYPYEAFrOV1mio+n3OPIweI5d+tk9KW7vmgdR3peD/zmkNlfB3Wt3IHROJqxPPRK75wMIgSkOZ9XYjg== +"@cometh/hosted-sdk-ethers@file:.yalc/@cometh/hosted-sdk-ethers": + version "0.1.0-dev.19" dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" From fdda44d5b6ccc6fde25335b20fbc7e1a52bcbe7a Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 6 Aug 2024 14:18:18 +0200 Subject: [PATCH 10/11] task: remove auth --- .../modules/wallet/hooks/useWalletAuth.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/app/modules/wallet/hooks/useWalletAuth.tsx b/src/app/modules/wallet/hooks/useWalletAuth.tsx index 02d8437..5c08af6 100644 --- a/src/app/modules/wallet/hooks/useWalletAuth.tsx +++ b/src/app/modules/wallet/hooks/useWalletAuth.tsx @@ -24,7 +24,7 @@ export function useWalletAuth() { const apiKey = process.env.NEXT_PUBLIC_COMETH_API_KEY as string; const connectUrl = process.env.NEXT_PUBLIC_COMETH_CONNECT_API_URL as string; - const oidcUrl = process.env.NEXT_PUBLIC_COMETH_OIDC_API_URL as string; + //const oidcUrl = process.env.NEXT_PUBLIC_COMETH_OIDC_API_URL as string; const oidcAppUrl = process.env.NEXT_PUBLIC_COMETH_OIDC_APP_URL as string; const counterContractAddress = process.env.NEXT_PUBLIC_COUNTER_CONTRACT_ADDRESS || @@ -39,23 +39,20 @@ export function useWalletAuth() { setIsConnecting(true) try { console.log('test: ', oidcAppUrl) - const auth = new ComethAuth(apiKey, { - oidcApiURI: oidcUrl, - oidcAppURI: oidcAppUrl, - display: DisplayMode.POPUP - }) + //const auth = new ComethAuth(apiKey, { + // oidcApiURI: oidcUrl, + // oidcAppURI: oidcAppUrl, + // display: DisplayMode.POPUP + //}) const wallet = new ComethWallet(apiKey, { oidcAppURI: oidcAppUrl, connectApiURI: connectUrl, display: DisplayMode.POPUP }) - console.error('start login') - await auth.login() - console.error('end login') + // we don't have login for now + //await auth.login() // with final UI, should refactor to force display modal of wallet.connect if not signup - console.error('start connect') await wallet.connect() - console.error('end connect') const provider = new ComethProvider(wallet) const counterContract = new ethers.Contract( counterContractAddress, From b54d5a6c0885f4cbc33d8e91256f1fdaceaf0ab8 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 6 Aug 2024 14:29:20 +0200 Subject: [PATCH 11/11] task: use live npm --- package.json | 2 +- yarn.lock | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8ec7f8e..a68a694 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@cometh/hosted-sdk-ethers": "file:.yalc/@cometh/hosted-sdk-ethers", + "@cometh/hosted-sdk-ethers": "^0.1.0-dev.19", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-slot": "^1.0.2", "@types/node": "20.3.2", diff --git a/yarn.lock b/yarn.lock index ff0a7e2..141fc35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,8 +19,10 @@ dependencies: regenerator-runtime "^0.14.0" -"@cometh/hosted-sdk-ethers@file:.yalc/@cometh/hosted-sdk-ethers": +"@cometh/hosted-sdk-ethers@^0.1.0-dev.19": version "0.1.0-dev.19" + resolved "https://registry.yarnpkg.com/@cometh/hosted-sdk-ethers/-/hosted-sdk-ethers-0.1.0-dev.19.tgz#1dbac0f2afe804a16d9a4f0c35d37fb23800e482" + integrity sha512-KJpd0VKkvAZVBYjNSn+6scWd3srTT61T31vVdHGtvnpJxT+mH82bXtJooseOu3qNoa361HhDfH53sIa5oL99DQ== dependencies: "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0"