@coinbase/cdp-react 0.0.86 → 0.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/assets/CDPReactProvider.css +1 -1
  2. package/dist/assets/EnrollMfaFlow.css +1 -1
  3. package/dist/assets/VerifyMfaFlow.css +1 -1
  4. package/dist/assets/VerifyMfaFlowBackButton.css +1 -0
  5. package/dist/assets/VerifyMfaInline.css +1 -1
  6. package/dist/assets/VerifyMfaItem.css +1 -0
  7. package/dist/assets/VerifyMfaItems.css +1 -0
  8. package/dist/assets/sms.css +1 -0
  9. package/dist/chunks/CDPReactProvider.BkmtXUv1.js +337 -0
  10. package/dist/chunks/{LinkAuthFlow.BaUSMzGH.js → LinkAuthFlow.B4FAtf4V.js} +13 -13
  11. package/dist/chunks/index.BX4k-ruQ.js +12 -0
  12. package/dist/chunks/index.Bgx0-QLY.js +12 -0
  13. package/dist/chunks/{index.C_DV0Ud7.js → index.DgrgIsTX.js} +1 -1
  14. package/dist/chunks/useSendComponentCallOnce.DGjALrnZ.js +278 -0
  15. package/dist/components/AuthButton/index.js +1 -1
  16. package/dist/components/CDPReactProvider/index.js +1 -1
  17. package/dist/components/CopyEvmKeyButton/index.js +1 -1
  18. package/dist/components/CopySolanaKeyButton/index.js +1 -1
  19. package/dist/components/EnrollMfa/EnrollMfaDescription.js +4 -3
  20. package/dist/components/EnrollMfa/EnrollMfaFlow.js +27 -26
  21. package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.js +7 -6
  22. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +1 -1
  23. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.js +5 -4
  24. package/dist/components/EnrollMfa/EnrollMfaImage.js +7 -6
  25. package/dist/components/EnrollMfa/EnrollMfaItem.js +7 -6
  26. package/dist/components/EnrollMfa/EnrollMfaItems.js +28 -25
  27. package/dist/components/EnrollMfa/EnrollMfaProvider.js +22 -17
  28. package/dist/components/EnrollMfa/EnrollMfaTitle.js +8 -7
  29. package/dist/components/EnrollMfa/index.js +134 -128
  30. package/dist/components/EnrollMfa/methods/sms.d.ts +6 -0
  31. package/dist/components/EnrollMfa/methods/sms.js +148 -0
  32. package/dist/components/EnrollMfa/methods/totp.js +24 -19
  33. package/dist/components/EnrollMfa/types.d.ts +17 -5
  34. package/dist/components/EnrollMfa/types.js +1 -0
  35. package/dist/components/EnrollMfa/useEnrollMfaReducer.js +51 -38
  36. package/dist/components/EnrollMfaModal/index.js +2 -2
  37. package/dist/components/ExportWallet/index.js +109 -101
  38. package/dist/components/ExportWalletModal/index.js +2 -2
  39. package/dist/components/Fund/index.js +2 -2
  40. package/dist/components/FundModal/index.js +2 -2
  41. package/dist/components/LinkAuth/LinkAuthFlow.js +2 -2
  42. package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +2 -2
  43. package/dist/components/LinkAuth/LinkAuthFlowProvider.js +2 -2
  44. package/dist/components/LinkAuth/LinkAuthItem.js +1 -1
  45. package/dist/components/LinkAuth/LinkAuthItems.js +1 -1
  46. package/dist/components/LinkAuth/LinkAuthProvider.js +1 -1
  47. package/dist/components/LinkAuth/index.js +4 -4
  48. package/dist/components/LinkAuth/types.js +1 -1
  49. package/dist/components/LinkAuth/utils.js +1 -1
  50. package/dist/components/LinkAuthModal/index.js +3 -3
  51. package/dist/components/OAuthStatusModal/index.js +2 -2
  52. package/dist/components/SendEvmTransactionButton/index.js +1 -1
  53. package/dist/components/SendSolanaTransactionButton/index.js +1 -1
  54. package/dist/components/SignIn/SignInAuthMethodButtons.js +1 -1
  55. package/dist/components/SignIn/SignInBackButton.js +12 -12
  56. package/dist/components/SignIn/SignInDescription.js +2 -2
  57. package/dist/components/SignIn/SignInForm.js +2 -2
  58. package/dist/components/SignIn/SignInImage.js +1 -1
  59. package/dist/components/SignIn/SignInProvider.js +1 -1
  60. package/dist/components/SignIn/SignInTitle.js +2 -2
  61. package/dist/components/SignIn/flows/SignInWithEmail.js +1 -1
  62. package/dist/components/SignIn/flows/SignInWithOAuth.js +1 -1
  63. package/dist/components/SignIn/flows/SignInWithSms.js +74 -84
  64. package/dist/components/SignIn/index.js +2 -2
  65. package/dist/components/SignIn/types.d.ts +2 -0
  66. package/dist/components/SignIn/types.js +1 -1
  67. package/dist/components/SignIn/useSignInReducer.js +20 -6
  68. package/dist/components/SignInModal/index.js +2 -2
  69. package/dist/components/SignOutButton/index.js +1 -1
  70. package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +1 -1
  71. package/dist/components/VerifyMfa/VerifyMfaDescription.js +24 -14
  72. package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +5 -4
  73. package/dist/components/VerifyMfa/VerifyMfaFlow.js +52 -13
  74. package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.d.ts +9 -0
  75. package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.js +40 -0
  76. package/dist/components/VerifyMfa/VerifyMfaFlowProvider.d.ts +23 -0
  77. package/dist/components/VerifyMfa/VerifyMfaFlowProvider.js +37 -0
  78. package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +1 -1
  79. package/dist/components/VerifyMfa/VerifyMfaImage.js +25 -13
  80. package/dist/components/VerifyMfa/VerifyMfaItem.d.ts +10 -0
  81. package/dist/components/VerifyMfa/VerifyMfaItem.js +27 -0
  82. package/dist/components/VerifyMfa/VerifyMfaItems.d.ts +9 -0
  83. package/dist/components/VerifyMfa/VerifyMfaItems.js +31 -0
  84. package/dist/components/VerifyMfa/VerifyMfaProvider.js +27 -14
  85. package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +1 -1
  86. package/dist/components/VerifyMfa/VerifyMfaTitle.js +23 -13
  87. package/dist/components/VerifyMfa/index.d.ts +6 -2
  88. package/dist/components/VerifyMfa/index.js +24 -15
  89. package/dist/components/VerifyMfa/methods/sms.d.ts +6 -0
  90. package/dist/components/VerifyMfa/methods/sms.js +90 -0
  91. package/dist/components/VerifyMfa/methods/totp.js +40 -39
  92. package/dist/components/VerifyMfa/types.d.ts +21 -2
  93. package/dist/components/VerifyMfa/types.js +1 -0
  94. package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +2 -1
  95. package/dist/components/VerifyMfa/useVerifyMfaReducer.js +29 -4
  96. package/dist/components/VerifyMfaInline/index.d.ts +1 -1
  97. package/dist/components/VerifyMfaInline/index.js +133 -116
  98. package/dist/components/VerifyMfaModal/index.js +8 -6
  99. package/dist/components/ui/SwitchTransition/index.js +3 -3
  100. package/dist/hooks/usePhoneNumberState.d.ts +15 -0
  101. package/dist/hooks/usePhoneNumberState.js +39 -0
  102. package/dist/hooks/useTransitionMap.js +24 -22
  103. package/dist/hooks/useVerifyMfaModal.js +2 -2
  104. package/dist/index.js +60 -52
  105. package/dist/utils/transition.d.ts +3 -3
  106. package/dist/utils/transition.js +21 -20
  107. package/dist/version.d.ts +1 -1
  108. package/dist/version.js +1 -1
  109. package/package.json +6 -6
  110. package/dist/chunks/CDPReactProvider.CIQm4C4z.js +0 -299
  111. package/dist/chunks/index.CKQKBoX2.js +0 -9
  112. package/dist/chunks/index.Dp-lIxM1.js +0 -9
  113. package/dist/chunks/useSendComponentCallOnce.BHZMuo6E.js +0 -273
@@ -1,6 +1,7 @@
1
+ import { InitiateMfaEnrollmentResult, InitiateMfaOptions } from '@coinbase/cdp-core';
1
2
  import { APIError } from '@coinbase/cdp-hooks';
2
3
  import { FC, FormEvent, ReactNode } from 'react';
3
- export type MfaMethod = "totp";
4
+ export type MfaMethod = InitiateMfaOptions["mfaMethod"];
4
5
  export type EnrollMfaStep = "list" | "setup" | "setup-verification";
5
6
  export type EnrollMfaMethodStep = Exclude<EnrollMfaStep, "list">;
6
7
  export interface EnrollMfaMethodComponentProps {
@@ -15,6 +16,7 @@ export interface EnrollMfaState {
15
16
  mfaCode: string;
16
17
  authUrl: string | null;
17
18
  secret: string | null;
19
+ phoneNumber: string;
18
20
  initiatedAt: number | null;
19
21
  isExpired: boolean;
20
22
  error: string | APIError | null;
@@ -26,12 +28,18 @@ export type EnrollMfaAction = {
26
28
  payload: {
27
29
  step: EnrollMfaStep;
28
30
  flowDirection?: "left" | "right";
31
+ method?: MfaMethod;
29
32
  };
30
33
  } | {
31
34
  type: "SET_MFA_CODE";
32
35
  payload: {
33
36
  mfaCode: string;
34
37
  };
38
+ } | {
39
+ type: "SET_PHONE_NUMBER";
40
+ payload: {
41
+ phoneNumber: string;
42
+ };
35
43
  } | {
36
44
  type: "INITIATE_ENROLLMENT";
37
45
  payload: {
@@ -39,10 +47,7 @@ export type EnrollMfaAction = {
39
47
  };
40
48
  } | {
41
49
  type: "INITIATE_ENROLLMENT_SUCCESS";
42
- payload: {
43
- authUrl: string;
44
- secret: string;
45
- };
50
+ payload: InitiateMfaEnrollmentResult;
46
51
  } | {
47
52
  type: "INITIATE_ENROLLMENT_FAILURE";
48
53
  payload: {
@@ -59,6 +64,11 @@ export type EnrollMfaAction = {
59
64
  payload: {
60
65
  error: string | APIError;
61
66
  };
67
+ } | {
68
+ type: "SET_METHODS";
69
+ payload: {
70
+ methods: MfaMethod[];
71
+ };
62
72
  } | {
63
73
  type: "CLEAR_ERROR";
64
74
  } | {
@@ -78,6 +88,8 @@ export interface EnrollMfaMethodContentProps {
78
88
  export interface EnrollMfaMethodConfig {
79
89
  content: FC<EnrollMfaMethodContentProps>;
80
90
  description: FC<EnrollMfaMethodComponentProps>;
91
+ getInitiateOptions: (state: EnrollMfaState) => InitiateMfaOptions;
81
92
  image: FC<EnrollMfaMethodComponentProps>;
93
+ requiresInput?: boolean;
82
94
  title: FC<EnrollMfaMethodComponentProps>;
83
95
  }
@@ -1,2 +1,3 @@
1
+ import "@coinbase/cdp-core";
1
2
  import "@coinbase/cdp-hooks";
2
3
  import "react";
@@ -1,111 +1,124 @@
1
- import { useReducer as n } from "react";
1
+ import { useReducer as d } from "react";
2
2
  import "@coinbase/cdp-hooks";
3
- import { isApiError as t } from "../../utils/isApiError.js";
3
+ import { isApiError as i } from "../../utils/isApiError.js";
4
4
  import "libphonenumber-js";
5
- const l = ["list", "setup", "setup-verification"], i = (r) => ({
6
- method: r[0] || "totp",
7
- methods: r,
5
+ import "@coinbase/cdp-core";
6
+ const l = ["list", "setup", "setup-verification"], s = (e) => ({
7
+ method: e[0] || "totp",
8
+ methods: e,
8
9
  step: "list",
9
10
  flowDirection: "left",
10
11
  mfaCode: "",
11
12
  authUrl: null,
12
13
  secret: null,
14
+ phoneNumber: "",
13
15
  initiatedAt: null,
14
16
  isExpired: !1,
15
17
  error: null,
16
18
  isPending: !1,
17
19
  isSuccess: !1
18
- }), u = (r, e) => {
19
- switch (e.type) {
20
+ }), u = (e, r) => {
21
+ switch (r.type) {
20
22
  case "SET_STEP":
21
23
  return {
22
- ...r,
23
- step: e.payload.step,
24
- flowDirection: e.payload.flowDirection || r.flowDirection,
24
+ ...e,
25
+ step: r.payload.step,
26
+ flowDirection: r.payload.flowDirection || e.flowDirection,
27
+ method: r.payload.method || e.method,
25
28
  error: null
26
29
  };
27
30
  case "SET_MFA_CODE":
28
31
  return {
29
- ...r,
30
- mfaCode: e.payload.mfaCode,
32
+ ...e,
33
+ mfaCode: r.payload.mfaCode,
34
+ error: null
35
+ };
36
+ case "SET_PHONE_NUMBER":
37
+ return {
38
+ ...e,
39
+ phoneNumber: r.payload.phoneNumber,
31
40
  error: null
32
41
  };
33
42
  case "INITIATE_ENROLLMENT":
34
43
  return {
35
- ...r,
36
- method: e.payload.method,
44
+ ...e,
45
+ method: r.payload.method,
37
46
  isPending: !0,
38
47
  error: null,
39
48
  flowDirection: "left"
40
49
  };
41
- case "INITIATE_ENROLLMENT_SUCCESS":
50
+ case "INITIATE_ENROLLMENT_SUCCESS": {
51
+ const o = l.indexOf(e.step), n = o < l.length - 1 ? l[o + 1] : e.step;
42
52
  return {
43
- ...r,
53
+ ...e,
44
54
  isPending: !1,
45
- authUrl: e.payload.authUrl,
46
- secret: e.payload.secret,
55
+ authUrl: "authUrl" in r.payload ? r.payload.authUrl : null,
56
+ secret: "secret" in r.payload ? r.payload.secret : null,
47
57
  initiatedAt: Date.now(),
48
58
  isExpired: !1,
49
- step: "setup"
59
+ step: n
50
60
  };
61
+ }
51
62
  case "INITIATE_ENROLLMENT_FAILURE":
52
63
  return {
53
- ...r,
64
+ ...e,
54
65
  isPending: !1,
55
- error: e.payload.error,
56
- step: "list",
57
- flowDirection: "right"
66
+ error: r.payload.error
58
67
  };
59
68
  case "ENROLLMENT_SESSION_EXPIRED":
60
69
  return {
61
- ...r,
70
+ ...e,
62
71
  mfaCode: "",
63
72
  isExpired: !0
64
73
  };
65
74
  case "SUBMIT_ENROLLMENT":
66
75
  return {
67
- ...r,
76
+ ...e,
68
77
  isPending: !0,
69
78
  error: null,
70
79
  flowDirection: "left"
71
80
  };
72
81
  case "SUBMIT_ENROLLMENT_SUCCESS":
73
82
  return {
74
- ...r,
83
+ ...e,
75
84
  isPending: !1,
76
85
  isSuccess: !0
77
86
  };
78
87
  case "SUBMIT_ENROLLMENT_FAILURE":
79
88
  return {
80
- ...r,
89
+ ...e,
81
90
  isPending: !1,
82
- error: e.payload.error,
83
- isExpired: t(e.payload.error) ? e.payload.error.errorType === "mfa_flow_expired" : e.payload.error.toLowerCase().startsWith("mfa flow not found or expired")
91
+ error: r.payload.error,
92
+ isExpired: i(r.payload.error) ? r.payload.error.errorType === "mfa_flow_expired" : r.payload.error.toLowerCase().startsWith("mfa flow not found or expired")
93
+ };
94
+ case "SET_METHODS":
95
+ return {
96
+ ...e,
97
+ methods: r.payload.methods
84
98
  };
85
99
  case "CLEAR_ERROR":
86
100
  return {
87
- ...r,
101
+ ...e,
88
102
  error: null
89
103
  };
90
104
  case "GO_TO_PREVIOUS_STEP": {
91
- const o = l.indexOf(r.step), s = o > 0 ? l[o - 1] : r.step;
105
+ const o = l.indexOf(e.step), n = o > 0 ? l[o - 1] : e.step;
92
106
  return {
93
- ...r,
107
+ ...e,
94
108
  flowDirection: "right",
95
- step: s,
109
+ step: n,
96
110
  error: null,
97
111
  isExpired: !1,
98
112
  mfaCode: ""
99
- // Clear MFA code when going back
100
113
  };
101
114
  }
102
115
  case "RESET_STATE":
103
- return i(r.methods);
116
+ return s(e.methods);
104
117
  default:
105
- return r;
118
+ return e;
106
119
  }
107
- }, f = (r = ["totp"]) => n(u, r, i);
120
+ }, S = (e = ["totp"]) => d(u, e, s);
108
121
  export {
109
122
  l as STEPS,
110
- f as useEnrollMfaReducer
123
+ S as useEnrollMfaReducer
111
124
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as o, jsxs as r, Fragment as s } from "react/jsx-runtime";
2
- import { u as v } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
2
+ import { u as v } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
3
3
  import { createContext as b, useMemo as w, useContext as y } from "react";
4
4
  import { c as p } from "../../chunks/lite.1fxw3LjI.js";
5
- import { u as F } from "../../chunks/CDPReactProvider.CIQm4C4z.js";
5
+ import { u as F } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
6
6
  import { EnrollMfa as T, EnrollMfaError as B } from "../EnrollMfa/index.js";
7
7
  import { Button as h } from "../ui/Button/index.js";
8
8
  import { Modal as A, ModalContent as O, ModalTitle as S, ModalDescription as $, ModalClose as E, ModalTrigger as D } from "../ui/Modal/index.js";
@@ -1,22 +1,22 @@
1
- import { u as S, A as z } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
2
- import { createContext as A, useContext as k, useMemo as h, useState as D, useCallback as L } from "react";
3
- import { VERSION as U } from "../../version.js";
1
+ import { u as S, A as D } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
2
+ import { createContext as A, useContext as k, useMemo as h, useState as L, useCallback as U } from "react";
3
+ import { VERSION as q } from "../../version.js";
4
4
  import "../AuthButton/index.js";
5
- import { u as b } from "../../chunks/CDPReactProvider.CIQm4C4z.js";
6
- import { CopyAddress as q } from "../CopyAddress/index.js";
7
- import { CopyEvmKeyButton as H } from "../CopyEvmKeyButton/index.js";
8
- import { CopySolanaKeyButton as J } from "../CopySolanaKeyButton/index.js";
5
+ import { u as b } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
6
+ import { CopyAddress as H } from "../CopyAddress/index.js";
7
+ import { CopyEvmKeyButton as J } from "../CopyEvmKeyButton/index.js";
8
+ import { CopySolanaKeyButton as X } from "../CopySolanaKeyButton/index.js";
9
9
  import "../EnrollMfa/index.js";
10
10
  import "../EnrollMfaModal/index.js";
11
- import { jsx as t, jsxs as _, Fragment as y } from "react/jsx-runtime";
12
- import { useCurrentUser as X } from "@coinbase/cdp-hooks";
11
+ import { jsx as t, jsxs as d, Fragment as y } from "react/jsx-runtime";
12
+ import { useCurrentUser as Z } from "@coinbase/cdp-hooks";
13
13
  import { c as m } from "../../chunks/lite.1fxw3LjI.js";
14
14
  import { Banner as w } from "../ui/Banner/index.js";
15
15
  import { CoinbaseFooter as C } from "../ui/CoinbaseFooter/index.js";
16
- import { VerifyMfaInline as F, VerifyMfaInlineFlow as I, useVerifyMfaInlineContext as Z } from "../VerifyMfaInline/index.js";
17
- import { Button as R } from "../ui/Button/index.js";
18
- import { Modal as $, ModalClose as G, ModalContent as Q, ModalTitle as tt, ModalTrigger as ot } from "../ui/Modal/index.js";
19
- import { IconXMark as et } from "../../icons/IconXMark.js";
16
+ import { VerifyMfaInline as F, VerifyMfaInlineBackButton as I, VerifyMfaInlineFlow as R, useVerifyMfaInlineContext as $ } from "../VerifyMfaInline/index.js";
17
+ import { Button as T } from "../ui/Button/index.js";
18
+ import { Modal as G, ModalClose as Q, ModalContent as tt, ModalTitle as ot, ModalTrigger as et } from "../ui/Modal/index.js";
19
+ import { IconXMark as rt } from "../../icons/IconXMark.js";
20
20
  import { childrenHasComponent as g } from "../../utils/childrenHasComponent.js";
21
21
  import "../Fund/index.js";
22
22
  import "../FundModal/index.js";
@@ -71,7 +71,7 @@ import "../EnrollMfa/EnrollMfaFlowProvider.js";
71
71
  import "../Fund/FundForm.js";
72
72
  import "../Fund/FundTitle.js";
73
73
  import "../Fund/FundProvider.js";
74
- import "../../chunks/LinkAuthFlow.BaUSMzGH.js";
74
+ import "../../chunks/LinkAuthFlow.B4FAtf4V.js";
75
75
  import "../LinkAuth/LinkAuthFlowBackButton.js";
76
76
  import "../LinkAuth/LinkAuthItem.js";
77
77
  import "../LinkAuth/LinkAuthItems.js";
@@ -86,27 +86,31 @@ import "../SignIn/SignInImage.js";
86
86
  import "../SignIn/SignInTitle.js";
87
87
  import "../SignIn/SignInProvider.js";
88
88
  import "../VerifyMfa/VerifyMfaDescription.js";
89
- import "../VerifyMfa/VerifyMfaFooter.js";
90
89
  import "../VerifyMfa/VerifyMfaFlow.js";
90
+ import "../VerifyMfa/VerifyMfaFlowBackButton.js";
91
+ import "../VerifyMfa/VerifyMfaFooter.js";
91
92
  import "../VerifyMfa/VerifyMfaImage.js";
93
+ import "../VerifyMfa/VerifyMfaItem.js";
94
+ import "../VerifyMfa/VerifyMfaItems.js";
92
95
  import "../VerifyMfa/VerifyMfaTitle.js";
93
96
  import "../VerifyMfa/VerifyMfaProvider.js";
94
- import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer___NvrFY", E = {
97
+ import "../VerifyMfa/VerifyMfaFlowProvider.js";
98
+ import '../../assets/ExportWallet.css';const at = "ExportWallet-module__footer___NvrFY", E = {
95
99
  "export-wallet": "ExportWallet-module__export-wallet___EyZys",
96
100
  "no-footer": "ExportWallet-module__no-footer___fzl3R",
97
101
  "flex-container": "ExportWallet-module__flex-container___-vm5t",
98
102
  "export-wallet-title": "ExportWallet-module__export-wallet-title___MuI09",
99
- footer: rt
100
- }, T = A({
103
+ footer: at
104
+ }, P = A({
101
105
  address: "",
102
106
  isSessionExpired: !1,
103
107
  type: "evm-eoa"
104
108
  }), W = () => {
105
- const o = k(T);
109
+ const o = k(P);
106
110
  if (!o)
107
111
  throw new Error("useExportWalletContext must be used within a ExportWalletProvider");
108
112
  return o;
109
- }, at = ({
113
+ }, lt = ({
110
114
  address: o,
111
115
  children: e,
112
116
  onIframeError: r,
@@ -114,19 +118,19 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
114
118
  onIframeSessionExpired: n,
115
119
  onCopySuccess: s
116
120
  }) => {
117
- const { currentUser: i } = X(), c = h(
118
- () => !!i?.solanaAccountObjects?.find((v) => v.address === o),
121
+ const { currentUser: i } = Z(), c = h(
122
+ () => !!i?.solanaAccountObjects?.find((M) => M.address === o),
119
123
  [i?.solanaAccountObjects, o]
120
- ), d = h(
121
- () => !!i?.evmSmartAccountObjects?.find((v) => v.address === o),
124
+ ), u = h(
125
+ () => !!i?.evmSmartAccountObjects?.find((M) => M.address === o),
122
126
  [i?.evmSmartAccountObjects, o]
123
- ), u = c ? "solana" : d ? "evm-smart" : "evm-eoa", [p, x] = D(!1), f = L(() => {
127
+ ), _ = c ? "solana" : u ? "evm-smart" : "evm-eoa", [p, x] = L(!1), f = U(() => {
124
128
  x(!0), n?.();
125
- }, [n]), Y = h(
129
+ }, [n]), z = h(
126
130
  () => ({
127
131
  address: o,
128
132
  isSessionExpired: p,
129
- type: u,
133
+ type: _,
130
134
  onIframeError: r,
131
135
  onIframeReady: a,
132
136
  onIframeSessionExpired: f,
@@ -135,15 +139,15 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
135
139
  [
136
140
  o,
137
141
  p,
138
- u,
142
+ _,
139
143
  f,
140
144
  r,
141
145
  a,
142
146
  s
143
147
  ]
144
148
  );
145
- return /* @__PURE__ */ t(T.Provider, { value: Y, children: e });
146
- }, lt = ({
149
+ return /* @__PURE__ */ t(P.Provider, { value: z, children: e });
150
+ }, nt = ({
147
151
  children: o,
148
152
  className: e = "",
149
153
  as: r = "h2",
@@ -156,7 +160,7 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
156
160
  ...a,
157
161
  children: o || "Export your wallet"
158
162
  }
159
- ), P = (o) => {
163
+ ), V = (o) => {
160
164
  const { isSessionExpired: e, type: r } = W();
161
165
  return e ? /* @__PURE__ */ t(w, { "data-part": "warning", variant: "warning", ...o, children: "Your export session has expired." }) : r === "evm-smart" ? /* @__PURE__ */ t(w, { "data-part": "warning", variant: "warning", ...o, children: "Cannot export a smart account's private key; only the owner's private key can be exported." }) : /* @__PURE__ */ t(w, { "data-part": "warning", variant: "warning", ...o, children: "Do not share your private key with anyone" });
162
166
  }, j = ({
@@ -164,14 +168,14 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
164
168
  ...e
165
169
  }) => {
166
170
  const { address: r } = W();
167
- return /* @__PURE__ */ t(q, { "data-part": "copy-address", address: r, label: o, ...e });
168
- }, O = ({
171
+ return /* @__PURE__ */ t(H, { "data-part": "copy-address", address: r, label: o, ...e });
172
+ }, B = ({
169
173
  fullWidth: o = !0,
170
174
  ...e
171
175
  }) => {
172
176
  const { address: r, type: a, onIframeError: n, onIframeReady: s, onIframeSessionExpired: i, onCopySuccess: c } = W();
173
177
  return a === "solana" ? /* @__PURE__ */ t(
174
- J,
178
+ X,
175
179
  {
176
180
  fullWidth: o,
177
181
  address: r,
@@ -182,7 +186,7 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
182
186
  ...e
183
187
  }
184
188
  ) : a === "evm-eoa" ? /* @__PURE__ */ t(
185
- H,
189
+ J,
186
190
  {
187
191
  fullWidth: o,
188
192
  address: r,
@@ -193,16 +197,16 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
193
197
  ...e
194
198
  }
195
199
  ) : null;
196
- }, nt = (o) => /* @__PURE__ */ t(C, { "data-part": "coinbase-footer", ...o }), it = ({ children: o }) => {
200
+ }, it = (o) => /* @__PURE__ */ t(C, { "data-part": "coinbase-footer", ...o }), st = ({ children: o }) => {
197
201
  const { showCoinbaseFooter: e } = b(), { type: r, isSessionExpired: a } = W();
198
- return o && typeof o == "function" ? o({ type: r, isSessionExpired: a }) : o || /* @__PURE__ */ _(y, { children: [
199
- /* @__PURE__ */ t(lt, {}),
200
- /* @__PURE__ */ t(P, {}),
202
+ return o && typeof o == "function" ? o({ type: r, isSessionExpired: a }) : o || /* @__PURE__ */ d(y, { children: [
203
+ /* @__PURE__ */ t(nt, {}),
204
+ /* @__PURE__ */ t(V, {}),
201
205
  /* @__PURE__ */ t(j, {}),
202
- /* @__PURE__ */ t(O, {}),
203
- e && /* @__PURE__ */ t(nt, { className: E.footer })
206
+ /* @__PURE__ */ t(B, {}),
207
+ e && /* @__PURE__ */ t(it, { className: E.footer })
204
208
  ] });
205
- }, st = ({
209
+ }, pt = ({
206
210
  address: o,
207
211
  children: e,
208
212
  className: r = "",
@@ -211,18 +215,18 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
211
215
  onIframeSessionExpired: s,
212
216
  onCopySuccess: i,
213
217
  skipMfa: c = !1,
214
- ...d
218
+ ...u
215
219
  }) => {
216
220
  S("export_wallet");
217
- const { showCoinbaseFooter: u } = b(), p = /* @__PURE__ */ t(
218
- at,
221
+ const { showCoinbaseFooter: _ } = b(), p = /* @__PURE__ */ t(
222
+ lt,
219
223
  {
220
224
  address: o,
221
225
  onIframeReady: n,
222
226
  onCopySuccess: i,
223
227
  onIframeError: a,
224
228
  onIframeSessionExpired: s,
225
- children: /* @__PURE__ */ t(it, { children: e })
229
+ children: /* @__PURE__ */ t(st, { children: e })
226
230
  }
227
231
  );
228
232
  return /* @__PURE__ */ t(
@@ -230,31 +234,34 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
230
234
  {
231
235
  className: m(
232
236
  E["export-wallet"],
233
- !u && E["no-footer"],
237
+ !_ && E["no-footer"],
234
238
  r
235
239
  ),
236
- ...d,
237
- children: c ? p : /* @__PURE__ */ t(F, { verifyFirst: !0, children: /* @__PURE__ */ t(I, { transition: "fade", children: /* @__PURE__ */ t("div", { className: m(E["flex-container"]), children: p }) }) })
240
+ ...u,
241
+ children: c ? p : /* @__PURE__ */ d(F, { verifyFirst: !0, children: [
242
+ /* @__PURE__ */ t(I, {}),
243
+ /* @__PURE__ */ t(R, { transition: "fade", children: /* @__PURE__ */ t("div", { className: m(E["flex-container"]), children: p }) })
244
+ ] })
238
245
  }
239
246
  );
240
- }, pt = "ExportWalletModal-module__wrapper___r1E1L", mt = "ExportWalletModal-module__trigger___zMk8N", ct = "ExportWalletModal-module__content___KzNol", dt = "ExportWalletModal-module__footer___byg1T", ut = "ExportWalletModal-module__modal___pX1AP", l = {
247
+ }, mt = "ExportWalletModal-module__wrapper___r1E1L", ct = "ExportWalletModal-module__trigger___zMk8N", dt = "ExportWalletModal-module__content___KzNol", ut = "ExportWalletModal-module__footer___byg1T", _t = "ExportWalletModal-module__modal___pX1AP", l = {
241
248
  "export-wallet": "ExportWalletModal-module__export-wallet___--L56",
242
249
  "in-mfa-flow": "ExportWalletModal-module__in-mfa-flow___9Fe8k",
243
- wrapper: pt,
250
+ wrapper: mt,
244
251
  "no-footer": "ExportWalletModal-module__no-footer___J8uj2",
245
- trigger: mt,
252
+ trigger: ct,
246
253
  "title-bar": "ExportWalletModal-module__title-bar___RTPZq",
247
254
  "title-bar-space-bottom": "ExportWalletModal-module__title-bar-space-bottom___l-NvR",
248
255
  "export-wallet-title": "ExportWalletModal-module__export-wallet-title___2k0L-",
249
- content: ct,
256
+ content: dt,
250
257
  "close-button": "ExportWalletModal-module__close-button___ImsDR",
251
258
  "close-icon": "ExportWalletModal-module__close-icon___iAfyT",
252
- footer: dt,
259
+ footer: ut,
253
260
  "footer-space-top": "ExportWalletModal-module__footer-space-top___URl9q",
254
261
  "visually-hidden": "ExportWalletModal-module__visually-hidden___JAcNA",
255
- modal: ut
256
- }, V = A(null), _t = () => {
257
- const o = k(V);
262
+ modal: _t
263
+ }, O = A(null), xt = () => {
264
+ const o = k(O);
258
265
  if (!o)
259
266
  throw new Error("useExportWalletModalContext must be used within a ExportWalletModal");
260
267
  return o;
@@ -263,68 +270,69 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
263
270
  className: e = "",
264
271
  label: r,
265
272
  ...a
266
- }) => /* @__PURE__ */ t(ot, { asChild: !0, children: o || /* @__PURE__ */ t(R, { className: m(l.trigger, e), ...a, children: r || "Export wallet" }) }), B = ({
273
+ }) => /* @__PURE__ */ t(et, { asChild: !0, children: o || /* @__PURE__ */ t(T, { className: m(l.trigger, e), ...a, children: r || "Export wallet" }) }), K = ({
267
274
  children: o = "Copy private key to export wallet",
268
275
  as: e = "h2",
269
276
  className: r = "",
270
277
  ...a
271
- }) => /* @__PURE__ */ t(tt, { asChild: !0, children: /* @__PURE__ */ t(e, { className: m(l["export-wallet-title"], r), ...a, children: o }) }), K = ({ children: o }) => /* @__PURE__ */ t(G, { asChild: !0, children: o || /* @__PURE__ */ t(
272
- R,
278
+ }) => /* @__PURE__ */ t(ot, { asChild: !0, children: /* @__PURE__ */ t(e, { className: m(l["export-wallet-title"], r), ...a, children: o }) }), Y = ({ children: o }) => /* @__PURE__ */ t(Q, { asChild: !0, children: o || /* @__PURE__ */ t(
279
+ T,
273
280
  {
274
281
  "aria-label": "Close",
275
282
  className: l["close-button"],
276
283
  variant: "transparentSecondary",
277
- children: /* @__PURE__ */ t(et, { className: l["close-icon"] })
284
+ children: /* @__PURE__ */ t(rt, { className: l["close-icon"] })
278
285
  }
279
- ) }), xt = ({ children: o }) => {
280
- const { view: e } = Z();
281
- return /* @__PURE__ */ _("div", { className: l["title-bar"], children: [
282
- /* @__PURE__ */ t(B, { className: m(e === "content" ? "" : l["visually-hidden"]), children: o }),
283
- /* @__PURE__ */ t(K, {})
286
+ ) }), ft = ({ children: o }) => {
287
+ const { view: e } = $();
288
+ return /* @__PURE__ */ d("div", { className: l["title-bar"], children: [
289
+ /* @__PURE__ */ t(I, {}),
290
+ /* @__PURE__ */ t(K, { className: m(e === "content" ? "" : l["visually-hidden"]), children: o }),
291
+ /* @__PURE__ */ t(Y, {})
284
292
  ] });
285
- }, M = ({
293
+ }, v = ({
286
294
  children: o,
287
295
  className: e = "",
288
296
  title: r,
289
297
  ...a
290
298
  }) => {
291
- const { showCoinbaseFooter: n } = b(), { address: s, onIframeReady: i, onCopySuccess: c, onIframeError: d, onIframeSessionExpired: u, skipMfa: p } = _t(), x = /* @__PURE__ */ t(
292
- st,
299
+ const { showCoinbaseFooter: n } = b(), { address: s, onIframeReady: i, onCopySuccess: c, onIframeError: u, onIframeSessionExpired: _, skipMfa: p } = xt(), x = /* @__PURE__ */ t(
300
+ pt,
293
301
  {
294
302
  address: s,
295
303
  onIframeReady: i,
296
304
  onCopySuccess: c,
297
- onIframeError: d,
298
- onIframeSessionExpired: u,
305
+ onIframeError: u,
306
+ onIframeSessionExpired: _,
299
307
  className: m(l["export-wallet"], !p && l["in-mfa-flow"]),
300
308
  skipMfa: !0,
301
- children: o || (({ isSessionExpired: f }) => /* @__PURE__ */ _(y, { children: [
302
- p && /* @__PURE__ */ _("div", { className: m(l["title-bar"], l["title-bar-space-bottom"]), children: [
303
- /* @__PURE__ */ t(B, {}),
304
- /* @__PURE__ */ t(K, {})
309
+ children: o || (({ isSessionExpired: f }) => /* @__PURE__ */ d(y, { children: [
310
+ p && /* @__PURE__ */ d("div", { className: m(l["title-bar"], l["title-bar-space-bottom"]), children: [
311
+ /* @__PURE__ */ t(K, {}),
312
+ /* @__PURE__ */ t(Y, {})
305
313
  ] }),
306
- /* @__PURE__ */ _("div", { className: l.content, children: [
307
- f ? /* @__PURE__ */ t(w, { role: "alert", "data-part": "warning", variant: "warning", children: "Your export session has expired. Please close and reopen the modal to export again." }) : /* @__PURE__ */ t(P, {}),
314
+ /* @__PURE__ */ d("div", { className: l.content, children: [
315
+ f ? /* @__PURE__ */ t(w, { role: "alert", "data-part": "warning", variant: "warning", children: "Your export session has expired. Please close and reopen the modal to export again." }) : /* @__PURE__ */ t(V, {}),
308
316
  /* @__PURE__ */ t(j, {}),
309
- /* @__PURE__ */ t(O, {}),
317
+ /* @__PURE__ */ t(B, {}),
310
318
  p && n && /* @__PURE__ */ t(C, { className: l.footer })
311
319
  ] })
312
320
  ] }))
313
321
  }
314
322
  );
315
- return /* @__PURE__ */ t(Q, { "aria-describedby": void 0, className: m(l.modal, e), ...a, children: p ? x : /* @__PURE__ */ _(
323
+ return /* @__PURE__ */ t(tt, { "aria-describedby": void 0, className: m(l.modal, e), ...a, children: p ? x : /* @__PURE__ */ d(
316
324
  F,
317
325
  {
318
326
  className: m(l.wrapper, n ? "" : l["no-footer"]),
319
327
  verifyFirst: !0,
320
328
  children: [
321
- /* @__PURE__ */ t(xt, { children: r }),
322
- /* @__PURE__ */ t(I, { transition: "fade", children: x }),
329
+ /* @__PURE__ */ t(ft, { children: r }),
330
+ /* @__PURE__ */ t(R, { transition: "fade", children: x }),
323
331
  n && /* @__PURE__ */ t(C, { className: m(l.footer, l["footer-space-top"]) })
324
332
  ]
325
333
  }
326
334
  ) });
327
- }, ee = ({
335
+ }, ie = ({
328
336
  address: o,
329
337
  children: e,
330
338
  onIframeReady: r,
@@ -333,39 +341,39 @@ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer__
333
341
  onIframeSessionExpired: s,
334
342
  open: i,
335
343
  setIsOpen: c,
336
- skipMfa: d = !1
344
+ skipMfa: u = !1
337
345
  }) => {
338
346
  S("export_wallet_modal");
339
- const u = h(
347
+ const _ = h(
340
348
  () => ({
341
349
  address: o,
342
350
  onIframeReady: r,
343
351
  onCopySuccess: a,
344
352
  onIframeError: n,
345
353
  onIframeSessionExpired: s,
346
- skipMfa: d
354
+ skipMfa: u
347
355
  }),
348
- [o, r, a, n, s, d]
349
- ), p = e ? g(e, N) : !1, x = e ? g(e, M) : !1, f = !p && !x;
350
- return /* @__PURE__ */ t(V.Provider, { value: u, children: /* @__PURE__ */ t($, { open: i, onOpenChange: c, children: f ? /* @__PURE__ */ _(y, { children: [
356
+ [o, r, a, n, s, u]
357
+ ), p = e ? g(e, N) : !1, x = e ? g(e, v) : !1, f = !p && !x;
358
+ return /* @__PURE__ */ t(O.Provider, { value: _, children: /* @__PURE__ */ t(G, { open: i, onOpenChange: c, children: f ? /* @__PURE__ */ d(y, { children: [
351
359
  /* @__PURE__ */ t(N, { children: e }),
352
- /* @__PURE__ */ t(M, {})
353
- ] }) : /* @__PURE__ */ _(y, { children: [
360
+ /* @__PURE__ */ t(v, {})
361
+ ] }) : /* @__PURE__ */ d(y, { children: [
354
362
  e,
355
- !x && /* @__PURE__ */ t(M, {})
363
+ !x && /* @__PURE__ */ t(v, {})
356
364
  ] }) }) });
357
365
  };
358
- z.registerPackageVersion("react", U);
366
+ D.registerPackageVersion("react", q);
359
367
  export {
360
- ee as E,
361
- st as ExportWallet,
368
+ ie as E,
369
+ pt as ExportWallet,
362
370
  j as ExportWalletCopyAddress,
363
- O as ExportWalletCopyKeyButton,
364
- nt as ExportWalletFooter,
365
- lt as ExportWalletTitle,
366
- P as ExportWalletWarning,
367
- K as a,
368
- M as b,
369
- B as c,
371
+ B as ExportWalletCopyKeyButton,
372
+ it as ExportWalletFooter,
373
+ nt as ExportWalletTitle,
374
+ V as ExportWalletWarning,
375
+ Y as a,
376
+ v as b,
377
+ K as c,
370
378
  N as d
371
379
  };