@crossmint/client-sdk-react-native-ui 0.13.27 → 0.13.29
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/dist/chunk-24MMQ2R4.js +15 -0
- package/dist/chunk-24MMQ2R4.js.map +1 -0
- package/dist/chunk-2DNOAXOE.mjs +8 -0
- package/dist/chunk-2DNOAXOE.mjs.map +1 -0
- package/dist/chunk-2TEAOLM6.mjs +149 -0
- package/dist/chunk-2TEAOLM6.mjs.map +1 -0
- package/dist/chunk-34OVOZB2.mjs +111 -0
- package/dist/chunk-34OVOZB2.mjs.map +1 -0
- package/dist/chunk-3AWDWMZ2.mjs +18 -0
- package/dist/chunk-3AWDWMZ2.mjs.map +1 -0
- package/dist/chunk-3PJ6FXFT.mjs +1 -0
- package/dist/chunk-3PJ6FXFT.mjs.map +1 -0
- package/dist/chunk-3SFSPJXM.mjs +55 -0
- package/dist/chunk-3SFSPJXM.mjs.map +1 -0
- package/dist/chunk-4AJTICKY.mjs +44 -0
- package/dist/chunk-4AJTICKY.mjs.map +1 -0
- package/dist/chunk-4HKXTAVR.js +14 -0
- package/dist/chunk-4HKXTAVR.js.map +1 -0
- package/dist/chunk-4V7NDO5X.mjs +157 -0
- package/dist/chunk-4V7NDO5X.mjs.map +1 -0
- package/dist/chunk-4WJIXD7U.mjs +14 -0
- package/dist/chunk-4WJIXD7U.mjs.map +1 -0
- package/dist/chunk-5V6ONJWT.mjs +61 -0
- package/dist/chunk-5V6ONJWT.mjs.map +1 -0
- package/dist/chunk-5ZBDQUNG.js +1 -0
- package/dist/chunk-5ZBDQUNG.js.map +1 -0
- package/dist/chunk-6S5SEVGS.js +17 -0
- package/dist/chunk-6S5SEVGS.js.map +1 -0
- package/dist/chunk-6Z74KC25.mjs +1 -0
- package/dist/chunk-6Z74KC25.mjs.map +1 -0
- package/dist/chunk-7SPIOD4K.mjs +66 -0
- package/dist/chunk-7SPIOD4K.mjs.map +1 -0
- package/dist/chunk-ALMDA3KN.mjs +199 -0
- package/dist/chunk-ALMDA3KN.mjs.map +1 -0
- package/dist/chunk-BE4HT2U7.mjs +1 -0
- package/dist/chunk-BE4HT2U7.mjs.map +1 -0
- package/dist/chunk-BTH5QRIT.js +149 -0
- package/dist/chunk-BTH5QRIT.js.map +1 -0
- package/dist/chunk-BUB4U2GE.js +44 -0
- package/dist/chunk-BUB4U2GE.js.map +1 -0
- package/dist/chunk-BUTZZ7JB.js +36 -0
- package/dist/chunk-BUTZZ7JB.js.map +1 -0
- package/dist/chunk-CFHHVHNZ.mjs +157 -0
- package/dist/chunk-CFHHVHNZ.mjs.map +1 -0
- package/dist/chunk-CV6RWU2T.js +50 -0
- package/dist/chunk-CV6RWU2T.js.map +1 -0
- package/dist/chunk-DD2MVD6A.mjs +36 -0
- package/dist/chunk-DD2MVD6A.mjs.map +1 -0
- package/dist/chunk-EKXEDMRD.mjs +71 -0
- package/dist/chunk-EKXEDMRD.mjs.map +1 -0
- package/dist/chunk-FCDPEDXH.mjs +148 -0
- package/dist/chunk-FCDPEDXH.mjs.map +1 -0
- package/dist/chunk-FQID5LOL.js +22 -0
- package/dist/chunk-FQID5LOL.js.map +1 -0
- package/dist/chunk-FRD6HEIM.mjs +22 -0
- package/dist/chunk-FRD6HEIM.mjs.map +1 -0
- package/dist/chunk-GYBEEYGB.mjs +1 -0
- package/dist/chunk-GYBEEYGB.mjs.map +1 -0
- package/dist/chunk-HELXBZ7D.js +18 -0
- package/dist/chunk-HELXBZ7D.js.map +1 -0
- package/dist/chunk-IBQK5B7B.js +71 -0
- package/dist/chunk-IBQK5B7B.js.map +1 -0
- package/dist/chunk-IHZNXV5S.js +1 -0
- package/dist/chunk-IHZNXV5S.js.map +1 -0
- package/dist/chunk-IMME6ZBV.js +61 -0
- package/dist/chunk-IMME6ZBV.js.map +1 -0
- package/dist/chunk-J2MDWDV6.mjs +1 -0
- package/dist/chunk-J2MDWDV6.mjs.map +1 -0
- package/dist/chunk-KK4SQ7WF.js +1 -0
- package/dist/chunk-KK4SQ7WF.js.map +1 -0
- package/dist/chunk-KOUCOMBE.js +148 -0
- package/dist/chunk-KOUCOMBE.js.map +1 -0
- package/dist/chunk-MMVER6VO.js +1 -0
- package/dist/chunk-MMVER6VO.js.map +1 -0
- package/dist/chunk-MVLQR6RI.js +199 -0
- package/dist/chunk-MVLQR6RI.js.map +1 -0
- package/dist/chunk-NBWATZY4.js +157 -0
- package/dist/chunk-NBWATZY4.js.map +1 -0
- package/dist/chunk-OTRMAWWU.js +55 -0
- package/dist/chunk-OTRMAWWU.js.map +1 -0
- package/dist/chunk-P35PHJU5.mjs +17 -0
- package/dist/chunk-P35PHJU5.mjs.map +1 -0
- package/dist/chunk-PUTC7LI4.mjs +348 -0
- package/dist/chunk-PUTC7LI4.mjs.map +1 -0
- package/dist/chunk-Q2Y5CZT4.js +157 -0
- package/dist/chunk-Q2Y5CZT4.js.map +1 -0
- package/dist/chunk-Q7YPX4RJ.js +66 -0
- package/dist/chunk-Q7YPX4RJ.js.map +1 -0
- package/dist/chunk-R47XMJ32.js +1 -0
- package/dist/chunk-R47XMJ32.js.map +1 -0
- package/dist/chunk-RSCBYS6I.mjs +15 -0
- package/dist/chunk-RSCBYS6I.mjs.map +1 -0
- package/dist/chunk-RTLOANMR.mjs +50 -0
- package/dist/chunk-RTLOANMR.mjs.map +1 -0
- package/dist/chunk-S3OC5AT3.mjs +24 -0
- package/dist/chunk-S3OC5AT3.mjs.map +1 -0
- package/dist/chunk-SHSENRY7.js +24 -0
- package/dist/chunk-SHSENRY7.js.map +1 -0
- package/dist/chunk-TNPZITVL.mjs +1 -0
- package/dist/chunk-TNPZITVL.mjs.map +1 -0
- package/dist/chunk-UNIFCVYR.js +348 -0
- package/dist/chunk-UNIFCVYR.js.map +1 -0
- package/dist/chunk-VCF2YXCO.js +208 -0
- package/dist/chunk-VCF2YXCO.js.map +1 -0
- package/dist/chunk-XNVZRSGL.js +111 -0
- package/dist/chunk-XNVZRSGL.js.map +1 -0
- package/dist/chunk-XUGJXLWC.js +8 -0
- package/dist/chunk-XUGJXLWC.js.map +1 -0
- package/dist/chunk-XXJ7LQ44.js +1 -0
- package/dist/chunk-XXJ7LQ44.js.map +1 -0
- package/dist/chunk-Z7Y7COJM.mjs +208 -0
- package/dist/chunk-Z7Y7COJM.mjs.map +1 -0
- package/dist/components/embed/index.js +16 -1
- package/dist/components/embed/index.js.map +1 -0
- package/dist/components/embed/index.mjs +16 -1
- package/dist/components/embed/index.mjs.map +1 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +14 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js.map +1 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.mjs +14 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.mjs.map +1 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js +13 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js.map +1 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.mjs +13 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.mjs.map +1 -0
- package/dist/components/embed/v3/crypto/PayerConnectionHandler.js +8 -1
- package/dist/components/embed/v3/crypto/PayerConnectionHandler.js.map +1 -0
- package/dist/components/embed/v3/crypto/PayerConnectionHandler.mjs +8 -1
- package/dist/components/embed/v3/crypto/PayerConnectionHandler.mjs.map +1 -0
- package/dist/components/embed/v3/index.js +15 -1
- package/dist/components/embed/v3/index.js.map +1 -0
- package/dist/components/embed/v3/index.mjs +15 -1
- package/dist/components/embed/v3/index.mjs.map +1 -0
- package/dist/components/index.js +34 -1
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +34 -1
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/signers/BaseCodeInput.js +9 -1
- package/dist/components/signers/BaseCodeInput.js.map +1 -0
- package/dist/components/signers/BaseCodeInput.mjs +9 -1
- package/dist/components/signers/BaseCodeInput.mjs.map +1 -0
- package/dist/components/signers/BaseConfirmation.js +9 -1
- package/dist/components/signers/BaseConfirmation.js.map +1 -0
- package/dist/components/signers/BaseConfirmation.mjs +9 -1
- package/dist/components/signers/BaseConfirmation.mjs.map +1 -0
- package/dist/components/signers/EmailSignersDialog.js +11 -1
- package/dist/components/signers/EmailSignersDialog.js.map +1 -0
- package/dist/components/signers/EmailSignersDialog.mjs +11 -1
- package/dist/components/signers/EmailSignersDialog.mjs.map +1 -0
- package/dist/components/signers/PhoneSignersDialog.js +11 -1
- package/dist/components/signers/PhoneSignersDialog.js.map +1 -0
- package/dist/components/signers/PhoneSignersDialog.mjs +11 -1
- package/dist/components/signers/PhoneSignersDialog.mjs.map +1 -0
- package/dist/components/signers/index.js +16 -1
- package/dist/components/signers/index.js.map +1 -0
- package/dist/components/signers/index.mjs +16 -1
- package/dist/components/signers/index.mjs.map +1 -0
- package/dist/components/wallets/ExportPrivateKeyButton.js +8 -1
- package/dist/components/wallets/ExportPrivateKeyButton.js.map +1 -0
- package/dist/components/wallets/ExportPrivateKeyButton.mjs +8 -1
- package/dist/components/wallets/ExportPrivateKeyButton.mjs.map +1 -0
- package/dist/components/wallets/index.js +9 -1
- package/dist/components/wallets/index.js.map +1 -0
- package/dist/components/wallets/index.mjs +9 -1
- package/dist/components/wallets/index.mjs.map +1 -0
- package/dist/hooks/index.js +26 -1
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +26 -1
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/useAuth.js +14 -1
- package/dist/hooks/useAuth.js.map +1 -0
- package/dist/hooks/useAuth.mjs +14 -1
- package/dist/hooks/useAuth.mjs.map +1 -0
- package/dist/hooks/useCrossmintCheckout.js +11 -1
- package/dist/hooks/useCrossmintCheckout.js.map +1 -0
- package/dist/hooks/useCrossmintCheckout.mjs +11 -1
- package/dist/hooks/useCrossmintCheckout.mjs.map +1 -0
- package/dist/hooks/useWalletEmailSigner.js +8 -1
- package/dist/hooks/useWalletEmailSigner.js.map +1 -0
- package/dist/hooks/useWalletEmailSigner.mjs +8 -1
- package/dist/hooks/useWalletEmailSigner.mjs.map +1 -0
- package/dist/index.js +79 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +79 -1
- package/dist/index.mjs.map +1 -0
- package/dist/logger/init.js +9 -1
- package/dist/logger/init.js.map +1 -0
- package/dist/logger/init.mjs +9 -1
- package/dist/logger/init.mjs.map +1 -0
- package/dist/plugin/mods/addQueryToAndroidManifest.js +8 -1
- package/dist/plugin/mods/addQueryToAndroidManifest.js.map +1 -0
- package/dist/plugin/mods/addQueryToAndroidManifest.mjs +8 -1
- package/dist/plugin/mods/addQueryToAndroidManifest.mjs.map +1 -0
- package/dist/plugin/withGooglePay.js +57 -1
- package/dist/plugin/withGooglePay.js.map +1 -0
- package/dist/plugin/withGooglePay.mjs +57 -1
- package/dist/plugin/withGooglePay.mjs.map +1 -0
- package/dist/providers/CrossmintAuthProvider.js +14 -1
- package/dist/providers/CrossmintAuthProvider.js.map +1 -0
- package/dist/providers/CrossmintAuthProvider.mjs +14 -1
- package/dist/providers/CrossmintAuthProvider.mjs.map +1 -0
- package/dist/providers/CrossmintProvider.js +12 -1
- package/dist/providers/CrossmintProvider.js.map +1 -0
- package/dist/providers/CrossmintProvider.mjs +12 -1
- package/dist/providers/CrossmintProvider.mjs.map +1 -0
- package/dist/providers/CrossmintWalletProvider.js +16 -1
- package/dist/providers/CrossmintWalletProvider.js.map +1 -0
- package/dist/providers/CrossmintWalletProvider.mjs +16 -1
- package/dist/providers/CrossmintWalletProvider.mjs.map +1 -0
- package/dist/providers/index.js +28 -1
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/index.mjs +28 -1
- package/dist/providers/index.mjs.map +1 -0
- package/dist/styles/index.js +8 -1
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/index.mjs +8 -1
- package/dist/styles/index.mjs.map +1 -0
- package/dist/styles/theme.js +8 -1
- package/dist/styles/theme.js.map +1 -0
- package/dist/styles/theme.mjs +8 -1
- package/dist/styles/theme.mjs.map +1 -0
- package/dist/types/auth.js +1 -1
- package/dist/types/auth.js.map +1 -0
- package/dist/types/auth.mjs +1 -0
- package/dist/types/auth.mjs.map +1 -0
- package/dist/utils/SecureStorage.js +8 -1
- package/dist/utils/SecureStorage.js.map +1 -0
- package/dist/utils/SecureStorage.mjs +8 -1
- package/dist/utils/SecureStorage.mjs.map +1 -0
- package/dist/utils/createCrossmintApiClient.js +9 -1
- package/dist/utils/createCrossmintApiClient.js.map +1 -0
- package/dist/utils/createCrossmintApiClient.mjs +9 -1
- package/dist/utils/createCrossmintApiClient.mjs.map +1 -0
- package/dist/utils/embed/userAgent.js +12 -1
- package/dist/utils/embed/userAgent.js.map +1 -0
- package/dist/utils/embed/userAgent.mjs +12 -1
- package/dist/utils/embed/userAgent.mjs.map +1 -0
- package/dist/utils/eventEmitter.js +8 -1
- package/dist/utils/eventEmitter.js.map +1 -0
- package/dist/utils/eventEmitter.mjs +8 -1
- package/dist/utils/eventEmitter.mjs.map +1 -0
- package/package.json +54 -58
- package/dist/chunk-26ALKCF5.js +0 -1
- package/dist/chunk-2D2RJCVX.js +0 -1
- package/dist/chunk-2PX34LDU.js +0 -1
- package/dist/chunk-3HU2PILN.js +0 -1
- package/dist/chunk-3QSVHCEH.mjs +0 -2
- package/dist/chunk-3RE54L4I.js +0 -1
- package/dist/chunk-5CLFJLE4.mjs +0 -0
- package/dist/chunk-5ZNJIO4M.js +0 -1
- package/dist/chunk-72MMCJ2E.js +0 -1
- package/dist/chunk-77GXCNDP.js +0 -1
- package/dist/chunk-7USVT6EZ.mjs +0 -1
- package/dist/chunk-7YKYLQL6.mjs +0 -1
- package/dist/chunk-AJMHVVST.js +0 -1
- package/dist/chunk-ASFGJDGB.mjs +0 -1
- package/dist/chunk-AV236X3H.mjs +0 -1
- package/dist/chunk-C62HRWJA.js +0 -1
- package/dist/chunk-D4347S2W.mjs +0 -1
- package/dist/chunk-D5QADN6Z.mjs +0 -1
- package/dist/chunk-DC5HCBPK.js +0 -1
- package/dist/chunk-DKQZSNOO.js +0 -1
- package/dist/chunk-EF2YTIUF.mjs +0 -1
- package/dist/chunk-EF5KYLDO.js +0 -1
- package/dist/chunk-EI5LOD4Y.js +0 -1
- package/dist/chunk-EJO7BAXE.js +0 -1
- package/dist/chunk-F7VXWATP.js +0 -1
- package/dist/chunk-FEGPD4LZ.mjs +0 -1
- package/dist/chunk-FFQ6EQCL.mjs +0 -1
- package/dist/chunk-FX23A4BR.mjs +0 -1
- package/dist/chunk-I3QSTPTV.mjs +0 -0
- package/dist/chunk-I4D3YJW2.js +0 -1
- package/dist/chunk-IDJHXN7Q.js +0 -1
- package/dist/chunk-IUDQDPIN.mjs +0 -1
- package/dist/chunk-J2XU2BUG.mjs +0 -1
- package/dist/chunk-J42HASCI.js +0 -1
- package/dist/chunk-J477SX6P.mjs +0 -1
- package/dist/chunk-J7Q2R6UH.mjs +0 -0
- package/dist/chunk-LK3AO6AY.mjs +0 -1
- package/dist/chunk-LOFHVHXQ.js +0 -1
- package/dist/chunk-MB7H3PBJ.mjs +0 -0
- package/dist/chunk-MKCQJOIO.js +0 -1
- package/dist/chunk-MVVSGLQL.js +0 -2
- package/dist/chunk-PCJMDUSI.mjs +0 -1
- package/dist/chunk-PSSAAY7D.mjs +0 -1
- package/dist/chunk-RQ5I5OCQ.mjs +0 -1
- package/dist/chunk-SHTETN4C.js +0 -1
- package/dist/chunk-TCTH7JIY.js +0 -1
- package/dist/chunk-TIQGKXQA.mjs +0 -0
- package/dist/chunk-TYFMPXM4.mjs +0 -1
- package/dist/chunk-UA34B5QB.js +0 -1
- package/dist/chunk-UBHIBMTA.mjs +0 -0
- package/dist/chunk-VACQTZRT.js +0 -1
- package/dist/chunk-XNDIT72O.mjs +0 -2
- package/dist/chunk-YJORUMPB.js +0 -2
- package/dist/chunk-YLJDAK2S.mjs +0 -1
- package/dist/chunk-YQEWHOQ7.js +0 -1
- package/dist/chunk-ZCKUSOGC.mjs +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }// src/utils/embed/userAgent.ts
|
|
2
|
+
var _reactnative = require('react-native');
|
|
3
|
+
var _expodevice = require('expo-device'); var Device = _interopRequireWildcard(_expodevice);
|
|
4
|
+
var osVersion2 = Device.osVersion || "0";
|
|
5
|
+
var modelName2 = Device.modelName || "Unknown";
|
|
6
|
+
var userAgent = _reactnative.Platform.OS === "ios" ? `Mozilla/5.0 (iPhone; CPU iPhone OS ${osVersion2.toString().replace(/\./g, "_")} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/${Math.floor(
|
|
7
|
+
Number(osVersion2) / 2
|
|
8
|
+
)}.0 Mobile/15E148 Safari/604.1` : `Mozilla/5.0 (Linux; Android ${osVersion2}; ${modelName2}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.181 Mobile Safari/537.36`;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.osVersion = osVersion2; exports.modelName = modelName2; exports.userAgent = userAgent;
|
|
15
|
+
//# sourceMappingURL=chunk-24MMQ2R4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/embed/userAgent.ts"],"names":["osVersion","modelName"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,YAAY,YAAY;AAEjB,IAAMA,aAAmB,oBAAa;AACtC,IAAMC,aAAmB,oBAAa;AAEtC,IAAM,YACT,SAAS,OAAO,QACV,sCAAsCD,WACjC,SAAS,EACT,QAAQ,OAAO,GAAG,CAAC,oEAAoE,KAAK;AAAA,EAC7F,OAAOA,UAAS,IAAI;AACxB,CAAC,kCACD,+BAA+BA,UAAS,KAAKC,UAAS","sourcesContent":["import { Platform } from \"react-native\";\nimport * as Device from \"expo-device\";\n\nexport const osVersion = Device.osVersion || \"0\";\nexport const modelName = Device.modelName || \"Unknown\";\n\nexport const userAgent =\n Platform.OS === \"ios\"\n ? `Mozilla/5.0 (iPhone; CPU iPhone OS ${osVersion\n .toString()\n .replace(/\\./g, \"_\")} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/${Math.floor(\n Number(osVersion) / 2\n )}.0 Mobile/15E148 Safari/604.1`\n : `Mozilla/5.0 (Linux; Android ${osVersion}; ${modelName}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.181 Mobile Safari/537.36`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/eventEmitter.ts"],"sourcesContent":["import type { Order } from \"@crossmint/client-sdk-base\";\nimport mitt from \"mitt\";\n\nexport type LocalEventEmitterEvents = {\n \"order:updated\": {\n order?: Order;\n orderClientSecret?: string;\n };\n \"order:creation-failed\": {\n errorMessage: string;\n };\n};\n\n// Create a singleton instance for global use\nexport const localEventEmitter = mitt<LocalEventEmitterEvents>();\n"],"mappings":";AACA,OAAO,UAAU;AAaV,IAAM,oBAAoB,KAA8B;","names":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
theme
|
|
3
|
+
} from "./chunk-3AWDWMZ2.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__async
|
|
6
|
+
} from "./chunk-7SPIOD4K.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/signers/BaseConfirmation.tsx
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { View, Text, TouchableOpacity, StyleSheet, ActivityIndicator } from "react-native";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function BaseConfirmation({
|
|
13
|
+
contactInfo,
|
|
14
|
+
contactType,
|
|
15
|
+
icon,
|
|
16
|
+
onConfirm,
|
|
17
|
+
onCancel,
|
|
18
|
+
appearance
|
|
19
|
+
}) {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
21
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
22
|
+
const [error, setError] = useState(null);
|
|
23
|
+
const handleConfirm = () => __async(this, null, function* () {
|
|
24
|
+
setIsLoading(true);
|
|
25
|
+
setError(null);
|
|
26
|
+
try {
|
|
27
|
+
yield onConfirm();
|
|
28
|
+
} catch (error2) {
|
|
29
|
+
console.error(`Failed to send ${contactType} code`, error2);
|
|
30
|
+
setError(`Failed to send ${contactType === "email" ? "email" : "SMS"}. Please try again.`);
|
|
31
|
+
} finally {
|
|
32
|
+
setIsLoading(false);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const dynamicStyles = StyleSheet.create({
|
|
36
|
+
container: {
|
|
37
|
+
width: "100%"
|
|
38
|
+
},
|
|
39
|
+
title: {
|
|
40
|
+
fontSize: 24,
|
|
41
|
+
fontWeight: "600",
|
|
42
|
+
color: ((_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary) || theme["cm-text-primary"],
|
|
43
|
+
textAlign: "center",
|
|
44
|
+
marginBottom: 8
|
|
45
|
+
},
|
|
46
|
+
description: {
|
|
47
|
+
fontSize: 16,
|
|
48
|
+
color: ((_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.textSecondary) || theme["cm-text-secondary"],
|
|
49
|
+
textAlign: "center",
|
|
50
|
+
marginBottom: 24,
|
|
51
|
+
lineHeight: 22
|
|
52
|
+
},
|
|
53
|
+
contactContainer: {
|
|
54
|
+
borderWidth: 1,
|
|
55
|
+
borderColor: ((_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.border) || theme["cm-border"],
|
|
56
|
+
borderRadius: (appearance == null ? void 0 : appearance.borderRadius) || 12,
|
|
57
|
+
padding: 16,
|
|
58
|
+
marginBottom: 24,
|
|
59
|
+
flexDirection: "row",
|
|
60
|
+
alignItems: "center"
|
|
61
|
+
},
|
|
62
|
+
contactText: {
|
|
63
|
+
fontSize: 16,
|
|
64
|
+
color: ((_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary) || theme["cm-text-primary"],
|
|
65
|
+
marginLeft: 12,
|
|
66
|
+
flex: 1
|
|
67
|
+
},
|
|
68
|
+
errorText: {
|
|
69
|
+
fontSize: 14,
|
|
70
|
+
color: ((_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.danger) || theme["cm-danger"],
|
|
71
|
+
textAlign: "center",
|
|
72
|
+
marginBottom: 16
|
|
73
|
+
},
|
|
74
|
+
buttonContainer: {
|
|
75
|
+
flexDirection: "row",
|
|
76
|
+
gap: 12
|
|
77
|
+
},
|
|
78
|
+
button: {
|
|
79
|
+
flex: 1,
|
|
80
|
+
paddingVertical: 16,
|
|
81
|
+
paddingHorizontal: 24,
|
|
82
|
+
borderRadius: 999,
|
|
83
|
+
alignItems: "center",
|
|
84
|
+
justifyContent: "center",
|
|
85
|
+
minHeight: 52
|
|
86
|
+
},
|
|
87
|
+
primaryButton: {
|
|
88
|
+
backgroundColor: ((_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.accent) || theme["cm-accent"]
|
|
89
|
+
},
|
|
90
|
+
secondaryButton: {
|
|
91
|
+
backgroundColor: "transparent",
|
|
92
|
+
borderWidth: 1,
|
|
93
|
+
borderColor: ((_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.border) || theme["cm-border"]
|
|
94
|
+
},
|
|
95
|
+
disabledButton: {
|
|
96
|
+
opacity: 0.6
|
|
97
|
+
},
|
|
98
|
+
buttonText: {
|
|
99
|
+
fontSize: 16,
|
|
100
|
+
fontWeight: "500",
|
|
101
|
+
color: ((_h = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _h.background) || theme["cm-background-primary"]
|
|
102
|
+
},
|
|
103
|
+
secondaryButtonText: {
|
|
104
|
+
color: ((_i = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _i.textPrimary) || theme["cm-text-primary"]
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return /* @__PURE__ */ jsxs(View, { style: dynamicStyles.container, children: [
|
|
108
|
+
/* @__PURE__ */ jsx(Text, { style: dynamicStyles.title, children: "Confirm it's you" }),
|
|
109
|
+
/* @__PURE__ */ jsxs(Text, { style: dynamicStyles.description, children: [
|
|
110
|
+
"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code",
|
|
111
|
+
contactType === "phone" ? " via SMS" : "",
|
|
112
|
+
"."
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsxs(View, { style: dynamicStyles.contactContainer, children: [
|
|
115
|
+
icon,
|
|
116
|
+
/* @__PURE__ */ jsx(Text, { style: dynamicStyles.contactText, children: contactInfo })
|
|
117
|
+
] }),
|
|
118
|
+
error && /* @__PURE__ */ jsx(Text, { style: dynamicStyles.errorText, children: error }),
|
|
119
|
+
/* @__PURE__ */ jsxs(View, { style: dynamicStyles.buttonContainer, children: [
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
TouchableOpacity,
|
|
122
|
+
{
|
|
123
|
+
style: [dynamicStyles.button, dynamicStyles.secondaryButton],
|
|
124
|
+
onPress: onCancel,
|
|
125
|
+
disabled: isLoading,
|
|
126
|
+
children: /* @__PURE__ */ jsx(Text, { style: [dynamicStyles.buttonText, dynamicStyles.secondaryButtonText], children: "Cancel" })
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
TouchableOpacity,
|
|
131
|
+
{
|
|
132
|
+
style: [
|
|
133
|
+
dynamicStyles.button,
|
|
134
|
+
dynamicStyles.primaryButton,
|
|
135
|
+
isLoading && dynamicStyles.disabledButton
|
|
136
|
+
],
|
|
137
|
+
onPress: handleConfirm,
|
|
138
|
+
disabled: isLoading,
|
|
139
|
+
children: isLoading ? /* @__PURE__ */ jsx(ActivityIndicator, { color: ((_j = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _j.background) || theme["cm-background-primary"] }) : /* @__PURE__ */ jsx(Text, { style: dynamicStyles.buttonText, children: "Send code" })
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
] })
|
|
143
|
+
] });
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
BaseConfirmation
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=chunk-2TEAOLM6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/signers/BaseConfirmation.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { View, Text, TouchableOpacity, StyleSheet, ActivityIndicator } from \"react-native\";\nimport type { UIConfig } from \"@crossmint/common-sdk-base\";\nimport { theme } from \"../../styles/theme\";\n\ninterface BaseConfirmationProps {\n contactInfo: string;\n contactType: \"email\" | \"phone\";\n icon: ReactNode;\n onConfirm: () => Promise<void>;\n onCancel?: () => void;\n appearance?: UIConfig;\n}\n\nexport function BaseConfirmation({\n contactInfo,\n contactType,\n icon,\n onConfirm,\n onCancel,\n appearance,\n}: BaseConfirmationProps) {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleConfirm = async () => {\n setIsLoading(true);\n setError(null);\n try {\n await onConfirm();\n } catch (error) {\n console.error(`Failed to send ${contactType} code`, error);\n setError(`Failed to send ${contactType === \"email\" ? \"email\" : \"SMS\"}. Please try again.`);\n } finally {\n setIsLoading(false);\n }\n };\n\n const dynamicStyles = StyleSheet.create({\n container: {\n width: \"100%\",\n },\n title: {\n fontSize: 24,\n fontWeight: \"600\",\n color: appearance?.colors?.textPrimary || theme[\"cm-text-primary\"],\n textAlign: \"center\",\n marginBottom: 8,\n },\n description: {\n fontSize: 16,\n color: appearance?.colors?.textSecondary || theme[\"cm-text-secondary\"],\n textAlign: \"center\",\n marginBottom: 24,\n lineHeight: 22,\n },\n contactContainer: {\n borderWidth: 1,\n borderColor: appearance?.colors?.border || theme[\"cm-border\"],\n borderRadius: appearance?.borderRadius || 12,\n padding: 16,\n marginBottom: 24,\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n contactText: {\n fontSize: 16,\n color: appearance?.colors?.textPrimary || theme[\"cm-text-primary\"],\n marginLeft: 12,\n flex: 1,\n },\n errorText: {\n fontSize: 14,\n color: appearance?.colors?.danger || theme[\"cm-danger\"],\n textAlign: \"center\",\n marginBottom: 16,\n },\n buttonContainer: {\n flexDirection: \"row\",\n gap: 12,\n },\n button: {\n flex: 1,\n paddingVertical: 16,\n paddingHorizontal: 24,\n borderRadius: 999,\n alignItems: \"center\",\n justifyContent: \"center\",\n minHeight: 52,\n },\n primaryButton: {\n backgroundColor: appearance?.colors?.accent || theme[\"cm-accent\"],\n },\n secondaryButton: {\n backgroundColor: \"transparent\",\n borderWidth: 1,\n borderColor: appearance?.colors?.border || theme[\"cm-border\"],\n },\n disabledButton: {\n opacity: 0.6,\n },\n buttonText: {\n fontSize: 16,\n fontWeight: \"500\",\n color: appearance?.colors?.background || theme[\"cm-background-primary\"],\n },\n secondaryButtonText: {\n color: appearance?.colors?.textPrimary || theme[\"cm-text-primary\"],\n },\n });\n\n return (\n <View style={dynamicStyles.container}>\n <Text style={dynamicStyles.title}>Confirm it's you</Text>\n <Text style={dynamicStyles.description}>\n You're using this wallet for the first time on this device. Click 'Send code' to get a one-time\n verification code{contactType === \"phone\" ? \" via SMS\" : \"\"}.\n </Text>\n\n <View style={dynamicStyles.contactContainer}>\n {icon}\n <Text style={dynamicStyles.contactText}>{contactInfo}</Text>\n </View>\n\n {error && <Text style={dynamicStyles.errorText}>{error}</Text>}\n\n <View style={dynamicStyles.buttonContainer}>\n <TouchableOpacity\n style={[dynamicStyles.button, dynamicStyles.secondaryButton]}\n onPress={onCancel}\n disabled={isLoading}\n >\n <Text style={[dynamicStyles.buttonText, dynamicStyles.secondaryButtonText]}>Cancel</Text>\n </TouchableOpacity>\n\n <TouchableOpacity\n style={[\n dynamicStyles.button,\n dynamicStyles.primaryButton,\n isLoading && dynamicStyles.disabledButton,\n ]}\n onPress={handleConfirm}\n disabled={isLoading}\n >\n {isLoading ? (\n <ActivityIndicator color={appearance?.colors?.background || theme[\"cm-background-primary\"]} />\n ) : (\n <Text style={dynamicStyles.buttonText}>Send code</Text>\n )}\n </TouchableOpacity>\n </View>\n </View>\n );\n}\n"],"mappings":"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","names":["error"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "./chunk-7SPIOD4K.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/wallets/ExportPrivateKeyButton.tsx
|
|
6
|
+
import { useState, useCallback, useRef, useEffect } from "react";
|
|
7
|
+
import { View, Text, StyleSheet, Alert } from "react-native";
|
|
8
|
+
import { useWallet, useCrossmint } from "@crossmint/client-sdk-react-base";
|
|
9
|
+
import { environmentUrlConfig, exportSignerInboundEvents, exportSignerOutboundEvents } from "@crossmint/client-signers";
|
|
10
|
+
import { isExportableSigner } from "@crossmint/wallets-sdk";
|
|
11
|
+
import { validateAPIKey } from "@crossmint/common-sdk-base";
|
|
12
|
+
import { WebViewParent, RNWebView } from "@crossmint/client-sdk-rn-window";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
function ExportPrivateKeyButton({ appearance }) {
|
|
15
|
+
const { wallet } = useWallet();
|
|
16
|
+
const { crossmint } = useCrossmint();
|
|
17
|
+
const webViewRef = useRef(null);
|
|
18
|
+
const connectionRef = useRef(null);
|
|
19
|
+
const [frameUrl, setFrameUrl] = useState("");
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (crossmint != null) {
|
|
22
|
+
try {
|
|
23
|
+
const parsedAPIKey = validateAPIKey(crossmint.apiKey);
|
|
24
|
+
if (parsedAPIKey.isValid) {
|
|
25
|
+
const baseUrl = environmentUrlConfig[parsedAPIKey.environment];
|
|
26
|
+
setFrameUrl(`${baseUrl}/export`);
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error("Failed to get TEE URL:", error);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, [crossmint]);
|
|
33
|
+
const handleWebViewLoadEnd = useCallback(
|
|
34
|
+
(syntheticEvent) => __async(this, null, function* () {
|
|
35
|
+
if (wallet == null || webViewRef.current == null || syntheticEvent.nativeEvent.loading) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
if (isExportableSigner(wallet.signer)) {
|
|
40
|
+
const connection = new WebViewParent(webViewRef, {
|
|
41
|
+
incomingEvents: exportSignerOutboundEvents,
|
|
42
|
+
outgoingEvents: exportSignerInboundEvents
|
|
43
|
+
});
|
|
44
|
+
connectionRef.current = connection;
|
|
45
|
+
yield connection.handshakeWithChild();
|
|
46
|
+
yield wallet.signer._exportPrivateKey(connection);
|
|
47
|
+
}
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("Failed to export private key:", error);
|
|
50
|
+
Alert.alert("Export Failed", "Failed to export private key. Please try again.");
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
[wallet]
|
|
54
|
+
);
|
|
55
|
+
const handleWebViewError = useCallback((syntheticEvent) => {
|
|
56
|
+
const { nativeEvent } = syntheticEvent;
|
|
57
|
+
console.error("WebView error:", nativeEvent);
|
|
58
|
+
Alert.alert("Export Failed", "Failed to load export interface. Please try again.");
|
|
59
|
+
}, []);
|
|
60
|
+
const handleMessage = useCallback((event) => {
|
|
61
|
+
if (connectionRef.current) {
|
|
62
|
+
connectionRef.current.handleMessage(event);
|
|
63
|
+
}
|
|
64
|
+
}, []);
|
|
65
|
+
if (frameUrl === "" || wallet == null || !isExportableSigner(wallet.signer)) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ jsx(View, { style: styles.webViewContainer, children: /* @__PURE__ */ jsx(
|
|
69
|
+
RNWebView,
|
|
70
|
+
{
|
|
71
|
+
ref: webViewRef,
|
|
72
|
+
source: { uri: frameUrl },
|
|
73
|
+
style: styles.webView,
|
|
74
|
+
javaScriptEnabled: true,
|
|
75
|
+
domStorageEnabled: true,
|
|
76
|
+
onLoadEnd: handleWebViewLoadEnd,
|
|
77
|
+
onError: handleWebViewError,
|
|
78
|
+
onHttpError: handleWebViewError,
|
|
79
|
+
onMessage: handleMessage,
|
|
80
|
+
startInLoadingState: true,
|
|
81
|
+
renderLoading: () => /* @__PURE__ */ jsx(View, { style: styles.loadingContainer, children: /* @__PURE__ */ jsx(Text, { style: styles.loadingText, children: "Loading..." }) })
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
84
|
+
}
|
|
85
|
+
var styles = StyleSheet.create({
|
|
86
|
+
webViewContainer: {
|
|
87
|
+
height: 56,
|
|
88
|
+
borderWidth: 1,
|
|
89
|
+
borderColor: "#E5E5E5",
|
|
90
|
+
borderRadius: 12,
|
|
91
|
+
overflow: "hidden"
|
|
92
|
+
},
|
|
93
|
+
webView: {
|
|
94
|
+
flex: 1
|
|
95
|
+
},
|
|
96
|
+
loadingContainer: {
|
|
97
|
+
flex: 1,
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
backgroundColor: "#F5F5F5"
|
|
101
|
+
},
|
|
102
|
+
loadingText: {
|
|
103
|
+
fontSize: 16,
|
|
104
|
+
color: "#666666"
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
ExportPrivateKeyButton
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=chunk-34OVOZB2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/wallets/ExportPrivateKeyButton.tsx"],"sourcesContent":["import { useState, useCallback, useRef, useEffect } from \"react\";\nimport { View, Text, StyleSheet, Alert } from \"react-native\";\nimport type { WebView, WebViewMessageEvent } from \"react-native-webview\";\nimport { useWallet, useCrossmint } from \"@crossmint/client-sdk-react-base\";\nimport { environmentUrlConfig, exportSignerInboundEvents, exportSignerOutboundEvents } from \"@crossmint/client-signers\";\nimport { isExportableSigner } from \"@crossmint/wallets-sdk\";\nimport { validateAPIKey } from \"@crossmint/common-sdk-base\";\nimport type { UIConfig } from \"@crossmint/common-sdk-base\";\nimport { WebViewParent, RNWebView } from \"@crossmint/client-sdk-rn-window\";\n\nexport interface ExportPrivateKeyButtonProps {\n /** Optional appearance configuration for styling the export button. */\n appearance?: UIConfig;\n}\n\n/**\n * Renders a button that allows the user to export their wallet's private key.\n * Only works with email and phone signers. Will not render for passkey or external wallet signers.\n */\nexport function ExportPrivateKeyButton({ appearance }: ExportPrivateKeyButtonProps) {\n const { wallet } = useWallet();\n const { crossmint } = useCrossmint();\n const webViewRef = useRef<WebView>(null);\n const connectionRef = useRef<WebViewParent<\n typeof exportSignerOutboundEvents,\n typeof exportSignerInboundEvents\n > | null>(null);\n const [frameUrl, setFrameUrl] = useState<string>(\"\");\n\n useEffect(() => {\n if (crossmint != null) {\n try {\n const parsedAPIKey = validateAPIKey(crossmint.apiKey);\n if (parsedAPIKey.isValid) {\n const baseUrl = environmentUrlConfig[parsedAPIKey.environment];\n setFrameUrl(`${baseUrl}/export`);\n }\n } catch (error) {\n console.error(\"Failed to get TEE URL:\", error);\n }\n }\n }, [crossmint]);\n\n const handleWebViewLoadEnd = useCallback(\n async (syntheticEvent: { nativeEvent: { loading: boolean } }) => {\n if (wallet == null || webViewRef.current == null || syntheticEvent.nativeEvent.loading) {\n return;\n }\n\n try {\n if (isExportableSigner(wallet.signer)) {\n const connection = new WebViewParent(webViewRef, {\n incomingEvents: exportSignerOutboundEvents,\n outgoingEvents: exportSignerInboundEvents,\n });\n connectionRef.current = connection;\n await connection.handshakeWithChild();\n await wallet.signer._exportPrivateKey(connection);\n }\n } catch (error) {\n console.error(\"Failed to export private key:\", error);\n Alert.alert(\"Export Failed\", \"Failed to export private key. Please try again.\");\n }\n },\n [wallet]\n );\n\n const handleWebViewError = useCallback((syntheticEvent: { nativeEvent: unknown }) => {\n const { nativeEvent } = syntheticEvent;\n console.error(\"WebView error:\", nativeEvent);\n Alert.alert(\"Export Failed\", \"Failed to load export interface. Please try again.\");\n }, []);\n\n const handleMessage = useCallback((event: WebViewMessageEvent) => {\n if (connectionRef.current) {\n connectionRef.current.handleMessage(event);\n }\n }, []);\n\n if (frameUrl === \"\" || wallet == null || !isExportableSigner(wallet.signer)) {\n return null;\n }\n\n return (\n <View style={styles.webViewContainer}>\n <RNWebView\n ref={webViewRef}\n source={{ uri: frameUrl }}\n style={styles.webView}\n javaScriptEnabled={true}\n domStorageEnabled={true}\n onLoadEnd={handleWebViewLoadEnd}\n onError={handleWebViewError}\n onHttpError={handleWebViewError}\n onMessage={handleMessage}\n startInLoadingState={true}\n renderLoading={() => (\n <View style={styles.loadingContainer}>\n <Text style={styles.loadingText}>Loading...</Text>\n </View>\n )}\n />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n webViewContainer: {\n height: 56,\n borderWidth: 1,\n borderColor: \"#E5E5E5\",\n borderRadius: 12,\n overflow: \"hidden\",\n },\n webView: {\n flex: 1,\n },\n loadingContainer: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n backgroundColor: \"#F5F5F5\",\n },\n loadingText: {\n fontSize: 16,\n color: \"#666666\",\n },\n});\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/styles/theme.ts
|
|
2
|
+
var theme = {
|
|
3
|
+
"cm-text-primary": "#00150D",
|
|
4
|
+
"cm-text-secondary": "#67797F",
|
|
5
|
+
"cm-background-primary": "#FFFFFF",
|
|
6
|
+
"cm-muted-primary": "#F0F2F4",
|
|
7
|
+
"cm-hover": "#E9ECF0",
|
|
8
|
+
"cm-border": "#D9D9D9",
|
|
9
|
+
"cm-link": "#1A74E9",
|
|
10
|
+
"cm-accent": "#4CAF50",
|
|
11
|
+
// old 04AA6D
|
|
12
|
+
"cm-danger": "#f44336"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
theme
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-3AWDWMZ2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/styles/theme.ts"],"sourcesContent":["export const theme = {\n \"cm-text-primary\": \"#00150D\",\n \"cm-text-secondary\": \"#67797F\",\n \"cm-background-primary\": \"#FFFFFF\",\n \"cm-muted-primary\": \"#F0F2F4\",\n \"cm-hover\": \"#E9ECF0\",\n \"cm-border\": \"#D9D9D9\",\n \"cm-link\": \"#1A74E9\",\n \"cm-accent\": \"#4CAF50\", // old 04AA6D\n \"cm-danger\": \"#f44336\",\n} as const;\n"],"mappings":";AAAO,IAAM,QAAQ;AAAA,EACjB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA;AAAA,EACb,aAAa;AACjB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-3PJ6FXFT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "./chunk-7SPIOD4K.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useWalletEmailSigner.ts
|
|
6
|
+
import { useCallback, useContext } from "react";
|
|
7
|
+
import { CrossmintWalletBaseContext } from "@crossmint/client-sdk-react-base";
|
|
8
|
+
var throwNotAvailable = (functionName) => () => {
|
|
9
|
+
throw new Error(`${functionName} is not available. Make sure you're using an email signer wallet.`);
|
|
10
|
+
};
|
|
11
|
+
function useWalletEmailSigner() {
|
|
12
|
+
const context = useContext(CrossmintWalletBaseContext);
|
|
13
|
+
if (context == null) {
|
|
14
|
+
throw new Error("useWalletEmailSigner must be used within CrossmintWalletProvider");
|
|
15
|
+
}
|
|
16
|
+
const { emailSignerState } = context;
|
|
17
|
+
const sendEmailWithOtp = useCallback(() => __async(this, null, function* () {
|
|
18
|
+
var _a;
|
|
19
|
+
if (!emailSignerState.sendEmailWithOtp) {
|
|
20
|
+
throwNotAvailable("sendEmailWithOtp")();
|
|
21
|
+
}
|
|
22
|
+
return yield (_a = emailSignerState.sendEmailWithOtp) == null ? void 0 : _a.call(emailSignerState);
|
|
23
|
+
}), [emailSignerState.sendEmailWithOtp]);
|
|
24
|
+
const verifyOtp = useCallback(
|
|
25
|
+
(otp) => __async(this, null, function* () {
|
|
26
|
+
var _a;
|
|
27
|
+
if (!emailSignerState.verifyOtp) {
|
|
28
|
+
throwNotAvailable("verifyOtp")();
|
|
29
|
+
}
|
|
30
|
+
return yield (_a = emailSignerState.verifyOtp) == null ? void 0 : _a.call(emailSignerState, otp);
|
|
31
|
+
}),
|
|
32
|
+
[emailSignerState.verifyOtp]
|
|
33
|
+
);
|
|
34
|
+
const reject = useCallback(
|
|
35
|
+
(error) => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!emailSignerState.reject) {
|
|
38
|
+
throwNotAvailable("reject")();
|
|
39
|
+
}
|
|
40
|
+
(_a = emailSignerState.reject) == null ? void 0 : _a.call(emailSignerState, error);
|
|
41
|
+
},
|
|
42
|
+
[emailSignerState.reject]
|
|
43
|
+
);
|
|
44
|
+
return {
|
|
45
|
+
needsAuth: emailSignerState.needsAuth,
|
|
46
|
+
sendEmailWithOtp,
|
|
47
|
+
verifyOtp,
|
|
48
|
+
reject
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
useWalletEmailSigner
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-3SFSPJXM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useWalletEmailSigner.ts"],"sourcesContent":["import { useCallback, useContext } from \"react\";\nimport { CrossmintWalletBaseContext } from \"@crossmint/client-sdk-react-base\";\n\nconst throwNotAvailable = (functionName: string) => () => {\n throw new Error(`${functionName} is not available. Make sure you're using an email signer wallet.`);\n};\n\nexport type EmailSignerFunctions = {\n /** Whether the email signer currently requires authentication (OTP verification). */\n needsAuth: boolean;\n /** Sends a one-time password to the user's email address. */\n sendEmailWithOtp: () => Promise<void>;\n /** Verifies the one-time password entered by the user. */\n verifyOtp: (otp: string) => Promise<void>;\n /** Rejects the current authentication request with an error. */\n reject: (error: Error) => void;\n};\n\n/**\n * Hook for managing email-based signer authentication flows.\n * Provides OTP send/verify functions for wallets using an email signer.\n * Must be used within a {@link CrossmintWalletProvider}.\n */\nexport function useWalletEmailSigner(): EmailSignerFunctions {\n const context = useContext(CrossmintWalletBaseContext);\n\n if (context == null) {\n throw new Error(\"useWalletEmailSigner must be used within CrossmintWalletProvider\");\n }\n\n const { emailSignerState } = context;\n\n const sendEmailWithOtp = useCallback(async () => {\n if (!emailSignerState.sendEmailWithOtp) {\n throwNotAvailable(\"sendEmailWithOtp\")();\n }\n return await emailSignerState.sendEmailWithOtp?.();\n }, [emailSignerState.sendEmailWithOtp]);\n\n const verifyOtp = useCallback(\n async (otp: string) => {\n if (!emailSignerState.verifyOtp) {\n throwNotAvailable(\"verifyOtp\")();\n }\n return await emailSignerState.verifyOtp?.(otp);\n },\n [emailSignerState.verifyOtp]\n );\n\n const reject = useCallback(\n (error: Error) => {\n if (!emailSignerState.reject) {\n throwNotAvailable(\"reject\")();\n }\n emailSignerState.reject?.(error);\n },\n [emailSignerState.reject]\n );\n\n return {\n needsAuth: emailSignerState.needsAuth,\n sendEmailWithOtp,\n verifyOtp,\n reject,\n };\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa,kBAAkB;AACxC,SAAS,kCAAkC;AAE3C,IAAM,oBAAoB,CAAC,iBAAyB,MAAM;AACtD,QAAM,IAAI,MAAM,GAAG,YAAY,mEAAmE;AACtG;AAkBO,SAAS,uBAA6C;AACzD,QAAM,UAAU,WAAW,0BAA0B;AAErD,MAAI,WAAW,MAAM;AACjB,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACtF;AAEA,QAAM,EAAE,iBAAiB,IAAI;AAE7B,QAAM,mBAAmB,YAAY,MAAY;AAhCrD;AAiCQ,QAAI,CAAC,iBAAiB,kBAAkB;AACpC,wBAAkB,kBAAkB,EAAE;AAAA,IAC1C;AACA,WAAO,OAAM,sBAAiB,qBAAjB;AAAA,EACjB,IAAG,CAAC,iBAAiB,gBAAgB,CAAC;AAEtC,QAAM,YAAY;AAAA,IACd,CAAO,QAAgB;AAxC/B;AAyCY,UAAI,CAAC,iBAAiB,WAAW;AAC7B,0BAAkB,WAAW,EAAE;AAAA,MACnC;AACA,aAAO,OAAM,sBAAiB,cAAjB,0CAA6B;AAAA,IAC9C;AAAA,IACA,CAAC,iBAAiB,SAAS;AAAA,EAC/B;AAEA,QAAM,SAAS;AAAA,IACX,CAAC,UAAiB;AAlD1B;AAmDY,UAAI,CAAC,iBAAiB,QAAQ;AAC1B,0BAAkB,QAAQ,EAAE;AAAA,MAChC;AACA,6BAAiB,WAAjB,0CAA0B;AAAA,IAC9B;AAAA,IACA,CAAC,iBAAiB,MAAM;AAAA,EAC5B;AAEA,SAAO;AAAA,IACH,WAAW,iBAAiB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "./chunk-7SPIOD4K.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/embed/v3/crypto/PayerConnectionHandler.tsx
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
function PayerConnectionHandler({
|
|
8
|
+
payer,
|
|
9
|
+
webViewClient
|
|
10
|
+
}) {
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (webViewClient == null) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const signTransactionListener = webViewClient.on(
|
|
16
|
+
"crypto:send-transaction",
|
|
17
|
+
(_0) => __async(this, [_0], function* ({ chain, serializedTransaction }) {
|
|
18
|
+
try {
|
|
19
|
+
yield payer.handleChainSwitch(chain);
|
|
20
|
+
const tx = yield payer.handleSignAndSendTransaction(serializedTransaction);
|
|
21
|
+
if (tx.success) {
|
|
22
|
+
webViewClient.send("crypto:send-transaction:success", { txId: tx.txId });
|
|
23
|
+
} else {
|
|
24
|
+
webViewClient.send("crypto:send-transaction:failed", { error: tx.errorMessage });
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error("[PayerConnectionHandler] Failed to send transaction", error);
|
|
28
|
+
webViewClient.send("crypto:send-transaction:failed", {
|
|
29
|
+
error: error.message || "An unknown error occurred"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
return () => {
|
|
35
|
+
webViewClient.off(signTransactionListener);
|
|
36
|
+
};
|
|
37
|
+
}, [webViewClient]);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
PayerConnectionHandler
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=chunk-4AJTICKY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/embed/v3/crypto/PayerConnectionHandler.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { EmbeddedCheckoutPayer } from \"@crossmint/client-sdk-base\";\nimport type { PayerSupportedBlockchains } from \"@crossmint/common-sdk-base\";\nimport type { WebViewParent } from \"@crossmint/client-sdk-rn-window\";\nimport type { embeddedCheckoutV3IncomingEvents, embeddedCheckoutV3OutgoingEvents } from \"@crossmint/client-sdk-base\";\n\nexport function PayerConnectionHandler({\n payer,\n webViewClient,\n}: {\n payer: EmbeddedCheckoutPayer;\n webViewClient: WebViewParent<\n typeof embeddedCheckoutV3IncomingEvents,\n typeof embeddedCheckoutV3OutgoingEvents\n > | null;\n}) {\n useEffect(() => {\n if (webViewClient == null) {\n return;\n }\n\n const signTransactionListener = webViewClient.on(\n \"crypto:send-transaction\",\n async ({ chain, serializedTransaction }) => {\n try {\n await payer.handleChainSwitch(chain as PayerSupportedBlockchains);\n const tx = await payer.handleSignAndSendTransaction(serializedTransaction);\n if (tx.success) {\n webViewClient.send(\"crypto:send-transaction:success\", { txId: tx.txId });\n } else {\n webViewClient.send(\"crypto:send-transaction:failed\", { error: tx.errorMessage });\n }\n } catch (error) {\n console.error(\"[PayerConnectionHandler] Failed to send transaction\", error);\n webViewClient.send(\"crypto:send-transaction:failed\", {\n error: (error as Error).message || \"An unknown error occurred\",\n });\n }\n }\n );\n\n return () => {\n webViewClient.off(signTransactionListener);\n };\n }, [webViewClient]);\n\n return null;\n}\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAMnB,SAAS,uBAAuB;AAAA,EACnC;AAAA,EACA;AACJ,GAMG;AACC,YAAU,MAAM;AACZ,QAAI,iBAAiB,MAAM;AACvB;AAAA,IACJ;AAEA,UAAM,0BAA0B,cAAc;AAAA,MAC1C;AAAA,MACA,CAAO,OAAqC,eAArC,KAAqC,WAArC,EAAE,OAAO,sBAAsB,GAAM;AACxC,YAAI;AACA,gBAAM,MAAM,kBAAkB,KAAkC;AAChE,gBAAM,KAAK,MAAM,MAAM,6BAA6B,qBAAqB;AACzE,cAAI,GAAG,SAAS;AACZ,0BAAc,KAAK,mCAAmC,EAAE,MAAM,GAAG,KAAK,CAAC;AAAA,UAC3E,OAAO;AACH,0BAAc,KAAK,kCAAkC,EAAE,OAAO,GAAG,aAAa,CAAC;AAAA,UACnF;AAAA,QACJ,SAAS,OAAO;AACZ,kBAAQ,MAAM,uDAAuD,KAAK;AAC1E,wBAAc,KAAK,kCAAkC;AAAA,YACjD,OAAQ,MAAgB,WAAW;AAAA,UACvC,CAAC;AAAA,QACL;AAAA,MACJ;AAAA,IACJ;AAEA,WAAO,MAAM;AACT,oBAAc,IAAI,uBAAuB;AAAA,IAC7C;AAAA,EACJ,GAAG,CAAC,aAAa,CAAC;AAElB,SAAO;AACX;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/plugin/mods/addQueryToAndroidManifest.ts
|
|
2
|
+
function addQueryToAndroidManifest(androidManifest, query) {
|
|
3
|
+
const manifest = androidManifest.manifest;
|
|
4
|
+
if (!manifest.queries) {
|
|
5
|
+
manifest.queries = [];
|
|
6
|
+
}
|
|
7
|
+
manifest.queries.push(query);
|
|
8
|
+
return androidManifest;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.addQueryToAndroidManifest = addQueryToAndroidManifest;
|
|
14
|
+
//# sourceMappingURL=chunk-4HKXTAVR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin/mods/addQueryToAndroidManifest.ts"],"names":[],"mappings":";AAEO,SAAS,0BAA0B,iBAAkC,OAAuC;AAC/G,QAAM,WAAW,gBAAgB;AAEjC,MAAI,CAAC,SAAS,SAAS;AACnB,aAAS,UAAU,CAAC;AAAA,EACxB;AAEA,WAAS,QAAQ,KAAK,KAAK;AAE3B,SAAO;AACX","sourcesContent":["import type { AndroidManifest, ManifestQuery } from \"@expo/config-plugins/build/android/Manifest\";\n\nexport function addQueryToAndroidManifest(androidManifest: AndroidManifest, query: ManifestQuery): AndroidManifest {\n const manifest = androidManifest.manifest;\n\n if (!manifest.queries) {\n manifest.queries = [];\n }\n\n manifest.queries.push(query);\n\n return androidManifest;\n}\n"]}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCodeInput
|
|
3
|
+
} from "./chunk-ALMDA3KN.mjs";
|
|
4
|
+
import {
|
|
5
|
+
BaseConfirmation
|
|
6
|
+
} from "./chunk-2TEAOLM6.mjs";
|
|
7
|
+
import {
|
|
8
|
+
theme
|
|
9
|
+
} from "./chunk-3AWDWMZ2.mjs";
|
|
10
|
+
|
|
11
|
+
// src/components/signers/PhoneSignersDialog.tsx
|
|
12
|
+
import { View, StyleSheet, Dimensions, Modal, TouchableOpacity, Text } from "react-native";
|
|
13
|
+
import { PhoneIcon, Smartphone, X } from "lucide-react-native";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var { width: screenWidth } = Dimensions.get("window");
|
|
16
|
+
function PhoneSignersDialog({
|
|
17
|
+
phone,
|
|
18
|
+
open,
|
|
19
|
+
setOpen,
|
|
20
|
+
step,
|
|
21
|
+
onSubmitOTP,
|
|
22
|
+
onResendOTPCode,
|
|
23
|
+
onSubmitPhone,
|
|
24
|
+
rejectRef,
|
|
25
|
+
appearance
|
|
26
|
+
}) {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
28
|
+
function handleOnCancel() {
|
|
29
|
+
var _a2;
|
|
30
|
+
if (open) {
|
|
31
|
+
(_a2 = rejectRef.current) == null ? void 0 : _a2.call(rejectRef, new Error("User cancelled"));
|
|
32
|
+
setOpen(false);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const dynamicStyles = StyleSheet.create({
|
|
36
|
+
modalOverlay: {
|
|
37
|
+
flex: 1,
|
|
38
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
39
|
+
justifyContent: "center",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
padding: 16
|
|
42
|
+
},
|
|
43
|
+
modalContainer: {
|
|
44
|
+
backgroundColor: ((_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.background) || theme["cm-background-primary"],
|
|
45
|
+
borderRadius: (appearance == null ? void 0 : appearance.borderRadius) || 12,
|
|
46
|
+
padding: 32,
|
|
47
|
+
width: Math.min(screenWidth - 32, 400),
|
|
48
|
+
maxHeight: "80%",
|
|
49
|
+
position: "relative",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
shadowColor: "#000",
|
|
52
|
+
shadowOffset: {
|
|
53
|
+
width: 0,
|
|
54
|
+
height: 2
|
|
55
|
+
},
|
|
56
|
+
shadowOpacity: 0.25,
|
|
57
|
+
shadowRadius: 4,
|
|
58
|
+
elevation: 5
|
|
59
|
+
},
|
|
60
|
+
closeButton: {
|
|
61
|
+
position: "absolute",
|
|
62
|
+
top: 16,
|
|
63
|
+
right: 16,
|
|
64
|
+
width: 32,
|
|
65
|
+
height: 32,
|
|
66
|
+
borderRadius: 6,
|
|
67
|
+
backgroundColor: ((_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.inputBackground) || theme["cm-muted-primary"],
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
zIndex: 1
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
if (!open) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
Modal,
|
|
78
|
+
{
|
|
79
|
+
visible: open,
|
|
80
|
+
transparent: true,
|
|
81
|
+
animationType: "fade",
|
|
82
|
+
onRequestClose: handleOnCancel,
|
|
83
|
+
statusBarTranslucent: true,
|
|
84
|
+
children: /* @__PURE__ */ jsx(View, { style: dynamicStyles.modalOverlay, children: /* @__PURE__ */ jsxs(View, { style: dynamicStyles.modalContainer, children: [
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
TouchableOpacity,
|
|
87
|
+
{
|
|
88
|
+
style: dynamicStyles.closeButton,
|
|
89
|
+
onPress: handleOnCancel,
|
|
90
|
+
hitSlop: { top: 10, bottom: 10, left: 10, right: 10 },
|
|
91
|
+
children: /* @__PURE__ */ jsx(X, { size: 16, color: ((_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textSecondary) || theme["cm-text-secondary"] })
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
step === "initial" ? /* @__PURE__ */ jsx(
|
|
95
|
+
BaseConfirmation,
|
|
96
|
+
{
|
|
97
|
+
contactInfo: phone != null ? phone : "",
|
|
98
|
+
contactType: "phone",
|
|
99
|
+
icon: /* @__PURE__ */ jsx(
|
|
100
|
+
PhoneIcon,
|
|
101
|
+
{
|
|
102
|
+
size: 22,
|
|
103
|
+
color: ((_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary) || theme["cm-text-primary"]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
onConfirm: onSubmitPhone,
|
|
107
|
+
onCancel: handleOnCancel,
|
|
108
|
+
appearance
|
|
109
|
+
}
|
|
110
|
+
) : /* @__PURE__ */ jsx(
|
|
111
|
+
BaseCodeInput,
|
|
112
|
+
{
|
|
113
|
+
contactInfo: phone != null ? phone : "",
|
|
114
|
+
contactType: "phone",
|
|
115
|
+
icon: /* @__PURE__ */ jsx(
|
|
116
|
+
View,
|
|
117
|
+
{
|
|
118
|
+
style: {
|
|
119
|
+
backgroundColor: ((_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.accent) || theme["cm-accent"],
|
|
120
|
+
borderRadius: 999,
|
|
121
|
+
padding: 12
|
|
122
|
+
},
|
|
123
|
+
children: /* @__PURE__ */ jsx(
|
|
124
|
+
Smartphone,
|
|
125
|
+
{
|
|
126
|
+
size: 22,
|
|
127
|
+
color: ((_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.background) || theme["cm-background-primary"]
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
title: "Check your phone",
|
|
133
|
+
description: /* @__PURE__ */ jsxs(Text, { children: [
|
|
134
|
+
"A temporary login code has been sent via SMS to",
|
|
135
|
+
" ",
|
|
136
|
+
/* @__PURE__ */ jsx(Text, { style: { fontWeight: "bold" }, children: phone })
|
|
137
|
+
] }),
|
|
138
|
+
helpText: `Can't receive the SMS? Check your phone number.
|
|
139
|
+
Some messages may take several minutes to arrive.`,
|
|
140
|
+
onSubmitOTP,
|
|
141
|
+
onResendCode: onResendOTPCode,
|
|
142
|
+
appearance,
|
|
143
|
+
otpLength: 10,
|
|
144
|
+
keyboardType: "number-pad",
|
|
145
|
+
autoComplete: "sms-otp",
|
|
146
|
+
textContentType: "oneTimeCode"
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] }) })
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
PhoneSignersDialog
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=chunk-4V7NDO5X.mjs.map
|