@dynamic-labs/sdk-react-core 3.0.0-alpha.45 → 3.0.0-alpha.47
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 +40 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/index.cjs +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -2
- package/src/lib/components/PinField/PinField.cjs +2 -2
- package/src/lib/components/PinField/PinField.d.ts +1 -1
- package/src/lib/components/PinField/PinField.js +2 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +2 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +2 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +3 -3
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +3 -3
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.d.ts +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +3 -3
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +3 -3
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +34 -32
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +34 -32
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +16 -12
- package/src/lib/context/DynamicContext/DynamicContext.js +17 -13
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +5 -0
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +1 -2
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +1 -2
- package/src/lib/data/api/api.cjs +2 -4
- package/src/lib/data/api/api.d.ts +6 -2
- package/src/lib/data/api/api.js +2 -4
- package/src/lib/data/api/chains/balances.cjs +5 -2
- package/src/lib/data/api/chains/balances.d.ts +2 -1
- package/src/lib/data/api/chains/balances.js +5 -2
- package/src/lib/data/api/mfa/mfa.cjs +5 -1
- package/src/lib/data/api/mfa/mfa.d.ts +2 -1
- package/src/lib/data/api/mfa/mfa.js +6 -2
- package/src/lib/events/dynamicEvents.d.ts +2 -1
- package/src/lib/events/tokenBalances.d.ts +3 -0
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +2 -2
- package/src/lib/locale/en/translation.cjs +5 -0
- package/src/lib/locale/en/translation.d.ts +5 -0
- package/src/lib/locale/en/translation.js +5 -0
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +1 -1
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +2 -2
- package/src/lib/store/actions/tokenBalancesActions/index.d.ts +1 -0
- package/src/lib/store/actions/tokenBalancesActions/tokenBalancesActions.cjs +12 -0
- package/src/lib/store/actions/tokenBalancesActions/tokenBalancesActions.d.ts +7 -0
- package/src/lib/store/actions/tokenBalancesActions/tokenBalancesActions.js +8 -0
- package/src/lib/store/hooks/useTokenBalancesState/index.d.ts +1 -0
- package/src/lib/store/hooks/useTokenBalancesState/useTokenBalancesState.cjs +14 -0
- package/src/lib/store/hooks/useTokenBalancesState/useTokenBalancesState.d.ts +1 -0
- package/src/lib/store/hooks/useTokenBalancesState/useTokenBalancesState.js +10 -0
- package/src/lib/store/index.d.ts +2 -0
- package/src/lib/store/store.cjs +6 -0
- package/src/lib/store/store.js +6 -0
- package/src/lib/store/types.d.ts +8 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/index.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +8 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +8 -1
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +2 -1
- package/src/lib/utils/hooks/useMfa/useMfa.d.ts +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +2 -1
- package/src/lib/utils/hooks/useOnlyConnectedMode/useOnlyConnectedMode.d.ts +0 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +7 -13
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +7 -13
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +29 -19
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.d.ts +4 -3
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +30 -20
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +2 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -2
- package/src/lib/utils/hooks/useWalletOptions/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useSelectWalletOption/useSelectWalletOption.cjs → useWalletOptions/useWalletOptions.cjs} +31 -4
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +9 -0
- package/src/lib/utils/hooks/{useSelectWalletOption/useSelectWalletOption.js → useWalletOptions/useWalletOptions.js} +32 -5
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +2 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +2 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +3 -3
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +3 -3
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +10 -3
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +11 -4
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +23 -7
- package/src/lib/views/SendBalanceView/SendBalanceView.js +23 -7
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +20 -6
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +21 -7
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.cjs +3 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.js +3 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/utils/sort.cjs +2 -8
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/utils/sort.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/utils/sort.js +2 -8
- package/src/lib/utils/hooks/useSelectWalletOption/index.d.ts +0 -1
- package/src/lib/utils/hooks/useSelectWalletOption/useSelectWalletOption.d.ts +0 -3
|
@@ -2,7 +2,7 @@ import { DynamicEvents } from '../../../../events';
|
|
|
2
2
|
import { EventArgs } from '../types';
|
|
3
3
|
type DynamicEventListener<E extends keyof DynamicEvents> = (...args: EventArgs<DynamicEvents, E>) => void;
|
|
4
4
|
/** Allows us to subscribe to all dynamicEvents with a hook, even the internal ones */
|
|
5
|
-
export declare const useInternalDynamicEvents: <E extends keyof import("../../../../events/auth").AuthEvents | keyof import("../../../../events/ui").UIEvents | keyof import("../../../../events/otp").OTPEvents | keyof import("../../../../events/wallets").WalletEvents | keyof import("../../../../events/passkey").PasskeyEvents | "farcasterConnectCancelled" | keyof import("../../../../events/embeddedWallet").EmbeddedWalletEvents | keyof import("../../../../events/multiWallet").MultiWalletInternalEvents>(event: E, listener: DynamicEventListener<E>) => void;
|
|
5
|
+
export declare const useInternalDynamicEvents: <E extends keyof import("../../../../events/auth").AuthEvents | keyof import("../../../../events/ui").UIEvents | keyof import("../../../../events/otp").OTPEvents | keyof import("../../../../events/wallets").WalletEvents | keyof import("../../../../events/passkey").PasskeyEvents | "farcasterConnectCancelled" | keyof import("../../../../events/embeddedWallet").EmbeddedWalletEvents | keyof import("../../../../events/multiWallet").MultiWalletInternalEvents | "tokenBalancesChanged">(event: E, listener: DynamicEventListener<E>) => void;
|
|
6
6
|
/** Allows subscribing to dynamic events directly inside components with a hook */
|
|
7
7
|
export declare const useDynamicEvents: <E extends "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "walletAdded" | "embeddedWalletCreated">(event: E, listener: DynamicEventListener<E>) => void;
|
|
8
8
|
export {};
|
|
@@ -60,6 +60,6 @@ export { useSyncEmbeddedWalletFlow } from './useSyncEmbeddedWalletFlow';
|
|
|
60
60
|
export { useSyncOnboardingFlow } from './useSyncOnboardingFlow';
|
|
61
61
|
export { useExternalAuth } from './useExternalAuth';
|
|
62
62
|
export { useRefreshUser } from './useRefreshUser';
|
|
63
|
-
export {
|
|
63
|
+
export { useWalletOptions } from './useWalletOptions';
|
|
64
64
|
export { useResetCookieLocalStorage } from './useResetCookieLocalStorage';
|
|
65
65
|
export { useSyncMfaFlow } from './useSyncMfaFlow';
|
|
@@ -204,7 +204,14 @@ const useSecureEnclaveEmbeddedWallet = () => {
|
|
|
204
204
|
environmentId,
|
|
205
205
|
});
|
|
206
206
|
return user.refreshUserJwt({ environmentId });
|
|
207
|
-
}), [
|
|
207
|
+
}), [
|
|
208
|
+
environmentId,
|
|
209
|
+
initPasskeyRecoveryProcess,
|
|
210
|
+
projectSettings,
|
|
211
|
+
shouldInitRecovery,
|
|
212
|
+
user$1,
|
|
213
|
+
wallet === null || wallet === void 0 ? void 0 : wallet.connector,
|
|
214
|
+
]);
|
|
208
215
|
/**
|
|
209
216
|
* Creates or restores a secure enclave embedded wallet session
|
|
210
217
|
* If it detects that the session is possible to be restored, it will restore it
|
|
@@ -200,7 +200,14 @@ const useSecureEnclaveEmbeddedWallet = () => {
|
|
|
200
200
|
environmentId,
|
|
201
201
|
});
|
|
202
202
|
return refreshUserJwt({ environmentId });
|
|
203
|
-
}), [
|
|
203
|
+
}), [
|
|
204
|
+
environmentId,
|
|
205
|
+
initPasskeyRecoveryProcess,
|
|
206
|
+
projectSettings,
|
|
207
|
+
shouldInitRecovery,
|
|
208
|
+
user,
|
|
209
|
+
wallet === null || wallet === void 0 ? void 0 : wallet.connector,
|
|
210
|
+
]);
|
|
204
211
|
/**
|
|
205
212
|
* Creates or restores a secure enclave embedded wallet session
|
|
206
213
|
* If it detects that the session is possible to be restored, it will restore it
|
|
@@ -112,12 +112,13 @@ const useMfa = () => {
|
|
|
112
112
|
mfaDeviceId: deviceId,
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
|
-
const deleteUserDevice = (deviceId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
115
|
+
const deleteUserDevice = (deviceId, mfaAuthToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
116
116
|
if (!verifiedUser) {
|
|
117
117
|
throw new Error(errors.USER_NOT_LOGGED_IN);
|
|
118
118
|
}
|
|
119
119
|
yield mfa.deleteMfaDevice({
|
|
120
120
|
environmentId,
|
|
121
|
+
mfaAuthToken,
|
|
121
122
|
mfaDeviceId: deviceId,
|
|
122
123
|
});
|
|
123
124
|
});
|
|
@@ -7,7 +7,7 @@ export declare const useMfa: () => {
|
|
|
7
7
|
}>;
|
|
8
8
|
readonly authDevice: (code: string, type?: MFADeviceType, deviceId?: string) => Promise<boolean>;
|
|
9
9
|
readonly authRecoveryCode: (code: string) => Promise<boolean>;
|
|
10
|
-
readonly deleteUserDevice: (deviceId: string) => Promise<void>;
|
|
10
|
+
readonly deleteUserDevice: (deviceId: string, mfaAuthToken: string) => Promise<void>;
|
|
11
11
|
readonly getRecoveryCodes: (generateNewCodes?: boolean) => Promise<string[]>;
|
|
12
12
|
readonly getUserDevices: () => Promise<MFADevice[]>;
|
|
13
13
|
readonly updateUserDevice: (deviceId: string) => Promise<void>;
|
|
@@ -108,12 +108,13 @@ const useMfa = () => {
|
|
|
108
108
|
mfaDeviceId: deviceId,
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
|
-
const deleteUserDevice = (deviceId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
+
const deleteUserDevice = (deviceId, mfaAuthToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
112
112
|
if (!verifiedUser) {
|
|
113
113
|
throw new Error(USER_NOT_LOGGED_IN);
|
|
114
114
|
}
|
|
115
115
|
yield deleteMfaDevice({
|
|
116
116
|
environmentId,
|
|
117
|
+
mfaAuthToken,
|
|
117
118
|
mfaDeviceId: deviceId,
|
|
118
119
|
});
|
|
119
120
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useOnlyConnectedMode: () => boolean;
|
|
@@ -228,29 +228,23 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
228
228
|
oauthLoginUrl.searchParams.set('code_challenge_method', 'S256');
|
|
229
229
|
}
|
|
230
230
|
const isMobile = utils.isMobile();
|
|
231
|
-
const effectiveRedirectUrl = redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl;
|
|
232
231
|
try {
|
|
233
232
|
const authCode = yield utils.Oauth2Service.getOauthCode({
|
|
234
233
|
apiProvider: getProviderByType.getProviderByType((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _c !== void 0 ? _c : [], provider),
|
|
235
234
|
getOAuthResultFromApi: () => oauth.getOAuthResult(environmentId, provider, {
|
|
236
235
|
state,
|
|
237
236
|
}),
|
|
238
|
-
initWebAuth: () => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
? removeDynamicOauthParamsFromUrl(mobileRedirectUrl)
|
|
245
|
-
: undefined,
|
|
246
|
-
state,
|
|
247
|
-
});
|
|
248
|
-
},
|
|
237
|
+
initWebAuth: ({ redirectUrl } = {}) => oauth.initAuth(environmentId, provider, {
|
|
238
|
+
redirectUrl: redirectUrl
|
|
239
|
+
? removeDynamicOauthParamsFromUrl(redirectUrl)
|
|
240
|
+
: undefined,
|
|
241
|
+
state,
|
|
242
|
+
}),
|
|
249
243
|
isMobile,
|
|
250
244
|
oauthLoginUrl,
|
|
251
245
|
onSettled,
|
|
252
246
|
provider,
|
|
253
|
-
redirectUrl:
|
|
247
|
+
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
254
248
|
sessionTimeout,
|
|
255
249
|
setIsProcessing,
|
|
256
250
|
state,
|
|
@@ -224,29 +224,23 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
224
224
|
oauthLoginUrl.searchParams.set('code_challenge_method', 'S256');
|
|
225
225
|
}
|
|
226
226
|
const isMobile$1 = isMobile();
|
|
227
|
-
const effectiveRedirectUrl = redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl;
|
|
228
227
|
try {
|
|
229
228
|
const authCode = yield Oauth2Service.getOauthCode({
|
|
230
229
|
apiProvider: getProviderByType((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _c !== void 0 ? _c : [], provider),
|
|
231
230
|
getOAuthResultFromApi: () => getOAuthResult(environmentId, provider, {
|
|
232
231
|
state,
|
|
233
232
|
}),
|
|
234
|
-
initWebAuth: () => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
? removeDynamicOauthParamsFromUrl(mobileRedirectUrl)
|
|
241
|
-
: undefined,
|
|
242
|
-
state,
|
|
243
|
-
});
|
|
244
|
-
},
|
|
233
|
+
initWebAuth: ({ redirectUrl } = {}) => initAuth(environmentId, provider, {
|
|
234
|
+
redirectUrl: redirectUrl
|
|
235
|
+
? removeDynamicOauthParamsFromUrl(redirectUrl)
|
|
236
|
+
: undefined,
|
|
237
|
+
state,
|
|
238
|
+
}),
|
|
245
239
|
isMobile: isMobile$1,
|
|
246
240
|
oauthLoginUrl,
|
|
247
241
|
onSettled,
|
|
248
242
|
provider,
|
|
249
|
-
redirectUrl:
|
|
243
|
+
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
250
244
|
sessionTimeout,
|
|
251
245
|
setIsProcessing,
|
|
252
246
|
state,
|
|
@@ -6,32 +6,34 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
9
|
-
|
|
10
|
-
require('
|
|
9
|
+
require('@dynamic-labs/store');
|
|
10
|
+
require('../../constants/colors.cjs');
|
|
11
|
+
require('../../constants/values.cjs');
|
|
11
12
|
require('../../../shared/logger.cjs');
|
|
12
13
|
require('@dynamic-labs/iconic');
|
|
13
14
|
require('@dynamic-labs/wallet-connector-core');
|
|
14
15
|
require('react/jsx-runtime');
|
|
15
16
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
16
17
|
require('@dynamic-labs/wallet-book');
|
|
17
|
-
require('../../constants/colors.cjs');
|
|
18
|
-
require('../../constants/values.cjs');
|
|
19
18
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
19
|
require('../../../shared/utils/classes/storage/sessionStorage.cjs');
|
|
21
20
|
require('@dynamic-labs/utils');
|
|
22
21
|
require('../../../shared/consts/index.cjs');
|
|
23
|
-
require('../../../
|
|
22
|
+
var tokenBalancesActions = require('../../../store/actions/tokenBalancesActions/tokenBalancesActions.cjs');
|
|
23
|
+
var useDynamicEvents = require('../events/useDynamicEvents/useDynamicEvents.cjs');
|
|
24
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
25
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
24
26
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
25
27
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
26
28
|
var errors = require('../../constants/errors.cjs');
|
|
27
29
|
require('@dynamic-labs/multi-wallet');
|
|
28
30
|
require('react-international-phone');
|
|
29
31
|
require('../../../config/ApiEndpoint.cjs');
|
|
30
|
-
require('@dynamic-labs/store');
|
|
31
32
|
require('../../../locale/locale.cjs');
|
|
32
33
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
33
34
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
34
35
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
36
|
+
require('../../../events/dynamicEvents.cjs');
|
|
35
37
|
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
36
38
|
require('react-dom');
|
|
37
39
|
require('../../../context/WalletContext/WalletContext.cjs');
|
|
@@ -89,25 +91,26 @@ require('../../../context/SendBalanceContext/SendBalanceContext.cjs');
|
|
|
89
91
|
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
90
92
|
require('../../../context/ConnectWithOtpContext/constants.cjs');
|
|
91
93
|
require('../../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
92
|
-
var
|
|
94
|
+
var balances = require('../../../data/api/chains/balances.cjs');
|
|
95
|
+
var useTokenBalancesState = require('../../../store/hooks/useTokenBalancesState/useTokenBalancesState.cjs');
|
|
93
96
|
|
|
94
97
|
// Hook exposed to customers and used internally to fetch account balances
|
|
95
98
|
const useTokenBalances = ({ accountAddress, networkId, chainName = sdkApiCore.ChainEnum.Evm, tokenAddresses, includeFiat = false, includeNativeBalance = false, } = {}) => {
|
|
96
|
-
const
|
|
97
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
98
|
-
const [error, setError] = React.useState(undefined);
|
|
99
|
+
const { tokenBalances: tokenBalancesData, isLoading, error, } = useTokenBalancesState.useTokenBalancesState();
|
|
99
100
|
const { primaryWallet, environmentId, network, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
100
101
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
101
102
|
const requestChainName = chainName !== null && chainName !== void 0 ? chainName : walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain;
|
|
102
103
|
const requestAccount = accountAddress !== null && accountAddress !== void 0 ? accountAddress : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
103
104
|
const requestNetwork = networkId !== null && networkId !== void 0 ? networkId : network;
|
|
104
|
-
const fetchAccountBalances = React.useCallback(() => _tslib.__awaiter(void 0,
|
|
105
|
+
const fetchAccountBalances = React.useCallback((...args_1) => _tslib.__awaiter(void 0, [...args_1], void 0, function* (forceRefresh = false) {
|
|
105
106
|
if (!user) {
|
|
106
|
-
|
|
107
|
+
tokenBalancesActions.setTokenBalances({ error: errors.USER_NOT_LOGGED_IN });
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
110
|
if (![sdkApiCore.ChainEnum.Evm, sdkApiCore.ChainEnum.Sol].includes(requestChainName)) {
|
|
110
|
-
|
|
111
|
+
tokenBalancesActions.setTokenBalances({
|
|
112
|
+
error: `Chain ${requestChainName} is not supported for token balances`,
|
|
113
|
+
});
|
|
111
114
|
return;
|
|
112
115
|
}
|
|
113
116
|
if (!isLoading &&
|
|
@@ -116,29 +119,29 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = sdkApiCore.Ch
|
|
|
116
119
|
requestNetwork &&
|
|
117
120
|
Object.values(sdkApiCore.GetAccountBalancesNetworkIdEnum).includes(requestNetwork)) ||
|
|
118
121
|
chainName === sdkApiCore.ChainEnum.Sol)) {
|
|
119
|
-
|
|
122
|
+
tokenBalancesActions.setTokenBalances({ isLoading: true });
|
|
120
123
|
balances.getAccountTokenBalances({
|
|
121
124
|
accountAddress: requestAccount,
|
|
122
125
|
chainName: requestChainName,
|
|
123
126
|
environmentId,
|
|
127
|
+
forceRefresh,
|
|
124
128
|
includeNative: includeNativeBalance,
|
|
125
129
|
includePrices: includeFiat,
|
|
126
130
|
networkId: chainName === sdkApiCore.ChainEnum.Evm ? Number(requestNetwork) : 0,
|
|
127
131
|
})
|
|
128
132
|
.then((response) => {
|
|
129
133
|
if (response) {
|
|
130
|
-
|
|
131
|
-
setError(undefined);
|
|
134
|
+
tokenBalancesActions.setTokenBalances({ error: undefined, tokenBalances: response });
|
|
132
135
|
}
|
|
133
136
|
})
|
|
134
137
|
.catch((e) => {
|
|
135
138
|
const errorMessage = (e === null || e === void 0 ? void 0 : e.code) === 429
|
|
136
139
|
? 'Too many requests fetching balances'
|
|
137
140
|
: e === null || e === void 0 ? void 0 : e.message;
|
|
138
|
-
|
|
141
|
+
tokenBalancesActions.setTokenBalances({ error: errorMessage });
|
|
139
142
|
})
|
|
140
143
|
.finally(() => {
|
|
141
|
-
|
|
144
|
+
tokenBalancesActions.setTokenBalances({ isLoading: false });
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
147
|
}), [
|
|
@@ -149,6 +152,7 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = sdkApiCore.Ch
|
|
|
149
152
|
requestNetwork,
|
|
150
153
|
environmentId,
|
|
151
154
|
]);
|
|
155
|
+
useDynamicEvents.useInternalDynamicEvents('tokenBalancesChanged', () => fetchAccountBalances(true));
|
|
152
156
|
React.useEffect(() => {
|
|
153
157
|
fetchAccountBalances();
|
|
154
158
|
}, [requestAccount, requestNetwork]);
|
|
@@ -157,7 +161,13 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = sdkApiCore.Ch
|
|
|
157
161
|
const lowerTokenAddresses = tokenAddresses === null || tokenAddresses === void 0 ? void 0 : tokenAddresses.map((address) => address.toLowerCase());
|
|
158
162
|
tokenBalances = tokenBalancesData === null || tokenBalancesData === void 0 ? void 0 : tokenBalancesData.filter((token) => lowerTokenAddresses === null || lowerTokenAddresses === void 0 ? void 0 : lowerTokenAddresses.includes(token.address.toLowerCase()));
|
|
159
163
|
}
|
|
160
|
-
return {
|
|
164
|
+
return {
|
|
165
|
+
error,
|
|
166
|
+
fetchAccountBalances,
|
|
167
|
+
isError: Boolean(error),
|
|
168
|
+
isLoading,
|
|
169
|
+
tokenBalances,
|
|
170
|
+
};
|
|
161
171
|
};
|
|
162
172
|
|
|
163
173
|
exports.useTokenBalances = useTokenBalances;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainEnum
|
|
1
|
+
import { ChainEnum } from '@dynamic-labs/sdk-api-core';
|
|
2
2
|
export declare const useTokenBalances: ({ accountAddress, networkId, chainName, tokenAddresses, includeFiat, includeNativeBalance, }?: {
|
|
3
3
|
accountAddress?: string;
|
|
4
4
|
networkId?: number;
|
|
@@ -8,7 +8,8 @@ export declare const useTokenBalances: ({ accountAddress, networkId, chainName,
|
|
|
8
8
|
includeNativeBalance?: boolean;
|
|
9
9
|
}) => {
|
|
10
10
|
error: string | undefined;
|
|
11
|
+
fetchAccountBalances: (forceRefresh?: boolean) => Promise<void>;
|
|
11
12
|
isError: boolean;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
tokenBalances: TokenBalance[] | undefined;
|
|
13
|
+
isLoading: boolean | undefined;
|
|
14
|
+
tokenBalances: import("@dynamic-labs/sdk-api-core").TokenBalance[] | undefined;
|
|
14
15
|
};
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useEffect } from 'react';
|
|
4
4
|
import { ChainEnum, GetAccountBalancesNetworkIdEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
|
-
import
|
|
6
|
-
import '
|
|
5
|
+
import '@dynamic-labs/store';
|
|
6
|
+
import '../../constants/colors.js';
|
|
7
|
+
import '../../constants/values.js';
|
|
7
8
|
import '../../../shared/logger.js';
|
|
8
9
|
import '@dynamic-labs/iconic';
|
|
9
10
|
import '@dynamic-labs/wallet-connector-core';
|
|
10
11
|
import 'react/jsx-runtime';
|
|
11
12
|
import '../../../context/ViewContext/ViewContext.js';
|
|
12
13
|
import '@dynamic-labs/wallet-book';
|
|
13
|
-
import '../../constants/colors.js';
|
|
14
|
-
import '../../constants/values.js';
|
|
15
14
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
16
15
|
import '../../../shared/utils/classes/storage/sessionStorage.js';
|
|
17
16
|
import '@dynamic-labs/utils';
|
|
18
17
|
import '../../../shared/consts/index.js';
|
|
19
|
-
import '../../../
|
|
18
|
+
import { setTokenBalances } from '../../../store/actions/tokenBalancesActions/tokenBalancesActions.js';
|
|
19
|
+
import { useInternalDynamicEvents } from '../events/useDynamicEvents/useDynamicEvents.js';
|
|
20
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
21
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
20
22
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
21
23
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
22
24
|
import { USER_NOT_LOGGED_IN } from '../../constants/errors.js';
|
|
23
25
|
import '@dynamic-labs/multi-wallet';
|
|
24
26
|
import 'react-international-phone';
|
|
25
27
|
import '../../../config/ApiEndpoint.js';
|
|
26
|
-
import '@dynamic-labs/store';
|
|
27
28
|
import '../../../locale/locale.js';
|
|
28
29
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
30
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
30
31
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
32
|
+
import '../../../events/dynamicEvents.js';
|
|
31
33
|
import '../../../context/VerificationContext/VerificationContext.js';
|
|
32
34
|
import 'react-dom';
|
|
33
35
|
import '../../../context/WalletContext/WalletContext.js';
|
|
@@ -85,25 +87,26 @@ import '../../../context/SendBalanceContext/SendBalanceContext.js';
|
|
|
85
87
|
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
86
88
|
import '../../../context/ConnectWithOtpContext/constants.js';
|
|
87
89
|
import '../../../context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
88
|
-
import {
|
|
90
|
+
import { getAccountTokenBalances } from '../../../data/api/chains/balances.js';
|
|
91
|
+
import { useTokenBalancesState } from '../../../store/hooks/useTokenBalancesState/useTokenBalancesState.js';
|
|
89
92
|
|
|
90
93
|
// Hook exposed to customers and used internally to fetch account balances
|
|
91
94
|
const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm, tokenAddresses, includeFiat = false, includeNativeBalance = false, } = {}) => {
|
|
92
|
-
const
|
|
93
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
94
|
-
const [error, setError] = useState(undefined);
|
|
95
|
+
const { tokenBalances: tokenBalancesData, isLoading, error, } = useTokenBalancesState();
|
|
95
96
|
const { primaryWallet, environmentId, network, user } = useInternalDynamicContext();
|
|
96
97
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
97
98
|
const requestChainName = chainName !== null && chainName !== void 0 ? chainName : walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain;
|
|
98
99
|
const requestAccount = accountAddress !== null && accountAddress !== void 0 ? accountAddress : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
99
100
|
const requestNetwork = networkId !== null && networkId !== void 0 ? networkId : network;
|
|
100
|
-
const fetchAccountBalances = useCallback(() => __awaiter(void 0,
|
|
101
|
+
const fetchAccountBalances = useCallback((...args_1) => __awaiter(void 0, [...args_1], void 0, function* (forceRefresh = false) {
|
|
101
102
|
if (!user) {
|
|
102
|
-
|
|
103
|
+
setTokenBalances({ error: USER_NOT_LOGGED_IN });
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
106
|
if (![ChainEnum.Evm, ChainEnum.Sol].includes(requestChainName)) {
|
|
106
|
-
|
|
107
|
+
setTokenBalances({
|
|
108
|
+
error: `Chain ${requestChainName} is not supported for token balances`,
|
|
109
|
+
});
|
|
107
110
|
return;
|
|
108
111
|
}
|
|
109
112
|
if (!isLoading &&
|
|
@@ -112,29 +115,29 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm
|
|
|
112
115
|
requestNetwork &&
|
|
113
116
|
Object.values(GetAccountBalancesNetworkIdEnum).includes(requestNetwork)) ||
|
|
114
117
|
chainName === ChainEnum.Sol)) {
|
|
115
|
-
|
|
118
|
+
setTokenBalances({ isLoading: true });
|
|
116
119
|
getAccountTokenBalances({
|
|
117
120
|
accountAddress: requestAccount,
|
|
118
121
|
chainName: requestChainName,
|
|
119
122
|
environmentId,
|
|
123
|
+
forceRefresh,
|
|
120
124
|
includeNative: includeNativeBalance,
|
|
121
125
|
includePrices: includeFiat,
|
|
122
126
|
networkId: chainName === ChainEnum.Evm ? Number(requestNetwork) : 0,
|
|
123
127
|
})
|
|
124
128
|
.then((response) => {
|
|
125
129
|
if (response) {
|
|
126
|
-
|
|
127
|
-
setError(undefined);
|
|
130
|
+
setTokenBalances({ error: undefined, tokenBalances: response });
|
|
128
131
|
}
|
|
129
132
|
})
|
|
130
133
|
.catch((e) => {
|
|
131
134
|
const errorMessage = (e === null || e === void 0 ? void 0 : e.code) === 429
|
|
132
135
|
? 'Too many requests fetching balances'
|
|
133
136
|
: e === null || e === void 0 ? void 0 : e.message;
|
|
134
|
-
|
|
137
|
+
setTokenBalances({ error: errorMessage });
|
|
135
138
|
})
|
|
136
139
|
.finally(() => {
|
|
137
|
-
|
|
140
|
+
setTokenBalances({ isLoading: false });
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
143
|
}), [
|
|
@@ -145,6 +148,7 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm
|
|
|
145
148
|
requestNetwork,
|
|
146
149
|
environmentId,
|
|
147
150
|
]);
|
|
151
|
+
useInternalDynamicEvents('tokenBalancesChanged', () => fetchAccountBalances(true));
|
|
148
152
|
useEffect(() => {
|
|
149
153
|
fetchAccountBalances();
|
|
150
154
|
}, [requestAccount, requestNetwork]);
|
|
@@ -153,7 +157,13 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm
|
|
|
153
157
|
const lowerTokenAddresses = tokenAddresses === null || tokenAddresses === void 0 ? void 0 : tokenAddresses.map((address) => address.toLowerCase());
|
|
154
158
|
tokenBalances = tokenBalancesData === null || tokenBalancesData === void 0 ? void 0 : tokenBalancesData.filter((token) => lowerTokenAddresses === null || lowerTokenAddresses === void 0 ? void 0 : lowerTokenAddresses.includes(token.address.toLowerCase()));
|
|
155
159
|
}
|
|
156
|
-
return {
|
|
160
|
+
return {
|
|
161
|
+
error,
|
|
162
|
+
fetchAccountBalances,
|
|
163
|
+
isError: Boolean(error),
|
|
164
|
+
isLoading,
|
|
165
|
+
tokenBalances,
|
|
166
|
+
};
|
|
157
167
|
};
|
|
158
168
|
|
|
159
169
|
export { useTokenBalances };
|
|
@@ -166,7 +166,8 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
166
166
|
});
|
|
167
167
|
const handleAuthError = (error, { options = {}, onError, }) => {
|
|
168
168
|
var _a;
|
|
169
|
-
if (error instanceof utils.MfaInvalidOtpError
|
|
169
|
+
if (error instanceof utils.MfaInvalidOtpError ||
|
|
170
|
+
error instanceof utils.MfaRateLimitedError) {
|
|
170
171
|
throw error;
|
|
171
172
|
}
|
|
172
173
|
// these get caught in onboarding form and handled there
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
-
import { DynamicError, MfaInvalidOtpError, EmailAlreadyExistsError, CustomFieldNotUniqueError, UsernameAlreadyExistsError, TooManyEmailVerificationsError, InvalidPhoneNumberError, NoAccessError, AccountExistsError, SandboxMaximumThresholdReachedError, UserHasAccountWithEmailError, sleep } from '@dynamic-labs/utils';
|
|
3
|
+
import { DynamicError, MfaInvalidOtpError, MfaRateLimitedError, EmailAlreadyExistsError, CustomFieldNotUniqueError, UsernameAlreadyExistsError, TooManyEmailVerificationsError, InvalidPhoneNumberError, NoAccessError, AccountExistsError, SandboxMaximumThresholdReachedError, UserHasAccountWithEmailError, sleep } from '@dynamic-labs/utils';
|
|
4
4
|
import { MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';
|
|
5
5
|
import { useAccountExistsContext } from '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
6
6
|
import 'react';
|
|
@@ -162,7 +162,8 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
162
162
|
});
|
|
163
163
|
const handleAuthError = (error, { options = {}, onError, }) => {
|
|
164
164
|
var _a;
|
|
165
|
-
if (error instanceof MfaInvalidOtpError
|
|
165
|
+
if (error instanceof MfaInvalidOtpError ||
|
|
166
|
+
error instanceof MfaRateLimitedError) {
|
|
166
167
|
throw error;
|
|
167
168
|
}
|
|
168
169
|
// these get caught in onboarding form and handled there
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useWalletOptions } from './useWalletOptions';
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var React = require('react');
|
|
7
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
9
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
10
|
var utils = require('@dynamic-labs/utils');
|
|
10
|
-
require('react');
|
|
11
11
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
12
12
|
require('@dynamic-labs/sdk-api-core');
|
|
13
13
|
require('../../../shared/logger.cjs');
|
|
@@ -93,16 +93,42 @@ require('../../../context/ConnectWithOtpContext/constants.cjs');
|
|
|
93
93
|
require('../../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
94
94
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
95
95
|
|
|
96
|
-
const
|
|
96
|
+
const embeddedWalletsKeys = [
|
|
97
|
+
'magicemailotp',
|
|
98
|
+
'magiclink',
|
|
99
|
+
'magicsocial',
|
|
100
|
+
'turnkey',
|
|
101
|
+
'turnkeyhd',
|
|
102
|
+
'coinbasempc',
|
|
103
|
+
'zerodev',
|
|
104
|
+
];
|
|
105
|
+
const useWalletOptions = () => {
|
|
97
106
|
const { walletConnectorOptions, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
98
107
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
99
108
|
const { setView } = ViewContext.useViewContext();
|
|
100
109
|
const { navigateToWalletGroup } = WalletGroupContext.useWalletGroupContext();
|
|
101
110
|
const { handleWalletItemClick } = useWalletItemActions.useWalletItemActions();
|
|
111
|
+
const walletOptions = React.useMemo(() => {
|
|
112
|
+
var _a;
|
|
113
|
+
return (_a = walletConnectorOptions === null || walletConnectorOptions === void 0 ? void 0 : walletConnectorOptions.filter((option) => !embeddedWalletsKeys.includes(option.walletConnector.key)).map((option) => {
|
|
114
|
+
const groupName = option.group
|
|
115
|
+
? walletBook.getWalletGroup(walletBook$1, option.group).name
|
|
116
|
+
: undefined;
|
|
117
|
+
return {
|
|
118
|
+
group: option.group,
|
|
119
|
+
groupName,
|
|
120
|
+
key: option.walletConnector.key,
|
|
121
|
+
name: option.name,
|
|
122
|
+
};
|
|
123
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
124
|
+
}, [walletBook$1, walletConnectorOptions]);
|
|
102
125
|
const selectWalletOption = (walletKey) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
103
126
|
const group = groupWalletOptions.groupWalletOptions(walletBook$1, walletConnectorOptions);
|
|
104
127
|
const walletOption = group.find((wallet) => wallet.key === walletKey);
|
|
105
|
-
logVerboseTroubleshootingMessage.logVerboseTroubleshootingMessage('[
|
|
128
|
+
logVerboseTroubleshootingMessage.logVerboseTroubleshootingMessage('[useWalletOptions] selectWalletOption', {
|
|
129
|
+
walletKey,
|
|
130
|
+
walletOption: walletOption === null || walletOption === void 0 ? void 0 : walletOption.key,
|
|
131
|
+
});
|
|
106
132
|
if (!walletOption) {
|
|
107
133
|
throw new utils.DynamicError('Invalid wallet option key provided.');
|
|
108
134
|
}
|
|
@@ -123,7 +149,8 @@ const useSelectWalletOption = () => {
|
|
|
123
149
|
});
|
|
124
150
|
return {
|
|
125
151
|
selectWalletOption,
|
|
152
|
+
walletOptions,
|
|
126
153
|
};
|
|
127
154
|
};
|
|
128
155
|
|
|
129
|
-
exports.
|
|
156
|
+
exports.useWalletOptions = useWalletOptions;
|