@b3dotfun/sdk 0.1.69-alpha.8 → 0.1.69-alpha.9

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 (30) hide show
  1. package/dist/cjs/app.shared.js +9 -7
  2. package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -0
  3. package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  4. package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.js +57 -0
  5. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +12 -29
  6. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  7. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -1
  8. package/dist/cjs/shared/utils/session-duration.d.ts +15 -0
  9. package/dist/cjs/shared/utils/session-duration.js +69 -0
  10. package/dist/esm/app.shared.js +9 -7
  11. package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -0
  12. package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  13. package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.js +52 -0
  14. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +12 -29
  15. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  16. package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -1
  17. package/dist/esm/shared/utils/session-duration.d.ts +15 -0
  18. package/dist/esm/shared/utils/session-duration.js +64 -0
  19. package/dist/styles/index.css +1 -1
  20. package/dist/types/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  21. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  22. package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -1
  23. package/dist/types/shared/utils/session-duration.d.ts +15 -0
  24. package/package.json +1 -1
  25. package/src/app.shared.ts +9 -8
  26. package/src/global-account/react/components/B3DynamicModal.tsx +3 -0
  27. package/src/global-account/react/components/ManageAccount/SessionDurationContent.tsx +107 -0
  28. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +28 -30
  29. package/src/global-account/react/stores/useModalStore.ts +11 -0
  30. package/src/shared/utils/session-duration.ts +64 -0
@@ -7,8 +7,8 @@ exports.clientOptions = exports.MyAuthenticationClient = exports.authenticate =
7
7
  const authentication_client_1 = require("@feathersjs/authentication-client");
8
8
  const js_cookie_1 = __importDefault(require("js-cookie"));
9
9
  const constants_1 = require("./shared/constants");
10
+ const session_duration_1 = require("./shared/utils/session-duration");
10
11
  exports.B3_API_URL = process.env.EXPO_PUBLIC_B3_API || process.env.NEXT_PUBLIC_B3_API || process.env.PUBLIC_B3_API || "https://api.b3.fun";
11
- const DEV_USER_GROUP = 4;
12
12
  const authenticate = async (app, accessToken, identityToken, params) => {
13
13
  const fullToken = `${accessToken}+${identityToken}`;
14
14
  // Do not authenticate if there is no token
@@ -23,12 +23,14 @@ const authenticate = async (app, accessToken, identityToken, params) => {
23
23
  }, {
24
24
  query: params || {},
25
25
  });
26
- // Extend cookie expiration to 30 days for dev users
27
- if (response?.user?.userGroups?.includes(DEV_USER_GROUP)) {
28
- const token = js_cookie_1.default.get(constants_1.B3_AUTH_COOKIE_NAME);
29
- if (token) {
30
- js_cookie_1.default.set(constants_1.B3_AUTH_COOKIE_NAME, token, { expires: 30 });
31
- }
26
+ const token = js_cookie_1.default.get(constants_1.B3_AUTH_COOKIE_NAME);
27
+ if (token) {
28
+ const days = (0, session_duration_1.getSessionDurationDays)(response?.user?.preferences, params?.partnerId);
29
+ js_cookie_1.default.set(constants_1.B3_AUTH_COOKIE_NAME, token, {
30
+ ...(days > 0 ? { expires: days } : {}),
31
+ secure: true,
32
+ sameSite: "Lax",
33
+ });
32
34
  }
33
35
  return response;
34
36
  }
@@ -23,6 +23,7 @@ const LinkAccount_1 = require("./LinkAccount/LinkAccount");
23
23
  const LinkNewAccount_1 = require("./LinkAccount/LinkNewAccount");
24
24
  const ManageAccount_1 = require("./ManageAccount/ManageAccount");
25
25
  const NotificationsContent_1 = __importDefault(require("./ManageAccount/NotificationsContent"));
26
+ const SessionDurationContent_1 = __importDefault(require("./ManageAccount/SessionDurationContent"));
26
27
  const RequestPermissions_1 = require("./RequestPermissions/RequestPermissions");
27
28
  const Send_1 = require("./Send/Send");
28
29
  const SignInWithB3Flow_1 = require("./SignInWithB3/SignInWithB3Flow");
@@ -146,6 +147,8 @@ function B3DynamicModal() {
146
147
  return (0, jsx_runtime_1.jsx)(Send_1.Send, { ...contentType });
147
148
  case "notifications":
148
149
  return (0, jsx_runtime_1.jsx)(NotificationsContent_1.default, { ...contentType });
150
+ case "sessionDuration":
151
+ return (0, jsx_runtime_1.jsx)(SessionDurationContent_1.default, { partnerId: contentType.partnerId });
149
152
  // Add other modal types here
150
153
  default:
151
154
  return null;
@@ -0,0 +1,5 @@
1
+ interface SessionDurationContentProps {
2
+ partnerId: string;
3
+ }
4
+ declare const SessionDurationContent: ({ partnerId }: SessionDurationContentProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default SessionDurationContent;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const app_1 = __importDefault(require("../../../../global-account/app"));
8
+ const react_1 = require("../../../../global-account/react");
9
+ const session_duration_1 = require("../../../../shared/utils/session-duration");
10
+ const react_2 = require("react");
11
+ const ModalHeader_1 = __importDefault(require("../ModalHeader/ModalHeader"));
12
+ const DESCRIPTIONS = {
13
+ 0: "Sign out when browser closes",
14
+ 1: "Stay signed in for 1 day",
15
+ 7: "Stay signed in for 7 days",
16
+ 14: "Stay signed in for 2 weeks",
17
+ 30: "Stay signed in for 30 days",
18
+ };
19
+ const SessionDurationContent = ({ partnerId }) => {
20
+ const { user, setUser } = (0, react_1.useAuthentication)(partnerId);
21
+ const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
22
+ const [sessionDays, setSessionDays] = (0, react_2.useState)(() => (0, session_duration_1.getSessionDurationDays)(user?.preferences, partnerId));
23
+ const [saving, setSaving] = (0, react_2.useState)(false);
24
+ const handleSelect = async (days) => {
25
+ const previous = sessionDays;
26
+ (0, session_duration_1.setSessionDurationDays)(days, partnerId);
27
+ setSessionDays(days);
28
+ if (user?.userId) {
29
+ setSaving(true);
30
+ try {
31
+ const updated = await app_1.default.service("users").patch(user.userId, {
32
+ preferences: {
33
+ ...user.preferences,
34
+ [partnerId]: {
35
+ ...((user.preferences ?? {})[partnerId] ?? {}),
36
+ sessionDuration: days,
37
+ },
38
+ },
39
+ });
40
+ setUser(updated);
41
+ }
42
+ catch (error) {
43
+ console.error("Failed to save session duration preference:", error);
44
+ // Revert optimistic update so UI stays consistent with server state
45
+ setSessionDays(previous);
46
+ (0, session_duration_1.setSessionDurationDays)(previous, partnerId);
47
+ }
48
+ finally {
49
+ setSaving(false);
50
+ }
51
+ }
52
+ };
53
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-[470px] flex-col", children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { showBackButton: true, showCloseButton: false, title: "Stay signed in", handleBack: navigateBack }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-2 p-5", children: session_duration_1.SESSION_DURATION_OPTIONS.map(days => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => handleSelect(days), disabled: saving, className: `flex items-center justify-between rounded-xl border px-4 py-3 transition-colors ${sessionDays === days
54
+ ? "border-[#3f3f46] bg-[#f4f4f5] dark:border-white dark:bg-white/10"
55
+ : "border-[#e4e4e7] bg-transparent hover:bg-[#f4f4f5] dark:border-white/10 dark:hover:bg-white/5"}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-0.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[14px] leading-none tracking-[-0.28px] text-[#3f3f46] dark:text-white", children: session_duration_1.SESSION_DURATION_LABELS[days] }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-medium text-[13px] leading-none tracking-[-0.26px] text-[#70707b] dark:text-white/50", children: DESCRIPTIONS[days] })] }), sessionDays === days && ((0, jsx_runtime_1.jsx)("div", { className: "flex size-5 items-center justify-center rounded-full bg-[#3f3f46] dark:bg-white", children: (0, jsx_runtime_1.jsx)("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 4L3.5 6.5L9 1", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "dark:stroke-[#3f3f46]" }) }) }))] }, days))) })] }));
56
+ };
57
+ exports.default = SessionDurationContent;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("../../../../global-account/react");
8
8
  const thirdweb_1 = require("../../../../shared/utils/thirdweb");
9
+ const session_duration_1 = require("../../../../shared/utils/session-duration");
9
10
  const lucide_react_1 = require("lucide-react");
10
11
  const react_2 = require("react");
11
12
  const react_3 = require("thirdweb/react");
@@ -16,47 +17,29 @@ const SettingsProfileCard_1 = __importDefault(require("./SettingsProfileCard"));
16
17
  const SettingsContent = ({ partnerId, onLogout, chain, }) => {
17
18
  const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
18
19
  const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
19
- const { logout } = (0, react_1.useAuthentication)(partnerId);
20
+ const { logout, user } = (0, react_1.useAuthentication)(partnerId);
20
21
  const [logoutLoading, setLogoutLoading] = (0, react_2.useState)(false);
22
+ const sessionDays = (0, session_duration_1.getSessionDurationDays)(user?.preferences, partnerId);
21
23
  const { data: profilesRaw = [] } = (0, react_3.useProfiles)({ client: thirdweb_1.client });
22
24
  const profiles = profilesRaw.filter((profile) => !["custom_auth_endpoint"].includes(profile.type));
23
25
  const handleNavigate = (type) => {
24
26
  if (type === "home") {
25
- setB3ModalContentType({
26
- type: "manageAccount",
27
- chain,
28
- partnerId,
29
- onLogout,
30
- activeTab: "home",
31
- });
27
+ setB3ModalContentType({ type: "manageAccount", chain, partnerId, onLogout, activeTab: "home" });
32
28
  }
33
29
  else if (type === "swap") {
34
- setB3ModalContentType({
35
- type: "manageAccount",
36
- chain,
37
- partnerId,
38
- onLogout,
39
- activeTab: "tokens",
40
- });
30
+ setB3ModalContentType({ type: "manageAccount", chain, partnerId, onLogout, activeTab: "tokens" });
41
31
  }
42
32
  else if (type === "linkAccount") {
43
- setB3ModalContentType({
44
- type: "linkAccount",
45
- chain,
46
- partnerId,
47
- });
33
+ setB3ModalContentType({ type: "linkAccount", chain, partnerId });
48
34
  }
49
35
  else if (type === "notifications") {
50
- setB3ModalContentType({
51
- type: "notifications",
52
- chain,
53
- partnerId,
54
- });
36
+ setB3ModalContentType({ type: "notifications", chain, partnerId });
37
+ }
38
+ else if (type === "sessionDuration") {
39
+ setB3ModalContentType({ type: "sessionDuration", chain, partnerId });
55
40
  }
56
41
  else {
57
- setB3ModalContentType({
58
- type: "avatarEditor",
59
- });
42
+ setB3ModalContentType({ type: "avatarEditor" });
60
43
  }
61
44
  setB3ModalOpen(true);
62
45
  };
@@ -67,7 +50,7 @@ const SettingsContent = ({ partnerId, onLogout, chain, }) => {
67
50
  setB3ModalOpen(false);
68
51
  setLogoutLoading(false);
69
52
  };
70
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-[470px] flex-col", children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { showBackButton: false, showCloseButton: false, title: "Settings" }), (0, jsx_runtime_1.jsx)("div", { className: "p-5", children: (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-settings-profile-card dark:border-b3-line dark:bg-b3-background flex items-center rounded-xl border border-[#e4e4e7] bg-[#f4f4f5] p-4", children: (0, jsx_runtime_1.jsx)(SettingsProfileCard_1.default, {}) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 px-5", children: [(0, jsx_runtime_1.jsx)(SettingsMenuItem_1.default, { icon: (0, jsx_runtime_1.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Linked Accounts", subtitle: `${profiles.length} connected account${profiles.length > 1 ? "s" : ""}`, onClick: () => handleNavigate("linkAccount") }), (0, jsx_runtime_1.jsx)(SettingsMenuItem_1.default, { icon: (0, jsx_runtime_1.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Notifications", subtitle: "Manage your notifications", onClick: () => handleNavigate("notifications") })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-auto px-5 pb-5", children: (0, jsx_runtime_1.jsxs)("button", { className: "b3-modal-sign-out-button border-b3-line hover:bg-b3-line bg-b3-background dark:bg-b3-background dark:border-b3-line dark:hover:bg-b3-line/80 flex w-full items-center justify-center gap-1.5 rounded-xl border border-solid p-3 transition-colors", onClick: onLogoutEnhanced, disabled: logoutLoading, style: {
53
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-[470px] flex-col", children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { showBackButton: false, showCloseButton: false, title: "Settings" }), (0, jsx_runtime_1.jsx)("div", { className: "p-5", children: (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-settings-profile-card dark:border-b3-line dark:bg-b3-background flex items-center rounded-xl border border-[#e4e4e7] bg-[#f4f4f5] p-4", children: (0, jsx_runtime_1.jsx)(SettingsProfileCard_1.default, {}) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 px-5", children: [(0, jsx_runtime_1.jsx)(SettingsMenuItem_1.default, { icon: (0, jsx_runtime_1.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Linked Accounts", subtitle: `${profiles.length} connected account${profiles.length > 1 ? "s" : ""}`, onClick: () => handleNavigate("linkAccount") }), (0, jsx_runtime_1.jsx)(SettingsMenuItem_1.default, { icon: (0, jsx_runtime_1.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Notifications", subtitle: "Manage your notifications", onClick: () => handleNavigate("notifications") }), (0, jsx_runtime_1.jsx)(SettingsMenuItem_1.default, { icon: (0, jsx_runtime_1.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Stay signed in", subtitle: session_duration_1.SESSION_DURATION_LABELS[sessionDays] ?? `${sessionDays} days`, onClick: () => handleNavigate("sessionDuration") })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-auto px-5 pb-5", children: (0, jsx_runtime_1.jsxs)("button", { type: "button", className: "b3-modal-sign-out-button border-b3-line hover:bg-b3-line bg-b3-background dark:bg-b3-background dark:border-b3-line dark:hover:bg-b3-line/80 flex w-full items-center justify-center gap-1.5 rounded-xl border border-solid p-3 transition-colors", onClick: onLogoutEnhanced, disabled: logoutLoading, style: {
71
54
  boxShadow: "inset 0px 0px 0px 1px rgba(10,13,18,0.18), inset 0px -2px 0px 0px rgba(10,13,18,0.05)",
72
55
  }, children: [logoutLoading ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-grey animate-spin", size: 20 })) : ((0, jsx_runtime_1.jsx)(SignOutIcon_1.default, { size: 20, className: "text-b3-grey", color: "currentColor" })), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-grey dark:text-b3-foreground-muted font-neue-montreal-semibold text-base", children: "Sign out" })] }) })] }));
73
56
  };
@@ -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;
@@ -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
  */
@@ -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,8 +1,8 @@
1
1
  import { AuthenticationClient } from "@feathersjs/authentication-client";
2
2
  import Cookies from "js-cookie";
3
3
  import { B3_AUTH_COOKIE_NAME } from "./shared/constants/index.js";
4
+ import { getSessionDurationDays } from "./shared/utils/session-duration.js";
4
5
  export const B3_API_URL = process.env.EXPO_PUBLIC_B3_API || process.env.NEXT_PUBLIC_B3_API || process.env.PUBLIC_B3_API || "https://api.b3.fun";
5
- const DEV_USER_GROUP = 4;
6
6
  export const authenticate = async (app, accessToken, identityToken, params) => {
7
7
  const fullToken = `${accessToken}+${identityToken}`;
8
8
  // Do not authenticate if there is no token
@@ -17,12 +17,14 @@ export const authenticate = async (app, accessToken, identityToken, params) => {
17
17
  }, {
18
18
  query: params || {},
19
19
  });
20
- // Extend cookie expiration to 30 days for dev users
21
- if (response?.user?.userGroups?.includes(DEV_USER_GROUP)) {
22
- const token = Cookies.get(B3_AUTH_COOKIE_NAME);
23
- if (token) {
24
- Cookies.set(B3_AUTH_COOKIE_NAME, token, { expires: 30 });
25
- }
20
+ const token = Cookies.get(B3_AUTH_COOKIE_NAME);
21
+ if (token) {
22
+ const days = getSessionDurationDays(response?.user?.preferences, params?.partnerId);
23
+ Cookies.set(B3_AUTH_COOKIE_NAME, token, {
24
+ ...(days > 0 ? { expires: days } : {}),
25
+ secure: true,
26
+ sameSite: "Lax",
27
+ });
26
28
  }
27
29
  return response;
28
30
  }
@@ -17,6 +17,7 @@ import { LinkAccount } from "./LinkAccount/LinkAccount.js";
17
17
  import { LinkNewAccount } from "./LinkAccount/LinkNewAccount.js";
18
18
  import { ManageAccount } from "./ManageAccount/ManageAccount.js";
19
19
  import NotificationsContent from "./ManageAccount/NotificationsContent.js";
20
+ import SessionDurationContent from "./ManageAccount/SessionDurationContent.js";
20
21
  import { RequestPermissions } from "./RequestPermissions/RequestPermissions.js";
21
22
  import { Send } from "./Send/Send.js";
22
23
  import { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow.js";
@@ -140,6 +141,8 @@ export function B3DynamicModal() {
140
141
  return _jsx(Send, { ...contentType });
141
142
  case "notifications":
142
143
  return _jsx(NotificationsContent, { ...contentType });
144
+ case "sessionDuration":
145
+ return _jsx(SessionDurationContent, { partnerId: contentType.partnerId });
143
146
  // Add other modal types here
144
147
  default:
145
148
  return null;
@@ -0,0 +1,5 @@
1
+ interface SessionDurationContentProps {
2
+ partnerId: string;
3
+ }
4
+ declare const SessionDurationContent: ({ partnerId }: SessionDurationContentProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default SessionDurationContent;
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import app from "../../../../global-account/app.js";
3
+ import { useAuthentication, useModalStore } from "../../../../global-account/react/index.js";
4
+ import { getSessionDurationDays, SESSION_DURATION_LABELS, SESSION_DURATION_OPTIONS, setSessionDurationDays, } from "../../../../shared/utils/session-duration.js";
5
+ import { useState } from "react";
6
+ import ModalHeader from "../ModalHeader/ModalHeader.js";
7
+ const DESCRIPTIONS = {
8
+ 0: "Sign out when browser closes",
9
+ 1: "Stay signed in for 1 day",
10
+ 7: "Stay signed in for 7 days",
11
+ 14: "Stay signed in for 2 weeks",
12
+ 30: "Stay signed in for 30 days",
13
+ };
14
+ const SessionDurationContent = ({ partnerId }) => {
15
+ const { user, setUser } = useAuthentication(partnerId);
16
+ const navigateBack = useModalStore(state => state.navigateBack);
17
+ const [sessionDays, setSessionDays] = useState(() => getSessionDurationDays(user?.preferences, partnerId));
18
+ const [saving, setSaving] = useState(false);
19
+ const handleSelect = async (days) => {
20
+ const previous = sessionDays;
21
+ setSessionDurationDays(days, partnerId);
22
+ setSessionDays(days);
23
+ if (user?.userId) {
24
+ setSaving(true);
25
+ try {
26
+ const updated = await app.service("users").patch(user.userId, {
27
+ preferences: {
28
+ ...user.preferences,
29
+ [partnerId]: {
30
+ ...((user.preferences ?? {})[partnerId] ?? {}),
31
+ sessionDuration: days,
32
+ },
33
+ },
34
+ });
35
+ setUser(updated);
36
+ }
37
+ catch (error) {
38
+ console.error("Failed to save session duration preference:", error);
39
+ // Revert optimistic update so UI stays consistent with server state
40
+ setSessionDays(previous);
41
+ setSessionDurationDays(previous, partnerId);
42
+ }
43
+ finally {
44
+ setSaving(false);
45
+ }
46
+ }
47
+ };
48
+ return (_jsxs("div", { className: "flex h-[470px] flex-col", children: [_jsx(ModalHeader, { showBackButton: true, showCloseButton: false, title: "Stay signed in", handleBack: navigateBack }), _jsx("div", { className: "flex flex-col gap-2 p-5", children: SESSION_DURATION_OPTIONS.map(days => (_jsxs("button", { type: "button", onClick: () => handleSelect(days), disabled: saving, className: `flex items-center justify-between rounded-xl border px-4 py-3 transition-colors ${sessionDays === days
49
+ ? "border-[#3f3f46] bg-[#f4f4f5] dark:border-white dark:bg-white/10"
50
+ : "border-[#e4e4e7] bg-transparent hover:bg-[#f4f4f5] dark:border-white/10 dark:hover:bg-white/5"}`, children: [_jsxs("div", { className: "flex flex-col items-start gap-0.5", children: [_jsx("span", { className: "font-neue-montreal-semibold text-[14px] leading-none tracking-[-0.28px] text-[#3f3f46] dark:text-white", children: SESSION_DURATION_LABELS[days] }), _jsx("span", { className: "font-neue-montreal-medium text-[13px] leading-none tracking-[-0.26px] text-[#70707b] dark:text-white/50", children: DESCRIPTIONS[days] })] }), sessionDays === days && (_jsx("div", { className: "flex size-5 items-center justify-center rounded-full bg-[#3f3f46] dark:bg-white", children: _jsx("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", children: _jsx("path", { d: "M1 4L3.5 6.5L9 1", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "dark:stroke-[#3f3f46]" }) }) }))] }, days))) })] }));
51
+ };
52
+ export default SessionDurationContent;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useAuthentication, useModalStore } from "../../../../global-account/react/index.js";
3
3
  import { client } from "../../../../shared/utils/thirdweb.js";
4
+ import { getSessionDurationDays, SESSION_DURATION_LABELS } from "../../../../shared/utils/session-duration.js";
4
5
  import { Loader2 } from "lucide-react";
5
6
  import { useState } from "react";
6
7
  import { useProfiles } from "thirdweb/react";
@@ -11,47 +12,29 @@ import SettingsProfileCard from "./SettingsProfileCard.js";
11
12
  const SettingsContent = ({ partnerId, onLogout, chain, }) => {
12
13
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
13
14
  const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
14
- const { logout } = useAuthentication(partnerId);
15
+ const { logout, user } = useAuthentication(partnerId);
15
16
  const [logoutLoading, setLogoutLoading] = useState(false);
17
+ const sessionDays = getSessionDurationDays(user?.preferences, partnerId);
16
18
  const { data: profilesRaw = [] } = useProfiles({ client });
17
19
  const profiles = profilesRaw.filter((profile) => !["custom_auth_endpoint"].includes(profile.type));
18
20
  const handleNavigate = (type) => {
19
21
  if (type === "home") {
20
- setB3ModalContentType({
21
- type: "manageAccount",
22
- chain,
23
- partnerId,
24
- onLogout,
25
- activeTab: "home",
26
- });
22
+ setB3ModalContentType({ type: "manageAccount", chain, partnerId, onLogout, activeTab: "home" });
27
23
  }
28
24
  else if (type === "swap") {
29
- setB3ModalContentType({
30
- type: "manageAccount",
31
- chain,
32
- partnerId,
33
- onLogout,
34
- activeTab: "tokens",
35
- });
25
+ setB3ModalContentType({ type: "manageAccount", chain, partnerId, onLogout, activeTab: "tokens" });
36
26
  }
37
27
  else if (type === "linkAccount") {
38
- setB3ModalContentType({
39
- type: "linkAccount",
40
- chain,
41
- partnerId,
42
- });
28
+ setB3ModalContentType({ type: "linkAccount", chain, partnerId });
43
29
  }
44
30
  else if (type === "notifications") {
45
- setB3ModalContentType({
46
- type: "notifications",
47
- chain,
48
- partnerId,
49
- });
31
+ setB3ModalContentType({ type: "notifications", chain, partnerId });
32
+ }
33
+ else if (type === "sessionDuration") {
34
+ setB3ModalContentType({ type: "sessionDuration", chain, partnerId });
50
35
  }
51
36
  else {
52
- setB3ModalContentType({
53
- type: "avatarEditor",
54
- });
37
+ setB3ModalContentType({ type: "avatarEditor" });
55
38
  }
56
39
  setB3ModalOpen(true);
57
40
  };
@@ -62,7 +45,7 @@ const SettingsContent = ({ partnerId, onLogout, chain, }) => {
62
45
  setB3ModalOpen(false);
63
46
  setLogoutLoading(false);
64
47
  };
65
- return (_jsxs("div", { className: "flex h-[470px] flex-col", children: [_jsx(ModalHeader, { showBackButton: false, showCloseButton: false, title: "Settings" }), _jsx("div", { className: "p-5", children: _jsx("div", { className: "b3-modal-settings-profile-card dark:border-b3-line dark:bg-b3-background flex items-center rounded-xl border border-[#e4e4e7] bg-[#f4f4f5] p-4", children: _jsx(SettingsProfileCard, {}) }) }), _jsxs("div", { className: "space-y-3 px-5", children: [_jsx(SettingsMenuItem, { icon: _jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Linked Accounts", subtitle: `${profiles.length} connected account${profiles.length > 1 ? "s" : ""}`, onClick: () => handleNavigate("linkAccount") }), _jsx(SettingsMenuItem, { icon: _jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Notifications", subtitle: "Manage your notifications", onClick: () => handleNavigate("notifications") })] }), _jsx("div", { className: "mt-auto px-5 pb-5", children: _jsxs("button", { className: "b3-modal-sign-out-button border-b3-line hover:bg-b3-line bg-b3-background dark:bg-b3-background dark:border-b3-line dark:hover:bg-b3-line/80 flex w-full items-center justify-center gap-1.5 rounded-xl border border-solid p-3 transition-colors", onClick: onLogoutEnhanced, disabled: logoutLoading, style: {
48
+ return (_jsxs("div", { className: "flex h-[470px] flex-col", children: [_jsx(ModalHeader, { showBackButton: false, showCloseButton: false, title: "Settings" }), _jsx("div", { className: "p-5", children: _jsx("div", { className: "b3-modal-settings-profile-card dark:border-b3-line dark:bg-b3-background flex items-center rounded-xl border border-[#e4e4e7] bg-[#f4f4f5] p-4", children: _jsx(SettingsProfileCard, {}) }) }), _jsxs("div", { className: "space-y-3 px-5", children: [_jsx(SettingsMenuItem, { icon: _jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Linked Accounts", subtitle: `${profiles.length} connected account${profiles.length > 1 ? "s" : ""}`, onClick: () => handleNavigate("linkAccount") }), _jsx(SettingsMenuItem, { icon: _jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Notifications", subtitle: "Manage your notifications", onClick: () => handleNavigate("notifications") }), _jsx(SettingsMenuItem, { icon: _jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z", fill: "#F4F4F5" }) }), title: "Stay signed in", subtitle: SESSION_DURATION_LABELS[sessionDays] ?? `${sessionDays} days`, onClick: () => handleNavigate("sessionDuration") })] }), _jsx("div", { className: "mt-auto px-5 pb-5", children: _jsxs("button", { type: "button", className: "b3-modal-sign-out-button border-b3-line hover:bg-b3-line bg-b3-background dark:bg-b3-background dark:border-b3-line dark:hover:bg-b3-line/80 flex w-full items-center justify-center gap-1.5 rounded-xl border border-solid p-3 transition-colors", onClick: onLogoutEnhanced, disabled: logoutLoading, style: {
66
49
  boxShadow: "inset 0px 0px 0px 1px rgba(10,13,18,0.18), inset 0px -2px 0px 0px rgba(10,13,18,0.05)",
67
50
  }, children: [logoutLoading ? (_jsx(Loader2, { className: "text-b3-grey animate-spin", size: 20 })) : (_jsx(SignOutIcon, { size: 20, className: "text-b3-grey", color: "currentColor" })), _jsx("p", { className: "text-b3-grey dark:text-b3-foreground-muted font-neue-montreal-semibold text-base", children: "Sign out" })] }) })] }));
68
51
  };
@@ -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;
@@ -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
  */