@1delta/providers 0.0.54 → 0.0.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/providers",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "vitest": "^4.0.18",
21
21
  "@1delta/chain-registry": "0.0.4",
22
- "@1delta/data-sdk": "0.0.21"
22
+ "@1delta/data-sdk": "0.0.23"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.5.1",
@@ -87,6 +87,19 @@ function isHttpError(e: unknown): boolean {
87
87
  return false
88
88
  }
89
89
 
90
+ /** Compact viem/error formatter — avoids dumping full ABI/calldata/args */
91
+ function formatViemError(e: unknown): string {
92
+ if (e instanceof BaseError) {
93
+ const cause = (e.walk() as any)?.shortMessage
94
+ const short = e.shortMessage
95
+ return cause && cause !== short
96
+ ? `${e.name}: ${short} | cause: ${cause}`
97
+ : `${e.name}: ${short}`
98
+ }
99
+ if (e instanceof Error) return `${e.name}: ${e.message}`
100
+ return String(e)
101
+ }
102
+
90
103
  /** Return true if the multicall ran out of gas (batch too large for the RPC gas limit) */
91
104
  function isOutOfGasError(e: unknown): boolean {
92
105
  const msg =
@@ -267,7 +280,11 @@ export function createMulticallRetry(
267
280
 
268
281
  // Out-of-gas: batch too large for the RPC gas limit — halve batch size and retry
269
282
  if (isOutOfGasError(e) && batchSize > 1) {
270
- if (logErrors) console.debug(e)
283
+ if (logErrors)
284
+ console.debug(
285
+ `[multicall] OOG chain=${chain}`,
286
+ formatViemError(e),
287
+ )
271
288
  return await multicallRetry(
272
289
  chain,
273
290
  calls,
@@ -289,8 +306,8 @@ export function createMulticallRetry(
289
306
  if (logErrors) {
290
307
  const tag = isHttpError(e) ? 'HTTP' : 'unknown-transient'
291
308
  console.debug(
292
- `[multicall] ${tag} error on provider ${providerId}, skipping`,
293
- e,
309
+ `[multicall] ${tag} error on chain=${chain} provider ${providerId}, skipping:`,
310
+ formatViemError(e),
294
311
  )
295
312
  }
296
313
  return await multicallRetry(
@@ -309,12 +326,17 @@ export function createMulticallRetry(
309
326
 
310
327
  if (maxRetries === 0) {
311
328
  if (!allowFailure) throw e
312
- if (logErrors) console.debug(e)
329
+ if (logErrors)
330
+ console.debug(`[multicall] chain=${chain}`, formatViemError(e))
313
331
  return Array(calls.length).fill('0x')
314
332
  }
315
333
 
316
334
  // Skips exhausted — consume a retry and rotate RPC
317
- if (logErrors) console.debug(e)
335
+ if (logErrors)
336
+ console.debug(
337
+ `[multicall] retrying on chain=${chain} provider ${providerId + 1}:`,
338
+ formatViemError(e),
339
+ )
318
340
 
319
341
  return await multicallRetry(
320
342
  chain,