@coinbase/cdp-react 0.0.78 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/assets/Badge.css +1 -0
- package/dist/assets/Banner.css +1 -1
- package/dist/assets/CDPReactProvider.css +1 -0
- package/dist/assets/CoinbaseFooter.css +1 -1
- package/dist/assets/CopyTextField.css +1 -0
- package/dist/assets/EnrollMfa.css +1 -0
- package/dist/assets/EnrollMfaDescription.css +1 -0
- package/dist/assets/EnrollMfaFlow.css +1 -0
- package/dist/assets/EnrollMfaFlowBackButton.css +1 -0
- package/dist/assets/EnrollMfaItems.css +1 -0
- package/dist/assets/EnrollMfaModal.css +1 -0
- package/dist/assets/EnrollMfaTitle.css +1 -0
- package/dist/assets/ExportWallet.css +1 -1
- package/dist/assets/OTPForm.css +1 -1
- package/dist/assets/QRCode.css +1 -0
- package/dist/assets/ToggleListItem.css +1 -0
- package/dist/assets/VerifyMfaDescription.css +1 -0
- package/dist/assets/VerifyMfaFlow.css +1 -0
- package/dist/assets/VerifyMfaImage.css +1 -0
- package/dist/assets/VerifyMfaInline.css +1 -0
- package/dist/assets/VerifyMfaTitle.css +1 -0
- package/dist/assets/totp.css +1 -0
- package/dist/chunks/CDPReactProvider.CIQm4C4z.js +299 -0
- package/dist/chunks/{LinkAuthFlow.3HN888DV.js → LinkAuthFlow.BaUSMzGH.js} +1 -1
- package/dist/chunks/index.CKQKBoX2.js +9 -0
- package/dist/chunks/{index.Bvudzh_y.js → index.C_DV0Ud7.js} +1 -1
- package/dist/chunks/index.Dp-lIxM1.js +9 -0
- package/dist/components/CDPReactProvider/index.d.ts +4 -1
- package/dist/components/CDPReactProvider/index.js +11 -79
- package/dist/components/CopyAddress/index.js +24 -60
- package/dist/components/EnrollMfa/EnrollMfaDescription.d.ts +6 -0
- package/dist/components/EnrollMfa/EnrollMfaDescription.js +21 -0
- package/dist/components/EnrollMfa/EnrollMfaFlow.d.ts +12 -0
- package/dist/components/EnrollMfa/EnrollMfaFlow.js +46 -0
- package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.d.ts +9 -0
- package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.js +39 -0
- package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +21 -0
- package/dist/components/EnrollMfa/EnrollMfaFlowProvider.js +34 -0
- package/dist/components/EnrollMfa/EnrollMfaFooter.d.ts +2 -0
- package/dist/components/EnrollMfa/EnrollMfaFooter.js +7 -0
- package/dist/components/EnrollMfa/EnrollMfaImage.d.ts +6 -0
- package/dist/components/EnrollMfa/EnrollMfaImage.js +19 -0
- package/dist/components/EnrollMfa/EnrollMfaItem.d.ts +11 -0
- package/dist/components/EnrollMfa/EnrollMfaItem.js +21 -0
- package/dist/components/EnrollMfa/EnrollMfaItems.d.ts +9 -0
- package/dist/components/EnrollMfa/EnrollMfaItems.js +39 -0
- package/dist/components/EnrollMfa/EnrollMfaProvider.d.ts +14 -0
- package/dist/components/EnrollMfa/EnrollMfaProvider.js +24 -0
- package/dist/components/EnrollMfa/EnrollMfaTitle.d.ts +6 -0
- package/dist/components/EnrollMfa/EnrollMfaTitle.js +21 -0
- package/dist/components/EnrollMfa/index.d.ts +20 -0
- package/dist/components/EnrollMfa/index.js +171 -0
- package/dist/components/EnrollMfa/methods/totp.d.ts +6 -0
- package/dist/components/EnrollMfa/methods/totp.js +120 -0
- package/dist/components/EnrollMfa/types.d.ts +83 -0
- package/dist/components/EnrollMfa/types.js +2 -0
- package/dist/components/EnrollMfa/useEnrollMfaReducer.d.ts +3 -0
- package/dist/components/EnrollMfa/useEnrollMfaReducer.js +111 -0
- package/dist/components/EnrollMfaModal/index.d.ts +20 -0
- package/dist/components/EnrollMfaModal/index.js +144 -0
- package/dist/components/ExportWallet/index.d.ts +2 -1
- package/dist/components/ExportWallet/index.js +225 -165
- package/dist/components/ExportWalletModal/index.d.ts +7 -4
- package/dist/components/ExportWalletModal/index.js +9 -7
- package/dist/components/Fund/index.js +5 -5
- package/dist/components/FundModal/index.js +14 -14
- package/dist/components/LinkAuth/LinkAuthFlow.js +2 -2
- package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +2 -2
- package/dist/components/LinkAuth/LinkAuthFlowProvider.js +2 -2
- package/dist/components/LinkAuth/LinkAuthItem.js +26 -45
- package/dist/components/LinkAuth/LinkAuthItems.js +1 -1
- package/dist/components/LinkAuth/LinkAuthProvider.js +1 -1
- package/dist/components/LinkAuth/index.js +3 -3
- package/dist/components/LinkAuth/types.js +1 -1
- package/dist/components/LinkAuth/utils.js +1 -1
- package/dist/components/LinkAuthModal/index.js +2 -2
- package/dist/components/OAuthStatusModal/index.js +1 -1
- package/dist/components/SignIn/SignInAuthMethodButtons.js +1 -1
- package/dist/components/SignIn/SignInBackButton.js +1 -1
- package/dist/components/SignIn/SignInDescription.js +2 -2
- package/dist/components/SignIn/SignInForm.js +2 -2
- package/dist/components/SignIn/SignInImage.js +5 -5
- package/dist/components/SignIn/SignInProvider.js +1 -1
- package/dist/components/SignIn/SignInTitle.js +2 -2
- package/dist/components/SignIn/flows/SignInWithEmail.js +1 -1
- package/dist/components/SignIn/flows/SignInWithOAuth.js +1 -1
- package/dist/components/SignIn/flows/SignInWithSms.js +1 -1
- package/dist/components/SignIn/index.js +4 -4
- package/dist/components/SignIn/types.js +1 -1
- package/dist/components/SignIn/useSignInReducer.js +1 -1
- package/dist/components/SignInModal/index.js +13 -13
- package/dist/components/ThemeProvider/index.d.ts +4 -6
- package/dist/components/ThemeProvider/index.js +32 -21
- package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +6 -0
- package/dist/components/VerifyMfa/VerifyMfaDescription.js +21 -0
- package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +11 -0
- package/dist/components/VerifyMfa/VerifyMfaFlow.js +19 -0
- package/dist/components/VerifyMfa/VerifyMfaFooter.d.ts +2 -0
- package/dist/components/VerifyMfa/VerifyMfaFooter.js +7 -0
- package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +6 -0
- package/dist/components/VerifyMfa/VerifyMfaImage.js +21 -0
- package/dist/components/VerifyMfa/VerifyMfaProvider.d.ts +15 -0
- package/dist/components/VerifyMfa/VerifyMfaProvider.js +28 -0
- package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +6 -0
- package/dist/components/VerifyMfa/VerifyMfaTitle.js +21 -0
- package/dist/components/VerifyMfa/index.d.ts +16 -0
- package/dist/components/VerifyMfa/index.js +20 -0
- package/dist/components/VerifyMfa/methods/totp.d.ts +6 -0
- package/dist/components/VerifyMfa/methods/totp.js +69 -0
- package/dist/components/VerifyMfa/types.d.ts +60 -0
- package/dist/components/VerifyMfa/types.js +2 -0
- package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +2 -0
- package/dist/components/VerifyMfa/useVerifyMfaReducer.js +61 -0
- package/dist/components/VerifyMfaInline/index.d.ts +40 -0
- package/dist/components/VerifyMfaInline/index.js +175 -0
- package/dist/components/VerifyMfaModal/index.d.ts +23 -0
- package/dist/components/VerifyMfaModal/index.js +19 -0
- package/dist/components/forms/AmountInput/index.d.ts +1 -1
- package/dist/components/forms/ExchangeAmountInput/index.d.ts +1 -1
- package/dist/components/forms/OTPForm/index.d.ts +2 -2
- package/dist/components/forms/OTPForm/index.js +81 -64
- package/dist/components/ui/Badge/index.d.ts +7 -0
- package/dist/components/ui/Badge/index.js +9 -0
- package/dist/components/ui/CopyTextField/index.d.ts +10 -0
- package/dist/components/ui/CopyTextField/index.js +81 -0
- package/dist/components/ui/Modal/index.js +4 -4
- package/dist/components/ui/QRCode/QRCodeSvg.d.ts +17 -0
- package/dist/components/ui/QRCode/QRCodeSvg.js +57 -0
- package/dist/components/ui/QRCode/index.d.ts +5 -0
- package/dist/components/ui/QRCode/index.js +31 -0
- package/dist/components/ui/QRCode/useCorners.d.ts +1 -0
- package/dist/components/ui/QRCode/useCorners.js +72 -0
- package/dist/components/ui/QRCode/useDotsPath.d.ts +11 -0
- package/dist/components/ui/QRCode/useDotsPath.js +66 -0
- package/dist/components/ui/QRCode/useLogo.d.ts +12 -0
- package/dist/components/ui/QRCode/useLogo.js +52 -0
- package/dist/components/ui/QRCode/useMatrix.d.ts +1 -0
- package/dist/components/ui/QRCode/useMatrix.js +17 -0
- package/dist/components/ui/ToggleListItem/index.d.ts +15 -0
- package/dist/components/ui/ToggleListItem/index.js +52 -0
- package/dist/hooks/useKeyExportPostMessage.js +67 -55
- package/dist/hooks/useVerifyMfaModal.d.ts +22 -0
- package/dist/hooks/useVerifyMfaModal.js +10 -0
- package/dist/icons/IconCoinbaseWordmark.js +10 -13
- package/dist/icons/IconPinCode.d.ts +2 -0
- package/dist/icons/IconPinCode.js +13 -0
- package/dist/icons/IconShield.d.ts +2 -0
- package/dist/icons/IconShield.js +7 -0
- package/dist/icons/IconSmartPhone.d.ts +2 -0
- package/dist/icons/IconSmartPhone.js +7 -0
- package/dist/icons/index.d.ts +5 -2
- package/dist/icons/index.js +22 -16
- package/dist/index.d.ts +6 -0
- package/dist/index.js +220 -165
- package/dist/theme/theme.d.ts +104 -0
- package/dist/theme/tokens.d.ts +312 -0
- package/dist/theme/tokens.js +70 -0
- package/dist/utils/transition.d.ts +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -7
- package/dist/assets/CopyAddress.css +0 -1
- package/dist/assets/LinkAuthItem.css +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import p from "qrcode";
|
|
2
|
+
import { useMemo as s } from "react";
|
|
3
|
+
function h(r, e) {
|
|
4
|
+
return s(() => {
|
|
5
|
+
const u = Array.prototype.slice.call(
|
|
6
|
+
p.create(r, { errorCorrectionLevel: e }).modules.data,
|
|
7
|
+
0
|
|
8
|
+
), n = Math.sqrt(u.length);
|
|
9
|
+
return u.reduce(
|
|
10
|
+
(t, a, o) => (o % n === 0 ? t.push([a]) : t[t.length - 1].push(a)) && t,
|
|
11
|
+
[]
|
|
12
|
+
);
|
|
13
|
+
}, [e, r]);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
h as useMatrix
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
interface ToggleListItemProps {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
isPending?: boolean;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
onActivate?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
onDeactivate?: MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
activateAriaLabel?: string;
|
|
11
|
+
deactivateAriaLabel?: string;
|
|
12
|
+
size?: "md" | "sm";
|
|
13
|
+
}
|
|
14
|
+
export declare const ToggleListItem: ({ icon, label, isActive, isPending, isDisabled, onActivate, onDeactivate, activateAriaLabel, deactivateAriaLabel, size, }: ToggleListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export type { ToggleListItemProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Button as s } from "../Button/index.js";
|
|
4
|
+
import { IconMinus as g } from "../../../icons/IconMinus.js";
|
|
5
|
+
import { IconPlus as f } from "../../../icons/IconPlus.js";
|
|
6
|
+
import '../../../assets/ToggleListItem.css';const h = "ToggleListItem-module__item___MoMVD", v = "ToggleListItem-module__button___MEFkz", e = {
|
|
7
|
+
item: h,
|
|
8
|
+
"item-icon": "ToggleListItem-module__item-icon___-fk9h",
|
|
9
|
+
"item-text": "ToggleListItem-module__item-text___nFMfG",
|
|
10
|
+
"item-action": "ToggleListItem-module__item-action___G48jL",
|
|
11
|
+
button: v
|
|
12
|
+
}, N = ({
|
|
13
|
+
icon: o,
|
|
14
|
+
label: i,
|
|
15
|
+
isActive: l = !1,
|
|
16
|
+
isPending: m = !1,
|
|
17
|
+
isDisabled: a = !1,
|
|
18
|
+
onActivate: n,
|
|
19
|
+
onDeactivate: r,
|
|
20
|
+
activateAriaLabel: c,
|
|
21
|
+
deactivateAriaLabel: _,
|
|
22
|
+
size: d = "md"
|
|
23
|
+
}) => /* @__PURE__ */ u("div", { className: e.item, "data-size": d, children: [
|
|
24
|
+
o && /* @__PURE__ */ t("div", { className: e["item-icon"], children: o }),
|
|
25
|
+
/* @__PURE__ */ t("div", { className: e["item-text"], children: i }),
|
|
26
|
+
/* @__PURE__ */ t("div", { className: e["item-action"], children: l ? /* @__PURE__ */ t(
|
|
27
|
+
s,
|
|
28
|
+
{
|
|
29
|
+
variant: "secondary",
|
|
30
|
+
className: e.button,
|
|
31
|
+
isPending: m,
|
|
32
|
+
disabled: a,
|
|
33
|
+
onClick: r,
|
|
34
|
+
"aria-label": _ ?? `Deactivate ${i}`,
|
|
35
|
+
children: /* @__PURE__ */ t(g, { "aria-hidden": "true" })
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ t(
|
|
38
|
+
s,
|
|
39
|
+
{
|
|
40
|
+
variant: "primary",
|
|
41
|
+
className: e.button,
|
|
42
|
+
isPending: m,
|
|
43
|
+
disabled: a,
|
|
44
|
+
onClick: n,
|
|
45
|
+
"aria-label": c ?? `Activate ${i}`,
|
|
46
|
+
children: /* @__PURE__ */ t(f, { "aria-hidden": "true" })
|
|
47
|
+
}
|
|
48
|
+
) })
|
|
49
|
+
] });
|
|
50
|
+
export {
|
|
51
|
+
N as ToggleListItem
|
|
52
|
+
};
|
|
@@ -1,82 +1,94 @@
|
|
|
1
|
-
import { buildKeyExportIframeUrl as
|
|
2
|
-
import { useCurrentUser as
|
|
3
|
-
import { useState as w, useRef as
|
|
1
|
+
import { buildKeyExportIframeUrl as P, getAccessTokenExpiration as q, SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE as c, getAccessToken as L, isSecureIframeKeyExportMessage as h } from "@coinbase/cdp-core";
|
|
2
|
+
import { useCurrentUser as C } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { useState as w, useRef as N, useMemo as Y, useCallback as A, useEffect as _ } from "react";
|
|
4
4
|
import "libphonenumber-js";
|
|
5
|
-
import { sendIframeMessage as
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
import { sendIframeMessage as I } from "../utils/sendIframeMessage.js";
|
|
6
|
+
const x = "https://secure-wallet.cdp.coinbase.com";
|
|
7
|
+
let i = null;
|
|
8
|
+
const v = async () => (i || (i = L({ forceRefresh: !0 }).finally(() => {
|
|
9
|
+
i = null;
|
|
10
|
+
})), i), F = (o, t) => {
|
|
11
|
+
I(o, t);
|
|
8
12
|
}, O = ({
|
|
9
13
|
address: o,
|
|
10
|
-
basePath:
|
|
11
|
-
copiedLabel:
|
|
12
|
-
icon:
|
|
13
|
-
iframeRef:
|
|
14
|
+
basePath: t = x,
|
|
15
|
+
copiedLabel: l,
|
|
16
|
+
icon: y,
|
|
17
|
+
iframeRef: s,
|
|
14
18
|
label: p,
|
|
15
|
-
onStatusUpdate:
|
|
16
|
-
projectId:
|
|
17
|
-
theme:
|
|
19
|
+
onStatusUpdate: a,
|
|
20
|
+
projectId: d,
|
|
21
|
+
theme: n,
|
|
18
22
|
type: T
|
|
19
23
|
}) => {
|
|
20
|
-
const { currentUser:
|
|
21
|
-
projectId:
|
|
24
|
+
const { currentUser: u } = C(), [M, R] = w(!0), [E, K] = w(!1), f = N(!1), S = Y(() => P({
|
|
25
|
+
projectId: d,
|
|
22
26
|
label: p,
|
|
23
|
-
copiedLabel:
|
|
24
|
-
icon:
|
|
25
|
-
basePath:
|
|
26
|
-
}), [
|
|
27
|
-
if (!
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
copiedLabel: l,
|
|
28
|
+
icon: y,
|
|
29
|
+
basePath: t
|
|
30
|
+
}), [d, p, l, y, t]), k = A(async () => {
|
|
31
|
+
if (!(!u || !s.current))
|
|
32
|
+
try {
|
|
33
|
+
const e = await v(), r = await q();
|
|
34
|
+
F(s.current, {
|
|
35
|
+
type: c.GET_PRIVATE_KEY,
|
|
36
|
+
payload: {
|
|
37
|
+
address: o,
|
|
38
|
+
type: T,
|
|
39
|
+
authState: {
|
|
40
|
+
accessToken: e || "",
|
|
41
|
+
expiresAt: r || 0,
|
|
42
|
+
user: u
|
|
43
|
+
},
|
|
44
|
+
theme: n
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
} catch (e) {
|
|
48
|
+
console.error("Error requesting private key:", e), a?.(
|
|
49
|
+
"error",
|
|
50
|
+
e instanceof Error ? "Error requesting private key: " + e.message : "Error requesting private key"
|
|
51
|
+
);
|
|
40
52
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
g?.(r, e), M(!1);
|
|
53
|
+
}, [u, o, T, n, s, a]), m = A(
|
|
54
|
+
(e, r) => {
|
|
55
|
+
a?.(e, r), R(!1);
|
|
45
56
|
},
|
|
46
|
-
[
|
|
57
|
+
[a]
|
|
47
58
|
);
|
|
48
59
|
return _(() => {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
type:
|
|
60
|
+
const e = f.current;
|
|
61
|
+
f.current = E, e && E && n && I(s.current, {
|
|
62
|
+
type: c.THEME,
|
|
52
63
|
payload: {
|
|
53
|
-
theme:
|
|
64
|
+
theme: n
|
|
54
65
|
}
|
|
55
66
|
});
|
|
56
|
-
}, [
|
|
57
|
-
const
|
|
58
|
-
|
|
67
|
+
}, [n, E, s]), _(() => {
|
|
68
|
+
const e = (r) => {
|
|
69
|
+
if (r.source !== s.current?.contentWindow) return;
|
|
70
|
+
let g = "";
|
|
59
71
|
try {
|
|
60
|
-
|
|
72
|
+
g = new URL(t || x).origin;
|
|
61
73
|
} catch (U) {
|
|
62
74
|
console.error("Error parsing iframe origin", U);
|
|
63
75
|
}
|
|
64
|
-
if (!(!
|
|
65
|
-
switch (
|
|
66
|
-
case
|
|
67
|
-
|
|
76
|
+
if (!(!g || r.origin !== g) && h(r.data))
|
|
77
|
+
switch (r.data?.type) {
|
|
78
|
+
case c.LISTENING:
|
|
79
|
+
K(!0), k();
|
|
68
80
|
break;
|
|
69
|
-
case
|
|
70
|
-
m(
|
|
81
|
+
case c.STATUS:
|
|
82
|
+
m(r.data.payload.status, r.data.payload.message);
|
|
71
83
|
break;
|
|
72
84
|
}
|
|
73
85
|
};
|
|
74
|
-
return window.addEventListener("message",
|
|
75
|
-
window.removeEventListener("message",
|
|
86
|
+
return window.addEventListener("message", e), () => {
|
|
87
|
+
window.removeEventListener("message", e);
|
|
76
88
|
};
|
|
77
|
-
}, [
|
|
89
|
+
}, [k, m, t, s]), { iframeUrl: S, isPending: M };
|
|
78
90
|
};
|
|
79
91
|
export {
|
|
80
|
-
|
|
92
|
+
F as sendKeyExportMessage,
|
|
81
93
|
O as useKeyExportPostMessage
|
|
82
94
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { VerifyMfaModalProps } from '../components/VerifyMfaModal';
|
|
3
|
+
export interface UseVerifyMfaModalOptions extends Pick<VerifyMfaModalProps, "onCancel" | "onError" | "onSuccess"> {
|
|
4
|
+
closeOnSuccessDelay?: number | null;
|
|
5
|
+
}
|
|
6
|
+
export interface UseVerifyMfaModalReturn {
|
|
7
|
+
open: () => boolean;
|
|
8
|
+
close: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface VerifyMfaModalContextValue {
|
|
11
|
+
register: (id: string, optionsRef: RefObject<UseVerifyMfaModalOptions>) => void;
|
|
12
|
+
unregister: (id: string) => void;
|
|
13
|
+
open: (id: string) => boolean;
|
|
14
|
+
close: () => void;
|
|
15
|
+
}
|
|
16
|
+
interface MfaVerificationProviderProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare const VerifyMfaModalProvider: ({ children }: MfaVerificationProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const useVerifyMfaModal: (options?: UseVerifyMfaModalOptions) => UseVerifyMfaModalReturn;
|
|
21
|
+
export declare const useMfaVerification: () => VerifyMfaModalContextValue;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "@coinbase/cdp-core";
|
|
3
|
+
import "../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
4
|
+
import { g as t, h as m, b as p } from "../chunks/CDPReactProvider.CIQm4C4z.js";
|
|
5
|
+
import "react";
|
|
6
|
+
export {
|
|
7
|
+
t as VerifyMfaModalProvider,
|
|
8
|
+
m as useMfaVerification,
|
|
9
|
+
p as useVerifyMfaModal
|
|
10
|
+
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
) }),
|
|
12
|
-
/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ C("clipPath", { id: "clip0_7507_87", children: /* @__PURE__ */ C("rect", { width: "67", height: "11.9895", fill: "white", transform: "translate(0 0.505371)" }) }) })
|
|
13
|
-
] });
|
|
3
|
+
import { SvgIcon as o } from "./SvgIcon.js";
|
|
4
|
+
const Z = (H) => /* @__PURE__ */ C(o, { width: "65", height: "12", viewBox: "0 0 65 12", fill: "none", ...H, children: /* @__PURE__ */ C(
|
|
5
|
+
"path",
|
|
6
|
+
{
|
|
7
|
+
d: "M13.1187 3.24731C10.7574 3.24731 8.91239 5.04297 8.91239 7.44683C8.91239 9.8507 10.7108 11.631 13.1187 11.631C15.5266 11.631 17.3563 9.81996 17.3563 7.43147C17.3563 5.05834 15.5579 3.24731 13.1187 3.24731ZM13.1346 9.89857C11.79 9.89857 10.8046 8.85239 10.8046 7.44742C10.8046 6.0265 11.774 4.98091 13.1187 4.98091C14.4793 4.98091 15.4641 6.04246 15.4641 7.44742C15.4641 8.85239 14.4793 9.89857 13.1346 9.89857ZM17.872 5.0743H19.045V11.4755H20.9213V3.40336H17.872V5.0743ZM4.19039 4.98032C5.17574 4.98032 5.95753 5.58912 6.25431 6.49463H8.24035C7.88043 4.55889 6.28558 3.24731 4.20632 3.24731C1.84502 3.24731 0 5.04297 0 7.44742C0 9.85188 1.79841 11.6316 4.20632 11.6316C6.23897 11.6316 7.86509 10.32 8.22501 8.3683H6.25431C5.97287 9.27382 5.19108 9.89857 4.20573 9.89857C2.84512 9.89857 1.89163 8.85239 1.89163 7.44742C1.89222 6.0265 2.83037 4.98032 4.19039 4.98032ZM53.5227 6.66663L52.1468 6.46389C51.4901 6.3705 51.021 6.15181 51.021 5.6364C51.021 5.0743 51.6311 4.79354 52.4595 4.79354C53.3664 4.79354 53.9452 5.18364 54.0703 5.82377H55.884C55.6805 4.20011 54.4296 3.2479 52.5067 3.2479C50.5207 3.2479 49.2073 4.26276 49.2073 5.69905C49.2073 7.07269 50.0675 7.86945 51.8028 8.11888L53.1788 8.32161C53.8514 8.415 54.2266 8.68098 54.2266 9.18043C54.2266 9.82055 53.5699 10.0859 52.6631 10.0859C51.5526 10.0859 50.9272 9.63319 50.8334 8.94637H48.9884C49.1607 10.5233 50.3956 11.6316 52.6471 11.6316C54.6957 11.6316 56.0557 10.6947 56.0557 9.08645C56.0557 7.65016 55.071 6.90069 53.5227 6.66663ZM19.9831 0.0780206C19.2951 0.0780206 18.7789 0.577471 18.7789 1.26429C18.7789 1.95111 19.2945 2.45056 19.9831 2.45056C20.6711 2.45056 21.1874 1.95111 21.1874 1.26429C21.1874 0.577471 20.6711 0.0780206 19.9831 0.0780206ZM47.5186 6.16718C47.5186 4.41881 46.4554 3.2479 44.2038 3.2479C42.0774 3.2479 40.889 4.32542 40.6542 5.9804H42.5152C42.609 5.34028 43.1093 4.8095 44.1726 4.8095C45.1266 4.8095 45.5957 5.23093 45.5957 5.74634C45.5957 6.41779 44.7354 6.5892 43.6722 6.69855C42.2337 6.85459 40.4512 7.35404 40.4512 9.22771C40.4512 10.68 41.5304 11.6162 43.2503 11.6162C44.595 11.6162 45.4393 11.0541 45.8618 10.164C45.9243 10.9601 46.5185 11.4755 47.3475 11.4755H48.442V9.80519H47.5192V6.16718H47.5186ZM45.6736 8.19689C45.6736 9.27441 44.7354 10.0706 43.5937 10.0706C42.8898 10.0706 42.2957 9.77386 42.2957 9.14969C42.2957 8.35353 43.2497 8.13483 44.1253 8.04145C44.9697 7.96343 45.4388 7.77606 45.6736 7.41669V8.19689ZM35.7133 3.24731C34.6654 3.24731 33.7898 3.6847 33.1644 4.41821V0H31.2881V11.4755H33.1331V10.414C33.7585 11.1788 34.6501 11.6316 35.7133 11.6316C37.9649 11.6316 39.6694 9.85188 39.6694 7.44742C39.6694 5.04297 37.9336 3.24731 35.7133 3.24731ZM35.4319 9.89857C34.0872 9.89857 33.1018 8.85239 33.1018 7.44742C33.1018 6.04246 34.1025 4.98091 35.4472 4.98091C36.8078 4.98091 37.7613 6.02709 37.7613 7.44742C37.7613 8.85239 36.7765 9.89857 35.4319 9.89857ZM26.8003 3.24731C25.5807 3.24731 24.783 3.74676 24.3139 4.44954V3.40336H22.453V11.4749H24.3293V7.08806C24.3293 5.8545 25.1111 4.98032 26.2681 4.98032C27.3473 4.98032 28.0193 5.74516 28.0193 6.85399V11.4755H29.8956V6.71391C29.8962 4.6836 28.8489 3.24731 26.8003 3.24731ZM65 7.18204C65 4.87156 63.3113 3.2479 61.0438 3.2479C58.6359 3.2479 56.8688 5.05893 56.8688 7.44742C56.8688 9.96123 58.761 11.6316 61.0751 11.6316C63.0299 11.6316 64.5622 10.476 64.9528 8.83702H62.998C62.7166 9.55516 62.0286 9.96123 61.1058 9.96123C59.9016 9.96123 58.9947 9.21176 58.7917 7.90018H64.9994V7.18204H65ZM58.9015 6.55728C59.1988 5.43307 60.0432 4.88693 61.0126 4.88693C62.0758 4.88693 62.8889 5.49573 63.0765 6.55728H58.9015Z",
|
|
8
|
+
fill: "currentColor"
|
|
9
|
+
}
|
|
10
|
+
) });
|
|
14
11
|
export {
|
|
15
|
-
|
|
12
|
+
Z as IconCoinbaseWordmark
|
|
16
13
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as o, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { SvgIcon as r } from "./SvgIcon.js";
|
|
4
|
+
const i = (t) => /* @__PURE__ */ o(r, { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", ...t, children: [
|
|
5
|
+
/* @__PURE__ */ C("path", { d: "M2.82585 7.66341C4.02246 7.66341 4.99251 6.69336 4.99251 5.49674C4.99251 4.30013 4.02246 3.33008 2.82585 3.33008C1.62923 3.33008 0.65918 4.30013 0.65918 5.49674C0.65918 6.69336 1.62923 7.66341 2.82585 7.66341ZM2.82585 6.33008C2.36561 6.33008 1.99251 5.95698 1.99251 5.49674C1.99251 5.03651 2.36561 4.66341 2.82585 4.66341C3.28608 4.66341 3.65918 5.03651 3.65918 5.49674C3.65918 5.95698 3.28608 6.33008 2.82585 6.33008Z" }),
|
|
6
|
+
/* @__PURE__ */ C("path", { d: "M13.1592 7.66341C14.3558 7.66341 15.3258 6.69336 15.3258 5.49674C15.3258 4.30013 14.3558 3.33008 13.1592 3.33008C11.9626 3.33008 10.9925 4.30013 10.9925 5.49674C10.9925 6.69336 11.9626 7.66341 13.1592 7.66341ZM13.1592 6.33008C12.6989 6.33008 12.3258 5.95698 12.3258 5.49674C12.3258 5.03651 12.6989 4.66341 13.1592 4.66341C13.6194 4.66341 13.9925 5.03651 13.9925 5.49674C13.9925 5.95698 13.6194 6.33008 13.1592 6.33008Z" }),
|
|
7
|
+
/* @__PURE__ */ C("path", { d: "M10.1592 5.49674C10.1592 6.69336 9.18913 7.66341 7.99251 7.66341C6.7959 7.66341 5.82585 6.69336 5.82585 5.49674C5.82585 4.30013 6.7959 3.33008 7.99251 3.33008C9.18913 3.33008 10.1592 4.30013 10.1592 5.49674ZM8.82585 5.49674C8.82585 5.03651 8.45275 4.66341 7.99251 4.66341C7.53228 4.66341 7.15918 5.03651 7.15918 5.49674C7.15918 5.95698 7.53228 6.33008 7.99251 6.33008C8.45275 6.33008 8.82585 5.95698 8.82585 5.49674Z" }),
|
|
8
|
+
/* @__PURE__ */ C("path", { d: "M10.6592 12.6634C9.46256 12.6634 8.49251 11.6934 8.49251 10.4967C8.49251 9.30013 9.46256 8.33008 10.6592 8.33008C11.8558 8.33008 12.8258 9.30013 12.8258 10.4967C12.8258 11.6934 11.8558 12.6634 10.6592 12.6634ZM10.6592 11.3301C11.1194 11.3301 11.4925 10.957 11.4925 10.4967C11.4925 10.0365 11.1194 9.66341 10.6592 9.66341C10.1989 9.66341 9.82585 10.0365 9.82585 10.4967C9.82585 10.957 10.1989 11.3301 10.6592 11.3301Z" }),
|
|
9
|
+
/* @__PURE__ */ C("path", { d: "M7.49251 10.4967C7.49251 11.6934 6.52246 12.6634 5.32585 12.6634C4.12923 12.6634 3.15918 11.6934 3.15918 10.4967C3.15918 9.30013 4.12923 8.33008 5.32585 8.33008C6.52246 8.33008 7.49251 9.30013 7.49251 10.4967ZM6.15918 10.4967C6.15918 10.0365 5.78608 9.66341 5.32585 9.66341C4.86561 9.66341 4.49251 10.0365 4.49251 10.4967C4.49251 10.957 4.86561 11.3301 5.32585 11.3301C5.78608 11.3301 6.15918 10.957 6.15918 10.4967Z" })
|
|
10
|
+
] });
|
|
11
|
+
export {
|
|
12
|
+
i as IconPinCode
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { SvgIcon as t } from "./SvgIcon.js";
|
|
4
|
+
const h = (r) => /* @__PURE__ */ o(t, { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", ...r, children: /* @__PURE__ */ o("path", { d: "M1.99997 3.99512L2.03005 11.9951C2.92005 20.0868 12.0001 22.9951 12.0001 22.9951C12.0001 22.9951 21.1101 20.2785 22.0001 12.1868V3.99512L12.0001 0.995117L1.99997 3.99512ZM10.9702 20.39C10.2594 20.0375 9.39941 19.5503 8.52813 18.9142C6.41552 17.3718 4.41951 15.0988 4.02962 11.8765L4.00557 5.4815L10.9702 3.39213V20.39ZM15.5109 18.9928C14.5994 19.6379 13.6998 20.1206 12.9702 20.4605V3.37422L20.0001 5.48318V12.0717C19.6103 15.2799 17.6195 17.5005 15.5109 18.9928Z" }) });
|
|
5
|
+
export {
|
|
6
|
+
h as IconShield
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { SvgIcon as t } from "./SvgIcon.js";
|
|
4
|
+
const e = (r) => /* @__PURE__ */ o(t, { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", ...r, children: /* @__PURE__ */ o("path", { d: "M3.98877 0V24H19.9888V0H3.98877ZM17.9888 2V4H5.98877V2H17.9888ZM17.9888 6V18H5.98877V6H17.9888ZM5.98877 22V20H17.9888V22H5.98877Z" }) });
|
|
5
|
+
export {
|
|
6
|
+
e as IconSmartPhone
|
|
7
|
+
};
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ export * from './IconExclamationCircle';
|
|
|
10
10
|
export * from './IconExclamationTriangle';
|
|
11
11
|
export * from './IconGoogleLogo';
|
|
12
12
|
export * from './IconLock';
|
|
13
|
-
export * from './IconPhone';
|
|
14
|
-
export * from './IconXMark';
|
|
15
13
|
export * from './IconMinus';
|
|
14
|
+
export * from './IconPhone';
|
|
15
|
+
export * from './IconPinCode';
|
|
16
16
|
export * from './IconPlus';
|
|
17
|
+
export * from './IconShield';
|
|
18
|
+
export * from './IconSmartPhone';
|
|
19
|
+
export * from './IconXMark';
|
package/dist/icons/index.js
CHANGED
|
@@ -3,32 +3,38 @@ import { IconArrowLeft as c } from "./IconArrowLeft.js";
|
|
|
3
3
|
import { IconArrowsUpDown as t } from "./IconArrowsUpDown.js";
|
|
4
4
|
import { IconCheck as x } from "./IconCheck.js";
|
|
5
5
|
import { IconCheckCircle as I } from "./IconCheckCircle.js";
|
|
6
|
-
import { IconChevronDown as
|
|
6
|
+
import { IconChevronDown as i } from "./IconChevronDown.js";
|
|
7
7
|
import { IconCopy as C } from "./IconCopy.js";
|
|
8
|
-
import { IconEnvelope as
|
|
8
|
+
import { IconEnvelope as g } from "./IconEnvelope.js";
|
|
9
9
|
import { IconExclamationCircle as w } from "./IconExclamationCircle.js";
|
|
10
|
-
import { IconExclamationTriangle as
|
|
11
|
-
import { IconGoogleLogo as
|
|
12
|
-
import { IconLock as
|
|
10
|
+
import { IconExclamationTriangle as P } from "./IconExclamationTriangle.js";
|
|
11
|
+
import { IconGoogleLogo as A } from "./IconGoogleLogo.js";
|
|
12
|
+
import { IconLock as d } from "./IconLock.js";
|
|
13
|
+
import { IconMinus as v } from "./IconMinus.js";
|
|
13
14
|
import { IconPhone as M } from "./IconPhone.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { IconPinCode as y } from "./IconPinCode.js";
|
|
16
|
+
import { IconPlus as T } from "./IconPlus.js";
|
|
17
|
+
import { IconShield as X } from "./IconShield.js";
|
|
18
|
+
import { IconSmartPhone as j } from "./IconSmartPhone.js";
|
|
19
|
+
import { IconXMark as z } from "./IconXMark.js";
|
|
17
20
|
export {
|
|
18
21
|
e as IconAppleLogo,
|
|
19
22
|
c as IconArrowLeft,
|
|
20
23
|
t as IconArrowsUpDown,
|
|
21
24
|
x as IconCheck,
|
|
22
25
|
I as IconCheckCircle,
|
|
23
|
-
|
|
26
|
+
i as IconChevronDown,
|
|
24
27
|
C as IconCopy,
|
|
25
|
-
|
|
28
|
+
g as IconEnvelope,
|
|
26
29
|
w as IconExclamationCircle,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
P as IconExclamationTriangle,
|
|
31
|
+
A as IconGoogleLogo,
|
|
32
|
+
d as IconLock,
|
|
33
|
+
v as IconMinus,
|
|
31
34
|
M as IconPhone,
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
y as IconPinCode,
|
|
36
|
+
T as IconPlus,
|
|
37
|
+
X as IconShield,
|
|
38
|
+
j as IconSmartPhone,
|
|
39
|
+
z as IconXMark
|
|
34
40
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './components/CDPReactProvider';
|
|
|
3
3
|
export * from './components/CopyAddress';
|
|
4
4
|
export * from './components/CopyEvmKeyButton';
|
|
5
5
|
export * from './components/CopySolanaKeyButton';
|
|
6
|
+
export * from './components/EnrollMfa';
|
|
7
|
+
export * from './components/EnrollMfaModal';
|
|
6
8
|
export * from './components/ExportWallet';
|
|
7
9
|
export * from './components/ExportWalletModal';
|
|
8
10
|
export * from './components/Fund';
|
|
@@ -15,9 +17,13 @@ export * from './components/SignIn';
|
|
|
15
17
|
export * from './components/SignInModal';
|
|
16
18
|
export * from './components/SignOutButton';
|
|
17
19
|
export * from './components/ThemeProvider';
|
|
20
|
+
export * from './components/VerifyMfa';
|
|
21
|
+
export * from './components/VerifyMfaModal';
|
|
22
|
+
export * from './components/VerifyMfaInline';
|
|
18
23
|
export * from './components/ui/Button';
|
|
19
24
|
export * from './components/ui/Modal';
|
|
20
25
|
export * from './theme';
|
|
21
26
|
export * from './icons';
|
|
22
27
|
export * from './utils';
|
|
28
|
+
export { useVerifyMfaModal, type UseVerifyMfaModalOptions, type UseVerifyMfaModalReturn, } from './hooks/useVerifyMfaModal';
|
|
23
29
|
export { type IframeTheme } from './types/secureIframe';
|