@dynamic-labs/sdk-react-core 4.48.2 → 4.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/index.cjs +6 -4
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +10 -0
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +10 -0
- package/src/lib/context/OnrampContext/OnrampContext.cjs +4 -2
- package/src/lib/context/OnrampContext/OnrampContext.d.ts +1 -0
- package/src/lib/context/OnrampContext/OnrampContext.js +4 -2
- package/src/lib/context/OnrampContext/types.d.ts +1 -0
- package/src/lib/context/OnrampContext/utils/getOnrampProviders.cjs +2 -1
- package/src/lib/context/OnrampContext/utils/getOnrampProviders.d.ts +1 -1
- package/src/lib/context/OnrampContext/utils/getOnrampProviders.js +2 -1
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.cjs +38 -6
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.d.ts +2 -2
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.js +39 -8
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +108 -16
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +108 -16
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/onramp/onramp.cjs +2 -1
- package/src/lib/data/api/onramp/onramp.d.ts +2 -1
- package/src/lib/data/api/onramp/onramp.js +2 -1
- package/src/lib/events/dynamicEvents.cjs +2 -0
- package/src/lib/events/dynamicEvents.d.ts +1 -1
- package/src/lib/events/dynamicEvents.js +2 -0
- package/src/lib/shared/assets/backup-waas.cjs +4 -4
- package/src/lib/shared/assets/backup-waas.js +4 -4
- package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +4 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +13 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +13 -0
- package/src/lib/utils/functions/generateMessages/index.cjs +11 -2
- package/src/lib/utils/functions/generateMessages/index.js +11 -2
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.cjs +27 -1
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.js +27 -1
- package/src/lib/utils/functions/index.d.ts +0 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.cjs +5 -1
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.js +5 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +35 -5
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +35 -5
- package/src/lib/utils/hooks/useFunding/useFunding.d.ts +1 -0
- package/src/lib/utils/hooks/useOnramp/useOnramp.cjs +14 -29
- package/src/lib/utils/hooks/useOnramp/useOnramp.d.ts +14 -18
- package/src/lib/utils/hooks/useOnramp/useOnramp.js +14 -29
- package/src/lib/utils/hooks/usePhantomRedirectEvents/index.d.ts +1 -0
- package/src/lib/utils/hooks/usePhantomRedirectEvents/usePhantomRedirectEvents.cjs +65 -0
- package/src/lib/utils/hooks/usePhantomRedirectEvents/usePhantomRedirectEvents.d.ts +36 -0
- package/src/lib/utils/hooks/usePhantomRedirectEvents/usePhantomRedirectEvents.js +61 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +17 -14
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +17 -14
- package/src/lib/utils/hooks/useSignInWithPasskey/useSignInWithPasskey.cjs +106 -1
- package/src/lib/utils/hooks/useSignInWithPasskey/useSignInWithPasskey.js +106 -1
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.cjs +1 -1
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.js +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +1 -1
- package/src/lib/utils/hooks/useWalletBackup/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.cjs +339 -0
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.d.ts +49 -0
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.js +332 -0
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +2 -2
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +2 -2
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +1 -0
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +1 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +13 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +14 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +9 -6
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +9 -6
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.cjs +13 -0
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.js +14 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
- package/src/lib/views/viewToComponentMap.cjs +15 -3
- package/src/lib/views/viewToComponentMap.d.ts +6 -0
- package/src/lib/views/viewToComponentMap.js +15 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +97 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +97 -3
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.cjs +16 -14
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.js +16 -14
- package/src/lib/widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs +3 -1
- package/src/lib/widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js +3 -1
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/BackupStepper.cjs +37 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/BackupStepper.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/BackupStepper.js +33 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupCloudProviderView.cjs +49 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupCloudProviderView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupCloudProviderView.js +45 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupDownloadView.cjs +53 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupDownloadView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupDownloadView.js +49 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupInfoView.cjs +9 -18
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupInfoView.js +10 -19
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupProgressView.cjs +52 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupProgressView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupProgressView.js +48 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupSuccessView.cjs +131 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupSuccessView.d.ts +5 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupSuccessView.js +127 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.cjs +45 -104
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.js +47 -106
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/index.d.ts +6 -1
- package/src/lib/utils/functions/downloadFile/downloadFile.cjs +0 -15
- package/src/lib/utils/functions/downloadFile/downloadFile.d.ts +0 -1
- package/src/lib/utils/functions/downloadFile/downloadFile.js +0 -11
- package/src/lib/utils/functions/downloadFile/index.d.ts +0 -1
|
@@ -15,7 +15,7 @@ require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
|
15
15
|
require('@dynamic-labs/iconic');
|
|
16
16
|
require('react/jsx-runtime');
|
|
17
17
|
var ViewContext = require('../ViewContext/ViewContext.cjs');
|
|
18
|
-
require('../../shared/logger.cjs');
|
|
18
|
+
var logger = require('../../shared/logger.cjs');
|
|
19
19
|
require('@dynamic-labs/wallet-book');
|
|
20
20
|
require('../../utils/constants/colors.cjs');
|
|
21
21
|
require('../../utils/constants/values.cjs');
|
|
@@ -124,12 +124,19 @@ const useResponseHandlers = () => {
|
|
|
124
124
|
.map(({ walletConnector }) => walletConnector)
|
|
125
125
|
.find(walletConnectorCore.isPhantomRedirectConnector);
|
|
126
126
|
const handleConnectResponse = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] called');
|
|
127
128
|
if (!phantomRedirectConnector) {
|
|
129
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] no phantomRedirectConnector');
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
130
132
|
// this completes the connection step
|
|
133
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] calling getSession');
|
|
131
134
|
yield phantomRedirectConnector.getSession();
|
|
135
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] getSession complete, calling connectWallet');
|
|
132
136
|
const connectResult = yield connectWallet(phantomRedirectConnector);
|
|
137
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] connectWallet result', {
|
|
138
|
+
connectResult,
|
|
139
|
+
});
|
|
133
140
|
// Check if we have a connection type
|
|
134
141
|
const connectionType = utils.StorageService.getItem(utils.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY);
|
|
135
142
|
// If this is an external wallet funding connection, then we need to
|
|
@@ -175,32 +182,74 @@ const useResponseHandlers = () => {
|
|
|
175
182
|
]);
|
|
176
183
|
const completeWalletTransfer = useTransferWallet.useTransferWallet();
|
|
177
184
|
const handleUserResponse = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
185
|
+
var _a, _b, _c, _d;
|
|
186
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] called');
|
|
178
187
|
if (!phantomRedirectConnector) {
|
|
188
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] no phantomRedirectConnector');
|
|
179
189
|
return;
|
|
180
190
|
}
|
|
181
191
|
setSelectedWalletConnectorKey('phantom');
|
|
182
192
|
const [address] = yield phantomRedirectConnector.getConnectedAccounts();
|
|
193
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] got address', {
|
|
194
|
+
address,
|
|
195
|
+
});
|
|
183
196
|
const method = phantomRedirectConnector.consumeMethod();
|
|
197
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] consumed method', {
|
|
198
|
+
method,
|
|
199
|
+
});
|
|
184
200
|
switch (method) {
|
|
185
201
|
case 'signAndSendTransaction': {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
202
|
+
// Phantom redirect doesn't support signAndSendTransaction natively,
|
|
203
|
+
// so we extract the signed transaction and send it ourselves
|
|
204
|
+
const signAndSendRequestId = (_a = phantomRedirectConnector.consumeRequestId) === null || _a === void 0 ? void 0 : _a.call(phantomRedirectConnector);
|
|
205
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] handling signAndSendTransaction');
|
|
206
|
+
try {
|
|
207
|
+
const signature = yield phantomRedirectConnector.extractAndSendTransaction();
|
|
208
|
+
phantomRedirectConnector.emit('signAndSendTransaction', {
|
|
209
|
+
requestId: signAndSendRequestId,
|
|
210
|
+
signature,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
logger.logger.error('[PhantomRedirect handleUserResponse] Failed to send transaction', { error });
|
|
215
|
+
phantomRedirectConnector.emit('signAndSendTransaction', {
|
|
216
|
+
errorCode: 'SEND_FAILED',
|
|
217
|
+
errorMessage: error instanceof Error
|
|
218
|
+
? error.message
|
|
219
|
+
: 'Failed to send transaction',
|
|
220
|
+
requestId: signAndSendRequestId,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
190
223
|
break;
|
|
191
224
|
}
|
|
192
|
-
case 'signAllTransactions':
|
|
225
|
+
case 'signAllTransactions': {
|
|
226
|
+
const signAllRequestId = (_b = phantomRedirectConnector.consumeRequestId) === null || _b === void 0 ? void 0 : _b.call(phantomRedirectConnector);
|
|
227
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] handling signAllTransactions');
|
|
193
228
|
phantomRedirectConnector.emit('signAllTransactions', {
|
|
229
|
+
requestId: signAllRequestId,
|
|
194
230
|
transactions: phantomRedirectConnector.extractTransactions(),
|
|
195
231
|
});
|
|
196
232
|
break;
|
|
197
|
-
|
|
233
|
+
}
|
|
234
|
+
case 'signTransaction': {
|
|
235
|
+
const requestId = (_c = phantomRedirectConnector.consumeRequestId) === null || _c === void 0 ? void 0 : _c.call(phantomRedirectConnector);
|
|
236
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] handling signTransaction');
|
|
198
237
|
phantomRedirectConnector.emit('signTransaction', {
|
|
238
|
+
requestId,
|
|
199
239
|
transaction: phantomRedirectConnector.extractTransaction(),
|
|
200
240
|
});
|
|
201
241
|
break;
|
|
242
|
+
}
|
|
202
243
|
case 'signMessage': {
|
|
244
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] handling signMessage response');
|
|
203
245
|
const { signature, message } = phantomRedirectConnector.extractSignature();
|
|
246
|
+
logger.logger.debug('[PhantomRedirect handleUserResponse] extracted signature and message', {
|
|
247
|
+
message,
|
|
248
|
+
messageLength: message === null || message === void 0 ? void 0 : message.length,
|
|
249
|
+
messagePreview: message === null || message === void 0 ? void 0 : message.substring(0, 200),
|
|
250
|
+
signature,
|
|
251
|
+
signatureLength: signature === null || signature === void 0 ? void 0 : signature.length,
|
|
252
|
+
});
|
|
204
253
|
const signatureState = utils.StorageService.getItem(localStorage.PHANTOM_SIGNATURE_STATE);
|
|
205
254
|
utils.StorageService.removeItem(localStorage.PHANTOM_SIGNATURE_STATE);
|
|
206
255
|
if ((signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType) === 'awaiting_transfer') {
|
|
@@ -208,6 +257,12 @@ const useResponseHandlers = () => {
|
|
|
208
257
|
appName,
|
|
209
258
|
siweStatement,
|
|
210
259
|
});
|
|
260
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] completeWalletTransfer', {
|
|
261
|
+
messageToSignOverride: message,
|
|
262
|
+
overrideSiweStatement: siweStatementToUse,
|
|
263
|
+
publicWalletAddress: address,
|
|
264
|
+
signedMessageOverride: signature,
|
|
265
|
+
});
|
|
211
266
|
yield completeWalletTransfer({
|
|
212
267
|
messageToSignOverride: message,
|
|
213
268
|
overrideSiweStatement: siweStatementToUse,
|
|
@@ -219,17 +274,45 @@ const useResponseHandlers = () => {
|
|
|
219
274
|
}
|
|
220
275
|
else if ((signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType) === 'awaiting_verification' ||
|
|
221
276
|
!user) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
277
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] calling verifyWallet', {
|
|
278
|
+
address,
|
|
279
|
+
captchaTokenPresent: Boolean(getCaptchaToken()),
|
|
280
|
+
message,
|
|
281
|
+
messageLength: message === null || message === void 0 ? void 0 : message.length,
|
|
282
|
+
signature,
|
|
283
|
+
signatureLength: signature === null || signature === void 0 ? void 0 : signature.length,
|
|
284
|
+
user: Boolean(user),
|
|
285
|
+
verificationType: signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType,
|
|
229
286
|
});
|
|
287
|
+
pushView('wallet-redirect-view');
|
|
288
|
+
try {
|
|
289
|
+
yield verifyWallet({
|
|
290
|
+
captchaToken: getCaptchaToken(),
|
|
291
|
+
messageToSignOverride: message,
|
|
292
|
+
publicWalletAddress: address,
|
|
293
|
+
signedMessageOverride: signature,
|
|
294
|
+
walletConnector: phantomRedirectConnector,
|
|
295
|
+
});
|
|
296
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] verifyWallet completed successfully');
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] verifyWallet threw error', { error });
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
230
302
|
}
|
|
231
303
|
else {
|
|
304
|
+
// Post-auth sign: emit the signMessage event with the requestId and message
|
|
305
|
+
// so the listener from signMessage() can match and self-cleanup
|
|
306
|
+
const requestId = (_d = phantomRedirectConnector.consumeRequestId) === null || _d === void 0 ? void 0 : _d.call(phantomRedirectConnector);
|
|
307
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] emitting signMessage event (post-auth sign)', {
|
|
308
|
+
message,
|
|
309
|
+
requestId,
|
|
310
|
+
signature,
|
|
311
|
+
signatureLength: signature === null || signature === void 0 ? void 0 : signature.length,
|
|
312
|
+
});
|
|
232
313
|
phantomRedirectConnector.emit('signMessage', {
|
|
314
|
+
message,
|
|
315
|
+
requestId,
|
|
233
316
|
signature,
|
|
234
317
|
});
|
|
235
318
|
}
|
|
@@ -249,14 +332,23 @@ const useResponseHandlers = () => {
|
|
|
249
332
|
]);
|
|
250
333
|
const handleErrorResponse = React.useCallback((params) => {
|
|
251
334
|
var _a;
|
|
252
|
-
|
|
335
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] called', {
|
|
336
|
+
errorCode: params.get('errorCode'),
|
|
337
|
+
errorMessage: params.get('errorMessage'),
|
|
338
|
+
});
|
|
339
|
+
if (!phantomRedirectConnector) {
|
|
340
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] no phantomRedirectConnector');
|
|
253
341
|
return;
|
|
342
|
+
}
|
|
254
343
|
const errorCode = params.get('errorCode');
|
|
255
344
|
const errorMessage = (_a = params.get('errorMessage')) !== null && _a !== void 0 ? _a : undefined;
|
|
256
|
-
if (!errorCode)
|
|
345
|
+
if (!errorCode) {
|
|
346
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] no errorCode');
|
|
257
347
|
return;
|
|
348
|
+
}
|
|
258
349
|
setErrorMessage(errorCode);
|
|
259
350
|
const method = phantomRedirectConnector.consumeMethod();
|
|
351
|
+
logger.logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] consumed method, emitting error', { errorCode, errorMessage, method });
|
|
260
352
|
switch (method) {
|
|
261
353
|
case 'signAndSendTransaction':
|
|
262
354
|
phantomRedirectConnector.emit('signAndSendTransaction', {
|
|
@@ -11,7 +11,7 @@ import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
|
11
11
|
import '@dynamic-labs/iconic';
|
|
12
12
|
import 'react/jsx-runtime';
|
|
13
13
|
import { useViewContext } from '../ViewContext/ViewContext.js';
|
|
14
|
-
import '../../shared/logger.js';
|
|
14
|
+
import { logger } from '../../shared/logger.js';
|
|
15
15
|
import '@dynamic-labs/wallet-book';
|
|
16
16
|
import '../../utils/constants/colors.js';
|
|
17
17
|
import '../../utils/constants/values.js';
|
|
@@ -120,12 +120,19 @@ const useResponseHandlers = () => {
|
|
|
120
120
|
.map(({ walletConnector }) => walletConnector)
|
|
121
121
|
.find(isPhantomRedirectConnector);
|
|
122
122
|
const handleConnectResponse = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] called');
|
|
123
124
|
if (!phantomRedirectConnector) {
|
|
125
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] no phantomRedirectConnector');
|
|
124
126
|
return;
|
|
125
127
|
}
|
|
126
128
|
// this completes the connection step
|
|
129
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] calling getSession');
|
|
127
130
|
yield phantomRedirectConnector.getSession();
|
|
131
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] getSession complete, calling connectWallet');
|
|
128
132
|
const connectResult = yield connectWallet(phantomRedirectConnector);
|
|
133
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleConnectResponse] connectWallet result', {
|
|
134
|
+
connectResult,
|
|
135
|
+
});
|
|
129
136
|
// Check if we have a connection type
|
|
130
137
|
const connectionType = StorageService.getItem(PHANTOM_REDIRECT_CONNECTION_TYPE_KEY);
|
|
131
138
|
// If this is an external wallet funding connection, then we need to
|
|
@@ -171,32 +178,74 @@ const useResponseHandlers = () => {
|
|
|
171
178
|
]);
|
|
172
179
|
const completeWalletTransfer = useTransferWallet();
|
|
173
180
|
const handleUserResponse = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
181
|
+
var _a, _b, _c, _d;
|
|
182
|
+
logger.debug('[PhantomRedirect handleUserResponse] called');
|
|
174
183
|
if (!phantomRedirectConnector) {
|
|
184
|
+
logger.debug('[PhantomRedirect handleUserResponse] no phantomRedirectConnector');
|
|
175
185
|
return;
|
|
176
186
|
}
|
|
177
187
|
setSelectedWalletConnectorKey('phantom');
|
|
178
188
|
const [address] = yield phantomRedirectConnector.getConnectedAccounts();
|
|
189
|
+
logger.debug('[PhantomRedirect handleUserResponse] got address', {
|
|
190
|
+
address,
|
|
191
|
+
});
|
|
179
192
|
const method = phantomRedirectConnector.consumeMethod();
|
|
193
|
+
logger.debug('[PhantomRedirect handleUserResponse] consumed method', {
|
|
194
|
+
method,
|
|
195
|
+
});
|
|
180
196
|
switch (method) {
|
|
181
197
|
case 'signAndSendTransaction': {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
198
|
+
// Phantom redirect doesn't support signAndSendTransaction natively,
|
|
199
|
+
// so we extract the signed transaction and send it ourselves
|
|
200
|
+
const signAndSendRequestId = (_a = phantomRedirectConnector.consumeRequestId) === null || _a === void 0 ? void 0 : _a.call(phantomRedirectConnector);
|
|
201
|
+
logger.debug('[PhantomRedirect handleUserResponse] handling signAndSendTransaction');
|
|
202
|
+
try {
|
|
203
|
+
const signature = yield phantomRedirectConnector.extractAndSendTransaction();
|
|
204
|
+
phantomRedirectConnector.emit('signAndSendTransaction', {
|
|
205
|
+
requestId: signAndSendRequestId,
|
|
206
|
+
signature,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
logger.error('[PhantomRedirect handleUserResponse] Failed to send transaction', { error });
|
|
211
|
+
phantomRedirectConnector.emit('signAndSendTransaction', {
|
|
212
|
+
errorCode: 'SEND_FAILED',
|
|
213
|
+
errorMessage: error instanceof Error
|
|
214
|
+
? error.message
|
|
215
|
+
: 'Failed to send transaction',
|
|
216
|
+
requestId: signAndSendRequestId,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
186
219
|
break;
|
|
187
220
|
}
|
|
188
|
-
case 'signAllTransactions':
|
|
221
|
+
case 'signAllTransactions': {
|
|
222
|
+
const signAllRequestId = (_b = phantomRedirectConnector.consumeRequestId) === null || _b === void 0 ? void 0 : _b.call(phantomRedirectConnector);
|
|
223
|
+
logger.debug('[PhantomRedirect handleUserResponse] handling signAllTransactions');
|
|
189
224
|
phantomRedirectConnector.emit('signAllTransactions', {
|
|
225
|
+
requestId: signAllRequestId,
|
|
190
226
|
transactions: phantomRedirectConnector.extractTransactions(),
|
|
191
227
|
});
|
|
192
228
|
break;
|
|
193
|
-
|
|
229
|
+
}
|
|
230
|
+
case 'signTransaction': {
|
|
231
|
+
const requestId = (_c = phantomRedirectConnector.consumeRequestId) === null || _c === void 0 ? void 0 : _c.call(phantomRedirectConnector);
|
|
232
|
+
logger.debug('[PhantomRedirect handleUserResponse] handling signTransaction');
|
|
194
233
|
phantomRedirectConnector.emit('signTransaction', {
|
|
234
|
+
requestId,
|
|
195
235
|
transaction: phantomRedirectConnector.extractTransaction(),
|
|
196
236
|
});
|
|
197
237
|
break;
|
|
238
|
+
}
|
|
198
239
|
case 'signMessage': {
|
|
240
|
+
logger.debug('[PhantomRedirect handleUserResponse] handling signMessage response');
|
|
199
241
|
const { signature, message } = phantomRedirectConnector.extractSignature();
|
|
242
|
+
logger.debug('[PhantomRedirect handleUserResponse] extracted signature and message', {
|
|
243
|
+
message,
|
|
244
|
+
messageLength: message === null || message === void 0 ? void 0 : message.length,
|
|
245
|
+
messagePreview: message === null || message === void 0 ? void 0 : message.substring(0, 200),
|
|
246
|
+
signature,
|
|
247
|
+
signatureLength: signature === null || signature === void 0 ? void 0 : signature.length,
|
|
248
|
+
});
|
|
200
249
|
const signatureState = StorageService.getItem(PHANTOM_SIGNATURE_STATE);
|
|
201
250
|
StorageService.removeItem(PHANTOM_SIGNATURE_STATE);
|
|
202
251
|
if ((signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType) === 'awaiting_transfer') {
|
|
@@ -204,6 +253,12 @@ const useResponseHandlers = () => {
|
|
|
204
253
|
appName,
|
|
205
254
|
siweStatement,
|
|
206
255
|
});
|
|
256
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] completeWalletTransfer', {
|
|
257
|
+
messageToSignOverride: message,
|
|
258
|
+
overrideSiweStatement: siweStatementToUse,
|
|
259
|
+
publicWalletAddress: address,
|
|
260
|
+
signedMessageOverride: signature,
|
|
261
|
+
});
|
|
207
262
|
yield completeWalletTransfer({
|
|
208
263
|
messageToSignOverride: message,
|
|
209
264
|
overrideSiweStatement: siweStatementToUse,
|
|
@@ -215,17 +270,45 @@ const useResponseHandlers = () => {
|
|
|
215
270
|
}
|
|
216
271
|
else if ((signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType) === 'awaiting_verification' ||
|
|
217
272
|
!user) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
273
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] calling verifyWallet', {
|
|
274
|
+
address,
|
|
275
|
+
captchaTokenPresent: Boolean(getCaptchaToken()),
|
|
276
|
+
message,
|
|
277
|
+
messageLength: message === null || message === void 0 ? void 0 : message.length,
|
|
278
|
+
signature,
|
|
279
|
+
signatureLength: signature === null || signature === void 0 ? void 0 : signature.length,
|
|
280
|
+
user: Boolean(user),
|
|
281
|
+
verificationType: signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType,
|
|
225
282
|
});
|
|
283
|
+
pushView('wallet-redirect-view');
|
|
284
|
+
try {
|
|
285
|
+
yield verifyWallet({
|
|
286
|
+
captchaToken: getCaptchaToken(),
|
|
287
|
+
messageToSignOverride: message,
|
|
288
|
+
publicWalletAddress: address,
|
|
289
|
+
signedMessageOverride: signature,
|
|
290
|
+
walletConnector: phantomRedirectConnector,
|
|
291
|
+
});
|
|
292
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] verifyWallet completed successfully');
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] verifyWallet threw error', { error });
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
226
298
|
}
|
|
227
299
|
else {
|
|
300
|
+
// Post-auth sign: emit the signMessage event with the requestId and message
|
|
301
|
+
// so the listener from signMessage() can match and self-cleanup
|
|
302
|
+
const requestId = (_d = phantomRedirectConnector.consumeRequestId) === null || _d === void 0 ? void 0 : _d.call(phantomRedirectConnector);
|
|
303
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleUserResponse] emitting signMessage event (post-auth sign)', {
|
|
304
|
+
message,
|
|
305
|
+
requestId,
|
|
306
|
+
signature,
|
|
307
|
+
signatureLength: signature === null || signature === void 0 ? void 0 : signature.length,
|
|
308
|
+
});
|
|
228
309
|
phantomRedirectConnector.emit('signMessage', {
|
|
310
|
+
message,
|
|
311
|
+
requestId,
|
|
229
312
|
signature,
|
|
230
313
|
});
|
|
231
314
|
}
|
|
@@ -245,14 +328,23 @@ const useResponseHandlers = () => {
|
|
|
245
328
|
]);
|
|
246
329
|
const handleErrorResponse = useCallback((params) => {
|
|
247
330
|
var _a;
|
|
248
|
-
|
|
331
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] called', {
|
|
332
|
+
errorCode: params.get('errorCode'),
|
|
333
|
+
errorMessage: params.get('errorMessage'),
|
|
334
|
+
});
|
|
335
|
+
if (!phantomRedirectConnector) {
|
|
336
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] no phantomRedirectConnector');
|
|
249
337
|
return;
|
|
338
|
+
}
|
|
250
339
|
const errorCode = params.get('errorCode');
|
|
251
340
|
const errorMessage = (_a = params.get('errorMessage')) !== null && _a !== void 0 ? _a : undefined;
|
|
252
|
-
if (!errorCode)
|
|
341
|
+
if (!errorCode) {
|
|
342
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] no errorCode');
|
|
253
343
|
return;
|
|
344
|
+
}
|
|
254
345
|
setErrorMessage(errorCode);
|
|
255
346
|
const method = phantomRedirectConnector.consumeMethod();
|
|
347
|
+
logger.logVerboseTroubleshootingMessage('[PhantomRedirect handleErrorResponse] consumed method, emitting error', { errorCode, errorMessage, method });
|
|
256
348
|
switch (method) {
|
|
257
349
|
case 'signAndSendTransaction':
|
|
258
350
|
phantomRedirectConnector.emit('signAndSendTransaction', {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
2
|
import { viewToComponentMap } from '../../../views/viewToComponentMap';
|
|
3
|
-
export type ViewType = 'access-blocked' | 'account-upgraded' | 'backup-unsuccessful' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'unified-wallet-exchange-list' | 'external-funding-exchange-list' | 'external-funding-wallet-list' | 'mfa-exchange-view' | 'exchange-whitelist-warning' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'duplicate-wallet' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'passkey-setup' | 'passkey-confirm' | 'embedded-delete-view' | 'embedded-reveal-view' | 'export-shares-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'wallet-upgrade-flow-view' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists' | 'user-delete-account' | 'waas-upgrade-view' | 'wallet-delegation-view';
|
|
3
|
+
export type ViewType = 'access-blocked' | 'account-upgraded' | 'backup-unsuccessful' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'unified-wallet-exchange-list' | 'external-funding-exchange-list' | 'external-funding-wallet-list' | 'mfa-exchange-view' | 'exchange-whitelist-warning' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'duplicate-wallet' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'passkey-setup' | 'passkey-confirm' | 'embedded-delete-view' | 'embedded-reveal-view' | 'export-shares-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'wallet-upgrade-flow-view' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists' | 'user-delete-account' | 'waas-upgrade-view' | 'wallet-delegation-view' | 'waas-backup-view' | 'waas-backup-info-view' | 'waas-backup-cloud-provider-view' | 'waas-backup-download-view' | 'waas-backup-progress-view' | 'waas-backup-success-view';
|
|
4
4
|
export type ViewMapConstraint = Record<ViewType, FC<any>>;
|
|
5
5
|
export type ViewMap = typeof viewToComponentMap;
|
|
6
6
|
export type ViewState<T extends ViewType> = {
|
|
@@ -6,12 +6,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var api = require('../api.cjs');
|
|
8
8
|
|
|
9
|
-
const getOnrampProviders = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ chain, environmentId, networkId, token, tokenAmount, walletAddress, currency, includeDisabled, }) {
|
|
9
|
+
const getOnrampProviders = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ chain, environmentId, networkId, token, tokenAmount, walletAddress, currency, includeDisabled, merchantName, }) {
|
|
10
10
|
const { onramps } = yield api.sdkApi().getSupportedOnramps({
|
|
11
11
|
chain,
|
|
12
12
|
currency,
|
|
13
13
|
environmentId,
|
|
14
14
|
includeDisabled,
|
|
15
|
+
merchantName,
|
|
15
16
|
networkId: networkId ? String(networkId) : undefined,
|
|
16
17
|
token,
|
|
17
18
|
tokenAmount,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RampConfiguration } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
export declare const getOnrampProviders: ({ chain, environmentId, networkId, token, tokenAmount, walletAddress, currency, includeDisabled, }: {
|
|
2
|
+
export declare const getOnrampProviders: ({ chain, environmentId, networkId, token, tokenAmount, walletAddress, currency, includeDisabled, merchantName, }: {
|
|
3
3
|
chain: string;
|
|
4
4
|
environmentId: string;
|
|
5
5
|
networkId?: string | number;
|
|
@@ -8,4 +8,5 @@ export declare const getOnrampProviders: ({ chain, environmentId, networkId, tok
|
|
|
8
8
|
walletAddress: string;
|
|
9
9
|
currency?: string;
|
|
10
10
|
includeDisabled?: boolean;
|
|
11
|
+
merchantName?: string;
|
|
11
12
|
}) => Promise<RampConfiguration[]>;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { sdkApi } from '../api.js';
|
|
4
4
|
|
|
5
|
-
const getOnrampProviders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ chain, environmentId, networkId, token, tokenAmount, walletAddress, currency, includeDisabled, }) {
|
|
5
|
+
const getOnrampProviders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ chain, environmentId, networkId, token, tokenAmount, walletAddress, currency, includeDisabled, merchantName, }) {
|
|
6
6
|
const { onramps } = yield sdkApi().getSupportedOnramps({
|
|
7
7
|
chain,
|
|
8
8
|
currency,
|
|
9
9
|
environmentId,
|
|
10
10
|
includeDisabled,
|
|
11
|
+
merchantName,
|
|
11
12
|
networkId: networkId ? String(networkId) : undefined,
|
|
12
13
|
token,
|
|
13
14
|
tokenAmount,
|
|
@@ -31,6 +31,8 @@ const externalEvents = [
|
|
|
31
31
|
'walletConnectedForFunding',
|
|
32
32
|
'walletTabSelected',
|
|
33
33
|
'walletConnectionFailed',
|
|
34
|
+
'embeddedWalletRevealCompleted',
|
|
35
|
+
'embeddedWalletRevealFailed',
|
|
34
36
|
];
|
|
35
37
|
// Full internal event emitter
|
|
36
38
|
const dynamicEvents = new EventEmitter__default["default"]();
|
|
@@ -14,7 +14,7 @@ import { WalletEvents } from './wallets';
|
|
|
14
14
|
export type DynamicEvents = AuthEvents & UIEvents & OTPEvents & WalletEvents & PasskeyEvents & SocialEvents & EmbeddedWalletEvents & MultiWalletInternalEvents & TokenBalancesEvents & UserEvents & FundingEvents;
|
|
15
15
|
type PublicDynamicEvents = Pick<DynamicEvents, typeof externalEvents[number]>;
|
|
16
16
|
/** Which events are accessible by our clients */
|
|
17
|
-
export declare const externalEvents: ("authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "walletConnectionQrCodeReady" | "embeddedWalletCreated" | "walletConnectedForFunding")[];
|
|
17
|
+
export declare const externalEvents: ("authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "walletConnectionQrCodeReady" | "embeddedWalletCreated" | "embeddedWalletRevealCompleted" | "embeddedWalletRevealFailed" | "walletConnectedForFunding")[];
|
|
18
18
|
export declare const dynamicEvents: EventEmitter<DynamicEvents, any>;
|
|
19
19
|
export declare const publicDynamicEvents: EventEmitter<PublicDynamicEvents, any>;
|
|
20
20
|
export type DynamicEventEmitter = typeof dynamicEvents;
|
|
@@ -23,6 +23,8 @@ const externalEvents = [
|
|
|
23
23
|
'walletConnectedForFunding',
|
|
24
24
|
'walletTabSelected',
|
|
25
25
|
'walletConnectionFailed',
|
|
26
|
+
'embeddedWalletRevealCompleted',
|
|
27
|
+
'embeddedWalletRevealFailed',
|
|
26
28
|
];
|
|
27
29
|
// Full internal event emitter
|
|
28
30
|
const dynamicEvents = new EventEmitter();
|
|
@@ -35,17 +35,17 @@ var SvgBackupWaas = function SvgBackupWaas(_ref) {
|
|
|
35
35
|
titleId = _ref.titleId,
|
|
36
36
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
37
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
38
|
-
width:
|
|
38
|
+
width: 64,
|
|
39
39
|
height: 64,
|
|
40
|
-
viewBox: "0 0
|
|
40
|
+
viewBox: "0 0 64 64",
|
|
41
41
|
fill: "none",
|
|
42
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
43
43
|
"aria-labelledby": titleId
|
|
44
44
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
45
45
|
id: titleId
|
|
46
46
|
}, title) : null, _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
47
|
-
d: "M32
|
|
48
|
-
fill: "#
|
|
47
|
+
d: "M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0Zm10.325 34.635a.89.89 0 0 0-1.258-.016l-1.8 1.757a.89.89 0 0 0-.016 1.258l1.758 1.801a.89.89 0 0 0 1.273-1.242l-.338-.346a7.119 7.119 0 1 1-5.245.735.89.89 0 1 0-.886-1.543 8.897 8.897 0 1 0 6.321-.975l.176-.171a.89.89 0 0 0 .015-1.258ZM19.95 15A4.95 4.95 0 0 0 15 19.95v23.1A4.95 4.95 0 0 0 19.95 48h8.11a12.481 12.481 0 0 1-.383-3.081c0-6.002 4.245-11.014 9.897-12.193a2.47 2.47 0 0 1 2.183-.257A12.405 12.405 0 0 1 48 35.262V26.55a4.95 4.95 0 0 0-4.95-4.95h-23.1a1.65 1.65 0 1 1 0-3.3h19.8a1.65 1.65 0 1 0 0-3.3h-19.8Z",
|
|
48
|
+
fill: "#4779FF"
|
|
49
49
|
})));
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -11,17 +11,17 @@ var SvgBackupWaas = function SvgBackupWaas(_ref) {
|
|
|
11
11
|
titleId = _ref.titleId,
|
|
12
12
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
13
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
14
|
-
width:
|
|
14
|
+
width: 64,
|
|
15
15
|
height: 64,
|
|
16
|
-
viewBox: "0 0
|
|
16
|
+
viewBox: "0 0 64 64",
|
|
17
17
|
fill: "none",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
19
|
"aria-labelledby": titleId
|
|
20
20
|
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
21
21
|
id: titleId
|
|
22
22
|
}, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
23
|
-
d: "M32
|
|
24
|
-
fill: "#
|
|
23
|
+
d: "M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0Zm10.325 34.635a.89.89 0 0 0-1.258-.016l-1.8 1.757a.89.89 0 0 0-.016 1.258l1.758 1.801a.89.89 0 0 0 1.273-1.242l-.338-.346a7.119 7.119 0 1 1-5.245.735.89.89 0 1 0-.886-1.543 8.897 8.897 0 1 0 6.321-.975l.176-.171a.89.89 0 0 0 .015-1.258ZM19.95 15A4.95 4.95 0 0 0 15 19.95v23.1A4.95 4.95 0 0 0 19.95 48h8.11a12.481 12.481 0 0 1-.383-3.081c0-6.002 4.245-11.014 9.897-12.193a2.47 2.47 0 0 1 2.183-.257A12.405 12.405 0 0 1 48 35.262V26.55a4.95 4.95 0 0 0-4.95-4.95h-23.1a1.65 1.65 0 1 1 0-3.3h19.8a1.65 1.65 0 1 0 0-3.3h-19.8Z",
|
|
24
|
+
fill: "#4779FF"
|
|
25
25
|
})));
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -17,6 +17,10 @@ export type DynamicEventsCallbacks = {
|
|
|
17
17
|
onLogout?: (user: UserProfile | undefined) => void;
|
|
18
18
|
onUserProfileUpdate?: (user: UserProfile) => void;
|
|
19
19
|
onEmbeddedWalletCreated?: OnEmbeddedWalletCreated;
|
|
20
|
+
/** Called when a user successfully reveals their embedded wallet private key or recovery phrase */
|
|
21
|
+
onEmbeddedWalletRevealSuccess?: (wallet: Wallet) => void;
|
|
22
|
+
/** Called when revealing an embedded wallet private key or recovery phrase fails */
|
|
23
|
+
onEmbeddedWalletRevealFailure?: (error: unknown) => void;
|
|
20
24
|
onWalletAdded?: OnWalletAdded;
|
|
21
25
|
onWalletRemoved?: OnWalletRemoved;
|
|
22
26
|
onWalletConnectionFailed?: (walletConnector: WalletConnector, error: unknown) => void;
|