@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.cjs
CHANGED
|
@@ -331,6 +331,22 @@ async function reportActionCompletion(apiBaseUrl, actionId, result) {
|
|
|
331
331
|
return await res.json();
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
+
// src/sentry.ts
|
|
335
|
+
var _mod;
|
|
336
|
+
function captureException(error) {
|
|
337
|
+
if (_mod === null) return;
|
|
338
|
+
if (_mod) {
|
|
339
|
+
_mod.captureException(error);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
import('@sentry/react').then((m) => {
|
|
343
|
+
_mod = m;
|
|
344
|
+
m.captureException(error);
|
|
345
|
+
}).catch(() => {
|
|
346
|
+
_mod = null;
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
|
|
334
350
|
// node_modules/@wagmi/core/dist/esm/version.js
|
|
335
351
|
var version = "2.22.1";
|
|
336
352
|
|
|
@@ -4358,8 +4374,8 @@ var PaymentErrorBoundary = class extends react.Component {
|
|
|
4358
4374
|
static getDerivedStateFromError() {
|
|
4359
4375
|
return { hasError: true };
|
|
4360
4376
|
}
|
|
4361
|
-
componentDidCatch(error,
|
|
4362
|
-
|
|
4377
|
+
componentDidCatch(error, _info) {
|
|
4378
|
+
captureException(error);
|
|
4363
4379
|
}
|
|
4364
4380
|
handleReset = () => {
|
|
4365
4381
|
this.setState({ hasError: false });
|
|
@@ -4677,6 +4693,7 @@ function SwypePaymentInner({
|
|
|
4677
4693
|
try {
|
|
4678
4694
|
await initOAuth({ provider });
|
|
4679
4695
|
} catch (err) {
|
|
4696
|
+
captureException(err);
|
|
4680
4697
|
setError(err instanceof Error ? err.message : "Social login failed");
|
|
4681
4698
|
}
|
|
4682
4699
|
}, [initOAuth]);
|
|
@@ -4703,6 +4720,7 @@ function SwypePaymentInner({
|
|
|
4703
4720
|
setVerificationTarget(normalizedIdentifier);
|
|
4704
4721
|
setStep("otp-verify");
|
|
4705
4722
|
} catch (err) {
|
|
4723
|
+
captureException(err);
|
|
4706
4724
|
setError(err instanceof Error ? err.message : "Failed to send verification code");
|
|
4707
4725
|
}
|
|
4708
4726
|
}, [authInput, sendEmailCode, sendSmsCode]);
|
|
@@ -4721,6 +4739,7 @@ function SwypePaymentInner({
|
|
|
4721
4739
|
await loginWithSmsCode({ code: trimmedCode });
|
|
4722
4740
|
}
|
|
4723
4741
|
} catch (err) {
|
|
4742
|
+
captureException(err);
|
|
4724
4743
|
setError(err instanceof Error ? err.message : "Failed to verify code");
|
|
4725
4744
|
}
|
|
4726
4745
|
}, [verificationTarget, otpCode, loginWithEmailCode, loginWithSmsCode]);
|
|
@@ -4739,6 +4758,7 @@ function SwypePaymentInner({
|
|
|
4739
4758
|
await sendSmsCode({ phoneNumber: verificationTarget.value });
|
|
4740
4759
|
}
|
|
4741
4760
|
} catch (err) {
|
|
4761
|
+
captureException(err);
|
|
4742
4762
|
setError(err instanceof Error ? err.message : "Failed to resend code");
|
|
4743
4763
|
}
|
|
4744
4764
|
}, [verificationTarget, sendEmailCode, sendSmsCode]);
|
|
@@ -4953,6 +4973,7 @@ function SwypePaymentInner({
|
|
|
4953
4973
|
}
|
|
4954
4974
|
} catch (err) {
|
|
4955
4975
|
if (!cancelled) {
|
|
4976
|
+
captureException(err);
|
|
4956
4977
|
setError(err instanceof Error ? err.message : "Failed to load data");
|
|
4957
4978
|
}
|
|
4958
4979
|
} finally {
|
|
@@ -4995,6 +5016,7 @@ function SwypePaymentInner({
|
|
|
4995
5016
|
if (!hasProcessingTimedOut(processingStartedAtRef.current, Date.now())) return;
|
|
4996
5017
|
const status = getTransferStatus(polling.transfer, transfer);
|
|
4997
5018
|
const msg = buildProcessingTimeoutMessage(status);
|
|
5019
|
+
captureException(new Error(msg));
|
|
4998
5020
|
polling.stopPolling();
|
|
4999
5021
|
setStep("deposit");
|
|
5000
5022
|
setError(msg);
|
|
@@ -5219,6 +5241,7 @@ function SwypePaymentInner({
|
|
|
5219
5241
|
setTransfer(signedTransfer);
|
|
5220
5242
|
polling.startPolling(t.id);
|
|
5221
5243
|
} catch (err) {
|
|
5244
|
+
captureException(err);
|
|
5222
5245
|
const msg = err instanceof Error ? err.message : "Transfer failed";
|
|
5223
5246
|
setError(msg);
|
|
5224
5247
|
onError?.(msg);
|
|
@@ -5297,6 +5320,7 @@ function SwypePaymentInner({
|
|
|
5297
5320
|
triggerDeeplink(uri);
|
|
5298
5321
|
}
|
|
5299
5322
|
} catch (err) {
|
|
5323
|
+
captureException(err);
|
|
5300
5324
|
const msg = err instanceof Error ? err.message : "Failed to increase limit";
|
|
5301
5325
|
setError(msg);
|
|
5302
5326
|
onError?.(msg);
|
|
@@ -5351,6 +5375,7 @@ function SwypePaymentInner({
|
|
|
5351
5375
|
if (err instanceof PasskeyIframeBlockedError) {
|
|
5352
5376
|
setPasskeyPopupNeeded(true);
|
|
5353
5377
|
} else {
|
|
5378
|
+
captureException(err);
|
|
5354
5379
|
setError(err instanceof Error ? err.message : "Failed to register passkey");
|
|
5355
5380
|
}
|
|
5356
5381
|
} finally {
|
|
@@ -5369,6 +5394,7 @@ function SwypePaymentInner({
|
|
|
5369
5394
|
const { credentialId, publicKey } = await createPasskeyViaPopup(popupOptions);
|
|
5370
5395
|
await completePasskeyRegistration(credentialId, publicKey);
|
|
5371
5396
|
} catch (err) {
|
|
5397
|
+
captureException(err);
|
|
5372
5398
|
setError(err instanceof Error ? err.message : "Failed to register passkey");
|
|
5373
5399
|
} finally {
|
|
5374
5400
|
setRegisteringPasskey(false);
|
|
@@ -5456,6 +5482,7 @@ function SwypePaymentInner({
|
|
|
5456
5482
|
setStep("processing");
|
|
5457
5483
|
polling.startPolling(t.id);
|
|
5458
5484
|
} catch (err) {
|
|
5485
|
+
captureException(err);
|
|
5459
5486
|
const msg = err instanceof Error ? err.message : "Failed to sign transfer";
|
|
5460
5487
|
setError(msg);
|
|
5461
5488
|
onError?.(msg);
|