@sentio/sdk 2.40.0-rc.3 → 2.40.0-rc.31
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/lib/aptos/aptos-processor.d.ts +1 -1
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +1 -1
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/context.d.ts +2 -2
- package/lib/aptos/context.d.ts.map +1 -1
- package/lib/aptos/context.js +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts.map +1 -1
- package/lib/aptos/ext/aptos-dex.js +1 -1
- package/lib/aptos/ext/aptos-dex.js.map +1 -1
- package/lib/aptos/ext/coin-event.d.ts +1 -1
- package/lib/aptos/ext/coin-event.d.ts.map +1 -1
- package/lib/aptos/ext/coin.js +2 -2
- package/lib/aptos/ext/coin.js.map +1 -1
- package/lib/eth/account-processor.d.ts +21 -7
- package/lib/eth/account-processor.d.ts.map +1 -1
- package/lib/eth/account-processor.js +2 -2
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +24 -8
- package/lib/eth/base-processor-template.d.ts.map +1 -1
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +30 -10
- package/lib/eth/base-processor.d.ts.map +1 -1
- package/lib/eth/base-processor.js +6 -6
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +100 -31
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +1295 -46
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts +55 -16
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +510 -16
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts +79 -24
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +1039 -36
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +46 -13
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +512 -18
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts +67 -20
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +826 -28
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts +64 -19
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +607 -22
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/event-handler.js +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +21 -3
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.d.ts +4 -0
- package/lib/eth/codegen/function-calls.d.ts.map +1 -1
- package/lib/eth/codegen/function-calls.js +83 -5
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/codegen/types.d.ts +1 -0
- package/lib/eth/codegen/types.d.ts.map +1 -1
- package/lib/eth/codegen/types.js +13 -0
- package/lib/eth/codegen/types.js.map +1 -1
- package/lib/eth/context.d.ts +4 -0
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +4 -0
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth-plugin.d.ts +27 -9
- package/lib/eth/eth-plugin.d.ts.map +1 -1
- package/lib/eth/eth-plugin.js +20 -17
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/eth.d.ts.map +1 -1
- package/lib/eth/eth.js +1 -1
- package/lib/eth/eth.js.map +1 -1
- package/lib/eth/generic-processor.js +1 -1
- package/lib/eth/generic-processor.js.map +1 -1
- package/lib/eth/generic-processor.test.js.map +1 -1
- package/lib/eth/index.d.ts +2 -1
- package/lib/eth/index.d.ts.map +1 -1
- package/lib/eth/index.js +2 -1
- package/lib/eth/index.js.map +1 -1
- package/lib/solana/builtin/spl-token-processor.d.ts +1 -1
- package/lib/solana/builtin/spl-token-processor.d.ts.map +1 -1
- package/lib/solana/builtin/spl-token-processor.js +1 -1
- package/lib/solana/builtin/spl-token-processor.js.map +1 -1
- package/lib/solana/solana-context.d.ts +1 -1
- package/lib/solana/solana-context.js +2 -2
- package/lib/store/cache.d.ts +14 -0
- package/lib/store/cache.d.ts.map +1 -0
- package/lib/store/cache.js +35 -0
- package/lib/store/cache.js.map +1 -0
- package/lib/store/store.d.ts +2 -3
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +34 -9
- package/lib/store/store.js.map +1 -1
- package/lib/sui/context.d.ts +1 -1
- package/lib/sui/context.d.ts.map +1 -1
- package/lib/sui/sui-processor.d.ts +1 -1
- package/lib/sui/sui-processor.d.ts.map +1 -1
- package/lib/sui/sui-processor.js +1 -1
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/aptos-facet.d.ts +1 -1
- package/lib/testing/aptos-facet.js +2 -2
- package/lib/testing/sui-facet.js +1 -1
- package/lib/utils/dex-price.d.ts +1 -0
- package/lib/utils/dex-price.d.ts.map +1 -1
- package/lib/utils/dex-price.js +13 -2
- package/lib/utils/dex-price.js.map +1 -1
- package/package.json +8 -7
- package/src/aptos/aptos-processor.ts +1 -1
- package/src/aptos/context.ts +2 -2
- package/src/aptos/ext/aptos-dex.ts +1 -1
- package/src/aptos/ext/coin-event.ts +1 -1
- package/src/aptos/ext/coin.ts +2 -2
- package/src/eth/account-processor.ts +28 -12
- package/src/eth/base-processor-template.ts +16 -8
- package/src/eth/base-processor.ts +25 -16
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +1643 -123
- package/src/eth/builtin/internal/erc1155-processor.ts +724 -42
- package/src/eth/builtin/internal/erc20-processor.ts +1368 -90
- package/src/eth/builtin/internal/erc20bytes-processor.ts +685 -49
- package/src/eth/builtin/internal/erc721-processor.ts +1116 -70
- package/src/eth/builtin/internal/weth9-processor.ts +798 -63
- package/src/eth/codegen/event-handler.ts +1 -1
- package/src/eth/codegen/file.ts +26 -3
- package/src/eth/codegen/function-calls.ts +101 -8
- package/src/eth/codegen/types.ts +22 -1
- package/src/eth/context.ts +7 -0
- package/src/eth/eth-plugin.ts +34 -26
- package/src/eth/eth.ts +1 -2
- package/src/eth/generic-processor.ts +1 -1
- package/src/eth/index.ts +5 -1
- package/src/solana/builtin/spl-token-processor.ts +1 -1
- package/src/solana/solana-context.ts +2 -2
- package/src/store/cache.ts +46 -0
- package/src/store/store.ts +40 -22
- package/src/sui/context.ts +1 -1
- package/src/sui/sui-processor.ts +1 -1
- package/src/testing/aptos-facet.ts +2 -2
- package/src/testing/sui-facet.ts +1 -1
- package/src/utils/dex-price.ts +15 -2
- package/lib/eth/provider.d.ts +0 -5
- package/lib/eth/provider.d.ts.map +0 -1
- package/lib/eth/provider.js +0 -134
- package/lib/eth/provider.js.map +0 -1
- package/lib/utils/chainlink-oracles-sepolia.csv +0 -19
- package/lib/utils/chainlink-oracles.csv +0 -217
- package/src/eth/provider.ts +0 -163
@@ -1,7 +1,7 @@
|
|
1
1
|
/* Autogenerated file. Do not edit manually. */
|
2
2
|
/* tslint:disable */
|
3
3
|
/* eslint-disable */
|
4
|
-
import { BigNumberish, Overrides } from "ethers";
|
4
|
+
import { BigNumberish, Overrides, Interface } from "ethers";
|
5
5
|
import {
|
6
6
|
addContractByABI,
|
7
7
|
getContractByABI,
|
@@ -21,7 +21,9 @@ import {
|
|
21
21
|
EthContext,
|
22
22
|
EthFetchConfig,
|
23
23
|
PreprocessResult,
|
24
|
+
makeEthCallKey,
|
24
25
|
} from "@sentio/sdk/eth";
|
26
|
+
import { EthCallParam, EthCallContext, PreparedData } from "@sentio/protos";
|
25
27
|
|
26
28
|
import { WETH9__factory } from "./index.js";
|
27
29
|
import {
|
@@ -112,8 +114,28 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
112
114
|
this.callStatic.contract = contract;
|
113
115
|
}
|
114
116
|
|
115
|
-
async name(
|
117
|
+
async name(
|
118
|
+
overrides?: Overrides,
|
119
|
+
preparedData?: PreparedData,
|
120
|
+
ethCallContext?: EthCallContext
|
121
|
+
): Promise<string> {
|
116
122
|
try {
|
123
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
124
|
+
const iface = new Interface(["function name() view returns (string)"]);
|
125
|
+
const calldata = iface.encodeFunctionData("name", []);
|
126
|
+
const key = makeEthCallKey({
|
127
|
+
context: ethCallContext,
|
128
|
+
calldata,
|
129
|
+
});
|
130
|
+
console.debug("looking up eth call key:", key);
|
131
|
+
const ret = preparedData.ethCallResults[key];
|
132
|
+
if (ret) {
|
133
|
+
console.debug("prepared eth call found:", key);
|
134
|
+
const result = iface.decodeFunctionResult("name", ret).toArray();
|
135
|
+
return result.length == 1 ? result[0] : result;
|
136
|
+
}
|
137
|
+
console.debug("missing eth call key:", "name", key);
|
138
|
+
}
|
117
139
|
return await this.contract.getFunction("name()")(overrides || {});
|
118
140
|
} catch (e) {
|
119
141
|
const stack = new Error().stack;
|
@@ -121,8 +143,32 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
121
143
|
}
|
122
144
|
}
|
123
145
|
|
124
|
-
async totalSupply(
|
146
|
+
async totalSupply(
|
147
|
+
overrides?: Overrides,
|
148
|
+
preparedData?: PreparedData,
|
149
|
+
ethCallContext?: EthCallContext
|
150
|
+
): Promise<bigint> {
|
125
151
|
try {
|
152
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
153
|
+
const iface = new Interface([
|
154
|
+
"function totalSupply() view returns (uint256)",
|
155
|
+
]);
|
156
|
+
const calldata = iface.encodeFunctionData("totalSupply", []);
|
157
|
+
const key = makeEthCallKey({
|
158
|
+
context: ethCallContext,
|
159
|
+
calldata,
|
160
|
+
});
|
161
|
+
console.debug("looking up eth call key:", key);
|
162
|
+
const ret = preparedData.ethCallResults[key];
|
163
|
+
if (ret) {
|
164
|
+
console.debug("prepared eth call found:", key);
|
165
|
+
const result = iface
|
166
|
+
.decodeFunctionResult("totalSupply", ret)
|
167
|
+
.toArray();
|
168
|
+
return result.length == 1 ? result[0] : result;
|
169
|
+
}
|
170
|
+
console.debug("missing eth call key:", "totalSupply", key);
|
171
|
+
}
|
126
172
|
return await this.contract.getFunction("totalSupply()")(overrides || {});
|
127
173
|
} catch (e) {
|
128
174
|
const stack = new Error().stack;
|
@@ -130,8 +176,30 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
130
176
|
}
|
131
177
|
}
|
132
178
|
|
133
|
-
async decimals(
|
179
|
+
async decimals(
|
180
|
+
overrides?: Overrides,
|
181
|
+
preparedData?: PreparedData,
|
182
|
+
ethCallContext?: EthCallContext
|
183
|
+
): Promise<bigint> {
|
134
184
|
try {
|
185
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
186
|
+
const iface = new Interface([
|
187
|
+
"function decimals() view returns (uint8)",
|
188
|
+
]);
|
189
|
+
const calldata = iface.encodeFunctionData("decimals", []);
|
190
|
+
const key = makeEthCallKey({
|
191
|
+
context: ethCallContext,
|
192
|
+
calldata,
|
193
|
+
});
|
194
|
+
console.debug("looking up eth call key:", key);
|
195
|
+
const ret = preparedData.ethCallResults[key];
|
196
|
+
if (ret) {
|
197
|
+
console.debug("prepared eth call found:", key);
|
198
|
+
const result = iface.decodeFunctionResult("decimals", ret).toArray();
|
199
|
+
return result.length == 1 ? result[0] : result;
|
200
|
+
}
|
201
|
+
console.debug("missing eth call key:", "decimals", key);
|
202
|
+
}
|
135
203
|
return await this.contract.getFunction("decimals()")(overrides || {});
|
136
204
|
} catch (e) {
|
137
205
|
const stack = new Error().stack;
|
@@ -139,8 +207,31 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
139
207
|
}
|
140
208
|
}
|
141
209
|
|
142
|
-
async balanceOf(
|
210
|
+
async balanceOf(
|
211
|
+
arg0: string,
|
212
|
+
overrides?: Overrides,
|
213
|
+
preparedData?: PreparedData,
|
214
|
+
ethCallContext?: EthCallContext
|
215
|
+
): Promise<bigint> {
|
143
216
|
try {
|
217
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
218
|
+
const iface = new Interface([
|
219
|
+
"function balanceOf(address) view returns (uint256)",
|
220
|
+
]);
|
221
|
+
const calldata = iface.encodeFunctionData("balanceOf", [arg0]);
|
222
|
+
const key = makeEthCallKey({
|
223
|
+
context: ethCallContext,
|
224
|
+
calldata,
|
225
|
+
});
|
226
|
+
console.debug("looking up eth call key:", key);
|
227
|
+
const ret = preparedData.ethCallResults[key];
|
228
|
+
if (ret) {
|
229
|
+
console.debug("prepared eth call found:", key);
|
230
|
+
const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
|
231
|
+
return result.length == 1 ? result[0] : result;
|
232
|
+
}
|
233
|
+
console.debug("missing eth call key:", "balanceOf", arg0, key);
|
234
|
+
}
|
144
235
|
return await this.contract.getFunction("balanceOf(address)")(
|
145
236
|
arg0,
|
146
237
|
overrides || {}
|
@@ -151,8 +242,30 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
151
242
|
}
|
152
243
|
}
|
153
244
|
|
154
|
-
async symbol(
|
245
|
+
async symbol(
|
246
|
+
overrides?: Overrides,
|
247
|
+
preparedData?: PreparedData,
|
248
|
+
ethCallContext?: EthCallContext
|
249
|
+
): Promise<string> {
|
155
250
|
try {
|
251
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
252
|
+
const iface = new Interface([
|
253
|
+
"function symbol() view returns (string)",
|
254
|
+
]);
|
255
|
+
const calldata = iface.encodeFunctionData("symbol", []);
|
256
|
+
const key = makeEthCallKey({
|
257
|
+
context: ethCallContext,
|
258
|
+
calldata,
|
259
|
+
});
|
260
|
+
console.debug("looking up eth call key:", key);
|
261
|
+
const ret = preparedData.ethCallResults[key];
|
262
|
+
if (ret) {
|
263
|
+
console.debug("prepared eth call found:", key);
|
264
|
+
const result = iface.decodeFunctionResult("symbol", ret).toArray();
|
265
|
+
return result.length == 1 ? result[0] : result;
|
266
|
+
}
|
267
|
+
console.debug("missing eth call key:", "symbol", key);
|
268
|
+
}
|
156
269
|
return await this.contract.getFunction("symbol()")(overrides || {});
|
157
270
|
} catch (e) {
|
158
271
|
const stack = new Error().stack;
|
@@ -163,9 +276,29 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
163
276
|
async allowance(
|
164
277
|
arg0: string,
|
165
278
|
arg1: string,
|
166
|
-
overrides?: Overrides
|
279
|
+
overrides?: Overrides,
|
280
|
+
preparedData?: PreparedData,
|
281
|
+
ethCallContext?: EthCallContext
|
167
282
|
): Promise<bigint> {
|
168
283
|
try {
|
284
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
285
|
+
const iface = new Interface([
|
286
|
+
"function allowance(address,address) view returns (uint256)",
|
287
|
+
]);
|
288
|
+
const calldata = iface.encodeFunctionData("allowance", [arg0, arg1]);
|
289
|
+
const key = makeEthCallKey({
|
290
|
+
context: ethCallContext,
|
291
|
+
calldata,
|
292
|
+
});
|
293
|
+
console.debug("looking up eth call key:", key);
|
294
|
+
const ret = preparedData.ethCallResults[key];
|
295
|
+
if (ret) {
|
296
|
+
console.debug("prepared eth call found:", key);
|
297
|
+
const result = iface.decodeFunctionResult("allowance", ret).toArray();
|
298
|
+
return result.length == 1 ? result[0] : result;
|
299
|
+
}
|
300
|
+
console.debug("missing eth call key:", "allowance", arg0, arg1, key);
|
301
|
+
}
|
169
302
|
return await this.contract.getFunction("allowance(address,address)")(
|
170
303
|
arg0,
|
171
304
|
arg1,
|
@@ -183,9 +316,29 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
183
316
|
async approve(
|
184
317
|
guy: string,
|
185
318
|
wad: BigNumberish,
|
186
|
-
overrides?: Overrides
|
319
|
+
overrides?: Overrides,
|
320
|
+
preparedData?: PreparedData,
|
321
|
+
ethCallContext?: EthCallContext
|
187
322
|
): Promise<boolean> {
|
188
323
|
try {
|
324
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
325
|
+
const iface = new Interface([
|
326
|
+
"function approve(address,uint256) nonpayable returns (bool)",
|
327
|
+
]);
|
328
|
+
const calldata = iface.encodeFunctionData("approve", [guy, wad]);
|
329
|
+
const key = makeEthCallKey({
|
330
|
+
context: ethCallContext,
|
331
|
+
calldata,
|
332
|
+
});
|
333
|
+
console.debug("looking up eth call key:", key);
|
334
|
+
const ret = preparedData.ethCallResults[key];
|
335
|
+
if (ret) {
|
336
|
+
console.debug("prepared eth call found:", key);
|
337
|
+
const result = iface.decodeFunctionResult("approve", ret).toArray();
|
338
|
+
return result.length == 1 ? result[0] : result;
|
339
|
+
}
|
340
|
+
console.debug("missing eth call key:", "approve", guy, wad, key);
|
341
|
+
}
|
189
342
|
return await this.contract
|
190
343
|
.getFunction("approve(address,uint256)")
|
191
344
|
.staticCall(guy, wad, overrides || {});
|
@@ -198,9 +351,42 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
198
351
|
src: string,
|
199
352
|
dst: string,
|
200
353
|
wad: BigNumberish,
|
201
|
-
overrides?: Overrides
|
354
|
+
overrides?: Overrides,
|
355
|
+
preparedData?: PreparedData,
|
356
|
+
ethCallContext?: EthCallContext
|
202
357
|
): Promise<boolean> {
|
203
358
|
try {
|
359
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
360
|
+
const iface = new Interface([
|
361
|
+
"function transferFrom(address,address,uint256) nonpayable returns (bool)",
|
362
|
+
]);
|
363
|
+
const calldata = iface.encodeFunctionData("transferFrom", [
|
364
|
+
src,
|
365
|
+
dst,
|
366
|
+
wad,
|
367
|
+
]);
|
368
|
+
const key = makeEthCallKey({
|
369
|
+
context: ethCallContext,
|
370
|
+
calldata,
|
371
|
+
});
|
372
|
+
console.debug("looking up eth call key:", key);
|
373
|
+
const ret = preparedData.ethCallResults[key];
|
374
|
+
if (ret) {
|
375
|
+
console.debug("prepared eth call found:", key);
|
376
|
+
const result = iface
|
377
|
+
.decodeFunctionResult("transferFrom", ret)
|
378
|
+
.toArray();
|
379
|
+
return result.length == 1 ? result[0] : result;
|
380
|
+
}
|
381
|
+
console.debug(
|
382
|
+
"missing eth call key:",
|
383
|
+
"transferFrom",
|
384
|
+
src,
|
385
|
+
dst,
|
386
|
+
wad,
|
387
|
+
key
|
388
|
+
);
|
389
|
+
}
|
204
390
|
return await this.contract
|
205
391
|
.getFunction("transferFrom(address,address,uint256)")
|
206
392
|
.staticCall(src, dst, wad, overrides || {});
|
@@ -209,8 +395,33 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
209
395
|
throw transformEtherError(e, undefined, stack);
|
210
396
|
}
|
211
397
|
},
|
212
|
-
async withdraw(
|
398
|
+
async withdraw(
|
399
|
+
wad: BigNumberish,
|
400
|
+
overrides?: Overrides,
|
401
|
+
preparedData?: PreparedData,
|
402
|
+
ethCallContext?: EthCallContext
|
403
|
+
): Promise<void> {
|
213
404
|
try {
|
405
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
406
|
+
const iface = new Interface([
|
407
|
+
"function withdraw(uint256) nonpayable returns ()",
|
408
|
+
]);
|
409
|
+
const calldata = iface.encodeFunctionData("withdraw", [wad]);
|
410
|
+
const key = makeEthCallKey({
|
411
|
+
context: ethCallContext,
|
412
|
+
calldata,
|
413
|
+
});
|
414
|
+
console.debug("looking up eth call key:", key);
|
415
|
+
const ret = preparedData.ethCallResults[key];
|
416
|
+
if (ret) {
|
417
|
+
console.debug("prepared eth call found:", key);
|
418
|
+
const result = iface
|
419
|
+
.decodeFunctionResult("withdraw", ret)
|
420
|
+
.toArray();
|
421
|
+
return result.length == 1 ? result[0] : result;
|
422
|
+
}
|
423
|
+
console.debug("missing eth call key:", "withdraw", wad, key);
|
424
|
+
}
|
214
425
|
return await this.contract
|
215
426
|
.getFunction("withdraw(uint256)")
|
216
427
|
.staticCall(wad, overrides || {});
|
@@ -222,9 +433,31 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
222
433
|
async transfer(
|
223
434
|
dst: string,
|
224
435
|
wad: BigNumberish,
|
225
|
-
overrides?: Overrides
|
436
|
+
overrides?: Overrides,
|
437
|
+
preparedData?: PreparedData,
|
438
|
+
ethCallContext?: EthCallContext
|
226
439
|
): Promise<boolean> {
|
227
440
|
try {
|
441
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
442
|
+
const iface = new Interface([
|
443
|
+
"function transfer(address,uint256) nonpayable returns (bool)",
|
444
|
+
]);
|
445
|
+
const calldata = iface.encodeFunctionData("transfer", [dst, wad]);
|
446
|
+
const key = makeEthCallKey({
|
447
|
+
context: ethCallContext,
|
448
|
+
calldata,
|
449
|
+
});
|
450
|
+
console.debug("looking up eth call key:", key);
|
451
|
+
const ret = preparedData.ethCallResults[key];
|
452
|
+
if (ret) {
|
453
|
+
console.debug("prepared eth call found:", key);
|
454
|
+
const result = iface
|
455
|
+
.decodeFunctionResult("transfer", ret)
|
456
|
+
.toArray();
|
457
|
+
return result.length == 1 ? result[0] : result;
|
458
|
+
}
|
459
|
+
console.debug("missing eth call key:", "transfer", dst, wad, key);
|
460
|
+
}
|
228
461
|
return await this.contract
|
229
462
|
.getFunction("transfer(address,uint256)")
|
230
463
|
.staticCall(dst, wad, overrides || {});
|
@@ -233,8 +466,30 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
233
466
|
throw transformEtherError(e, undefined, stack);
|
234
467
|
}
|
235
468
|
},
|
236
|
-
async deposit(
|
469
|
+
async deposit(
|
470
|
+
overrides?: Overrides,
|
471
|
+
preparedData?: PreparedData,
|
472
|
+
ethCallContext?: EthCallContext
|
473
|
+
): Promise<void> {
|
237
474
|
try {
|
475
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
476
|
+
const iface = new Interface([
|
477
|
+
"function deposit() payable returns ()",
|
478
|
+
]);
|
479
|
+
const calldata = iface.encodeFunctionData("deposit", []);
|
480
|
+
const key = makeEthCallKey({
|
481
|
+
context: ethCallContext,
|
482
|
+
calldata,
|
483
|
+
});
|
484
|
+
console.debug("looking up eth call key:", key);
|
485
|
+
const ret = preparedData.ethCallResults[key];
|
486
|
+
if (ret) {
|
487
|
+
console.debug("prepared eth call found:", key);
|
488
|
+
const result = iface.decodeFunctionResult("deposit", ret).toArray();
|
489
|
+
return result.length == 1 ? result[0] : result;
|
490
|
+
}
|
491
|
+
console.debug("missing eth call key:", "deposit", key);
|
492
|
+
}
|
238
493
|
return await this.contract
|
239
494
|
.getFunction("deposit()")
|
240
495
|
.staticCall(overrides || {});
|
@@ -244,6 +499,175 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
244
499
|
}
|
245
500
|
},
|
246
501
|
};
|
502
|
+
|
503
|
+
encodeCall = {
|
504
|
+
name(ethCallContext: EthCallContext): EthCallParam {
|
505
|
+
try {
|
506
|
+
const iface = new Interface(["function name()"]);
|
507
|
+
const calldata = iface.encodeFunctionData("name", []);
|
508
|
+
return {
|
509
|
+
context: ethCallContext,
|
510
|
+
calldata,
|
511
|
+
};
|
512
|
+
} catch (e) {
|
513
|
+
const stack = new Error().stack;
|
514
|
+
throw transformEtherError(e, undefined, stack);
|
515
|
+
}
|
516
|
+
},
|
517
|
+
approve(
|
518
|
+
guy: string,
|
519
|
+
wad: BigNumberish,
|
520
|
+
ethCallContext: EthCallContext
|
521
|
+
): EthCallParam {
|
522
|
+
try {
|
523
|
+
const iface = new Interface(["function approve(address,uint256)"]);
|
524
|
+
const calldata = iface.encodeFunctionData("approve", [guy, wad]);
|
525
|
+
return {
|
526
|
+
context: ethCallContext,
|
527
|
+
calldata,
|
528
|
+
};
|
529
|
+
} catch (e) {
|
530
|
+
const stack = new Error().stack;
|
531
|
+
throw transformEtherError(e, undefined, stack);
|
532
|
+
}
|
533
|
+
},
|
534
|
+
totalSupply(ethCallContext: EthCallContext): EthCallParam {
|
535
|
+
try {
|
536
|
+
const iface = new Interface(["function totalSupply()"]);
|
537
|
+
const calldata = iface.encodeFunctionData("totalSupply", []);
|
538
|
+
return {
|
539
|
+
context: ethCallContext,
|
540
|
+
calldata,
|
541
|
+
};
|
542
|
+
} catch (e) {
|
543
|
+
const stack = new Error().stack;
|
544
|
+
throw transformEtherError(e, undefined, stack);
|
545
|
+
}
|
546
|
+
},
|
547
|
+
transferFrom(
|
548
|
+
src: string,
|
549
|
+
dst: string,
|
550
|
+
wad: BigNumberish,
|
551
|
+
ethCallContext: EthCallContext
|
552
|
+
): EthCallParam {
|
553
|
+
try {
|
554
|
+
const iface = new Interface([
|
555
|
+
"function transferFrom(address,address,uint256)",
|
556
|
+
]);
|
557
|
+
const calldata = iface.encodeFunctionData("transferFrom", [
|
558
|
+
src,
|
559
|
+
dst,
|
560
|
+
wad,
|
561
|
+
]);
|
562
|
+
return {
|
563
|
+
context: ethCallContext,
|
564
|
+
calldata,
|
565
|
+
};
|
566
|
+
} catch (e) {
|
567
|
+
const stack = new Error().stack;
|
568
|
+
throw transformEtherError(e, undefined, stack);
|
569
|
+
}
|
570
|
+
},
|
571
|
+
withdraw(wad: BigNumberish, ethCallContext: EthCallContext): EthCallParam {
|
572
|
+
try {
|
573
|
+
const iface = new Interface(["function withdraw(uint256)"]);
|
574
|
+
const calldata = iface.encodeFunctionData("withdraw", [wad]);
|
575
|
+
return {
|
576
|
+
context: ethCallContext,
|
577
|
+
calldata,
|
578
|
+
};
|
579
|
+
} catch (e) {
|
580
|
+
const stack = new Error().stack;
|
581
|
+
throw transformEtherError(e, undefined, stack);
|
582
|
+
}
|
583
|
+
},
|
584
|
+
decimals(ethCallContext: EthCallContext): EthCallParam {
|
585
|
+
try {
|
586
|
+
const iface = new Interface(["function decimals()"]);
|
587
|
+
const calldata = iface.encodeFunctionData("decimals", []);
|
588
|
+
return {
|
589
|
+
context: ethCallContext,
|
590
|
+
calldata,
|
591
|
+
};
|
592
|
+
} catch (e) {
|
593
|
+
const stack = new Error().stack;
|
594
|
+
throw transformEtherError(e, undefined, stack);
|
595
|
+
}
|
596
|
+
},
|
597
|
+
balanceOf(arg0: string, ethCallContext: EthCallContext): EthCallParam {
|
598
|
+
try {
|
599
|
+
const iface = new Interface(["function balanceOf(address)"]);
|
600
|
+
const calldata = iface.encodeFunctionData("balanceOf", [arg0]);
|
601
|
+
return {
|
602
|
+
context: ethCallContext,
|
603
|
+
calldata,
|
604
|
+
};
|
605
|
+
} catch (e) {
|
606
|
+
const stack = new Error().stack;
|
607
|
+
throw transformEtherError(e, undefined, stack);
|
608
|
+
}
|
609
|
+
},
|
610
|
+
symbol(ethCallContext: EthCallContext): EthCallParam {
|
611
|
+
try {
|
612
|
+
const iface = new Interface(["function symbol()"]);
|
613
|
+
const calldata = iface.encodeFunctionData("symbol", []);
|
614
|
+
return {
|
615
|
+
context: ethCallContext,
|
616
|
+
calldata,
|
617
|
+
};
|
618
|
+
} catch (e) {
|
619
|
+
const stack = new Error().stack;
|
620
|
+
throw transformEtherError(e, undefined, stack);
|
621
|
+
}
|
622
|
+
},
|
623
|
+
transfer(
|
624
|
+
dst: string,
|
625
|
+
wad: BigNumberish,
|
626
|
+
ethCallContext: EthCallContext
|
627
|
+
): EthCallParam {
|
628
|
+
try {
|
629
|
+
const iface = new Interface(["function transfer(address,uint256)"]);
|
630
|
+
const calldata = iface.encodeFunctionData("transfer", [dst, wad]);
|
631
|
+
return {
|
632
|
+
context: ethCallContext,
|
633
|
+
calldata,
|
634
|
+
};
|
635
|
+
} catch (e) {
|
636
|
+
const stack = new Error().stack;
|
637
|
+
throw transformEtherError(e, undefined, stack);
|
638
|
+
}
|
639
|
+
},
|
640
|
+
deposit(ethCallContext: EthCallContext): EthCallParam {
|
641
|
+
try {
|
642
|
+
const iface = new Interface(["function deposit()"]);
|
643
|
+
const calldata = iface.encodeFunctionData("deposit", []);
|
644
|
+
return {
|
645
|
+
context: ethCallContext,
|
646
|
+
calldata,
|
647
|
+
};
|
648
|
+
} catch (e) {
|
649
|
+
const stack = new Error().stack;
|
650
|
+
throw transformEtherError(e, undefined, stack);
|
651
|
+
}
|
652
|
+
},
|
653
|
+
allowance(
|
654
|
+
arg0: string,
|
655
|
+
arg1: string,
|
656
|
+
ethCallContext: EthCallContext
|
657
|
+
): EthCallParam {
|
658
|
+
try {
|
659
|
+
const iface = new Interface(["function allowance(address,address)"]);
|
660
|
+
const calldata = iface.encodeFunctionData("allowance", [arg0, arg1]);
|
661
|
+
return {
|
662
|
+
context: ethCallContext,
|
663
|
+
calldata,
|
664
|
+
};
|
665
|
+
} catch (e) {
|
666
|
+
const stack = new Error().stack;
|
667
|
+
throw transformEtherError(e, undefined, stack);
|
668
|
+
}
|
669
|
+
},
|
670
|
+
};
|
247
671
|
}
|
248
672
|
|
249
673
|
export class WETH9BoundContractView extends BoundContractView<
|
@@ -251,38 +675,84 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
251
675
|
WETH9ContractView
|
252
676
|
> {
|
253
677
|
async name(overrides?: Overrides): Promise<string> {
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
678
|
+
const ethCallContext = {
|
679
|
+
chainId: this.context.chainId,
|
680
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
681
|
+
address: this.context.address,
|
682
|
+
};
|
683
|
+
return await this.view.name(
|
684
|
+
{
|
685
|
+
blockTag: this.context.blockNumber,
|
686
|
+
...overrides,
|
687
|
+
},
|
688
|
+
this.context.preparedData,
|
689
|
+
ethCallContext
|
690
|
+
);
|
258
691
|
}
|
259
692
|
|
260
693
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
694
|
+
const ethCallContext = {
|
695
|
+
chainId: this.context.chainId,
|
696
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
697
|
+
address: this.context.address,
|
698
|
+
};
|
699
|
+
return await this.view.totalSupply(
|
700
|
+
{
|
701
|
+
blockTag: this.context.blockNumber,
|
702
|
+
...overrides,
|
703
|
+
},
|
704
|
+
this.context.preparedData,
|
705
|
+
ethCallContext
|
706
|
+
);
|
265
707
|
}
|
266
708
|
|
267
709
|
async decimals(overrides?: Overrides): Promise<bigint> {
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
710
|
+
const ethCallContext = {
|
711
|
+
chainId: this.context.chainId,
|
712
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
713
|
+
address: this.context.address,
|
714
|
+
};
|
715
|
+
return await this.view.decimals(
|
716
|
+
{
|
717
|
+
blockTag: this.context.blockNumber,
|
718
|
+
...overrides,
|
719
|
+
},
|
720
|
+
this.context.preparedData,
|
721
|
+
ethCallContext
|
722
|
+
);
|
272
723
|
}
|
273
724
|
|
274
725
|
async balanceOf(arg0: string, overrides?: Overrides): Promise<bigint> {
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
726
|
+
const ethCallContext = {
|
727
|
+
chainId: this.context.chainId,
|
728
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
729
|
+
address: this.context.address,
|
730
|
+
};
|
731
|
+
return await this.view.balanceOf(
|
732
|
+
arg0,
|
733
|
+
{
|
734
|
+
blockTag: this.context.blockNumber,
|
735
|
+
...overrides,
|
736
|
+
},
|
737
|
+
this.context.preparedData,
|
738
|
+
ethCallContext
|
739
|
+
);
|
279
740
|
}
|
280
741
|
|
281
742
|
async symbol(overrides?: Overrides): Promise<string> {
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
743
|
+
const ethCallContext = {
|
744
|
+
chainId: this.context.chainId,
|
745
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
746
|
+
address: this.context.address,
|
747
|
+
};
|
748
|
+
return await this.view.symbol(
|
749
|
+
{
|
750
|
+
blockTag: this.context.blockNumber,
|
751
|
+
...overrides,
|
752
|
+
},
|
753
|
+
this.context.preparedData,
|
754
|
+
ethCallContext
|
755
|
+
);
|
286
756
|
}
|
287
757
|
|
288
758
|
async allowance(
|
@@ -290,10 +760,21 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
290
760
|
arg1: string,
|
291
761
|
overrides?: Overrides
|
292
762
|
): Promise<bigint> {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
763
|
+
const ethCallContext = {
|
764
|
+
chainId: this.context.chainId,
|
765
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
766
|
+
address: this.context.address,
|
767
|
+
};
|
768
|
+
return await this.view.allowance(
|
769
|
+
arg0,
|
770
|
+
arg1,
|
771
|
+
{
|
772
|
+
blockTag: this.context.blockNumber,
|
773
|
+
...overrides,
|
774
|
+
},
|
775
|
+
this.context.preparedData,
|
776
|
+
ethCallContext
|
777
|
+
);
|
297
778
|
}
|
298
779
|
|
299
780
|
callStatic = {
|
@@ -305,10 +786,21 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
305
786
|
wad: BigNumberish,
|
306
787
|
overrides?: Overrides
|
307
788
|
): Promise<boolean> {
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
789
|
+
const ethCallContext = {
|
790
|
+
chainId: this.context.chainId,
|
791
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
792
|
+
address: this.context.address,
|
793
|
+
};
|
794
|
+
return await this.view.callStatic.approve(
|
795
|
+
guy,
|
796
|
+
wad,
|
797
|
+
{
|
798
|
+
blockTag: this.context.blockNumber,
|
799
|
+
...overrides,
|
800
|
+
},
|
801
|
+
this.context.preparedData,
|
802
|
+
ethCallContext
|
803
|
+
);
|
312
804
|
},
|
313
805
|
async transferFrom(
|
314
806
|
src: string,
|
@@ -316,31 +808,266 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
316
808
|
wad: BigNumberish,
|
317
809
|
overrides?: Overrides
|
318
810
|
): Promise<boolean> {
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
811
|
+
const ethCallContext = {
|
812
|
+
chainId: this.context.chainId,
|
813
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
814
|
+
address: this.context.address,
|
815
|
+
};
|
816
|
+
return await this.view.callStatic.transferFrom(
|
817
|
+
src,
|
818
|
+
dst,
|
819
|
+
wad,
|
820
|
+
{
|
821
|
+
blockTag: this.context.blockNumber,
|
822
|
+
...overrides,
|
823
|
+
},
|
824
|
+
this.context.preparedData,
|
825
|
+
ethCallContext
|
826
|
+
);
|
323
827
|
},
|
324
828
|
async withdraw(wad: BigNumberish, overrides?: Overrides): Promise<void> {
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
829
|
+
const ethCallContext = {
|
830
|
+
chainId: this.context.chainId,
|
831
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
832
|
+
address: this.context.address,
|
833
|
+
};
|
834
|
+
return await this.view.callStatic.withdraw(
|
835
|
+
wad,
|
836
|
+
{
|
837
|
+
blockTag: this.context.blockNumber,
|
838
|
+
...overrides,
|
839
|
+
},
|
840
|
+
this.context.preparedData,
|
841
|
+
ethCallContext
|
842
|
+
);
|
329
843
|
},
|
330
844
|
async transfer(
|
331
845
|
dst: string,
|
332
846
|
wad: BigNumberish,
|
333
847
|
overrides?: Overrides
|
334
848
|
): Promise<boolean> {
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
849
|
+
const ethCallContext = {
|
850
|
+
chainId: this.context.chainId,
|
851
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
852
|
+
address: this.context.address,
|
853
|
+
};
|
854
|
+
return await this.view.callStatic.transfer(
|
855
|
+
dst,
|
856
|
+
wad,
|
857
|
+
{
|
858
|
+
blockTag: this.context.blockNumber,
|
859
|
+
...overrides,
|
860
|
+
},
|
861
|
+
this.context.preparedData,
|
862
|
+
ethCallContext
|
863
|
+
);
|
339
864
|
},
|
340
865
|
async deposit(overrides?: Overrides): Promise<void> {
|
341
|
-
|
342
|
-
|
343
|
-
|
866
|
+
const ethCallContext = {
|
867
|
+
chainId: this.context.chainId,
|
868
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
869
|
+
address: this.context.address,
|
870
|
+
};
|
871
|
+
return await this.view.callStatic.deposit(
|
872
|
+
{
|
873
|
+
blockTag: this.context.blockNumber,
|
874
|
+
...overrides,
|
875
|
+
},
|
876
|
+
this.context.preparedData,
|
877
|
+
ethCallContext
|
878
|
+
);
|
879
|
+
},
|
880
|
+
};
|
881
|
+
|
882
|
+
encodeCall = {
|
883
|
+
view: this.view,
|
884
|
+
context: this.context,
|
885
|
+
|
886
|
+
name(overrides?: Overrides): EthCallParam {
|
887
|
+
const chainId =
|
888
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
889
|
+
const address = this.context.address;
|
890
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
891
|
+
if (overrides?.blockTag) {
|
892
|
+
blockTag =
|
893
|
+
typeof overrides.blockTag == "string"
|
894
|
+
? overrides.blockTag
|
895
|
+
: "0x" + overrides.blockTag.toString(16);
|
896
|
+
}
|
897
|
+
|
898
|
+
return this.view.encodeCall.name({ chainId, address, blockTag });
|
899
|
+
},
|
900
|
+
approve(
|
901
|
+
guy: string,
|
902
|
+
wad: BigNumberish,
|
903
|
+
overrides?: Overrides
|
904
|
+
): EthCallParam {
|
905
|
+
const chainId =
|
906
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
907
|
+
const address = this.context.address;
|
908
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
909
|
+
if (overrides?.blockTag) {
|
910
|
+
blockTag =
|
911
|
+
typeof overrides.blockTag == "string"
|
912
|
+
? overrides.blockTag
|
913
|
+
: "0x" + overrides.blockTag.toString(16);
|
914
|
+
}
|
915
|
+
|
916
|
+
return this.view.encodeCall.approve(guy, wad, {
|
917
|
+
chainId,
|
918
|
+
address,
|
919
|
+
blockTag,
|
920
|
+
});
|
921
|
+
},
|
922
|
+
totalSupply(overrides?: Overrides): EthCallParam {
|
923
|
+
const chainId =
|
924
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
925
|
+
const address = this.context.address;
|
926
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
927
|
+
if (overrides?.blockTag) {
|
928
|
+
blockTag =
|
929
|
+
typeof overrides.blockTag == "string"
|
930
|
+
? overrides.blockTag
|
931
|
+
: "0x" + overrides.blockTag.toString(16);
|
932
|
+
}
|
933
|
+
|
934
|
+
return this.view.encodeCall.totalSupply({ chainId, address, blockTag });
|
935
|
+
},
|
936
|
+
transferFrom(
|
937
|
+
src: string,
|
938
|
+
dst: string,
|
939
|
+
wad: BigNumberish,
|
940
|
+
overrides?: Overrides
|
941
|
+
): EthCallParam {
|
942
|
+
const chainId =
|
943
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
944
|
+
const address = this.context.address;
|
945
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
946
|
+
if (overrides?.blockTag) {
|
947
|
+
blockTag =
|
948
|
+
typeof overrides.blockTag == "string"
|
949
|
+
? overrides.blockTag
|
950
|
+
: "0x" + overrides.blockTag.toString(16);
|
951
|
+
}
|
952
|
+
|
953
|
+
return this.view.encodeCall.transferFrom(src, dst, wad, {
|
954
|
+
chainId,
|
955
|
+
address,
|
956
|
+
blockTag,
|
957
|
+
});
|
958
|
+
},
|
959
|
+
withdraw(wad: BigNumberish, overrides?: Overrides): EthCallParam {
|
960
|
+
const chainId =
|
961
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
962
|
+
const address = this.context.address;
|
963
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
964
|
+
if (overrides?.blockTag) {
|
965
|
+
blockTag =
|
966
|
+
typeof overrides.blockTag == "string"
|
967
|
+
? overrides.blockTag
|
968
|
+
: "0x" + overrides.blockTag.toString(16);
|
969
|
+
}
|
970
|
+
|
971
|
+
return this.view.encodeCall.withdraw(wad, { chainId, address, blockTag });
|
972
|
+
},
|
973
|
+
decimals(overrides?: Overrides): EthCallParam {
|
974
|
+
const chainId =
|
975
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
976
|
+
const address = this.context.address;
|
977
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
978
|
+
if (overrides?.blockTag) {
|
979
|
+
blockTag =
|
980
|
+
typeof overrides.blockTag == "string"
|
981
|
+
? overrides.blockTag
|
982
|
+
: "0x" + overrides.blockTag.toString(16);
|
983
|
+
}
|
984
|
+
|
985
|
+
return this.view.encodeCall.decimals({ chainId, address, blockTag });
|
986
|
+
},
|
987
|
+
balanceOf(arg0: string, overrides?: Overrides): EthCallParam {
|
988
|
+
const chainId =
|
989
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
990
|
+
const address = this.context.address;
|
991
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
992
|
+
if (overrides?.blockTag) {
|
993
|
+
blockTag =
|
994
|
+
typeof overrides.blockTag == "string"
|
995
|
+
? overrides.blockTag
|
996
|
+
: "0x" + overrides.blockTag.toString(16);
|
997
|
+
}
|
998
|
+
|
999
|
+
return this.view.encodeCall.balanceOf(arg0, {
|
1000
|
+
chainId,
|
1001
|
+
address,
|
1002
|
+
blockTag,
|
1003
|
+
});
|
1004
|
+
},
|
1005
|
+
symbol(overrides?: Overrides): EthCallParam {
|
1006
|
+
const chainId =
|
1007
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
1008
|
+
const address = this.context.address;
|
1009
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
1010
|
+
if (overrides?.blockTag) {
|
1011
|
+
blockTag =
|
1012
|
+
typeof overrides.blockTag == "string"
|
1013
|
+
? overrides.blockTag
|
1014
|
+
: "0x" + overrides.blockTag.toString(16);
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
return this.view.encodeCall.symbol({ chainId, address, blockTag });
|
1018
|
+
},
|
1019
|
+
transfer(
|
1020
|
+
dst: string,
|
1021
|
+
wad: BigNumberish,
|
1022
|
+
overrides?: Overrides
|
1023
|
+
): EthCallParam {
|
1024
|
+
const chainId =
|
1025
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
1026
|
+
const address = this.context.address;
|
1027
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
1028
|
+
if (overrides?.blockTag) {
|
1029
|
+
blockTag =
|
1030
|
+
typeof overrides.blockTag == "string"
|
1031
|
+
? overrides.blockTag
|
1032
|
+
: "0x" + overrides.blockTag.toString(16);
|
1033
|
+
}
|
1034
|
+
|
1035
|
+
return this.view.encodeCall.transfer(dst, wad, {
|
1036
|
+
chainId,
|
1037
|
+
address,
|
1038
|
+
blockTag,
|
1039
|
+
});
|
1040
|
+
},
|
1041
|
+
deposit(overrides?: Overrides): EthCallParam {
|
1042
|
+
const chainId =
|
1043
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
1044
|
+
const address = this.context.address;
|
1045
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
1046
|
+
if (overrides?.blockTag) {
|
1047
|
+
blockTag =
|
1048
|
+
typeof overrides.blockTag == "string"
|
1049
|
+
? overrides.blockTag
|
1050
|
+
: "0x" + overrides.blockTag.toString(16);
|
1051
|
+
}
|
1052
|
+
|
1053
|
+
return this.view.encodeCall.deposit({ chainId, address, blockTag });
|
1054
|
+
},
|
1055
|
+
allowance(arg0: string, arg1: string, overrides?: Overrides): EthCallParam {
|
1056
|
+
const chainId =
|
1057
|
+
overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
1058
|
+
const address = this.context.address;
|
1059
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
1060
|
+
if (overrides?.blockTag) {
|
1061
|
+
blockTag =
|
1062
|
+
typeof overrides.blockTag == "string"
|
1063
|
+
? overrides.blockTag
|
1064
|
+
: "0x" + overrides.blockTag.toString(16);
|
1065
|
+
}
|
1066
|
+
|
1067
|
+
return this.view.encodeCall.allowance(arg0, arg1, {
|
1068
|
+
chainId,
|
1069
|
+
address,
|
1070
|
+
blockTag,
|
344
1071
|
});
|
345
1072
|
},
|
346
1073
|
};
|
@@ -358,7 +1085,8 @@ export class WETH9Processor extends BaseProcessor<
|
|
358
1085
|
fetchConfig?: Partial<EthFetchConfig>,
|
359
1086
|
preprocessHandler?: (
|
360
1087
|
event: ApprovalEvent,
|
361
|
-
ctx: WETH9Context
|
1088
|
+
ctx: WETH9Context,
|
1089
|
+
preprocessStore: { [k: string]: any }
|
362
1090
|
) => Promise<PreprocessResult>
|
363
1091
|
): this {
|
364
1092
|
if (!filter) {
|
@@ -377,7 +1105,8 @@ export class WETH9Processor extends BaseProcessor<
|
|
377
1105
|
fetchConfig?: Partial<EthFetchConfig>,
|
378
1106
|
preprocessHandler?: (
|
379
1107
|
event: TransferEvent,
|
380
|
-
ctx: WETH9Context
|
1108
|
+
ctx: WETH9Context,
|
1109
|
+
preprocessStore: { [k: string]: any }
|
381
1110
|
) => Promise<PreprocessResult>
|
382
1111
|
): this {
|
383
1112
|
if (!filter) {
|
@@ -396,7 +1125,8 @@ export class WETH9Processor extends BaseProcessor<
|
|
396
1125
|
fetchConfig?: Partial<EthFetchConfig>,
|
397
1126
|
preprocessHandler?: (
|
398
1127
|
event: DepositEvent,
|
399
|
-
ctx: WETH9Context
|
1128
|
+
ctx: WETH9Context,
|
1129
|
+
preprocessStore: { [k: string]: any }
|
400
1130
|
) => Promise<PreprocessResult>
|
401
1131
|
): this {
|
402
1132
|
if (!filter) {
|
@@ -411,7 +1141,8 @@ export class WETH9Processor extends BaseProcessor<
|
|
411
1141
|
fetchConfig?: Partial<EthFetchConfig>,
|
412
1142
|
preprocessHandler?: (
|
413
1143
|
event: WithdrawalEvent,
|
414
|
-
ctx: WETH9Context
|
1144
|
+
ctx: WETH9Context,
|
1145
|
+
preprocessStore: { [k: string]: any }
|
415
1146
|
) => Promise<PreprocessResult>
|
416
1147
|
): this {
|
417
1148
|
if (!filter) {
|
@@ -670,7 +1401,8 @@ export class WETH9ProcessorTemplate extends BaseProcessorTemplate<
|
|
670
1401
|
fetchConfig?: Partial<EthFetchConfig>,
|
671
1402
|
preprocessHandler?: (
|
672
1403
|
event: ApprovalEvent,
|
673
|
-
ctx: WETH9Context
|
1404
|
+
ctx: WETH9Context,
|
1405
|
+
preprocessStore: { [k: string]: any }
|
674
1406
|
) => Promise<PreprocessResult>
|
675
1407
|
): this {
|
676
1408
|
if (!filter) {
|
@@ -689,7 +1421,8 @@ export class WETH9ProcessorTemplate extends BaseProcessorTemplate<
|
|
689
1421
|
fetchConfig?: Partial<EthFetchConfig>,
|
690
1422
|
preprocessHandler?: (
|
691
1423
|
event: TransferEvent,
|
692
|
-
ctx: WETH9Context
|
1424
|
+
ctx: WETH9Context,
|
1425
|
+
preprocessStore: { [k: string]: any }
|
693
1426
|
) => Promise<PreprocessResult>
|
694
1427
|
): this {
|
695
1428
|
if (!filter) {
|
@@ -708,7 +1441,8 @@ export class WETH9ProcessorTemplate extends BaseProcessorTemplate<
|
|
708
1441
|
fetchConfig?: Partial<EthFetchConfig>,
|
709
1442
|
preprocessHandler?: (
|
710
1443
|
event: DepositEvent,
|
711
|
-
ctx: WETH9Context
|
1444
|
+
ctx: WETH9Context,
|
1445
|
+
preprocessStore: { [k: string]: any }
|
712
1446
|
) => Promise<PreprocessResult>
|
713
1447
|
): this {
|
714
1448
|
if (!filter) {
|
@@ -723,7 +1457,8 @@ export class WETH9ProcessorTemplate extends BaseProcessorTemplate<
|
|
723
1457
|
fetchConfig?: Partial<EthFetchConfig>,
|
724
1458
|
preprocessHandler?: (
|
725
1459
|
event: WithdrawalEvent,
|
726
|
-
ctx: WETH9Context
|
1460
|
+
ctx: WETH9Context,
|
1461
|
+
preprocessStore: { [k: string]: any }
|
727
1462
|
) => Promise<PreprocessResult>
|
728
1463
|
): this {
|
729
1464
|
if (!filter) {
|