@b3dotfun/sdk 0.0.87 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +77 -73
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +190 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.js +146 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +17 -12
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/cjs/anyspend/react/components/common/WarningText.js +36 -0
- package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.js +6 -0
- package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.js +6 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/index.js +3 -1
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +35 -11
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +86 -0
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/anyspend/utils/format.js +28 -5
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +17 -47
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +6 -7
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/types.js +4 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +10 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +23 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +1 -1
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +1 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -1
- package/dist/cjs/global-account/react/components/index.d.ts +2 -0
- package/dist/cjs/global-account/react/components/index.js +7 -3
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +3 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.js +42 -0
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +6 -4
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +77 -73
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +187 -0
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/esm/anyspend/react/components/QRDeposit.js +143 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +17 -12
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/esm/anyspend/react/components/common/WarningText.js +32 -0
- package/dist/esm/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/esm/anyspend/react/components/icons/CreditCardIcon.js +2 -0
- package/dist/esm/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/esm/anyspend/react/components/icons/QrCodeIcon.js +2 -0
- package/dist/esm/anyspend/react/components/index.d.ts +2 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +35 -11
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +83 -0
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/anyspend/utils/format.js +28 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +21 -51
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +6 -7
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/types.js +4 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +1 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +1 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +6 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +19 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +2 -2
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +2 -3
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +3 -2
- package/dist/esm/global-account/react/components/index.d.ts +2 -0
- package/dist/esm/global-account/react/components/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +4 -3
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useAutoSelectWallet.js +39 -0
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +6 -4
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/types/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/types/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/types/anyspend/react/components/index.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -5
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +1 -0
- package/dist/types/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
- package/dist/types/global-account/react/components/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +105 -85
- package/src/anyspend/react/components/AnySpendCustom.tsx +0 -2
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -3
- package/src/anyspend/react/components/AnySpendDeposit.tsx +578 -0
- package/src/anyspend/react/components/QRDeposit.tsx +348 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +26 -8
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +20 -8
- package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
- package/src/anyspend/react/components/common/WarningText.tsx +52 -0
- package/src/anyspend/react/components/icons/CreditCardIcon.tsx +25 -0
- package/src/anyspend/react/components/icons/QrCodeIcon.tsx +25 -0
- package/src/anyspend/react/components/icons/credit-card.svg +5 -0
- package/src/anyspend/react/components/icons/qr-code.svg +5 -0
- package/src/anyspend/react/components/index.ts +2 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +37 -12
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +110 -0
- package/src/anyspend/utils/format.ts +33 -5
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +10 -2
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +6 -7
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +20 -71
- package/src/global-account/react/components/B3Provider/types.ts +8 -9
- package/src/global-account/react/components/B3Provider/useB3.ts +1 -0
- package/src/global-account/react/components/B3Provider/useB3Account.ts +7 -0
- package/src/global-account/react/components/B3Provider/useB3Config.ts +34 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +2 -2
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +2 -3
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -2
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +3 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +5 -2
- package/src/global-account/react/components/index.ts +2 -0
- package/src/global-account/react/hooks/useAccountWallet.tsx +4 -3
- package/src/global-account/react/hooks/useAutoSelectWallet.ts +51 -0
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +7 -5
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +2 -2
- package/src/global-account/react/stores/useModalStore.ts +4 -0
- package/src/styles/index.css +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ens_normalize } from "@adraffy/ens-normalize";
|
|
2
2
|
import app from "@b3dotfun/sdk/global-account/app";
|
|
3
|
-
import { toast,
|
|
3
|
+
import { toast, useAuthentication, useB3Config, useModalStore, useProfile } from "@b3dotfun/sdk/global-account/react";
|
|
4
4
|
import { formatUsername } from "@b3dotfun/sdk/shared/utils";
|
|
5
5
|
import { Check, Loader2, Pencil, X } from "lucide-react";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -17,7 +17,8 @@ const SettingsProfileCard = () => {
|
|
|
17
17
|
address: eoaAddress || account?.address,
|
|
18
18
|
fresh: true,
|
|
19
19
|
});
|
|
20
|
-
const {
|
|
20
|
+
const { partnerId } = useB3Config();
|
|
21
|
+
const { user, setUser } = useAuthentication(partnerId);
|
|
21
22
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
22
23
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
23
24
|
const navigateBack = useModalStore(state => state.navigateBack);
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
SignInWithB3ModalProps,
|
|
4
4
|
StyleRoot,
|
|
5
5
|
useAuthStore,
|
|
6
|
-
useB3,
|
|
7
6
|
useIsMobile,
|
|
8
7
|
useModalStore,
|
|
9
8
|
} from "@b3dotfun/sdk/global-account/react";
|
|
10
9
|
import { ReactNode, useEffect } from "react";
|
|
10
|
+
import { useB3Account } from "../B3Provider/useB3Account";
|
|
11
11
|
import { ManageAccountButton } from "../custom/ManageAccountButton";
|
|
12
12
|
import { Loading } from "../ui/Loading";
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ export type SignInWithB3Props = Omit<SignInWithB3ModalProps, "type" | "showBackB
|
|
|
20
20
|
|
|
21
21
|
export function SignInWithB3(props: SignInWithB3Props) {
|
|
22
22
|
const { setB3ModalOpen, setB3ModalContentType, setEcoSystemAccountAddress } = useModalStore();
|
|
23
|
-
const
|
|
23
|
+
const account = useB3Account();
|
|
24
24
|
const { isAuthenticating, isAuthenticated } = useAuthStore();
|
|
25
25
|
const isMobile = useIsMobile();
|
|
26
26
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Loading,
|
|
3
3
|
SignInWithB3ModalProps,
|
|
4
|
+
useAuthentication,
|
|
4
5
|
useAuthStore,
|
|
5
|
-
|
|
6
|
+
useB3Config,
|
|
6
7
|
useGetAllTWSigners,
|
|
7
8
|
useModalStore,
|
|
8
9
|
} from "@b3dotfun/sdk/global-account/react";
|
|
@@ -33,7 +34,9 @@ export function SignInWithB3Flow({
|
|
|
33
34
|
source = "signInWithB3Button",
|
|
34
35
|
signersEnabled = false,
|
|
35
36
|
}: SignInWithB3ModalProps) {
|
|
36
|
-
const { automaticallySetFirstEoa,
|
|
37
|
+
const { automaticallySetFirstEoa, enableTurnkey } = useB3Config();
|
|
38
|
+
const { user, refetchUser } = useAuthentication(partnerId);
|
|
39
|
+
|
|
37
40
|
const [step, setStep] = useState<"login" | "permissions" | null>(source === "requestPermissions" ? null : "login");
|
|
38
41
|
const [sessionKeyAdded, setSessionKeyAdded] = useState(source === "requestPermissions" ? true : false);
|
|
39
42
|
const { setB3ModalContentType, setB3ModalOpen, isOpen, contentType } = useModalStore();
|
|
@@ -5,6 +5,8 @@ export { B3Provider, InnerProvider } from "./B3Provider/B3Provider";
|
|
|
5
5
|
export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
|
|
6
6
|
export { B3Context, type B3ContextType } from "./B3Provider/types";
|
|
7
7
|
export { useB3 } from "./B3Provider/useB3";
|
|
8
|
+
export { useB3Account } from "./B3Provider/useB3Account";
|
|
9
|
+
export { useB3Config } from "./B3Provider/useB3Config";
|
|
8
10
|
export { StyleRoot } from "./StyleRoot";
|
|
9
11
|
|
|
10
12
|
// SignInWithB3 Components
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useProfile } from "@b3dotfun/sdk/global-account/react";
|
|
2
2
|
import { ecosystemWalletId } from "@b3dotfun/sdk/shared/constants";
|
|
3
3
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
4
4
|
import { useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { getLastAuthProvider, useActiveWallet, useConnectedWallets, useWalletImage } from "thirdweb/react";
|
|
6
6
|
import { Account, Wallet } from "thirdweb/wallets";
|
|
7
7
|
import { socialIcons } from "thirdweb/wallets/in-app";
|
|
8
|
+
import { useB3Account } from "../components/B3Provider/useB3Account";
|
|
8
9
|
|
|
9
10
|
const debug = debugB3React("useAccountWallet");
|
|
10
11
|
|
|
@@ -49,7 +50,7 @@ export function useAccountWallet(): {
|
|
|
49
50
|
// const effectiveAccount = isAuthenticated ? accountOverride || activeAccount : undefined;
|
|
50
51
|
// can we possibly just use useActiveAccount here?
|
|
51
52
|
// --------------------
|
|
52
|
-
const
|
|
53
|
+
const account = useB3Account();
|
|
53
54
|
|
|
54
55
|
const activeWallet = useActiveWallet();
|
|
55
56
|
const connectedWallets = useConnectedWallets();
|
|
@@ -114,7 +115,7 @@ export function useAccountWallet(): {
|
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
export function useAccountWalletImage(): string {
|
|
117
|
-
const
|
|
118
|
+
const account = useB3Account();
|
|
118
119
|
|
|
119
120
|
const activeWallet = useActiveWallet();
|
|
120
121
|
const connectedWallets = useConnectedWallets();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
3
|
+
import { getLastAuthProvider, useConnectedWallets, useSetActiveWallet } from "thirdweb/react";
|
|
4
|
+
import { Wallet } from "thirdweb/wallets";
|
|
5
|
+
import { useAuthStore } from "../stores";
|
|
6
|
+
|
|
7
|
+
const debug = debugB3React("useAutoSelectWallet");
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Hook to automatically select the first EOA wallet when user is authenticated
|
|
11
|
+
* Only auto-selects if the last auth was via wallet or no previous auth provider
|
|
12
|
+
*/
|
|
13
|
+
export function useAutoSelectWallet({ enabled }: { enabled: boolean }) {
|
|
14
|
+
const isAuthenticated = useAuthStore(state => state.isAuthenticated);
|
|
15
|
+
const wallets = useConnectedWallets();
|
|
16
|
+
const setActiveWallet = useSetActiveWallet();
|
|
17
|
+
|
|
18
|
+
const setWallet = useCallback(
|
|
19
|
+
(wallet: Wallet) => {
|
|
20
|
+
debug("@@setWallet", wallet.id, wallet.getAccount()?.address);
|
|
21
|
+
setActiveWallet(wallet);
|
|
22
|
+
},
|
|
23
|
+
[setActiveWallet],
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const autoSelectFirstEOAWallet = async () => {
|
|
28
|
+
// Only proceed if auto-selection is enabled and user is authenticated
|
|
29
|
+
if (!enabled || !isAuthenticated) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Find the first EOA wallet (excluding ecosystem wallets)
|
|
34
|
+
const isEOAWallet = (wallet: Wallet) => !wallet.id.startsWith("ecosystem.");
|
|
35
|
+
const firstEOAWallet = wallets.find(isEOAWallet);
|
|
36
|
+
|
|
37
|
+
if (firstEOAWallet) {
|
|
38
|
+
// Only auto-select if the last auth was via wallet or no previous auth provider
|
|
39
|
+
const lastAuthProvider = await getLastAuthProvider();
|
|
40
|
+
const shouldAutoSelect = lastAuthProvider === null || lastAuthProvider === "wallet";
|
|
41
|
+
|
|
42
|
+
if (shouldAutoSelect) {
|
|
43
|
+
debug("Auto-selecting first EOA wallet", firstEOAWallet.id);
|
|
44
|
+
setWallet(firstEOAWallet);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
autoSelectFirstEOAWallet();
|
|
50
|
+
}, [enabled, isAuthenticated, setWallet, wallets]);
|
|
51
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import app from "../../app";
|
|
2
|
-
import { useAuthStore } from "../stores";
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
|
-
import { useB3 } from "../components/B3Provider/useB3";
|
|
5
1
|
import { TurnkeyAuthInitResponse } from "@b3dotfun/b3-api";
|
|
6
2
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import app from "../../app";
|
|
5
|
+
import { useB3Config } from "../components";
|
|
6
|
+
import { useAuthStore } from "../stores";
|
|
7
|
+
import { useAuthentication } from "./useAuthentication";
|
|
7
8
|
|
|
8
9
|
const debug = debugB3React("useTurnkeyAuth");
|
|
9
10
|
|
|
@@ -32,7 +33,8 @@ export function useTurnkeyAuth(): UseTurnkeyAuthReturn {
|
|
|
32
33
|
const [error, setError] = useState<string | null>(null);
|
|
33
34
|
const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
|
|
34
35
|
const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
|
|
35
|
-
const {
|
|
36
|
+
const { partnerId } = useB3Config();
|
|
37
|
+
const { user } = useAuthentication(partnerId);
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* Step 1: Initiate login with email
|
|
@@ -9,7 +9,7 @@ import { useCallback, useState } from "react";
|
|
|
9
9
|
import { prepareTransaction, sendTransaction as twSendTransaction } from "thirdweb";
|
|
10
10
|
import { isAddress } from "viem";
|
|
11
11
|
import { useSwitchChain } from "wagmi";
|
|
12
|
-
import {
|
|
12
|
+
import { useB3Account } from "../components/B3Provider/useB3Account";
|
|
13
13
|
import { useAccountWallet } from "./useAccountWallet";
|
|
14
14
|
|
|
15
15
|
export interface UnifiedTransactionParams {
|
|
@@ -31,7 +31,7 @@ export function useUnifiedChainSwitchAndExecute() {
|
|
|
31
31
|
const [isSwitchingOrExecuting, setIsSwitchingOrExecuting] = useState(false);
|
|
32
32
|
|
|
33
33
|
const { isActiveSmartWallet, isActiveEOAWallet, connectedEOAWallet } = useAccountWallet();
|
|
34
|
-
const
|
|
34
|
+
const aaAccount = useB3Account();
|
|
35
35
|
|
|
36
36
|
// Handle EOA wallet chain switch and execute transaction
|
|
37
37
|
const handleEOASwitchChainAndSendTransaction = useCallback(
|
|
@@ -151,6 +151,10 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
151
151
|
customUsdInputValues?: string[];
|
|
152
152
|
/** Client-provided reference ID for tracking orders */
|
|
153
153
|
clientReferenceId?: string;
|
|
154
|
+
/** Whether to hide the header */
|
|
155
|
+
hideHeader?: boolean;
|
|
156
|
+
/** When true, disables URL parameter management for swap configuration */
|
|
157
|
+
disableUrlParamManagement?: boolean;
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
/**
|
package/src/styles/index.css
CHANGED
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
--red-100: #fde6d7;
|
|
153
153
|
--green-100: #dff9e8;
|
|
154
154
|
--border-brand: #2a9fff;
|
|
155
|
+
--border-primary: #d1d1d6;
|
|
155
156
|
--yellow-100: #fee6c7;
|
|
156
157
|
--purple-100: #f5edfa;
|
|
157
158
|
--purple-300: #ddc3ef;
|
|
@@ -249,6 +250,7 @@ html[data-theme="dark"] .b3-root,
|
|
|
249
250
|
--red-100: #6a5550;
|
|
250
251
|
--green-100: rgba(68, 90, 76, 0.57);
|
|
251
252
|
--border-brand: #2a9fff;
|
|
253
|
+
--border-primary: #d1d1d6;
|
|
252
254
|
--yellow-100: #957a6c;
|
|
253
255
|
--purple-100: rgba(113, 88, 126, 0.38);
|
|
254
256
|
--purple-300: #a375c3;
|