@dynamic-labs/sdk-react-core 4.52.2 → 4.52.5
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 +28 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/index.cjs +10 -4
- package/src/index.d.ts +2 -1
- package/src/index.js +4 -2
- package/src/lib/utils/functions/createCryptoDotComPayment/createCryptoDotComPayment.cjs +13 -0
- package/src/lib/utils/functions/createCryptoDotComPayment/createCryptoDotComPayment.d.ts +6 -0
- package/src/lib/utils/functions/createCryptoDotComPayment/createCryptoDotComPayment.js +9 -0
- package/src/lib/utils/functions/createCryptoDotComPayment/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.cjs +26 -7
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.js +26 -7
- package/src/lib/utils/hooks/useRegisterPasskey/useRegisterPasskey.cjs +25 -7
- package/src/lib/utils/hooks/useRegisterPasskey/useRegisterPasskey.js +25 -7
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +11 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.52.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.4...v4.52.5) (2026-01-08)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add generate ton connect proof method to demo v2 ([#9989](https://github.com/dynamic-labs/dynamic-auth/issues/9989)) ([9727e2e](https://github.com/dynamic-labs/dynamic-auth/commit/9727e2e25742c4a2b0345c8c4a83159cc88892d7))
|
|
8
|
+
* add waas ton to demo v2 ([#9988](https://github.com/dynamic-labs/dynamic-auth/issues/9988)) ([8edda43](https://github.com/dynamic-labs/dynamic-auth/commit/8edda43aeb58b5a77aef197d6cf20c1b633d1610))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* trigger onAuthSuccess callback for passkey MFA flows ([#10174](https://github.com/dynamic-labs/dynamic-auth/issues/10174)) ([a37753a](https://github.com/dynamic-labs/dynamic-auth/commit/a37753afd6f3b814198d2acf6dc267feb11021e2))
|
|
14
|
+
* **wallet-book:** add mobile app IDs for Binance Wallet to fix mobile filtering ([#10176](https://github.com/dynamic-labs/dynamic-auth/issues/10176)) ([010a48f](https://github.com/dynamic-labs/dynamic-auth/commit/010a48fd28a49861a26b9188babe4a174cefeedb))
|
|
15
|
+
|
|
16
|
+
### [4.52.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.3...v4.52.4) (2026-01-07)
|
|
17
|
+
|
|
18
|
+
### [4.52.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.2...v4.52.3) (2026-01-06)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* create waas-bitcoin package ([#10037](https://github.com/dynamic-labs/dynamic-auth/issues/10037)) ([788fb5d](https://github.com/dynamic-labs/dynamic-auth/commit/788fb5d1f4cc1d5f7285f73c384d680215eb2701))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* add export for useWalletBackup ([#10166](https://github.com/dynamic-labs/dynamic-auth/issues/10166)) ([162f180](https://github.com/dynamic-labs/dynamic-auth/commit/162f180cb8689da65467e11239fe7e563892d300))
|
|
29
|
+
|
|
2
30
|
### [4.52.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.1...v4.52.2) (2025-12-27)
|
|
3
31
|
|
|
4
32
|
|
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.52.
|
|
3
|
+
"version": "4.52.5",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.843",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.2",
|
|
@@ -15,17 +15,17 @@
|
|
|
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.52.
|
|
19
|
-
"@dynamic-labs/iconic": "4.52.
|
|
20
|
-
"@dynamic-labs/locale": "4.52.
|
|
21
|
-
"@dynamic-labs/logger": "4.52.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "4.52.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "4.52.
|
|
24
|
-
"@dynamic-labs/store": "4.52.
|
|
25
|
-
"@dynamic-labs/types": "4.52.
|
|
26
|
-
"@dynamic-labs/utils": "4.52.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.52.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.52.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.52.5",
|
|
19
|
+
"@dynamic-labs/iconic": "4.52.5",
|
|
20
|
+
"@dynamic-labs/locale": "4.52.5",
|
|
21
|
+
"@dynamic-labs/logger": "4.52.5",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.52.5",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.52.5",
|
|
24
|
+
"@dynamic-labs/store": "4.52.5",
|
|
25
|
+
"@dynamic-labs/types": "4.52.5",
|
|
26
|
+
"@dynamic-labs/utils": "4.52.5",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.52.5",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.52.5",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -134,8 +134,7 @@ require('./lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanne
|
|
|
134
134
|
require('./lib/context/PasskeyContext/PasskeyContext.cjs');
|
|
135
135
|
require('./lib/widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
|
|
136
136
|
var useEmbeddedReveal = require('./lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs');
|
|
137
|
-
var
|
|
138
|
-
var useRefreshUser = require('./lib/utils/hooks/useRefreshUser/useRefreshUser.cjs');
|
|
137
|
+
var useWalletBackup = require('./lib/utils/hooks/useWalletBackup/useWalletBackup.cjs');
|
|
139
138
|
var useEmbeddedWalletAuthenticator = require('./lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.cjs');
|
|
140
139
|
require('./lib/widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
|
|
141
140
|
require('./lib/context/OnrampContext/OnrampContext.cjs');
|
|
@@ -155,6 +154,7 @@ var FarcasterConnectView = require('./lib/views/FarcasterConnectView/FarcasterCo
|
|
|
155
154
|
var NetworkNotSupportedSwitchManual = require('./lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs');
|
|
156
155
|
var viewToComponentMap = require('./lib/views/viewToComponentMap.cjs');
|
|
157
156
|
require('./lib/store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
157
|
+
var useDynamicWaas = require('./lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs');
|
|
158
158
|
var useGetMfaToken = require('./lib/utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
|
|
159
159
|
var useDynamicModals = require('./lib/utils/hooks/useDynamicModals/useDynamicModals.cjs');
|
|
160
160
|
var useMfa = require('./lib/utils/hooks/useMfa/useMfa.cjs');
|
|
@@ -163,6 +163,7 @@ var useMultichainTokenBalances = require('./lib/utils/hooks/useMultichainTokenBa
|
|
|
163
163
|
var useEmbeddedWallet = require('./lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
164
164
|
var constants = require('./lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
165
165
|
var useExternalAuth = require('./lib/utils/hooks/useExternalAuth/useExternalAuth.cjs');
|
|
166
|
+
var useRefreshUser = require('./lib/utils/hooks/useRefreshUser/useRefreshUser.cjs');
|
|
166
167
|
var useWalletOptions = require('./lib/utils/hooks/useWalletOptions/useWalletOptions.cjs');
|
|
167
168
|
var useSyncMfaFlow = require('./lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs');
|
|
168
169
|
var useTelegramLogin = require('./lib/utils/hooks/useTelegramLogin/useTelegramLogin.cjs');
|
|
@@ -205,6 +206,7 @@ var useConnectWithOtp = require('./lib/context/ConnectWithOtpContext/useConnectW
|
|
|
205
206
|
var usePhantomRedirectEvents = require('./lib/utils/hooks/usePhantomRedirectEvents/usePhantomRedirectEvents.cjs');
|
|
206
207
|
var useSwitchNetwork = require('./lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.cjs');
|
|
207
208
|
var ReinitializeContextProvider = require('./lib/context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
209
|
+
var createCryptoDotComPayment = require('./lib/utils/functions/createCryptoDotComPayment/createCryptoDotComPayment.cjs');
|
|
208
210
|
|
|
209
211
|
assertPackageVersion.assertPackageVersion('@dynamic-labs/sdk-react-core', _package.version);
|
|
210
212
|
utils.tracing.logEvent('sdk-react-core.initialization', 'script-loaded');
|
|
@@ -286,8 +288,9 @@ exports.DynamicWidgetContextProvider = DynamicWidgetContext.DynamicWidgetContext
|
|
|
286
288
|
exports.useWalletDelegation = useWalletDelegation.useWalletDelegation;
|
|
287
289
|
exports.useSwitchWallet = useSwitchWallet.useSwitchWallet;
|
|
288
290
|
exports.useEmbeddedReveal = useEmbeddedReveal.useEmbeddedReveal;
|
|
289
|
-
exports.
|
|
290
|
-
exports.
|
|
291
|
+
exports.isWalletBackedUp = useWalletBackup.isWalletBackedUp;
|
|
292
|
+
exports.useBackupWallets = useWalletBackup.useBackupWallets;
|
|
293
|
+
exports.useWalletBackup = useWalletBackup.useWalletBackup;
|
|
291
294
|
exports.useEmbeddedWalletAuthenticator = useEmbeddedWalletAuthenticator.useEmbeddedWalletAuthenticator;
|
|
292
295
|
exports.FilterAndSortWallets = index$2.FilterAndSortWallets;
|
|
293
296
|
exports.FilterBridgeChainsName = index$2.FilterBridgeChainsName;
|
|
@@ -307,6 +310,7 @@ exports.WalletList = WalletList.WalletList;
|
|
|
307
310
|
exports.FarcasterConnectView = FarcasterConnectView.FarcasterConnectView;
|
|
308
311
|
exports.NetworkNotSupportedSwitchManual = NetworkNotSupportedSwitchManual.NetworkNotSupportedSwitchManual;
|
|
309
312
|
exports.viewToComponentMap = viewToComponentMap.viewToComponentMap;
|
|
313
|
+
exports.useDynamicWaas = useDynamicWaas.useDynamicWaas;
|
|
310
314
|
exports.useGetMfaToken = useGetMfaToken.useGetMfaToken;
|
|
311
315
|
exports.useDynamicModals = useDynamicModals.useDynamicModals;
|
|
312
316
|
exports.useMfa = useMfa.useMfa;
|
|
@@ -318,6 +322,7 @@ Object.defineProperty(exports, 'EmbeddedWalletVersion', {
|
|
|
318
322
|
get: function () { return constants.EmbeddedWalletVersion; }
|
|
319
323
|
});
|
|
320
324
|
exports.useExternalAuth = useExternalAuth.useExternalAuth;
|
|
325
|
+
exports.useRefreshUser = useRefreshUser.useRefreshUser;
|
|
321
326
|
exports.useWalletOptions = useWalletOptions.useWalletOptions;
|
|
322
327
|
exports.useSyncMfaFlow = useSyncMfaFlow.useSyncMfaFlow;
|
|
323
328
|
exports.useTelegramLogin = useTelegramLogin.useTelegramLogin;
|
|
@@ -358,3 +363,4 @@ exports.useConnectWithOtp = useConnectWithOtp.useConnectWithOtp;
|
|
|
358
363
|
exports.usePhantomRedirectEvents = usePhantomRedirectEvents.usePhantomRedirectEvents;
|
|
359
364
|
exports.useSwitchNetwork = useSwitchNetwork.useSwitchNetwork;
|
|
360
365
|
exports.useReinitialize = ReinitializeContextProvider.useReinitialize;
|
|
366
|
+
exports.createCryptoDotComPayment = createCryptoDotComPayment.createCryptoDotComPayment;
|
package/src/index.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export { FilterAndSortWallets, FilterBridgeChainsName, FilterChain, FilterWallet
|
|
|
123
123
|
export {
|
|
124
124
|
/** @deprecated */
|
|
125
125
|
DynamicWidgetContextProvider, } from './lib/widgets/DynamicWidget/context';
|
|
126
|
-
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useMultichainTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, useDynamicWaas, useGetPasskeys, useDeletePasskey, useRegisterPasskey, useAuthenticatePasskeyMFA, useGetUserMfaMethods, usePromptMfaAuth, useUpgradeToDynamicWaasFlow, useGetMfaToken, useIsMfaRequiredForAction, useWalletDelegation, useExchangeAccounts, } from './lib/utils/hooks';
|
|
126
|
+
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useMultichainTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, useDynamicWaas, useGetPasskeys, useDeletePasskey, useRegisterPasskey, useAuthenticatePasskeyMFA, useGetUserMfaMethods, usePromptMfaAuth, useUpgradeToDynamicWaasFlow, useGetMfaToken, useIsMfaRequiredForAction, useWalletDelegation, useWalletBackup, useBackupWallets, isWalletBackedUp, useExchangeAccounts, } from './lib/utils/hooks';
|
|
127
127
|
export {
|
|
128
128
|
/** @deprecated use useOnramp instead */
|
|
129
129
|
useFunding, } from './lib/utils/hooks/useFunding';
|
|
@@ -148,3 +148,4 @@ export { isAuthenticatedWithAWallet } from './lib/utils/functions/isAuthenticate
|
|
|
148
148
|
export { usingV3Wallets } from './lib/utils/functions/usingV3Wallets/usingV3Wallets';
|
|
149
149
|
export { useSyncMfaFlow } from './lib/utils/hooks/useSyncMfaFlow';
|
|
150
150
|
export { useSignInWithPasskey } from './lib/utils/hooks/useSignInWithPasskey';
|
|
151
|
+
export { createCryptoDotComPayment } from './lib/utils/functions/createCryptoDotComPayment';
|
package/src/index.js
CHANGED
|
@@ -130,8 +130,7 @@ import './lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner
|
|
|
130
130
|
import './lib/context/PasskeyContext/PasskeyContext.js';
|
|
131
131
|
import './lib/widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js';
|
|
132
132
|
export { useEmbeddedReveal } from './lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js';
|
|
133
|
-
export {
|
|
134
|
-
export { useRefreshUser } from './lib/utils/hooks/useRefreshUser/useRefreshUser.js';
|
|
133
|
+
export { isWalletBackedUp, useBackupWallets, useWalletBackup } from './lib/utils/hooks/useWalletBackup/useWalletBackup.js';
|
|
135
134
|
export { useEmbeddedWalletAuthenticator } from './lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.js';
|
|
136
135
|
import './lib/widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js';
|
|
137
136
|
import './lib/context/OnrampContext/OnrampContext.js';
|
|
@@ -151,6 +150,7 @@ export { FarcasterConnectView } from './lib/views/FarcasterConnectView/Farcaster
|
|
|
151
150
|
export { NetworkNotSupportedSwitchManual } from './lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js';
|
|
152
151
|
export { viewToComponentMap } from './lib/views/viewToComponentMap.js';
|
|
153
152
|
import './lib/store/state/connectorsInitializing/connectorsInitializing.js';
|
|
153
|
+
export { useDynamicWaas } from './lib/utils/hooks/useDynamicWaas/useDynamicWaas.js';
|
|
154
154
|
export { useGetMfaToken } from './lib/utils/hooks/useGetMfaToken/useGetMfaToken.js';
|
|
155
155
|
export { useDynamicModals } from './lib/utils/hooks/useDynamicModals/useDynamicModals.js';
|
|
156
156
|
export { useMfa } from './lib/utils/hooks/useMfa/useMfa.js';
|
|
@@ -159,6 +159,7 @@ export { useMultichainTokenBalances } from './lib/utils/hooks/useMultichainToken
|
|
|
159
159
|
export { useEmbeddedWallet } from './lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
|
|
160
160
|
export { EmbeddedWalletVersion } from './lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
161
161
|
export { useExternalAuth } from './lib/utils/hooks/useExternalAuth/useExternalAuth.js';
|
|
162
|
+
export { useRefreshUser } from './lib/utils/hooks/useRefreshUser/useRefreshUser.js';
|
|
162
163
|
export { useWalletOptions } from './lib/utils/hooks/useWalletOptions/useWalletOptions.js';
|
|
163
164
|
export { useSyncMfaFlow } from './lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js';
|
|
164
165
|
export { useTelegramLogin } from './lib/utils/hooks/useTelegramLogin/useTelegramLogin.js';
|
|
@@ -201,6 +202,7 @@ export { useConnectWithOtp } from './lib/context/ConnectWithOtpContext/useConnec
|
|
|
201
202
|
export { usePhantomRedirectEvents } from './lib/utils/hooks/usePhantomRedirectEvents/usePhantomRedirectEvents.js';
|
|
202
203
|
export { useSwitchNetwork } from './lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.js';
|
|
203
204
|
export { useReinitialize } from './lib/context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
205
|
+
export { createCryptoDotComPayment } from './lib/utils/functions/createCryptoDotComPayment/createCryptoDotComPayment.js';
|
|
204
206
|
|
|
205
207
|
assertPackageVersion('@dynamic-labs/sdk-react-core', version);
|
|
206
208
|
tracing.logEvent('sdk-react-core.initialization', 'script-loaded');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var client = require('@dynamic-labs-sdk/client');
|
|
8
|
+
|
|
9
|
+
const createCryptoDotComPayment = (paymentParams) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
10
|
+
return client.createCryptoDotComPayment(Object.assign(Object.assign({}, paymentParams), { chain: paymentParams.chain }));
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
exports.createCryptoDotComPayment = createCryptoDotComPayment;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CryptoDotComPaymentCreateRequest, CryptoDotComPaymentResponse } from '@dynamic-labs-sdk/client';
|
|
2
|
+
type CreateCryptoDotComPaymentParams = Omit<CryptoDotComPaymentCreateRequest, 'chain'> & {
|
|
3
|
+
chain: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const createCryptoDotComPayment: (paymentParams: CreateCryptoDotComPaymentParams) => Promise<CryptoDotComPaymentResponse>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { createCryptoDotComPayment as createCryptoDotComPayment$1 } from '@dynamic-labs-sdk/client';
|
|
4
|
+
|
|
5
|
+
const createCryptoDotComPayment = (paymentParams) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
|
+
return createCryptoDotComPayment$1(Object.assign(Object.assign({}, paymentParams), { chain: paymentParams.chain }));
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { createCryptoDotComPayment };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCryptoDotComPayment } from './createCryptoDotComPayment';
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
9
|
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
10
|
+
var useUserAuth = require('../useUserAuth/useUserAuth.cjs');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Authenticate passkey for MFA
|
|
@@ -30,12 +31,30 @@ var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
|
30
31
|
* );
|
|
31
32
|
* }
|
|
32
33
|
*/
|
|
33
|
-
const useAuthenticatePasskeyMFA = () =>
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
mfaToken
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const useAuthenticatePasskeyMFA = () => {
|
|
35
|
+
const { completeAuth } = useUserAuth.useUserAuth({});
|
|
36
|
+
return React.useCallback((props) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
let mfaToken = undefined;
|
|
38
|
+
yield completeAuth({
|
|
39
|
+
updateJwtFunction: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const response = yield client.authenticatePasskeyMFA(props);
|
|
41
|
+
// eslint-disable-next-line prefer-destructuring
|
|
42
|
+
mfaToken = response.mfaToken;
|
|
43
|
+
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
44
|
+
mfaToken: response.mfaToken,
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
isEmailVerificationRequired: false,
|
|
48
|
+
isSmsVerificationRequired: false,
|
|
49
|
+
missingFields: [],
|
|
50
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows:
|
|
51
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
52
|
+
updateUserProfileResponse: response,
|
|
53
|
+
};
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
return mfaToken;
|
|
57
|
+
}), [completeAuth]);
|
|
58
|
+
};
|
|
40
59
|
|
|
41
60
|
exports.useAuthenticatePasskeyMFA = useAuthenticatePasskeyMFA;
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { authenticatePasskeyMFA } from '@dynamic-labs-sdk/client';
|
|
5
5
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
6
|
+
import { useUserAuth } from '../useUserAuth/useUserAuth.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Authenticate passkey for MFA
|
|
@@ -26,12 +27,30 @@ import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
|
26
27
|
* );
|
|
27
28
|
* }
|
|
28
29
|
*/
|
|
29
|
-
const useAuthenticatePasskeyMFA = () =>
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
mfaToken
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const useAuthenticatePasskeyMFA = () => {
|
|
31
|
+
const { completeAuth } = useUserAuth({});
|
|
32
|
+
return useCallback((props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
let mfaToken = undefined;
|
|
34
|
+
yield completeAuth({
|
|
35
|
+
updateJwtFunction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const response = yield authenticatePasskeyMFA(props);
|
|
37
|
+
// eslint-disable-next-line prefer-destructuring
|
|
38
|
+
mfaToken = response.mfaToken;
|
|
39
|
+
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
40
|
+
mfaToken: response.mfaToken,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
isEmailVerificationRequired: false,
|
|
44
|
+
isSmsVerificationRequired: false,
|
|
45
|
+
missingFields: [],
|
|
46
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows:
|
|
47
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
48
|
+
updateUserProfileResponse: response,
|
|
49
|
+
};
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
return mfaToken;
|
|
53
|
+
}), [completeAuth]);
|
|
54
|
+
};
|
|
36
55
|
|
|
37
56
|
export { useAuthenticatePasskeyMFA };
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
9
|
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
10
|
+
var useUserAuth = require('../useUserAuth/useUserAuth.cjs');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Register passkey
|
|
@@ -27,12 +28,29 @@ var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
|
27
28
|
* );
|
|
28
29
|
* }
|
|
29
30
|
*/
|
|
30
|
-
const useRegisterPasskey = () =>
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const useRegisterPasskey = () => {
|
|
32
|
+
const { completeAuth } = useUserAuth.useUserAuth({});
|
|
33
|
+
return React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
let response;
|
|
35
|
+
yield completeAuth({
|
|
36
|
+
updateJwtFunction: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
response = yield client.registerPasskey();
|
|
38
|
+
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
39
|
+
mfaToken: response.mfaToken,
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
isEmailVerificationRequired: false,
|
|
43
|
+
isSmsVerificationRequired: false,
|
|
44
|
+
missingFields: [],
|
|
45
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows
|
|
46
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
47
|
+
updateUserProfileResponse: response,
|
|
48
|
+
};
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
// @ts-expect-error - response is being set in the completeAuth function
|
|
52
|
+
return response;
|
|
53
|
+
}), [completeAuth]);
|
|
54
|
+
};
|
|
37
55
|
|
|
38
56
|
exports.useRegisterPasskey = useRegisterPasskey;
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { registerPasskey } from '@dynamic-labs-sdk/client';
|
|
5
5
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
6
|
+
import { useUserAuth } from '../useUserAuth/useUserAuth.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Register passkey
|
|
@@ -23,12 +24,29 @@ import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
|
23
24
|
* );
|
|
24
25
|
* }
|
|
25
26
|
*/
|
|
26
|
-
const useRegisterPasskey = () =>
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const useRegisterPasskey = () => {
|
|
28
|
+
const { completeAuth } = useUserAuth({});
|
|
29
|
+
return useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
let response;
|
|
31
|
+
yield completeAuth({
|
|
32
|
+
updateJwtFunction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
response = yield registerPasskey();
|
|
34
|
+
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
35
|
+
mfaToken: response.mfaToken,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
isEmailVerificationRequired: false,
|
|
39
|
+
isSmsVerificationRequired: false,
|
|
40
|
+
missingFields: [],
|
|
41
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows
|
|
42
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
43
|
+
updateUserProfileResponse: response,
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
// @ts-expect-error - response is being set in the completeAuth function
|
|
48
|
+
return response;
|
|
49
|
+
}), [completeAuth]);
|
|
50
|
+
};
|
|
33
51
|
|
|
34
52
|
export { useRegisterPasskey };
|
|
@@ -123,7 +123,7 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
123
123
|
clearStackAndPushInitialView();
|
|
124
124
|
}), [authMethod, clearStackAndPushInitialView, handleLogOut]);
|
|
125
125
|
const handleAuthError = React.useCallback((error, { options = {}, onError, }) => {
|
|
126
|
-
var _a;
|
|
126
|
+
var _a, _b;
|
|
127
127
|
if (error instanceof client.MfaInvalidOtpError ||
|
|
128
128
|
error instanceof client.MfaRateLimitedError) {
|
|
129
129
|
throw error;
|
|
@@ -160,6 +160,16 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
160
160
|
});
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
+
// Re-throw passkey errors so they propagate to usePromise in the UI
|
|
164
|
+
// This allows error messages to be displayed in ConfirmPasskeyView
|
|
165
|
+
// WebAuthnError is the specific error type thrown by @simplewebauthn/browser
|
|
166
|
+
// for passkey operations (authentication/registration failures)
|
|
167
|
+
// NotAllowedError is the underlying DOMException when user cancels or times out
|
|
168
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'NotAllowedError' &&
|
|
169
|
+
(((_b = error === null || error === void 0 ? void 0 : error.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'WebAuthnError' ||
|
|
170
|
+
(error === null || error === void 0 ? void 0 : error.code) === 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY')) {
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
163
173
|
if (onError) {
|
|
164
174
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
165
175
|
return;
|
|
@@ -119,7 +119,7 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
119
119
|
clearStackAndPushInitialView();
|
|
120
120
|
}), [authMethod, clearStackAndPushInitialView, handleLogOut]);
|
|
121
121
|
const handleAuthError = useCallback((error, { options = {}, onError, }) => {
|
|
122
|
-
var _a;
|
|
122
|
+
var _a, _b;
|
|
123
123
|
if (error instanceof MfaInvalidOtpError ||
|
|
124
124
|
error instanceof MfaRateLimitedError) {
|
|
125
125
|
throw error;
|
|
@@ -156,6 +156,16 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
156
156
|
});
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
+
// Re-throw passkey errors so they propagate to usePromise in the UI
|
|
160
|
+
// This allows error messages to be displayed in ConfirmPasskeyView
|
|
161
|
+
// WebAuthnError is the specific error type thrown by @simplewebauthn/browser
|
|
162
|
+
// for passkey operations (authentication/registration failures)
|
|
163
|
+
// NotAllowedError is the underlying DOMException when user cancels or times out
|
|
164
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'NotAllowedError' &&
|
|
165
|
+
(((_b = error === null || error === void 0 ? void 0 : error.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'WebAuthnError' ||
|
|
166
|
+
(error === null || error === void 0 ? void 0 : error.code) === 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY')) {
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
159
169
|
if (onError) {
|
|
160
170
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
161
171
|
return;
|