diff --git a/apps/global-accounts/src/components/TurnkeyAuthModal.tsx b/apps/global-accounts/src/components/TurnkeyAuthModal.tsx new file mode 100644 index 000000000..88ba922d3 --- /dev/null +++ b/apps/global-accounts/src/components/TurnkeyAuthModal.tsx @@ -0,0 +1,248 @@ +import * as Dialog from "@radix-ui/react-dialog"; +import React, { useState } from "react"; +import { useTurnkeyAuth } from "../hooks/useTurnkeyAuth"; + +type ModalStep = "email" | "otp" | "success"; + +interface TurnkeyWalletAccount { + walletAccountId: string; + organizationId: string; + walletId: string; + curve: string; + pathFormat: string; + path: string; + addressFormat: string; + address: string; + createdAt?: { seconds: string; nanos: number | string }; + updatedAt?: { seconds: string; nanos: number | string }; + publicKey?: string; +} + +interface TurnkeySubOrg { + subOrgId: string; + accounts: TurnkeyWalletAccount[]; + hasDelegatedUser?: boolean; +} + +interface TurnkeyAuthModalProps { + isOpen: boolean; + onClose: () => void; + onSuccess: (_user: any, _walletAddresses: string[]) => void; +} + +export function TurnkeyAuthModal({ isOpen, onClose, onSuccess }: TurnkeyAuthModalProps) { + const [step, setStep] = useState("email"); + const [email, setEmail] = useState(""); + const [otpCode, setOtpCode] = useState(""); + const [otpId, setOtpId] = useState(""); + const [subOrgId, setSubOrgId] = useState(""); + const [turnkeySubOrgs, setTurnkeySubOrgs] = useState([]); + + const { initiateLogin, verifyOtp, isLoading, error, clearError } = useTurnkeyAuth(); + + const handleEmailSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + try { + const result = await initiateLogin(email); + setOtpId(result.otpId); + setSubOrgId(result.subOrgId); + setTurnkeySubOrgs(result.turnkeySubOrgs); + setStep("otp"); + } catch (err) { + // Error is handled by the hook + console.error("Failed to initiate login:", err); + } + }; + + const handleOtpSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + try { + const result = await verifyOtp(otpId, otpCode, email, subOrgId); + setStep("success"); + + // Auto-close after success and notify parent + // Extract all addresses from turnkeySubOrgs for backward compatibility + const allAddresses = turnkeySubOrgs.flatMap(subOrg => subOrg.accounts.map(account => account.address)); + setTimeout(() => { + onSuccess(result.user, allAddresses); + handleClose(); + }, 1500); + } catch (err) { + // Error is handled by the hook + console.error("Failed to verify OTP:", err); + } + }; + + const handleClose = () => { + // Reset state + setStep("email"); + setEmail(""); + setOtpCode(""); + setOtpId(""); + setSubOrgId(""); + setTurnkeySubOrgs([]); + clearError(); + onClose(); + }; + + const handleResendOtp = async () => { + try { + const result = await initiateLogin(email); + setOtpId(result.otpId); + clearError(); + } catch (err) { + console.error("Failed to resend OTP:", err); + } + }; + + return ( + + + + + {/* Email Step */} + {step === "email" && ( + <> + + Login with Turnkey + + + Enter your email address to receive a verification code. + + +
+
+ setEmail(e.target.value)} + required + disabled={isLoading} + className="w-full rounded-lg border border-gray-300 px-4 py-3 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50" + /> +
+ + {error &&
{error}
} + +
+ + + +
+
+ + )} + + {/* OTP Step */} + {step === "otp" && ( + <> + + Enter Verification Code + + + We've sent a code to {email} + + +
+
+ setOtpCode(e.target.value.toUpperCase())} + required + disabled={isLoading} + className="w-full rounded-lg border border-gray-300 px-4 py-3 text-center font-mono text-lg uppercase tracking-wider text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50" + maxLength={20} + /> +
+ + {error &&
{error}
} + +
+ + + + + +
+
+ + )} + + {/* Success Step */} + {step === "success" && ( +
+
+
+ + + +
+
+ + Successfully Authenticated! + + Redirecting... +
+ )} +
+
+
+
+ ); +} diff --git a/apps/global-accounts/src/components/TurnkeyAuthSection.tsx b/apps/global-accounts/src/components/TurnkeyAuthSection.tsx new file mode 100644 index 000000000..a6fa5bc41 --- /dev/null +++ b/apps/global-accounts/src/components/TurnkeyAuthSection.tsx @@ -0,0 +1,200 @@ +import app from "@b3dotfun/sdk/global-account/app"; +import { useAuthStore, useB3 } from "@b3dotfun/sdk/global-account/react"; +import { useEffect, useState } from "react"; +import { TurnkeyAuthModal } from "./TurnkeyAuthModal"; + +interface TurnkeySubOrg { + subOrgId: string; + accounts: Array<{ address: string; [key: string]: unknown }>; + hasDelegatedUser?: boolean; +} + +export function TurnkeyAuthSection() { + const { user, setUser } = useB3(); + const isAuthenticated = useAuthStore(state => state.isAuthenticated); + const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated); + const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating); + const [isModalOpen, setIsModalOpen] = useState(false); + const [turnkeySubOrgs, setTurnkeySubOrgs] = useState([]); + const [isCheckingAuth, setIsCheckingAuth] = useState(true); + + // Auto-reAuthenticate on mount (restore session from JWT in cookies) + useEffect(() => { + const restoreSession = async () => { + try { + console.log("[TurnkeyAuthSection] Checking for existing session..."); + setIsAuthenticating(true); + + // Try to reAuthenticate using JWT from cookies + const authResult = await app.reAuthenticate(); + + console.log("[TurnkeyAuthSection] Session restored!", authResult); + + // IMPORTANT: Update SDK's user state + if (authResult.user) { + setUser(authResult.user); + } + + setIsAuthenticated(true); + + // Store Turnkey sub-orgs with delegated access info + if (authResult.user?.turnkeySubOrgs) { + setTurnkeySubOrgs(authResult.user.turnkeySubOrgs as TurnkeySubOrg[]); + } + } catch (error) { + console.log("[TurnkeyAuthSection] No existing session found"); + setIsAuthenticated(false); + } finally { + setIsAuthenticating(false); + setIsCheckingAuth(false); + } + }; + + restoreSession(); + // Hey Gio, if I put setUser in the dependency array, it will cause a infinite loop. + // How can I fix this? + // }, [setIsAuthenticated, setIsAuthenticating, setUser]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [setIsAuthenticated, setIsAuthenticating]); + + const handleLoginSuccess = (authenticatedUser: any, _walletAddresses: string[]) => { + console.log("Turnkey login successful!", authenticatedUser); + + // IMPORTANT: Update SDK's user state + if (authenticatedUser) { + setUser(authenticatedUser); + // Extract turnkeySubOrgs from user object + if (authenticatedUser.turnkeySubOrgs) { + setTurnkeySubOrgs(authenticatedUser.turnkeySubOrgs as TurnkeySubOrg[]); + } + } + + setIsModalOpen(false); + }; + + const handleLogout = async () => { + try { + await app.logout(); + setIsAuthenticated(false); + setUser(undefined); // Clear SDK user state + setTurnkeySubOrgs([]); + console.log("Logged out successfully"); + } catch (error) { + console.error("Failed to logout:", error); + } + }; + + // Show loading state while checking for existing session + if (isCheckingAuth) { + return ( +
+
+
+ Checking authentication... +
+
+ ); + } + + return ( + <> + {!isAuthenticated ? ( + // Not authenticated - show login button +
+ +

+ Click the button above to authenticate using your email address. You'll receive a verification code to + complete the login process. +

+
+ ) : ( + // Authenticated - show user info +
+
+

Authenticated Account

+
+ {user?.email && ( +
+ Email: + {user.email} +
+ )} + {turnkeySubOrgs.length > 0 && ( +
+ Turnkey Wallets: +
+ {turnkeySubOrgs.map((subOrg, index) => ( +
+
+ Sub-Org {index + 1} + {subOrg.hasDelegatedUser !== undefined && ( + + {subOrg.hasDelegatedUser ? "✅ Delegated" : "⚠️ No Delegation"} + + )} +
+
+ {subOrg.accounts.map((account, accIndex) => ( + + {account.address} + + ))} +
+
+ ))} +
+
+ )} + {user?.smartAccountAddress && ( +
+ Smart Account: + + {user.smartAccountAddress} + +
+ )} + {user?.username && ( +
+ Username: + {user.username} +
+ )} +
+
+ +
+ +
+ +
+

+ ✅ Success! You're now authenticated with Turnkey. Your session persists across page + refreshes using the b3-api JWT stored in cookies. +

+
+
+ )} + + setIsModalOpen(false)} onSuccess={handleLoginSuccess} /> + + ); +} diff --git a/apps/global-accounts/src/hooks/useTurnkeyAuth.ts b/apps/global-accounts/src/hooks/useTurnkeyAuth.ts new file mode 100644 index 000000000..a008346cc --- /dev/null +++ b/apps/global-accounts/src/hooks/useTurnkeyAuth.ts @@ -0,0 +1,153 @@ +import app from "@b3dotfun/sdk/global-account/app"; +import { useAuthStore } from "@b3dotfun/sdk/global-account/react"; +import { useState } from "react"; + +interface TurnkeyWalletAccount { + walletAccountId: string; + organizationId: string; + walletId: string; + curve: string; + pathFormat: string; + path: string; + addressFormat: string; + address: string; + createdAt?: { seconds: string; nanos: number | string }; + updatedAt?: { seconds: string; nanos: number | string }; + publicKey?: string; +} + +interface TurnkeySubOrg { + subOrgId: string; + accounts: TurnkeyWalletAccount[]; + hasDelegatedUser?: boolean; +} + +interface TurnkeyInitResponse { + otpId: string; + subOrgId: string; + turnkeySubOrgs: TurnkeySubOrg[]; + requiresOtp: true; + isNewUser: boolean; +} + +interface TurnkeyVerifyResponse { + turnkeySessionJwt: string; +} + +interface UseTurnkeyAuthReturn { + initiateLogin: (_email: string) => Promise; + verifyOtp: (_otpId: string, _otpCode: string, _email: string, _subOrgId: string) => Promise<{ user: any }>; + isLoading: boolean; + error: string | null; + clearError: () => void; +} + +/** + * Hook for Turnkey email-based OTP authentication + * + * Usage: + * 1. Call initiateLogin(email) → User receives OTP email + * 2. Call verifyOtp(...) → Verifies OTP and authenticates with b3-api + * 3. User is authenticated, JWT stored in cookies automatically + */ +export function useTurnkeyAuth(): UseTurnkeyAuthReturn { + const [isLoading, setIsLoading] = useState(false); + const [error, setError] = useState(null); + const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating); + const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated); + + /** + * Step 1: Initiate login with email + * - Calls backend to create sub-org (if needed) and send OTP + * - Returns otpId to use in verification step + */ + const initiateLogin = async (email: string): Promise => { + setIsLoading(true); + setError(null); + setIsAuthenticating(true); + + try { + console.log(`[useTurnkeyAuth] Initiating login for: ${email}`); + + // Call FeathersJS service to initialize OTP + const data = (await app.service("turnkey-auth").init({ email })) as TurnkeyInitResponse; + + console.log(`[useTurnkeyAuth] OTP initialized successfully. OtpId: ${data.otpId}`); + + return data; + } catch (err: any) { + console.error("[useTurnkeyAuth] Error initiating login:", err); + const errorMessage = err.message || "Failed to send OTP email. Please try again."; + setError(errorMessage); + throw err; + } finally { + setIsLoading(false); + setIsAuthenticating(false); + } + }; + + /** + * Step 2: Verify OTP and authenticate + * - Verifies OTP with backend + * - Gets Turnkey session JWT + * - Authenticates with b3-api using "turnkey-jwt" strategy + * - JWT automatically stored in cookies by SDK + */ + const verifyOtp = async (otpId: string, otpCode: string, email: string, subOrgId: string): Promise<{ user: any }> => { + setIsLoading(true); + setError(null); + setIsAuthenticating(true); + + try { + console.log(`[useTurnkeyAuth] Verifying OTP...`); + + // Step 1: Verify OTP and get Turnkey session JWT + const { turnkeySessionJwt }: TurnkeyVerifyResponse = await app.service("turnkey-auth").verify({ + otpId, + otpCode, + email, + subOrgId, + }); + + console.log(`[useTurnkeyAuth] OTP verified! Authenticating with b3-api...`); + + // Step 2: Authenticate with b3-api using Turnkey JWT + // The SDK will automatically store the b3-api JWT in cookies + const authResult = await app.authenticate({ + strategy: "turnkey-jwt", + accessToken: turnkeySessionJwt, + } as any); + + console.log(`[useTurnkeyAuth] Successfully authenticated with b3-api!`, authResult); + + // Update auth store to reflect authenticated state + setIsAuthenticated(true); + + // Return user data + return { + user: authResult.user, + }; + } catch (err: any) { + console.error("[useTurnkeyAuth] Error verifying OTP:", err); + const errorMessage = err.message || "Failed to verify OTP. Please try again."; + setError(errorMessage); + setIsAuthenticated(false); + throw err; + } finally { + setIsLoading(false); + setIsAuthenticating(false); + } + }; + + const clearError = () => { + setError(null); + }; + + return { + initiateLogin, + verifyOtp, + isLoading, + error, + clearError, + }; +} diff --git a/apps/global-accounts/src/pages/Demos.tsx b/apps/global-accounts/src/pages/Demos.tsx index ae1968786..220ace49d 100644 --- a/apps/global-accounts/src/pages/Demos.tsx +++ b/apps/global-accounts/src/pages/Demos.tsx @@ -1,5 +1,6 @@ import { SignInWithB3, useAuthStore, useB3 } from "@b3dotfun/sdk/global-account/react"; import { useEffect, useState } from "react"; +import { TurnkeyAuthSection } from "../components/TurnkeyAuthSection"; import { b3Chain } from "../constants/b3Chain"; export function Demos() { @@ -78,6 +79,12 @@ export function Demos() { > All Strategies + + Turnkey Only + @@ -214,6 +221,22 @@ export function Demos() { )} + {/* Turnkey Authentication */} + {shouldShowSection("auth-turnkey") && ( +
+

Turnkey Authentication Only

+

+ Email-based authentication using Turnkey infrastructure. Login with OTP verification. +

+ +
+

+ Usage: Turnkey provides email-based authentication with automatic wallet creation. +

+
+
+ )} + {/* Code Example Reference - Only show when not in embedded mode with hash */} {!isEmbedded && (
diff --git a/packages/sdk/package.json b/packages/sdk/package.json index bb063e6e8..6e02f6bde 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -307,7 +307,7 @@ }, "dependencies": { "@adraffy/ens-normalize": "1.11.1", - "@b3dotfun/b3-api": "0.0.87", + "@b3dotfun/b3-api": "file:../../../b3-mono/services/b3-api", "@b3dotfun/basement-api": "0.0.11", "@feathersjs/authentication-client": "5.0.33", "@feathersjs/feathers": "5.0.33", diff --git a/packages/sdk/src/global-account/react/hooks/index.ts b/packages/sdk/src/global-account/react/hooks/index.ts index 4e424796b..c38044c22 100644 --- a/packages/sdk/src/global-account/react/hooks/index.ts +++ b/packages/sdk/src/global-account/react/hooks/index.ts @@ -6,6 +6,7 @@ export { useAnalytics } from "./useAnalytics"; export { useAuthentication } from "./useAuthentication"; export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses"; export { useB3EnsName } from "./useB3EnsName"; +export { useB3JWT } from "./useB3JWT"; export { useBestTransactionPath } from "./useBestTransactionPath"; export { useChainSwitchWithAction } from "./useChainSwitchWithAction"; export * from "./useClaim"; @@ -45,5 +46,5 @@ export { useTokenFromUrl } from "./useTokenFromUrl"; export { useTokenPrice } from "./useTokenPrice"; export { useTokenPriceWithFallback } from "./useTokenPriceWithFallback"; export { useTokensFromAddress } from "./useTokensFromAddress"; -export { useURLParams } from "./useURLParams"; export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute"; +export { useURLParams } from "./useURLParams"; diff --git a/packages/sdk/src/global-account/react/hooks/useB3JWT.ts b/packages/sdk/src/global-account/react/hooks/useB3JWT.ts new file mode 100644 index 000000000..fa560e941 --- /dev/null +++ b/packages/sdk/src/global-account/react/hooks/useB3JWT.ts @@ -0,0 +1,58 @@ +import app from "@b3dotfun/sdk/global-account/app"; +import { useAuthStore } from "@b3dotfun/sdk/global-account/react"; +import { useEffect, useState } from "react"; + +/** + * Custom hook to get B3 JWT from SDK authentication + * + * Benefits over manual cookie reading: + * - ✅ Reactive to auth state changes (login/logout) + * - ✅ Uses SDK's internal auth management + * - ✅ Automatically handles token refresh + * - ✅ Type-safe + * + * @returns JWT string or undefined if not authenticated + * + * @example + * ```tsx + * function MyComponent() { + * const jwt = useB3JWT(); + * + * const sendToOtherServer = async () => { + * if (!jwt) return; + * + * await fetch("https://your-server.com/api", { + * headers: { Authorization: `Bearer ${jwt}` } + * }); + * }; + * + * return ; + * } + * ``` + */ +export function useB3JWT() { + const [jwt, setJwt] = useState(); + const isAuthenticated = useAuthStore(state => state.isAuthenticated); + + useEffect(() => { + const getJWT = async () => { + if (!isAuthenticated) { + setJwt(undefined); + return; + } + + try { + // Try to get JWT from reAuthenticate (reads from cookie) + const authResult = await app.reAuthenticate(); + setJwt(authResult.accessToken); + } catch (error) { + console.warn("Failed to get JWT:", error); + setJwt(undefined); + } + }; + + getJWT(); + }, [isAuthenticated]); // Re-run when auth state changes + + return jwt; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94bc76d47..e8792b9ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -524,8 +524,8 @@ importers: specifier: 1.11.1 version: 1.11.1 '@b3dotfun/b3-api': - specifier: 0.0.87 - version: 0.0.87(@hey-api/openapi-ts@0.64.13(typescript@5.8.2))(@solana/sysvars@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2))(@tanstack/query-core@5.54.1)(@types/node@22.14.0)(@types/react-dom@19.1.1(@types/react@19.1.0))(@types/react@19.1.0)(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(h3@1.15.4)(hono@4.9.9)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-native@0.80.2(@babel/core@7.28.0)(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)(socks@2.8.7)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75) + specifier: file:../../../b3-mono/services/b3-api + version: b3-api@file:../b3-mono/services/b3-api(@hey-api/openapi-ts@0.64.13(typescript@5.8.2))(@solana/sysvars@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2))(@tanstack/query-core@5.54.1)(@types/node@22.14.0)(@types/react-dom@19.1.1(@types/react@19.1.0))(@types/react@19.1.0)(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(h3@1.15.4)(hono@4.9.9)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-native@0.80.2(@babel/core@7.28.0)(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)(socks@2.8.7)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75) '@b3dotfun/basement-api': specifier: 0.0.11 version: 0.0.11(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(express@4.21.2)(graphql@16.11.0)(h3@1.15.4)(hono@4.9.9)(koa@3.0.1)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(socks@2.8.7)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75) @@ -1009,10 +1009,6 @@ packages: resolution: {integrity: sha512-6Ed0kmC1NMbuFTEgNmamAUU1h5gShgxL1hBVLbEzUa3trX5aJBz1vU4bXaBTvOYUAnOHtiy1Ml4AMStd6hJnFA==} engines: {node: '>=18.0.0'} - '@b3dotfun/b3-api@0.0.87': - resolution: {integrity: sha512-QW3T9fAI7KEELKiH3UkpLJdF3NDk6FYXpjrGir95XM1BgrA9h5VwLunxqjPORrEyAxXGInNHn1p2L5Qqb0sz8Q==} - engines: {node: '>= 20.15.0'} - '@b3dotfun/basement-api@0.0.11': resolution: {integrity: sha512-pY7zcNWvjMF4aqc5pSaMVLvW5ZR7yhZHfXXHEsst5uIJXwIzKQ9XAIicp/nR2Bvom2Wia4QhLVwUWsjd+BpyHw==} engines: {node: '>= 20.12.0'} @@ -2393,6 +2389,10 @@ packages: resolution: {integrity: sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==} engines: {node: ^14.21.3 || >=16} + '@noble/curves@1.9.0': + resolution: {integrity: sha512-7YDlXiNMdO1YZeH6t/kvopHHbIZzlxrCV9WLqCY6QhcXOoXiNCMDqJIglZ9Yjx5+w7Dz30TITFrlTjnRg7sKEg==} + engines: {node: ^14.21.3 || >=16} + '@noble/curves@1.9.1': resolution: {integrity: sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==} engines: {node: ^14.21.3 || >=16} @@ -2986,6 +2986,39 @@ packages: resolution: {integrity: sha512-IHnV6A+zxU7XwmKFinmYjUcwlyK9+xkG3/s9KcQhI9BjQKycrJ1JRO+FbNYPwZiPKW3je/DR0k7w8/gLa5eaxQ==} deprecated: 'The package is now available as "qr": npm install qr' + '@peculiar/asn1-cms@2.6.0': + resolution: {integrity: sha512-2uZqP+ggSncESeUF/9Su8rWqGclEfEiz1SyU02WX5fUONFfkjzS2Z/F1Li0ofSmf4JqYXIOdCAZqIXAIBAT1OA==} + + '@peculiar/asn1-csr@2.6.0': + resolution: {integrity: sha512-BeWIu5VpTIhfRysfEp73SGbwjjoLL/JWXhJ/9mo4vXnz3tRGm+NGm3KNcRzQ9VMVqwYS2RHlolz21svzRXIHPQ==} + + '@peculiar/asn1-ecc@2.6.0': + resolution: {integrity: sha512-FF3LMGq6SfAOwUG2sKpPXblibn6XnEIKa+SryvUl5Pik+WR9rmRA3OCiwz8R3lVXnYnyRkSZsSLdml8H3UiOcw==} + + '@peculiar/asn1-pfx@2.6.0': + resolution: {integrity: sha512-rtUvtf+tyKGgokHHmZzeUojRZJYPxoD/jaN1+VAB4kKR7tXrnDCA/RAWXAIhMJJC+7W27IIRGe9djvxKgsldCQ==} + + '@peculiar/asn1-pkcs8@2.6.0': + resolution: {integrity: sha512-KyQ4D8G/NrS7Fw3XCJrngxmjwO/3htnA0lL9gDICvEQ+GJ+EPFqldcJQTwPIdvx98Tua+WjkdKHSC0/Km7T+lA==} + + '@peculiar/asn1-pkcs9@2.6.0': + resolution: {integrity: sha512-b78OQ6OciW0aqZxdzliXGYHASeCvvw5caqidbpQRYW2mBtXIX2WhofNXTEe7NyxTb0P6J62kAAWLwn0HuMF1Fw==} + + '@peculiar/asn1-rsa@2.6.0': + resolution: {integrity: sha512-Nu4C19tsrTsCp9fDrH+sdcOKoVfdfoQQ7S3VqjJU6vedR7tY3RLkQ5oguOIB3zFW33USDUuYZnPEQYySlgha4w==} + + '@peculiar/asn1-schema@2.6.0': + resolution: {integrity: sha512-xNLYLBFTBKkCzEZIw842BxytQQATQv+lDTCEMZ8C196iJcJJMBUZxrhSTxLaohMyKK8QlzRNTRkUmanucnDSqg==} + + '@peculiar/asn1-x509-attr@2.6.0': + resolution: {integrity: sha512-MuIAXFX3/dc8gmoZBkwJWxUWOSvG4MMDntXhrOZpJVMkYX+MYc/rUAU2uJOved9iJEoiUx7//3D8oG83a78UJA==} + + '@peculiar/asn1-x509@2.6.0': + resolution: {integrity: sha512-uzYbPEpoQiBoTq0/+jZtpM6Gq6zADBx+JNFP3yqRgziWBxQ/Dt/HcuvRfm9zJTPdRcBqPNdaRHTVwpyiq6iNMA==} + + '@peculiar/x509@1.12.3': + resolution: {integrity: sha512-+Mzq+W7cNEKfkNZzyLl6A6ffqc3r21HGZUezgfKxpZrkORfOqgRXnS80Zu0IV6a9Ue9QBJeKD7kN0iWfc3bhRQ==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -5243,6 +5276,37 @@ packages: '@tsconfig/node16@1.0.4': resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@turnkey/api-key-stamper@0.5.0': + resolution: {integrity: sha512-DcxavFpNO93mJnCSef+g97uuQANYHjxxqK8z+cX7GztSBN+Skfja5656VDZCUITql4gNhhiNyjMiWLutS2DDJg==} + engines: {node: '>=18.0.0'} + + '@turnkey/crypto@2.8.5': + resolution: {integrity: sha512-QjzzuMysQmHbF9CG2TjS9Bb09/RxKpDL8JWR0hEDhR8ysMRx0V5RvfQ+0sqlXkg6IF2B/PhCAh67FjTw2uV3jQ==} + engines: {node: '>=18.0.0'} + + '@turnkey/encoding@0.6.0': + resolution: {integrity: sha512-IC8qXvy36+iGAeiaVIuJvB35uU2Ld/RAWI/DRTKS+ttBej0GXhOn48Ouu5mlca4jt8ZEuwXmDVv74A8uBQclsA==} + engines: {node: '>=18.0.0'} + + '@turnkey/http@3.15.0': + resolution: {integrity: sha512-fjFf5+g/axeul8bgiMHzOOoKt9Ko8vAHuw6UTFOwZD6a2KwRAn9dc+kj8vAD6yxiTxzYSKp/ybPcTjeyXQ9fIQ==} + engines: {node: '>=18.0.0'} + + '@turnkey/sdk-server@4.12.0': + resolution: {integrity: sha512-8G2y2QJ7yTFlrIDz6myqUes6B/NWdEXo+f2ZjLuY73tFtPrEeTBMXN+xOHVP0GGNy8S+zuEV8/Ur3VzSfKsHig==} + engines: {node: '>=18.0.0'} + + '@turnkey/sdk-types@0.8.0': + resolution: {integrity: sha512-Us4LRUGwH0wQNDUpQUScNywbQb96X9rcZHvA7xC23ujWV4G4AVcam2nkBx++1xKA+fBCv4HmvBCPcUrIa0X0vA==} + engines: {node: '>=18.0.0'} + + '@turnkey/wallet-stamper@1.1.7': + resolution: {integrity: sha512-ATPjIZAKDb4YvEpH3piDXXeISH7y15JuiuTRaTfstSeKghyeWB1WiqcFVfXQlYK/PvWjyR7c6IWQzv5RIsysDw==} + + '@turnkey/webauthn-stamper@0.6.0': + resolution: {integrity: sha512-jdN17QEnn7RBykEOhtKIialWmDjnDAH8DzbyITwn8jsKcwT1TBNYge89hTUTjbdsDLBAqQw8cHujPdy0RaAqvw==} + engines: {node: '>=18.0.0'} + '@tweenjs/tween.js@23.1.3': resolution: {integrity: sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==} @@ -6277,6 +6341,10 @@ packages: asn1.js@4.10.1: resolution: {integrity: sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==} + asn1js@3.0.6: + resolution: {integrity: sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA==} + engines: {node: '>=12.0.0'} + assert@2.1.0: resolution: {integrity: sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==} @@ -6340,6 +6408,10 @@ packages: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} + b3-api@file:../b3-mono/services/b3-api: + resolution: {directory: ../b3-mono/services/b3-api, type: directory} + engines: {node: '>= 20.15.0'} + babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -6468,6 +6540,9 @@ packages: borsh@0.7.0: resolution: {integrity: sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==} + borsh@2.0.0: + resolution: {integrity: sha512-kc9+BgR3zz9+cjbwM8ODoUB4fs3X3I5A/HtX7LZKxCLaMrEeDFoBpnhZY//DTS1VZBSs6S5v46RZRbZjRFspEg==} + bowser@2.12.0: resolution: {integrity: sha512-HcOcTudTeEWgbHh0Y1Tyb6fdeR71m4b/QACf0D4KswGTsNeIJQmg38mRENZPAYPZvGFN3fk3604XbQEPdxXdKg==} @@ -6532,6 +6607,9 @@ packages: bs58check@3.0.1: resolution: {integrity: sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==} + bs58check@4.0.0: + resolution: {integrity: sha512-FsGDOnFg9aVI9erdriULkd/JjEWONV/lQE5aYziB5PoBsXRind56lh8doIZIc9X4HoxT5x4bLjMWN1/NB8Zp5g==} + bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} @@ -6656,6 +6734,9 @@ packages: resolution: {integrity: sha512-F705O3xrsUtgt98j7leetNhTWPe+5S72rlL5O4jA1pKqBVQ/dT1O1D6PFxmSXvc0SUOinWS57DKx0I3CHrXJHQ==} hasBin: true + cbor-js@0.1.0: + resolution: {integrity: sha512-7sQ/TvDZPl7csT1Sif9G0+MA0I0JOVah8+wWlJVQdVEgIbCzlN/ab3x+uvMNsc34TUvO6osQTAmB2ls80JX6tw==} + chai@5.2.1: resolution: {integrity: sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==} engines: {node: '>=18'} @@ -10736,6 +10817,13 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + pvtsutils@1.3.6: + resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==} + + pvutils@1.1.5: + resolution: {integrity: sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==} + engines: {node: '>=16.0.0'} + qrcode.react@4.2.0: resolution: {integrity: sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA==} peerDependencies: @@ -11275,6 +11363,9 @@ packages: engines: {node: '>= 0.10'} hasBin: true + sha256-uint8array@0.10.7: + resolution: {integrity: sha512-1Q6JQU4tX9NqsDGodej6pkrUVQVNapLZnvkwIhddH/JqzBZF1fSaxSWNY6sziXBE8aEa2twtGkXUrwzGeZCMpQ==} + shallowequal@1.1.0: resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} @@ -12055,6 +12146,10 @@ packages: peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + tsyringe@4.10.0: + resolution: {integrity: sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==} + engines: {node: '>= 6.0.0'} + ttl-set@1.0.0: resolution: {integrity: sha512-2fuHn/UR+8Z9HK49r97+p2Ru1b5Eewg2QqPrU14BVCQ9QoyU3+vLLZk2WEiyZ9sgJh6W8G1cZr9I2NBLywAHrA==} @@ -13419,122 +13514,6 @@ snapshots: '@smithy/types': 4.3.2 tslib: 2.8.1 - '@b3dotfun/b3-api@0.0.87(@hey-api/openapi-ts@0.64.13(typescript@5.8.2))(@solana/sysvars@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2))(@tanstack/query-core@5.54.1)(@types/node@22.14.0)(@types/react-dom@19.1.1(@types/react@19.1.0))(@types/react@19.1.0)(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(h3@1.15.4)(hono@4.9.9)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-native@0.80.2(@babel/core@7.28.0)(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)(socks@2.8.7)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75)': - dependencies: - '@apollo/client': 3.13.9(@types/react@19.1.0)(graphql@16.11.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@feathersjs/adapter-commons': 5.0.34 - '@feathersjs/authentication-client': 5.0.33(typescript@5.8.2) - '@feathersjs/configuration': 5.0.34(typescript@5.8.2) - '@feathersjs/errors': 5.0.34 - '@feathersjs/feathers': 5.0.33 - '@feathersjs/knex': 5.0.34(knex@3.1.0(pg@8.16.3)) - '@feathersjs/koa': 5.0.34(typescript@5.8.2) - '@feathersjs/mongodb': 5.0.34(mongodb@6.18.0(socks@2.8.7)) - '@feathersjs/schema': 5.0.34(typescript@5.8.2) - '@feathersjs/socketio': 5.0.34(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@feathersjs/transport-commons': 5.0.34 - '@feathersjs/typebox': 5.0.33(typescript@5.8.2) - '@neynar/nodejs-sdk': 3.34.0(@types/node@22.14.0)(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) - '@privy-io/server-auth': 1.31.0(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.37.9(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75)) - '@thirdweb-dev/engine': 0.0.18 - '@types/bcrypt': 6.0.0 - '@types/koa': 2.15.0 - bcrypt: 6.0.0 - big.js: 7.0.1 - cryptr: 6.3.0 - ethers: 6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - express: 4.21.2 - fast-ratelimit: 3.0.1 - graphql: 16.11.0 - inngest: 3.40.1(encoding@0.1.13)(express@4.21.2)(h3@1.15.4)(hono@4.9.9)(koa@3.0.1)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(typescript@5.8.2) - ioredis: 5.7.0 - jsonwebtoken: 9.0.2 - knex: 3.1.0(pg@8.16.3) - koa: 3.0.1 - mongodb: 6.18.0(socks@2.8.7) - nanoid: 3.3.11 - openai: 4.104.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75) - pg: 8.16.3 - stream-chat: 8.60.0(bufferutil@4.0.9)(debug@4.4.1)(utf-8-validate@5.0.10) - thirdweb: 5.112.0(@hey-api/openapi-ts@0.64.13(typescript@5.8.2))(@solana/sysvars@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2))(@tanstack/query-core@5.54.1)(@types/react-dom@19.1.1(@types/react@19.1.0))(@types/react@19.1.0)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(ioredis@5.7.0)(react-dom@19.1.0(react@19.1.0))(react-native@0.80.2(@babel/core@7.28.0)(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - uuid: 8.3.2 - viem: 2.37.9(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) - winston: 3.17.0 - transitivePeerDependencies: - - '@aws-sdk/client-kms' - - '@aws-sdk/client-lambda' - - '@aws-sdk/credential-providers' - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@coinbase/wallet-mobile-sdk' - - '@deno/kv' - - '@hey-api/openapi-ts' - - '@mobile-wallet-protocol/client' - - '@mongodb-js/zstd' - - '@nestjs/microservices' - - '@nestjs/platform-express' - - '@nestjs/websockets' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@solana/sysvars' - - '@sveltejs/kit' - - '@tanstack/query-core' - - '@types/node' - - '@types/react' - - '@types/react-dom' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/kv' - - '@vercel/node' - - aws-lambda - - aws4fetch - - better-sqlite3 - - bufferutil - - class-transformer - - class-validator - - db0 - - debug - - encoding - - expo-linking - - expo-web-browser - - fastestsmallesttextencoderdecoder - - fastify - - gcp-metadata - - graphql-ws - - h3 - - hono - - immer - - kerberos - - mongodb-client-encryption - - mysql - - mysql2 - - next - - pg-native - - react - - react-dom - - react-native - - react-native-aes-gcm-crypto - - react-native-passkey - - react-native-quick-crypto - - react-native-svg - - snappy - - socks - - sqlite3 - - subscriptions-transport-ws - - supports-color - - tedious - - typescript - - uploadthing - - utf-8-validate - - ws - - zod - '@b3dotfun/basement-api@0.0.11(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(express@4.21.2)(graphql@16.11.0)(h3@1.15.4)(hono@4.9.9)(koa@3.0.1)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(socks@2.8.7)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75)': dependencies: '@aws-sdk/client-s3': 3.864.0 @@ -15523,6 +15502,10 @@ snapshots: dependencies: '@noble/hashes': 1.7.2 + '@noble/curves@1.9.0': + dependencies: + '@noble/hashes': 1.8.0 + '@noble/curves@1.9.1': dependencies: '@noble/hashes': 1.8.0 @@ -16477,6 +16460,96 @@ snapshots: '@paulmillr/qr@0.2.1': {} + '@peculiar/asn1-cms@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + '@peculiar/asn1-x509-attr': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-csr@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-ecc@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-pfx@2.6.0': + dependencies: + '@peculiar/asn1-cms': 2.6.0 + '@peculiar/asn1-pkcs8': 2.6.0 + '@peculiar/asn1-rsa': 2.6.0 + '@peculiar/asn1-schema': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-pkcs8@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-pkcs9@2.6.0': + dependencies: + '@peculiar/asn1-cms': 2.6.0 + '@peculiar/asn1-pfx': 2.6.0 + '@peculiar/asn1-pkcs8': 2.6.0 + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + '@peculiar/asn1-x509-attr': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-rsa@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-schema@2.6.0': + dependencies: + asn1js: 3.0.6 + pvtsutils: 1.3.6 + tslib: 2.8.1 + + '@peculiar/asn1-x509-attr@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + asn1js: 3.0.6 + tslib: 2.8.1 + + '@peculiar/asn1-x509@2.6.0': + dependencies: + '@peculiar/asn1-schema': 2.6.0 + asn1js: 3.0.6 + pvtsutils: 1.3.6 + tslib: 2.8.1 + + '@peculiar/x509@1.12.3': + dependencies: + '@peculiar/asn1-cms': 2.6.0 + '@peculiar/asn1-csr': 2.6.0 + '@peculiar/asn1-ecc': 2.6.0 + '@peculiar/asn1-pkcs9': 2.6.0 + '@peculiar/asn1-rsa': 2.6.0 + '@peculiar/asn1-schema': 2.6.0 + '@peculiar/asn1-x509': 2.6.0 + pvtsutils: 1.3.6 + reflect-metadata: 0.2.2 + tslib: 2.8.1 + tsyringe: 4.10.0 + '@pkgjs/parseargs@0.11.0': optional: true @@ -20794,6 +20867,69 @@ snapshots: '@tsconfig/node16@1.0.4': {} + '@turnkey/api-key-stamper@0.5.0': + dependencies: + '@noble/curves': 1.9.6 + '@turnkey/encoding': 0.6.0 + sha256-uint8array: 0.10.7 + + '@turnkey/crypto@2.8.5': + dependencies: + '@noble/ciphers': 1.3.0 + '@noble/curves': 1.9.0 + '@noble/hashes': 1.8.0 + '@peculiar/x509': 1.12.3 + '@turnkey/encoding': 0.6.0 + '@turnkey/sdk-types': 0.8.0 + borsh: 2.0.0 + cbor-js: 0.1.0 + + '@turnkey/encoding@0.6.0': + dependencies: + bs58: 6.0.0 + bs58check: 4.0.0 + + '@turnkey/http@3.15.0(encoding@0.1.13)': + dependencies: + '@turnkey/api-key-stamper': 0.5.0 + '@turnkey/encoding': 0.6.0 + '@turnkey/webauthn-stamper': 0.6.0 + cross-fetch: 3.2.0(encoding@0.1.13) + transitivePeerDependencies: + - encoding + + '@turnkey/sdk-server@4.12.0(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75)': + dependencies: + '@turnkey/api-key-stamper': 0.5.0 + '@turnkey/http': 3.15.0(encoding@0.1.13) + '@turnkey/wallet-stamper': 1.1.7(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) + buffer: 6.0.3 + cross-fetch: 3.2.0(encoding@0.1.13) + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + - zod + + '@turnkey/sdk-types@0.8.0': {} + + '@turnkey/wallet-stamper@1.1.7(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75)': + dependencies: + '@turnkey/crypto': 2.8.5 + '@turnkey/encoding': 0.6.0 + optionalDependencies: + viem: 2.37.9(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + '@turnkey/webauthn-stamper@0.6.0': + dependencies: + sha256-uint8array: 0.10.7 + '@tweenjs/tween.js@23.1.3': {} '@tybys/wasm-util@0.10.0': @@ -23557,6 +23693,12 @@ snapshots: inherits: 2.0.4 minimalistic-assert: 1.0.1 + asn1js@3.0.6: + dependencies: + pvtsutils: 1.3.6 + pvutils: 1.1.5 + tslib: 2.8.1 + assert@2.1.0: dependencies: call-bind: 1.0.8 @@ -23620,6 +23762,124 @@ snapshots: axobject-query@4.1.0: {} + b3-api@file:../b3-mono/services/b3-api(@hey-api/openapi-ts@0.64.13(typescript@5.8.2))(@solana/sysvars@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2))(@tanstack/query-core@5.54.1)(@types/node@22.14.0)(@types/react-dom@19.1.1(@types/react@19.1.0))(@types/react@19.1.0)(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(h3@1.15.4)(hono@4.9.9)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-native@0.80.2(@babel/core@7.28.0)(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)(socks@2.8.7)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75): + dependencies: + '@apollo/client': 3.13.9(@types/react@19.1.0)(graphql@16.11.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + '@feathersjs/adapter-commons': 5.0.34 + '@feathersjs/authentication-client': 5.0.33(typescript@5.8.2) + '@feathersjs/configuration': 5.0.34(typescript@5.8.2) + '@feathersjs/errors': 5.0.34 + '@feathersjs/feathers': 5.0.33 + '@feathersjs/knex': 5.0.34(knex@3.1.0(pg@8.16.3)) + '@feathersjs/koa': 5.0.34(typescript@5.8.2) + '@feathersjs/mongodb': 5.0.34(mongodb@6.18.0(socks@2.8.7)) + '@feathersjs/schema': 5.0.34(typescript@5.8.2) + '@feathersjs/socketio': 5.0.34(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@feathersjs/transport-commons': 5.0.34 + '@feathersjs/typebox': 5.0.33(typescript@5.8.2) + '@neynar/nodejs-sdk': 3.34.0(@types/node@22.14.0)(bufferutil@4.0.9)(debug@4.4.1)(encoding@0.1.13)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) + '@privy-io/server-auth': 1.31.0(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.37.9(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75)) + '@thirdweb-dev/engine': 0.0.18 + '@turnkey/crypto': 2.8.5 + '@turnkey/sdk-server': 4.12.0(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) + '@types/bcrypt': 6.0.0 + '@types/koa': 2.15.0 + bcrypt: 6.0.0 + big.js: 7.0.1 + cryptr: 6.3.0 + ethers: 6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + express: 4.21.2 + fast-ratelimit: 3.0.1 + graphql: 16.11.0 + inngest: 3.40.1(encoding@0.1.13)(express@4.21.2)(h3@1.15.4)(hono@4.9.9)(koa@3.0.1)(next@14.1.0(@babel/core@7.28.0)(@opentelemetry/api@1.8.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(typescript@5.8.2) + ioredis: 5.7.0 + jsonwebtoken: 9.0.2 + knex: 3.1.0(pg@8.16.3) + koa: 3.0.1 + mongodb: 6.18.0(socks@2.8.7) + nanoid: 3.3.11 + openai: 4.104.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.75) + pg: 8.16.3 + stream-chat: 8.60.0(bufferutil@4.0.9)(debug@4.4.1)(utf-8-validate@5.0.10) + thirdweb: 5.112.0(@hey-api/openapi-ts@0.64.13(typescript@5.8.2))(@solana/sysvars@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.2))(@tanstack/query-core@5.54.1)(@types/react-dom@19.1.1(@types/react@19.1.0))(@types/react@19.1.0)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(ioredis@5.7.0)(react-dom@19.1.0(react@19.1.0))(react-native@0.80.2(@babel/core@7.28.0)(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10))(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + uuid: 8.3.2 + viem: 2.37.9(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.25.75) + winston: 3.17.0 + transitivePeerDependencies: + - '@aws-sdk/client-kms' + - '@aws-sdk/client-lambda' + - '@aws-sdk/credential-providers' + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@coinbase/wallet-mobile-sdk' + - '@deno/kv' + - '@hey-api/openapi-ts' + - '@mobile-wallet-protocol/client' + - '@mongodb-js/zstd' + - '@nestjs/microservices' + - '@nestjs/platform-express' + - '@nestjs/websockets' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@solana/sysvars' + - '@sveltejs/kit' + - '@tanstack/query-core' + - '@types/node' + - '@types/react' + - '@types/react-dom' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/kv' + - '@vercel/node' + - aws-lambda + - aws4fetch + - better-sqlite3 + - bufferutil + - class-transformer + - class-validator + - db0 + - debug + - encoding + - expo-linking + - expo-web-browser + - fastestsmallesttextencoderdecoder + - fastify + - gcp-metadata + - graphql-ws + - h3 + - hono + - immer + - kerberos + - mongodb-client-encryption + - mysql + - mysql2 + - next + - pg-native + - react + - react-dom + - react-native + - react-native-aes-gcm-crypto + - react-native-passkey + - react-native-quick-crypto + - react-native-svg + - snappy + - socks + - sqlite3 + - subscriptions-transport-ws + - supports-color + - tedious + - typescript + - uploadthing + - utf-8-validate + - ws + - zod + babel-jest@29.7.0(@babel/core@7.28.0): dependencies: '@babel/core': 7.28.0 @@ -23807,6 +24067,8 @@ snapshots: bs58: 4.0.1 text-encoding-utf-8: 1.0.2 + borsh@2.0.0: {} + bowser@2.12.0: {} brace-expansion@1.1.12: @@ -23911,6 +24173,11 @@ snapshots: bs58: 5.0.0 optional: true + bs58check@4.0.0: + dependencies: + '@noble/hashes': 1.8.0 + bs58: 6.0.0 + bser@2.1.1: dependencies: node-int64: 0.4.0 @@ -24030,6 +24297,8 @@ snapshots: canonicalize@2.1.0: {} + cbor-js@0.1.0: {} + chai@5.2.1: dependencies: assertion-error: 2.0.1 @@ -28772,6 +29041,12 @@ snapshots: punycode@2.3.1: {} + pvtsutils@1.3.6: + dependencies: + tslib: 2.8.1 + + pvutils@1.1.5: {} + qrcode.react@4.2.0(react@19.1.0): dependencies: react: 19.1.0 @@ -29492,6 +29767,8 @@ snapshots: safe-buffer: 5.2.1 to-buffer: 1.2.1 + sha256-uint8array@0.10.7: {} + shallowequal@1.1.0: {} shebang-command@2.0.0: @@ -30504,6 +30781,10 @@ snapshots: tslib: 1.14.1 typescript: 5.8.2 + tsyringe@4.10.0: + dependencies: + tslib: 1.14.1 + ttl-set@1.0.0: dependencies: fast-fifo: 1.3.2 diff --git a/scripts/clean.sh b/scripts/clean.sh index 7ae40c8be..e673adf7f 100644 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,16 +1,17 @@ -# Remove all node_modules, .next, dist, .tsbuildinfo, tsconfig.tsbuildinfo -echo "Removing all node_modules, .next, dist, .tsbuildinfo, tsconfig.tsbuildinfo" -find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + -find . -name '.next' -type d -prune -exec rm -rf '{}' + -find . -name 'dist' -type d -prune -exec rm -rf '{}' + -find . -name 'build' -type d -prune -exec rm -rf '{}' + -find . -name 'target' -type d -prune -exec rm -rf '{}' + -find . -name '.tsbuildinfo' -type f -prune -exec rm -rf '{}' + -find . -name 'tsconfig.tsbuildinfo' -type f -prune -exec rm -rf '{}' + +echo "Removing all local build artifacts" +find . -name 'node_modules' -type d -prune -exec rm -rf {} + +find . -name '.turbo' -type d -prune -exec rm -rf {} + +find . -name '.next' -type d -prune -exec rm -rf {} + +find . -name 'dist' -type d -prune -exec rm -rf {} + +find . -name 'build' -type d -prune -exec rm -rf {} + +find . -name 'target' -type d -prune -exec rm -rf {} + +find . -name '.tsbuildinfo' -type f -delete +find . -name 'tsconfig.tsbuildinfo' -type f -delete -# Install dependencies +# Install echo "Installing dependencies" pnpm install +# Build SDK echo "Building SDK" pnpm sdk:build