@across-protocol/sdk 3.1.28-beta.1 → 3.1.28
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/cjs/clients/BundleDataClient/BundleDataClient.d.ts +1 -0
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +11 -8
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/cjs/providers/alchemy.js +5 -5
- package/dist/cjs/providers/alchemy.js.map +1 -1
- package/dist/cjs/providers/drpc.d.ts +2 -0
- package/dist/cjs/providers/drpc.js +21 -0
- package/dist/cjs/providers/drpc.js.map +1 -0
- package/dist/cjs/providers/infura.js +5 -5
- package/dist/cjs/providers/infura.js.map +1 -1
- package/dist/cjs/providers/types.d.ts +1 -1
- package/dist/cjs/providers/utils.js +3 -1
- package/dist/cjs/providers/utils.js.map +1 -1
- package/dist/cjs/utils/Multicall.d.ts +3 -2
- package/dist/cjs/utils/Multicall.js +40 -41
- package/dist/cjs/utils/Multicall.js.map +1 -1
- package/dist/cjs/utils/abi/contracts/index.d.ts +1 -0
- package/dist/cjs/utils/abi/contracts/index.js +9 -0
- package/dist/cjs/utils/abi/contracts/index.js.map +1 -0
- package/dist/cjs/utils/abi/typechain/Multicall3.d.ts +289 -0
- package/dist/cjs/utils/abi/typechain/Multicall3.js +3 -0
- package/dist/cjs/utils/abi/typechain/Multicall3.js.map +1 -0
- package/dist/cjs/utils/abi/typechain/common.d.ts +21 -0
- package/dist/cjs/utils/abi/typechain/common.js +3 -0
- package/dist/cjs/utils/abi/typechain/common.js.map +1 -0
- package/dist/cjs/utils/abi/typechain/factories/Multicall3__factory.d.ts +339 -0
- package/dist/cjs/utils/abi/typechain/factories/Multicall3__factory.js +458 -0
- package/dist/cjs/utils/abi/typechain/factories/Multicall3__factory.js.map +1 -0
- package/dist/cjs/utils/abi/typechain/factories/index.d.ts +1 -0
- package/dist/cjs/utils/abi/typechain/factories/index.js +6 -0
- package/dist/cjs/utils/abi/typechain/factories/index.js.map +1 -0
- package/dist/cjs/utils/abi/typechain/index.d.ts +3 -0
- package/dist/cjs/utils/abi/typechain/index.js +8 -0
- package/dist/cjs/utils/abi/typechain/index.js.map +1 -0
- package/dist/esm/clients/BundleDataClient/BundleDataClient.d.ts +1 -0
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js +16 -9
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/esm/providers/alchemy.js +6 -6
- package/dist/esm/providers/alchemy.js.map +1 -1
- package/dist/esm/providers/drpc.d.ts +2 -0
- package/dist/esm/providers/drpc.js +18 -0
- package/dist/esm/providers/drpc.js.map +1 -0
- package/dist/esm/providers/infura.js +6 -6
- package/dist/esm/providers/infura.js.map +1 -1
- package/dist/esm/providers/types.d.ts +1 -1
- package/dist/esm/providers/utils.js +3 -1
- package/dist/esm/providers/utils.js.map +1 -1
- package/dist/esm/utils/Multicall.d.ts +3 -2
- package/dist/esm/utils/Multicall.js +39 -42
- package/dist/esm/utils/Multicall.js.map +1 -1
- package/dist/esm/utils/abi/contracts/index.d.ts +1 -0
- package/dist/esm/utils/abi/contracts/index.js +2 -0
- package/dist/esm/utils/abi/contracts/index.js.map +1 -0
- package/dist/esm/utils/abi/typechain/Multicall3.d.ts +292 -0
- package/dist/esm/utils/abi/typechain/Multicall3.js +2 -0
- package/dist/esm/utils/abi/typechain/Multicall3.js.map +1 -0
- package/dist/esm/utils/abi/typechain/common.d.ts +21 -0
- package/dist/esm/utils/abi/typechain/common.js +2 -0
- package/dist/esm/utils/abi/typechain/common.js.map +1 -0
- package/dist/esm/utils/abi/typechain/factories/Multicall3__factory.d.ts +339 -0
- package/dist/esm/utils/abi/typechain/factories/Multicall3__factory.js +458 -0
- package/dist/esm/utils/abi/typechain/factories/Multicall3__factory.js.map +1 -0
- package/dist/esm/utils/abi/typechain/factories/index.d.ts +1 -0
- package/dist/esm/utils/abi/typechain/factories/index.js +5 -0
- package/dist/esm/utils/abi/typechain/factories/index.js.map +1 -0
- package/dist/esm/utils/abi/typechain/index.d.ts +3 -0
- package/dist/esm/utils/abi/typechain/index.js +4 -0
- package/dist/esm/utils/abi/typechain/index.js.map +1 -0
- package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts +1 -0
- package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
- package/dist/types/providers/drpc.d.ts +3 -0
- package/dist/types/providers/drpc.d.ts.map +1 -0
- package/dist/types/providers/types.d.ts +1 -1
- package/dist/types/providers/types.d.ts.map +1 -1
- package/dist/types/providers/utils.d.ts.map +1 -1
- package/dist/types/utils/Multicall.d.ts +3 -2
- package/dist/types/utils/Multicall.d.ts.map +1 -1
- package/dist/types/utils/abi/contracts/index.d.ts +2 -0
- package/dist/types/utils/abi/contracts/index.d.ts.map +1 -0
- package/dist/types/utils/abi/typechain/Multicall3.d.ts +293 -0
- package/dist/types/utils/abi/typechain/Multicall3.d.ts.map +1 -0
- package/dist/types/utils/abi/typechain/common.d.ts +22 -0
- package/dist/types/utils/abi/typechain/common.d.ts.map +1 -0
- package/dist/types/utils/abi/typechain/factories/Multicall3__factory.d.ts +340 -0
- package/dist/types/utils/abi/typechain/factories/Multicall3__factory.d.ts.map +1 -0
- package/dist/types/utils/abi/typechain/factories/index.d.ts +2 -0
- package/dist/types/utils/abi/typechain/factories/index.d.ts.map +1 -0
- package/dist/types/utils/abi/typechain/index.d.ts +4 -0
- package/dist/types/utils/abi/typechain/index.d.ts.map +1 -0
- package/package.json +6 -8
- package/src/clients/BundleDataClient/BundleDataClient.ts +54 -40
- package/src/providers/alchemy.ts +6 -6
- package/src/providers/drpc.ts +19 -0
- package/src/providers/infura.ts +6 -6
- package/src/providers/types.ts +1 -1
- package/src/providers/utils.ts +3 -1
- package/src/utils/Multicall.ts +38 -30
- package/src/utils/abi/contracts/index.ts +1 -0
- package/src/utils/abi/typechain/Multicall3.ts +433 -0
- package/src/utils/abi/typechain/common.ts +30 -0
- package/src/utils/abi/typechain/factories/Multicall3__factory.ts +458 -0
- package/src/utils/abi/typechain/factories/index.ts +4 -0
- package/src/utils/abi/typechain/index.ts +6 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import type { Provider } from "@ethersproject/providers";
|
|
3
|
+
import type { Multicall3, Multicall3Interface } from "../Multicall3";
|
|
4
|
+
export declare class Multicall3__factory {
|
|
5
|
+
static readonly abi: readonly [{
|
|
6
|
+
readonly inputs: readonly [{
|
|
7
|
+
readonly components: readonly [{
|
|
8
|
+
readonly internalType: "address";
|
|
9
|
+
readonly name: "target";
|
|
10
|
+
readonly type: "address";
|
|
11
|
+
}, {
|
|
12
|
+
readonly internalType: "bytes";
|
|
13
|
+
readonly name: "callData";
|
|
14
|
+
readonly type: "bytes";
|
|
15
|
+
}];
|
|
16
|
+
readonly internalType: "struct Multicall3.Call[]";
|
|
17
|
+
readonly name: "calls";
|
|
18
|
+
readonly type: "tuple[]";
|
|
19
|
+
}];
|
|
20
|
+
readonly name: "aggregate";
|
|
21
|
+
readonly outputs: readonly [{
|
|
22
|
+
readonly internalType: "uint256";
|
|
23
|
+
readonly name: "blockNumber";
|
|
24
|
+
readonly type: "uint256";
|
|
25
|
+
}, {
|
|
26
|
+
readonly internalType: "bytes[]";
|
|
27
|
+
readonly name: "returnData";
|
|
28
|
+
readonly type: "bytes[]";
|
|
29
|
+
}];
|
|
30
|
+
readonly stateMutability: "payable";
|
|
31
|
+
readonly type: "function";
|
|
32
|
+
}, {
|
|
33
|
+
readonly inputs: readonly [{
|
|
34
|
+
readonly components: readonly [{
|
|
35
|
+
readonly internalType: "address";
|
|
36
|
+
readonly name: "target";
|
|
37
|
+
readonly type: "address";
|
|
38
|
+
}, {
|
|
39
|
+
readonly internalType: "bool";
|
|
40
|
+
readonly name: "allowFailure";
|
|
41
|
+
readonly type: "bool";
|
|
42
|
+
}, {
|
|
43
|
+
readonly internalType: "bytes";
|
|
44
|
+
readonly name: "callData";
|
|
45
|
+
readonly type: "bytes";
|
|
46
|
+
}];
|
|
47
|
+
readonly internalType: "struct Multicall3.Call3[]";
|
|
48
|
+
readonly name: "calls";
|
|
49
|
+
readonly type: "tuple[]";
|
|
50
|
+
}];
|
|
51
|
+
readonly name: "aggregate3";
|
|
52
|
+
readonly outputs: readonly [{
|
|
53
|
+
readonly components: readonly [{
|
|
54
|
+
readonly internalType: "bool";
|
|
55
|
+
readonly name: "success";
|
|
56
|
+
readonly type: "bool";
|
|
57
|
+
}, {
|
|
58
|
+
readonly internalType: "bytes";
|
|
59
|
+
readonly name: "returnData";
|
|
60
|
+
readonly type: "bytes";
|
|
61
|
+
}];
|
|
62
|
+
readonly internalType: "struct Multicall3.Result[]";
|
|
63
|
+
readonly name: "returnData";
|
|
64
|
+
readonly type: "tuple[]";
|
|
65
|
+
}];
|
|
66
|
+
readonly stateMutability: "payable";
|
|
67
|
+
readonly type: "function";
|
|
68
|
+
}, {
|
|
69
|
+
readonly inputs: readonly [{
|
|
70
|
+
readonly components: readonly [{
|
|
71
|
+
readonly internalType: "address";
|
|
72
|
+
readonly name: "target";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly internalType: "bool";
|
|
76
|
+
readonly name: "allowFailure";
|
|
77
|
+
readonly type: "bool";
|
|
78
|
+
}, {
|
|
79
|
+
readonly internalType: "uint256";
|
|
80
|
+
readonly name: "value";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
}, {
|
|
83
|
+
readonly internalType: "bytes";
|
|
84
|
+
readonly name: "callData";
|
|
85
|
+
readonly type: "bytes";
|
|
86
|
+
}];
|
|
87
|
+
readonly internalType: "struct Multicall3.Call3Value[]";
|
|
88
|
+
readonly name: "calls";
|
|
89
|
+
readonly type: "tuple[]";
|
|
90
|
+
}];
|
|
91
|
+
readonly name: "aggregate3Value";
|
|
92
|
+
readonly outputs: readonly [{
|
|
93
|
+
readonly components: readonly [{
|
|
94
|
+
readonly internalType: "bool";
|
|
95
|
+
readonly name: "success";
|
|
96
|
+
readonly type: "bool";
|
|
97
|
+
}, {
|
|
98
|
+
readonly internalType: "bytes";
|
|
99
|
+
readonly name: "returnData";
|
|
100
|
+
readonly type: "bytes";
|
|
101
|
+
}];
|
|
102
|
+
readonly internalType: "struct Multicall3.Result[]";
|
|
103
|
+
readonly name: "returnData";
|
|
104
|
+
readonly type: "tuple[]";
|
|
105
|
+
}];
|
|
106
|
+
readonly stateMutability: "payable";
|
|
107
|
+
readonly type: "function";
|
|
108
|
+
}, {
|
|
109
|
+
readonly inputs: readonly [{
|
|
110
|
+
readonly components: readonly [{
|
|
111
|
+
readonly internalType: "address";
|
|
112
|
+
readonly name: "target";
|
|
113
|
+
readonly type: "address";
|
|
114
|
+
}, {
|
|
115
|
+
readonly internalType: "bytes";
|
|
116
|
+
readonly name: "callData";
|
|
117
|
+
readonly type: "bytes";
|
|
118
|
+
}];
|
|
119
|
+
readonly internalType: "struct Multicall3.Call[]";
|
|
120
|
+
readonly name: "calls";
|
|
121
|
+
readonly type: "tuple[]";
|
|
122
|
+
}];
|
|
123
|
+
readonly name: "blockAndAggregate";
|
|
124
|
+
readonly outputs: readonly [{
|
|
125
|
+
readonly internalType: "uint256";
|
|
126
|
+
readonly name: "blockNumber";
|
|
127
|
+
readonly type: "uint256";
|
|
128
|
+
}, {
|
|
129
|
+
readonly internalType: "bytes32";
|
|
130
|
+
readonly name: "blockHash";
|
|
131
|
+
readonly type: "bytes32";
|
|
132
|
+
}, {
|
|
133
|
+
readonly components: readonly [{
|
|
134
|
+
readonly internalType: "bool";
|
|
135
|
+
readonly name: "success";
|
|
136
|
+
readonly type: "bool";
|
|
137
|
+
}, {
|
|
138
|
+
readonly internalType: "bytes";
|
|
139
|
+
readonly name: "returnData";
|
|
140
|
+
readonly type: "bytes";
|
|
141
|
+
}];
|
|
142
|
+
readonly internalType: "struct Multicall3.Result[]";
|
|
143
|
+
readonly name: "returnData";
|
|
144
|
+
readonly type: "tuple[]";
|
|
145
|
+
}];
|
|
146
|
+
readonly stateMutability: "payable";
|
|
147
|
+
readonly type: "function";
|
|
148
|
+
}, {
|
|
149
|
+
readonly inputs: readonly [];
|
|
150
|
+
readonly name: "getBasefee";
|
|
151
|
+
readonly outputs: readonly [{
|
|
152
|
+
readonly internalType: "uint256";
|
|
153
|
+
readonly name: "basefee";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}];
|
|
156
|
+
readonly stateMutability: "view";
|
|
157
|
+
readonly type: "function";
|
|
158
|
+
}, {
|
|
159
|
+
readonly inputs: readonly [{
|
|
160
|
+
readonly internalType: "uint256";
|
|
161
|
+
readonly name: "blockNumber";
|
|
162
|
+
readonly type: "uint256";
|
|
163
|
+
}];
|
|
164
|
+
readonly name: "getBlockHash";
|
|
165
|
+
readonly outputs: readonly [{
|
|
166
|
+
readonly internalType: "bytes32";
|
|
167
|
+
readonly name: "blockHash";
|
|
168
|
+
readonly type: "bytes32";
|
|
169
|
+
}];
|
|
170
|
+
readonly stateMutability: "view";
|
|
171
|
+
readonly type: "function";
|
|
172
|
+
}, {
|
|
173
|
+
readonly inputs: readonly [];
|
|
174
|
+
readonly name: "getBlockNumber";
|
|
175
|
+
readonly outputs: readonly [{
|
|
176
|
+
readonly internalType: "uint256";
|
|
177
|
+
readonly name: "blockNumber";
|
|
178
|
+
readonly type: "uint256";
|
|
179
|
+
}];
|
|
180
|
+
readonly stateMutability: "view";
|
|
181
|
+
readonly type: "function";
|
|
182
|
+
}, {
|
|
183
|
+
readonly inputs: readonly [];
|
|
184
|
+
readonly name: "getChainId";
|
|
185
|
+
readonly outputs: readonly [{
|
|
186
|
+
readonly internalType: "uint256";
|
|
187
|
+
readonly name: "chainid";
|
|
188
|
+
readonly type: "uint256";
|
|
189
|
+
}];
|
|
190
|
+
readonly stateMutability: "view";
|
|
191
|
+
readonly type: "function";
|
|
192
|
+
}, {
|
|
193
|
+
readonly inputs: readonly [];
|
|
194
|
+
readonly name: "getCurrentBlockCoinbase";
|
|
195
|
+
readonly outputs: readonly [{
|
|
196
|
+
readonly internalType: "address";
|
|
197
|
+
readonly name: "coinbase";
|
|
198
|
+
readonly type: "address";
|
|
199
|
+
}];
|
|
200
|
+
readonly stateMutability: "view";
|
|
201
|
+
readonly type: "function";
|
|
202
|
+
}, {
|
|
203
|
+
readonly inputs: readonly [];
|
|
204
|
+
readonly name: "getCurrentBlockDifficulty";
|
|
205
|
+
readonly outputs: readonly [{
|
|
206
|
+
readonly internalType: "uint256";
|
|
207
|
+
readonly name: "difficulty";
|
|
208
|
+
readonly type: "uint256";
|
|
209
|
+
}];
|
|
210
|
+
readonly stateMutability: "view";
|
|
211
|
+
readonly type: "function";
|
|
212
|
+
}, {
|
|
213
|
+
readonly inputs: readonly [];
|
|
214
|
+
readonly name: "getCurrentBlockGasLimit";
|
|
215
|
+
readonly outputs: readonly [{
|
|
216
|
+
readonly internalType: "uint256";
|
|
217
|
+
readonly name: "gaslimit";
|
|
218
|
+
readonly type: "uint256";
|
|
219
|
+
}];
|
|
220
|
+
readonly stateMutability: "view";
|
|
221
|
+
readonly type: "function";
|
|
222
|
+
}, {
|
|
223
|
+
readonly inputs: readonly [];
|
|
224
|
+
readonly name: "getCurrentBlockTimestamp";
|
|
225
|
+
readonly outputs: readonly [{
|
|
226
|
+
readonly internalType: "uint256";
|
|
227
|
+
readonly name: "timestamp";
|
|
228
|
+
readonly type: "uint256";
|
|
229
|
+
}];
|
|
230
|
+
readonly stateMutability: "view";
|
|
231
|
+
readonly type: "function";
|
|
232
|
+
}, {
|
|
233
|
+
readonly inputs: readonly [{
|
|
234
|
+
readonly internalType: "address";
|
|
235
|
+
readonly name: "addr";
|
|
236
|
+
readonly type: "address";
|
|
237
|
+
}];
|
|
238
|
+
readonly name: "getEthBalance";
|
|
239
|
+
readonly outputs: readonly [{
|
|
240
|
+
readonly internalType: "uint256";
|
|
241
|
+
readonly name: "balance";
|
|
242
|
+
readonly type: "uint256";
|
|
243
|
+
}];
|
|
244
|
+
readonly stateMutability: "view";
|
|
245
|
+
readonly type: "function";
|
|
246
|
+
}, {
|
|
247
|
+
readonly inputs: readonly [];
|
|
248
|
+
readonly name: "getLastBlockHash";
|
|
249
|
+
readonly outputs: readonly [{
|
|
250
|
+
readonly internalType: "bytes32";
|
|
251
|
+
readonly name: "blockHash";
|
|
252
|
+
readonly type: "bytes32";
|
|
253
|
+
}];
|
|
254
|
+
readonly stateMutability: "view";
|
|
255
|
+
readonly type: "function";
|
|
256
|
+
}, {
|
|
257
|
+
readonly inputs: readonly [{
|
|
258
|
+
readonly internalType: "bool";
|
|
259
|
+
readonly name: "requireSuccess";
|
|
260
|
+
readonly type: "bool";
|
|
261
|
+
}, {
|
|
262
|
+
readonly components: readonly [{
|
|
263
|
+
readonly internalType: "address";
|
|
264
|
+
readonly name: "target";
|
|
265
|
+
readonly type: "address";
|
|
266
|
+
}, {
|
|
267
|
+
readonly internalType: "bytes";
|
|
268
|
+
readonly name: "callData";
|
|
269
|
+
readonly type: "bytes";
|
|
270
|
+
}];
|
|
271
|
+
readonly internalType: "struct Multicall3.Call[]";
|
|
272
|
+
readonly name: "calls";
|
|
273
|
+
readonly type: "tuple[]";
|
|
274
|
+
}];
|
|
275
|
+
readonly name: "tryAggregate";
|
|
276
|
+
readonly outputs: readonly [{
|
|
277
|
+
readonly components: readonly [{
|
|
278
|
+
readonly internalType: "bool";
|
|
279
|
+
readonly name: "success";
|
|
280
|
+
readonly type: "bool";
|
|
281
|
+
}, {
|
|
282
|
+
readonly internalType: "bytes";
|
|
283
|
+
readonly name: "returnData";
|
|
284
|
+
readonly type: "bytes";
|
|
285
|
+
}];
|
|
286
|
+
readonly internalType: "struct Multicall3.Result[]";
|
|
287
|
+
readonly name: "returnData";
|
|
288
|
+
readonly type: "tuple[]";
|
|
289
|
+
}];
|
|
290
|
+
readonly stateMutability: "payable";
|
|
291
|
+
readonly type: "function";
|
|
292
|
+
}, {
|
|
293
|
+
readonly inputs: readonly [{
|
|
294
|
+
readonly internalType: "bool";
|
|
295
|
+
readonly name: "requireSuccess";
|
|
296
|
+
readonly type: "bool";
|
|
297
|
+
}, {
|
|
298
|
+
readonly components: readonly [{
|
|
299
|
+
readonly internalType: "address";
|
|
300
|
+
readonly name: "target";
|
|
301
|
+
readonly type: "address";
|
|
302
|
+
}, {
|
|
303
|
+
readonly internalType: "bytes";
|
|
304
|
+
readonly name: "callData";
|
|
305
|
+
readonly type: "bytes";
|
|
306
|
+
}];
|
|
307
|
+
readonly internalType: "struct Multicall3.Call[]";
|
|
308
|
+
readonly name: "calls";
|
|
309
|
+
readonly type: "tuple[]";
|
|
310
|
+
}];
|
|
311
|
+
readonly name: "tryBlockAndAggregate";
|
|
312
|
+
readonly outputs: readonly [{
|
|
313
|
+
readonly internalType: "uint256";
|
|
314
|
+
readonly name: "blockNumber";
|
|
315
|
+
readonly type: "uint256";
|
|
316
|
+
}, {
|
|
317
|
+
readonly internalType: "bytes32";
|
|
318
|
+
readonly name: "blockHash";
|
|
319
|
+
readonly type: "bytes32";
|
|
320
|
+
}, {
|
|
321
|
+
readonly components: readonly [{
|
|
322
|
+
readonly internalType: "bool";
|
|
323
|
+
readonly name: "success";
|
|
324
|
+
readonly type: "bool";
|
|
325
|
+
}, {
|
|
326
|
+
readonly internalType: "bytes";
|
|
327
|
+
readonly name: "returnData";
|
|
328
|
+
readonly type: "bytes";
|
|
329
|
+
}];
|
|
330
|
+
readonly internalType: "struct Multicall3.Result[]";
|
|
331
|
+
readonly name: "returnData";
|
|
332
|
+
readonly type: "tuple[]";
|
|
333
|
+
}];
|
|
334
|
+
readonly stateMutability: "payable";
|
|
335
|
+
readonly type: "function";
|
|
336
|
+
}];
|
|
337
|
+
static createInterface(): Multicall3Interface;
|
|
338
|
+
static connect(address: string, signerOrProvider: Signer | Provider): Multicall3;
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=Multicall3__factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Multicall3__factory.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/abi/typechain/factories/Multicall3__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,MAAM,EAAS,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA2brE,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,mBAAmB;IAG7C,MAAM,CAAC,OAAO,CACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,QAAQ,GAClC,UAAU;CAGd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/abi/typechain/factories/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/abi/typechain/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@across-protocol/sdk",
|
|
3
3
|
"author": "UMA Team",
|
|
4
|
-
"version": "3.1.28
|
|
4
|
+
"version": "3.1.28",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"homepage": "https://docs.across.to/reference/sdk",
|
|
7
7
|
"files": [
|
|
@@ -13,13 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"start": "nodemon -e ts,tsx,json,js,jsx --watch ./src --ignore ./dist --exec 'yarn build'",
|
|
16
|
-
"build": "yarn run clean && yarn run build:cjs & yarn run build:esm & yarn run build:types; wait",
|
|
17
|
-
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'
|
|
18
|
-
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm && echo > ./dist/esm/package.json '{\"type\":\"module\",\"sideEffects\":false}'
|
|
16
|
+
"build": "yarn run clean && yarn typechain && yarn run build:cjs & yarn run build:esm & yarn run build:types; wait",
|
|
17
|
+
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
18
|
+
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm && echo > ./dist/esm/package.json '{\"type\":\"module\",\"sideEffects\":false}'",
|
|
19
19
|
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
|
20
|
-
"copy-abi:cjs": "DIR=cjs yarn copy-abi",
|
|
21
|
-
"copy-abi:esm": "DIR=esm yarn copy-abi",
|
|
22
|
-
"copy-abi": "abi=utils/abi/contracts; dstdir=\"./dist/${DIR}/${abi}\"; mkdir -p \"${dstdir}\"; cp ./src/${abi}/*.json \"${dstdir}\"",
|
|
23
20
|
"test": "hardhat test",
|
|
24
21
|
"test:watch": "hardhat watch test",
|
|
25
22
|
"test:run:arweave": "npx -y arlocal",
|
|
@@ -31,7 +28,8 @@
|
|
|
31
28
|
"clean": "rm -rf ./dist",
|
|
32
29
|
"bump-version:major": "yarn version --major --no-git-tag-version --no-commit-hooks && git commit -m 'chore: bump version' ./package.json --no-verify",
|
|
33
30
|
"bump-version:minor": "yarn version --minor --no-git-tag-version --no-commit-hooks && git commit -m 'chore: bump version' ./package.json --no-verify",
|
|
34
|
-
"bump-version:patch": "yarn version --patch --no-git-tag-version --no-commit-hooks && git commit -m 'chore: bump version' ./package.json --no-verify"
|
|
31
|
+
"bump-version:patch": "yarn version --patch --no-git-tag-version --no-commit-hooks && git commit -m 'chore: bump version' ./package.json --no-verify",
|
|
32
|
+
"typechain": "typechain --target ethers-v5 --out-dir src/utils/abi/typechain 'src/utils/abi/contracts/*.json' && eslint --fix src/utils/abi/typechain && yarn prettier --write \"src/utils/abi/typechain/**/*.ts\""
|
|
35
33
|
},
|
|
36
34
|
"lint-staged": {
|
|
37
35
|
"*.ts": "yarn lint"
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
isSlowFill,
|
|
31
31
|
mapAsync,
|
|
32
32
|
relayFillStatus,
|
|
33
|
+
bnUint32Max,
|
|
33
34
|
} from "../../utils";
|
|
34
35
|
import { BigNumber } from "ethers";
|
|
35
36
|
import winston from "winston";
|
|
@@ -47,6 +48,9 @@ import {
|
|
|
47
48
|
V3FillWithBlock,
|
|
48
49
|
} from "./utils";
|
|
49
50
|
|
|
51
|
+
// max(uint256) - 1
|
|
52
|
+
export const INFINITE_FILL_DEADLINE = bnUint32Max;
|
|
53
|
+
|
|
50
54
|
type DataCache = Record<string, Promise<LoadDataReturnValue>>;
|
|
51
55
|
|
|
52
56
|
// V3 dictionary helper functions
|
|
@@ -766,44 +770,40 @@ export class BundleDataClient {
|
|
|
766
770
|
if (originChainId === destinationChainId) {
|
|
767
771
|
continue;
|
|
768
772
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
.
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
//
|
|
791
|
-
|
|
792
|
-
//
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
// for example. Those should be impossible to create but technically should be included in this
|
|
799
|
-
// bundle of refunded deposits.
|
|
800
|
-
if (deposit.fillDeadline < bundleBlockTimestamps[destinationChainId][1]) {
|
|
801
|
-
expiredBundleDepositHashes.add(relayDataHash);
|
|
802
|
-
}
|
|
803
|
-
} else {
|
|
804
|
-
olderDepositHashes.add(relayDataHash);
|
|
773
|
+
originClient.getDepositsForDestinationChain(destinationChainId).forEach((deposit) => {
|
|
774
|
+
depositCounter++;
|
|
775
|
+
const relayDataHash = this.getRelayHashFromEvent(deposit);
|
|
776
|
+
if (v3RelayHashes[relayDataHash]) {
|
|
777
|
+
// If we've seen this deposit before, then skip this deposit. This can happen if our RPC provider
|
|
778
|
+
// gives us bad data.
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
// Even if deposit is not in bundle block range, store all deposits we can see in memory in this
|
|
782
|
+
// convenient dictionary.
|
|
783
|
+
v3RelayHashes[relayDataHash] = {
|
|
784
|
+
deposit: deposit,
|
|
785
|
+
fill: undefined,
|
|
786
|
+
slowFillRequest: undefined,
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
// If deposit block is within origin chain bundle block range, then save as bundle deposit.
|
|
790
|
+
// If deposit is in bundle and it has expired, additionally save it as an expired deposit.
|
|
791
|
+
// If deposit is not in the bundle block range, then save it as an older deposit that
|
|
792
|
+
// may have expired.
|
|
793
|
+
if (deposit.blockNumber >= originChainBlockRange[0] && deposit.blockNumber <= originChainBlockRange[1]) {
|
|
794
|
+
// Deposit is a V3 deposit in this origin chain's bundle block range and is not a duplicate.
|
|
795
|
+
updateBundleDepositsV3(bundleDepositsV3, deposit);
|
|
796
|
+
// We don't check that fillDeadline >= bundleBlockTimestamps[destinationChainId][0] because
|
|
797
|
+
// that would eliminate any deposits in this bundle with a very low fillDeadline like equal to 0
|
|
798
|
+
// for example. Those should be impossible to create but technically should be included in this
|
|
799
|
+
// bundle of refunded deposits.
|
|
800
|
+
if (deposit.fillDeadline < bundleBlockTimestamps[destinationChainId][1]) {
|
|
801
|
+
expiredBundleDepositHashes.add(relayDataHash);
|
|
805
802
|
}
|
|
806
|
-
})
|
|
803
|
+
} else if (deposit.blockNumber < originChainBlockRange[0]) {
|
|
804
|
+
olderDepositHashes.add(relayDataHash);
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
this.logger.debug({
|
|
@@ -877,7 +877,16 @@ export class BundleDataClient {
|
|
|
877
877
|
|
|
878
878
|
// Since there was no deposit matching the relay hash, we need to do a historical query for an
|
|
879
879
|
// older deposit in case the spoke pool client's lookback isn't old enough to find the matching deposit.
|
|
880
|
+
// We can skip this step if the fill's fill deadline is not infinite, because we can assume that the
|
|
881
|
+
// spoke pool clients have loaded deposits old enough to cover all fills with a non-infinite fill deadline.
|
|
880
882
|
if (fill.blockNumber >= destinationChainBlockRange[0]) {
|
|
883
|
+
// Fill has a non-infinite expiry, and we can assume our spoke pool clients have old enough deposits
|
|
884
|
+
// to conclude that this fill is invalid if we haven't found a matching deposit in memory, so
|
|
885
|
+
// skip the historical query.
|
|
886
|
+
if (!INFINITE_FILL_DEADLINE.eq(fill.fillDeadline)) {
|
|
887
|
+
bundleInvalidFillsV3.push(fill);
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
881
890
|
const historicalDeposit = await queryHistoricalDepositForFill(originClient, fill);
|
|
882
891
|
if (!historicalDeposit.found) {
|
|
883
892
|
bundleInvalidFillsV3.push(fill);
|
|
@@ -975,7 +984,12 @@ export class BundleDataClient {
|
|
|
975
984
|
|
|
976
985
|
// Since there was no deposit matching the relay hash, we need to do a historical query for an
|
|
977
986
|
// older deposit in case the spoke pool client's lookback isn't old enough to find the matching deposit.
|
|
978
|
-
if
|
|
987
|
+
// We can skip this step if the deposit's fill deadline is not infinite, because we can assume that the
|
|
988
|
+
// spoke pool clients have loaded deposits old enough to cover all fills with a non-infinite fill deadline.
|
|
989
|
+
if (
|
|
990
|
+
INFINITE_FILL_DEADLINE.eq(slowFillRequest.fillDeadline) &&
|
|
991
|
+
slowFillRequest.blockNumber >= destinationChainBlockRange[0]
|
|
992
|
+
) {
|
|
979
993
|
const historicalDeposit = await queryHistoricalDepositForFill(originClient, slowFillRequest);
|
|
980
994
|
if (!historicalDeposit.found) {
|
|
981
995
|
// TODO: Invalid slow fill request. Maybe worth logging.
|
|
@@ -1103,7 +1117,7 @@ export class BundleDataClient {
|
|
|
1103
1117
|
// the block ranges passed into this function would never contain blocks where the spoke pool client
|
|
1104
1118
|
// hasn't queried. This is because this function will usually be called
|
|
1105
1119
|
// in production with block ranges that were validated by
|
|
1106
|
-
//
|
|
1120
|
+
// DataworkerUtils.blockRangesAreInvalidForSpokeClients
|
|
1107
1121
|
Math.min(destinationBlockRange[1], spokePoolClients[destinationChainId].latestBlockSearched),
|
|
1108
1122
|
destinationChainId
|
|
1109
1123
|
);
|
|
@@ -1279,7 +1293,7 @@ export class BundleDataClient {
|
|
|
1279
1293
|
// We can assume that in production the block ranges passed into this function would never
|
|
1280
1294
|
// contain blocks where the spoke pool client hasn't queried. This is because this function
|
|
1281
1295
|
// will usually be called in production with block ranges that were validated by
|
|
1282
|
-
//
|
|
1296
|
+
// DataworkerUtils.blockRangesAreInvalidForSpokeClients.
|
|
1283
1297
|
const startBlockForChain = Math.min(_startBlockForChain, spokePoolClient.latestBlockSearched);
|
|
1284
1298
|
const endBlockForChain = Math.min(_endBlockForChain, spokePoolClient.latestBlockSearched);
|
|
1285
1299
|
const [startTime, endTime] = [
|
package/src/providers/alchemy.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { RPCTransport } from "./types";
|
|
|
3
3
|
|
|
4
4
|
const MAINNET_CHAIN_IDs = Object.values(_MAINNET_CHAIN_IDs);
|
|
5
5
|
|
|
6
|
-
// Chain-specific overrides for when the
|
|
6
|
+
// Chain-specific overrides for when the endpoint name does not match the canonical chain name.
|
|
7
7
|
const endpoints: { [chainId: string]: string } = {
|
|
8
8
|
[CHAIN_IDs.ARBITRUM]: "arb",
|
|
9
9
|
[CHAIN_IDs.ARBITRUM_SEPOLIA]: "arb-sepolia",
|
|
@@ -14,15 +14,15 @@ const endpoints: { [chainId: string]: string } = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export function getURL(chainId: number, apiKey: string, transport: RPCTransport): string {
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
17
|
+
let chain = endpoints[chainId] ?? PUBLIC_NETWORKS[chainId]?.name;
|
|
18
|
+
if (!chain) {
|
|
19
19
|
throw new Error(`No known Alchemy provider for chainId ${chainId}`);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if (MAINNET_CHAIN_IDs.includes(chainId)) {
|
|
23
|
-
|
|
23
|
+
chain = `${chain}-mainnet`;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
chain = chain.toLowerCase().replace(" ", "-");
|
|
26
26
|
|
|
27
|
-
return `${transport}://${
|
|
27
|
+
return `${transport}://${chain}.g.alchemy.com/v2/${apiKey}`;
|
|
28
28
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CHAIN_IDs, PUBLIC_NETWORKS } from "../constants";
|
|
2
|
+
import { RPCTransport } from "./types";
|
|
3
|
+
|
|
4
|
+
// Chain-specific overrides for when the endpoint name does not match the canonical chain name.
|
|
5
|
+
const endpoints: { [chainId: string]: string } = {
|
|
6
|
+
[CHAIN_IDs.ARBITRUM]: "arbitrum",
|
|
7
|
+
[CHAIN_IDs.MAINNET]: "ethereum",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function getURL(chainId: number, apiKey: string, transport: RPCTransport): string {
|
|
11
|
+
let chain = endpoints[chainId] ?? PUBLIC_NETWORKS[chainId]?.name;
|
|
12
|
+
if (!chain) {
|
|
13
|
+
throw new Error(`No known DRPC provider for chainId ${chainId}`);
|
|
14
|
+
}
|
|
15
|
+
chain = chain.toLowerCase().replace(" ", "-");
|
|
16
|
+
const rpcType = transport === "https" ? "rpc" : "ws";
|
|
17
|
+
|
|
18
|
+
return `${transport}://lb.drpc.org/og${rpcType}?network=${chain}&dkey=${apiKey}`;
|
|
19
|
+
}
|
package/src/providers/infura.ts
CHANGED
|
@@ -3,21 +3,21 @@ import { RPCTransport } from "./types";
|
|
|
3
3
|
|
|
4
4
|
const MAINNET_CHAIN_IDs = Object.values(_MAINNET_CHAIN_IDs);
|
|
5
5
|
|
|
6
|
-
// Chain-specific overrides for when the
|
|
6
|
+
// Chain-specific overrides for when the endpoint name does not match the canonical chain name.
|
|
7
7
|
const endpoints: { [chainId: string]: string } = {
|
|
8
8
|
[CHAIN_IDs.ARBITRUM]: "arbitrum",
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export function getURL(chainId: number, apiKey: string, transport: RPCTransport): string {
|
|
12
|
-
let
|
|
13
|
-
if (!
|
|
12
|
+
let chain = endpoints[chainId] ?? PUBLIC_NETWORKS[chainId]?.name;
|
|
13
|
+
if (!chain) {
|
|
14
14
|
throw new Error(`No known Infura provider for chainId ${chainId}`);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if (chainId !== CHAIN_IDs.MAINNET && MAINNET_CHAIN_IDs.includes(chainId)) {
|
|
18
|
-
|
|
18
|
+
chain = `${chain}-mainnet`;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
chain = chain.toLowerCase().replace(" ", "-");
|
|
21
21
|
|
|
22
|
-
return transport === "https" ? `https://${
|
|
22
|
+
return transport === "https" ? `https://${chain}.infura.io/v3/${apiKey}` : `wss://${chain}.infura.io/ws/v3/${apiKey}`;
|
|
23
23
|
}
|
package/src/providers/types.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type RPCProvider = "INFURA" | "
|
|
1
|
+
export type RPCProvider = "ALCHEMY" | "DRPC" | "INFURA" | "INFURA_DIN";
|
|
2
2
|
export type RPCTransport = "https" | "wss";
|
package/src/providers/utils.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { isDefined } from "../utils";
|
|
|
6
6
|
import { RPCProvider, RPCTransport } from "./types";
|
|
7
7
|
import * as alchemy from "./alchemy";
|
|
8
8
|
import * as infura from "./infura";
|
|
9
|
+
import * as drpc from "./drpc";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Infura DIN is identified separately to allow it to be configured explicitly.
|
|
@@ -14,6 +15,7 @@ const PROVIDERS = {
|
|
|
14
15
|
ALCHEMY: alchemy.getURL,
|
|
15
16
|
INFURA: infura.getURL,
|
|
16
17
|
INFURA_DIN: infura.getURL,
|
|
18
|
+
DRPC: drpc.getURL,
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -22,7 +24,7 @@ const PROVIDERS = {
|
|
|
22
24
|
* @returns True if the provider string is a supported provider.
|
|
23
25
|
*/
|
|
24
26
|
export function isSupportedProvider(provider: string): provider is RPCProvider {
|
|
25
|
-
return ["ALCHEMY", "INFURA", "INFURA_DIN"].includes(provider);
|
|
27
|
+
return ["ALCHEMY", "INFURA", "INFURA_DIN", "DRPC"].includes(provider);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
/**
|