From 8298729e99396ca2aa26495a12feeb3b62d1a515 Mon Sep 17 00:00:00 2001 From: I Putu Saputrayana Date: Mon, 23 Dec 2024 11:09:56 +0800 Subject: [PATCH 1/5] feat: privy account abstraction --- .vscode/settings.json | 3 + apps/storybook/package.json | 2 + .../src/stories/privy-aa/privy-aa.stories.tsx | 43 +++++++ packages/ui-react/package.json | 50 +++++--- .../privy-aa/account-abstraction.tsx | 104 +++++++++++++++++ .../src/components/privy-aa/provider.tsx | 100 ++++++++++++++++ .../components/transfer/transfer-button.tsx | 28 ++++- pnpm-lock.yaml | 108 ++++++++++++++---- 8 files changed, 392 insertions(+), 46 deletions(-) create mode 100644 apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx create mode 100644 packages/ui-react/src/components/privy-aa/account-abstraction.tsx create mode 100644 packages/ui-react/src/components/privy-aa/provider.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json index 7d61aa96..ad029792 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,6 +34,9 @@ "editor.defaultFormatter": "biomejs.biome" }, "editor.defaultFormatter": "biomejs.biome", + "editor.codeActionsOnSave": { + "source.organizeImports.biome": "explicit" + }, "eslint.workingDirectories": [ { "mode": "auto" diff --git a/apps/storybook/package.json b/apps/storybook/package.json index 8a0b1261..1a8d54e0 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -83,6 +83,8 @@ "lucide-react": "^0.446.0", "micro-packed": "^0.6.3", "multiformats": "^13.3.0", + "pako": "^2.1.0", + "permissionless": "^0.2.23", "react": "^18.3.1", "react-dom": "^18.3.1", "react-dropzone": "^14.2.9", diff --git a/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx b/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx new file mode 100644 index 00000000..de391407 --- /dev/null +++ b/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx @@ -0,0 +1,43 @@ +import { PrivyAAFlow } from "@geist/ui-react/components/privy-aa/account-abstraction.js"; +import { PrivyAAProvider } from "@geist/ui-react/components/privy-aa/provider.js"; + +import { Meta, StoryObj } from "@storybook/react"; + +interface PrivyAAProps { + appId: string; + pimlicoApiKey: string; +} + +function PrivyAAStories({ appId, pimlicoApiKey }: PrivyAAProps) { + return ( + + + + ); +} + +const meta = { + title: "Privy/Account Abstraction", + component: PrivyAAStories, + argTypes: { + appId: { + control: "text", + name: "Privy App ID", + }, + pimlicoApiKey: { + control: "text", + name: "Pimlico API Key", + }, + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + appId: "", + pimlicoApiKey: "", + }, +}; diff --git a/packages/ui-react/package.json b/packages/ui-react/package.json index e856cbb1..de8cedff 100644 --- a/packages/ui-react/package.json +++ b/packages/ui-react/package.json @@ -5,11 +5,20 @@ "type": "module", "exports": { ".": "./src/index.ts", - "./*.fixture": ["./src/*.fixture.ts"], - "./*": ["./src/*", "./src/*.tsx", "./src/*.ts"] + "./*.fixture": [ + "./src/*.fixture.ts" + ], + "./*": [ + "./src/*", + "./src/*.tsx", + "./src/*.ts" + ] }, "imports": { - "#*": ["./src/*", "./src/*.tsx"] + "#*": [ + "./src/*", + "./src/*.tsx" + ] }, "scripts": { "test": "vitest", @@ -18,44 +27,44 @@ "generate:component": "turbo gen react-component" }, "devDependencies": { - "@geist/typescript-config": "workspace:*", - "@turbo/gen": "^1.12.4", - "@types/node": "^22.10.2", - "@types/react": "^18.3.12", - "@types/react-dom": "^18.3.1", - "typescript": "^5.7.2", - "vite": "^5.4.1", - "vite-plugin-node-polyfills": "^0.22.0", - "vitest": "^2.1.8", "@biomejs/biome": "^1.9.4", "@ethereum-attestation-service/eas-contracts": "1.7.1", "@faker-js/faker": "^8.2.0", + "@geist/typescript-config": "workspace:*", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "@testing-library/react-hooks": "^8.0.1", + "@turbo/gen": "^1.12.4", + "@types/node": "^22.10.2", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.1", + "pako": "^2.1.0", "react-test-renderer": "^18.3.1", + "typescript": "^5.7.2", "typescript-eslint": "^8.0.1", - "pako": "^2.1.0" + "vite": "^5.4.1", + "vite-plugin-node-polyfills": "^0.22.0", + "vitest": "^2.1.8" }, "dependencies": { - "@geist/domain": "workspace:*", "@ensdomains/ensjs": "4.0.1-alpha.0", "@ensdomains/ensjs-react": "^0.0.3", "@ethereum-attestation-service/eas-sdk": "2.6.0", "@ethereumjs/rlp": "^5.0.2", + "@geist/domain": "workspace:*", + "@geist/graphql": "workspace:*", "@hookform/resolvers": "^3.9.0", "@ipld/dag-ucan": "^3.4.0", "@lighthouse-web3/kavach": "^0.1.9", "@lighthouse-web3/sdk": "^0.3.7", - "postcss": "^8.4.24", - "autoprefixer": "10.4.20", "@noble/ed25519": "2.1.0", "@noble/hashes": "^1.6.1", "@noble/secp256k1": "^2.1.0", "@openzeppelin/merkle-tree": "^1.0.7", - "@radix-ui/themes": "^3.1.6", "@privy-io/react-auth": "^1.95.2", + "@privy-io/wagmi": "^0.2.13", + "@privy-io/wagmi-connector": "^0.1.13", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-accessible-icon": "^1.0.3", "@radix-ui/react-accordion": "^1.2.0", @@ -88,7 +97,7 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.0.4", "@radix-ui/react-tooltip": "^1.1.2", - "@geist/graphql": "workspace:*", + "@radix-ui/themes": "^3.1.6", "@scure/base": "^1.1.9", "@storybook/components": "^8.3.6", "@storybook/icons": "^1.2.12", @@ -100,8 +109,8 @@ "@ucanto/interface": "^10.0.1", "@ucanto/transport": "^9.1.1", "@wagmi/core": "^2.13.8", - "wagmi": "^2.12.16", "@web3-storage/w3up-client": "^16.5.1", + "autoprefixer": "10.4.20", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "date-fns": "^4.1.0", @@ -118,6 +127,8 @@ "micro-eth-signer": "^0.12.0", "micro-packed": "^0.6.3", "multiformats": "^13.3.0", + "permissionless": "^0.2.23", + "postcss": "^8.4.24", "react": "^18.3.1", "react-dom": "^18.3.1", "react-dropzone": "^14.2.9", @@ -128,6 +139,7 @@ "tailwindcss": "^3.4.13", "tailwindcss-animate": "^1.0.7", "viem": "2.x", + "wagmi": "^2.12.16", "zod": "^3.23.8" } } diff --git a/packages/ui-react/src/components/privy-aa/account-abstraction.tsx b/packages/ui-react/src/components/privy-aa/account-abstraction.tsx new file mode 100644 index 00000000..8b4a9feb --- /dev/null +++ b/packages/ui-react/src/components/privy-aa/account-abstraction.tsx @@ -0,0 +1,104 @@ +import { usePrivy, useWallets } from "@privy-io/react-auth"; +import { useSetActiveWallet } from "@privy-io/wagmi"; +import { SmartAccountClient, createSmartAccountClient } from "permissionless"; +import { toSimpleSmartAccount } from "permissionless/accounts"; +import { useEffect, useMemo, useState } from "react"; +import { zeroAddress } from "viem"; +import { entryPoint07Address } from "viem/account-abstraction"; +import { sepolia } from "viem/chains"; +import { http, useAccount, usePublicClient, useWalletClient } from "wagmi"; + +import { Button } from "#components/shadcn/button"; +import { TransferButton } from "#components/transfer/transfer-button"; +import { usePrivyAA } from "./provider"; + +export function PrivyAAFlow() { + const { pimlicoRpcUrl, pimlicoClient } = usePrivyAA(); + const { login, ready: isReady, authenticated: isAuthenticated } = usePrivy(); + + const { isConnected } = useAccount(); + const [smartAccountClient, setSmartAccountClient] = + useState(null); + + const publicClient = usePublicClient(); + const { wallets, ready: isWalletsReady } = useWallets(); + const { data: walletClient } = useWalletClient(); + + const embeddedWallet = useMemo( + () => wallets.find((wallet) => wallet.walletClientType === "privy"), + [wallets], + ); + + const { setActiveWallet } = useSetActiveWallet(); + + useEffect(() => { + (async () => { + if (isConnected && walletClient && publicClient && embeddedWallet) { + const owner = await embeddedWallet.getEthereumProvider(); + + if (!owner) { + throw new Error("No owner found"); + } + + const simpleSmartAccount = await toSimpleSmartAccount({ + owner, + client: publicClient, + entryPoint: { + address: entryPoint07Address, + version: "0.7", + }, + }); + + const smartAccountClient = createSmartAccountClient({ + account: simpleSmartAccount, + chain: sepolia, + bundlerTransport: http(pimlicoRpcUrl), + paymaster: pimlicoClient, + userOperation: { + estimateFeesPerGas: async () => { + return (await pimlicoClient.getUserOperationGasPrice()).fast; + }, + }, + }); + + setSmartAccountClient(smartAccountClient); + } + })(); + }, [isConnected, walletClient, publicClient]); + + if (!isReady) { + return null; + } + + if (isConnected && smartAccountClient && embeddedWallet) { + return ( +
+ +
+ ); + } + + return ( + <> + {!isAuthenticated && } + + {isWalletsReady && + wallets.map((wallet) => { + return ( + + ); + })} + + ); +} diff --git a/packages/ui-react/src/components/privy-aa/provider.tsx b/packages/ui-react/src/components/privy-aa/provider.tsx new file mode 100644 index 00000000..36bf4bf2 --- /dev/null +++ b/packages/ui-react/src/components/privy-aa/provider.tsx @@ -0,0 +1,100 @@ +import { PrivyClientConfig, PrivyProvider } from "@privy-io/react-auth"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { + PimlicoClient, + createPimlicoClient, +} from "permissionless/clients/pimlico"; +import { PropsWithChildren, createContext, useContext, useState } from "react"; +import { http } from "viem"; +import { entryPoint07Address } from "viem/account-abstraction"; +import { sepolia } from "viem/chains"; +import { WagmiProvider, createConfig } from "wagmi"; + +interface PrivyAAContextProps { + appId: string; + pimlicoApiKey: string; +} + +interface PrivyAAContext { + appId: string; + pimlicoApiKey: string; + pimlicoClient: PimlicoClient; + pimlicoRpcUrl: string; +} + +const privyConfig: PrivyClientConfig = { + embeddedWallets: { + createOnLogin: "users-without-wallets", + requireUserPasswordOnCreate: true, + noPromptOnSignature: false, + }, + loginMethods: ["wallet", "email", "sms"], + appearance: { + showWalletLoginFirst: true, + }, +}; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + refetchOnWindowFocus: false, + }, + }, +}); + +const wagmiConfig = createConfig({ + chains: [sepolia], + transports: { + [sepolia.id]: http(), + }, +}); + +const PrivyAAContext = createContext(undefined as never); + +export function PrivyAAProvider({ + children, + appId, + pimlicoApiKey, +}: PropsWithChildren) { + if (!pimlicoApiKey) { + throw new Error("Missing pimlicoApiKey"); + } + + const [pimlicoRpcUrl] = useState( + `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoApiKey}`, + ); + + const [pimlicoClient] = useState( + createPimlicoClient({ + transport: http(pimlicoRpcUrl), + entryPoint: { + address: entryPoint07Address, + version: "0.7", + }, + }), + ); + + return ( + + + + + {children} + + + + + ); +} + +export function usePrivyAA() { + const context = useContext(PrivyAAContext); + + if (!context) { + throw new Error("Missing PrivyAAContext"); + } + + return context; +} diff --git a/packages/ui-react/src/components/transfer/transfer-button.tsx b/packages/ui-react/src/components/transfer/transfer-button.tsx index 52768af9..9691bedd 100644 --- a/packages/ui-react/src/components/transfer/transfer-button.tsx +++ b/packages/ui-react/src/components/transfer/transfer-button.tsx @@ -1,7 +1,10 @@ import { MutationOptions } from "@tanstack/react-query"; import { Config, SendTransactionErrorType } from "@wagmi/core"; import { Loader2 } from "lucide-react"; -import { Account, parseEther } from "viem"; +import { SmartAccountClient } from "permissionless"; +import { Account, parseEther, zeroAddress } from "viem"; +import { SmartAccount } from "viem/account-abstraction"; +import { sepolia } from "viem/chains"; import { useSendTransaction } from "wagmi"; import { SendTransactionData, SendTransactionVariables } from "wagmi/query"; import { Button, ButtonProps } from "#components/shadcn/button"; @@ -19,6 +22,9 @@ type TransferButtonProps = { SendTransactionErrorType, SendTransactionVariables >; + /** Custom handler for the transfer */ + onTransfer?: (txHash: string) => void; + smartAccountClient?: SmartAccountClient; } & ButtonProps; export function TransferButton({ @@ -27,15 +33,31 @@ export function TransferButton({ account, disabled, mutationOptions, + onTransfer, + smartAccountClient, ...buttonProps }: TransferButtonProps) { const { sendTransaction, isPending } = useSendTransaction(); - const handleTransfer = () => { + const handleTransfer = async () => { + if (smartAccountClient) { + const txHash = await smartAccountClient.sendTransaction({ + chain: sepolia, + to: to as `0x${string}`, + value: BigInt(amount), + authorizationList: [], + account: smartAccountClient.account as SmartAccount, + }); + + onTransfer?.(txHash); + + return; + } + sendTransaction( { to: to as `0x${string}`, - value: parseEther(amount.toString()), + value: parseEther(amount?.toString() ?? "0"), account, }, mutationOptions, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a07e010..b99da8c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,6 +74,15 @@ importers: '@ethereumjs/rlp': specifier: ^5.0.2 version: 5.0.2 + '@geist/domain': + specifier: workspace:* + version: link:../../packages/domain + '@geist/graphql': + specifier: workspace:* + version: link:../../packages/gql + '@geist/ui-react': + specifier: workspace:* + version: link:../../packages/ui-react '@hookform/resolvers': specifier: ^3.9.0 version: 3.9.0(react-hook-form@7.53.0(react@18.3.1)) @@ -94,7 +103,7 @@ importers: version: 1.0.7 '@privy-io/react-auth': specifier: ^1.95.2 - version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) '@radix-ui/colors': specifier: ^3.0.0 version: 3.0.0 @@ -191,15 +200,6 @@ importers: '@radix-ui/react-tooltip': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@geist/domain': - specifier: workspace:* - version: link:../../packages/domain - '@geist/graphql': - specifier: workspace:* - version: link:../../packages/gql - '@geist/ui-react': - specifier: workspace:* - version: link:../../packages/ui-react '@scure/base': specifier: ^1.1.9 version: 1.1.9 @@ -275,6 +275,12 @@ importers: multiformats: specifier: ^13.3.0 version: 13.3.0 + pako: + specifier: ^2.1.0 + version: 2.1.0 + permissionless: + specifier: ^0.2.23 + version: 0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5) react: specifier: ^18.3.1 version: 18.3.1 @@ -411,6 +417,9 @@ importers: '@ethereumjs/rlp': specifier: ^5.0.2 version: 5.0.2 + '@geist/graphql': + specifier: workspace:* + version: link:../gql '@hookform/resolvers': specifier: ^3.9.0 version: 3.9.0(react-hook-form@7.53.0(react@18.3.1)) @@ -431,10 +440,7 @@ importers: version: 1.0.7 '@privy-io/react-auth': specifier: ^1.95.2 - version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) - '@geist/graphql': - specifier: workspace:* - version: link:../gql + version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) '@scure/base': specifier: ^1.1.9 version: 1.1.9 @@ -576,6 +582,12 @@ importers: '@ethereumjs/rlp': specifier: ^5.0.2 version: 5.0.2 + '@geist/domain': + specifier: workspace:* + version: link:../domain + '@geist/graphql': + specifier: workspace:* + version: link:../gql '@hookform/resolvers': specifier: ^3.9.0 version: 3.9.0(react-hook-form@7.53.0(react@18.3.1)) @@ -602,7 +614,13 @@ importers: version: 1.0.7 '@privy-io/react-auth': specifier: ^1.95.2 - version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + '@privy-io/wagmi': + specifier: ^0.2.13 + version: 0.2.13(kjkal4mpntnb4ingcpeg2h45vi) + '@privy-io/wagmi-connector': + specifier: ^0.1.13 + version: 0.1.13(seuudtlqc2ej5cwookedvm32v4) '@radix-ui/colors': specifier: ^3.0.0 version: 3.0.0 @@ -702,12 +720,6 @@ importers: '@radix-ui/themes': specifier: ^3.1.6 version: 3.1.6(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@geist/domain': - specifier: workspace:* - version: link:../domain - '@geist/graphql': - specifier: workspace:* - version: link:../gql '@scure/base': specifier: ^1.1.9 version: 1.1.9 @@ -795,6 +807,9 @@ importers: multiformats: specifier: ^13.3.0 version: 13.3.0 + permissionless: + specifier: ^0.2.23 + version: 0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5) postcss: specifier: ^8.4.24 version: 8.4.47 @@ -3203,6 +3218,23 @@ packages: permissionless: optional: true + '@privy-io/wagmi-connector@0.1.13': + resolution: {integrity: sha512-dbel4pYvbJM+28m12DE7LvEKzJ8ni/rDkuHpF3RGwkph+HsgDNDxJy4OTgUjaKi6yJsjZ5nvhsZdNNVXbVFKkg==} + peerDependencies: + '@privy-io/react-auth': ^1.33.0 + react: ^18 + react-dom: ^18 + viem: '>=0.3.35' + wagmi: '>=1.4.12 <2' + + '@privy-io/wagmi@0.2.13': + resolution: {integrity: sha512-NOyM43Kbc1K+hu3OwaSpKE1twhUEof9+jPefX4f1OLhbnEZGfcKAYP75O9xjc5rxTPgKfod9FSmt/xbKxJfUHw==} + peerDependencies: + '@privy-io/react-auth': ^1.64.1 + react: '>=18' + viem: ^2 + wagmi: ^2 + '@protobufjs/aspromise@1.1.2': resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -10045,6 +10077,12 @@ packages: performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + permissionless@0.2.23: + resolution: {integrity: sha512-J/Z8Tvgv/FKcbu9DMDYu/QLkssnlOAbQ6yXPqKsRywdB+x4FT5PDHVkwBdK46t6QnDy8r4zU9G1EmlTSmZA2kA==} + peerDependencies: + viem: ^2.21.54 + webauthn-p256: 0.0.10 + picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} @@ -15810,7 +15848,7 @@ snapshots: dependencies: zod: 3.23.8 - '@privy-io/js-sdk-core@0.35.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))': + '@privy-io/js-sdk-core@0.35.1(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))': dependencies: '@ethersproject/abstract-signer': 5.7.0 '@ethersproject/bignumber': 5.7.0 @@ -15828,6 +15866,7 @@ snapshots: set-cookie-parser: 2.7.1 uuid: 9.0.1 optionalDependencies: + permissionless: 0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5) viem: 2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) transitivePeerDependencies: - bufferutil @@ -15844,7 +15883,7 @@ snapshots: - bufferutil - utf-8-validate - '@privy-io/react-auth@1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8)': + '@privy-io/react-auth@1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@coinbase/wallet-sdk': 4.0.3 '@ethersproject/abstract-signer': 5.7.0 @@ -15862,7 +15901,7 @@ snapshots: '@heroicons/react': 2.2.0(react@18.3.1) '@marsidev/react-turnstile': 0.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@metamask/eth-sig-util': 6.0.2 - '@privy-io/js-sdk-core': 0.35.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8)) + '@privy-io/js-sdk-core': 0.35.1(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8)) '@simplewebauthn/browser': 9.0.1 '@solana/wallet-adapter-base': 0.9.23(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)) '@solana/wallet-standard-wallet-adapter-base': 1.1.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bs58@5.0.0) @@ -15896,6 +15935,7 @@ snapshots: web3-core-helpers: 1.10.3 optionalDependencies: '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + permissionless: 0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -15919,6 +15959,21 @@ snapshots: - utf-8-validate - zod + '@privy-io/wagmi-connector@0.1.13(seuudtlqc2ej5cwookedvm32v4)': + dependencies: + '@privy-io/react-auth': 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + wagmi: 2.12.16(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.3.1))(@types/react@18.3.18)(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-native@0.75.3(@babel/core@7.25.2)(@babel/preset-env@7.25.4(@babel/core@7.25.2))(@types/react@18.3.18)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.22.5)(typescript@5.7.2)(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) + + '@privy-io/wagmi@0.2.13(kjkal4mpntnb4ingcpeg2h45vi)': + dependencies: + '@privy-io/react-auth': 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + react: 18.3.1 + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + wagmi: 2.12.16(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.3.1))(@types/react@18.3.18)(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-native@0.75.3(@babel/core@7.25.2)(@babel/preset-env@7.25.4(@babel/core@7.25.2))(@types/react@18.3.18)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.22.5)(typescript@5.7.2)(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) + '@protobufjs/aspromise@1.1.2': {} '@protobufjs/base64@1.1.2': {} @@ -24644,6 +24699,11 @@ snapshots: performance-now@2.1.0: {} + permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5): + dependencies: + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) + webauthn-p256: 0.0.5 + picocolors@1.1.0: {} picomatch@2.3.1: {} From 79536096e107eb018462a89d25d95103a622f18f Mon Sep 17 00:00:00 2001 From: I Putu Saputrayana Date: Mon, 23 Dec 2024 11:10:34 +0800 Subject: [PATCH 2/5] chore: setting biome --- packages/ui-react/package.json | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/ui-react/package.json b/packages/ui-react/package.json index de8cedff..438f2dd5 100644 --- a/packages/ui-react/package.json +++ b/packages/ui-react/package.json @@ -5,20 +5,11 @@ "type": "module", "exports": { ".": "./src/index.ts", - "./*.fixture": [ - "./src/*.fixture.ts" - ], - "./*": [ - "./src/*", - "./src/*.tsx", - "./src/*.ts" - ] + "./*.fixture": ["./src/*.fixture.ts"], + "./*": ["./src/*", "./src/*.tsx", "./src/*.ts"] }, "imports": { - "#*": [ - "./src/*", - "./src/*.tsx" - ] + "#*": ["./src/*", "./src/*.tsx"] }, "scripts": { "test": "vitest", From d86583f5dcddc5534ed8316c22cd9ba4a119639f Mon Sep 17 00:00:00 2001 From: I Putu Saputrayana Date: Mon, 20 Jan 2025 11:14:52 +0800 Subject: [PATCH 3/5] feat: update PR feedback --- .vscode/settings.json | 3 - .../src/stories/privy-aa/privy-aa.stories.tsx | 12 +- env.sample | 4 +- packages/domain/src/config.ts | 3 + .../src/components/privy-aa/provider.tsx | 27 +-- .../ui-react/src/components/privy-aa/utils.ts | 9 + pnpm-lock.yaml | 210 +++++++++--------- 7 files changed, 131 insertions(+), 137 deletions(-) create mode 100644 packages/ui-react/src/components/privy-aa/utils.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index ad029792..7d61aa96 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,9 +34,6 @@ "editor.defaultFormatter": "biomejs.biome" }, "editor.defaultFormatter": "biomejs.biome", - "editor.codeActionsOnSave": { - "source.organizeImports.biome": "explicit" - }, "eslint.workingDirectories": [ { "mode": "auto" diff --git a/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx b/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx index de391407..e4ee6ac1 100644 --- a/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx +++ b/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx @@ -1,16 +1,15 @@ import { PrivyAAFlow } from "@geist/ui-react/components/privy-aa/account-abstraction.js"; import { PrivyAAProvider } from "@geist/ui-react/components/privy-aa/provider.js"; -import { Meta, StoryObj } from "@storybook/react"; +import type { Meta, StoryObj } from "@storybook/react"; interface PrivyAAProps { appId: string; - pimlicoApiKey: string; } -function PrivyAAStories({ appId, pimlicoApiKey }: PrivyAAProps) { +function PrivyAAStories({ appId }: PrivyAAProps) { return ( - + ); @@ -24,10 +23,6 @@ const meta = { control: "text", name: "Privy App ID", }, - pimlicoApiKey: { - control: "text", - name: "Pimlico API Key", - }, }, } satisfies Meta; @@ -38,6 +33,5 @@ type Story = StoryObj; export const Default: Story = { args: { appId: "", - pimlicoApiKey: "", }, }; diff --git a/env.sample b/env.sample index 641cddf4..3e5a3853 100644 --- a/env.sample +++ b/env.sample @@ -21,4 +21,6 @@ AKAVE_API_KEY= LIGHTHOUSE_API_KEY= STORACHA_KEY= -STORACHA_PROOF= \ No newline at end of file +STORACHA_PROOF= + +PIMLICO_API_KEY= \ No newline at end of file diff --git a/packages/domain/src/config.ts b/packages/domain/src/config.ts index 595df1d0..953ce5dd 100644 --- a/packages/domain/src/config.ts +++ b/packages/domain/src/config.ts @@ -33,4 +33,7 @@ export default { privateKey: process.env.TEST_EAS_PRIVATE_KEY, }, }, + pimlico: { + apiKey: process.env.PIMLICO_API_KEY, + }, }; diff --git a/packages/ui-react/src/components/privy-aa/provider.tsx b/packages/ui-react/src/components/privy-aa/provider.tsx index 36bf4bf2..035caf68 100644 --- a/packages/ui-react/src/components/privy-aa/provider.tsx +++ b/packages/ui-react/src/components/privy-aa/provider.tsx @@ -1,23 +1,27 @@ -import { PrivyClientConfig, PrivyProvider } from "@privy-io/react-auth"; +import { type PrivyClientConfig, PrivyProvider } from "@privy-io/react-auth"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { - PimlicoClient, + type PimlicoClient, createPimlicoClient, } from "permissionless/clients/pimlico"; -import { PropsWithChildren, createContext, useContext, useState } from "react"; +import { + type PropsWithChildren, + createContext, + useContext, + useState, +} from "react"; import { http } from "viem"; import { entryPoint07Address } from "viem/account-abstraction"; import { sepolia } from "viem/chains"; import { WagmiProvider, createConfig } from "wagmi"; +import { generatePimlicoRpcUrl } from "./utils"; interface PrivyAAContextProps { appId: string; - pimlicoApiKey: string; } interface PrivyAAContext { appId: string; - pimlicoApiKey: string; pimlicoClient: PimlicoClient; pimlicoRpcUrl: string; } @@ -54,15 +58,8 @@ const PrivyAAContext = createContext(undefined as never); export function PrivyAAProvider({ children, appId, - pimlicoApiKey, }: PropsWithChildren) { - if (!pimlicoApiKey) { - throw new Error("Missing pimlicoApiKey"); - } - - const [pimlicoRpcUrl] = useState( - `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoApiKey}`, - ); + const pimlicoRpcUrl = generatePimlicoRpcUrl(sepolia.id); const [pimlicoClient] = useState( createPimlicoClient({ @@ -75,9 +72,7 @@ export function PrivyAAProvider({ ); return ( - + diff --git a/packages/ui-react/src/components/privy-aa/utils.ts b/packages/ui-react/src/components/privy-aa/utils.ts new file mode 100644 index 00000000..ea8a6d39 --- /dev/null +++ b/packages/ui-react/src/components/privy-aa/utils.ts @@ -0,0 +1,9 @@ +import config from "@geist/domain/config"; + +export const generatePimlicoRpcUrl = (chainId: number) => { + const pimlicoApiKey = config.pimlico.apiKey; + if (!pimlicoApiKey) { + throw new Error("Missing pimlicoApiKey"); + } + return `https://api.pimlico.io/v2/${chainId}/rpc?apikey=${pimlicoApiKey}`; +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 16d5722b..37f381e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -446,11 +446,7 @@ importers: version: 1.0.7 '@privy-io/react-auth': specifier: ^1.95.2 -<<<<<<< HEAD version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) -======= - version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) ->>>>>>> 09410c58cbf91ce3382bb95b854ddd84f6eb0f3f '@scure/base': specifier: ^1.1.9 version: 1.1.9 @@ -627,10 +623,10 @@ importers: version: 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) '@privy-io/wagmi': specifier: ^0.2.13 - version: 0.2.13(kjkal4mpntnb4ingcpeg2h45vi) + version: 0.2.13(ca3327189a27c0790f970b6cfbebb435) '@privy-io/wagmi-connector': specifier: ^0.1.13 - version: 0.1.13(seuudtlqc2ej5cwookedvm32v4) + version: 0.1.13(c1df4561e7530d235a72a58dcf3d6984) '@radix-ui/colors': specifier: ^3.0.0 version: 3.0.0 @@ -13022,7 +13018,7 @@ snapshots: '@babel/traverse': 7.25.6 '@babel/types': 7.25.6 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -13897,7 +13893,7 @@ snapshots: '@babel/parser': 7.25.6 '@babel/template': 7.25.0 '@babel/types': 7.25.6 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -15029,7 +15025,7 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) '@whatwg-node/fetch': 0.9.21 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - encoding @@ -15038,7 +15034,7 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) dataloader: 2.2.2 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 value-or-promise: 1.0.12 '@graphql-tools/code-file-loader@8.1.3(graphql@16.9.0)': @@ -15047,7 +15043,7 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) globby: 11.1.0 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 unixify: 1.0.0 transitivePeerDependencies: - supports-color @@ -15061,13 +15057,13 @@ snapshots: '@repeaterjs/repeater': 3.0.6 dataloader: 2.2.2 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/documents@1.0.1(graphql@16.9.0)': dependencies: graphql: 16.9.0 lodash.sortby: 4.7.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/executor-graphql-ws@1.3.0(bufferutil@4.0.8)(graphql@16.9.0)(utf-8-validate@5.0.10)': dependencies: @@ -15075,9 +15071,9 @@ snapshots: '@types/ws': 8.5.12 graphql: 16.9.0 graphql-ws: 5.16.0(graphql@16.9.0) - isomorphic-ws: 5.0.0(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - tslib: 2.7.0 - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + tslib: 2.8.1 + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -15090,7 +15086,7 @@ snapshots: extract-files: 11.0.0 graphql: 16.9.0 meros: 1.3.0(@types/node@22.10.2) - tslib: 2.7.0 + tslib: 2.8.1 value-or-promise: 1.0.12 transitivePeerDependencies: - '@types/node' @@ -15100,9 +15096,9 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) '@types/ws': 8.5.12 graphql: 16.9.0 - isomorphic-ws: 5.0.0(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - tslib: 2.7.0 - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + tslib: 2.8.1 + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -15113,7 +15109,7 @@ snapshots: '@graphql-typed-document-node/core': 3.2.0(graphql@16.9.0) '@repeaterjs/repeater': 3.0.6 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 value-or-promise: 1.0.12 '@graphql-tools/git-loader@8.0.7(graphql@16.9.0)': @@ -15123,7 +15119,7 @@ snapshots: graphql: 16.9.0 is-glob: 4.0.3 micromatch: 4.0.8 - tslib: 2.7.0 + tslib: 2.8.1 unixify: 1.0.0 transitivePeerDependencies: - supports-color @@ -15136,7 +15132,7 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) '@whatwg-node/fetch': 0.9.21 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 value-or-promise: 1.0.12 transitivePeerDependencies: - '@types/node' @@ -15149,7 +15145,7 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) globby: 11.1.0 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 unixify: 1.0.0 '@graphql-tools/graphql-tag-pluck@8.3.2(graphql@16.9.0)': @@ -15161,7 +15157,7 @@ snapshots: '@babel/types': 7.25.6 '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -15170,14 +15166,14 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 resolve-from: 5.0.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/json-file-loader@8.0.1(graphql@16.9.0)': dependencies: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) globby: 11.1.0 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 unixify: 1.0.0 '@graphql-tools/load@8.0.2(graphql@16.9.0)': @@ -15186,18 +15182,18 @@ snapshots: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 p-limit: 3.1.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/merge@9.0.7(graphql@16.9.0)': dependencies: '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/optimize@2.0.0(graphql@16.9.0)': dependencies: graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/prisma-loader@8.0.4(@types/node@22.10.2)(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.9.0)(utf-8-validate@5.0.10)': dependencies: @@ -15206,7 +15202,7 @@ snapshots: '@types/js-yaml': 4.0.9 '@whatwg-node/fetch': 0.9.21 chalk: 4.1.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) dotenv: 16.4.5 graphql: 16.9.0 graphql-request: 6.1.0(encoding@0.1.13)(graphql@16.9.0) @@ -15216,7 +15212,7 @@ snapshots: js-yaml: 4.1.0 lodash: 4.17.21 scuid: 1.1.0 - tslib: 2.7.0 + tslib: 2.8.1 yaml-ast-parser: 0.0.43 transitivePeerDependencies: - '@types/node' @@ -15230,7 +15226,7 @@ snapshots: '@ardatan/relay-compiler': 12.0.0(encoding@0.1.13)(graphql@16.9.0) '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - encoding - supports-color @@ -15240,7 +15236,7 @@ snapshots: '@graphql-tools/merge': 9.0.7(graphql@16.9.0) '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 value-or-promise: 1.0.12 '@graphql-tools/url-loader@8.0.2(@types/node@22.10.2)(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.9.0)(utf-8-validate@5.0.10)': @@ -15255,10 +15251,10 @@ snapshots: '@types/ws': 8.5.12 '@whatwg-node/fetch': 0.9.21 graphql: 16.9.0 - isomorphic-ws: 5.0.0(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - tslib: 2.7.0 + isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + tslib: 2.8.1 value-or-promise: 1.0.12 - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - '@types/node' - bufferutil @@ -15271,7 +15267,7 @@ snapshots: cross-inspect: 1.0.1 dset: 3.1.4 graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 '@graphql-tools/wrap@10.0.5(graphql@16.9.0)': dependencies: @@ -15279,7 +15275,7 @@ snapshots: '@graphql-tools/schema': 10.0.6(graphql@16.9.0) '@graphql-tools/utils': 10.5.4(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 value-or-promise: 1.0.12 '@graphql-typed-document-node/core@3.2.0(graphql@16.9.0)': @@ -15626,7 +15622,7 @@ snapshots: bufferutil: 4.0.8 cross-fetch: 4.0.0(encoding@0.1.13) date-fns: 2.30.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) eciesjs: 0.3.20 eventemitter2: 6.4.9 readable-stream: 3.6.2 @@ -15655,7 +15651,7 @@ snapshots: '@types/uuid': 10.0.0 bowser: 2.11.0 cross-fetch: 4.0.0(encoding@0.1.13) - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) eciesjs: 0.3.20 eth-rpc-errors: 4.0.3 eventemitter2: 6.4.9 @@ -15686,7 +15682,7 @@ snapshots: '@metamask/utils@3.6.0': dependencies: '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) semver: 7.6.3 superstruct: 1.0.4 transitivePeerDependencies: @@ -15696,7 +15692,7 @@ snapshots: dependencies: '@ethereumjs/tx': 4.2.0 '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) semver: 7.6.3 superstruct: 1.0.4 transitivePeerDependencies: @@ -15709,7 +15705,7 @@ snapshots: '@noble/hashes': 1.6.1 '@scure/base': 1.1.9 '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) pony-cause: 2.1.11 semver: 7.6.3 uuid: 9.0.1 @@ -15723,7 +15719,7 @@ snapshots: '@noble/hashes': 1.6.1 '@scure/base': 1.1.9 '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) pony-cause: 2.1.11 semver: 7.6.3 uuid: 9.0.1 @@ -15928,7 +15924,7 @@ snapshots: chalk: 4.1.2 clean-stack: 3.0.1 cli-progress: 3.12.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) ejs: 3.1.10 get-package-type: 0.1.0 globby: 11.1.0 @@ -15945,7 +15941,7 @@ snapshots: supports-color: 8.1.1 supports-hyperlinks: 2.3.0 ts-node: 10.9.2(@types/node@22.10.2)(typescript@5.7.2) - tslib: 2.7.0 + tslib: 2.8.1 widest-line: 3.1.0 wordwrap: 1.0.0 wrap-ansi: 7.0.0 @@ -15964,7 +15960,7 @@ snapshots: chalk: 4.1.2 clean-stack: 3.0.1 cli-progress: 3.12.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) ejs: 3.1.10 fs-extra: 9.1.0 get-package-type: 0.1.0 @@ -15982,7 +15978,7 @@ snapshots: supports-color: 8.1.1 supports-hyperlinks: 2.3.0 ts-node: 10.9.2(@types/node@22.10.2)(typescript@5.7.2) - tslib: 2.7.0 + tslib: 2.8.1 widest-line: 3.1.0 wordwrap: 1.0.0 wrap-ansi: 7.0.0 @@ -15996,7 +15992,7 @@ snapshots: dependencies: '@oclif/core': 2.16.0(@types/node@22.10.2)(typescript@5.7.2) chalk: 4.1.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -16087,18 +16083,18 @@ snapshots: dependencies: asn1js: 3.0.5 pvtsutils: 1.3.5 - tslib: 2.7.0 + tslib: 2.8.1 '@peculiar/json-schema@1.1.12': dependencies: - tslib: 2.7.0 + tslib: 2.8.1 '@peculiar/webcrypto@1.5.0': dependencies: '@peculiar/asn1-schema': 2.3.13 '@peculiar/json-schema': 1.1.12 pvtsutils: 1.3.5 - tslib: 2.7.0 + tslib: 2.8.1 webcrypto-core: 1.8.0 '@perma/map@1.0.3': @@ -16236,7 +16232,7 @@ snapshots: - utf-8-validate - zod - '@privy-io/wagmi-connector@0.1.13(seuudtlqc2ej5cwookedvm32v4)': + '@privy-io/wagmi-connector@0.1.13(c1df4561e7530d235a72a58dcf3d6984)': dependencies: '@privy-io/react-auth': 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) react: 18.3.1 @@ -16244,7 +16240,7 @@ snapshots: viem: 2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) wagmi: 2.12.16(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.3.1))(@types/react@18.3.18)(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-native@0.75.3(@babel/core@7.25.2)(@babel/preset-env@7.25.4(@babel/core@7.25.2))(@types/react@18.3.18)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.22.5)(typescript@5.7.2)(utf-8-validate@5.0.10)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) - '@privy-io/wagmi@0.2.13(kjkal4mpntnb4ingcpeg2h45vi)': + '@privy-io/wagmi@0.2.13(ca3327189a27c0790f970b6cfbebb435)': dependencies: '@privy-io/react-auth': 1.95.2(@solana/web3.js@1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(@types/react@18.3.18)(bs58@5.0.0)(bufferutil@4.0.8)(permissionless@0.2.23(viem@2.21.16(bufferutil@4.0.8)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8))(webauthn-p256@0.0.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)(utf-8-validate@5.0.10)(zod@3.23.8) react: 18.3.1 @@ -19180,7 +19176,7 @@ snapshots: '@typescript-eslint/types': 8.13.0 '@typescript-eslint/typescript-estree': 8.13.0(typescript@5.7.2) '@typescript-eslint/visitor-keys': 8.13.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 eslint: 9.14.0(jiti@2.4.1) optionalDependencies: typescript: 5.7.2 @@ -19196,7 +19192,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.13.0(typescript@5.7.2) '@typescript-eslint/utils': 8.13.0(eslint@9.14.0(jiti@2.4.1))(typescript@5.7.2) - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 ts-api-utils: 1.3.0(typescript@5.7.2) optionalDependencies: typescript: 5.7.2 @@ -19210,7 +19206,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.13.0 '@typescript-eslint/visitor-keys': 8.13.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 @@ -19895,14 +19891,14 @@ snapshots: busboy: 1.6.0 fast-querystring: 1.1.2 fast-url-parser: 1.1.3 - tslib: 2.7.0 + tslib: 2.8.1 '@whatwg-node/node-fetch@0.5.26': dependencies: '@kamilkisiela/fast-url-parser': 1.1.4 busboy: 1.6.0 fast-querystring: 1.1.2 - tslib: 2.7.0 + tslib: 2.8.1 '@wry/equality@0.1.11': dependencies: @@ -19978,7 +19974,7 @@ snapshots: agent-base@7.1.1: dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -20154,7 +20150,7 @@ snapshots: dependencies: pvtsutils: 1.3.5 pvutils: 1.1.3 - tslib: 2.7.0 + tslib: 2.8.1 assemblyscript@0.19.10: dependencies: @@ -20189,7 +20185,7 @@ snapshots: ast-types@0.16.1: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 astral-regex@1.0.0: {} @@ -20250,7 +20246,7 @@ snapshots: axios@1.7.7: dependencies: - follow-redirects: 1.15.9(debug@4.4.0) + follow-redirects: 1.15.9(debug@4.3.4) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -20613,7 +20609,7 @@ snapshots: camel-case@4.1.2: dependencies: pascal-case: 3.1.2 - tslib: 2.7.0 + tslib: 2.8.1 camelcase-css@2.0.1: {} @@ -20729,7 +20725,7 @@ snapshots: path-case: 3.0.4 sentence-case: 3.0.4 snake-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 chardet@0.7.0: {} @@ -21141,7 +21137,7 @@ snapshots: cross-inspect@1.0.1: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 cross-spawn@7.0.3: dependencies: @@ -21248,11 +21244,9 @@ snapshots: dependencies: ms: 2.1.2 - debug@4.3.7(supports-color@8.1.1): + debug@4.3.7: dependencies: ms: 2.1.3 - optionalDependencies: - supports-color: 8.1.1 debug@4.4.0(supports-color@8.1.1): dependencies: @@ -21395,7 +21389,7 @@ snapshots: dns-over-http-resolver@1.2.3(node-fetch@2.7.0(encoding@0.1.13)): dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) native-fetch: 3.0.0(node-fetch@2.7.0(encoding@0.1.13)) receptacle: 1.3.2 transitivePeerDependencies: @@ -21561,7 +21555,7 @@ snapshots: engine.io-client@6.6.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 engine.io-parser: 5.2.3 ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) xmlhttprequest-ssl: 2.1.1 @@ -21656,7 +21650,7 @@ snapshots: esbuild-register@3.6.0(esbuild@0.23.1): dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) esbuild: 0.23.1 transitivePeerDependencies: - supports-color @@ -21759,7 +21753,7 @@ snapshots: '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 debug: 4.4.0(supports-color@8.1.1) escape-string-regexp: 4.0.0 eslint-scope: 8.2.0 @@ -22418,7 +22412,7 @@ snapshots: dependencies: basic-ftp: 5.0.5 data-uri-to-buffer: 6.0.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) fs-extra: 11.2.0 transitivePeerDependencies: - supports-color @@ -22618,7 +22612,7 @@ snapshots: jiti: 1.21.6 minimatch: 9.0.5 string-env-interpolation: 1.0.1 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - '@types/node' - bufferutil @@ -22668,7 +22662,7 @@ snapshots: graphql-tag@2.12.6(graphql@16.9.0): dependencies: graphql: 16.9.0 - tslib: 2.7.0 + tslib: 2.8.1 graphql-toolkit@0.2.0(graphql@16.9.0): dependencies: @@ -22909,7 +22903,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -22937,14 +22931,14 @@ snapshots: https-proxy-agent@6.2.1: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -23008,7 +23002,7 @@ snapshots: import-from-esm@1.3.4: dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 import-meta-resolve: 4.1.0 transitivePeerDependencies: - supports-color @@ -23130,7 +23124,7 @@ snapshots: any-signal: 2.1.2 blob-to-it: 1.0.4 browser-readablestream-to-it: 1.0.3 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) err-code: 3.0.1 ipfs-core-types: 0.9.0(node-fetch@2.7.0(encoding@0.1.13)) ipfs-unixfs: 6.0.9 @@ -23159,7 +23153,7 @@ snapshots: '@ipld/dag-pb': 2.1.18 abort-controller: 3.0.0 any-signal: 2.1.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) err-code: 3.0.1 ipfs-core-types: 0.9.0(node-fetch@2.7.0(encoding@0.1.13)) ipfs-core-utils: 0.13.0(encoding@0.1.13)(node-fetch@2.7.0(encoding@0.1.13)) @@ -23321,7 +23315,7 @@ snapshots: is-lower-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 is-map@2.0.3: {} @@ -23411,7 +23405,7 @@ snapshots: is-upper-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 is-valid-path@0.1.1: dependencies: @@ -23469,9 +23463,9 @@ snapshots: dependencies: ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + isomorphic-ws@5.0.0(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) isows@1.0.4(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: @@ -24017,13 +24011,13 @@ snapshots: lower-case-first@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 lower-case@1.1.4: {} lower-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 lru-cache@10.4.3: {} @@ -24518,7 +24512,7 @@ snapshots: no-case@3.0.4: dependencies: lower-case: 2.0.2 - tslib: 2.7.0 + tslib: 2.8.1 nocache@3.0.4: {} @@ -24861,7 +24855,7 @@ snapshots: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) get-uri: 6.0.3 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.5 @@ -24941,7 +24935,7 @@ snapshots: pascal-case@3.1.2: dependencies: no-case: 3.0.4 - tslib: 2.7.0 + tslib: 2.8.1 password-prompt@1.1.3: dependencies: @@ -25243,7 +25237,7 @@ snapshots: proxy-agent@6.4.0: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.5 lru-cache: 7.18.3 @@ -25288,7 +25282,7 @@ snapshots: pvtsutils@1.3.5: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 pvutils@1.1.3: {} @@ -25516,7 +25510,7 @@ snapshots: dependencies: react: 18.3.1 react-style-singleton: 2.2.1(@types/react@18.3.18)(react@18.3.1) - tslib: 2.7.0 + tslib: 2.8.1 optionalDependencies: '@types/react': 18.3.18 @@ -25524,7 +25518,7 @@ snapshots: dependencies: react: 18.3.1 react-style-singleton: 2.2.1(@types/react@18.3.18)(react@18.3.1) - tslib: 2.7.0 + tslib: 2.8.1 optionalDependencies: '@types/react': 18.3.18 @@ -25544,7 +25538,7 @@ snapshots: react: 18.3.1 react-remove-scroll-bar: 2.3.6(@types/react@18.3.18)(react@18.3.1) react-style-singleton: 2.2.1(@types/react@18.3.18)(react@18.3.1) - tslib: 2.7.0 + tslib: 2.8.1 use-callback-ref: 1.3.2(@types/react@18.3.18)(react@18.3.1) use-sidecar: 1.1.2(@types/react@18.3.18)(react@18.3.1) optionalDependencies: @@ -25645,7 +25639,7 @@ snapshots: esprima: 4.0.1 source-map: 0.6.1 tiny-invariant: 1.3.3 - tslib: 2.7.0 + tslib: 2.8.1 receptacle@1.3.2: dependencies: @@ -25895,7 +25889,7 @@ snapshots: rxjs@7.8.1: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 safe-buffer@5.1.2: {} @@ -26135,7 +26129,7 @@ snapshots: socket.io-client@4.8.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 engine.io-client: 6.6.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) socket.io-parser: 4.2.4 transitivePeerDependencies: @@ -26146,14 +26140,14 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color socks-proxy-agent@8.0.4: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -26215,7 +26209,7 @@ snapshots: sponge-case@1.0.1: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 sprintf-js@1.0.3: {} @@ -26452,7 +26446,7 @@ snapshots: swap-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 symbol-tree@3.2.4: {} @@ -26627,7 +26621,7 @@ snapshots: title-case@3.0.3: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 tldts-core@6.1.49: {} @@ -27008,13 +27002,13 @@ snapshots: upper-case-first@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 upper-case@1.1.3: {} upper-case@2.0.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 uqr@0.1.2: {} @@ -27393,7 +27387,7 @@ snapshots: '@peculiar/json-schema': 1.1.12 asn1js: 3.0.5 pvtsutils: 1.3.5 - tslib: 2.7.0 + tslib: 2.8.1 webextension-polyfill@0.10.0: {} From 45770e14946e95350fb6d01043045eecf68b3699 Mon Sep 17 00:00:00 2001 From: debuggingfuture Date: Mon, 20 Jan 2025 19:06:45 +0800 Subject: [PATCH 4/5] update: deps with decorator --- apps/storybook/package.json | 2 +- .../src/stories/decorators/privy.tsx | 26 ++ .../src/stories/privy-aa/privy-aa.stories.tsx | 37 -- .../src/stories/privy/privy-aa.stories.tsx | 20 + .../src/stories/privy/privy-login.stories.tsx | 3 +- env.sample | 4 +- packages/domain/package.json | 2 +- packages/domain/src/config.ts | 3 + packages/ui-react/package.json | 4 +- .../privy-aa/account-abstraction.tsx | 18 +- .../src/components/privy-aa/provider.tsx | 32 +- pnpm-lock.yaml | 432 ++++-------------- 12 files changed, 168 insertions(+), 415 deletions(-) create mode 100644 apps/storybook/src/stories/decorators/privy.tsx delete mode 100644 apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx create mode 100644 apps/storybook/src/stories/privy/privy-aa.stories.tsx diff --git a/apps/storybook/package.json b/apps/storybook/package.json index 7cba7202..e8e710a0 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -22,7 +22,7 @@ "@noble/hashes": "^1.6.1", "@noble/secp256k1": "^2.1.0", "@openzeppelin/merkle-tree": "^1.0.7", - "@privy-io/react-auth": "^1.95.2", + "@privy-io/react-auth": "^2.0.4", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-accessible-icon": "^1.0.3", "@radix-ui/react-accordion": "^1.2.0", diff --git a/apps/storybook/src/stories/decorators/privy.tsx b/apps/storybook/src/stories/decorators/privy.tsx new file mode 100644 index 00000000..c2dc0e98 --- /dev/null +++ b/apps/storybook/src/stories/decorators/privy.tsx @@ -0,0 +1,26 @@ +import { PrivyAAProvider } from "@geist/ui-react/components/privy-aa/provider.js"; +import { WAGMI_CONFIG } from "@geist/ui-react/lib/utils/wagmi-config.js"; +import { QueryClient } from "@tanstack/react-query"; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + refetchOnWindowFocus: false, + }, + }, +}); + +export const withPrivyProvider = ({ appId }: { appId: string }) => { + return (Story: any) => ( +
+ + {Story()} + +
+ ); +}; diff --git a/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx b/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx deleted file mode 100644 index e4ee6ac1..00000000 --- a/apps/storybook/src/stories/privy-aa/privy-aa.stories.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { PrivyAAFlow } from "@geist/ui-react/components/privy-aa/account-abstraction.js"; -import { PrivyAAProvider } from "@geist/ui-react/components/privy-aa/provider.js"; - -import type { Meta, StoryObj } from "@storybook/react"; - -interface PrivyAAProps { - appId: string; -} - -function PrivyAAStories({ appId }: PrivyAAProps) { - return ( - - - - ); -} - -const meta = { - title: "Privy/Account Abstraction", - component: PrivyAAStories, - argTypes: { - appId: { - control: "text", - name: "Privy App ID", - }, - }, -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = { - args: { - appId: "", - }, -}; diff --git a/apps/storybook/src/stories/privy/privy-aa.stories.tsx b/apps/storybook/src/stories/privy/privy-aa.stories.tsx new file mode 100644 index 00000000..a6a49f3f --- /dev/null +++ b/apps/storybook/src/stories/privy/privy-aa.stories.tsx @@ -0,0 +1,20 @@ +import { PrivyAAFlow } from "@geist/ui-react/components/privy-aa/account-abstraction.js"; + +import config from "@geist/domain/config"; +import type { Meta, StoryObj } from "@storybook/react"; +import { withPrivyProvider } from "#stories/decorators/privy.tsx"; + +const meta = { + title: "Privy/Account Abstraction", + component: PrivyAAFlow, + argTypes: {}, + decorators: [withPrivyProvider({ appId: config.privy.appId! })], +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: {}, +}; diff --git a/apps/storybook/src/stories/privy/privy-login.stories.tsx b/apps/storybook/src/stories/privy/privy-login.stories.tsx index dff9f9a9..35251f17 100644 --- a/apps/storybook/src/stories/privy/privy-login.stories.tsx +++ b/apps/storybook/src/stories/privy/privy-login.stories.tsx @@ -1,3 +1,4 @@ +import config from "@geist/domain/config"; import { PrivyLogin, PrivyLoginProvider, @@ -33,6 +34,6 @@ type Story = StoryObj; export const Default: Story = { args: { - appId: "cm2vi1gua0aukbq4p69w3rphl", + appId: config.privy.appId!, }, }; diff --git a/env.sample b/env.sample index 3e5a3853..ba8a25d4 100644 --- a/env.sample +++ b/env.sample @@ -23,4 +23,6 @@ LIGHTHOUSE_API_KEY= STORACHA_KEY= STORACHA_PROOF= -PIMLICO_API_KEY= \ No newline at end of file +PIMLICO_API_KEY= + +PRIVY_APP_ID=cm2vi1gua0aukbq4p69w3rphl \ No newline at end of file diff --git a/packages/domain/package.json b/packages/domain/package.json index 4caf7fa8..92a492b6 100644 --- a/packages/domain/package.json +++ b/packages/domain/package.json @@ -33,7 +33,7 @@ "@noble/hashes": "^1.6.1", "@noble/secp256k1": "^2.1.0", "@openzeppelin/merkle-tree": "^1.0.7", - "@privy-io/react-auth": "^1.95.2", + "@privy-io/react-auth": "^2.0.4", "@geist/graphql": "workspace:*", "@scure/base": "^1.1.9", "@storybook/components": "^8.3.6", diff --git a/packages/domain/src/config.ts b/packages/domain/src/config.ts index 953ce5dd..9fb23fc9 100644 --- a/packages/domain/src/config.ts +++ b/packages/domain/src/config.ts @@ -36,4 +36,7 @@ export default { pimlico: { apiKey: process.env.PIMLICO_API_KEY, }, + privy: { + appId: process.env.PRIVY_APP_ID, + }, }; diff --git a/packages/ui-react/package.json b/packages/ui-react/package.json index 438f2dd5..456a128e 100644 --- a/packages/ui-react/package.json +++ b/packages/ui-react/package.json @@ -53,8 +53,8 @@ "@noble/hashes": "^1.6.1", "@noble/secp256k1": "^2.1.0", "@openzeppelin/merkle-tree": "^1.0.7", - "@privy-io/react-auth": "^1.95.2", - "@privy-io/wagmi": "^0.2.13", + "@privy-io/react-auth": "^2.0.4", + "@privy-io/wagmi": "^1.0.2", "@privy-io/wagmi-connector": "^0.1.13", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-accessible-icon": "^1.0.3", diff --git a/packages/ui-react/src/components/privy-aa/account-abstraction.tsx b/packages/ui-react/src/components/privy-aa/account-abstraction.tsx index 8b4a9feb..5d55a40c 100644 --- a/packages/ui-react/src/components/privy-aa/account-abstraction.tsx +++ b/packages/ui-react/src/components/privy-aa/account-abstraction.tsx @@ -1,6 +1,13 @@ -import { usePrivy, useWallets } from "@privy-io/react-auth"; +import { + type ConnectedWallet, + usePrivy, + useWallets, +} from "@privy-io/react-auth"; import { useSetActiveWallet } from "@privy-io/wagmi"; -import { SmartAccountClient, createSmartAccountClient } from "permissionless"; +import { + type SmartAccountClient, + createSmartAccountClient, +} from "permissionless"; import { toSimpleSmartAccount } from "permissionless/accounts"; import { useEffect, useMemo, useState } from "react"; import { zeroAddress } from "viem"; @@ -87,12 +94,13 @@ export function PrivyAAFlow() { {!isAuthenticated && } {isWalletsReady && - wallets.map((wallet) => { + wallets.map((wallet: ConnectedWallet) => { return (