@dynamic-labs/sdk-react-core 4.91.3 → 4.91.4
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 +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/client/client.cjs +1 -1
- package/src/lib/client/client.js +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +4 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +4 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +3 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +3 -0
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +1 -1
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +13 -1
- package/src/lib/context/OnrampContext/OnrampContext.cjs +1 -1
- package/src/lib/context/OnrampContext/OnrampContext.js +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.errors.cjs +2 -2
- package/src/lib/context/SendBalanceContext/SendBalanceContext.errors.js +2 -2
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +3 -3
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +3 -3
- package/src/lib/data/api/email/email.cjs +6 -3
- package/src/lib/data/api/email/email.js +6 -3
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +5 -5
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +5 -5
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.cjs +3 -3
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.js +3 -3
- package/src/lib/data/api/oauth/oauth.cjs +3 -2
- package/src/lib/data/api/oauth/oauth.js +3 -2
- package/src/lib/data/api/session/session.cjs +3 -3
- package/src/lib/data/api/session/session.js +3 -3
- package/src/lib/data/api/sms/sms.cjs +4 -1
- package/src/lib/data/api/sms/sms.js +4 -1
- package/src/lib/data/api/user/user.cjs +4 -4
- package/src/lib/data/api/user/user.js +4 -4
- package/src/lib/data/api/wallets/wallets.cjs +15 -13
- package/src/lib/data/api/wallets/wallets.js +15 -13
- package/src/lib/store/state/nonce/nonce.cjs +1 -1
- package/src/lib/store/state/nonce/nonce.js +1 -1
- package/src/lib/utils/functions/generateMessages/index.cjs +3 -3
- package/src/lib/utils/functions/generateMessages/index.js +3 -3
- package/src/lib/utils/functions/getEmbeddedWalletAuthHandler/getEmbeddedWalletAuthHandler.cjs +1 -1
- package/src/lib/utils/functions/getEmbeddedWalletAuthHandler/getEmbeddedWalletAuthHandler.js +1 -1
- package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.cjs +30 -0
- package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.d.ts +17 -0
- package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.js +29 -1
- package/src/lib/utils/functions/getTransactionLink/getTransactionLink.cjs +13 -1
- package/src/lib/utils/functions/getTransactionLink/getTransactionLink.d.ts +2 -1
- package/src/lib/utils/functions/getTransactionLink/getTransactionLink.js +14 -2
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +2 -2
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +2 -2
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +2 -2
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +2 -2
- package/src/lib/utils/hooks/useConfirmationPortal/useConfirmationPortal.cjs +1 -1
- package/src/lib/utils/hooks/useConfirmationPortal/useConfirmationPortal.js +1 -1
- package/src/lib/utils/hooks/useConnectExchangeForFunding/useConnectExchangeForFunding.cjs +1 -1
- package/src/lib/utils/hooks/useConnectExchangeForFunding/useConnectExchangeForFunding.js +1 -1
- package/src/lib/utils/hooks/useConnectUnifiedForFunding/useConnectUnifiedForFunding.cjs +2 -2
- package/src/lib/utils/hooks/useConnectUnifiedForFunding/useConnectUnifiedForFunding.js +2 -2
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.cjs +1 -1
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.js +1 -1
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +1 -1
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +1 -1
- package/src/lib/utils/hooks/useCreateWalletConnectorOptions/utils/errors/ConnectorSetupError.cjs +1 -1
- package/src/lib/utils/hooks/useCreateWalletConnectorOptions/utils/errors/ConnectorSetupError.js +1 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +8 -8
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +8 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +4 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +9 -9
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +9 -9
- package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.cjs +2 -2
- package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.js +2 -2
- package/src/lib/utils/hooks/useFundingHelpers/useFundingHelpers.cjs +2 -2
- package/src/lib/utils/hooks/useFundingHelpers/useFundingHelpers.js +2 -2
- package/src/lib/utils/hooks/useGetMfaToken/useGetMfaToken.cjs +1 -1
- package/src/lib/utils/hooks/useGetMfaToken/useGetMfaToken.js +1 -1
- package/src/lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.cjs +2 -2
- package/src/lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.js +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +2 -2
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +2 -2
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +2 -2
- package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.cjs +3 -3
- package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.js +3 -3
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +1 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +1 -1
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +1 -1
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +1 -1
- package/src/lib/utils/hooks/useUserUpdateRequest/unlinkUserEmail/unlinkUserEmail.cjs +3 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/unlinkUserEmail/unlinkUserEmail.js +3 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +1 -1
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -2
- package/src/lib/utils/hooks/useViewSettings/useViewSettings.d.ts +5 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +1 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +1 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +2 -2
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +2 -2
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +2 -2
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +2 -2
- package/src/lib/views/ExportSharesView/ExportSharesView.cjs +2 -2
- package/src/lib/views/ExportSharesView/ExportSharesView.js +2 -2
- package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +1 -1
- package/src/lib/views/LoginView/useLoginView/useLoginView.js +1 -1
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +1 -1
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +1 -1
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +2 -2
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +1 -1
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs +3 -3
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.js +3 -3
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +14 -14
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +14 -14
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +2 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.js +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +1 -1
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +1 -1
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.cjs +1 -1
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/getPromptAmountParams/getPromptAmountParams.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/getPromptAmountParams/getPromptAmountParams.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/utils/useSubmitWalletFunding/useSubmitWalletFunding.cjs +10 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/utils/useSubmitWalletFunding/useSubmitWalletFunding.js +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.91.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.3...v4.91.4) (2026-07-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* conditionally use /op/ route for AA transactions based on block explorer support ([#11628](https://github.com/dynamic-labs/dynamic-auth/issues/11628)) ([95822dc](https://github.com/dynamic-labs/dynamic-auth/commit/95822dc0edbcd739afe870f0b3881555fdb17eb6))
|
|
8
|
+
* require error codes in all SDK error classes ([#11761](https://github.com/dynamic-labs/dynamic-auth/issues/11761)) ([5744811](https://github.com/dynamic-labs/dynamic-auth/commit/5744811efdd1e415aaf51eec5b3300b323ec1347))
|
|
9
|
+
|
|
2
10
|
### [4.91.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.2...v4.91.3) (2026-06-30)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.91.
|
|
3
|
+
"version": "4.91.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.1046",
|
|
6
6
|
"@dynamic-labs-sdk/client": "1.12.1",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"yup": "0.32.11",
|
|
18
18
|
"react-international-phone": "4.5.0",
|
|
19
19
|
"bs58": "5.0.0",
|
|
20
|
-
"@dynamic-labs/assert-package-version": "4.91.
|
|
21
|
-
"@dynamic-labs/iconic": "4.91.
|
|
22
|
-
"@dynamic-labs/locale": "4.91.
|
|
23
|
-
"@dynamic-labs/logger": "4.91.
|
|
24
|
-
"@dynamic-labs/multi-wallet": "4.91.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "4.91.
|
|
26
|
-
"@dynamic-labs/store": "4.91.
|
|
27
|
-
"@dynamic-labs/types": "4.91.
|
|
28
|
-
"@dynamic-labs/utils": "4.91.
|
|
29
|
-
"@dynamic-labs/wallet-book": "4.91.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "4.91.
|
|
20
|
+
"@dynamic-labs/assert-package-version": "4.91.4",
|
|
21
|
+
"@dynamic-labs/iconic": "4.91.4",
|
|
22
|
+
"@dynamic-labs/locale": "4.91.4",
|
|
23
|
+
"@dynamic-labs/logger": "4.91.4",
|
|
24
|
+
"@dynamic-labs/multi-wallet": "4.91.4",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "4.91.4",
|
|
26
|
+
"@dynamic-labs/store": "4.91.4",
|
|
27
|
+
"@dynamic-labs/types": "4.91.4",
|
|
28
|
+
"@dynamic-labs/utils": "4.91.4",
|
|
29
|
+
"@dynamic-labs/wallet-book": "4.91.4",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "4.91.4",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -35,7 +35,7 @@ const hasDynamicClient = () => getClientStore().client !== null;
|
|
|
35
35
|
const getDynamicClient = () => {
|
|
36
36
|
const { client } = getClientStore();
|
|
37
37
|
if (!client) {
|
|
38
|
-
throw new utils.DynamicError('Tried to getClient when it was still null');
|
|
38
|
+
throw new utils.DynamicError('Tried to getClient when it was still null', 'tried_to_getclient_when_it_was');
|
|
39
39
|
}
|
|
40
40
|
return client;
|
|
41
41
|
};
|
package/src/lib/client/client.js
CHANGED
|
@@ -27,7 +27,7 @@ const hasDynamicClient = () => getClientStore().client !== null;
|
|
|
27
27
|
const getDynamicClient = () => {
|
|
28
28
|
const { client } = getClientStore();
|
|
29
29
|
if (!client) {
|
|
30
|
-
throw new DynamicError('Tried to getClient when it was still null');
|
|
30
|
+
throw new DynamicError('Tried to getClient when it was still null', 'tried_to_getclient_when_it_was');
|
|
31
31
|
}
|
|
32
32
|
return client;
|
|
33
33
|
};
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs
CHANGED
|
@@ -118,6 +118,7 @@ var utils = require('./utils.cjs');
|
|
|
118
118
|
var TransactionCard = require('../TransactionCard/TransactionCard.cjs');
|
|
119
119
|
var SendBalanceTransactionCard = require('../TransactionCard/SendBalanceTransactionCard.cjs');
|
|
120
120
|
var getTransactionLink = require('../../utils/functions/getTransactionLink/getTransactionLink.cjs');
|
|
121
|
+
var useViewSettings = require('../../utils/hooks/useViewSettings/useViewSettings.cjs');
|
|
121
122
|
require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
122
123
|
require('../OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
123
124
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
@@ -136,14 +137,16 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
136
137
|
const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, error, fetchTransactionFee, alert, walletConnector, transaction, transactionSignature, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, isNativeToken, walletKey, simulationResult, sendBalanceTransaction, recipient, }) => {
|
|
137
138
|
var _a;
|
|
138
139
|
const { t } = reactI18next.useTranslation();
|
|
140
|
+
const txConfirmationSettings = useViewSettings.useViewSettings('transaction-confirmation');
|
|
139
141
|
const { data: transactionLink } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
140
142
|
return walletConnector && transactionSignature
|
|
141
143
|
? getTransactionLink.getTransactionLink({
|
|
142
144
|
transactionHash: transactionSignature,
|
|
145
|
+
userOpSupportedExplorers: txConfirmationSettings === null || txConfirmationSettings === void 0 ? void 0 : txConfirmationSettings.userOpSupportedExplorers,
|
|
143
146
|
walletConnector,
|
|
144
147
|
})
|
|
145
148
|
: undefined;
|
|
146
|
-
}), { deps: [walletConnector, transactionSignature] });
|
|
149
|
+
}), { deps: [walletConnector, transactionSignature, txConfirmationSettings] });
|
|
147
150
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
148
151
|
const { setShowAuthFlow, user, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
149
152
|
const { pushView } = ViewContext.useViewContext();
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js
CHANGED
|
@@ -114,6 +114,7 @@ import { useCurrencySymbol, useHandleRecovery, getValueRounded, useHandleSubmitW
|
|
|
114
114
|
import { TransactionCard } from '../TransactionCard/TransactionCard.js';
|
|
115
115
|
import { SendBalanceTransactionCard } from '../TransactionCard/SendBalanceTransactionCard.js';
|
|
116
116
|
import { getTransactionLink } from '../../utils/functions/getTransactionLink/getTransactionLink.js';
|
|
117
|
+
import { useViewSettings } from '../../utils/hooks/useViewSettings/useViewSettings.js';
|
|
117
118
|
import '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
118
119
|
import '../OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
119
120
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
@@ -132,14 +133,16 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
132
133
|
const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, error, fetchTransactionFee, alert, walletConnector, transaction, transactionSignature, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, isNativeToken, walletKey, simulationResult, sendBalanceTransaction, recipient, }) => {
|
|
133
134
|
var _a;
|
|
134
135
|
const { t } = useTranslation();
|
|
136
|
+
const txConfirmationSettings = useViewSettings('transaction-confirmation');
|
|
135
137
|
const { data: transactionLink } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
138
|
return walletConnector && transactionSignature
|
|
137
139
|
? getTransactionLink({
|
|
138
140
|
transactionHash: transactionSignature,
|
|
141
|
+
userOpSupportedExplorers: txConfirmationSettings === null || txConfirmationSettings === void 0 ? void 0 : txConfirmationSettings.userOpSupportedExplorers,
|
|
139
142
|
walletConnector,
|
|
140
143
|
})
|
|
141
144
|
: undefined;
|
|
142
|
-
}), { deps: [walletConnector, transactionSignature] });
|
|
145
|
+
}), { deps: [walletConnector, transactionSignature, txConfirmationSettings] });
|
|
143
146
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
144
147
|
const { setShowAuthFlow, user, primaryWallet } = useInternalDynamicContext();
|
|
145
148
|
const { pushView } = useViewContext();
|
|
@@ -94,6 +94,7 @@ require('../Input/Input.cjs');
|
|
|
94
94
|
require('../OverlayCard/OverlayCard.cjs');
|
|
95
95
|
var utils = require('../TransactionConfirmationPageLayout/utils.cjs');
|
|
96
96
|
var getTransactionLink = require('../../utils/functions/getTransactionLink/getTransactionLink.cjs');
|
|
97
|
+
var useViewSettings = require('../../utils/hooks/useViewSettings/useViewSettings.cjs');
|
|
97
98
|
require('../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
98
99
|
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
99
100
|
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -131,11 +132,13 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
131
132
|
const { t } = reactI18next.useTranslation();
|
|
132
133
|
const { showFiat, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
133
134
|
const { nativePrice } = sendBalances.useSendBalanceState();
|
|
135
|
+
const txConfirmationSettings = useViewSettings.useViewSettings('transaction-confirmation');
|
|
134
136
|
const { data: txLink } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
135
137
|
if (!(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) || !transactionHash)
|
|
136
138
|
return;
|
|
137
139
|
return getTransactionLink.getTransactionLink({
|
|
138
140
|
transactionHash,
|
|
141
|
+
userOpSupportedExplorers: txConfirmationSettings === null || txConfirmationSettings === void 0 ? void 0 : txConfirmationSettings.userOpSupportedExplorers,
|
|
139
142
|
walletConnector: primaryWallet.connector,
|
|
140
143
|
});
|
|
141
144
|
}));
|
|
@@ -90,6 +90,7 @@ import '../Input/Input.js';
|
|
|
90
90
|
import '../OverlayCard/OverlayCard.js';
|
|
91
91
|
import { getValueRounded } from '../TransactionConfirmationPageLayout/utils.js';
|
|
92
92
|
import { getTransactionLink } from '../../utils/functions/getTransactionLink/getTransactionLink.js';
|
|
93
|
+
import { useViewSettings } from '../../utils/hooks/useViewSettings/useViewSettings.js';
|
|
93
94
|
import '../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
94
95
|
import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
95
96
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -127,11 +128,13 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
127
128
|
const { t } = useTranslation();
|
|
128
129
|
const { showFiat, primaryWallet } = useInternalDynamicContext();
|
|
129
130
|
const { nativePrice } = useSendBalanceState();
|
|
131
|
+
const txConfirmationSettings = useViewSettings('transaction-confirmation');
|
|
130
132
|
const { data: txLink } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
131
133
|
if (!(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) || !transactionHash)
|
|
132
134
|
return;
|
|
133
135
|
return getTransactionLink({
|
|
134
136
|
transactionHash,
|
|
137
|
+
userOpSupportedExplorers: txConfirmationSettings === null || txConfirmationSettings === void 0 ? void 0 : txConfirmationSettings.userOpSupportedExplorers,
|
|
135
138
|
walletConnector: primaryWallet.connector,
|
|
136
139
|
});
|
|
137
140
|
}));
|
|
@@ -50,7 +50,7 @@ const useRemoveWallet = ({ secondaryWallets, handleLogOutWithReason, setPrimaryW
|
|
|
50
50
|
if (authMode$1 === 'connect-and-sign') {
|
|
51
51
|
const isLastVerifiedCredential = (user === null || user === void 0 ? void 0 : user.verifiedCredentials.length) === 1;
|
|
52
52
|
if (isLastVerifiedCredential) {
|
|
53
|
-
throw new utils.DynamicError('This is your only login method. Add another wallet or log in method before removing it.');
|
|
53
|
+
throw new utils.DynamicError('This is your only login method. Add another wallet or log in method before removing it.', 'last_verified_credential');
|
|
54
54
|
}
|
|
55
55
|
yield wallets.unlinkWallet({
|
|
56
56
|
environmentId: dynamicContextProps.getEnvironmentId(),
|
|
@@ -46,7 +46,7 @@ const useRemoveWallet = ({ secondaryWallets, handleLogOutWithReason, setPrimaryW
|
|
|
46
46
|
if (authMode === 'connect-and-sign') {
|
|
47
47
|
const isLastVerifiedCredential = (user === null || user === void 0 ? void 0 : user.verifiedCredentials.length) === 1;
|
|
48
48
|
if (isLastVerifiedCredential) {
|
|
49
|
-
throw new DynamicError('This is your only login method. Add another wallet or log in method before removing it.');
|
|
49
|
+
throw new DynamicError('This is your only login method. Add another wallet or log in method before removing it.', 'last_verified_credential');
|
|
50
50
|
}
|
|
51
51
|
yield unlinkWallet({
|
|
52
52
|
environmentId: getEnvironmentId(),
|
|
@@ -9,8 +9,20 @@ export type WalletListViewSettings = {
|
|
|
9
9
|
items: WalletListViewTabItem[];
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
+
export type TransactionConfirmationViewSettings = {
|
|
13
|
+
type: 'transaction-confirmation';
|
|
14
|
+
/**
|
|
15
|
+
* Additional block explorer domains that support the /op/{userOpHash} route
|
|
16
|
+
* for ERC-4337 UserOperation lookups.
|
|
17
|
+
* These are merged with the built-in list of supported explorers
|
|
18
|
+
* (e.g. etherscan.io, blockscout.com, etc.).
|
|
19
|
+
*
|
|
20
|
+
* Example: ['my-custom-explorer.com', 'my-l2-explorer.xyz']
|
|
21
|
+
*/
|
|
22
|
+
userOpSupportedExplorers?: string[];
|
|
23
|
+
};
|
|
12
24
|
export type NetworksOverrides = GenericNetwork[] | ((dashboardNetworks: GenericNetwork[]) => GenericNetwork[]);
|
|
13
|
-
export type ViewsOverrides = SdkView | WalletListViewSettings;
|
|
25
|
+
export type ViewsOverrides = SdkView | WalletListViewSettings | TransactionConfirmationViewSettings;
|
|
14
26
|
export type OnrampOption = {
|
|
15
27
|
/**
|
|
16
28
|
* The name of the onramp provider to be displayed in UI
|
|
@@ -39,7 +39,7 @@ const OnrampContextProvider = ({ children, }) => {
|
|
|
39
39
|
const setShowOnramp = React.useCallback((value) => {
|
|
40
40
|
_setShowOnramp(value);
|
|
41
41
|
if (!value && promiseRef.current) {
|
|
42
|
-
rejectPromiseRef.rejectPromiseRef(promiseRef, new utils.DynamicError('User cancelled'));
|
|
42
|
+
rejectPromiseRef.rejectPromiseRef(promiseRef, new utils.DynamicError('User cancelled', 'user_cancelled'));
|
|
43
43
|
}
|
|
44
44
|
}, []);
|
|
45
45
|
const setEnabledOnrampProvidersTargetValue = React.useCallback(({ address, token, network, tokenAmount, chainName, currency, }) => {
|
|
@@ -35,7 +35,7 @@ const OnrampContextProvider = ({ children, }) => {
|
|
|
35
35
|
const setShowOnramp = useCallback((value) => {
|
|
36
36
|
_setShowOnramp(value);
|
|
37
37
|
if (!value && promiseRef.current) {
|
|
38
|
-
rejectPromiseRef(promiseRef, new DynamicError('User cancelled'));
|
|
38
|
+
rejectPromiseRef(promiseRef, new DynamicError('User cancelled', 'user_cancelled'));
|
|
39
39
|
}
|
|
40
40
|
}, []);
|
|
41
41
|
const setEnabledOnrampProvidersTargetValue = useCallback(({ address, token, network, tokenAmount, chainName, currency, }) => {
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var utils = require('@dynamic-labs/utils');
|
|
7
7
|
|
|
8
|
-
const noWalletError = new utils.DynamicError('No wallet connected');
|
|
9
|
-
const invalidWalletTypeError = new utils.DynamicError('Primary wallet must use embedded wallet');
|
|
8
|
+
const noWalletError = new utils.DynamicError('No wallet connected', 'no_wallet_connected');
|
|
9
|
+
const invalidWalletTypeError = new utils.DynamicError('Primary wallet must use embedded wallet', 'invalid_wallet_type');
|
|
10
10
|
|
|
11
11
|
exports.invalidWalletTypeError = invalidWalletTypeError;
|
|
12
12
|
exports.noWalletError = noWalletError;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
3
|
|
|
4
|
-
const noWalletError = new DynamicError('No wallet connected');
|
|
5
|
-
const invalidWalletTypeError = new DynamicError('Primary wallet must use embedded wallet');
|
|
4
|
+
const noWalletError = new DynamicError('No wallet connected', 'no_wallet_connected');
|
|
5
|
+
const invalidWalletTypeError = new DynamicError('Primary wallet must use embedded wallet', 'invalid_wallet_type');
|
|
6
6
|
|
|
7
7
|
export { invalidWalletTypeError, noWalletError };
|
|
@@ -172,14 +172,14 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
172
172
|
// Update UI to reflect the original state
|
|
173
173
|
if (socialStorageItem.mode === 'signin') {
|
|
174
174
|
if (client.getDynamicClient().user) {
|
|
175
|
-
logger.logger.error(new utils.DynamicError('User is already logged in'));
|
|
175
|
+
logger.logger.error(new utils.DynamicError('User is already logged in', 'user_is_already_logged_in'));
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
updateInterfaceStateForSignIn(socialStorageItem);
|
|
179
179
|
}
|
|
180
180
|
else if (socialStorageItem.mode === 'link') {
|
|
181
181
|
if (!client.getDynamicClient().user) {
|
|
182
|
-
logger.logger.error(new utils.DynamicError('User not logged in'));
|
|
182
|
+
logger.logger.error(new utils.DynamicError('User not logged in', 'user_not_logged_in'));
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
// Link was called from the widget, so show the profile on redirect
|
|
@@ -190,7 +190,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
190
190
|
}
|
|
191
191
|
else if (socialStorageItem.mode === 'stepup') {
|
|
192
192
|
if (!client.getDynamicClient().user) {
|
|
193
|
-
logger.logger.error(new utils.DynamicError('User not logged in'));
|
|
193
|
+
logger.logger.error(new utils.DynamicError('User not logged in', 'user_not_logged_in'));
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -168,14 +168,14 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
168
168
|
// Update UI to reflect the original state
|
|
169
169
|
if (socialStorageItem.mode === 'signin') {
|
|
170
170
|
if (getDynamicClient().user) {
|
|
171
|
-
logger.error(new DynamicError('User is already logged in'));
|
|
171
|
+
logger.error(new DynamicError('User is already logged in', 'user_is_already_logged_in'));
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
updateInterfaceStateForSignIn(socialStorageItem);
|
|
175
175
|
}
|
|
176
176
|
else if (socialStorageItem.mode === 'link') {
|
|
177
177
|
if (!getDynamicClient().user) {
|
|
178
|
-
logger.error(new DynamicError('User not logged in'));
|
|
178
|
+
logger.error(new DynamicError('User not logged in', 'user_not_logged_in'));
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
// Link was called from the widget, so show the profile on redirect
|
|
@@ -186,7 +186,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
186
186
|
}
|
|
187
187
|
else if (socialStorageItem.mode === 'stepup') {
|
|
188
188
|
if (!getDynamicClient().user) {
|
|
189
|
-
logger.error(new DynamicError('User not logged in'));
|
|
189
|
+
logger.error(new DynamicError('User not logged in', 'user_not_logged_in'));
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -43,13 +43,16 @@ const signInWithEmailVerification = (_b) => _tslib.__awaiter(void 0, [_b], void
|
|
|
43
43
|
catch (e) {
|
|
44
44
|
const data = yield utils.logResponseError(e, 'Error email signin');
|
|
45
45
|
if (data.error.code === 'missing_from_list') {
|
|
46
|
-
throw new utils$1.NoAccessError({
|
|
46
|
+
throw new utils$1.NoAccessError({
|
|
47
|
+
code: data.error.code,
|
|
48
|
+
email: data.payload.email,
|
|
49
|
+
});
|
|
47
50
|
}
|
|
48
51
|
if (data.code === 'credential_not_enabled_for_sign_in') {
|
|
49
52
|
throw new utils$1.DynamicError(data.error, utils$1.ErrorCode.CREDENTIAL_NOT_ENABLED_FOR_SIGN_IN);
|
|
50
53
|
}
|
|
51
54
|
if (data.code === 'email_associated_with_different_provider') {
|
|
52
|
-
throw new utils$1.AccountExistsError(data.error, data.payload);
|
|
55
|
+
throw new utils$1.AccountExistsError(data.error, data.payload, data.code);
|
|
53
56
|
}
|
|
54
57
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
55
58
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -94,7 +97,7 @@ const verifyEmail = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({
|
|
|
94
97
|
catch (e) {
|
|
95
98
|
const data = yield utils.logResponseError(e, 'Error linking email');
|
|
96
99
|
if (data.code === sdkApiCore.UnprocessableEntityErrorCode.UserHasAlreadyAccountWithEmail) {
|
|
97
|
-
throw new utils$1.UserHasAccountWithEmailError(data.error);
|
|
100
|
+
throw new utils$1.UserHasAccountWithEmailError(data.error, data.code);
|
|
98
101
|
}
|
|
99
102
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
100
103
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -39,13 +39,16 @@ const signInWithEmailVerification = (_b) => __awaiter(void 0, [_b], void 0, func
|
|
|
39
39
|
catch (e) {
|
|
40
40
|
const data = yield logResponseError(e, 'Error email signin');
|
|
41
41
|
if (data.error.code === 'missing_from_list') {
|
|
42
|
-
throw new NoAccessError({
|
|
42
|
+
throw new NoAccessError({
|
|
43
|
+
code: data.error.code,
|
|
44
|
+
email: data.payload.email,
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
47
|
if (data.code === 'credential_not_enabled_for_sign_in') {
|
|
45
48
|
throw new DynamicError(data.error, ErrorCode.CREDENTIAL_NOT_ENABLED_FOR_SIGN_IN);
|
|
46
49
|
}
|
|
47
50
|
if (data.code === 'email_associated_with_different_provider') {
|
|
48
|
-
throw new AccountExistsError(data.error, data.payload);
|
|
51
|
+
throw new AccountExistsError(data.error, data.payload, data.code);
|
|
49
52
|
}
|
|
50
53
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
51
54
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -90,7 +93,7 @@ const verifyEmail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ verific
|
|
|
90
93
|
catch (e) {
|
|
91
94
|
const data = yield logResponseError(e, 'Error linking email');
|
|
92
95
|
if (data.code === UnprocessableEntityErrorCode.UserHasAlreadyAccountWithEmail) {
|
|
93
|
-
throw new UserHasAccountWithEmailError(data.error);
|
|
96
|
+
throw new UserHasAccountWithEmailError(data.error, data.code);
|
|
94
97
|
}
|
|
95
98
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
96
99
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -110,7 +110,7 @@ const updatePasskeyRecoveryEmail = (_d) => _tslib.__awaiter(void 0, [_d], void 0
|
|
|
110
110
|
}
|
|
111
111
|
catch (e) {
|
|
112
112
|
yield logResponse(e, 'Error while trying to update recovery email');
|
|
113
|
-
throw new utils$1.DynamicError('Error updating recovery email');
|
|
113
|
+
throw new utils$1.DynamicError('Error updating recovery email', 'updating_recovery_email');
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
const getUserPasskeys = (_e) => _tslib.__awaiter(void 0, [_e], void 0, function* ({ environmentId, }) {
|
|
@@ -217,7 +217,7 @@ const getCreateEmbeddedWalletAccountRequest = (_j) => _tslib.__awaiter(void 0, [
|
|
|
217
217
|
}
|
|
218
218
|
catch (e) {
|
|
219
219
|
yield logResponse(e, 'Error fetching create embedded wallet account request', { chain });
|
|
220
|
-
throw new utils$1.DynamicError('Error fetching create embedded wallet account request');
|
|
220
|
+
throw new utils$1.DynamicError('Error fetching create embedded wallet account request', 'create_embedded_wallet_account_request_error');
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
const createEmbeddedWalletAccount = (_k) => _tslib.__awaiter(void 0, [_k], void 0, function* ({ environmentId, createEmbeddedWalletAccountRequest, }) {
|
|
@@ -234,7 +234,7 @@ const createEmbeddedWalletAccount = (_k) => _tslib.__awaiter(void 0, [_k], void
|
|
|
234
234
|
yield logResponse(e, '[createEmbeddedWalletAccount] Error creating embedded wallet account', {
|
|
235
235
|
createEmbeddedWalletAccountRequest,
|
|
236
236
|
});
|
|
237
|
-
throw new utils$1.DynamicError('[createEmbeddedWalletAccount] Error creating embedded wallet account');
|
|
237
|
+
throw new utils$1.DynamicError('[createEmbeddedWalletAccount] Error creating embedded wallet account', 'create_embedded_wallet_account_error');
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
240
|
const getDeleteEmbeddedWalletsRequest = (_l) => _tslib.__awaiter(void 0, [_l], void 0, function* ({ environmentId, walletId, }) {
|
|
@@ -247,7 +247,7 @@ const getDeleteEmbeddedWalletsRequest = (_l) => _tslib.__awaiter(void 0, [_l], v
|
|
|
247
247
|
}
|
|
248
248
|
catch (e) {
|
|
249
249
|
yield logResponse(e, 'Error fetching delete embedded wallet request');
|
|
250
|
-
throw new utils$1.DynamicError('Error fetching delete embedded wallets request');
|
|
250
|
+
throw new utils$1.DynamicError('Error fetching delete embedded wallets request', 'fetching_delete_embedded_wallets_request');
|
|
251
251
|
}
|
|
252
252
|
});
|
|
253
253
|
const deleteEmbeddedWallets = (_m) => _tslib.__awaiter(void 0, [_m], void 0, function* ({ environmentId, deleteEmbeddedWalletsRequest, }) {
|
|
@@ -264,7 +264,7 @@ const deleteEmbeddedWallets = (_m) => _tslib.__awaiter(void 0, [_m], void 0, fun
|
|
|
264
264
|
yield logResponse(e, 'Error deleting embedded wallets', {
|
|
265
265
|
deleteEmbeddedWalletsRequest,
|
|
266
266
|
});
|
|
267
|
-
throw new utils$1.DynamicError('Error deleting embedded wallets');
|
|
267
|
+
throw new utils$1.DynamicError('Error deleting embedded wallets', 'deleting_embedded_wallets');
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
270
|
const logResponse = (error, message, data) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -106,7 +106,7 @@ const updatePasskeyRecoveryEmail = (_d) => __awaiter(void 0, [_d], void 0, funct
|
|
|
106
106
|
}
|
|
107
107
|
catch (e) {
|
|
108
108
|
yield logResponse(e, 'Error while trying to update recovery email');
|
|
109
|
-
throw new DynamicError('Error updating recovery email');
|
|
109
|
+
throw new DynamicError('Error updating recovery email', 'updating_recovery_email');
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
const getUserPasskeys = (_e) => __awaiter(void 0, [_e], void 0, function* ({ environmentId, }) {
|
|
@@ -213,7 +213,7 @@ const getCreateEmbeddedWalletAccountRequest = (_j) => __awaiter(void 0, [_j], vo
|
|
|
213
213
|
}
|
|
214
214
|
catch (e) {
|
|
215
215
|
yield logResponse(e, 'Error fetching create embedded wallet account request', { chain });
|
|
216
|
-
throw new DynamicError('Error fetching create embedded wallet account request');
|
|
216
|
+
throw new DynamicError('Error fetching create embedded wallet account request', 'create_embedded_wallet_account_request_error');
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
const createEmbeddedWalletAccount = (_k) => __awaiter(void 0, [_k], void 0, function* ({ environmentId, createEmbeddedWalletAccountRequest, }) {
|
|
@@ -230,7 +230,7 @@ const createEmbeddedWalletAccount = (_k) => __awaiter(void 0, [_k], void 0, func
|
|
|
230
230
|
yield logResponse(e, '[createEmbeddedWalletAccount] Error creating embedded wallet account', {
|
|
231
231
|
createEmbeddedWalletAccountRequest,
|
|
232
232
|
});
|
|
233
|
-
throw new DynamicError('[createEmbeddedWalletAccount] Error creating embedded wallet account');
|
|
233
|
+
throw new DynamicError('[createEmbeddedWalletAccount] Error creating embedded wallet account', 'create_embedded_wallet_account_error');
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
const getDeleteEmbeddedWalletsRequest = (_l) => __awaiter(void 0, [_l], void 0, function* ({ environmentId, walletId, }) {
|
|
@@ -243,7 +243,7 @@ const getDeleteEmbeddedWalletsRequest = (_l) => __awaiter(void 0, [_l], void 0,
|
|
|
243
243
|
}
|
|
244
244
|
catch (e) {
|
|
245
245
|
yield logResponse(e, 'Error fetching delete embedded wallet request');
|
|
246
|
-
throw new DynamicError('Error fetching delete embedded wallets request');
|
|
246
|
+
throw new DynamicError('Error fetching delete embedded wallets request', 'fetching_delete_embedded_wallets_request');
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
249
|
const deleteEmbeddedWallets = (_m) => __awaiter(void 0, [_m], void 0, function* ({ environmentId, deleteEmbeddedWalletsRequest, }) {
|
|
@@ -260,7 +260,7 @@ const deleteEmbeddedWallets = (_m) => __awaiter(void 0, [_m], void 0, function*
|
|
|
260
260
|
yield logResponse(e, 'Error deleting embedded wallets', {
|
|
261
261
|
deleteEmbeddedWalletsRequest,
|
|
262
262
|
});
|
|
263
|
-
throw new DynamicError('Error deleting embedded wallets');
|
|
263
|
+
throw new DynamicError('Error deleting embedded wallets', 'deleting_embedded_wallets');
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
const logResponse = (error, message, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -27,7 +27,7 @@ const getUserExchangeAccounts = (_a) => _tslib.__awaiter(void 0, [_a], void 0, f
|
|
|
27
27
|
}
|
|
28
28
|
catch (e) {
|
|
29
29
|
const data = yield utils.logResponseError(e, 'Error retrieving accounts');
|
|
30
|
-
throw new utils$1.DynamicError(data.error);
|
|
30
|
+
throw new utils$1.DynamicError(data.error, data.code);
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
/**
|
|
@@ -100,7 +100,7 @@ const getExchangeAccountTransactions = (_c) => _tslib.__awaiter(void 0, [_c], vo
|
|
|
100
100
|
}
|
|
101
101
|
catch (e) {
|
|
102
102
|
const data = yield utils.logResponseError(e, 'Error retrieving transactions');
|
|
103
|
-
throw new utils$1.DynamicError(data.error);
|
|
103
|
+
throw new utils$1.DynamicError(data.error, data.code);
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
/**
|
|
@@ -128,7 +128,7 @@ const getExchangeTransferDestinations = (_d) => _tslib.__awaiter(void 0, [_d], v
|
|
|
128
128
|
}
|
|
129
129
|
catch (e) {
|
|
130
130
|
const data = yield utils.logResponseError(e, 'Error retrieving transfer destinations');
|
|
131
|
-
throw new utils$1.DynamicError(data.error);
|
|
131
|
+
throw new utils$1.DynamicError(data.error, data.code);
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
|
|
@@ -23,7 +23,7 @@ const getUserExchangeAccounts = (_a) => __awaiter(void 0, [_a], void 0, function
|
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
25
25
|
const data = yield logResponseError(e, 'Error retrieving accounts');
|
|
26
|
-
throw new DynamicError(data.error);
|
|
26
|
+
throw new DynamicError(data.error, data.code);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
/**
|
|
@@ -96,7 +96,7 @@ const getExchangeAccountTransactions = (_c) => __awaiter(void 0, [_c], void 0, f
|
|
|
96
96
|
}
|
|
97
97
|
catch (e) {
|
|
98
98
|
const data = yield logResponseError(e, 'Error retrieving transactions');
|
|
99
|
-
throw new DynamicError(data.error);
|
|
99
|
+
throw new DynamicError(data.error, data.code);
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
/**
|
|
@@ -124,7 +124,7 @@ const getExchangeTransferDestinations = (_d) => __awaiter(void 0, [_d], void 0,
|
|
|
124
124
|
}
|
|
125
125
|
catch (e) {
|
|
126
126
|
const data = yield logResponseError(e, 'Error retrieving transfer destinations');
|
|
127
|
-
throw new DynamicError(data.error);
|
|
127
|
+
throw new DynamicError(data.error, data.code);
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
|
|
@@ -216,7 +216,7 @@ const handleVerifyError = (e) => _tslib.__awaiter(void 0, void 0, void 0, functi
|
|
|
216
216
|
throw new utils$1.DynamicError(data.error, utils$1.ErrorCode.CREDENTIAL_NOT_ENABLED_FOR_SIGN_IN);
|
|
217
217
|
}
|
|
218
218
|
if (data.code === 'social_account_already_exists') {
|
|
219
|
-
throw new utils$1.SocialAccountAlreadyExistsError();
|
|
219
|
+
throw new utils$1.SocialAccountAlreadyExistsError(data.error, data.code);
|
|
220
220
|
}
|
|
221
221
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
222
222
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -234,13 +234,14 @@ const handleSignInError = (e) => _tslib.__awaiter(void 0, void 0, void 0, functi
|
|
|
234
234
|
}
|
|
235
235
|
if (data.error.code === 'missing_from_list') {
|
|
236
236
|
throw new utils$1.NoAccessError({
|
|
237
|
+
code: data.error.code,
|
|
237
238
|
socialProvider: (_f = data === null || data === void 0 ? void 0 : data.payload) === null || _f === void 0 ? void 0 : _f.socialProvider,
|
|
238
239
|
socialUsername: (_g = data === null || data === void 0 ? void 0 : data.payload) === null || _g === void 0 ? void 0 : _g.socialUsername,
|
|
239
240
|
walletPublicKey: (_h = data === null || data === void 0 ? void 0 : data.payload) === null || _h === void 0 ? void 0 : _h.walletPublicKey,
|
|
240
241
|
});
|
|
241
242
|
}
|
|
242
243
|
if (data.code === 'email_associated_with_different_provider') {
|
|
243
|
-
throw new utils$1.AccountExistsError(data.error, data.payload);
|
|
244
|
+
throw new utils$1.AccountExistsError(data.error, data.payload, data.code);
|
|
244
245
|
}
|
|
245
246
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
246
247
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -212,7 +212,7 @@ const handleVerifyError = (e) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
212
212
|
throw new DynamicError(data.error, ErrorCode.CREDENTIAL_NOT_ENABLED_FOR_SIGN_IN);
|
|
213
213
|
}
|
|
214
214
|
if (data.code === 'social_account_already_exists') {
|
|
215
|
-
throw new SocialAccountAlreadyExistsError();
|
|
215
|
+
throw new SocialAccountAlreadyExistsError(data.error, data.code);
|
|
216
216
|
}
|
|
217
217
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
218
218
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -230,13 +230,14 @@ const handleSignInError = (e) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
230
230
|
}
|
|
231
231
|
if (data.error.code === 'missing_from_list') {
|
|
232
232
|
throw new NoAccessError({
|
|
233
|
+
code: data.error.code,
|
|
233
234
|
socialProvider: (_f = data === null || data === void 0 ? void 0 : data.payload) === null || _f === void 0 ? void 0 : _f.socialProvider,
|
|
234
235
|
socialUsername: (_g = data === null || data === void 0 ? void 0 : data.payload) === null || _g === void 0 ? void 0 : _g.socialUsername,
|
|
235
236
|
walletPublicKey: (_h = data === null || data === void 0 ? void 0 : data.payload) === null || _h === void 0 ? void 0 : _h.walletPublicKey,
|
|
236
237
|
});
|
|
237
238
|
}
|
|
238
239
|
if (data.code === 'email_associated_with_different_provider') {
|
|
239
|
-
throw new AccountExistsError(data.error, data.payload);
|
|
240
|
+
throw new AccountExistsError(data.error, data.payload, data.code);
|
|
240
241
|
}
|
|
241
242
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
242
243
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
@@ -12,21 +12,21 @@ var utils = require('../utils.cjs');
|
|
|
12
12
|
const mapChainToChainEnum = (chain) => {
|
|
13
13
|
const foundChain = Object.values(sdkApiCore.ChainEnum).find((value) => value === chain);
|
|
14
14
|
if (!foundChain) {
|
|
15
|
-
throw new utils$1.DynamicError(`Invalid chain ${chain}
|
|
15
|
+
throw new utils$1.DynamicError(`Invalid chain ${chain}`, 'invalid_chain');
|
|
16
16
|
}
|
|
17
17
|
return foundChain;
|
|
18
18
|
};
|
|
19
19
|
const mapProviderToProviderEnum = (provider) => {
|
|
20
20
|
const foundProvider = Object.values(sdkApiCore.WalletProviderEnum).find((value) => value === provider);
|
|
21
21
|
if (!foundProvider) {
|
|
22
|
-
throw new utils$1.DynamicError(`Invalid provider ${provider}
|
|
22
|
+
throw new utils$1.DynamicError(`Invalid provider ${provider}`, 'invalid_provider');
|
|
23
23
|
}
|
|
24
24
|
return foundProvider;
|
|
25
25
|
};
|
|
26
26
|
const mapAuthModeToEnum = (authMode) => {
|
|
27
27
|
const found = Object.values(sdkApiCore.AuthModeEnum).find((value) => value === authMode);
|
|
28
28
|
if (!found) {
|
|
29
|
-
throw new utils$1.DynamicError(`Invalid authMode ${authMode}
|
|
29
|
+
throw new utils$1.DynamicError(`Invalid authMode ${authMode}`, 'invalid_auth_mode');
|
|
30
30
|
}
|
|
31
31
|
return found;
|
|
32
32
|
};
|