@b3dotfun/sdk 0.1.69-alpha.1 → 0.1.69-alpha.11

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.
Files changed (161) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +1 -1
  2. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +1 -1
  3. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +2 -4
  4. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
  5. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +5 -3
  6. package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.js +1 -2
  7. package/dist/cjs/anyspend/react/components/checkout/KycGate.js +1 -2
  8. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +5 -0
  9. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +37 -6
  10. package/dist/cjs/anyspend/react/components/common/StepProgress.d.ts +2 -0
  11. package/dist/cjs/anyspend/react/components/common/StepProgress.js +7 -2
  12. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +4 -6
  13. package/dist/cjs/anyspend/react/hooks/useKycStatus.d.ts +3 -1
  14. package/dist/cjs/anyspend/react/hooks/useKycStatus.js +11 -7
  15. package/dist/cjs/app.shared.js +9 -7
  16. package/dist/cjs/global-account/bsmnt.d.ts +0 -1
  17. package/dist/cjs/global-account/bsmnt.js +0 -6
  18. package/dist/cjs/global-account/react/components/B3DynamicModal.js +5 -2
  19. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
  20. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
  21. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +2 -1
  22. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  23. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
  24. package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  25. package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.js +57 -0
  26. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +12 -29
  27. package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +10 -1
  28. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +96 -15
  29. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +5 -3
  30. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +15 -2
  31. package/dist/cjs/global-account/react/components/Toast/ToastContext.d.ts +3 -0
  32. package/dist/cjs/global-account/react/components/Toast/ToastContext.js +30 -7
  33. package/dist/cjs/global-account/react/hooks/useAuth.js +26 -15
  34. package/dist/cjs/global-account/react/hooks/useAuthentication.js +23 -12
  35. package/dist/cjs/global-account/react/hooks/useConnect.d.ts +2 -2
  36. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  37. package/dist/cjs/global-account/react/hooks/useTWAuth.js +0 -1
  38. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -1
  39. package/dist/cjs/global-account/react/utils/createWagmiConfig.d.ts +0 -18
  40. package/dist/cjs/global-account/react/utils/createWagmiConfig.js +0 -17
  41. package/dist/cjs/global-account/react/utils/index.d.ts +0 -1
  42. package/dist/cjs/global-account/react/utils/index.js +0 -1
  43. package/dist/cjs/shared/utils/session-duration.d.ts +15 -0
  44. package/dist/cjs/shared/utils/session-duration.js +69 -0
  45. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
  46. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  47. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +2 -4
  48. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
  49. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +5 -3
  50. package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +2 -3
  51. package/dist/esm/anyspend/react/components/checkout/KycGate.js +2 -3
  52. package/dist/esm/anyspend/react/components/common/OrderDetails.js +6 -1
  53. package/dist/esm/anyspend/react/components/common/OrderStatus.js +34 -3
  54. package/dist/esm/anyspend/react/components/common/StepProgress.d.ts +2 -0
  55. package/dist/esm/anyspend/react/components/common/StepProgress.js +4 -2
  56. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +5 -7
  57. package/dist/esm/anyspend/react/hooks/useKycStatus.d.ts +3 -1
  58. package/dist/esm/anyspend/react/hooks/useKycStatus.js +9 -5
  59. package/dist/esm/app.shared.js +9 -7
  60. package/dist/esm/global-account/bsmnt.d.ts +0 -1
  61. package/dist/esm/global-account/bsmnt.js +0 -5
  62. package/dist/esm/global-account/react/components/B3DynamicModal.js +5 -2
  63. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
  64. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
  65. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +2 -1
  66. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  67. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
  68. package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  69. package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.js +52 -0
  70. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +12 -29
  71. package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +11 -2
  72. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +100 -19
  73. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +5 -3
  74. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +14 -1
  75. package/dist/esm/global-account/react/components/Toast/ToastContext.d.ts +3 -0
  76. package/dist/esm/global-account/react/components/Toast/ToastContext.js +30 -7
  77. package/dist/esm/global-account/react/hooks/useAuth.js +28 -17
  78. package/dist/esm/global-account/react/hooks/useAuthentication.js +24 -13
  79. package/dist/esm/global-account/react/hooks/useConnect.d.ts +2 -2
  80. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  81. package/dist/esm/global-account/react/hooks/useTWAuth.js +0 -1
  82. package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -1
  83. package/dist/esm/global-account/react/utils/createWagmiConfig.d.ts +0 -18
  84. package/dist/esm/global-account/react/utils/createWagmiConfig.js +0 -16
  85. package/dist/esm/global-account/react/utils/index.d.ts +0 -1
  86. package/dist/esm/global-account/react/utils/index.js +0 -1
  87. package/dist/esm/shared/utils/session-duration.d.ts +15 -0
  88. package/dist/esm/shared/utils/session-duration.js +64 -0
  89. package/dist/styles/index.css +1 -1
  90. package/dist/types/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
  91. package/dist/types/anyspend/react/components/common/StepProgress.d.ts +2 -0
  92. package/dist/types/anyspend/react/hooks/useKycStatus.d.ts +3 -1
  93. package/dist/types/global-account/bsmnt.d.ts +0 -1
  94. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
  95. package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  96. package/dist/types/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  97. package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +5 -3
  98. package/dist/types/global-account/react/components/Toast/ToastContext.d.ts +3 -0
  99. package/dist/types/global-account/react/hooks/useConnect.d.ts +2 -2
  100. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  101. package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -1
  102. package/dist/types/global-account/react/utils/createWagmiConfig.d.ts +0 -18
  103. package/dist/types/global-account/react/utils/index.d.ts +0 -1
  104. package/dist/types/shared/utils/session-duration.d.ts +15 -0
  105. package/package.json +2 -6
  106. package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -2
  107. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +2 -2
  108. package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +2 -4
  109. package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +13 -3
  110. package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +9 -3
  111. package/src/anyspend/react/components/checkout/KycGate.tsx +8 -3
  112. package/src/anyspend/react/components/common/OrderDetails.tsx +8 -0
  113. package/src/anyspend/react/components/common/OrderStatus.tsx +38 -3
  114. package/src/anyspend/react/components/common/StepProgress.tsx +15 -5
  115. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +5 -7
  116. package/src/anyspend/react/hooks/useKycStatus.ts +8 -5
  117. package/src/app.shared.ts +9 -8
  118. package/src/global-account/bsmnt.ts +0 -6
  119. package/src/global-account/react/components/B3DynamicModal.tsx +5 -2
  120. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +2 -1
  121. package/src/global-account/react/components/B3Provider/B3Provider.tsx +7 -1
  122. package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +5 -0
  123. package/src/global-account/react/components/ManageAccount/SessionDurationContent.tsx +107 -0
  124. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +28 -30
  125. package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +21 -2
  126. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +207 -54
  127. package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +19 -3
  128. package/src/global-account/react/components/Toast/ToastContext.tsx +39 -7
  129. package/src/global-account/react/hooks/useAuth.ts +28 -17
  130. package/src/global-account/react/hooks/useAuthentication.ts +24 -13
  131. package/src/global-account/react/hooks/useConnect.tsx +2 -2
  132. package/src/global-account/react/hooks/useTWAuth.tsx +0 -1
  133. package/src/global-account/react/stores/useModalStore.ts +11 -0
  134. package/src/global-account/react/utils/createWagmiConfig.tsx +0 -18
  135. package/src/global-account/react/utils/index.ts +0 -1
  136. package/src/shared/utils/session-duration.ts +64 -0
  137. package/src/types/torph.d.ts +4 -0
  138. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
  139. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +0 -54
  140. package/dist/cjs/global-account/react/components/ProfileAvatar.d.ts +0 -0
  141. package/dist/cjs/global-account/react/components/ProfileAvatar.js +0 -127
  142. package/dist/cjs/global-account/react/hooks/useRPMToken.d.ts +0 -7
  143. package/dist/cjs/global-account/react/hooks/useRPMToken.js +0 -11
  144. package/dist/cjs/global-account/react/utils/updateAvatar.d.ts +0 -4
  145. package/dist/cjs/global-account/react/utils/updateAvatar.js +0 -54
  146. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
  147. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +0 -51
  148. package/dist/esm/global-account/react/components/ProfileAvatar.d.ts +0 -0
  149. package/dist/esm/global-account/react/components/ProfileAvatar.js +0 -127
  150. package/dist/esm/global-account/react/hooks/useRPMToken.d.ts +0 -7
  151. package/dist/esm/global-account/react/hooks/useRPMToken.js +0 -8
  152. package/dist/esm/global-account/react/utils/updateAvatar.d.ts +0 -4
  153. package/dist/esm/global-account/react/utils/updateAvatar.js +0 -18
  154. package/dist/types/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
  155. package/dist/types/global-account/react/components/ProfileAvatar.d.ts +0 -0
  156. package/dist/types/global-account/react/hooks/useRPMToken.d.ts +0 -7
  157. package/dist/types/global-account/react/utils/updateAvatar.d.ts +0 -4
  158. package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +0 -90
  159. package/src/global-account/react/components/ProfileAvatar.tsx +0 -138
  160. package/src/global-account/react/hooks/useRPMToken.ts +0 -17
  161. package/src/global-account/react/utils/updateAvatar.ts +0 -21
@@ -22,7 +22,7 @@ const useTWAuth_1 = require("./useTWAuth");
22
22
  const useUserQuery_1 = require("./useUserQuery");
23
23
  const debug = (0, debug_1.debugB3React)("useAuthentication");
24
24
  function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
25
- const { onConnectCallback, onLogoutCallback } = (0, react_2.useContext)(LocalSDKProvider_1.LocalSDKContext);
25
+ const { onConnectCallback, onLogoutCallback, disableBSMNTAuthentication } = (0, react_2.useContext)(LocalSDKProvider_1.LocalSDKContext);
26
26
  const { disconnect } = (0, react_3.useDisconnect)();
27
27
  const wallets = (0, react_3.useConnectedWallets)();
28
28
  // Keep refs so logout() always disconnects current wallets, not stale closure values.
@@ -54,7 +54,7 @@ function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
54
54
  const { authenticate } = (0, useTWAuth_1.useTWAuth)();
55
55
  const { user, setUser } = (0, useUserQuery_1.useUserQuery)();
56
56
  const useAutoConnectLoadingPrevious = (0, react_2.useRef)(false);
57
- const wagmiConfig = (0, createWagmiConfig_1.createWagmiConfig)({ partnerId });
57
+ const wagmiConfig = (0, react_2.useMemo)(() => (0, createWagmiConfig_1.createWagmiConfig)({ partnerId }), [partnerId]);
58
58
  const { connect } = (0, wagmi_1.useConnect)();
59
59
  const activeWagmiAccount = (0, wagmi_1.useAccount)();
60
60
  const { switchAccount } = (0, wagmi_1.useSwitchAccount)();
@@ -105,9 +105,7 @@ function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
105
105
  });
106
106
  }
107
107
  syncWagmiFunc();
108
- // wagmi config shouldn't change
109
- // eslint-disable-next-line react-hooks/exhaustive-deps
110
- }, [partnerId, wallets]);
108
+ }, [wagmiConfig, wallets, connect, switchAccount]);
111
109
  (0, react_2.useEffect)(() => {
112
110
  syncWagmi();
113
111
  }, [wallets, syncWagmi]);
@@ -127,9 +125,11 @@ function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
127
125
  setIsAuthenticated(true);
128
126
  setIsAuthenticating(false);
129
127
  debug("Re-authenticated successfully", { userAuth });
130
- // Authenticate on BSMNT with B3 JWT
131
- const b3Jwt = await (0, bsmnt_1.authenticateWithB3JWT)(userAuth.accessToken);
132
- debug("@@b3Jwt", b3Jwt);
128
+ if (!disableBSMNTAuthentication) {
129
+ // Authenticate on BSMNT with B3 JWT
130
+ const b3Jwt = await (0, bsmnt_1.authenticateWithB3JWT)(userAuth.accessToken);
131
+ debug("@@b3Jwt", b3Jwt);
132
+ }
133
133
  return userAuth;
134
134
  }
135
135
  catch (error) {
@@ -140,12 +140,23 @@ function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
140
140
  setIsAuthenticated(true);
141
141
  setIsAuthenticating(false);
142
142
  debug("Fresh authentication successful", { userAuth });
143
- // Authenticate on BSMNT with B3 JWT
144
- const b3Jwt = await (0, bsmnt_1.authenticateWithB3JWT)(userAuth.accessToken);
145
- debug("@@b3Jwt", b3Jwt);
143
+ if (!disableBSMNTAuthentication) {
144
+ // Authenticate on BSMNT with B3 JWT
145
+ const b3Jwt = await (0, bsmnt_1.authenticateWithB3JWT)(userAuth.accessToken);
146
+ debug("@@b3Jwt", b3Jwt);
147
+ }
146
148
  return userAuth;
147
149
  }
148
- }, [activeWallet, partnerId, authenticate, setIsAuthenticated, setIsAuthenticating, setUser, setHasStartedConnecting]);
150
+ }, [
151
+ activeWallet,
152
+ partnerId,
153
+ authenticate,
154
+ setIsAuthenticated,
155
+ setIsAuthenticating,
156
+ setUser,
157
+ setHasStartedConnecting,
158
+ disableBSMNTAuthentication,
159
+ ]);
149
160
  const logout = (0, react_2.useCallback)(async (callback) => {
150
161
  // Disconnect ecosystem/smart wallets from the connected wallets list.
151
162
  // EOA wallets (MetaMask, Coinbase Wallet) are left in the list so they can
@@ -1,9 +1,9 @@
1
1
  import { Chain } from "thirdweb";
2
- import { SingleStepAuthArgsType } from "thirdweb/wallets";
2
+ import { MultiStepAuthArgsType, SingleStepAuthArgsType } from "thirdweb/wallets";
3
3
  /**
4
4
  * This hook is used to connect to a wallet using the thirdweb client.
5
5
  */
6
6
  export declare function useConnect(partnerId: string, chain?: Chain): {
7
- connect: (strategyOptions?: SingleStepAuthArgsType) => Promise<import("thirdweb/wallets").Wallet | null>;
7
+ connect: (strategyOptions?: MultiStepAuthArgsType | SingleStepAuthArgsType) => Promise<import("thirdweb/wallets").Wallet | null>;
8
8
  isLoading: boolean;
9
9
  };
@@ -7451,8 +7451,10 @@ export declare function useFirstEOA(chain?: {
7451
7451
  [x: `bool[${string}]`]: undefined;
7452
7452
  [x: `bytes[${string}]`]: undefined;
7453
7453
  [x: `bytes1[${string}]`]: undefined;
7454
- [x: `bytes4[${string}]`]: undefined;
7454
+ [x: `bytes7[${string}]`]: undefined;
7455
+ [x: `bytes14[${string}]`]: undefined;
7455
7456
  [x: `bytes30[${string}]`]: undefined;
7457
+ [x: `bytes5[${string}]`]: undefined;
7456
7458
  [x: `bytes18[${string}]`]: undefined;
7457
7459
  [x: `bytes6[${string}]`]: undefined;
7458
7460
  [x: `bytes9[${string}]`]: undefined;
@@ -7460,12 +7462,10 @@ export declare function useFirstEOA(chain?: {
7460
7462
  [x: `bytes10[${string}]`]: undefined;
7461
7463
  [x: `bytes2[${string}]`]: undefined;
7462
7464
  [x: `bytes3[${string}]`]: undefined;
7463
- [x: `bytes5[${string}]`]: undefined;
7464
- [x: `bytes7[${string}]`]: undefined;
7465
+ [x: `bytes4[${string}]`]: undefined;
7465
7466
  [x: `bytes11[${string}]`]: undefined;
7466
7467
  [x: `bytes12[${string}]`]: undefined;
7467
7468
  [x: `bytes13[${string}]`]: undefined;
7468
- [x: `bytes14[${string}]`]: undefined;
7469
7469
  [x: `bytes15[${string}]`]: undefined;
7470
7470
  [x: `bytes16[${string}]`]: undefined;
7471
7471
  [x: `bytes17[${string}]`]: undefined;
@@ -7553,8 +7553,10 @@ export declare function useFirstEOA(chain?: {
7553
7553
  bool?: undefined;
7554
7554
  bytes?: undefined;
7555
7555
  bytes1?: undefined;
7556
- bytes4?: undefined;
7556
+ bytes7?: undefined;
7557
+ bytes14?: undefined;
7557
7558
  bytes30?: undefined;
7559
+ bytes5?: undefined;
7558
7560
  bytes18?: undefined;
7559
7561
  bytes6?: undefined;
7560
7562
  bytes9?: undefined;
@@ -7562,12 +7564,10 @@ export declare function useFirstEOA(chain?: {
7562
7564
  bytes10?: undefined;
7563
7565
  bytes2?: undefined;
7564
7566
  bytes3?: undefined;
7565
- bytes5?: undefined;
7566
- bytes7?: undefined;
7567
+ bytes4?: undefined;
7567
7568
  bytes11?: undefined;
7568
7569
  bytes12?: undefined;
7569
7570
  bytes13?: undefined;
7570
- bytes14?: undefined;
7571
7571
  bytes15?: undefined;
7572
7572
  bytes16?: undefined;
7573
7573
  bytes17?: undefined;
@@ -16,7 +16,6 @@ const useSearchParamsSSR_1 = require("./useSearchParamsSSR");
16
16
  * @deprecated Use useAuth() instead
17
17
  */
18
18
  function useTWAuth() {
19
- console.warn("useTWAuth is deprecated. Please migrate to useAuth() for authentication.");
20
19
  const referralCode = (0, useSearchParamsSSR_1.useSearchParam)("referralCode");
21
20
  const authenticate = (0, react_1.useCallback)(async (wallet, partnerId) => {
22
21
  if (!wallet || !wallet?.getAuthToken?.())
@@ -425,6 +425,15 @@ export interface SendModalProps extends BaseModalProps {
425
425
  /** Callback function called when send is successful */
426
426
  onSuccess?: (txHash?: string) => void;
427
427
  }
428
+ /**
429
+ * Props for the Session Duration modal
430
+ * Allows users to configure how long they stay signed in
431
+ */
432
+ export interface SessionDurationModalProps extends BaseModalProps {
433
+ type: "sessionDuration";
434
+ partnerId: string;
435
+ chain: Chain;
436
+ }
428
437
  /**
429
438
  * Props for the Notifications modal
430
439
  * Allows users to manage notification settings and channels
@@ -626,7 +635,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
626
635
  /**
627
636
  * Union type of all possible modal content types
628
637
  */
629
- export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps | AnySpendCheckoutTriggerModalProps;
638
+ export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | SessionDurationModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps | AnySpendCheckoutTriggerModalProps;
630
639
  /**
631
640
  * State interface for the modal store
632
641
  */
@@ -25,21 +25,3 @@ export declare function createWagmiConfig(options: CreateWagmiConfigOptions): im
25
25
  }, {
26
26
  "thirdweb:lastChainId": number;
27
27
  }>)[]>;
28
- /**
29
- * Returns a cached wagmi config for the given partnerId.
30
- * Use this instead of calling createWagmiConfig() directly inside React components or hooks
31
- * to avoid registering duplicate EventEmitter listeners on every render.
32
- */
33
- export declare function getCachedWagmiConfig(options: CreateWagmiConfigOptions): import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], {
34
- [k: string]: import("viem").HttpTransport<undefined, false>;
35
- }, (CreateConnectorFn | CreateConnectorFn<import("thirdweb/dist/types/adapters/eip1193").EIP1193Provider | undefined, {
36
- connect<withCapabilities extends boolean = false>(parameters?: import("@thirdweb-dev/wagmi-adapter").ConnectionOptions<withCapabilities> | undefined): Promise<{
37
- accounts: withCapabilities extends true ? readonly {
38
- address: `0x${string}`;
39
- capabilities: Record<string, unknown>;
40
- }[] : readonly `0x${string}`[];
41
- chainId: number;
42
- }>;
43
- }, {
44
- "thirdweb:lastChainId": number;
45
- }>)[]>;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createWagmiConfig = createWagmiConfig;
4
- exports.getCachedWagmiConfig = getCachedWagmiConfig;
5
4
  const constants_1 = require("../../../shared/constants");
6
5
  const supported_1 = require("../../../shared/constants/chains/supported");
7
6
  const thirdweb_1 = require("../../../shared/utils/thirdweb");
@@ -31,19 +30,3 @@ function createWagmiConfig(options) {
31
30
  connectors: finalConnectors,
32
31
  });
33
32
  }
34
- /** Module-level cache — wagmi configs must not be recreated on every render. */
35
- const wagmiConfigCache = new Map();
36
- /**
37
- * Returns a cached wagmi config for the given partnerId.
38
- * Use this instead of calling createWagmiConfig() directly inside React components or hooks
39
- * to avoid registering duplicate EventEmitter listeners on every render.
40
- */
41
- function getCachedWagmiConfig(options) {
42
- const key = options.partnerId;
43
- let config = wagmiConfigCache.get(key);
44
- if (!config) {
45
- config = createWagmiConfig(options);
46
- wagmiConfigCache.set(key, config);
47
- }
48
- return config;
49
- }
@@ -1,4 +1,3 @@
1
1
  export * from "./notificationsAPI";
2
2
  export * from "./profileDisplay";
3
3
  export * from "./toast";
4
- export * from "./updateAvatar";
@@ -17,4 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./notificationsAPI"), exports);
18
18
  __exportStar(require("./profileDisplay"), exports);
19
19
  __exportStar(require("./toast"), exports);
20
- __exportStar(require("./updateAvatar"), exports);
@@ -0,0 +1,15 @@
1
+ export declare const SESSION_DURATION_OPTIONS: readonly [0, 1, 7, 14, 30];
2
+ export type SessionDurationDays = (typeof SESSION_DURATION_OPTIONS)[number];
3
+ /**
4
+ * Read session duration for a specific partner.
5
+ *
6
+ * preferences shape: { [partnerId]: { sessionDuration: number }, sessionDuration?: number }
7
+ *
8
+ * Priority: user.preferences[partnerId].sessionDuration
9
+ * → user.preferences.sessionDuration (global fallback)
10
+ * → localStorage (per-partner) → localStorage (global) → default 7d
11
+ */
12
+ export declare function getSessionDurationDays(userPreferences?: Record<string, any>, partnerId?: string): SessionDurationDays;
13
+ export declare const SESSION_DURATION_LABELS: Record<SessionDurationDays, string>;
14
+ /** Cache the preference locally so it's available immediately on next login */
15
+ export declare function setSessionDurationDays(days: SessionDurationDays, partnerId?: string): void;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SESSION_DURATION_LABELS = exports.SESSION_DURATION_OPTIONS = void 0;
4
+ exports.getSessionDurationDays = getSessionDurationDays;
5
+ exports.setSessionDurationDays = setSessionDurationDays;
6
+ const STORAGE_KEY_PREFIX = "b3-session-duration";
7
+ const DEFAULT_DAYS = 7;
8
+ // 0 = session cookie (expires when browser closes)
9
+ exports.SESSION_DURATION_OPTIONS = [0, 1, 7, 14, 30];
10
+ function storageKey(partnerId) {
11
+ return partnerId ? `${STORAGE_KEY_PREFIX}_${partnerId}` : STORAGE_KEY_PREFIX;
12
+ }
13
+ /**
14
+ * Read session duration for a specific partner.
15
+ *
16
+ * preferences shape: { [partnerId]: { sessionDuration: number }, sessionDuration?: number }
17
+ *
18
+ * Priority: user.preferences[partnerId].sessionDuration
19
+ * → user.preferences.sessionDuration (global fallback)
20
+ * → localStorage (per-partner) → localStorage (global) → default 7d
21
+ */
22
+ function getSessionDurationDays(userPreferences, partnerId) {
23
+ if (userPreferences) {
24
+ if (partnerId) {
25
+ const v = userPreferences[partnerId]?.sessionDuration;
26
+ if (exports.SESSION_DURATION_OPTIONS.includes(v))
27
+ return v;
28
+ }
29
+ const v = userPreferences["sessionDuration"];
30
+ if (exports.SESSION_DURATION_OPTIONS.includes(v))
31
+ return v;
32
+ }
33
+ try {
34
+ if (partnerId) {
35
+ const stored = localStorage.getItem(storageKey(partnerId));
36
+ if (stored !== null) {
37
+ const parsed = Number(stored);
38
+ if (exports.SESSION_DURATION_OPTIONS.includes(parsed))
39
+ return parsed;
40
+ }
41
+ }
42
+ const stored = localStorage.getItem(STORAGE_KEY_PREFIX);
43
+ if (stored !== null) {
44
+ const parsed = Number(stored);
45
+ if (exports.SESSION_DURATION_OPTIONS.includes(parsed))
46
+ return parsed;
47
+ }
48
+ }
49
+ catch {
50
+ // localStorage unavailable (e.g. SSR)
51
+ }
52
+ return DEFAULT_DAYS;
53
+ }
54
+ exports.SESSION_DURATION_LABELS = {
55
+ 0: "Session only",
56
+ 1: "1 day",
57
+ 7: "7 days",
58
+ 14: "14 days",
59
+ 30: "30 days",
60
+ };
61
+ /** Cache the preference locally so it's available immediately on next login */
62
+ function setSessionDurationDays(days, partnerId) {
63
+ try {
64
+ localStorage.setItem(storageKey(partnerId), String(days));
65
+ }
66
+ catch {
67
+ // ignore
68
+ }
69
+ }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "../../../anyspend/index.js";
2
+ import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "../../../anyspend/index.js";
3
3
  import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, toast, useHasMounted, useModalStore, useSimBalance, useUnifiedChainSwitchAndExecute, } from "../../../global-account/react/index.js";
4
4
  import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
5
5
  import { formatTokenAmount } from "../../../shared/utils/number.js";
@@ -262,7 +262,7 @@ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, s
262
262
  opacity: hasMounted ? 1 : 0,
263
263
  y: hasMounted ? 0 : 20,
264
264
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
265
- }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: `https://basescan.org/tx/${stakingTxHash}`, target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
265
+ }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: getExplorerTxUrl(base.id, stakingTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
266
266
  setB3ModalOpen(false);
267
267
  onSuccess?.();
268
268
  }, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "../../../anyspend/index.js";
2
+ import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "../../../anyspend/index.js";
3
3
  import { normalizeAddress } from "../../../anyspend/utils/index.js";
4
4
  import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, toast, useHasMounted, useModalStore, useSimBalance, useUnifiedChainSwitchAndExecute, } from "../../../global-account/react/index.js";
5
5
  import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
@@ -275,7 +275,7 @@ export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenA
275
275
  opacity: hasMounted ? 1 : 0,
276
276
  y: hasMounted ? 0 : 20,
277
277
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
278
- }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: `https://basescan.org/tx/${stakingTxHash}`, target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
278
+ }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: getExplorerTxUrl(base.id, stakingTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
279
279
  setB3ModalOpen(false);
280
280
  onSuccess?.(formatTokenAmount(BigInt(userStakeAmount), 18) ?? "");
281
281
  }, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
@@ -53,9 +53,7 @@ export function CheckoutPaymentPanel({ recipientAddress, destinationTokenAddress
53
53
  if (activeOrderId) {
54
54
  return (_jsx(CheckoutOrderStatus, { orderId: activeOrderId, themeColor: themeColor, returnUrl: returnUrl, returnLabel: returnLabel, onSuccess: onSuccess, onError: onError, onRetry: handleRetry, showPoints: showPoints, showOrderId: showOrderId, classes: classes }));
55
55
  }
56
- const accordionButtonClass = (active) => cn("anyspend-payment-method-btn flex w-full items-center gap-3 px-4 py-4 text-left transition-colors", active
57
- ? "bg-white dark:bg-neutral-900"
58
- : "bg-white hover:bg-gray-50 dark:bg-neutral-900 dark:hover:bg-neutral-800", classes?.paymentMethodButton);
59
- const expandedPanelClass = cn("anyspend-payment-method-panel border-t border-gray-100 bg-white px-4 py-4 dark:border-neutral-800 dark:bg-neutral-900");
56
+ const accordionButtonClass = (active) => cn("anyspend-payment-method-btn flex w-full items-center gap-3 px-4 py-4 text-left transition-colors", !active && "hover:bg-gray-50 dark:hover:bg-neutral-800", classes?.paymentMethodButton);
57
+ const expandedPanelClass = cn("anyspend-payment-method-panel border-t border-gray-100 px-4 py-4 dark:border-neutral-800");
60
58
  return (_jsxs("div", { className: cn("anyspend-payment-panel flex flex-col gap-5", classes?.paymentPanel), children: [_jsx("h2", { className: cn("anyspend-payment-title text-lg font-semibold text-gray-900 dark:text-gray-100", classes?.paymentTitle), children: "Payment" }), !isFormValid && (_jsx("p", { className: "text-sm text-amber-600 dark:text-amber-400", children: "Please complete the required fields above before proceeding to payment." })), _jsxs("div", { className: cn("anyspend-payment-methods divide-y divide-gray-200 overflow-hidden rounded-xl border border-gray-200 dark:divide-neutral-700 dark:border-neutral-700", !isFormValid && "pointer-events-none opacity-50", classes?.paymentMethodSelector), children: [_jsxs("div", { className: "anyspend-method-crypto", children: [_jsxs("button", { onClick: () => setPaymentMethod(paymentMethod === "crypto" ? null : "crypto"), className: accordionButtonClass(paymentMethod === "crypto"), children: [_jsx(RadioCircle, { selected: paymentMethod === "crypto", themeColor: themeColor }), _jsx(Wallet, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }), _jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Pay with crypto" })] }), _jsx(AnimatePresence, { initial: false, children: paymentMethod === "crypto" && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, children: _jsx("div", { className: expandedPanelClass, children: _jsx(CryptoPayPanel, { recipientAddress: recipientAddress, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, totalAmount: totalAmount, buttonText: buttonText, themeColor: themeColor, onOrderCreated: handleOrderCreated, onError: onError, callbackMetadata: callbackMetadata, classes: classes, senderAddress: senderAddress }) }) }, "crypto-panel")) })] }), _jsxs("div", { className: "anyspend-method-card", children: [_jsxs("button", { onClick: () => setPaymentMethod(paymentMethod === "card" ? null : "card"), className: accordionButtonClass(paymentMethod === "card"), children: [_jsx(RadioCircle, { selected: paymentMethod === "card", themeColor: themeColor }), _jsx(CreditCard, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }), _jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Credit or debit card" }), _jsxs("div", { className: "ml-auto flex items-center gap-1", children: [_jsx(VisaLogo, {}), _jsx(MastercardLogo, {}), _jsx(AmexLogo, {})] })] }), _jsx(AnimatePresence, { initial: false, children: paymentMethod === "card" && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, children: _jsx("div", { className: expandedPanelClass, children: _jsx(FiatCheckoutPanel, { recipientAddress: recipientAddress, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, totalAmount: totalAmount, themeColor: themeColor, onOrderCreated: handleOrderCreated, onError: onError, callbackMetadata: callbackMetadata, classes: classes, feeOnTop: feeOnTop, kycEnabled: kycEnabled }) }) }, "card-panel")) })] }), _jsxs("div", { className: "anyspend-method-coinbase", children: [_jsxs("button", { onClick: () => setPaymentMethod(paymentMethod === "coinbase" ? null : "coinbase"), className: accordionButtonClass(paymentMethod === "coinbase"), children: [_jsx(RadioCircle, { selected: paymentMethod === "coinbase", themeColor: themeColor }), _jsx(CoinbaseLogo, {}), _jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Coinbase Pay" })] }), _jsx(AnimatePresence, { initial: false, children: paymentMethod === "coinbase" && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, children: _jsx("div", { className: expandedPanelClass, children: _jsx(CoinbaseCheckoutPanel, { recipientAddress: recipientAddress, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, totalAmount: totalAmount, themeColor: themeColor, onOrderCreated: handleOrderCreated, onError: onError, callbackMetadata: callbackMetadata, classes: classes }) }) }, "coinbase-panel")) })] })] })] }));
61
59
  }
@@ -1,10 +1,11 @@
1
1
  import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
2
2
  interface CheckoutSuccessProps {
3
3
  txHash?: string;
4
+ dstChainId?: number;
4
5
  orderId?: string;
5
6
  returnUrl?: string;
6
7
  returnLabel?: string;
7
8
  classes?: AnySpendCheckoutClasses;
8
9
  }
9
- export declare function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -1,11 +1,13 @@
1
1
  "use client";
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { getExplorerTxUrl } from "../../../../anyspend/index.js";
4
+ import { b3 } from "viem/chains";
3
5
  import { cn } from "../../../../shared/utils/cn.js";
4
6
  import { ExternalLink } from "lucide-react";
5
7
  import { motion } from "motion/react";
6
8
  import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext.js";
7
9
  import { AnimatedCheckmark } from "../icons/AnimatedCheckmark.js";
8
- export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }) {
10
+ export function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }) {
9
11
  const { content, slots } = useAnySpendCustomization();
10
12
  if (slots.successScreen) {
11
13
  return (_jsx(_Fragment, { children: slots.successScreen({
@@ -15,7 +17,7 @@ export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, class
15
17
  : "Your payment has been processed successfully.",
16
18
  txHash,
17
19
  orderId,
18
- explorerUrl: txHash ? `https://explorer.b3.fun/tx/${txHash}` : undefined,
20
+ explorerUrl: txHash ? getExplorerTxUrl(dstChainId ?? b3.id, txHash) : undefined,
19
21
  onDone: () => {
20
22
  if (returnUrl)
21
23
  window.location.href = returnUrl;
@@ -24,5 +26,5 @@ export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, class
24
26
  returnLabel: content.returnButtonLabel || returnLabel,
25
27
  }) }));
26
28
  }
27
- return (_jsxs("div", { className: cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [_jsx("div", { className: "anyspend-success-icon mb-4", children: _jsx(AnimatedCheckmark, { className: "h-16 w-16" }) }), _jsx(motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), _jsx(motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && (_jsxs(motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: `https://explorer.b3.fun/tx/${txHash}`, target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && (_jsxs(motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && (_jsx(motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: cn("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
29
+ return (_jsxs("div", { className: cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [_jsx("div", { className: "anyspend-success-icon mb-4", children: _jsx(AnimatedCheckmark, { className: "h-16 w-16" }) }), _jsx(motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), _jsx(motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && (_jsxs(motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: getExplorerTxUrl(dstChainId ?? b3.id, txHash), target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && (_jsxs(motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && (_jsx(motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: cn("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
28
30
  }
@@ -5,19 +5,18 @@ import { USDC_BASE } from "../../../../anyspend/constants/index.js";
5
5
  import { cn } from "../../../../shared/utils/cn.js";
6
6
  import { formatUnits } from "../../../../shared/utils/number.js";
7
7
  import { getStripePromise } from "../../../../shared/utils/payment.utils.js";
8
- import { ShinyButton, TextShimmer, useB3Config, useModalStore, useTokenData } from "../../../../global-account/react/index.js";
8
+ import { ShinyButton, TextShimmer, useAccountWallet, useB3Config, useModalStore, useTokenData, } from "../../../../global-account/react/index.js";
9
9
  import { thirdwebB3Chain } from "../../../../shared/constants/chains/b3Chain.js";
10
10
  import { AddressElement, Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
11
11
  import { Loader2, Lock, Wallet } from "lucide-react";
12
12
  import { AnimatePresence, motion } from "motion/react";
13
13
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
14
- import { useAccount } from "wagmi";
15
14
  import { KycGate } from "./KycGate.js";
16
15
  export function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, classes, feeOnTop, kycEnabled = false, }) {
17
16
  // Stable refs for callback props to avoid re-triggering effects
18
17
  const onErrorRef = useRef(onError);
19
18
  onErrorRef.current = onError;
20
- const { address } = useAccount();
19
+ const { address } = useAccountWallet();
21
20
  const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
22
21
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
23
22
  const { data: tokenData } = useTokenData(destinationTokenChainId, destinationTokenAddress);
@@ -1,15 +1,14 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cn } from "../../../../shared/utils/cn.js";
4
- import { ShinyButton, TextShimmer, useB3Config, useModalStore } from "../../../../global-account/react/index.js";
4
+ import { ShinyButton, TextShimmer, useAccountWallet, useB3Config, useModalStore, } from "../../../../global-account/react/index.js";
5
5
  import { thirdwebB3Chain } from "../../../../shared/constants/chains/b3Chain.js";
6
6
  import { Loader2, ShieldCheck, AlertTriangle, Clock, Wallet } from "lucide-react";
7
7
  import { AnimatePresence, motion } from "motion/react";
8
8
  import { useCallback, useEffect, useRef, useState } from "react";
9
- import { useAccount } from "wagmi";
10
9
  import { useCreateKycInquiry, useKycStatus, useVerifyKyc, useWalletAuthHeaders } from "../../hooks/useKycStatus.js";
11
10
  export function KycGate({ themeColor, classes, enabled = false, onStatusResolved }) {
12
- const { address } = useAccount();
11
+ const { address } = useAccountWallet();
13
12
  const { partnerId } = useB3Config();
14
13
  // Gate the status fetch behind explicit user consent so the wallet
15
14
  // signature prompt doesn't fire automatically on tab open.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ALL_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_SOLANA_MAINNET_CHAIN_ID, ZERO_ADDRESS, } from "../../../../anyspend/index.js";
4
- import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useB3Config, useModalStore, useProfile, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
4
+ import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useB3Config, useModalStore, useProfile, useToastContext, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
5
5
  import { useRouter, useSearchParams } from "../../../../shared/react/hooks/index.js";
6
6
  import { cn } from "../../../../shared/utils/index.js";
7
7
  import centerTruncate from "../../../../shared/utils/centerTruncate.js";
@@ -134,6 +134,11 @@ function roundTokenAmount(amount) {
134
134
  export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, returnToHomeUrl, returnHomeLabel, classes, }) {
135
135
  const router = useRouter();
136
136
  const searchParams = useSearchParams();
137
+ const { setHeaderMode } = useToastContext();
138
+ useEffect(() => {
139
+ setHeaderMode(true);
140
+ return () => setHeaderMode(false);
141
+ }, [setHeaderMode]);
137
142
  // Get theme from B3Provider context
138
143
  const { theme } = useB3Config();
139
144
  const colorMode = theme || "light";
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { getStatusDisplay } from "../../../../anyspend/index.js";
3
3
  import { useSearchParams } from "../../../../shared/react/index.js";
4
- import { Clock, Loader2, RotateCcw, X } from "lucide-react";
4
+ import { AlertCircle, AlertTriangle, CheckCircle, Clock, Info, Loader2, RotateCcw, X } from "lucide-react";
5
+ import { useToastContext } from "../../../../global-account/react/index.js";
5
6
  import { memo, useEffect, useRef } from "react";
6
7
  import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext.js";
7
8
  import { AnimatedCheckmark } from "../icons/AnimatedCheckmark.js";
@@ -14,6 +15,19 @@ function getStepIndex(status) {
14
15
  return 1;
15
16
  return -1;
16
17
  }
18
+ function getToastIcon(type) {
19
+ const iconClass = "h-5 w-5";
20
+ switch (type) {
21
+ case "success":
22
+ return _jsx(CheckCircle, { className: `${iconClass} text-green-500` });
23
+ case "error":
24
+ return _jsx(AlertCircle, { className: `${iconClass} text-red-500` });
25
+ case "info":
26
+ return _jsx(Info, { className: `${iconClass} text-blue-500` });
27
+ case "warning":
28
+ return _jsx(AlertTriangle, { className: `${iconClass} text-amber-500` });
29
+ }
30
+ }
17
31
  export const OrderStatus = memo(function OrderStatus({ order, selectedCryptoPaymentMethod, }) {
18
32
  const { text: defaultText, description: defaultDescription } = getStatusDisplay(order);
19
33
  const { content, slots } = useAnySpendCustomization();
@@ -58,9 +72,26 @@ export const OrderStatus = memo(function OrderStatus({ order, selectedCryptoPaym
58
72
  if (content.processingDescription)
59
73
  description = content.processingDescription;
60
74
  }
75
+ const { latestToast } = useToastContext();
76
+ // Override subtitle with toast notification when present (title stays unchanged)
77
+ let notificationIcon = undefined;
78
+ if (latestToast && currentStepIndex >= 0) {
79
+ description = latestToast.message;
80
+ notificationIcon = getToastIcon(latestToast.type);
81
+ }
61
82
  const paymentSteps = [
62
- { id: 1, title: text, description: typeof description === "string" ? description : defaultDescription || "" },
63
- { id: 2, title: text, description: typeof description === "string" ? description : defaultDescription || "" },
83
+ {
84
+ id: 1,
85
+ title: text,
86
+ description: typeof description === "string" ? description : defaultDescription || "",
87
+ icon: notificationIcon,
88
+ },
89
+ {
90
+ id: 2,
91
+ title: text,
92
+ description: typeof description === "string" ? description : defaultDescription || "",
93
+ icon: notificationIcon,
94
+ },
64
95
  ];
65
96
  if (currentStepIndex === 0) {
66
97
  if (!(order.status === "scanning_deposit_transaction" && cryptoPaymentMethod === "transfer_crypto")) {
@@ -1,7 +1,9 @@
1
+ import React from "react";
1
2
  export interface Step {
2
3
  id: string | number;
3
4
  title: string;
4
5
  description?: string;
6
+ icon?: React.ReactNode;
5
7
  }
6
8
  export interface StepProgressProps {
7
9
  steps: Step[];
@@ -1,14 +1,16 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React from "react";
3
4
  import { motion } from "framer-motion";
5
+ import { TextMorph } from "torph/react";
4
6
  import { AnimatedCheckmark } from "../icons/AnimatedCheckmark.js";
5
7
  export function StepProgress({ steps, currentStepIndex, className = "", animateCompletedSteps = true, }) {
6
8
  const currentStep = steps[currentStepIndex];
7
- return (_jsxs("div", { className: `flex w-full flex-col items-center gap-4 ${className}`, children: [_jsx("div", { className: "flex items-center gap-2", children: steps.map((_, index) => (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center", children: index < currentStepIndex ? (
9
+ return (_jsxs("div", { className: `flex w-full flex-col items-center gap-4 ${className}`, children: [_jsx("div", { className: "flex items-center gap-2", children: steps.map((_, index) => (_jsxs(React.Fragment, { children: [_jsx("div", { className: "flex items-center", children: index < currentStepIndex ? (
8
10
  // Completed step - checkmark replaces the whole circle
9
11
  _jsx(motion.div, { initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, transition: { delay: index * 0.2 }, children: _jsx(AnimatedCheckmark, { className: "h-10 w-10", strokeWidth: 2.5, static: !animateCompletedSteps }) })) : (_jsx(motion.div, { initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, transition: { delay: index * 0.2 }, className: `border-as-border-secondary relative flex h-10 w-10 items-center justify-center rounded-full border-[3px]`, children: index === currentStepIndex ? (
10
12
  // Current step - show spinning border and step number
11
13
  _jsxs(_Fragment, { children: [_jsx("div", { className: "border-t-as-primary absolute -inset-0.5 animate-spin rounded-full border-[3px] border-transparent" }), _jsx("span", { className: "text-as-primary font-semibold", children: index + 1 })] })) : (
12
14
  // Future step - show step number with disabled styling
13
- _jsx("span", { className: "text-as-content-disabled font-semibold", children: index + 1 })) })) }, index), index < steps.length - 1 && (_jsx("div", { className: "flex w-8 items-center justify-center gap-1", children: Array.from({ length: 6 }).map((_, dotIndex) => (_jsx("div", { className: "bg-as-primary/30 h-[2px] w-[2px] rounded-full" }, dotIndex))) }))] }))) }), currentStep && (_jsxs(motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, className: "text-center", children: [_jsx("h2", { className: "text-as-primary text-xl font-semibold", children: currentStep.title }), currentStep.description && _jsx("p", { className: "text-as-tertiary mt-1 text-sm", children: currentStep.description })] }))] }));
15
+ _jsx("span", { className: "text-as-content-disabled font-semibold", children: index + 1 })) })) }), index < steps.length - 1 && (_jsx("div", { className: "flex w-8 items-center justify-center gap-1", children: Array.from({ length: 6 }).map((_, dotIndex) => (_jsx("div", { className: "bg-as-primary/30 h-[2px] w-[2px] rounded-full" }, dotIndex))) }))] }, index))) }), currentStep && (_jsxs(motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, className: "text-center", children: [_jsx("h2", { className: "text-as-primary text-xl font-semibold", children: _jsx(TextMorph, { children: currentStep.title }) }), currentStep.description && (_jsxs("p", { className: "text-as-tertiary mt-1 flex items-center justify-center gap-1.5 text-sm", children: [currentStep.icon, _jsx(TextMorph, { children: currentStep.description })] }))] }))] }));
14
16
  }