@glowlabs-org/utils 0.2.144 → 0.2.145

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var farmsRouter = require('./farms-router-Bvy7r2pJ.js');
3
+ var farmsRouter = require('./farms-router-C8V_F0vY.js');
4
4
  var viem = require('viem');
5
5
  require('ethers');
6
6
 
@@ -526,6 +526,29 @@ function configureSentry(config) {
526
526
  if (config.defaultContext)
527
527
  defaultExtra = { ...config.defaultContext };
528
528
  }
529
+ function shouldSkipSentry(error) {
530
+ try {
531
+ const possible = error;
532
+ const code = possible?.code || possible?.cause?.code;
533
+ const name = possible?.name || possible?.cause?.name;
534
+ const message = String(possible?.message || possible?.cause?.message || "");
535
+ // User rejected wallet request (ethers/viem/common providers)
536
+ if (code === "ACTION_REJECTED")
537
+ return true;
538
+ if (name === "UserRejectedRequestError")
539
+ return true;
540
+ if (/user rejected/i.test(message))
541
+ return true;
542
+ // Terminal waitForViemTransactionWithRetry error (retries exhausted)
543
+ if (/Transaction failed after\s+\d+\s+attempts:/i.test(message)) {
544
+ return true;
545
+ }
546
+ return false;
547
+ }
548
+ catch {
549
+ return false;
550
+ }
551
+ }
529
552
  function sentryAddBreadcrumb(breadcrumb) {
530
553
  try {
531
554
  if (!isEnabled)
@@ -538,6 +561,8 @@ function sentryCaptureException(error, extra) {
538
561
  try {
539
562
  if (!isEnabled)
540
563
  return;
564
+ if (shouldSkipSentry(error))
565
+ return;
541
566
  const client = getSentry();
542
567
  if (!client)
543
568
  return;
@@ -4258,4 +4283,4 @@ exports.useForwarder = useForwarder;
4258
4283
  exports.useOffchainFractions = useOffchainFractions;
4259
4284
  exports.waitForEthersTransactionWithRetry = waitForEthersTransactionWithRetry;
4260
4285
  exports.waitForViemTransactionWithRetry = waitForViemTransactionWithRetry;
4261
- //# sourceMappingURL=farms-router-Bvy7r2pJ.js.map
4286
+ //# sourceMappingURL=farms-router-C8V_F0vY.js.map