@0xkey-io/react-wallet-kit 0.1.0
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/LICENSE +201 -0
- package/README.MD +116 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs +307 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
- package/dist/components/auth/Action.d.ts +10 -0
- package/dist/components/auth/Action.d.ts.map +1 -0
- package/dist/components/auth/Action.js +76 -0
- package/dist/components/auth/Action.js.map +1 -0
- package/dist/components/auth/Action.mjs +97 -0
- package/dist/components/auth/Action.mjs.map +1 -0
- package/dist/components/auth/Email.d.ts +6 -0
- package/dist/components/auth/Email.d.ts.map +1 -0
- package/dist/components/auth/Email.js +77 -0
- package/dist/components/auth/Email.js.map +1 -0
- package/dist/components/auth/Email.mjs +98 -0
- package/dist/components/auth/Email.mjs.map +1 -0
- package/dist/components/auth/OAuth.d.ts +13 -0
- package/dist/components/auth/OAuth.d.ts.map +1 -0
- package/dist/components/auth/OAuth.js +63 -0
- package/dist/components/auth/OAuth.js.map +1 -0
- package/dist/components/auth/OAuth.mjs +68 -0
- package/dist/components/auth/OAuth.mjs.map +1 -0
- package/dist/components/auth/OTP.d.ts +21 -0
- package/dist/components/auth/OTP.d.ts.map +1 -0
- package/dist/components/auth/OTP.js +218 -0
- package/dist/components/auth/OTP.js.map +1 -0
- package/dist/components/auth/OTP.mjs +301 -0
- package/dist/components/auth/OTP.mjs.map +1 -0
- package/dist/components/auth/OrSeparator.d.ts +2 -0
- package/dist/components/auth/OrSeparator.d.ts.map +1 -0
- package/dist/components/auth/OrSeparator.js +20 -0
- package/dist/components/auth/OrSeparator.js.map +1 -0
- package/dist/components/auth/OrSeparator.mjs +18 -0
- package/dist/components/auth/OrSeparator.mjs.map +1 -0
- package/dist/components/auth/Passkey.d.ts +7 -0
- package/dist/components/auth/Passkey.d.ts.map +1 -0
- package/dist/components/auth/Passkey.js +34 -0
- package/dist/components/auth/Passkey.js.map +1 -0
- package/dist/components/auth/Passkey.mjs +30 -0
- package/dist/components/auth/Passkey.mjs.map +1 -0
- package/dist/components/auth/Phone.d.ts +6 -0
- package/dist/components/auth/Phone.d.ts.map +1 -0
- package/dist/components/auth/Phone.js +67 -0
- package/dist/components/auth/Phone.js.map +1 -0
- package/dist/components/auth/Phone.mjs +92 -0
- package/dist/components/auth/Phone.mjs.map +1 -0
- package/dist/components/auth/Wallet.d.ts +34 -0
- package/dist/components/auth/Wallet.d.ts.map +1 -0
- package/dist/components/auth/Wallet.js +517 -0
- package/dist/components/auth/Wallet.js.map +1 -0
- package/dist/components/auth/Wallet.mjs +618 -0
- package/dist/components/auth/Wallet.mjs.map +1 -0
- package/dist/components/auth/index.d.ts +9 -0
- package/dist/components/auth/index.d.ts.map +1 -0
- package/dist/components/auth/index.js +457 -0
- package/dist/components/auth/index.js.map +1 -0
- package/dist/components/auth/index.mjs +672 -0
- package/dist/components/auth/index.mjs.map +1 -0
- package/dist/components/design/Buttons.d.ts +29 -0
- package/dist/components/design/Buttons.d.ts.map +1 -0
- package/dist/components/design/Buttons.js +87 -0
- package/dist/components/design/Buttons.js.map +1 -0
- package/dist/components/design/Buttons.mjs +79 -0
- package/dist/components/design/Buttons.mjs.map +1 -0
- package/dist/components/design/Failure.d.ts +9 -0
- package/dist/components/design/Failure.d.ts.map +1 -0
- package/dist/components/design/Failure.js +33 -0
- package/dist/components/design/Failure.js.map +1 -0
- package/dist/components/design/Failure.mjs +34 -0
- package/dist/components/design/Failure.mjs.map +1 -0
- package/dist/components/design/Inputs.d.ts +9 -0
- package/dist/components/design/Inputs.d.ts.map +1 -0
- package/dist/components/design/Inputs.js +135 -0
- package/dist/components/design/Inputs.js.map +1 -0
- package/dist/components/design/Inputs.mjs +133 -0
- package/dist/components/design/Inputs.mjs.map +1 -0
- package/dist/components/design/Lottie/Dynamic.d.ts +2 -0
- package/dist/components/design/Lottie/Dynamic.d.ts.map +1 -0
- package/dist/components/design/Lottie/Dynamic.js +9 -0
- package/dist/components/design/Lottie/Dynamic.js.map +1 -0
- package/dist/components/design/Lottie/Dynamic.mjs +24 -0
- package/dist/components/design/Lottie/Dynamic.mjs.map +1 -0
- package/dist/components/design/Lottie/Wrapper.d.ts +8 -0
- package/dist/components/design/Lottie/Wrapper.d.ts.map +1 -0
- package/dist/components/design/Lottie/Wrapper.js +26 -0
- package/dist/components/design/Lottie/Wrapper.js.map +1 -0
- package/dist/components/design/Lottie/Wrapper.mjs +42 -0
- package/dist/components/design/Lottie/Wrapper.mjs.map +1 -0
- package/dist/components/design/Spinners.d.ts +9 -0
- package/dist/components/design/Spinners.d.ts.map +1 -0
- package/dist/components/design/Spinners.js +38 -0
- package/dist/components/design/Spinners.js.map +1 -0
- package/dist/components/design/Spinners.mjs +37 -0
- package/dist/components/design/Spinners.mjs.map +1 -0
- package/dist/components/design/Success.d.ts +8 -0
- package/dist/components/design/Success.d.ts.map +1 -0
- package/dist/components/design/Success.js +82 -0
- package/dist/components/design/Success.js.map +1 -0
- package/dist/components/design/Success.mjs +86 -0
- package/dist/components/design/Success.mjs.map +1 -0
- package/dist/components/design/Svg.d.ts +13 -0
- package/dist/components/design/Svg.d.ts.map +1 -0
- package/dist/components/design/Svg.js +165 -0
- package/dist/components/design/Svg.js.map +1 -0
- package/dist/components/design/Svg.mjs +161 -0
- package/dist/components/design/Svg.mjs.map +1 -0
- package/dist/components/export/Export.d.ts +13 -0
- package/dist/components/export/Export.d.ts.map +1 -0
- package/dist/components/export/Export.js +169 -0
- package/dist/components/export/Export.js.map +1 -0
- package/dist/components/export/Export.mjs +213 -0
- package/dist/components/export/Export.mjs.map +1 -0
- package/dist/components/export/ExportWarning.d.ts +15 -0
- package/dist/components/export/ExportWarning.d.ts.map +1 -0
- package/dist/components/export/ExportWarning.js +141 -0
- package/dist/components/export/ExportWarning.js.map +1 -0
- package/dist/components/export/ExportWarning.mjs +174 -0
- package/dist/components/export/ExportWarning.mjs.map +1 -0
- package/dist/components/import/Import.d.ts +20 -0
- package/dist/components/import/Import.d.ts.map +1 -0
- package/dist/components/import/Import.js +290 -0
- package/dist/components/import/Import.js.map +1 -0
- package/dist/components/import/Import.mjs +422 -0
- package/dist/components/import/Import.mjs.map +1 -0
- package/dist/components/onramp/OnRamp.d.ts +14 -0
- package/dist/components/onramp/OnRamp.d.ts.map +1 -0
- package/dist/components/onramp/OnRamp.js +61 -0
- package/dist/components/onramp/OnRamp.js.map +1 -0
- package/dist/components/onramp/OnRamp.mjs +79 -0
- package/dist/components/onramp/OnRamp.mjs.map +1 -0
- package/dist/components/send-transaction/SendTransaction.d.ts +12 -0
- package/dist/components/send-transaction/SendTransaction.d.ts.map +1 -0
- package/dist/components/send-transaction/SendTransaction.js +65 -0
- package/dist/components/send-transaction/SendTransaction.js.map +1 -0
- package/dist/components/send-transaction/SendTransaction.mjs +89 -0
- package/dist/components/send-transaction/SendTransaction.mjs.map +1 -0
- package/dist/components/send-transaction/helpers.d.ts +4 -0
- package/dist/components/send-transaction/helpers.d.ts.map +1 -0
- package/dist/components/send-transaction/helpers.js +37 -0
- package/dist/components/send-transaction/helpers.js.map +1 -0
- package/dist/components/send-transaction/helpers.mjs +34 -0
- package/dist/components/send-transaction/helpers.mjs.map +1 -0
- package/dist/components/sign/Message.d.ts +18 -0
- package/dist/components/sign/Message.d.ts.map +1 -0
- package/dist/components/sign/Message.js +132 -0
- package/dist/components/sign/Message.js.map +1 -0
- package/dist/components/sign/Message.mjs +148 -0
- package/dist/components/sign/Message.mjs.map +1 -0
- package/dist/components/user/ConnectWallet.d.ts +8 -0
- package/dist/components/user/ConnectWallet.d.ts.map +1 -0
- package/dist/components/user/ConnectWallet.js +114 -0
- package/dist/components/user/ConnectWallet.js.map +1 -0
- package/dist/components/user/ConnectWallet.mjs +194 -0
- package/dist/components/user/ConnectWallet.mjs.map +1 -0
- package/dist/components/user/RemoveEmail.d.ts +12 -0
- package/dist/components/user/RemoveEmail.d.ts.map +1 -0
- package/dist/components/user/RemoveEmail.js +105 -0
- package/dist/components/user/RemoveEmail.js.map +1 -0
- package/dist/components/user/RemoveEmail.mjs +124 -0
- package/dist/components/user/RemoveEmail.mjs.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.d.ts +12 -0
- package/dist/components/user/RemoveOAuthProvider.d.ts.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.js +110 -0
- package/dist/components/user/RemoveOAuthProvider.js.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.mjs +131 -0
- package/dist/components/user/RemoveOAuthProvider.mjs.map +1 -0
- package/dist/components/user/RemovePasskey.d.ts +12 -0
- package/dist/components/user/RemovePasskey.d.ts.map +1 -0
- package/dist/components/user/RemovePasskey.js +114 -0
- package/dist/components/user/RemovePasskey.js.map +1 -0
- package/dist/components/user/RemovePasskey.mjs +135 -0
- package/dist/components/user/RemovePasskey.mjs.map +1 -0
- package/dist/components/user/RemovePhoneNumber.d.ts +12 -0
- package/dist/components/user/RemovePhoneNumber.d.ts.map +1 -0
- package/dist/components/user/RemovePhoneNumber.js +105 -0
- package/dist/components/user/RemovePhoneNumber.js.map +1 -0
- package/dist/components/user/RemovePhoneNumber.mjs +124 -0
- package/dist/components/user/RemovePhoneNumber.mjs.map +1 -0
- package/dist/components/user/UpdateEmail.d.ts +12 -0
- package/dist/components/user/UpdateEmail.d.ts.map +1 -0
- package/dist/components/user/UpdateEmail.js +154 -0
- package/dist/components/user/UpdateEmail.js.map +1 -0
- package/dist/components/user/UpdateEmail.mjs +197 -0
- package/dist/components/user/UpdateEmail.mjs.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.d.ts +12 -0
- package/dist/components/user/UpdatePhoneNumber.d.ts.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.js +151 -0
- package/dist/components/user/UpdatePhoneNumber.js.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.mjs +198 -0
- package/dist/components/user/UpdatePhoneNumber.mjs.map +1 -0
- package/dist/components/user/UpdateUserName.d.ts +13 -0
- package/dist/components/user/UpdateUserName.d.ts.map +1 -0
- package/dist/components/user/UpdateUserName.js +113 -0
- package/dist/components/user/UpdateUserName.js.map +1 -0
- package/dist/components/user/UpdateUserName.mjs +139 -0
- package/dist/components/user/UpdateUserName.mjs.map +1 -0
- package/dist/components/verify/Verify.d.ts +9 -0
- package/dist/components/verify/Verify.d.ts.map +1 -0
- package/dist/components/verify/Verify.js +121 -0
- package/dist/components/verify/Verify.js.map +1 -0
- package/dist/components/verify/Verify.mjs +149 -0
- package/dist/components/verify/Verify.mjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/dist/providers/ZeroXKeyProvider.d.ts +9 -0
- package/dist/providers/ZeroXKeyProvider.d.ts.map +1 -0
- package/dist/providers/ZeroXKeyProvider.js +36 -0
- package/dist/providers/ZeroXKeyProvider.js.map +1 -0
- package/dist/providers/ZeroXKeyProvider.mjs +34 -0
- package/dist/providers/ZeroXKeyProvider.mjs.map +1 -0
- package/dist/providers/client/Hook.d.ts +4 -0
- package/dist/providers/client/Hook.d.ts.map +1 -0
- package/dist/providers/client/Hook.js +15 -0
- package/dist/providers/client/Hook.js.map +1 -0
- package/dist/providers/client/Hook.mjs +13 -0
- package/dist/providers/client/Hook.mjs.map +1 -0
- package/dist/providers/client/Provider.d.ts +39 -0
- package/dist/providers/client/Provider.d.ts.map +1 -0
- package/dist/providers/client/Provider.js +3934 -0
- package/dist/providers/client/Provider.js.map +1 -0
- package/dist/providers/client/Provider.mjs +6895 -0
- package/dist/providers/client/Provider.mjs.map +1 -0
- package/dist/providers/client/Types.d.ts +711 -0
- package/dist/providers/client/Types.d.ts.map +1 -0
- package/dist/providers/client/Types.js +10 -0
- package/dist/providers/client/Types.js.map +1 -0
- package/dist/providers/client/Types.mjs +8 -0
- package/dist/providers/client/Types.mjs.map +1 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/modal/Hook.d.ts +4 -0
- package/dist/providers/modal/Hook.d.ts.map +1 -0
- package/dist/providers/modal/Hook.js +15 -0
- package/dist/providers/modal/Hook.js.map +1 -0
- package/dist/providers/modal/Hook.mjs +13 -0
- package/dist/providers/modal/Hook.mjs.map +1 -0
- package/dist/providers/modal/Provider.d.ts +27 -0
- package/dist/providers/modal/Provider.d.ts.map +1 -0
- package/dist/providers/modal/Provider.js +48 -0
- package/dist/providers/modal/Provider.js.map +1 -0
- package/dist/providers/modal/Provider.mjs +68 -0
- package/dist/providers/modal/Provider.mjs.map +1 -0
- package/dist/providers/modal/Root.d.ts +7 -0
- package/dist/providers/modal/Root.d.ts.map +1 -0
- package/dist/providers/modal/Root.js +345 -0
- package/dist/providers/modal/Root.js.map +1 -0
- package/dist/providers/modal/Root.mjs +352 -0
- package/dist/providers/modal/Root.mjs.map +1 -0
- package/dist/providers/theme/Overrides.d.ts +18 -0
- package/dist/providers/theme/Overrides.d.ts.map +1 -0
- package/dist/providers/theme/Overrides.js +35 -0
- package/dist/providers/theme/Overrides.js.map +1 -0
- package/dist/providers/theme/Overrides.mjs +37 -0
- package/dist/providers/theme/Overrides.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/tests/oauth-test.d.ts +2 -0
- package/dist/tests/oauth-test.d.ts.map +1 -0
- package/dist/tests/timers-test.d.ts +2 -0
- package/dist/tests/timers-test.d.ts.map +1 -0
- package/dist/tests/utils-test.d.ts +2 -0
- package/dist/tests/utils-test.d.ts.map +1 -0
- package/dist/typedoc-entry/index.d.ts +5 -0
- package/dist/typedoc-entry/index.d.ts.map +1 -0
- package/dist/types/base.d.ts +178 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +55 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/base.mjs +50 -0
- package/dist/types/base.mjs.map +1 -0
- package/dist/types/method-types.d.ts +258 -0
- package/dist/types/method-types.d.ts.map +1 -0
- package/dist/utils/oauth/completion.d.ts +132 -0
- package/dist/utils/oauth/completion.d.ts.map +1 -0
- package/dist/utils/oauth/completion.js +136 -0
- package/dist/utils/oauth/completion.js.map +1 -0
- package/dist/utils/oauth/completion.mjs +176 -0
- package/dist/utils/oauth/completion.mjs.map +1 -0
- package/dist/utils/oauth/config.d.ts +34 -0
- package/dist/utils/oauth/config.d.ts.map +1 -0
- package/dist/utils/oauth/config.js +69 -0
- package/dist/utils/oauth/config.js.map +1 -0
- package/dist/utils/oauth/config.mjs +54 -0
- package/dist/utils/oauth/config.mjs.map +1 -0
- package/dist/utils/oauth/helpers.d.ts +13 -0
- package/dist/utils/oauth/helpers.d.ts.map +1 -0
- package/dist/utils/oauth/helpers.js +38 -0
- package/dist/utils/oauth/helpers.js.map +1 -0
- package/dist/utils/oauth/helpers.mjs +35 -0
- package/dist/utils/oauth/helpers.mjs.map +1 -0
- package/dist/utils/oauth/index.d.ts +7 -0
- package/dist/utils/oauth/index.d.ts.map +1 -0
- package/dist/utils/oauth/pkce.d.ts +14 -0
- package/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/dist/utils/oauth/pkce.js +48 -0
- package/dist/utils/oauth/pkce.js.map +1 -0
- package/dist/utils/oauth/pkce.mjs +85 -0
- package/dist/utils/oauth/pkce.mjs.map +1 -0
- package/dist/utils/oauth/storage.d.ts +48 -0
- package/dist/utils/oauth/storage.d.ts.map +1 -0
- package/dist/utils/oauth/storage.js +87 -0
- package/dist/utils/oauth/storage.js.map +1 -0
- package/dist/utils/oauth/storage.mjs +78 -0
- package/dist/utils/oauth/storage.mjs.map +1 -0
- package/dist/utils/oauth/url.d.ts +94 -0
- package/dist/utils/oauth/url.d.ts.map +1 -0
- package/dist/utils/oauth/url.js +224 -0
- package/dist/utils/oauth/url.js.map +1 -0
- package/dist/utils/oauth/url.mjs +230 -0
- package/dist/utils/oauth/url.mjs.map +1 -0
- package/dist/utils/timers.d.ts +73 -0
- package/dist/utils/timers.d.ts.map +1 -0
- package/dist/utils/timers.js +133 -0
- package/dist/utils/timers.js.map +1 -0
- package/dist/utils/timers.mjs +142 -0
- package/dist/utils/timers.mjs.map +1 -0
- package/dist/utils/utils.d.ts +40 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +116 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/utils.mjs +164 -0
- package/dist/utils/utils.mjs.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var Hook$1 = require('../../providers/modal/Hook.js');
|
|
6
|
+
var Hook = require('../../providers/client/Hook.js');
|
|
7
|
+
var iframeStamper = require('@0xkey-io/iframe-stamper');
|
|
8
|
+
var sdkTypes = require('@0xkey-io/sdk-types');
|
|
9
|
+
var Buttons = require('../design/Buttons.js');
|
|
10
|
+
var react$1 = require('@headlessui/react');
|
|
11
|
+
var core = require('@0xkey-io/core');
|
|
12
|
+
var Success = require('../design/Success.js');
|
|
13
|
+
var clsx = require('clsx');
|
|
14
|
+
var base = require('../../types/base.js');
|
|
15
|
+
|
|
16
|
+
const ZeroXKeyImportIframeContainerId = "0xkey-import-iframe-container-id";
|
|
17
|
+
const ZeroXKeyIframeElementId = "zeroxkey-default-iframe-element-id";
|
|
18
|
+
const ZeroXKeyIframeClassNames = "w-full h-full overflow-hidden border-none !text-base bg-icon-background-light dark:bg-icon-background-dark";
|
|
19
|
+
// IMPORTANT: These colors need to match --icon-text-light, --icon-background-light, --icon-background-dark and --icon-text-dark in index.css
|
|
20
|
+
const iconBackgroundLight = "#e5e7eb";
|
|
21
|
+
const iconBackgroundDark = "#333336";
|
|
22
|
+
const iconTextLight = "#828282";
|
|
23
|
+
const iconTextDark = "#a3a3a5";
|
|
24
|
+
function ImportComponent(props) {
|
|
25
|
+
const {
|
|
26
|
+
importType,
|
|
27
|
+
curve = "CURVE_SECP256K1",
|
|
28
|
+
addressFormats = ["ADDRESS_FORMAT_ETHEREUM"],
|
|
29
|
+
onSuccess,
|
|
30
|
+
onError,
|
|
31
|
+
defaultWalletAccounts,
|
|
32
|
+
successPageDuration,
|
|
33
|
+
clearClipboardOnPaste,
|
|
34
|
+
stampWith,
|
|
35
|
+
name,
|
|
36
|
+
keyFormat
|
|
37
|
+
} = props;
|
|
38
|
+
const {
|
|
39
|
+
config,
|
|
40
|
+
session,
|
|
41
|
+
importWallet,
|
|
42
|
+
importPrivateKey,
|
|
43
|
+
httpClient
|
|
44
|
+
} = Hook.useZeroXKey();
|
|
45
|
+
if (!config) {
|
|
46
|
+
throw new sdkTypes.ZeroXKeyError("ZeroXKey SDK is not properly configured. Please check your configuration.", sdkTypes.ZeroXKeyErrorCodes.CONFIG_NOT_INITIALIZED);
|
|
47
|
+
}
|
|
48
|
+
const organizationId = props.organizationId || session?.organizationId;
|
|
49
|
+
if (!organizationId) {
|
|
50
|
+
throw new sdkTypes.ZeroXKeyError("Organization ID or a valid session is required for importing. Please pass in an organizationId or log in.", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
51
|
+
}
|
|
52
|
+
const userId = props.userId || session?.userId;
|
|
53
|
+
if (!userId) {
|
|
54
|
+
throw new sdkTypes.ZeroXKeyError("User ID or a valid session is required for importing. Please pass in a userId or log in.", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
55
|
+
}
|
|
56
|
+
const [walletName, setWalletName] = react.useState(name || "");
|
|
57
|
+
const [isLoading, setIsLoading] = react.useState(false);
|
|
58
|
+
const [error, setError] = react.useState(null);
|
|
59
|
+
const [shaking, setShaking] = react.useState(false);
|
|
60
|
+
const shakeInput = () => {
|
|
61
|
+
setShaking(true);
|
|
62
|
+
setTimeout(() => setShaking(false), 250);
|
|
63
|
+
};
|
|
64
|
+
const importIframeUrl = config?.importIframeUrl;
|
|
65
|
+
const {
|
|
66
|
+
closeModal,
|
|
67
|
+
pushPage,
|
|
68
|
+
isMobile
|
|
69
|
+
} = Hook$1.useModal();
|
|
70
|
+
const [importIframeClient, setImportIframeClient] = react.useState(null);
|
|
71
|
+
const subtitle = importType === base.ImportType.Wallet ? "Enter your seed phrase. Seed phrases are typically 12-24 words." : importType === base.ImportType.PrivateKey ? "Enter your private key." : "";
|
|
72
|
+
const placeholder = importType === base.ImportType.Wallet ? "Enter your wallet name" : importType === base.ImportType.PrivateKey ? "Enter your private key name" : "";
|
|
73
|
+
function removeImportIframe() {
|
|
74
|
+
document.getElementById(ZeroXKeyIframeElementId)?.remove();
|
|
75
|
+
}
|
|
76
|
+
react.useEffect(() => {
|
|
77
|
+
let isMounted = true;
|
|
78
|
+
let currentIframeClient = null;
|
|
79
|
+
const initIframe = async () => {
|
|
80
|
+
try {
|
|
81
|
+
removeImportIframe();
|
|
82
|
+
const newImportIframeClient = new iframeStamper.IframeStamper({
|
|
83
|
+
iframeUrl: importIframeUrl,
|
|
84
|
+
iframeElementId: ZeroXKeyIframeElementId,
|
|
85
|
+
iframeContainer: document.getElementById(ZeroXKeyImportIframeContainerId),
|
|
86
|
+
clearClipboardOnPaste
|
|
87
|
+
});
|
|
88
|
+
currentIframeClient = newImportIframeClient;
|
|
89
|
+
await newImportIframeClient.init();
|
|
90
|
+
if (!isMounted) {
|
|
91
|
+
newImportIframeClient.clear();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
await newImportIframeClient.applySettings({
|
|
95
|
+
styles: {
|
|
96
|
+
fontSize: "16px",
|
|
97
|
+
// IMPORTANT: These colors need to match --icon-text-light and --icon-text-dark in index.css
|
|
98
|
+
backgroundColor: config?.ui?.darkMode ? config?.ui?.colors?.dark?.iconBackground || iconBackgroundDark : config?.ui?.colors?.light?.iconBackground || iconBackgroundLight,
|
|
99
|
+
color: config?.ui?.darkMode ? config?.ui?.colors?.dark?.iconText || iconTextDark : config?.ui?.colors?.light?.iconText || iconTextLight
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
if (!isMounted) {
|
|
103
|
+
newImportIframeClient.clear();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
setImportIframeClient(newImportIframeClient);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
const iframeError = new sdkTypes.ZeroXKeyError(`Error initializing IframeStamper`, sdkTypes.ZeroXKeyErrorCodes.INTERNAL_ERROR, error);
|
|
109
|
+
setError(iframeError);
|
|
110
|
+
onError(iframeError);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
initIframe();
|
|
114
|
+
const iframeElement = document.getElementById(ZeroXKeyIframeElementId);
|
|
115
|
+
if (iframeElement) {
|
|
116
|
+
iframeElement.className = ZeroXKeyIframeClassNames;
|
|
117
|
+
}
|
|
118
|
+
return () => {
|
|
119
|
+
isMounted = false;
|
|
120
|
+
currentIframeClient?.clear();
|
|
121
|
+
removeImportIframe();
|
|
122
|
+
};
|
|
123
|
+
}, []);
|
|
124
|
+
react.useEffect(() => {
|
|
125
|
+
const reapplyIframeStyles = async () => {
|
|
126
|
+
await importIframeClient?.applySettings({
|
|
127
|
+
styles: {
|
|
128
|
+
fontSize: "16px",
|
|
129
|
+
backgroundColor: config?.ui?.darkMode ? config?.ui?.colors?.dark?.iconBackground || iconBackgroundDark : config?.ui?.colors?.light?.iconBackground || iconBackgroundLight,
|
|
130
|
+
color: config?.ui?.darkMode ? config?.ui?.colors?.dark?.iconText || iconTextDark : config?.ui?.colors?.light?.iconText || iconTextLight
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
reapplyIframeStyles();
|
|
135
|
+
}, [config.ui]);
|
|
136
|
+
function handleImportModalClose() {
|
|
137
|
+
if (importIframeClient) {
|
|
138
|
+
setImportIframeClient(null);
|
|
139
|
+
}
|
|
140
|
+
removeImportIframe();
|
|
141
|
+
}
|
|
142
|
+
async function handleImport() {
|
|
143
|
+
setIsLoading(true);
|
|
144
|
+
try {
|
|
145
|
+
if (!importIframeClient) {
|
|
146
|
+
throw new sdkTypes.ZeroXKeyError("Import iframe client not initialized", sdkTypes.ZeroXKeyErrorCodes.INTERNAL_ERROR);
|
|
147
|
+
}
|
|
148
|
+
let response;
|
|
149
|
+
switch (importType) {
|
|
150
|
+
case base.ImportType.Wallet:
|
|
151
|
+
const initWalletResult = await httpClient?.initImportWallet({
|
|
152
|
+
organizationId: organizationId,
|
|
153
|
+
userId: userId
|
|
154
|
+
}, stampWith);
|
|
155
|
+
if (!initWalletResult || !initWalletResult.importBundle) {
|
|
156
|
+
throw new sdkTypes.ZeroXKeyError("Failed to retrieve import bundle", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
157
|
+
}
|
|
158
|
+
const injectedWallet = await importIframeClient.injectImportBundle(initWalletResult.importBundle, organizationId, userId);
|
|
159
|
+
if (!injectedWallet) {
|
|
160
|
+
throw new sdkTypes.ZeroXKeyError("Failed to inject import bundle", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
161
|
+
}
|
|
162
|
+
const encryptedWalletBundle = await importIframeClient.extractWalletEncryptedBundle();
|
|
163
|
+
if (!encryptedWalletBundle || encryptedWalletBundle.trim() === "") {
|
|
164
|
+
throw new sdkTypes.ZeroXKeyError("Encrypted bundle is empty", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
165
|
+
}
|
|
166
|
+
let accounts = [];
|
|
167
|
+
if (Array.isArray(defaultWalletAccounts) && defaultWalletAccounts.length > 0 && defaultWalletAccounts[0]?.addressFormat === undefined) {
|
|
168
|
+
accounts = core.generateWalletAccountsFromAddressFormat({
|
|
169
|
+
addresses: defaultWalletAccounts
|
|
170
|
+
});
|
|
171
|
+
} else if (Array.isArray(defaultWalletAccounts)) {
|
|
172
|
+
accounts = defaultWalletAccounts;
|
|
173
|
+
}
|
|
174
|
+
response = await importWallet({
|
|
175
|
+
walletName: walletName,
|
|
176
|
+
accounts,
|
|
177
|
+
encryptedBundle: encryptedWalletBundle,
|
|
178
|
+
stampWith,
|
|
179
|
+
organizationId: organizationId,
|
|
180
|
+
userId: userId
|
|
181
|
+
});
|
|
182
|
+
break;
|
|
183
|
+
case base.ImportType.PrivateKey:
|
|
184
|
+
const initPrivateKeyResult = await httpClient?.initImportPrivateKey({
|
|
185
|
+
organizationId: organizationId,
|
|
186
|
+
userId: userId
|
|
187
|
+
}, stampWith);
|
|
188
|
+
if (!initPrivateKeyResult || !initPrivateKeyResult.importBundle) {
|
|
189
|
+
throw new sdkTypes.ZeroXKeyError("Failed to retrieve import bundle", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
190
|
+
}
|
|
191
|
+
const injectedKey = await importIframeClient.injectImportBundle(initPrivateKeyResult.importBundle, organizationId, userId);
|
|
192
|
+
if (!injectedKey) {
|
|
193
|
+
throw new sdkTypes.ZeroXKeyError("Failed to inject import bundle", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
194
|
+
}
|
|
195
|
+
const encryptedKeyBundle = await importIframeClient.extractKeyEncryptedBundle(keyFormat);
|
|
196
|
+
if (!encryptedKeyBundle || encryptedKeyBundle.trim() === "") {
|
|
197
|
+
throw new sdkTypes.ZeroXKeyError("Encrypted bundle is empty", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
198
|
+
}
|
|
199
|
+
response = await importPrivateKey({
|
|
200
|
+
addressFormats,
|
|
201
|
+
curve,
|
|
202
|
+
privateKeyName: walletName,
|
|
203
|
+
encryptedBundle: encryptedKeyBundle,
|
|
204
|
+
stampWith,
|
|
205
|
+
organizationId: organizationId,
|
|
206
|
+
userId: userId
|
|
207
|
+
});
|
|
208
|
+
break;
|
|
209
|
+
default:
|
|
210
|
+
throw new sdkTypes.ZeroXKeyError("Invalid import type", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
211
|
+
}
|
|
212
|
+
if (response) {
|
|
213
|
+
onSuccess(response);
|
|
214
|
+
if (successPageDuration && successPageDuration !== 0) {
|
|
215
|
+
pushPage({
|
|
216
|
+
key: "success",
|
|
217
|
+
content: jsxRuntime.jsx(Success.SuccessPage, {
|
|
218
|
+
text: importType === base.ImportType.Wallet ? "Wallet imported successfully!" : importType === base.ImportType.PrivateKey ? "Private key imported successfully!" : "Success!",
|
|
219
|
+
duration: successPageDuration,
|
|
220
|
+
onComplete: () => {
|
|
221
|
+
handleImportModalClose();
|
|
222
|
+
closeModal();
|
|
223
|
+
}
|
|
224
|
+
}),
|
|
225
|
+
preventBack: true,
|
|
226
|
+
showTitle: false
|
|
227
|
+
});
|
|
228
|
+
} else {
|
|
229
|
+
handleImportModalClose();
|
|
230
|
+
closeModal();
|
|
231
|
+
}
|
|
232
|
+
handleImportModalClose();
|
|
233
|
+
} else {
|
|
234
|
+
await importIframeClient.clear();
|
|
235
|
+
throw new sdkTypes.ZeroXKeyError("Failed to import wallet", sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR);
|
|
236
|
+
}
|
|
237
|
+
} catch (error) {
|
|
238
|
+
shakeInput();
|
|
239
|
+
setError(error instanceof sdkTypes.ZeroXKeyError ? error : new sdkTypes.ZeroXKeyError(`Error importing wallet`, sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR, error));
|
|
240
|
+
if (error instanceof sdkTypes.ZeroXKeyError) onError(error);
|
|
241
|
+
throw new sdkTypes.ZeroXKeyError(`Error importing wallet`, sdkTypes.ZeroXKeyErrorCodes.IMPORT_WALLET_ERROR, error);
|
|
242
|
+
} finally {
|
|
243
|
+
setIsLoading(false);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return jsxRuntime.jsxs("div", {
|
|
247
|
+
className: clsx("flex flex-col items-center pt-4", isMobile ? "w-full" : "w-[21rem]"),
|
|
248
|
+
children: [jsxRuntime.jsx("p", {
|
|
249
|
+
className: "text-sm text-icon-text-light dark:text-icon-text-dark",
|
|
250
|
+
children: subtitle
|
|
251
|
+
}), jsxRuntime.jsx("div", {
|
|
252
|
+
id: ZeroXKeyImportIframeContainerId,
|
|
253
|
+
style: {
|
|
254
|
+
height: "100%",
|
|
255
|
+
overflow: "hidden",
|
|
256
|
+
display: "block",
|
|
257
|
+
backgroundColor: config?.ui?.darkMode ? config?.ui?.colors?.dark?.iconBackground || iconBackgroundDark : config?.ui?.colors?.light?.iconBackground || iconBackgroundLight,
|
|
258
|
+
width: "100%",
|
|
259
|
+
boxSizing: "border-box",
|
|
260
|
+
padding: "5px",
|
|
261
|
+
borderStyle: "solid",
|
|
262
|
+
borderWidth: "1px",
|
|
263
|
+
borderRadius: "8px",
|
|
264
|
+
borderColor: config?.ui?.darkMode ? config?.ui?.colors?.dark?.iconText || iconTextDark : config?.ui?.colors?.light?.iconText || iconTextLight
|
|
265
|
+
},
|
|
266
|
+
className: `transition-all ${shaking ? "animate-shake" : ""}`
|
|
267
|
+
}), !name && jsxRuntime.jsx(react$1.Input, {
|
|
268
|
+
type: "text",
|
|
269
|
+
"data-testid": "import-wallet-name-input",
|
|
270
|
+
placeholder: placeholder,
|
|
271
|
+
value: walletName,
|
|
272
|
+
onChange: e => setWalletName(e.target.value),
|
|
273
|
+
className: "placeholder:text-icon-text-light dark:placeholder:text-icon-text-dark w-full mt-2 py-3 px-3 rounded-md text-inherit bg-icon-background-light dark:bg-icon-background-dark border border-modal-background-dark/20 dark:border-modal-background-light/20 focus:outline-primary-light focus:dark:outline-primary-dark focus:outline-[1px] focus:outline-offset-0 box-border"
|
|
274
|
+
}), jsxRuntime.jsx(Buttons.ActionButton, {
|
|
275
|
+
name: "import-button",
|
|
276
|
+
loading: isLoading || !importIframeClient,
|
|
277
|
+
spinnerClassName: "text-primary-text-light dark:text-primary-text-dark",
|
|
278
|
+
onClick: handleImport,
|
|
279
|
+
className: "bg-primary-light mt-2 dark:bg-primary-dark text-primary-text-light dark:text-primary-text-dark",
|
|
280
|
+
children: "Import"
|
|
281
|
+
}), jsxRuntime.jsxs("p", {
|
|
282
|
+
"data-testid": "import-error-message",
|
|
283
|
+
className: clsx("text-sm text-red-500 transition-opacity delay-75 line-clamp-2 w-full", error ? "opacity-100 pointer-events-auto mt-2" : "opacity-0 pointer-events-none absolute"),
|
|
284
|
+
children: [error?.message, ":", " ", error?.cause instanceof sdkTypes.ZeroXKeyError ? error?.cause.message : error?.cause?.toString() || "Unknown error"]
|
|
285
|
+
})]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
exports.ImportComponent = ImportComponent;
|
|
290
|
+
//# sourceMappingURL=Import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Import.js","sources":["../../../src/components/import/Import.tsx"],"sourcesContent":[null],"names":["ZeroXKeyImportIframeContainerId","ZeroXKeyIframeElementId","ZeroXKeyIframeClassNames","iconBackgroundLight","iconBackgroundDark","iconTextLight","iconTextDark","ImportComponent","props","importType","curve","addressFormats","onSuccess","onError","defaultWalletAccounts","successPageDuration","clearClipboardOnPaste","stampWith","name","keyFormat","config","session","importWallet","importPrivateKey","httpClient","useZeroXKey","ZeroXKeyError","ZeroXKeyErrorCodes","CONFIG_NOT_INITIALIZED","organizationId","IMPORT_WALLET_ERROR","userId","walletName","setWalletName","useState","isLoading","setIsLoading","error","setError","shaking","setShaking","shakeInput","setTimeout","importIframeUrl","closeModal","pushPage","isMobile","useModal","importIframeClient","setImportIframeClient","subtitle","ImportType","Wallet","PrivateKey","placeholder","removeImportIframe","document","getElementById","remove","useEffect","isMounted","currentIframeClient","initIframe","newImportIframeClient","IframeStamper","iframeUrl","iframeElementId","iframeContainer","init","clear","applySettings","styles","fontSize","backgroundColor","ui","darkMode","colors","dark","iconBackground","light","color","iconText","iframeError","INTERNAL_ERROR","iframeElement","className","reapplyIframeStyles","handleImportModalClose","handleImport","response","initWalletResult","initImportWallet","importBundle","injectedWallet","injectImportBundle","encryptedWalletBundle","extractWalletEncryptedBundle","trim","accounts","Array","isArray","length","addressFormat","undefined","generateWalletAccountsFromAddressFormat","addresses","encryptedBundle","initPrivateKeyResult","initImportPrivateKey","injectedKey","encryptedKeyBundle","extractKeyEncryptedBundle","privateKeyName","key","content","_jsx","SuccessPage","text","duration","onComplete","preventBack","showTitle","_jsxs","clsx","children","id","style","height","overflow","display","width","boxSizing","padding","borderStyle","borderWidth","borderRadius","borderColor","Input","type","value","onChange","e","target","ActionButton","loading","spinnerClassName","onClick","message","cause","toString"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAMA,+BAA+B,GAAG,kCAAkC;AAC1E,MAAMC,uBAAuB,GAAG,oCAAoC;AACpE,MAAMC,wBAAwB,GAC5B,4GAA4G;AAE9G;AACA,MAAMC,mBAAmB,GAAG,SAAS;AACrC,MAAMC,kBAAkB,GAAG,SAAS;AACpC,MAAMC,aAAa,GAAG,SAAS;AAC/B,MAAMC,YAAY,GAAG,SAAS;AAExB,SAAUC,eAAeA,CAACC,KAc/B,EAAA;EACC,MAAM;IACJC,UAAU;AACVC,IAAAA,KAAK,GAAG,iBAAiB;IACzBC,cAAc,GAAG,CAAC,yBAAyB,CAAC;IAC5CC,SAAS;IACTC,OAAO;IACPC,qBAAqB;IACrBC,mBAAmB;IACnBC,qBAAqB;IACrBC,SAAS;IACTC,IAAI;AACJC,IAAAA;AAAS,GACV,GAAGX,KAAK;EAET,MAAM;IAAEY,MAAM;IAAEC,OAAO;IAAEC,YAAY;IAAEC,gBAAgB;AAAEC,IAAAA;GAAY,GACnEC,gBAAW,EAAE;EAEf,IAAI,CAACL,MAAM,EAAE;IACX,MAAM,IAAIM,sBAAa,CACrB,2EAA2E,EAC3EC,2BAAkB,CAACC,sBAAsB,CAC1C;AACH,EAAA;EAEA,MAAMC,cAAc,GAAGrB,KAAK,CAACqB,cAAc,IAAIR,OAAO,EAAEQ,cAAc;EACtE,IAAI,CAACA,cAAc,EAAE;IACnB,MAAM,IAAIH,sBAAa,CACrB,2GAA2G,EAC3GC,2BAAkB,CAACG,mBAAmB,CAC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