diff --git a/app/page.tsx b/app/page.tsx index 09831a6..062c540 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -2,23 +2,22 @@ import { LoginSignupCard } from "@/components/LoginSignupCard"; import { UserCard } from "@/components/UserCard"; -import { AccountContextProvider } from "@/context/AccountContext"; -import { useSignerContext } from "@/context/SignerContext"; +import { useAccount, useSignerStatus } from "@alchemy/aa-alchemy/react"; export default function Home() { - const { signer, account, isLoadingUser, refetchUserDetails } = - useSignerContext(); + const signerStatus = useSignerStatus(); + const { account } = useAccount({ + type: "MultiOwnerModularAccount", + }); return (
- {isLoadingUser ? ( + {signerStatus.isInitializing ? ( ) : account == null ? ( - + ) : ( - - - + )}
); diff --git a/app/providers.tsx b/app/providers.tsx index 58b538f..7b754b3 100644 --- a/app/providers.tsx +++ b/app/providers.tsx @@ -1,29 +1,27 @@ "use client"; -import { SignerContextProvider } from "@/context/SignerContext"; +import { createConfig } from "@alchemy/aa-alchemy/config"; +import { AlchemyAccountProvider } from "@alchemy/aa-alchemy/react"; +import { sepolia } from "@alchemy/aa-core"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { PropsWithChildren, Suspense, useState } from "react"; +import { PropsWithChildren, Suspense } from "react"; -const TurnkeyIframeContainerId = "turnkey-iframe-container-id"; -const TurnkeyIframeElementId = "turnkey-iframe-element-id"; +const config = createConfig({ + // required + rpcUrl: "/api/rpc", + chain: sepolia, + // optional + rootOrgId: "3121a8a0-c548-4d14-a313-630c3b739858", +}); -export const Providers = (props: PropsWithChildren) => { - const [queryClient] = useState(() => new QueryClient()); - const [clientConfig] = useState({ - connection: { - rpcUrl: "/api/rpc", - }, - iframeConfig: { - iframeContainerId: TurnkeyIframeContainerId, - iframeElementId: TurnkeyIframeElementId, - }, - }); +const queryClient = new QueryClient(); +export const Providers = (props: PropsWithChildren<{}>) => { return ( - + {props.children} - + ); diff --git a/client.ts b/client.ts deleted file mode 100644 index 42ec26a..0000000 --- a/client.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createBundlerClient, sepolia } from "@alchemy/aa-core"; -import { http } from "viem"; - -export const publicClient = createBundlerClient({ - chain: sepolia, - transport: http("/api/rpc"), -}); diff --git a/components/EmailBundleForm.tsx b/components/EmailBundleForm.tsx deleted file mode 100644 index e3243ed..0000000 --- a/components/EmailBundleForm.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useForm } from "@tanstack/react-form"; -import { zodValidator } from "@tanstack/zod-form-adapter"; - -type Props = { - onSubmit: (bundle: string) => void | Promise; - buttonCta?: string; - buttonDisabled?: boolean; -}; - -const EmailBundleForm = ({ onSubmit, buttonDisabled }: Props) => { - const form = useForm({ - defaultValues: { - bundle: "", - }, - validatorAdapter: zodValidator, - onSubmit: ({ value }) => onSubmit(value.bundle), - }); - - return
Check your email and click the link to complete login
; -}; - -export default EmailBundleForm; diff --git a/components/LoginSignupCard.tsx b/components/LoginSignupCard.tsx index e6dfeff..7e9281f 100644 --- a/components/LoginSignupCard.tsx +++ b/components/LoginSignupCard.tsx @@ -1,24 +1,14 @@ "use client"; -import { AlchemySigner } from "@alchemy/aa-alchemy"; -import { useMutation } from "@tanstack/react-query"; +import { useAccount, useAuthenticate } from "@alchemy/aa-alchemy/react"; import { useState } from "react"; -import EmailBundleForm from "./EmailBundleForm"; import EmailForm from "./EmailForm"; -type Props = { - signer?: AlchemySigner; - onLogin: () => void; -}; - -export const LoginSignupCard = ({ signer, onLogin }: Props) => { +export const LoginSignupCard = () => { const [email, setEmail] = useState(undefined); - - const { mutate, isPending } = useMutation({ - mutationFn: signer?.authenticate, - onSuccess: onLogin, - onError: (e) => { - console.error("Failed to login", e); - }, + const { authenticate, isPending } = useAuthenticate(); + const { isLoadingAccount } = useAccount({ + type: "MultiOwnerModularAccount", + skipCreate: true, }); return ( @@ -26,19 +16,15 @@ export const LoginSignupCard = ({ signer, onLogin }: Props) => {

Login / Signup

{email && isPending ? ( - // OTP bundle input - { - // resolve(bundle); - }} - /> +
Check your email and click the link to complete login
) : ( // email input <> { setEmail(email); - mutate({ + authenticate({ type: "email", email, }); @@ -46,19 +32,25 @@ export const LoginSignupCard = ({ signer, onLogin }: Props) => { />
diff --git a/components/UserCard.tsx b/components/UserCard.tsx index e451b20..ad75e9e 100644 --- a/components/UserCard.tsx +++ b/components/UserCard.tsx @@ -1,83 +1,60 @@ "use client"; -import { publicClient } from "@/client"; -import { useAccountContext } from "@/context/AccountContext"; -import { useSignerContext } from "@/context/SignerContext"; +import { + useAddPasskey, + useBundlerClient, + useExportAccount, + useLogout, + useSignMessage, + useSmartAccountClient, + useUser, +} from "@alchemy/aa-alchemy/react"; import { useForm } from "@tanstack/react-form"; -import { useMutation } from "@tanstack/react-query"; import { zodValidator } from "@tanstack/zod-form-adapter"; +import { useCallback, useState } from "react"; import { z } from "zod"; -const TurnkeyExportWalletContainerId = "turnkey-export-wallet-container-id"; -const TurnkeyExportWalletElementId = "turnkey-export-wallet-element-id"; - -const iframeCss = ` -iframe { - box-sizing: border-box; - width: 100%; - height: 120px; - border-radius: 8px; - border-width: 1px; - border-style: solid; - border-color: rgba(216, 219, 227, 1); - padding: 20px; -} -`; - export const UserCard = () => { - const { signer, user, account } = useSignerContext(); - const { provider } = useAccountContext(); + const bundlerClient = useBundlerClient(); + const { client, isLoadingClient } = useSmartAccountClient({ + type: "MultiOwnerModularAccount", + }); + const user = useUser(); - const { mutate: signMessage, data: { signature, isValid } = {} } = - useMutation({ - mutationFn: async (msg: string) => { - return provider - .signMessageWith6492({ message: msg }) - .then(async (signature) => { - return { - signature, - isValid: await publicClient - .verifyMessage({ - address: provider.getAddress(), - message: msg, - signature, - }) - .catch((e: any) => { - console.log("error verifying signature, ", e); - return false; - }), - }; - }); - }, - }); + const { signMessageAsync, signedMessage } = useSignMessage({ client }); + const [isValid, setIsValid] = useState(false); + const signMessageAndVerify = useCallback( + async ({ message }: { message: string }) => { + if (!client) { + return; + } - const { mutate, isPending, data } = useMutation({ - mutationFn: async () => - signer.exportWallet({ - iframeContainerId: TurnkeyExportWalletContainerId, - iframeElementId: TurnkeyExportWalletElementId, - }), - }); + const signature = await signMessageAsync({ message }); + const isValid = await bundlerClient.verifyMessage({ + message, + signature, + address: client.getAddress(), + }); - const { mutate: addPasskey } = useMutation({ - mutationFn: async () => signer.addPasskey({}), - onSuccess: (data) => { - console.log(data); - }, - }); + setIsValid(isValid); - const { mutate: logout } = useMutation({ - mutationFn: async () => signer.disconnect(), - onSuccess: () => { - window.location.reload(); + return { signature, isValid }; }, - }); + [bundlerClient, client, signMessageAsync] + ); + + const { exportAccount, isExporting, isExported, ExportAccountComponent } = + useExportAccount(); + + const { addPasskey } = useAddPasskey(); + + const { logout } = useLogout({ onSuccess: window.location.reload }); const form = useForm({ defaultValues: { message: "", }, validatorAdapter: zodValidator, - onSubmit: ({ value }) => signMessage(value.message), + onSubmit: ({ value }) => signMessageAndVerify({ message: value.message }), }); return ( @@ -98,7 +75,7 @@ export const UserCard = () => {
Account Address - {account!.address} + {client?.account.address}
Signer Address @@ -144,7 +121,7 @@ export const UserCard = () => { {({ canSubmit, isSubmitting }) => ( ) : ( Seed Phrase )} -
- -
+ iframeCss={{ + boxSizing: "border-box", + width: "100%", + height: "120px", + borderRadius: "8px", + borderWidth: "1px", + borderStyle: "solid", + borderColor: "rgba(216, 219, 227, 1)", + padding: "20px", + }} + isExported={isExported} + />
diff --git a/context/AccountContext.tsx b/context/AccountContext.tsx deleted file mode 100644 index 53dfe67..0000000 --- a/context/AccountContext.tsx +++ /dev/null @@ -1,57 +0,0 @@ -"use client"; - -import { publicClient } from "@/client"; -import type { MultiOwnerModularAccount } from "@alchemy/aa-accounts"; -import { - AlchemySigner, - createAlchemySmartAccountClient, -} from "@alchemy/aa-alchemy"; -import { PropsWithChildren, createContext, useContext, useState } from "react"; -import type { Chain, Transport } from "viem"; - -type AccountContextType = { - provider: ReturnType< - typeof createAlchemySmartAccountClient< - Transport, - Chain, - MultiOwnerModularAccount - > - >; -}; - -const AccountContext = createContext(undefined); - -export const useAccountContext = () => { - const context = useContext(AccountContext); - - if (context === undefined) { - throw new Error("useAccountContext must be used within a AccountProvider"); - } - - return context; -}; - -type CreateContextProviderProps = { - account: MultiOwnerModularAccount; -}; - -export const AccountContextProvider = ({ - children, - account, -}: PropsWithChildren) => { - const [provider] = useState(() => { - if (typeof document === "undefined") return undefined; - - return createAlchemySmartAccountClient({ - chain: publicClient.chain, - rpcUrl: "/api/rpc", - account, - }); - }); - - return ( - - {children} - - ); -}; diff --git a/context/SignerContext.tsx b/context/SignerContext.tsx deleted file mode 100644 index 21a4927..0000000 --- a/context/SignerContext.tsx +++ /dev/null @@ -1,108 +0,0 @@ -"use client"; - -import { publicClient } from "@/client"; -import { - MultiOwnerModularAccount, - createMultiOwnerModularAccount, -} from "@alchemy/aa-accounts"; -import { - AlchemySigner, - AlchemySignerClient, - AlchemySignerParams, - User, -} from "@alchemy/aa-alchemy"; -import { sepolia } from "@alchemy/aa-core"; -import { useQuery } from "@tanstack/react-query"; -import { useSearchParams } from "next/navigation"; -import { PropsWithChildren, createContext, useContext, useState } from "react"; -import { custom } from "viem"; - -type SignerContextType = { - signer: AlchemySigner; - account?: MultiOwnerModularAccount | null; - user?: User | null; - isLoadingUser: boolean; - refetchUserDetails: () => void; -}; - -const SignerContext = createContext(undefined); - -export const useSignerContext = (): SignerContextType => { - const context = useContext(SignerContext); - - if (context === undefined) { - throw new Error("useSignerContext must be used within a SignerContext"); - } - - return context; -}; - -export const SignerContextProvider = ({ - children, - ...signerConfig -}: PropsWithChildren<{ - client: Exclude; - sessionConfig?: AlchemySignerParams["sessionConfig"]; -}>) => { - const [signer] = useState(() => { - if (typeof window === "undefined") return undefined; - - const iframeContainer = document.createElement("div"); - iframeContainer.id = signerConfig.client.iframeConfig.iframeContainerId; - iframeContainer.style.display = "none"; - document.body.appendChild(iframeContainer); - - return new AlchemySigner(signerConfig); - }); - - const params = useSearchParams(); - - // TODO: the refetch logic should be moved into the context here - const { - data = { user: null, account: null }, - isLoading: isLoadingUser, - refetch: refetchUserDetails, - } = useQuery({ - queryKey: ["user"], - queryFn: async () => { - if (params.get("bundle") != null) { - await signer!.authenticate({ - type: "email", - bundle: params.get("bundle")!, - }); - } - - // this only ever runs on the client, so we can assume the signer is defined - const user = await signer!.getAuthDetails().catch(() => { - return null; - }); - - const account = user - ? await createMultiOwnerModularAccount({ - transport: custom(publicClient), - chain: sepolia, - signer: signer!, - }) - : null; - - return { - account, - user, - }; - }, - }); - - return ( - - {children} - - ); -}; diff --git a/hooks/usePromise.ts b/hooks/usePromise.ts deleted file mode 100644 index 50cf49e..0000000 --- a/hooks/usePromise.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { useState } from "react"; - -export const usePromise = () => { - const [resolve, setResolve] = useState<(value: T) => void>(); - const [reject, setReject] = useState<(reason?: any) => void>(); - - const [promise] = useState( - () => - new Promise((resolve, reject) => { - setResolve(() => resolve); - setReject(() => reject); - }) - ); - - return { - promise, - resolve: resolve!, - reject: reject!, - }; -}; diff --git a/package.json b/package.json index eab5df3..0a4b4af 100644 --- a/package.json +++ b/package.json @@ -9,22 +9,22 @@ "lint": "next lint" }, "dependencies": { - "@alchemy/aa-accounts": "^3.4.0", - "@alchemy/aa-alchemy": "^3.4.0", + "@alchemy/aa-accounts": "^3.8.0", + "@alchemy/aa-alchemy": "^3.8.0", "@t3-oss/env-core": "^0.7.1", "@t3-oss/env-nextjs": "^0.7.1", "@tanstack/react-form": "^0.13.3", - "@tanstack/react-query": "^5.17.15", + "@tanstack/react-query": "^5.28.9", "@tanstack/zod-form-adapter": "^0.13.3", "next": "14.1.0", - "react": "^18", - "react-dom": "^18", - "viem": "^2.7.8", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "viem": "2.8.6", "zod": "^3.22.4" }, "devDependencies": { "@types/node": "^20", - "@types/react": "^18", + "@types/react": "^18.2.73", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", "daisyui": "^4.6.0", diff --git a/yarn.lock b/yarn.lock index a3b21e9..5f39704 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,37 +12,39 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== -"@alchemy/aa-accounts@^3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-3.4.0.tgz#9fe7b12eb4d52f0e9047d765d365cc19a9aae791" - integrity sha512-9G2Eq5TSFdxijTG32h8hP42o8uUtYVNPy7sTrmulWwD7/PP0xNNBN0qoK2vzv266JV+QRqj4ItMtYNewcHsFpg== +"@alchemy/aa-accounts@^3.8.0": + version "3.8.0" + resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-3.8.0.tgz#29821225f9b547fdddc1fa0f34184173a7f245aa" + integrity sha512-TrXu1UPUhV9FW8OZ9b+i9fD9/sjIcxSK+fEujKqc6yZbch6yEdK7y5aVUt5vGsb3fOiT2zhKPb8w0CA0isiN8w== dependencies: - "@alchemy/aa-core" "^3.4.0" - viem "^2.7.8" + "@alchemy/aa-core" "^3.8.0" + viem "2.8.6" -"@alchemy/aa-alchemy@^3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-3.4.0.tgz#6e90429c059c2aa8f7f1c28d2dc04be5f1aeb47c" - integrity sha512-QuGyu/6pRvLDNJmF+NXuIjEv2KWwsbCjzZQ2SrzJPePSqVcHEsN6U0Ms4tCx48DgVx+HHC4qHyaouSTmkcOCEg== +"@alchemy/aa-alchemy@^3.8.0": + version "3.8.0" + resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-3.8.0.tgz#6cfae5edc2203d5ea772f233605fab7df441baa6" + integrity sha512-O6vRc7u3aohf9XeAS9r0zqiQdI5MME7jNdlg3Q0jh3G5HsCLFXhQGa+C0lGJhPdNb1i4qJ2frvqYs1eYdVmTmQ== dependencies: - "@alchemy/aa-core" "^3.4.0" + "@alchemy/aa-core" "^3.8.0" "@turnkey/http" "^2.6.2" "@turnkey/iframe-stamper" "^1.0.0" "@turnkey/viem" "^0.4.8" "@turnkey/webauthn-stamper" "^0.4.3" - viem "^2.7.8" + eventemitter3 "^5.0.1" + viem "2.8.6" + zustand "^4.5.2" optionalDependencies: - "@alchemy/aa-accounts" "^3.4.0" + "@alchemy/aa-accounts" "^3.8.0" alchemy-sdk "^3.0.0" -"@alchemy/aa-core@^3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-3.4.0.tgz#08e514bf2f97a9c1452424a7f7915aa48daf4db2" - integrity sha512-kEqsMwweMxQU6b8mKNmkUacyZRxdU7WBBiAYNmGxJK5djOdsGlfCBZGHu2AyAb8ogfrGWX8J+uVuYTnCIZS6ew== +"@alchemy/aa-core@^3.8.0": + version "3.8.0" + resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-3.8.0.tgz#0db37dd333143609cfefe5ddb9b2f360b45c8ec2" + integrity sha512-/Z1Jo6d54GmTrIbx1oI4e9yc2L3FBnj6SHaryEn/sJpwhFL3piJGpNrzlrLDhwvkdjxYIXy5rn9c8vkvogSYTg== dependencies: abitype "^0.8.3" eventemitter3 "^5.0.1" - viem "^2.7.8" + viem "2.8.6" zod "^3.22.4" "@alloc/quick-lru@^5.2.0": @@ -547,18 +549,23 @@ "@noble/hashes" "1.3.2" "@noble/curves@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.3.0.tgz#01be46da4fd195822dab821e72f71bf4aeec635e" - integrity sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" + integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== dependencies: - "@noble/hashes" "1.3.3" + "@noble/hashes" "1.4.0" "@noble/hashes@1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.3.3", "@noble/hashes@^1.3.2", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": +"@noble/hashes@1.4.0", "@noble/hashes@^1.3.2": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + +"@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": version "1.3.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== @@ -642,10 +649,10 @@ dependencies: "@tanstack/store" "^0.3.1" -"@tanstack/query-core@5.24.1": - version "5.24.1" - resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.24.1.tgz#d40928dec22b47df97fb2648e8c499772e8d7eb2" - integrity sha512-DZ6Nx9p7BhjkG50ayJ+MKPgff+lMeol7QYXkvuU5jr2ryW/4ok5eanaS9W5eooA4xN0A/GPHdLGOZGzArgf5Cg== +"@tanstack/query-core@5.28.9": + version "5.28.9" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.28.9.tgz#170a7a8794ab73aeffbaf711ac62126479a5d026" + integrity sha512-hNlfCiqZevr3GRVPXS3MhaGW5hjcxvCsIQ4q6ff7EPlvFwYZaS+0d9EIIgofnegDaU2BbCDlyURoYfRl5rmzow== "@tanstack/react-form@^0.13.3": version "0.13.6" @@ -657,12 +664,12 @@ decode-formdata "^0.4.0" rehackt "^0.0.3" -"@tanstack/react-query@^5.17.15": - version "5.24.1" - resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.24.1.tgz#bcb913febe0d813cec1fda7783298d07aa998b20" - integrity sha512-4+09JEdO4d6+Gc8Y/g2M/MuxDK5IY0QV8+2wL2304wPKJgJ54cBbULd3nciJ5uvh/as8rrxx6s0mtIwpRuGd1g== +"@tanstack/react-query@^5.28.9": + version "5.28.9" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.28.9.tgz#13c2049daa5db6c3137473e279b209f76d39708e" + integrity sha512-vwifBkGXsydsLxFOBMe3+f8kvtDoqDRDwUNjPHVDDt+FoBetCbOWAUHgZn4k+CVeZgLmy7bx6aKeDbe3e8koOQ== dependencies: - "@tanstack/query-core" "5.24.1" + "@tanstack/query-core" "5.28.9" "@tanstack/react-store@^0.3.1": version "0.3.1" @@ -698,10 +705,10 @@ resolved "https://registry.yarnpkg.com/@turnkey/encoding/-/encoding-0.1.0.tgz#85461c3aa11c70882cc2b0853f5db40f576c3ac9" integrity sha512-aLmLrWtvV1k9UyGzuzMpBFdwleCH8VpzXIriusVMrFLiQp+4uHCS9cwrEG1glg3207ewWFDtvgj31qLoJS29pg== -"@turnkey/http@2.7.1", "@turnkey/http@^2.6.2": - version "2.7.1" - resolved "https://registry.yarnpkg.com/@turnkey/http/-/http-2.7.1.tgz#fec1ebb5b80379460c45f3b05d0af65843d0598b" - integrity sha512-yrmE5FcMYanrNqwnvSy0cLaZBHTe0TWK+DAvPXDF655Ki+AP/+nHzYrzGK7aneNfTJIMPP9AEYdxY2PkytKtBg== +"@turnkey/http@2.10.0", "@turnkey/http@^2.6.2": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@turnkey/http/-/http-2.10.0.tgz#9e8d0dc6279719e3efaf5ae1df7dc9fd5a111ecf" + integrity sha512-5I2VwOzxYGxmSy8UOZn8rsV23gmK8v93KqNZ/mjf4GrFQ69q8LCaAFmrH1Zo+/J7eq0/GQdxNqBHfJKLp5iihw== dependencies: "@turnkey/api-key-stamper" "0.4.0" "@turnkey/encoding" "0.1.0" @@ -709,17 +716,17 @@ cross-fetch "^3.1.5" "@turnkey/iframe-stamper@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@turnkey/iframe-stamper/-/iframe-stamper-1.0.0.tgz#8133ca88c089f6e4c791fd8089bbd19d2b5d1932" - integrity sha512-hdHrqNQMO2YtmyF06qNsFWB+CF/0SfmZb5P7e8F8YaSkQUYfGGuwl7ld8SIml6ZEAmw9xl2aypbUMRm1/juIpA== + version "1.2.0" + resolved "https://registry.yarnpkg.com/@turnkey/iframe-stamper/-/iframe-stamper-1.2.0.tgz#bba478e391a266833f1a5960b9f1df9de5934fb8" + integrity sha512-OXbCVVzypa0AXa6dcNpfu8Q0xY/sq2nGXwhesrUQmE7V5I5nYYHZE3sQv54lErToX6H6YyDR9Z1DuPzEUkYTjw== "@turnkey/viem@^0.4.8": - version "0.4.10" - resolved "https://registry.yarnpkg.com/@turnkey/viem/-/viem-0.4.10.tgz#8beabc9af7fbcc85f0b50d7d28a87ccf90ba42c0" - integrity sha512-x2k+8h7ic1hrFZ4zOFCD9CMI7ZhrQ/TeQ6k20rHZ3dbG0RyalIa29IulL0iJ7xjUX6v/3sucyGt6FtS6yjIWgg== + version "0.4.14" + resolved "https://registry.yarnpkg.com/@turnkey/viem/-/viem-0.4.14.tgz#bbc60bd8ce478401e9e7900357de7edc792acd14" + integrity sha512-YMREwb7QBBuge8wxdpFGKAl48e4W/rX84XR1E5GsD5HnypNPnfMu/AI7Np0cbQBA6IRuwY9HWu3HbDPU9kicDg== dependencies: "@turnkey/api-key-stamper" "0.4.0" - "@turnkey/http" "2.7.1" + "@turnkey/http" "2.10.0" cross-fetch "^4.0.0" typescript "^5.1" @@ -762,7 +769,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18": +"@types/react@*": version "18.2.61" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.61.tgz#5607308495037436779939ec0348a5816c08799d" integrity sha512-NURTN0qNnJa7O/k4XUkEW2yfygA+NxS0V5h1+kp9jPwhzZy95q3ADoGMP0+JypMhrZBTTgjKAUlTctde1zzeQA== @@ -771,6 +778,14 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^18.2.73": + version "18.2.73" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.73.tgz#0579548ad122660d99e00499d22e33b81e73ed94" + integrity sha512-XcGdod0Jjv84HOC7N5ziY3x+qL0AfmubvKOZ9hJjJ2yd5EE+KYjWhdOjt387e9HPheHkdggF9atTifMRtyAaRA== + dependencies: + "@types/prop-types" "*" + csstype "^3.0.2" + "@types/scheduler@*": version "0.16.8" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff" @@ -863,9 +878,9 @@ ajv@^6.12.4: uri-js "^4.2.2" alchemy-sdk@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/alchemy-sdk/-/alchemy-sdk-3.1.2.tgz#0808aeed7fcbbed9c516021ce9d4aa0e33e5ccf9" - integrity sha512-xpCgQRLektp6imKdGdHyuVHvbMGpaSe22+qvg9jjGx0Wwkh0XgPzSfKwAzFDlkCGMMdazhKCsHu22XP0xh1noQ== + version "3.2.1" + resolved "https://registry.yarnpkg.com/alchemy-sdk/-/alchemy-sdk-3.2.1.tgz#23ced2b6f44ce4960ca0950b3b328c0d12b0098e" + integrity sha512-ytCllr0E3TZxlYT2o/+i8AVEFJwRS7msXYvS3f/L47VEemkv0Hpz09XTqbjOcfur2PooEMcD8rn5oKrbwLyFrQ== dependencies: "@ethersproject/abi" "^5.7.0" "@ethersproject/abstract-provider" "^5.7.0" @@ -1067,11 +1082,11 @@ axe-core@=4.7.0: integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== axios@^1.6.5: - version "1.6.7" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" - integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== dependencies: - follow-redirects "^1.15.4" + follow-redirects "^1.15.6" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -1300,13 +1315,13 @@ culori@^3: resolved "https://registry.yarnpkg.com/culori/-/culori-3.3.0.tgz#e33530adbd124d53bd6550394397e695eaaed739" integrity sha512-pHJg+jbuFsCjz9iclQBqyL3B2HLCBF71BwVNujUYEvCeQMvV97R59MNK3R2+jgJ3a1fcZgI9B3vYgz8lzr/BFQ== -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== +d@1, d@^1.0.1, d@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.2.tgz#2aefd554b81981e7dccf72d6842ae725cb17e5de" + integrity sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw== dependencies: - es5-ext "^0.10.50" - type "^1.0.1" + es5-ext "^0.10.64" + type "^2.7.2" daisyui@^4.6.0: version "4.7.2" @@ -1564,7 +1579,7 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@^0.10.62, es5-ext@~0.10.14: +es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@~0.10.14: version "0.10.64" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.64.tgz#12e4ffb48f1ba2ea777f1fcdd1918ef73ea21714" integrity sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg== @@ -1584,12 +1599,12 @@ es6-iterator@^2.0.3: es6-symbol "^3.1.1" es6-symbol@^3.1.1, es6-symbol@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + version "3.1.4" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.4.tgz#f4e7d28013770b4208ecbf3e0bf14d3bcb557b8c" + integrity sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg== dependencies: - d "^1.0.1" - ext "^1.1.2" + d "^1.0.2" + ext "^1.7.0" escalade@^3.1.1: version "3.1.2" @@ -1830,7 +1845,7 @@ eventemitter3@^5.0.1: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== -ext@^1.1.2: +ext@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== @@ -1911,10 +1926,10 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== -follow-redirects@^1.15.4: - version "1.15.5" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" - integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== for-each@^0.3.3: version "0.3.3" @@ -2940,7 +2955,7 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -react-dom@^18: +react-dom@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== @@ -2953,7 +2968,7 @@ react-is@^16.13.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react@^18: +react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== @@ -3389,11 +3404,6 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - type@^2.7.2: version "2.7.2" resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" @@ -3450,11 +3460,16 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^5, typescript@^5.1: +typescript@^5: version "5.3.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== +typescript@^5.1: + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -3485,7 +3500,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -use-sync-external-store@^1.2.0: +use-sync-external-store@1.2.0, use-sync-external-store@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== @@ -3502,10 +3517,10 @@ util-deprecate@^1.0.2: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -viem@^2.7.8: - version "2.7.16" - resolved "https://registry.yarnpkg.com/viem/-/viem-2.7.16.tgz#99e66bbec661b2284bc32061474f20a90381bdcb" - integrity sha512-yOPa9yaoJUm44m0Qe3ugHnkHol3QQlFxN3jT+bq+lQip7X7cWdPfmguyfLWX2viCXcmYZUDiQdeFbkPW9lw11Q== +viem@2.8.6: + version "2.8.6" + resolved "https://registry.yarnpkg.com/viem/-/viem-2.8.6.tgz#7467a0f113b4b13dd53fde4797aec1e686672f03" + integrity sha512-LqxLOSFtXfbC3tsiZ8Km8jKR4ktTOLfigL2dR9IN28He2+QrNhYvvwGPz3P4hbfU12Wvuxo6mWGZ2L1lpNtvrA== dependencies: "@adraffy/ens-normalize" "1.10.0" "@noble/curves" "1.2.0" @@ -3655,3 +3670,10 @@ zod@^3.22.4: version "3.22.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== + +zustand@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.5.2.tgz#fddbe7cac1e71d45413b3682cdb47b48034c3848" + integrity sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g== + dependencies: + use-sync-external-store "1.2.0"