@sentio/sdk 2.45.3-rc.1 → 2.45.3
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/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +23 -23
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +93 -659
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts +8 -8
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +33 -264
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts +18 -18
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +75 -538
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +9 -9
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +37 -268
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts +14 -14
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +57 -430
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts +11 -11
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +45 -321
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +3 -6
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.d.ts.map +1 -1
- package/lib/eth/codegen/function-calls.js +5 -27
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/context.d.ts +4 -2
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +15 -0
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth.d.ts +2 -0
- package/lib/eth/eth.d.ts.map +1 -1
- package/lib/eth/eth.js +15 -1
- package/lib/eth/eth.js.map +1 -1
- package/package.json +3 -3
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +189 -662
- package/src/eth/builtin/internal/erc1155-processor.ts +69 -261
- package/src/eth/builtin/internal/erc20-processor.ts +136 -535
- package/src/eth/builtin/internal/erc20bytes-processor.ts +68 -265
- package/src/eth/builtin/internal/erc721-processor.ts +118 -433
- package/src/eth/builtin/internal/weth9-processor.ts +81 -318
- package/src/eth/codegen/file.ts +2 -6
- package/src/eth/codegen/function-calls.ts +7 -29
- package/src/eth/context.ts +19 -2
- package/src/eth/eth.ts +21 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
/* Autogenerated file. Do not edit manually. */
|
2
2
|
/* tslint:disable */
|
3
3
|
/* eslint-disable */
|
4
|
-
import { BigNumberish, Overrides
|
4
|
+
import { BigNumberish, Overrides } from "ethers";
|
5
5
|
import {
|
6
6
|
addContractByABI,
|
7
7
|
getContractByABI,
|
@@ -21,6 +21,7 @@ import {
|
|
21
21
|
EthContext,
|
22
22
|
EthFetchConfig,
|
23
23
|
PreprocessResult,
|
24
|
+
encodeCallData,
|
24
25
|
} from "@sentio/sdk/eth";
|
25
26
|
import { EthCallParam, EthCallContext, PreparedData } from "@sentio/protos";
|
26
27
|
|
@@ -107,20 +108,6 @@ export type AllowanceCallTrace = TypedCallTrace<
|
|
107
108
|
|
108
109
|
const templateContract = WETH9__factory.connect("0x0", DummyProvider);
|
109
110
|
|
110
|
-
const iface = new Interface([
|
111
|
-
"function name() view returns (string)",
|
112
|
-
"function approve(address guy, uint256 wad) returns (bool)",
|
113
|
-
"function totalSupply() view returns (uint256)",
|
114
|
-
"function transferFrom(address src, address dst, uint256 wad) returns (bool)",
|
115
|
-
"function withdraw(uint256 wad) returns ()",
|
116
|
-
"function decimals() view returns (uint8)",
|
117
|
-
"function balanceOf(address) view returns (uint256)",
|
118
|
-
"function symbol() view returns (string)",
|
119
|
-
"function transfer(address dst, uint256 wad) returns (bool)",
|
120
|
-
"function deposit() payable returns ()",
|
121
|
-
"function allowance(address, address) view returns (uint256)",
|
122
|
-
]);
|
123
|
-
|
124
111
|
export class WETH9ContractView extends ContractView<WETH9> {
|
125
112
|
constructor(contract: WETH9) {
|
126
113
|
super(contract);
|
@@ -299,171 +286,90 @@ export class WETH9ContractView extends ContractView<WETH9> {
|
|
299
286
|
};
|
300
287
|
|
301
288
|
encodeCall = {
|
302
|
-
name(
|
303
|
-
|
304
|
-
const iface = new Interface(["function name()"]);
|
305
|
-
const calldata = iface.encodeFunctionData("name", []);
|
306
|
-
return {
|
307
|
-
context: ethCallContext,
|
308
|
-
calldata,
|
309
|
-
};
|
310
|
-
} catch (e) {
|
311
|
-
const stack = new Error().stack;
|
312
|
-
throw transformEtherError(e, undefined, stack);
|
313
|
-
}
|
289
|
+
name(callContext: EthCallContext): EthCallParam {
|
290
|
+
return encodeCallData(callContext, "name", "function name()", []);
|
314
291
|
},
|
315
292
|
approve(
|
316
293
|
guy: string,
|
317
294
|
wad: BigNumberish,
|
318
|
-
|
295
|
+
callContext: EthCallContext,
|
319
296
|
): EthCallParam {
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
};
|
327
|
-
} catch (e) {
|
328
|
-
const stack = new Error().stack;
|
329
|
-
throw transformEtherError(e, undefined, stack);
|
330
|
-
}
|
297
|
+
return encodeCallData(
|
298
|
+
callContext,
|
299
|
+
"approve",
|
300
|
+
"function approve(address,uint256)",
|
301
|
+
[guy, wad],
|
302
|
+
);
|
331
303
|
},
|
332
|
-
totalSupply(
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
};
|
340
|
-
} catch (e) {
|
341
|
-
const stack = new Error().stack;
|
342
|
-
throw transformEtherError(e, undefined, stack);
|
343
|
-
}
|
304
|
+
totalSupply(callContext: EthCallContext): EthCallParam {
|
305
|
+
return encodeCallData(
|
306
|
+
callContext,
|
307
|
+
"totalSupply",
|
308
|
+
"function totalSupply()",
|
309
|
+
[],
|
310
|
+
);
|
344
311
|
},
|
345
312
|
transferFrom(
|
346
313
|
src: string,
|
347
314
|
dst: string,
|
348
315
|
wad: BigNumberish,
|
349
|
-
|
316
|
+
callContext: EthCallContext,
|
350
317
|
): EthCallParam {
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
dst,
|
358
|
-
wad,
|
359
|
-
]);
|
360
|
-
return {
|
361
|
-
context: ethCallContext,
|
362
|
-
calldata,
|
363
|
-
};
|
364
|
-
} catch (e) {
|
365
|
-
const stack = new Error().stack;
|
366
|
-
throw transformEtherError(e, undefined, stack);
|
367
|
-
}
|
318
|
+
return encodeCallData(
|
319
|
+
callContext,
|
320
|
+
"transferFrom",
|
321
|
+
"function transferFrom(address,address,uint256)",
|
322
|
+
[src, dst, wad],
|
323
|
+
);
|
368
324
|
},
|
369
|
-
withdraw(wad: BigNumberish,
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
};
|
377
|
-
} catch (e) {
|
378
|
-
const stack = new Error().stack;
|
379
|
-
throw transformEtherError(e, undefined, stack);
|
380
|
-
}
|
325
|
+
withdraw(wad: BigNumberish, callContext: EthCallContext): EthCallParam {
|
326
|
+
return encodeCallData(
|
327
|
+
callContext,
|
328
|
+
"withdraw",
|
329
|
+
"function withdraw(uint256)",
|
330
|
+
[wad],
|
331
|
+
);
|
381
332
|
},
|
382
|
-
decimals(
|
383
|
-
|
384
|
-
const iface = new Interface(["function decimals()"]);
|
385
|
-
const calldata = iface.encodeFunctionData("decimals", []);
|
386
|
-
return {
|
387
|
-
context: ethCallContext,
|
388
|
-
calldata,
|
389
|
-
};
|
390
|
-
} catch (e) {
|
391
|
-
const stack = new Error().stack;
|
392
|
-
throw transformEtherError(e, undefined, stack);
|
393
|
-
}
|
333
|
+
decimals(callContext: EthCallContext): EthCallParam {
|
334
|
+
return encodeCallData(callContext, "decimals", "function decimals()", []);
|
394
335
|
},
|
395
|
-
balanceOf(arg0: string,
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
};
|
403
|
-
} catch (e) {
|
404
|
-
const stack = new Error().stack;
|
405
|
-
throw transformEtherError(e, undefined, stack);
|
406
|
-
}
|
336
|
+
balanceOf(arg0: string, callContext: EthCallContext): EthCallParam {
|
337
|
+
return encodeCallData(
|
338
|
+
callContext,
|
339
|
+
"balanceOf",
|
340
|
+
"function balanceOf(address)",
|
341
|
+
[arg0],
|
342
|
+
);
|
407
343
|
},
|
408
|
-
symbol(
|
409
|
-
|
410
|
-
const iface = new Interface(["function symbol()"]);
|
411
|
-
const calldata = iface.encodeFunctionData("symbol", []);
|
412
|
-
return {
|
413
|
-
context: ethCallContext,
|
414
|
-
calldata,
|
415
|
-
};
|
416
|
-
} catch (e) {
|
417
|
-
const stack = new Error().stack;
|
418
|
-
throw transformEtherError(e, undefined, stack);
|
419
|
-
}
|
344
|
+
symbol(callContext: EthCallContext): EthCallParam {
|
345
|
+
return encodeCallData(callContext, "symbol", "function symbol()", []);
|
420
346
|
},
|
421
347
|
transfer(
|
422
348
|
dst: string,
|
423
349
|
wad: BigNumberish,
|
424
|
-
|
350
|
+
callContext: EthCallContext,
|
425
351
|
): EthCallParam {
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
};
|
433
|
-
} catch (e) {
|
434
|
-
const stack = new Error().stack;
|
435
|
-
throw transformEtherError(e, undefined, stack);
|
436
|
-
}
|
352
|
+
return encodeCallData(
|
353
|
+
callContext,
|
354
|
+
"transfer",
|
355
|
+
"function transfer(address,uint256)",
|
356
|
+
[dst, wad],
|
357
|
+
);
|
437
358
|
},
|
438
|
-
deposit(
|
439
|
-
|
440
|
-
const iface = new Interface(["function deposit()"]);
|
441
|
-
const calldata = iface.encodeFunctionData("deposit", []);
|
442
|
-
return {
|
443
|
-
context: ethCallContext,
|
444
|
-
calldata,
|
445
|
-
};
|
446
|
-
} catch (e) {
|
447
|
-
const stack = new Error().stack;
|
448
|
-
throw transformEtherError(e, undefined, stack);
|
449
|
-
}
|
359
|
+
deposit(callContext: EthCallContext): EthCallParam {
|
360
|
+
return encodeCallData(callContext, "deposit", "function deposit()", []);
|
450
361
|
},
|
451
362
|
allowance(
|
452
363
|
arg0: string,
|
453
364
|
arg1: string,
|
454
|
-
|
365
|
+
callContext: EthCallContext,
|
455
366
|
): EthCallParam {
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
};
|
463
|
-
} catch (e) {
|
464
|
-
const stack = new Error().stack;
|
465
|
-
throw transformEtherError(e, undefined, stack);
|
466
|
-
}
|
367
|
+
return encodeCallData(
|
368
|
+
callContext,
|
369
|
+
"allowance",
|
370
|
+
"function allowance(address,address)",
|
371
|
+
[arg0, arg1],
|
372
|
+
);
|
467
373
|
},
|
468
374
|
};
|
469
375
|
}
|
@@ -473,59 +379,39 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
473
379
|
WETH9ContractView
|
474
380
|
> {
|
475
381
|
async name(overrides?: Overrides): Promise<string> {
|
476
|
-
const ethCallContext = {
|
477
|
-
chainId: this.context.chainId,
|
478
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
479
|
-
address: this.context.address,
|
480
|
-
};
|
481
382
|
return await this.view.name(
|
482
383
|
{
|
483
384
|
blockTag: this.context.blockNumber,
|
484
385
|
...overrides,
|
485
386
|
},
|
486
387
|
this.context.preparedData,
|
487
|
-
|
388
|
+
this.context.getEthCallContext(),
|
488
389
|
);
|
489
390
|
}
|
490
391
|
|
491
392
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
492
|
-
const ethCallContext = {
|
493
|
-
chainId: this.context.chainId,
|
494
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
495
|
-
address: this.context.address,
|
496
|
-
};
|
497
393
|
return await this.view.totalSupply(
|
498
394
|
{
|
499
395
|
blockTag: this.context.blockNumber,
|
500
396
|
...overrides,
|
501
397
|
},
|
502
398
|
this.context.preparedData,
|
503
|
-
|
399
|
+
this.context.getEthCallContext(),
|
504
400
|
);
|
505
401
|
}
|
506
402
|
|
507
403
|
async decimals(overrides?: Overrides): Promise<bigint> {
|
508
|
-
const ethCallContext = {
|
509
|
-
chainId: this.context.chainId,
|
510
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
511
|
-
address: this.context.address,
|
512
|
-
};
|
513
404
|
return await this.view.decimals(
|
514
405
|
{
|
515
406
|
blockTag: this.context.blockNumber,
|
516
407
|
...overrides,
|
517
408
|
},
|
518
409
|
this.context.preparedData,
|
519
|
-
|
410
|
+
this.context.getEthCallContext(),
|
520
411
|
);
|
521
412
|
}
|
522
413
|
|
523
414
|
async balanceOf(arg0: string, overrides?: Overrides): Promise<bigint> {
|
524
|
-
const ethCallContext = {
|
525
|
-
chainId: this.context.chainId,
|
526
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
527
|
-
address: this.context.address,
|
528
|
-
};
|
529
415
|
return await this.view.balanceOf(
|
530
416
|
arg0,
|
531
417
|
{
|
@@ -533,23 +419,18 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
533
419
|
...overrides,
|
534
420
|
},
|
535
421
|
this.context.preparedData,
|
536
|
-
|
422
|
+
this.context.getEthCallContext(),
|
537
423
|
);
|
538
424
|
}
|
539
425
|
|
540
426
|
async symbol(overrides?: Overrides): Promise<string> {
|
541
|
-
const ethCallContext = {
|
542
|
-
chainId: this.context.chainId,
|
543
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
544
|
-
address: this.context.address,
|
545
|
-
};
|
546
427
|
return await this.view.symbol(
|
547
428
|
{
|
548
429
|
blockTag: this.context.blockNumber,
|
549
430
|
...overrides,
|
550
431
|
},
|
551
432
|
this.context.preparedData,
|
552
|
-
|
433
|
+
this.context.getEthCallContext(),
|
553
434
|
);
|
554
435
|
}
|
555
436
|
|
@@ -558,11 +439,6 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
558
439
|
arg1: string,
|
559
440
|
overrides?: Overrides,
|
560
441
|
): Promise<bigint> {
|
561
|
-
const ethCallContext = {
|
562
|
-
chainId: this.context.chainId,
|
563
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
564
|
-
address: this.context.address,
|
565
|
-
};
|
566
442
|
return await this.view.allowance(
|
567
443
|
arg0,
|
568
444
|
arg1,
|
@@ -571,7 +447,7 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
571
447
|
...overrides,
|
572
448
|
},
|
573
449
|
this.context.preparedData,
|
574
|
-
|
450
|
+
this.context.getEthCallContext(),
|
575
451
|
);
|
576
452
|
}
|
577
453
|
|
@@ -584,11 +460,6 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
584
460
|
wad: BigNumberish,
|
585
461
|
overrides?: Overrides,
|
586
462
|
): Promise<boolean> {
|
587
|
-
const ethCallContext = {
|
588
|
-
chainId: this.context.chainId,
|
589
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
590
|
-
address: this.context.address,
|
591
|
-
};
|
592
463
|
return await this.view.callStatic.approve(
|
593
464
|
guy,
|
594
465
|
wad,
|
@@ -597,7 +468,7 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
597
468
|
...overrides,
|
598
469
|
},
|
599
470
|
this.context.preparedData,
|
600
|
-
|
471
|
+
this.context.getEthCallContext(),
|
601
472
|
);
|
602
473
|
},
|
603
474
|
async transferFrom(
|
@@ -606,11 +477,6 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
606
477
|
wad: BigNumberish,
|
607
478
|
overrides?: Overrides,
|
608
479
|
): Promise<boolean> {
|
609
|
-
const ethCallContext = {
|
610
|
-
chainId: this.context.chainId,
|
611
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
612
|
-
address: this.context.address,
|
613
|
-
};
|
614
480
|
return await this.view.callStatic.transferFrom(
|
615
481
|
src,
|
616
482
|
dst,
|
@@ -620,15 +486,10 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
620
486
|
...overrides,
|
621
487
|
},
|
622
488
|
this.context.preparedData,
|
623
|
-
|
489
|
+
this.context.getEthCallContext(),
|
624
490
|
);
|
625
491
|
},
|
626
492
|
async withdraw(wad: BigNumberish, overrides?: Overrides): Promise<void> {
|
627
|
-
const ethCallContext = {
|
628
|
-
chainId: this.context.chainId,
|
629
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
630
|
-
address: this.context.address,
|
631
|
-
};
|
632
493
|
return await this.view.callStatic.withdraw(
|
633
494
|
wad,
|
634
495
|
{
|
@@ -636,7 +497,7 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
636
497
|
...overrides,
|
637
498
|
},
|
638
499
|
this.context.preparedData,
|
639
|
-
|
500
|
+
this.context.getEthCallContext(),
|
640
501
|
);
|
641
502
|
},
|
642
503
|
async transfer(
|
@@ -644,11 +505,6 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
644
505
|
wad: BigNumberish,
|
645
506
|
overrides?: Overrides,
|
646
507
|
): Promise<boolean> {
|
647
|
-
const ethCallContext = {
|
648
|
-
chainId: this.context.chainId,
|
649
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
650
|
-
address: this.context.address,
|
651
|
-
};
|
652
508
|
return await this.view.callStatic.transfer(
|
653
509
|
dst,
|
654
510
|
wad,
|
@@ -657,22 +513,17 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
657
513
|
...overrides,
|
658
514
|
},
|
659
515
|
this.context.preparedData,
|
660
|
-
|
516
|
+
this.context.getEthCallContext(),
|
661
517
|
);
|
662
518
|
},
|
663
519
|
async deposit(overrides?: Overrides): Promise<void> {
|
664
|
-
const ethCallContext = {
|
665
|
-
chainId: this.context.chainId,
|
666
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
667
|
-
address: this.context.address,
|
668
|
-
};
|
669
520
|
return await this.view.callStatic.deposit(
|
670
521
|
{
|
671
522
|
blockTag: this.context.blockNumber,
|
672
523
|
...overrides,
|
673
524
|
},
|
674
525
|
this.context.preparedData,
|
675
|
-
|
526
|
+
this.context.getEthCallContext(),
|
676
527
|
);
|
677
528
|
},
|
678
529
|
};
|
@@ -682,18 +533,10 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
682
533
|
context: this.context,
|
683
534
|
|
684
535
|
name(overrides?: Overrides): EthCallParam {
|
685
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
686
|
-
if (overrides?.blockTag) {
|
687
|
-
blockTagWithOverride =
|
688
|
-
typeof overrides.blockTag == "string"
|
689
|
-
? overrides.blockTag
|
690
|
-
: "0x" + overrides.blockTag.toString(16);
|
691
|
-
}
|
692
|
-
|
693
536
|
return this.view.encodeCall.name({
|
694
537
|
chainId: this.context.chainId.toString(),
|
695
538
|
address: this.context.address,
|
696
|
-
blockTag:
|
539
|
+
blockTag: this.context.getBlockTag(overrides),
|
697
540
|
});
|
698
541
|
},
|
699
542
|
approve(
|
@@ -701,33 +544,17 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
701
544
|
wad: BigNumberish,
|
702
545
|
overrides?: Overrides,
|
703
546
|
): EthCallParam {
|
704
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
705
|
-
if (overrides?.blockTag) {
|
706
|
-
blockTagWithOverride =
|
707
|
-
typeof overrides.blockTag == "string"
|
708
|
-
? overrides.blockTag
|
709
|
-
: "0x" + overrides.blockTag.toString(16);
|
710
|
-
}
|
711
|
-
|
712
547
|
return this.view.encodeCall.approve(guy, wad, {
|
713
548
|
chainId: this.context.chainId.toString(),
|
714
549
|
address: this.context.address,
|
715
|
-
blockTag:
|
550
|
+
blockTag: this.context.getBlockTag(overrides),
|
716
551
|
});
|
717
552
|
},
|
718
553
|
totalSupply(overrides?: Overrides): EthCallParam {
|
719
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
720
|
-
if (overrides?.blockTag) {
|
721
|
-
blockTagWithOverride =
|
722
|
-
typeof overrides.blockTag == "string"
|
723
|
-
? overrides.blockTag
|
724
|
-
: "0x" + overrides.blockTag.toString(16);
|
725
|
-
}
|
726
|
-
|
727
554
|
return this.view.encodeCall.totalSupply({
|
728
555
|
chainId: this.context.chainId.toString(),
|
729
556
|
address: this.context.address,
|
730
|
-
blockTag:
|
557
|
+
blockTag: this.context.getBlockTag(overrides),
|
731
558
|
});
|
732
559
|
},
|
733
560
|
transferFrom(
|
@@ -736,78 +563,38 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
736
563
|
wad: BigNumberish,
|
737
564
|
overrides?: Overrides,
|
738
565
|
): EthCallParam {
|
739
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
740
|
-
if (overrides?.blockTag) {
|
741
|
-
blockTagWithOverride =
|
742
|
-
typeof overrides.blockTag == "string"
|
743
|
-
? overrides.blockTag
|
744
|
-
: "0x" + overrides.blockTag.toString(16);
|
745
|
-
}
|
746
|
-
|
747
566
|
return this.view.encodeCall.transferFrom(src, dst, wad, {
|
748
567
|
chainId: this.context.chainId.toString(),
|
749
568
|
address: this.context.address,
|
750
|
-
blockTag:
|
569
|
+
blockTag: this.context.getBlockTag(overrides),
|
751
570
|
});
|
752
571
|
},
|
753
572
|
withdraw(wad: BigNumberish, overrides?: Overrides): EthCallParam {
|
754
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
755
|
-
if (overrides?.blockTag) {
|
756
|
-
blockTagWithOverride =
|
757
|
-
typeof overrides.blockTag == "string"
|
758
|
-
? overrides.blockTag
|
759
|
-
: "0x" + overrides.blockTag.toString(16);
|
760
|
-
}
|
761
|
-
|
762
573
|
return this.view.encodeCall.withdraw(wad, {
|
763
574
|
chainId: this.context.chainId.toString(),
|
764
575
|
address: this.context.address,
|
765
|
-
blockTag:
|
576
|
+
blockTag: this.context.getBlockTag(overrides),
|
766
577
|
});
|
767
578
|
},
|
768
579
|
decimals(overrides?: Overrides): EthCallParam {
|
769
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
770
|
-
if (overrides?.blockTag) {
|
771
|
-
blockTagWithOverride =
|
772
|
-
typeof overrides.blockTag == "string"
|
773
|
-
? overrides.blockTag
|
774
|
-
: "0x" + overrides.blockTag.toString(16);
|
775
|
-
}
|
776
|
-
|
777
580
|
return this.view.encodeCall.decimals({
|
778
581
|
chainId: this.context.chainId.toString(),
|
779
582
|
address: this.context.address,
|
780
|
-
blockTag:
|
583
|
+
blockTag: this.context.getBlockTag(overrides),
|
781
584
|
});
|
782
585
|
},
|
783
586
|
balanceOf(arg0: string, overrides?: Overrides): EthCallParam {
|
784
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
785
|
-
if (overrides?.blockTag) {
|
786
|
-
blockTagWithOverride =
|
787
|
-
typeof overrides.blockTag == "string"
|
788
|
-
? overrides.blockTag
|
789
|
-
: "0x" + overrides.blockTag.toString(16);
|
790
|
-
}
|
791
|
-
|
792
587
|
return this.view.encodeCall.balanceOf(arg0, {
|
793
588
|
chainId: this.context.chainId.toString(),
|
794
589
|
address: this.context.address,
|
795
|
-
blockTag:
|
590
|
+
blockTag: this.context.getBlockTag(overrides),
|
796
591
|
});
|
797
592
|
},
|
798
593
|
symbol(overrides?: Overrides): EthCallParam {
|
799
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
800
|
-
if (overrides?.blockTag) {
|
801
|
-
blockTagWithOverride =
|
802
|
-
typeof overrides.blockTag == "string"
|
803
|
-
? overrides.blockTag
|
804
|
-
: "0x" + overrides.blockTag.toString(16);
|
805
|
-
}
|
806
|
-
|
807
594
|
return this.view.encodeCall.symbol({
|
808
595
|
chainId: this.context.chainId.toString(),
|
809
596
|
address: this.context.address,
|
810
|
-
blockTag:
|
597
|
+
blockTag: this.context.getBlockTag(overrides),
|
811
598
|
});
|
812
599
|
},
|
813
600
|
transfer(
|
@@ -815,48 +602,24 @@ export class WETH9BoundContractView extends BoundContractView<
|
|
815
602
|
wad: BigNumberish,
|
816
603
|
overrides?: Overrides,
|
817
604
|
): EthCallParam {
|
818
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
819
|
-
if (overrides?.blockTag) {
|
820
|
-
blockTagWithOverride =
|
821
|
-
typeof overrides.blockTag == "string"
|
822
|
-
? overrides.blockTag
|
823
|
-
: "0x" + overrides.blockTag.toString(16);
|
824
|
-
}
|
825
|
-
|
826
605
|
return this.view.encodeCall.transfer(dst, wad, {
|
827
606
|
chainId: this.context.chainId.toString(),
|
828
607
|
address: this.context.address,
|
829
|
-
blockTag:
|
608
|
+
blockTag: this.context.getBlockTag(overrides),
|
830
609
|
});
|
831
610
|
},
|
832
611
|
deposit(overrides?: Overrides): EthCallParam {
|
833
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
834
|
-
if (overrides?.blockTag) {
|
835
|
-
blockTagWithOverride =
|
836
|
-
typeof overrides.blockTag == "string"
|
837
|
-
? overrides.blockTag
|
838
|
-
: "0x" + overrides.blockTag.toString(16);
|
839
|
-
}
|
840
|
-
|
841
612
|
return this.view.encodeCall.deposit({
|
842
613
|
chainId: this.context.chainId.toString(),
|
843
614
|
address: this.context.address,
|
844
|
-
blockTag:
|
615
|
+
blockTag: this.context.getBlockTag(overrides),
|
845
616
|
});
|
846
617
|
},
|
847
618
|
allowance(arg0: string, arg1: string, overrides?: Overrides): EthCallParam {
|
848
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
849
|
-
if (overrides?.blockTag) {
|
850
|
-
blockTagWithOverride =
|
851
|
-
typeof overrides.blockTag == "string"
|
852
|
-
? overrides.blockTag
|
853
|
-
: "0x" + overrides.blockTag.toString(16);
|
854
|
-
}
|
855
|
-
|
856
619
|
return this.view.encodeCall.allowance(arg0, arg1, {
|
857
620
|
chainId: this.context.chainId.toString(),
|
858
621
|
address: this.context.address,
|
859
|
-
blockTag:
|
622
|
+
blockTag: this.context.getBlockTag(overrides),
|
860
623
|
});
|
861
624
|
},
|
862
625
|
};
|
package/src/eth/codegen/file.ts
CHANGED
@@ -13,7 +13,6 @@ import {
|
|
13
13
|
generateBoundFunctionCallEncoders,
|
14
14
|
generateBoundViewFunctions,
|
15
15
|
generateFunctionCallEncoders,
|
16
|
-
generateFunctionSignatures,
|
17
16
|
generateViewFunctions
|
18
17
|
} from './function-calls.js'
|
19
18
|
|
@@ -32,10 +31,6 @@ export function codeGenSentioFile(contract: Contract): string {
|
|
32
31
|
|
33
32
|
const templateContract = ${contract.name}__factory.connect("0x0", DummyProvider)
|
34
33
|
|
35
|
-
const iface = new Interface([${Object.values(contract.functions)
|
36
|
-
.filter((f) => !reservedKeywords.has(f[0].name))
|
37
|
-
.flatMap((fs) => generateFunctionSignatures(fs))}])
|
38
|
-
|
39
34
|
export class ${contract.name}ContractView extends ContractView<${contract.name}> {
|
40
35
|
constructor (contract: ${contract.name}) {
|
41
36
|
super(contract);
|
@@ -222,7 +217,8 @@ export class ${contract.name}ProcessorTemplate extends BaseProcessorTemplate<${c
|
|
222
217
|
'EthContext',
|
223
218
|
'EthFetchConfig',
|
224
219
|
'PreprocessResult',
|
225
|
-
'makeEthCallKey'
|
220
|
+
'makeEthCallKey',
|
221
|
+
'encodeCallData'
|
226
222
|
],
|
227
223
|
// '@sentio/sdk/eth': ['BaseContext'],
|
228
224
|
// '@sentio/protos': ['EthFetchConfig'],
|