@glowlabs-org/utils 0.2.144 → 0.2.146

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/esm/index.js CHANGED
@@ -13,8 +13,8 @@ import { parseUnits, formatUnits } from 'viem';
13
13
  import { MerkleTree } from 'merkletreejs';
14
14
  import { solidityPackedKeccak256, keccak256 } from 'ethers';
15
15
  import Decimal from 'decimal.js';
16
- import { H as HUB_URL, U as USDG_WEIGHT_DECIMAL_PRECISION, G as GLOW_WEIGHT_DECIMAL_PRECISION, M as MAX_WEIGHT } from './farms-router-DBnVa7Ts.js';
17
- export { C as ControlRouter, F as FarmsRouter, d as KICKSTARTER_STATUS, K as KickstarterRouter, O as OFF_CHAIN_PAYMENT_CURRENCIES, P as PAYMENT_CURRENCIES, b as REGIONS, R as RegionRouter, S as STAKING_DIRECTIONS, T as TRANSFER_TYPES, W as WalletsRouter, c as configureSentry, u as useForwarder, a as useOffchainFractions } from './farms-router-DBnVa7Ts.js';
16
+ import { H as HUB_URL, U as USDG_WEIGHT_DECIMAL_PRECISION, G as GLOW_WEIGHT_DECIMAL_PRECISION, M as MAX_WEIGHT } from './farms-router-CrYkNv7Z.js';
17
+ export { C as ControlRouter, F as FarmsRouter, d as KICKSTARTER_STATUS, K as KickstarterRouter, O as OFF_CHAIN_PAYMENT_CURRENCIES, P as PAYMENT_CURRENCIES, b as REGIONS, R as RegionRouter, S as STAKING_DIRECTIONS, T as TRANSFER_TYPES, W as WalletsRouter, c as configureSentry, u as useForwarder, a as useOffchainFractions } from './farms-router-CrYkNv7Z.js';
18
18
 
19
19
  const GENESIS_TIMESTAMP = 1700352000;
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glowlabs-org/utils",
3
- "version": "0.2.144",
3
+ "version": "0.2.146",
4
4
  "description": "A library containing all typechain types and addresses relating to the glow guarded launch",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -47,8 +47,8 @@ const sepoliaAddresses: Record<ContractKeys, `0x${string}`> = {
47
47
  USDC: "0x93c898be98cd2618ba84a6dccf5003d3bbe40356",
48
48
  USDG_UNISWAP: "0x2a085A3aEA8982396533327c854753Ce521B666d",
49
49
  GLW_UNISWAP: "0x8e27016D0B866a56CE74A1a280c749dD679bb0Fa",
50
- FORWARDER: "0xDaC24F18171224eeaf6a9B38f5C5081aDbDff969",
51
- OFFCHAIN_FRACTIONS: "0x7D97528eeF8B8D17AA1Ba3307Ed39b07b3A1b69B",
50
+ FORWARDER: "0xe7A366482899e2Ed29c9504F4792B8D1c67066ff",
51
+ OFFCHAIN_FRACTIONS: "0x5Ad30F90AFEf1279157A5055AAd2d8c1529a05D2",
52
52
  COUNTERFACTUAL_HOLDER_FACTORY: "0x2c3AB887746F6f4a8a4b9Db6aC800eb71945509A",
53
53
  FOUNDATION_WALLET: "0x5e230FED487c86B90f6508104149F087d9B1B0A7",
54
54
  FOUNDATION_HUB_MANAGER_WALLET: "0x5252FdA14A149c01EA5A1D6514a9c1369E4C70b4",
@@ -39,6 +39,31 @@ export function configureSentry(config: SentryConfig): void {
39
39
  if (config.defaultContext) defaultExtra = { ...config.defaultContext };
40
40
  }
41
41
 
42
+ function shouldSkipSentry(error: unknown): boolean {
43
+ try {
44
+ const possible: any = error;
45
+ const code: string | undefined = possible?.code || possible?.cause?.code;
46
+ const name: string | undefined = possible?.name || possible?.cause?.name;
47
+ const message: string = String(
48
+ possible?.message || possible?.cause?.message || ""
49
+ );
50
+
51
+ // User rejected wallet request (ethers/viem/common providers)
52
+ if (code === "ACTION_REJECTED") return true;
53
+ if (name === "UserRejectedRequestError") return true;
54
+ if (/user rejected/i.test(message)) return true;
55
+
56
+ // Terminal waitForViemTransactionWithRetry error (retries exhausted)
57
+ if (/Transaction failed after\s+\d+\s+attempts:/i.test(message)) {
58
+ return true;
59
+ }
60
+
61
+ return false;
62
+ } catch {
63
+ return false;
64
+ }
65
+ }
66
+
42
67
  export function sentryAddBreadcrumb(breadcrumb: SentryBreadcrumb): void {
43
68
  try {
44
69
  if (!isEnabled) return;
@@ -52,6 +77,7 @@ export function sentryCaptureException(
52
77
  ): void {
53
78
  try {
54
79
  if (!isEnabled) return;
80
+ if (shouldSkipSentry(error)) return;
55
81
  const client = getSentry();
56
82
  if (!client) return;
57
83
  const merged = extra ? { ...defaultExtra, ...extra } : defaultExtra;
@@ -121,7 +121,7 @@ export async function waitForViemTransactionWithRetry(
121
121
  }
122
122
 
123
123
  // Wait before retrying (exponential backoff)
124
- const delay = Math.min(2000 * Math.pow(2, attempt - 1), 10000);
124
+ const delay = Math.min(2000 * Math.pow(2, attempt - 1), 2000);
125
125
  if (enableLogging) {
126
126
  console.warn(
127
127
  `Transaction receipt not found (attempt ${attempt}/${maxRetries}), retrying in ${delay}ms...`
@@ -239,7 +239,7 @@ export async function waitForEthersTransactionWithRetry(
239
239
  }
240
240
 
241
241
  // Wait before retrying (exponential backoff)
242
- const delay = Math.min(2000 * Math.pow(2, attempt - 1), 10000);
242
+ const delay = Math.min(2000 * Math.pow(2, attempt - 1), 2000);
243
243
  if (enableLogging) {
244
244
  console.warn(
245
245
  `Transaction receipt not found (attempt ${attempt}/${maxRetries}), retrying in ${delay}ms...`