@sentio/sdk 1.39.0-rc.2 → 1.40.0-rc.1

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.
Files changed (59) hide show
  1. package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +32 -31
  2. package/lib/builtin/internal/eacaggregatorproxy_processor.js +62 -62
  3. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
  4. package/lib/builtin/internal/erc1155_processor.d.ts +17 -16
  5. package/lib/builtin/internal/erc1155_processor.js +32 -32
  6. package/lib/builtin/internal/erc1155_processor.js.map +1 -1
  7. package/lib/builtin/internal/erc20_processor.d.ts +25 -24
  8. package/lib/builtin/internal/erc20_processor.js +48 -48
  9. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  10. package/lib/builtin/internal/erc20bytes_processor.d.ts +14 -13
  11. package/lib/builtin/internal/erc20bytes_processor.js +26 -26
  12. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
  13. package/lib/builtin/internal/erc721_processor.d.ts +21 -20
  14. package/lib/builtin/internal/erc721_processor.js +40 -40
  15. package/lib/builtin/internal/erc721_processor.js.map +1 -1
  16. package/lib/builtin/internal/weth9_processor.d.ts +20 -19
  17. package/lib/builtin/internal/weth9_processor.js +38 -38
  18. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  19. package/lib/core/account-processor.d.ts +14 -7
  20. package/lib/core/account-processor.js +27 -20
  21. package/lib/core/account-processor.js.map +1 -1
  22. package/lib/core/base-processor-template.d.ts +4 -2
  23. package/lib/core/base-processor-template.js +6 -2
  24. package/lib/core/base-processor-template.js.map +1 -1
  25. package/lib/core/base-processor.d.ts +5 -3
  26. package/lib/core/base-processor.js +9 -5
  27. package/lib/core/base-processor.js.map +1 -1
  28. package/lib/core/context.d.ts +8 -6
  29. package/lib/core/context.js +10 -6
  30. package/lib/core/context.js.map +1 -1
  31. package/lib/core/eth-plugin.js +4 -0
  32. package/lib/core/eth-plugin.js.map +1 -1
  33. package/lib/core/sui-plugin.js +1 -0
  34. package/lib/core/sui-plugin.js.map +1 -1
  35. package/lib/target-ethers-sentio/event-handler.js +3 -2
  36. package/lib/target-ethers-sentio/event-handler.js.map +1 -1
  37. package/lib/target-ethers-sentio/file.js +1 -0
  38. package/lib/target-ethers-sentio/file.js.map +1 -1
  39. package/lib/target-ethers-sentio/functions-handler.js +3 -2
  40. package/lib/target-ethers-sentio/functions-handler.js.map +1 -1
  41. package/lib/utils/price.js +1 -5
  42. package/lib/utils/price.js.map +1 -1
  43. package/package.json +4 -4
  44. package/src/builtin/internal/eacaggregatorproxy_processor.ts +101 -62
  45. package/src/builtin/internal/erc1155_processor.ts +54 -32
  46. package/src/builtin/internal/erc20_processor.ts +89 -48
  47. package/src/builtin/internal/erc20bytes_processor.ts +42 -26
  48. package/src/builtin/internal/erc721_processor.ts +69 -40
  49. package/src/builtin/internal/weth9_processor.ts +66 -38
  50. package/src/core/account-processor.ts +76 -28
  51. package/src/core/base-processor-template.ts +10 -3
  52. package/src/core/base-processor.ts +30 -11
  53. package/src/core/context.ts +25 -9
  54. package/src/core/eth-plugin.ts +4 -1
  55. package/src/core/sui-plugin.ts +1 -0
  56. package/src/target-ethers-sentio/event-handler.ts +3 -2
  57. package/src/target-ethers-sentio/file.ts +1 -0
  58. package/src/target-ethers-sentio/functions-handler.ts +3 -2
  59. package/src/utils/price.ts +1 -5
@@ -20,6 +20,7 @@ import {
20
20
  TypedCallTrace,
21
21
  toBlockTag,
22
22
  } from "@sentio/sdk";
23
+ import { EthFetchConfig } from "@sentio/protos";
23
24
  import { PromiseOrValue } from "./common";
24
25
  import { ERC20, ERC20__factory } from "./index";
25
26
  import {
@@ -443,7 +444,8 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
443
444
 
444
445
  onEventApproval(
445
446
  handler: (event: ApprovalEvent, ctx: ERC20Context) => void,
446
- filter?: ApprovalEventFilter | ApprovalEventFilter[]
447
+ filter?: ApprovalEventFilter | ApprovalEventFilter[],
448
+ fetchConfig?: EthFetchConfig
447
449
  ) {
448
450
  if (!filter) {
449
451
  // @ts-ignore
@@ -452,12 +454,15 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
452
454
  "Approval(address,address,uint256)"
453
455
  ](null, null, null);
454
456
  }
455
- return super.onEvent(handler, filter!);
457
+ return super.onEvent(handler, filter!, fetchConfig);
456
458
  }
457
459
 
458
460
  onEventOwnershipTransferred(
459
461
  handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,
460
- filter?: OwnershipTransferredEventFilter | OwnershipTransferredEventFilter[]
462
+ filter?:
463
+ | OwnershipTransferredEventFilter
464
+ | OwnershipTransferredEventFilter[],
465
+ fetchConfig?: EthFetchConfig
461
466
  ) {
462
467
  if (!filter) {
463
468
  // @ts-ignore
@@ -466,12 +471,13 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
466
471
  "OwnershipTransferred(address,address)"
467
472
  ](null, null);
468
473
  }
469
- return super.onEvent(handler, filter!);
474
+ return super.onEvent(handler, filter!, fetchConfig);
470
475
  }
471
476
 
472
477
  onEventTransfer(
473
478
  handler: (event: TransferEvent, ctx: ERC20Context) => void,
474
- filter?: TransferEventFilter | TransferEventFilter[]
479
+ filter?: TransferEventFilter | TransferEventFilter[],
480
+ fetchConfig?: EthFetchConfig
475
481
  ) {
476
482
  if (!filter) {
477
483
  // @ts-ignore
@@ -480,7 +486,7 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
480
486
  "Transfer(address,address,uint256)"
481
487
  ](null, null, null);
482
488
  }
483
- return super.onEvent(handler, filter!);
489
+ return super.onEvent(handler, filter!, fetchConfig);
484
490
  }
485
491
  }
486
492
 
@@ -490,7 +496,8 @@ export class ERC20Processor extends BaseProcessor<
490
496
  > {
491
497
  onEventApproval(
492
498
  handler: (event: ApprovalEvent, ctx: ERC20Context) => void,
493
- filter?: ApprovalEventFilter | ApprovalEventFilter[]
499
+ filter?: ApprovalEventFilter | ApprovalEventFilter[],
500
+ fetchConfig?: EthFetchConfig
494
501
  ) {
495
502
  if (!filter) {
496
503
  // @ts-ignore
@@ -499,12 +506,15 @@ export class ERC20Processor extends BaseProcessor<
499
506
  "Approval(address,address,uint256)"
500
507
  ](null, null, null);
501
508
  }
502
- return super.onEvent(handler, filter!);
509
+ return super.onEvent(handler, filter!, fetchConfig);
503
510
  }
504
511
 
505
512
  onEventOwnershipTransferred(
506
513
  handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,
507
- filter?: OwnershipTransferredEventFilter | OwnershipTransferredEventFilter[]
514
+ filter?:
515
+ | OwnershipTransferredEventFilter
516
+ | OwnershipTransferredEventFilter[],
517
+ fetchConfig?: EthFetchConfig
508
518
  ) {
509
519
  if (!filter) {
510
520
  // @ts-ignore
@@ -513,12 +523,13 @@ export class ERC20Processor extends BaseProcessor<
513
523
  "OwnershipTransferred(address,address)"
514
524
  ](null, null);
515
525
  }
516
- return super.onEvent(handler, filter!);
526
+ return super.onEvent(handler, filter!, fetchConfig);
517
527
  }
518
528
 
519
529
  onEventTransfer(
520
530
  handler: (event: TransferEvent, ctx: ERC20Context) => void,
521
- filter?: TransferEventFilter | TransferEventFilter[]
531
+ filter?: TransferEventFilter | TransferEventFilter[],
532
+ fetchConfig?: EthFetchConfig
522
533
  ) {
523
534
  if (!filter) {
524
535
  // @ts-ignore
@@ -527,103 +538,133 @@ export class ERC20Processor extends BaseProcessor<
527
538
  "Transfer(address,address,uint256)"
528
539
  ](null, null, null);
529
540
  }
530
- return super.onEvent(handler, filter!);
541
+ return super.onEvent(handler, filter!, fetchConfig);
531
542
  }
532
543
 
533
544
  onCallAllowance(
534
- handler: (call: AllowanceCallTrace, ctx: ERC20Context) => void
545
+ handler: (call: AllowanceCallTrace, ctx: ERC20Context) => void,
546
+ fetchConfig?: EthFetchConfig
535
547
  ) {
536
- return super.onTrace("0xdd62ed3e", handler);
548
+ return super.onTrace("0xdd62ed3e", handler, fetchConfig);
537
549
  }
538
550
 
539
- onCallApprove(handler: (call: ApproveCallTrace, ctx: ERC20Context) => void) {
540
- return super.onTrace("0x095ea7b3", handler);
551
+ onCallApprove(
552
+ handler: (call: ApproveCallTrace, ctx: ERC20Context) => void,
553
+ fetchConfig?: EthFetchConfig
554
+ ) {
555
+ return super.onTrace("0x095ea7b3", handler, fetchConfig);
541
556
  }
542
557
 
543
558
  onCallBalanceOf(
544
- handler: (call: BalanceOfCallTrace, ctx: ERC20Context) => void
559
+ handler: (call: BalanceOfCallTrace, ctx: ERC20Context) => void,
560
+ fetchConfig?: EthFetchConfig
545
561
  ) {
546
- return super.onTrace("0x70a08231", handler);
562
+ return super.onTrace("0x70a08231", handler, fetchConfig);
547
563
  }
548
564
 
549
- onCallBurn(handler: (call: BurnCallTrace, ctx: ERC20Context) => void) {
550
- return super.onTrace("0x42966c68", handler);
565
+ onCallBurn(
566
+ handler: (call: BurnCallTrace, ctx: ERC20Context) => void,
567
+ fetchConfig?: EthFetchConfig
568
+ ) {
569
+ return super.onTrace("0x42966c68", handler, fetchConfig);
551
570
  }
552
571
 
553
572
  onCallBurnFrom(
554
- handler: (call: BurnFromCallTrace, ctx: ERC20Context) => void
573
+ handler: (call: BurnFromCallTrace, ctx: ERC20Context) => void,
574
+ fetchConfig?: EthFetchConfig
555
575
  ) {
556
- return super.onTrace("0x79cc6790", handler);
576
+ return super.onTrace("0x79cc6790", handler, fetchConfig);
557
577
  }
558
578
 
559
579
  onCallDecimals(
560
- handler: (call: DecimalsCallTrace, ctx: ERC20Context) => void
580
+ handler: (call: DecimalsCallTrace, ctx: ERC20Context) => void,
581
+ fetchConfig?: EthFetchConfig
561
582
  ) {
562
- return super.onTrace("0x313ce567", handler);
583
+ return super.onTrace("0x313ce567", handler, fetchConfig);
563
584
  }
564
585
 
565
586
  onCallDecreaseAllowance(
566
- handler: (call: DecreaseAllowanceCallTrace, ctx: ERC20Context) => void
587
+ handler: (call: DecreaseAllowanceCallTrace, ctx: ERC20Context) => void,
588
+ fetchConfig?: EthFetchConfig
567
589
  ) {
568
- return super.onTrace("0xa457c2d7", handler);
590
+ return super.onTrace("0xa457c2d7", handler, fetchConfig);
569
591
  }
570
592
 
571
593
  onCallIncreaseAllowance(
572
- handler: (call: IncreaseAllowanceCallTrace, ctx: ERC20Context) => void
594
+ handler: (call: IncreaseAllowanceCallTrace, ctx: ERC20Context) => void,
595
+ fetchConfig?: EthFetchConfig
573
596
  ) {
574
- return super.onTrace("0x39509351", handler);
597
+ return super.onTrace("0x39509351", handler, fetchConfig);
575
598
  }
576
599
 
577
- onCallLocker(handler: (call: LockerCallTrace, ctx: ERC20Context) => void) {
578
- return super.onTrace("0xd7b96d4e", handler);
600
+ onCallLocker(
601
+ handler: (call: LockerCallTrace, ctx: ERC20Context) => void,
602
+ fetchConfig?: EthFetchConfig
603
+ ) {
604
+ return super.onTrace("0xd7b96d4e", handler, fetchConfig);
579
605
  }
580
606
 
581
- onCallName(handler: (call: NameCallTrace, ctx: ERC20Context) => void) {
582
- return super.onTrace("0x06fdde03", handler);
607
+ onCallName(
608
+ handler: (call: NameCallTrace, ctx: ERC20Context) => void,
609
+ fetchConfig?: EthFetchConfig
610
+ ) {
611
+ return super.onTrace("0x06fdde03", handler, fetchConfig);
583
612
  }
584
613
 
585
- onCallOwner(handler: (call: OwnerCallTrace, ctx: ERC20Context) => void) {
586
- return super.onTrace("0x8da5cb5b", handler);
614
+ onCallOwner(
615
+ handler: (call: OwnerCallTrace, ctx: ERC20Context) => void,
616
+ fetchConfig?: EthFetchConfig
617
+ ) {
618
+ return super.onTrace("0x8da5cb5b", handler, fetchConfig);
587
619
  }
588
620
 
589
621
  onCallRenounceOwnership(
590
- handler: (call: RenounceOwnershipCallTrace, ctx: ERC20Context) => void
622
+ handler: (call: RenounceOwnershipCallTrace, ctx: ERC20Context) => void,
623
+ fetchConfig?: EthFetchConfig
591
624
  ) {
592
- return super.onTrace("0x715018a6", handler);
625
+ return super.onTrace("0x715018a6", handler, fetchConfig);
593
626
  }
594
627
 
595
628
  onCallSetLocker(
596
- handler: (call: SetLockerCallTrace, ctx: ERC20Context) => void
629
+ handler: (call: SetLockerCallTrace, ctx: ERC20Context) => void,
630
+ fetchConfig?: EthFetchConfig
597
631
  ) {
598
- return super.onTrace("0x171060ec", handler);
632
+ return super.onTrace("0x171060ec", handler, fetchConfig);
599
633
  }
600
634
 
601
- onCallSymbol(handler: (call: SymbolCallTrace, ctx: ERC20Context) => void) {
602
- return super.onTrace("0x95d89b41", handler);
635
+ onCallSymbol(
636
+ handler: (call: SymbolCallTrace, ctx: ERC20Context) => void,
637
+ fetchConfig?: EthFetchConfig
638
+ ) {
639
+ return super.onTrace("0x95d89b41", handler, fetchConfig);
603
640
  }
604
641
 
605
642
  onCallTotalSupply(
606
- handler: (call: TotalSupplyCallTrace, ctx: ERC20Context) => void
643
+ handler: (call: TotalSupplyCallTrace, ctx: ERC20Context) => void,
644
+ fetchConfig?: EthFetchConfig
607
645
  ) {
608
- return super.onTrace("0x18160ddd", handler);
646
+ return super.onTrace("0x18160ddd", handler, fetchConfig);
609
647
  }
610
648
 
611
649
  onCallTransfer(
612
- handler: (call: TransferCallTrace, ctx: ERC20Context) => void
650
+ handler: (call: TransferCallTrace, ctx: ERC20Context) => void,
651
+ fetchConfig?: EthFetchConfig
613
652
  ) {
614
- return super.onTrace("0xa9059cbb", handler);
653
+ return super.onTrace("0xa9059cbb", handler, fetchConfig);
615
654
  }
616
655
 
617
656
  onCallTransferFrom(
618
- handler: (call: TransferFromCallTrace, ctx: ERC20Context) => void
657
+ handler: (call: TransferFromCallTrace, ctx: ERC20Context) => void,
658
+ fetchConfig?: EthFetchConfig
619
659
  ) {
620
- return super.onTrace("0x23b872dd", handler);
660
+ return super.onTrace("0x23b872dd", handler, fetchConfig);
621
661
  }
622
662
 
623
663
  onCallTransferOwnership(
624
- handler: (call: TransferOwnershipCallTrace, ctx: ERC20Context) => void
664
+ handler: (call: TransferOwnershipCallTrace, ctx: ERC20Context) => void,
665
+ fetchConfig?: EthFetchConfig
625
666
  ) {
626
- return super.onTrace("0xf2fde38b", handler);
667
+ return super.onTrace("0xf2fde38b", handler, fetchConfig);
627
668
  }
628
669
 
629
670
  public static filters = templateContract.filters;
@@ -20,6 +20,7 @@ import {
20
20
  TypedCallTrace,
21
21
  toBlockTag,
22
22
  } from "@sentio/sdk";
23
+ import { EthFetchConfig } from "@sentio/protos";
23
24
  import { PromiseOrValue } from "./common";
24
25
  import { ERC20Bytes, ERC20Bytes__factory } from "./index";
25
26
  import {
@@ -320,7 +321,8 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
320
321
 
321
322
  onEventApproval(
322
323
  handler: (event: ApprovalEvent, ctx: ERC20BytesContext) => void,
323
- filter?: ApprovalEventFilter | ApprovalEventFilter[]
324
+ filter?: ApprovalEventFilter | ApprovalEventFilter[],
325
+ fetchConfig?: EthFetchConfig
324
326
  ) {
325
327
  if (!filter) {
326
328
  // @ts-ignore
@@ -329,12 +331,13 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
329
331
  "Approval(address,address,uint256)"
330
332
  ](null, null, null);
331
333
  }
332
- return super.onEvent(handler, filter!);
334
+ return super.onEvent(handler, filter!, fetchConfig);
333
335
  }
334
336
 
335
337
  onEventTransfer(
336
338
  handler: (event: TransferEvent, ctx: ERC20BytesContext) => void,
337
- filter?: TransferEventFilter | TransferEventFilter[]
339
+ filter?: TransferEventFilter | TransferEventFilter[],
340
+ fetchConfig?: EthFetchConfig
338
341
  ) {
339
342
  if (!filter) {
340
343
  // @ts-ignore
@@ -343,7 +346,7 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
343
346
  "Transfer(address,address,uint256)"
344
347
  ](null, null, null);
345
348
  }
346
- return super.onEvent(handler, filter!);
349
+ return super.onEvent(handler, filter!, fetchConfig);
347
350
  }
348
351
  }
349
352
 
@@ -353,7 +356,8 @@ export class ERC20BytesProcessor extends BaseProcessor<
353
356
  > {
354
357
  onEventApproval(
355
358
  handler: (event: ApprovalEvent, ctx: ERC20BytesContext) => void,
356
- filter?: ApprovalEventFilter | ApprovalEventFilter[]
359
+ filter?: ApprovalEventFilter | ApprovalEventFilter[],
360
+ fetchConfig?: EthFetchConfig
357
361
  ) {
358
362
  if (!filter) {
359
363
  // @ts-ignore
@@ -362,12 +366,13 @@ export class ERC20BytesProcessor extends BaseProcessor<
362
366
  "Approval(address,address,uint256)"
363
367
  ](null, null, null);
364
368
  }
365
- return super.onEvent(handler, filter!);
369
+ return super.onEvent(handler, filter!, fetchConfig);
366
370
  }
367
371
 
368
372
  onEventTransfer(
369
373
  handler: (event: TransferEvent, ctx: ERC20BytesContext) => void,
370
- filter?: TransferEventFilter | TransferEventFilter[]
374
+ filter?: TransferEventFilter | TransferEventFilter[],
375
+ fetchConfig?: EthFetchConfig
371
376
  ) {
372
377
  if (!filter) {
373
378
  // @ts-ignore
@@ -376,59 +381,70 @@ export class ERC20BytesProcessor extends BaseProcessor<
376
381
  "Transfer(address,address,uint256)"
377
382
  ](null, null, null);
378
383
  }
379
- return super.onEvent(handler, filter!);
384
+ return super.onEvent(handler, filter!, fetchConfig);
380
385
  }
381
386
 
382
- onCallName(handler: (call: NameCallTrace, ctx: ERC20BytesContext) => void) {
383
- return super.onTrace("0x06fdde03", handler);
387
+ onCallName(
388
+ handler: (call: NameCallTrace, ctx: ERC20BytesContext) => void,
389
+ fetchConfig?: EthFetchConfig
390
+ ) {
391
+ return super.onTrace("0x06fdde03", handler, fetchConfig);
384
392
  }
385
393
 
386
394
  onCallApprove(
387
- handler: (call: ApproveCallTrace, ctx: ERC20BytesContext) => void
395
+ handler: (call: ApproveCallTrace, ctx: ERC20BytesContext) => void,
396
+ fetchConfig?: EthFetchConfig
388
397
  ) {
389
- return super.onTrace("0x095ea7b3", handler);
398
+ return super.onTrace("0x095ea7b3", handler, fetchConfig);
390
399
  }
391
400
 
392
401
  onCallTotalSupply(
393
- handler: (call: TotalSupplyCallTrace, ctx: ERC20BytesContext) => void
402
+ handler: (call: TotalSupplyCallTrace, ctx: ERC20BytesContext) => void,
403
+ fetchConfig?: EthFetchConfig
394
404
  ) {
395
- return super.onTrace("0x18160ddd", handler);
405
+ return super.onTrace("0x18160ddd", handler, fetchConfig);
396
406
  }
397
407
 
398
408
  onCallTransferFrom(
399
- handler: (call: TransferFromCallTrace, ctx: ERC20BytesContext) => void
409
+ handler: (call: TransferFromCallTrace, ctx: ERC20BytesContext) => void,
410
+ fetchConfig?: EthFetchConfig
400
411
  ) {
401
- return super.onTrace("0x23b872dd", handler);
412
+ return super.onTrace("0x23b872dd", handler, fetchConfig);
402
413
  }
403
414
 
404
415
  onCallDecimals(
405
- handler: (call: DecimalsCallTrace, ctx: ERC20BytesContext) => void
416
+ handler: (call: DecimalsCallTrace, ctx: ERC20BytesContext) => void,
417
+ fetchConfig?: EthFetchConfig
406
418
  ) {
407
- return super.onTrace("0x313ce567", handler);
419
+ return super.onTrace("0x313ce567", handler, fetchConfig);
408
420
  }
409
421
 
410
422
  onCallBalanceOf(
411
- handler: (call: BalanceOfCallTrace, ctx: ERC20BytesContext) => void
423
+ handler: (call: BalanceOfCallTrace, ctx: ERC20BytesContext) => void,
424
+ fetchConfig?: EthFetchConfig
412
425
  ) {
413
- return super.onTrace("0x70a08231", handler);
426
+ return super.onTrace("0x70a08231", handler, fetchConfig);
414
427
  }
415
428
 
416
429
  onCallSymbol(
417
- handler: (call: SymbolCallTrace, ctx: ERC20BytesContext) => void
430
+ handler: (call: SymbolCallTrace, ctx: ERC20BytesContext) => void,
431
+ fetchConfig?: EthFetchConfig
418
432
  ) {
419
- return super.onTrace("0x95d89b41", handler);
433
+ return super.onTrace("0x95d89b41", handler, fetchConfig);
420
434
  }
421
435
 
422
436
  onCallTransfer(
423
- handler: (call: TransferCallTrace, ctx: ERC20BytesContext) => void
437
+ handler: (call: TransferCallTrace, ctx: ERC20BytesContext) => void,
438
+ fetchConfig?: EthFetchConfig
424
439
  ) {
425
- return super.onTrace("0xa9059cbb", handler);
440
+ return super.onTrace("0xa9059cbb", handler, fetchConfig);
426
441
  }
427
442
 
428
443
  onCallAllowance(
429
- handler: (call: AllowanceCallTrace, ctx: ERC20BytesContext) => void
444
+ handler: (call: AllowanceCallTrace, ctx: ERC20BytesContext) => void,
445
+ fetchConfig?: EthFetchConfig
430
446
  ) {
431
- return super.onTrace("0xdd62ed3e", handler);
447
+ return super.onTrace("0xdd62ed3e", handler, fetchConfig);
432
448
  }
433
449
 
434
450
  public static filters = templateContract.filters;
@@ -20,6 +20,7 @@ import {
20
20
  TypedCallTrace,
21
21
  toBlockTag,
22
22
  } from "@sentio/sdk";
23
+ import { EthFetchConfig } from "@sentio/protos";
23
24
  import { PromiseOrValue } from "./common";
24
25
  import { ERC721, ERC721__factory } from "./index";
25
26
  import {
@@ -480,7 +481,8 @@ export class ERC721ProcessorTemplate extends BaseProcessorTemplate<
480
481
 
481
482
  onEventApproval(
482
483
  handler: (event: ApprovalEvent, ctx: ERC721Context) => void,
483
- filter?: ApprovalEventFilter | ApprovalEventFilter[]
484
+ filter?: ApprovalEventFilter | ApprovalEventFilter[],
485
+ fetchConfig?: EthFetchConfig
484
486
  ) {
485
487
  if (!filter) {
486
488
  // @ts-ignore
@@ -489,12 +491,13 @@ export class ERC721ProcessorTemplate extends BaseProcessorTemplate<
489
491
  "Approval(address,address,uint256)"
490
492
  ](null, null, null);
491
493
  }
492
- return super.onEvent(handler, filter!);
494
+ return super.onEvent(handler, filter!, fetchConfig);
493
495
  }
494
496
 
495
497
  onEventApprovalForAll(
496
498
  handler: (event: ApprovalForAllEvent, ctx: ERC721Context) => void,
497
- filter?: ApprovalForAllEventFilter | ApprovalForAllEventFilter[]
499
+ filter?: ApprovalForAllEventFilter | ApprovalForAllEventFilter[],
500
+ fetchConfig?: EthFetchConfig
498
501
  ) {
499
502
  if (!filter) {
500
503
  // @ts-ignore
@@ -503,12 +506,13 @@ export class ERC721ProcessorTemplate extends BaseProcessorTemplate<
503
506
  "ApprovalForAll(address,address,bool)"
504
507
  ](null, null, null);
505
508
  }
506
- return super.onEvent(handler, filter!);
509
+ return super.onEvent(handler, filter!, fetchConfig);
507
510
  }
508
511
 
509
512
  onEventTransfer(
510
513
  handler: (event: TransferEvent, ctx: ERC721Context) => void,
511
- filter?: TransferEventFilter | TransferEventFilter[]
514
+ filter?: TransferEventFilter | TransferEventFilter[],
515
+ fetchConfig?: EthFetchConfig
512
516
  ) {
513
517
  if (!filter) {
514
518
  // @ts-ignore
@@ -517,7 +521,7 @@ export class ERC721ProcessorTemplate extends BaseProcessorTemplate<
517
521
  "Transfer(address,address,uint256)"
518
522
  ](null, null, null);
519
523
  }
520
- return super.onEvent(handler, filter!);
524
+ return super.onEvent(handler, filter!, fetchConfig);
521
525
  }
522
526
  }
523
527
 
@@ -527,7 +531,8 @@ export class ERC721Processor extends BaseProcessor<
527
531
  > {
528
532
  onEventApproval(
529
533
  handler: (event: ApprovalEvent, ctx: ERC721Context) => void,
530
- filter?: ApprovalEventFilter | ApprovalEventFilter[]
534
+ filter?: ApprovalEventFilter | ApprovalEventFilter[],
535
+ fetchConfig?: EthFetchConfig
531
536
  ) {
532
537
  if (!filter) {
533
538
  // @ts-ignore
@@ -536,12 +541,13 @@ export class ERC721Processor extends BaseProcessor<
536
541
  "Approval(address,address,uint256)"
537
542
  ](null, null, null);
538
543
  }
539
- return super.onEvent(handler, filter!);
544
+ return super.onEvent(handler, filter!, fetchConfig);
540
545
  }
541
546
 
542
547
  onEventApprovalForAll(
543
548
  handler: (event: ApprovalForAllEvent, ctx: ERC721Context) => void,
544
- filter?: ApprovalForAllEventFilter | ApprovalForAllEventFilter[]
549
+ filter?: ApprovalForAllEventFilter | ApprovalForAllEventFilter[],
550
+ fetchConfig?: EthFetchConfig
545
551
  ) {
546
552
  if (!filter) {
547
553
  // @ts-ignore
@@ -550,12 +556,13 @@ export class ERC721Processor extends BaseProcessor<
550
556
  "ApprovalForAll(address,address,bool)"
551
557
  ](null, null, null);
552
558
  }
553
- return super.onEvent(handler, filter!);
559
+ return super.onEvent(handler, filter!, fetchConfig);
554
560
  }
555
561
 
556
562
  onEventTransfer(
557
563
  handler: (event: TransferEvent, ctx: ERC721Context) => void,
558
- filter?: TransferEventFilter | TransferEventFilter[]
564
+ filter?: TransferEventFilter | TransferEventFilter[],
565
+ fetchConfig?: EthFetchConfig
559
566
  ) {
560
567
  if (!filter) {
561
568
  // @ts-ignore
@@ -564,89 +571,111 @@ export class ERC721Processor extends BaseProcessor<
564
571
  "Transfer(address,address,uint256)"
565
572
  ](null, null, null);
566
573
  }
567
- return super.onEvent(handler, filter!);
574
+ return super.onEvent(handler, filter!, fetchConfig);
568
575
  }
569
576
 
570
- onCallApprove(handler: (call: ApproveCallTrace, ctx: ERC721Context) => void) {
571
- return super.onTrace("0x095ea7b3", handler);
577
+ onCallApprove(
578
+ handler: (call: ApproveCallTrace, ctx: ERC721Context) => void,
579
+ fetchConfig?: EthFetchConfig
580
+ ) {
581
+ return super.onTrace("0x095ea7b3", handler, fetchConfig);
572
582
  }
573
583
 
574
584
  onCallTotalSupply(
575
- handler: (call: TotalSupplyCallTrace, ctx: ERC721Context) => void
585
+ handler: (call: TotalSupplyCallTrace, ctx: ERC721Context) => void,
586
+ fetchConfig?: EthFetchConfig
576
587
  ) {
577
- return super.onTrace("0x18160ddd", handler);
588
+ return super.onTrace("0x18160ddd", handler, fetchConfig);
578
589
  }
579
590
 
580
591
  onCallBalanceOf(
581
- handler: (call: BalanceOfCallTrace, ctx: ERC721Context) => void
592
+ handler: (call: BalanceOfCallTrace, ctx: ERC721Context) => void,
593
+ fetchConfig?: EthFetchConfig
582
594
  ) {
583
- return super.onTrace("0x70a08231", handler);
595
+ return super.onTrace("0x70a08231", handler, fetchConfig);
584
596
  }
585
597
 
586
598
  onCallGetApproved(
587
- handler: (call: GetApprovedCallTrace, ctx: ERC721Context) => void
599
+ handler: (call: GetApprovedCallTrace, ctx: ERC721Context) => void,
600
+ fetchConfig?: EthFetchConfig
588
601
  ) {
589
- return super.onTrace("0x081812fc", handler);
602
+ return super.onTrace("0x081812fc", handler, fetchConfig);
590
603
  }
591
604
 
592
605
  onCallIsApprovedForAll(
593
- handler: (call: IsApprovedForAllCallTrace, ctx: ERC721Context) => void
606
+ handler: (call: IsApprovedForAllCallTrace, ctx: ERC721Context) => void,
607
+ fetchConfig?: EthFetchConfig
594
608
  ) {
595
- return super.onTrace("0xe985e9c5", handler);
609
+ return super.onTrace("0xe985e9c5", handler, fetchConfig);
596
610
  }
597
611
 
598
- onCallName(handler: (call: NameCallTrace, ctx: ERC721Context) => void) {
599
- return super.onTrace("0x06fdde03", handler);
612
+ onCallName(
613
+ handler: (call: NameCallTrace, ctx: ERC721Context) => void,
614
+ fetchConfig?: EthFetchConfig
615
+ ) {
616
+ return super.onTrace("0x06fdde03", handler, fetchConfig);
600
617
  }
601
618
 
602
- onCallOwnerOf(handler: (call: OwnerOfCallTrace, ctx: ERC721Context) => void) {
603
- return super.onTrace("0x6352211e", handler);
619
+ onCallOwnerOf(
620
+ handler: (call: OwnerOfCallTrace, ctx: ERC721Context) => void,
621
+ fetchConfig?: EthFetchConfig
622
+ ) {
623
+ return super.onTrace("0x6352211e", handler, fetchConfig);
604
624
  }
605
625
 
606
626
  onCallSafeTransferFrom_address_address_uint256(
607
627
  handler: (
608
628
  call: SafeTransferFrom_address_address_uint256CallTrace,
609
629
  ctx: ERC721Context
610
- ) => void
630
+ ) => void,
631
+ fetchConfig?: EthFetchConfig
611
632
  ) {
612
- return super.onTrace("0x42842e0e", handler);
633
+ return super.onTrace("0x42842e0e", handler, fetchConfig);
613
634
  }
614
635
 
615
636
  onCallSafeTransferFrom_address_address_uint256_bytes(
616
637
  handler: (
617
638
  call: SafeTransferFrom_address_address_uint256_bytesCallTrace,
618
639
  ctx: ERC721Context
619
- ) => void
640
+ ) => void,
641
+ fetchConfig?: EthFetchConfig
620
642
  ) {
621
- return super.onTrace("0xb88d4fde", handler);
643
+ return super.onTrace("0xb88d4fde", handler, fetchConfig);
622
644
  }
623
645
 
624
646
  onCallSetApprovalForAll(
625
- handler: (call: SetApprovalForAllCallTrace, ctx: ERC721Context) => void
647
+ handler: (call: SetApprovalForAllCallTrace, ctx: ERC721Context) => void,
648
+ fetchConfig?: EthFetchConfig
626
649
  ) {
627
- return super.onTrace("0xa22cb465", handler);
650
+ return super.onTrace("0xa22cb465", handler, fetchConfig);
628
651
  }
629
652
 
630
653
  onCallSupportsInterface(
631
- handler: (call: SupportsInterfaceCallTrace, ctx: ERC721Context) => void
654
+ handler: (call: SupportsInterfaceCallTrace, ctx: ERC721Context) => void,
655
+ fetchConfig?: EthFetchConfig
632
656
  ) {
633
- return super.onTrace("0x01ffc9a7", handler);
657
+ return super.onTrace("0x01ffc9a7", handler, fetchConfig);
634
658
  }
635
659
 
636
- onCallSymbol(handler: (call: SymbolCallTrace, ctx: ERC721Context) => void) {
637
- return super.onTrace("0x95d89b41", handler);
660
+ onCallSymbol(
661
+ handler: (call: SymbolCallTrace, ctx: ERC721Context) => void,
662
+ fetchConfig?: EthFetchConfig
663
+ ) {
664
+ return super.onTrace("0x95d89b41", handler, fetchConfig);
638
665
  }
639
666
 
640
667
  onCallTokenURI(
641
- handler: (call: TokenURICallTrace, ctx: ERC721Context) => void
668
+ handler: (call: TokenURICallTrace, ctx: ERC721Context) => void,
669
+ fetchConfig?: EthFetchConfig
642
670
  ) {
643
- return super.onTrace("0xc87b56dd", handler);
671
+ return super.onTrace("0xc87b56dd", handler, fetchConfig);
644
672
  }
645
673
 
646
674
  onCallTransferFrom(
647
- handler: (call: TransferFromCallTrace, ctx: ERC721Context) => void
675
+ handler: (call: TransferFromCallTrace, ctx: ERC721Context) => void,
676
+ fetchConfig?: EthFetchConfig
648
677
  ) {
649
- return super.onTrace("0x23b872dd", handler);
678
+ return super.onTrace("0x23b872dd", handler, fetchConfig);
650
679
  }
651
680
 
652
681
  public static filters = templateContract.filters;