diff --git a/bun.lockb b/bun.lockb index 02a76d6..5cba6d3 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 8f96a3a..5b1bde5 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,13 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "bun link @biconomy/account && vite", + "dev": "bun i && bun link @biconomy/account && vite", "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" }, "dependencies": { - "@biconomy/account": "^4.2.0", + "@biconomy/account": "^4.4.0", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", "@ethersproject/providers": "^5.7.2", diff --git a/src/components/Modules/CreateABISVM.tsx b/src/components/Modules/CreateABISVM.tsx index 67b5eb9..576523b 100644 --- a/src/components/Modules/CreateABISVM.tsx +++ b/src/components/Modules/CreateABISVM.tsx @@ -27,7 +27,7 @@ interface props { const CreateABISVM: React.FC = () => { const nftAddress = "0x1758f42Af7026fBbB559Dc60EcE0De3ef81f665e"; - const [activeSession, setActiveSession] = useState(); + const [hasSession, setHasSession] = useState(false); const { address } = useAccount(); const { smartAccount, scwAddress } = useSmartAccountContext(); @@ -71,10 +71,9 @@ const CreateABISVM: React.FC = () => { }, ]; - const { wait, session } = await createSession( + const { wait } = await createSession( smartAccount, policy, - sessionKeyAddress, sessionStorageClient, { paymasterServiceData: { @@ -89,17 +88,19 @@ const CreateABISVM: React.FC = () => { console.log("txHash", transactionHash); console.log("Sessions Enabled"); - success && setActiveSession(session); - toast.success(`Success`, { - position: "top-right", - autoClose: 6000, - hideProgressBar: false, - closeOnClick: true, - pauseOnHover: true, - draggable: true, - progress: undefined, - theme: "dark", - }); + if (success) { + setHasSession(true); + toast.success(`Success ${success}`, { + position: "top-right", + autoClose: 6000, + hideProgressBar: false, + closeOnClick: true, + pauseOnHover: true, + draggable: true, + progress: undefined, + theme: "dark", + }); + } } catch (err: any) { console.error(err); } @@ -121,12 +122,8 @@ const CreateABISVM: React.FC = () => { theme="dark" /> - {!!activeSession ? ( - + {!!hasSession ? ( + ) : (