@dynamic-labs/sdk-react-core 4.22.8 → 4.23.1
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/CHANGELOG.md +16 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +13 -13
- package/src/index.cjs +2 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -1
- package/src/lib/client/client.cjs +2 -0
- package/src/lib/client/client.d.ts +1 -0
- package/src/lib/client/client.js +2 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.cjs +5 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.js +5 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.cjs +24 -6
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.d.ts +1 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.js +26 -8
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.cjs +1 -1
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.js +1 -1
- package/src/lib/components/Search/Search.cjs +5 -1
- package/src/lib/components/Search/Search.js +5 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +1 -1
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +9 -2
- package/src/lib/events/dynamicEvents.cjs +1 -0
- package/src/lib/events/dynamicEvents.d.ts +2 -2
- package/src/lib/events/dynamicEvents.js +1 -0
- package/src/lib/events/wallets.d.ts +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +1 -1
- package/src/lib/locale/en/translation.cjs +30 -0
- package/src/lib/locale/en/translation.d.ts +30 -0
- package/src/lib/locale/en/translation.js +30 -0
- package/src/lib/shared/logger.cjs +1 -1
- package/src/lib/shared/logger.js +2 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.cjs +1 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +1 -1
- package/src/lib/utils/functions/getTimeSince/index.d.ts +1 -0
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +1 -1
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +1 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/index.d.ts +3 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.cjs +15 -0
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.d.ts +6 -0
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.js +11 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +13 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +13 -6
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.cjs +1 -1
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.js +1 -1
- package/src/lib/utils/hooks/useIsMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -1
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +33 -18
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.d.ts +4 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +33 -18
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.cjs +1 -1
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.js +1 -1
- package/src/lib/utils/hooks/useRegisterPasskey/useRegisterPasskey.d.ts +2 -2
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.cjs +11 -2
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.js +11 -2
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +1 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +1 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +1 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +43 -6
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +43 -6
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +17 -8
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +17 -8
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +8 -2
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +8 -2
- package/src/lib/views/ExchangeList/ExchangeList.cjs +9 -14
- package/src/lib/views/ExchangeList/ExchangeList.js +10 -15
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +2 -2
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +2 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +1 -1
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +4 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.d.ts +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +4 -2
- package/src/lib/views/WalletList/WalletList.cjs +1 -1
- package/src/lib/views/WalletList/WalletList.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +4 -4
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -2
- package/src/lib/widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs +0 -6
- package/src/lib/widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js +1 -6
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +0 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +0 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +0 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +42 -106
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +43 -107
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +119 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.d.ts +6 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +115 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.cjs +170 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.js +166 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView/ManageMfaWidgetView.cjs → ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs} +8 -7
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView/ManageMfaWidgetView.js → ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js} +7 -6
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +5 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/index.d.ts +0 -1
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.cjs +0 -0
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.d.ts +0 -0
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.js +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/index.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.cjs +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.23.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.23.0...v4.23.1) (2025-07-15)
|
|
3
|
+
|
|
4
|
+
## [4.23.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.8...v4.23.0) (2025-07-11)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add passkey to react-native ([#9111](https://github.com/dynamic-labs/dynamic-auth/issues/9111)) ([b06e971](https://github.com/dynamic-labs/dynamic-auth/commit/b06e9718537519e25ffef50dfb616964316d8a99))
|
|
10
|
+
* add walletConnectionFailed event ([#9152](https://github.com/dynamic-labs/dynamic-auth/issues/9152)) ([ebdd06f](https://github.com/dynamic-labs/dynamic-auth/commit/ebdd06f6b799867db35f784d84a345f8f91fedb1))
|
|
11
|
+
* selectWalletOption now resolves to the connected wallet ([#9153](https://github.com/dynamic-labs/dynamic-auth/issues/9153)) ([775430c](https://github.com/dynamic-labs/dynamic-auth/commit/775430cd2d2b60a4010b70301db298b72dfb8f1e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* zod import reference with parser bundler ([#9157](https://github.com/dynamic-labs/dynamic-auth/issues/9157)) ([6dfe18d](https://github.com/dynamic-labs/dynamic-auth/commit/6dfe18d583ba6356205030ad4151b3312513ca46))
|
|
17
|
+
|
|
2
18
|
### [4.22.8](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.7...v4.22.8) (2025-07-10)
|
|
3
19
|
|
|
4
20
|
|
package/package.cjs
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.23.1";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
9
|
-
"@dynamic-labs-sdk/client": "0.0.1-alpha.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.715",
|
|
9
|
+
"@dynamic-labs-sdk/client": "0.0.1-alpha.15",
|
|
10
10
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
11
11
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
12
12
|
"country-list": "2.3.0",
|
package/package.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.
|
|
2
|
+
var version = "4.23.1";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
-
"@dynamic-labs-sdk/client": "0.0.1-alpha.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.715",
|
|
5
|
+
"@dynamic-labs-sdk/client": "0.0.1-alpha.15",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
7
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
8
8
|
"country-list": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.23.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
6
|
-
"@dynamic-labs-sdk/client": "0.0.1-alpha.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.715",
|
|
6
|
+
"@dynamic-labs-sdk/client": "0.0.1-alpha.15",
|
|
7
7
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
8
8
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
9
9
|
"country-list": "2.3.0",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
19
|
-
"@dynamic-labs/iconic": "4.
|
|
20
|
-
"@dynamic-labs/logger": "4.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
23
|
-
"@dynamic-labs/store": "4.
|
|
24
|
-
"@dynamic-labs/types": "4.
|
|
25
|
-
"@dynamic-labs/utils": "4.
|
|
26
|
-
"@dynamic-labs/wallet-book": "4.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.23.1",
|
|
19
|
+
"@dynamic-labs/iconic": "4.23.1",
|
|
20
|
+
"@dynamic-labs/logger": "4.23.1",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "4.23.1",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "4.23.1",
|
|
23
|
+
"@dynamic-labs/store": "4.23.1",
|
|
24
|
+
"@dynamic-labs/types": "4.23.1",
|
|
25
|
+
"@dynamic-labs/utils": "4.23.1",
|
|
26
|
+
"@dynamic-labs/wallet-book": "4.23.1",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "4.23.1",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -65,7 +65,7 @@ var dynamicEvents = require('./lib/events/dynamicEvents.cjs');
|
|
|
65
65
|
var api = require('./lib/data/api/api.cjs');
|
|
66
66
|
require('@dynamic-labs-sdk/client/core');
|
|
67
67
|
require('@dynamic-labs-sdk/client');
|
|
68
|
-
require('./lib/client/client.cjs');
|
|
68
|
+
var client = require('./lib/client/client.cjs');
|
|
69
69
|
require('@dynamic-labs/multi-wallet');
|
|
70
70
|
require('react-international-phone');
|
|
71
71
|
var mergeNetworks = require('./lib/utils/functions/mergeNetworks/mergeNetworks.cjs');
|
|
@@ -241,6 +241,7 @@ exports.useWalletConnectorEvent = useWalletConnectorEvent.useWalletConnectorEven
|
|
|
241
241
|
exports.useAuthenticateConnectedUser = useAuthenticateConnectedUser.useAuthenticateConnectedUser;
|
|
242
242
|
exports.dynamicEvents = dynamicEvents.publicDynamicEvents;
|
|
243
243
|
exports.apiClient = api.sdkApi;
|
|
244
|
+
exports.useDynamicClient = client.useDynamicClient;
|
|
244
245
|
exports.mergeNetworks = mergeNetworks.mergeNetworks;
|
|
245
246
|
exports.overrideNetworkRpcUrl = overrideNetworkRpcUrl.overrideNetworkRpcUrl;
|
|
246
247
|
exports.isAuthenticatedWithAWallet = isAuthenticatedWithAWallet.isAuthenticatedWithAWallet;
|
package/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { useDynamicContext } from './lib/context/DynamicContext/useDynamicContex
|
|
|
10
10
|
export { useDynamicScopes } from './lib/utils/hooks/useDynamicScopes';
|
|
11
11
|
export { useUserWalletsExternal as useUserWallets } from './lib/context/UserWalletsContext';
|
|
12
12
|
export { DynamicConnectButton, ShadowDOM, IsBrowser } from './lib/components';
|
|
13
|
+
export { useDynamicClient } from './lib/client';
|
|
13
14
|
export { DynamicBridgeWidget, DynamicEmbeddedAuthFlow, DynamicEmbeddedUserProfile, DynamicEmbeddedWidget, DynamicMultiWalletPromptsWidget, DynamicNav, DynamicUserProfile, DynamicWidget,
|
|
14
15
|
/** @deprecated use OnrampWidget instead */
|
|
15
16
|
OnrampWidget as FundingWidget, OnrampWidget, } from './lib/widgets';
|
package/src/index.js
CHANGED
|
@@ -61,7 +61,7 @@ export { publicDynamicEvents as dynamicEvents } from './lib/events/dynamicEvents
|
|
|
61
61
|
export { sdkApi as apiClient } from './lib/data/api/api.js';
|
|
62
62
|
import '@dynamic-labs-sdk/client/core';
|
|
63
63
|
import '@dynamic-labs-sdk/client';
|
|
64
|
-
|
|
64
|
+
export { useDynamicClient } from './lib/client/client.js';
|
|
65
65
|
import '@dynamic-labs/multi-wallet';
|
|
66
66
|
import 'react-international-phone';
|
|
67
67
|
export { mergeNetworks } from './lib/utils/functions/mergeNetworks/mergeNetworks.js';
|
|
@@ -17,6 +17,7 @@ const setDynamicClient = (newClient) => {
|
|
|
17
17
|
dynamicClient = newClient;
|
|
18
18
|
dynamicClientEmitter.emit('changed', newClient);
|
|
19
19
|
};
|
|
20
|
+
const hasDynamicClient = () => dynamicClient !== null;
|
|
20
21
|
const getDynamicClient = () => {
|
|
21
22
|
if (!dynamicClient) {
|
|
22
23
|
throw new utils.DynamicError('Tried to getClient when it was still null');
|
|
@@ -39,5 +40,6 @@ const useDynamicClient = () => {
|
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
exports.getDynamicClient = getDynamicClient;
|
|
43
|
+
exports.hasDynamicClient = hasDynamicClient;
|
|
42
44
|
exports.setDynamicClient = setDynamicClient;
|
|
43
45
|
exports.useDynamicClient = useDynamicClient;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DynamicClient } from '@dynamic-labs-sdk/client';
|
|
2
2
|
export declare const setDynamicClient: (newClient: DynamicClient) => void;
|
|
3
|
+
export declare const hasDynamicClient: () => boolean;
|
|
3
4
|
export declare const getDynamicClient: () => DynamicClient;
|
|
4
5
|
/**
|
|
5
6
|
* Not many customers will ever change the client mid execution, but demo v2 will.
|
package/src/lib/client/client.js
CHANGED
|
@@ -9,6 +9,7 @@ const setDynamicClient = (newClient) => {
|
|
|
9
9
|
dynamicClient = newClient;
|
|
10
10
|
dynamicClientEmitter.emit('changed', newClient);
|
|
11
11
|
};
|
|
12
|
+
const hasDynamicClient = () => dynamicClient !== null;
|
|
12
13
|
const getDynamicClient = () => {
|
|
13
14
|
if (!dynamicClient) {
|
|
14
15
|
throw new DynamicError('Tried to getClient when it was still null');
|
|
@@ -30,4 +31,4 @@ const useDynamicClient = () => {
|
|
|
30
31
|
return client;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
export { getDynamicClient, setDynamicClient, useDynamicClient };
|
|
34
|
+
export { getDynamicClient, hasDynamicClient, setDynamicClient, useDynamicClient };
|
package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.cjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Applies mock responses to requests that are not expected to be while in dog-feeding phase of the SDK.
|
|
@@ -21,7 +22,10 @@ const fetchOverride = (req, init) => _tslib.__awaiter(void 0, void 0, void 0, fu
|
|
|
21
22
|
if (req.toString().includes('settings')) {
|
|
22
23
|
return new Response(JSON.stringify(null), { status: 200 });
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* We need to use the FetchService.fetch for ReactNative, Flutter and Unity3d SDKs.
|
|
27
|
+
*/
|
|
28
|
+
return utils.FetchService.fetch(req, init);
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
exports.fetchOverride = fetchOverride;
|
package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { FetchService } from '@dynamic-labs/utils';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Applies mock responses to requests that are not expected to be while in dog-feeding phase of the SDK.
|
|
@@ -17,7 +18,10 @@ const fetchOverride = (req, init) => __awaiter(void 0, void 0, void 0, function*
|
|
|
17
18
|
if (req.toString().includes('settings')) {
|
|
18
19
|
return new Response(JSON.stringify(null), { status: 200 });
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* We need to use the FetchService.fetch for ReactNative, Flutter and Unity3d SDKs.
|
|
23
|
+
*/
|
|
24
|
+
return FetchService.fetch(req, init);
|
|
21
25
|
});
|
|
22
26
|
|
|
23
27
|
export { fetchOverride };
|
|
@@ -12,8 +12,29 @@ var fetchOverride = require('./fetchOverride/fetchOverride.cjs');
|
|
|
12
12
|
var getApiHeaders = require('./getApiHeaders/getApiHeaders.cjs');
|
|
13
13
|
var syncEvents = require('./syncEvents/syncEvents.cjs');
|
|
14
14
|
|
|
15
|
-
const useInitializeSdkClient = ({ settings }) => {
|
|
15
|
+
const useInitializeSdkClient = ({ settings, client: clientFromProps, }) => {
|
|
16
16
|
const lastClientDependencyKey = React.useRef(null);
|
|
17
|
+
/**
|
|
18
|
+
* Sets the client to the state and setup the extensions.
|
|
19
|
+
*/
|
|
20
|
+
const setClient = (client$2) => {
|
|
21
|
+
if (client.hasExtension(client$2, constants.CLIENT_EXTENSION_NAME)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
client$1.setDynamicClient(client$2);
|
|
25
|
+
core.registerExtension(client$2, constants.CLIENT_EXTENSION_NAME);
|
|
26
|
+
syncEvents.syncEvents(client$2);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* If a client is provided by the props, we should use it instead of
|
|
30
|
+
* creating a new one.
|
|
31
|
+
*/
|
|
32
|
+
if (clientFromProps) {
|
|
33
|
+
if (!client$1.hasDynamicClient() || client$1.getDynamicClient() !== clientFromProps) {
|
|
34
|
+
setClient(clientFromProps);
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
17
38
|
const clientDependencyKey = [
|
|
18
39
|
settings.apiBaseUrl,
|
|
19
40
|
settings.environmentId,
|
|
@@ -21,17 +42,14 @@ const useInitializeSdkClient = ({ settings }) => {
|
|
|
21
42
|
if (lastClientDependencyKey.current === clientDependencyKey)
|
|
22
43
|
return;
|
|
23
44
|
lastClientDependencyKey.current = clientDependencyKey;
|
|
24
|
-
|
|
45
|
+
setClient(client.createDynamicClient({
|
|
25
46
|
coreConfig: {
|
|
26
47
|
apiBaseUrl: settings.apiBaseUrl,
|
|
27
48
|
fetch: fetchOverride.fetchOverride,
|
|
28
49
|
getApiHeaders: getApiHeaders.getApiHeaders,
|
|
29
50
|
},
|
|
30
51
|
environmentId: settings.environmentId,
|
|
31
|
-
});
|
|
32
|
-
client$1.setDynamicClient(newClient);
|
|
33
|
-
core.registerExtension(newClient, constants.CLIENT_EXTENSION_NAME);
|
|
34
|
-
syncEvents.syncEvents(newClient);
|
|
52
|
+
}));
|
|
35
53
|
};
|
|
36
54
|
|
|
37
55
|
exports.useInitializeSdkClient = useInitializeSdkClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DynamicContextProps } from '../../../../context/DynamicContext';
|
|
2
|
-
export declare const useInitializeSdkClient: ({ settings }: DynamicContextProps) => void;
|
|
2
|
+
export declare const useInitializeSdkClient: ({ settings, client: clientFromProps, }: DynamicContextProps) => void;
|
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { useRef } from 'react';
|
|
3
|
-
import { createDynamicClient } from '@dynamic-labs-sdk/client';
|
|
3
|
+
import { createDynamicClient, hasExtension } from '@dynamic-labs-sdk/client';
|
|
4
4
|
import { registerExtension } from '@dynamic-labs-sdk/client/core';
|
|
5
|
-
import { setDynamicClient } from '../../../client.js';
|
|
5
|
+
import { setDynamicClient, hasDynamicClient, getDynamicClient } from '../../../client.js';
|
|
6
6
|
import { CLIENT_EXTENSION_NAME } from '../../constants.js';
|
|
7
7
|
import { fetchOverride } from './fetchOverride/fetchOverride.js';
|
|
8
8
|
import { getApiHeaders } from './getApiHeaders/getApiHeaders.js';
|
|
9
9
|
import { syncEvents } from './syncEvents/syncEvents.js';
|
|
10
10
|
|
|
11
|
-
const useInitializeSdkClient = ({ settings }) => {
|
|
11
|
+
const useInitializeSdkClient = ({ settings, client: clientFromProps, }) => {
|
|
12
12
|
const lastClientDependencyKey = useRef(null);
|
|
13
|
+
/**
|
|
14
|
+
* Sets the client to the state and setup the extensions.
|
|
15
|
+
*/
|
|
16
|
+
const setClient = (client) => {
|
|
17
|
+
if (hasExtension(client, CLIENT_EXTENSION_NAME)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
setDynamicClient(client);
|
|
21
|
+
registerExtension(client, CLIENT_EXTENSION_NAME);
|
|
22
|
+
syncEvents(client);
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* If a client is provided by the props, we should use it instead of
|
|
26
|
+
* creating a new one.
|
|
27
|
+
*/
|
|
28
|
+
if (clientFromProps) {
|
|
29
|
+
if (!hasDynamicClient() || getDynamicClient() !== clientFromProps) {
|
|
30
|
+
setClient(clientFromProps);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
13
34
|
const clientDependencyKey = [
|
|
14
35
|
settings.apiBaseUrl,
|
|
15
36
|
settings.environmentId,
|
|
@@ -17,17 +38,14 @@ const useInitializeSdkClient = ({ settings }) => {
|
|
|
17
38
|
if (lastClientDependencyKey.current === clientDependencyKey)
|
|
18
39
|
return;
|
|
19
40
|
lastClientDependencyKey.current = clientDependencyKey;
|
|
20
|
-
|
|
41
|
+
setClient(createDynamicClient({
|
|
21
42
|
coreConfig: {
|
|
22
43
|
apiBaseUrl: settings.apiBaseUrl,
|
|
23
44
|
fetch: fetchOverride,
|
|
24
45
|
getApiHeaders,
|
|
25
46
|
},
|
|
26
47
|
environmentId: settings.environmentId,
|
|
27
|
-
});
|
|
28
|
-
setDynamicClient(newClient);
|
|
29
|
-
registerExtension(newClient, CLIENT_EXTENSION_NAME);
|
|
30
|
-
syncEvents(newClient);
|
|
48
|
+
}));
|
|
31
49
|
};
|
|
32
50
|
|
|
33
51
|
export { useInitializeSdkClient };
|
|
@@ -22,6 +22,6 @@ var Typography = require('../../Typography/Typography.cjs');
|
|
|
22
22
|
const DropdownMenu = ({ options, setShowMenu, }) => (jsxRuntime.jsx("div", { className: 'dots-menu-dropdown__container', style: { zIndex: index.tooltipZIndex }, children: options.map((option) => option.hide ? null : (jsxRuntime.jsxs("div", { className: 'dots-menu-dropdown__item', onClick: () => {
|
|
23
23
|
option.callback();
|
|
24
24
|
setShowMenu(false);
|
|
25
|
-
}, children: [option.Icon && jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: option.Icon }), jsxRuntime.jsxs(Typography.Typography, { className: 'dots-menu-dropdown__item-text', color: option.fontColor ? option.fontColor : 'secondary', weight: option.fontWeight, children: [option.text, " ", option.badge ? jsxRuntime.jsx(Badge.Badge, { text: option.badge }) : null] }), option.endSlot && (jsxRuntime.jsx("div", { className: 'dots-menu-dropdown__item__end-slot', children: option.endSlot }))] }, option.text))) }));
|
|
25
|
+
}, children: [option.Icon && jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: option.Icon }), jsxRuntime.jsxs(Typography.Typography, { copykey: option.copykey, className: 'dots-menu-dropdown__item-text', color: option.fontColor ? option.fontColor : 'secondary', weight: option.fontWeight, children: [option.text, " ", option.badge ? jsxRuntime.jsx(Badge.Badge, { text: option.badge }) : null] }), option.endSlot && (jsxRuntime.jsx("div", { className: 'dots-menu-dropdown__item__end-slot', children: option.endSlot }))] }, option.text))) }));
|
|
26
26
|
|
|
27
27
|
exports.DropdownMenu = DropdownMenu;
|
|
@@ -18,6 +18,6 @@ import { Typography } from '../../Typography/Typography.js';
|
|
|
18
18
|
const DropdownMenu = ({ options, setShowMenu, }) => (jsx("div", { className: 'dots-menu-dropdown__container', style: { zIndex: tooltipZIndex }, children: options.map((option) => option.hide ? null : (jsxs("div", { className: 'dots-menu-dropdown__item', onClick: () => {
|
|
19
19
|
option.callback();
|
|
20
20
|
setShowMenu(false);
|
|
21
|
-
}, children: [option.Icon && jsx(Icon, { color: 'text-tertiary', children: option.Icon }), jsxs(Typography, { className: 'dots-menu-dropdown__item-text', color: option.fontColor ? option.fontColor : 'secondary', weight: option.fontWeight, children: [option.text, " ", option.badge ? jsx(Badge, { text: option.badge }) : null] }), option.endSlot && (jsx("div", { className: 'dots-menu-dropdown__item__end-slot', children: option.endSlot }))] }, option.text))) }));
|
|
21
|
+
}, children: [option.Icon && jsx(Icon, { color: 'text-tertiary', children: option.Icon }), jsxs(Typography, { copykey: option.copykey, className: 'dots-menu-dropdown__item-text', color: option.fontColor ? option.fontColor : 'secondary', weight: option.fontWeight, children: [option.text, " ", option.badge ? jsx(Badge, { text: option.badge }) : null] }), option.endSlot && (jsx("div", { className: 'dots-menu-dropdown__item__end-slot', children: option.endSlot }))] }, option.text))) }));
|
|
22
22
|
|
|
23
23
|
export { DropdownMenu };
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
7
8
|
require('react');
|
|
8
9
|
var search = require('../../assets/search.cjs');
|
|
9
10
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
10
11
|
|
|
11
|
-
const Search = ({ className = '', id, label, type, onChange, onBlur, name, value, onClickClear, copykey, }) =>
|
|
12
|
+
const Search = ({ className = '', id, label, type, onChange, onBlur, name, value, onClickClear, copykey, }) => {
|
|
13
|
+
const { t } = reactI18next.useTranslation();
|
|
14
|
+
return (jsxRuntime.jsxs("label", { htmlFor: id, className: classNames.classNames('search__container', value ? 'search__container--active' : undefined), children: [jsxRuntime.jsx("div", { className: 'search-icon__container', children: jsxRuntime.jsx(search.ReactComponent, {}) }), jsxRuntime.jsx("input", { name: name, value: value, onChange: onChange, onBlur: onBlur, type: type, id: id, placeholder: label, className: classNames.classNames('search__input', className), "data-testid": 'Search', copykey: copykey }), value.length > 0 && (jsxRuntime.jsx("button", { type: 'button', onClick: onClickClear, className: 'search__button--clear', "data-testid": 'search-clear-button', copykey: 'dyn_search.clear', children: t('dyn_search.clear') }))] }));
|
|
15
|
+
};
|
|
12
16
|
|
|
13
17
|
exports.Search = Search;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import 'react';
|
|
4
5
|
import { ReactComponent as SvgSearch } from '../../assets/search.js';
|
|
5
6
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
6
7
|
|
|
7
|
-
const Search = ({ className = '', id, label, type, onChange, onBlur, name, value, onClickClear, copykey, }) =>
|
|
8
|
+
const Search = ({ className = '', id, label, type, onChange, onBlur, name, value, onClickClear, copykey, }) => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
return (jsxs("label", { htmlFor: id, className: classNames('search__container', value ? 'search__container--active' : undefined), children: [jsx("div", { className: 'search-icon__container', children: jsx(SvgSearch, {}) }), jsx("input", { name: name, value: value, onChange: onChange, onBlur: onBlur, type: type, id: id, placeholder: label, className: classNames('search__input', className), "data-testid": 'Search', copykey: copykey }), value.length > 0 && (jsx("button", { type: 'button', onClick: onClickClear, className: 'search__button--clear', "data-testid": 'search-clear-button', copykey: 'dyn_search.clear', children: t('dyn_search.clear') }))] }));
|
|
11
|
+
};
|
|
8
12
|
|
|
9
13
|
export { Search };
|
|
@@ -9,8 +9,8 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
9
9
|
require('react');
|
|
10
10
|
require('@dynamic-labs-sdk/client');
|
|
11
11
|
require('../../../client/client.cjs');
|
|
12
|
-
require('../../../utils/constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../utils/constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../shared/logger.cjs');
|
|
16
16
|
require('../../../utils/constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import '@dynamic-labs-sdk/client';
|
|
7
7
|
import '../../../client/client.js';
|
|
8
|
-
import '../../../utils/constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../utils/constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../shared/logger.js';
|
|
12
12
|
import '../../../utils/constants/colors.js';
|
|
@@ -9,8 +9,8 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
9
9
|
require('react');
|
|
10
10
|
require('@dynamic-labs-sdk/client');
|
|
11
11
|
require('../../../client/client.cjs');
|
|
12
|
-
require('../../../utils/constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../utils/constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../shared/logger.cjs');
|
|
16
16
|
require('../../../utils/constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import '@dynamic-labs-sdk/client';
|
|
7
7
|
import '../../../client/client.js';
|
|
8
|
-
import '../../../utils/constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../utils/constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../shared/logger.js';
|
|
12
12
|
import '../../../utils/constants/colors.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { DynamicClient } from '@dynamic-labs-sdk/client';
|
|
2
3
|
import { CountryIso2 } from 'react-international-phone';
|
|
3
4
|
import { LogLevel } from '@dynamic-labs/logger';
|
|
4
|
-
import { type MobileExperience, type CoinbaseWalletPreference, type SocialProviderFilter, AuthMode } from '@dynamic-labs/types';
|
|
5
|
-
import { DeepLinkVariant, WalletConnectorExtension, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
|
|
6
5
|
import { TokenBalance } from '@dynamic-labs/sdk-api-core';
|
|
6
|
+
import { type CoinbaseWalletPreference, type MobileExperience, type SocialProviderFilter, AuthMode } from '@dynamic-labs/types';
|
|
7
|
+
import { DeepLinkVariant, WalletConnectorExtension, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import { LocaleResource } from '../../../locale';
|
|
8
9
|
import { AccessDeniedCustomButton, ChainToWalletMap, DynamicEventsCallbacks, RecommendedWallet, TransactionConfirmationSettings, WalletsFilter } from '../../../shared';
|
|
9
10
|
import { DynamicHandlers } from '../../../shared/types/dynamicHandlers';
|
|
@@ -15,6 +16,12 @@ import { SocialSettings } from './SocialSettings';
|
|
|
15
16
|
export interface DynamicContextProps {
|
|
16
17
|
children: ReactNode;
|
|
17
18
|
locale?: LocaleResource;
|
|
19
|
+
/**
|
|
20
|
+
* The DynamicClient instance to use for the DynamicContext.
|
|
21
|
+
* If not provided, a new instance will be created.
|
|
22
|
+
* @default undefined
|
|
23
|
+
*/
|
|
24
|
+
client?: DynamicClient;
|
|
18
25
|
settings: {
|
|
19
26
|
accessDeniedButton?: AccessDeniedCustomButton;
|
|
20
27
|
accessDeniedMessagePrimary?: string;
|
|
@@ -13,7 +13,7 @@ import { WalletEvents } from './wallets';
|
|
|
13
13
|
/** Maps internal event names to their listeners */
|
|
14
14
|
export type DynamicEvents = AuthEvents & UIEvents & OTPEvents & WalletEvents & PasskeyEvents & SocialEvents & EmbeddedWalletEvents & MultiWalletInternalEvents & TokenBalancesEvents & UserEvents & FundingEvents;
|
|
15
15
|
/** Which events are accessible by our clients */
|
|
16
|
-
export declare const externalEvents: ("authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "embeddedWalletCreated" | "walletConnectedForFunding")[];
|
|
16
|
+
export declare const externalEvents: ("authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "embeddedWalletCreated" | "walletConnectedForFunding")[];
|
|
17
17
|
export declare const dynamicEvents: EventEmitter<DynamicEvents, any>;
|
|
18
|
-
export declare const publicDynamicEvents: EventEmitter<"authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "embeddedWalletCreated" | "walletConnectedForFunding", any>;
|
|
18
|
+
export declare const publicDynamicEvents: EventEmitter<"authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "embeddedWalletCreated" | "walletConnectedForFunding", any>;
|
|
19
19
|
export type DynamicEventEmitter = typeof dynamicEvents;
|
|
@@ -35,4 +35,6 @@ export type WalletEvents = {
|
|
|
35
35
|
userWalletsChanged: (params: UserWalletsChangedParams) => void;
|
|
36
36
|
/** Triggered when user wallets changes from an empty array to a non-empty array */
|
|
37
37
|
userWalletsPopulated: (userWallets: Wallet[]) => void;
|
|
38
|
+
/** Triggered when Dynamic fails to connect to a wallet */
|
|
39
|
+
walletConnectionFailed: (walletConnector: WalletConnector, error: unknown) => void;
|
|
38
40
|
};
|
|
@@ -131,7 +131,7 @@ const shouldNotRenderBottomNavBarOptions = [
|
|
|
131
131
|
'confirm-exchange-transfer',
|
|
132
132
|
'choose-onramp-provider',
|
|
133
133
|
'choose-linked-wallet',
|
|
134
|
-
'manage-mfa-no-footer',
|
|
134
|
+
'manage-totp-mfa-no-footer',
|
|
135
135
|
];
|
|
136
136
|
const DynamicUserProfileLayout = ({ variant, className, style, }) => {
|
|
137
137
|
const { multiWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -127,7 +127,7 @@ const shouldNotRenderBottomNavBarOptions = [
|
|
|
127
127
|
'confirm-exchange-transfer',
|
|
128
128
|
'choose-onramp-provider',
|
|
129
129
|
'choose-linked-wallet',
|
|
130
|
-
'manage-mfa-no-footer',
|
|
130
|
+
'manage-totp-mfa-no-footer',
|
|
131
131
|
];
|
|
132
132
|
const DynamicUserProfileLayout = ({ variant, className, style, }) => {
|
|
133
133
|
const { multiWallet } = useInternalDynamicContext();
|
|
@@ -543,6 +543,8 @@ const translation = {
|
|
|
543
543
|
mfa_failed: 'Incorrect security code. Please double-check your MFA code and try again.',
|
|
544
544
|
invalid_currency_description: 'Please choose a supported currency and try again.',
|
|
545
545
|
invalid_balance: 'This transfer, including fees, exceeds your available balance. Transfer a smaller amount.',
|
|
546
|
+
amount_too_small: 'The amount you’re trying to transfer is below the minimum allowed by the selected exchange. Please enter a larger amount and try again.',
|
|
547
|
+
address_not_whitelisted: 'The destination address is not whitelisted on this exchange. Please add it to your whitelist before retrying the transfer.',
|
|
546
548
|
unknown: 'An unknown error occurred.',
|
|
547
549
|
},
|
|
548
550
|
/**
|
|
@@ -1010,6 +1012,15 @@ const translation = {
|
|
|
1010
1012
|
mfa_button: 'Authenticator App',
|
|
1011
1013
|
title: '2 factor authentication',
|
|
1012
1014
|
},
|
|
1015
|
+
mfa_section: {
|
|
1016
|
+
title: 'MFA',
|
|
1017
|
+
passkey_button: 'Passkeys',
|
|
1018
|
+
totp_button: 'TOTP',
|
|
1019
|
+
},
|
|
1020
|
+
wallet_security_section: {
|
|
1021
|
+
title: 'Wallet Security',
|
|
1022
|
+
passkey_button: 'Passkeys',
|
|
1023
|
+
},
|
|
1013
1024
|
title: 'Settings',
|
|
1014
1025
|
button_logout: 'Log out',
|
|
1015
1026
|
empty_screen: {
|
|
@@ -1057,6 +1068,15 @@ const translation = {
|
|
|
1057
1068
|
mfa_button: 'Authenticator App',
|
|
1058
1069
|
title: '2 factor authentication',
|
|
1059
1070
|
},
|
|
1071
|
+
mfa_section: {
|
|
1072
|
+
title: 'MFA',
|
|
1073
|
+
passkey_button: 'Passkeys',
|
|
1074
|
+
totp_button: 'TOTP',
|
|
1075
|
+
},
|
|
1076
|
+
wallet_security_section: {
|
|
1077
|
+
title: 'Wallet Security',
|
|
1078
|
+
passkey_button: 'Passkeys',
|
|
1079
|
+
},
|
|
1060
1080
|
title: 'Settings',
|
|
1061
1081
|
button_logout: 'Log out',
|
|
1062
1082
|
account_security: {
|
|
@@ -2766,6 +2786,16 @@ const translation = {
|
|
|
2766
2786
|
connection_proposal_expired: 'Connection proposal expired. Please try again.',
|
|
2767
2787
|
sei_not_enabled_in_keplr_wallet: 'Sei network is not enabled in Keplr. Please enable it and try again.',
|
|
2768
2788
|
},
|
|
2789
|
+
/**
|
|
2790
|
+
* @description copy keys for search component
|
|
2791
|
+
* @default
|
|
2792
|
+
* {
|
|
2793
|
+
clear: 'Clear',
|
|
2794
|
+
}
|
|
2795
|
+
*/
|
|
2796
|
+
dyn_search: {
|
|
2797
|
+
clear: 'Clear',
|
|
2798
|
+
},
|
|
2769
2799
|
};
|
|
2770
2800
|
|
|
2771
2801
|
exports.translation = translation;
|
|
@@ -537,6 +537,8 @@ export declare const translation: {
|
|
|
537
537
|
mfa_failed: string;
|
|
538
538
|
invalid_currency_description: string;
|
|
539
539
|
invalid_balance: string;
|
|
540
|
+
amount_too_small: string;
|
|
541
|
+
address_not_whitelisted: string;
|
|
540
542
|
unknown: string;
|
|
541
543
|
};
|
|
542
544
|
/**
|
|
@@ -1004,6 +1006,15 @@ export declare const translation: {
|
|
|
1004
1006
|
mfa_button: 'Authenticator App',
|
|
1005
1007
|
title: '2 factor authentication',
|
|
1006
1008
|
},
|
|
1009
|
+
mfa_section: {
|
|
1010
|
+
title: 'MFA',
|
|
1011
|
+
passkey_button: 'Passkeys',
|
|
1012
|
+
totp_button: 'TOTP',
|
|
1013
|
+
},
|
|
1014
|
+
wallet_security_section: {
|
|
1015
|
+
title: 'Wallet Security',
|
|
1016
|
+
passkey_button: 'Passkeys',
|
|
1017
|
+
},
|
|
1007
1018
|
title: 'Settings',
|
|
1008
1019
|
button_logout: 'Log out',
|
|
1009
1020
|
empty_screen: {
|
|
@@ -1053,6 +1064,15 @@ export declare const translation: {
|
|
|
1053
1064
|
mfa_button: string;
|
|
1054
1065
|
title: string;
|
|
1055
1066
|
};
|
|
1067
|
+
mfa_section: {
|
|
1068
|
+
title: string;
|
|
1069
|
+
passkey_button: string;
|
|
1070
|
+
totp_button: string;
|
|
1071
|
+
};
|
|
1072
|
+
wallet_security_section: {
|
|
1073
|
+
title: string;
|
|
1074
|
+
passkey_button: string;
|
|
1075
|
+
};
|
|
1056
1076
|
title: string;
|
|
1057
1077
|
button_logout: string;
|
|
1058
1078
|
account_security: {
|
|
@@ -2762,4 +2782,14 @@ export declare const translation: {
|
|
|
2762
2782
|
connection_proposal_expired: string;
|
|
2763
2783
|
sei_not_enabled_in_keplr_wallet: string;
|
|
2764
2784
|
};
|
|
2785
|
+
/**
|
|
2786
|
+
* @description copy keys for search component
|
|
2787
|
+
* @default
|
|
2788
|
+
* {
|
|
2789
|
+
clear: 'Clear',
|
|
2790
|
+
}
|
|
2791
|
+
*/
|
|
2792
|
+
dyn_search: {
|
|
2793
|
+
clear: string;
|
|
2794
|
+
};
|
|
2765
2795
|
};
|