@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/dist/{ccip-P6QKYDYG.mjs → ccip-CQYMVZLL.mjs} +1 -1
- package/dist/{chunk-GGVKF6RL.mjs → chunk-B7I6NQ46.mjs} +121 -88
- package/dist/index.d.mts +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +576 -485
- package/dist/index.mjs +311 -255
- package/package.json +1 -1
- package/src/chains/chainMapping.ts +3 -0
- package/src/multicall/multicall.ts +11 -3
package/package.json
CHANGED
|
@@ -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
|
|
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(
|
|
116
|
+
finalResults.push(resolvedData[filteredIndex++])
|
|
109
117
|
}
|
|
110
118
|
}
|
|
111
119
|
return finalResults
|
|
112
120
|
}
|
|
113
121
|
|
|
114
|
-
return
|
|
122
|
+
return resolvedData
|
|
115
123
|
} catch (e) {
|
|
116
124
|
if (isContractRevert(e)) {
|
|
117
125
|
const error = e as ContractFunctionExecutionError
|