@swype-org/react-sdk 0.1.81 → 0.1.82
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/dist/index.cjs +29 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/package.json +10 -3
package/dist/index.js
CHANGED
|
@@ -328,6 +328,22 @@ async function reportActionCompletion(apiBaseUrl, actionId, result) {
|
|
|
328
328
|
return await res.json();
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
// src/sentry.ts
|
|
332
|
+
var _mod;
|
|
333
|
+
function captureException(error) {
|
|
334
|
+
if (_mod === null) return;
|
|
335
|
+
if (_mod) {
|
|
336
|
+
_mod.captureException(error);
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
import('@sentry/react').then((m) => {
|
|
340
|
+
_mod = m;
|
|
341
|
+
m.captureException(error);
|
|
342
|
+
}).catch(() => {
|
|
343
|
+
_mod = null;
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
331
347
|
// node_modules/@wagmi/core/dist/esm/version.js
|
|
332
348
|
var version = "2.22.1";
|
|
333
349
|
|
|
@@ -4355,8 +4371,8 @@ var PaymentErrorBoundary = class extends Component {
|
|
|
4355
4371
|
static getDerivedStateFromError() {
|
|
4356
4372
|
return { hasError: true };
|
|
4357
4373
|
}
|
|
4358
|
-
componentDidCatch(error,
|
|
4359
|
-
|
|
4374
|
+
componentDidCatch(error, _info) {
|
|
4375
|
+
captureException(error);
|
|
4360
4376
|
}
|
|
4361
4377
|
handleReset = () => {
|
|
4362
4378
|
this.setState({ hasError: false });
|
|
@@ -4674,6 +4690,7 @@ function SwypePaymentInner({
|
|
|
4674
4690
|
try {
|
|
4675
4691
|
await initOAuth({ provider });
|
|
4676
4692
|
} catch (err) {
|
|
4693
|
+
captureException(err);
|
|
4677
4694
|
setError(err instanceof Error ? err.message : "Social login failed");
|
|
4678
4695
|
}
|
|
4679
4696
|
}, [initOAuth]);
|
|
@@ -4700,6 +4717,7 @@ function SwypePaymentInner({
|
|
|
4700
4717
|
setVerificationTarget(normalizedIdentifier);
|
|
4701
4718
|
setStep("otp-verify");
|
|
4702
4719
|
} catch (err) {
|
|
4720
|
+
captureException(err);
|
|
4703
4721
|
setError(err instanceof Error ? err.message : "Failed to send verification code");
|
|
4704
4722
|
}
|
|
4705
4723
|
}, [authInput, sendEmailCode, sendSmsCode]);
|
|
@@ -4718,6 +4736,7 @@ function SwypePaymentInner({
|
|
|
4718
4736
|
await loginWithSmsCode({ code: trimmedCode });
|
|
4719
4737
|
}
|
|
4720
4738
|
} catch (err) {
|
|
4739
|
+
captureException(err);
|
|
4721
4740
|
setError(err instanceof Error ? err.message : "Failed to verify code");
|
|
4722
4741
|
}
|
|
4723
4742
|
}, [verificationTarget, otpCode, loginWithEmailCode, loginWithSmsCode]);
|
|
@@ -4736,6 +4755,7 @@ function SwypePaymentInner({
|
|
|
4736
4755
|
await sendSmsCode({ phoneNumber: verificationTarget.value });
|
|
4737
4756
|
}
|
|
4738
4757
|
} catch (err) {
|
|
4758
|
+
captureException(err);
|
|
4739
4759
|
setError(err instanceof Error ? err.message : "Failed to resend code");
|
|
4740
4760
|
}
|
|
4741
4761
|
}, [verificationTarget, sendEmailCode, sendSmsCode]);
|
|
@@ -4950,6 +4970,7 @@ function SwypePaymentInner({
|
|
|
4950
4970
|
}
|
|
4951
4971
|
} catch (err) {
|
|
4952
4972
|
if (!cancelled) {
|
|
4973
|
+
captureException(err);
|
|
4953
4974
|
setError(err instanceof Error ? err.message : "Failed to load data");
|
|
4954
4975
|
}
|
|
4955
4976
|
} finally {
|
|
@@ -4992,6 +5013,7 @@ function SwypePaymentInner({
|
|
|
4992
5013
|
if (!hasProcessingTimedOut(processingStartedAtRef.current, Date.now())) return;
|
|
4993
5014
|
const status = getTransferStatus(polling.transfer, transfer);
|
|
4994
5015
|
const msg = buildProcessingTimeoutMessage(status);
|
|
5016
|
+
captureException(new Error(msg));
|
|
4995
5017
|
polling.stopPolling();
|
|
4996
5018
|
setStep("deposit");
|
|
4997
5019
|
setError(msg);
|
|
@@ -5216,6 +5238,7 @@ function SwypePaymentInner({
|
|
|
5216
5238
|
setTransfer(signedTransfer);
|
|
5217
5239
|
polling.startPolling(t.id);
|
|
5218
5240
|
} catch (err) {
|
|
5241
|
+
captureException(err);
|
|
5219
5242
|
const msg = err instanceof Error ? err.message : "Transfer failed";
|
|
5220
5243
|
setError(msg);
|
|
5221
5244
|
onError?.(msg);
|
|
@@ -5294,6 +5317,7 @@ function SwypePaymentInner({
|
|
|
5294
5317
|
triggerDeeplink(uri);
|
|
5295
5318
|
}
|
|
5296
5319
|
} catch (err) {
|
|
5320
|
+
captureException(err);
|
|
5297
5321
|
const msg = err instanceof Error ? err.message : "Failed to increase limit";
|
|
5298
5322
|
setError(msg);
|
|
5299
5323
|
onError?.(msg);
|
|
@@ -5348,6 +5372,7 @@ function SwypePaymentInner({
|
|
|
5348
5372
|
if (err instanceof PasskeyIframeBlockedError) {
|
|
5349
5373
|
setPasskeyPopupNeeded(true);
|
|
5350
5374
|
} else {
|
|
5375
|
+
captureException(err);
|
|
5351
5376
|
setError(err instanceof Error ? err.message : "Failed to register passkey");
|
|
5352
5377
|
}
|
|
5353
5378
|
} finally {
|
|
@@ -5366,6 +5391,7 @@ function SwypePaymentInner({
|
|
|
5366
5391
|
const { credentialId, publicKey } = await createPasskeyViaPopup(popupOptions);
|
|
5367
5392
|
await completePasskeyRegistration(credentialId, publicKey);
|
|
5368
5393
|
} catch (err) {
|
|
5394
|
+
captureException(err);
|
|
5369
5395
|
setError(err instanceof Error ? err.message : "Failed to register passkey");
|
|
5370
5396
|
} finally {
|
|
5371
5397
|
setRegisteringPasskey(false);
|
|
@@ -5453,6 +5479,7 @@ function SwypePaymentInner({
|
|
|
5453
5479
|
setStep("processing");
|
|
5454
5480
|
polling.startPolling(t.id);
|
|
5455
5481
|
} catch (err) {
|
|
5482
|
+
captureException(err);
|
|
5456
5483
|
const msg = err instanceof Error ? err.message : "Failed to sign transfer";
|
|
5457
5484
|
setError(msg);
|
|
5458
5485
|
onError?.(msg);
|