@1delta/providers 0.0.44 → 0.0.45

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.44",
3
+ "version": "0.0.45",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -72,6 +72,7 @@ import {
72
72
  moonbeam,
73
73
  zkLinkNova,
74
74
  vana,
75
+ confluxESpace,
75
76
  } from 'viem/chains'
76
77
  import { customChains, katana, plasma } from './customChains'
77
78
 
@@ -265,6 +266,8 @@ export function getEvmChain(chain: string) {
265
266
  return customChains.hyperEvm
266
267
  case Chain.KATANA:
267
268
  return katana
269
+ case Chain.CONFLUX_ESPACE:
270
+ return confluxESpace
268
271
  case Chain.TARAXA_MAINNET:
269
272
  return {
270
273
  ...taraxa,
@@ -94,9 +94,17 @@ export function createMulticallRetry(
94
94
  functionName: call.name,
95
95
  args: call.args ?? call.params ?? [],
96
96
  })),
97
- allowFailure: false,
97
+ allowFailure,
98
98
  })
99
99
 
100
+ // When allowFailure is true, viem returns { result, status } per call.
101
+ // Extract results and convert failures to '0x'.
102
+ const resolvedData = allowFailure
103
+ ? (data as any[]).map(({ result, status }: any) =>
104
+ status !== 'success' ? '0x' : result,
105
+ )
106
+ : data
107
+
100
108
  if (revertedIndices.size > 0) {
101
109
  const finalResults: any[] = []
102
110
  let filteredIndex = 0
@@ -105,13 +113,13 @@ export function createMulticallRetry(
105
113
  if (revertedIndices.has(i)) {
106
114
  finalResults.push('0x')
107
115
  } else {
108
- finalResults.push(data[filteredIndex++])
116
+ finalResults.push(resolvedData[filteredIndex++])
109
117
  }
110
118
  }
111
119
  return finalResults
112
120
  }
113
121
 
114
- return data
122
+ return resolvedData
115
123
  } catch (e) {
116
124
  if (isContractRevert(e)) {
117
125
  const error = e as ContractFunctionExecutionError