@sentio/sdk 2.44.3-rc.8 → 2.44.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/aptos/builtin/0x1.d.ts +25 -0
- package/lib/aptos/builtin/0x1.d.ts.map +1 -1
- package/lib/aptos/builtin/0x1.js +24 -2
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/builtin/0x3.js +2 -1
- package/lib/aptos/builtin/0x3.js.map +1 -1
- package/lib/aptos/builtin/0x4.js +2 -1
- package/lib/aptos/builtin/0x4.js.map +1 -1
- package/lib/aptos/codegen/codegen.js +1 -12
- package/lib/aptos/codegen/codegen.js.map +1 -1
- package/lib/aptos/network.d.ts +1 -0
- package/lib/aptos/network.d.ts.map +1 -1
- package/lib/aptos/network.js +2 -1
- package/lib/aptos/network.js.map +1 -1
- package/lib/eth/codegen/codegen.js +4 -5
- package/lib/eth/codegen/codegen.js.map +1 -1
- package/lib/fuel/codegen/codegen.js +2 -2
- package/lib/fuel/codegen/codegen.js.map +1 -1
- package/lib/move/shared-network-codegen.d.ts +3 -1
- package/lib/move/shared-network-codegen.d.ts.map +1 -1
- package/lib/move/shared-network-codegen.js +19 -6
- package/lib/move/shared-network-codegen.js.map +1 -1
- package/lib/solana/builtin/types.d.ts +170 -170
- package/lib/solana/builtin/types.d.ts.map +1 -1
- package/lib/solana/builtin/types.js +1 -1
- package/lib/solana/builtin/types.js.map +1 -1
- package/lib/stark/codegen/codegen.js +2 -2
- package/lib/stark/codegen/codegen.js.map +1 -1
- package/lib/store/codegen.js +2 -2
- package/lib/store/codegen.js.map +1 -1
- package/lib/sui/builtin/0x1.d.ts +19 -0
- package/lib/sui/builtin/0x1.d.ts.map +1 -1
- package/lib/sui/builtin/0x1.js +28 -3
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x2.js +0 -2
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/builtin/0x3.js +1 -3
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/lib/sui/codegen/codegen.js +1 -12
- package/lib/sui/codegen/codegen.js.map +1 -1
- package/lib/sui/network.d.ts +0 -2
- package/lib/sui/network.d.ts.map +1 -1
- package/lib/sui/network.js +3 -3
- package/lib/sui/network.js.map +1 -1
- package/package.json +12 -16
- package/src/aptos/abis/0x1.json +73 -9
- package/src/aptos/builtin/0x1.ts +80 -2
- package/src/aptos/builtin/0x3.ts +2 -1
- package/src/aptos/builtin/0x4.ts +2 -1
- package/src/aptos/codegen/codegen.ts +1 -13
- package/src/aptos/network.ts +2 -1
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +204 -204
- package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.ts +12 -12
- package/src/eth/builtin/internal/erc1155-processor.ts +95 -95
- package/src/eth/builtin/internal/erc1155-test-utils.ts +8 -8
- package/src/eth/builtin/internal/erc20-processor.ts +140 -140
- package/src/eth/builtin/internal/erc20-test-utils.ts +6 -6
- package/src/eth/builtin/internal/erc20bytes-processor.ts +80 -80
- package/src/eth/builtin/internal/erc20bytes-test-utils.ts +4 -4
- package/src/eth/builtin/internal/erc721-processor.ts +133 -133
- package/src/eth/builtin/internal/erc721-test-utils.ts +6 -6
- package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.ts +1 -1
- package/src/eth/builtin/internal/factories/ERC1155__factory.ts +1 -1
- package/src/eth/builtin/internal/factories/ERC20Bytes__factory.ts +1 -1
- package/src/eth/builtin/internal/weth9-processor.ts +97 -97
- package/src/eth/builtin/internal/weth9-test-utils.ts +8 -8
- package/src/eth/codegen/codegen.ts +5 -5
- package/src/fuel/codegen/codegen.ts +2 -2
- package/src/move/shared-network-codegen.ts +14 -7
- package/src/solana/builtin/types.ts +1 -1
- package/src/stark/codegen/codegen.ts +2 -2
- package/src/store/codegen.ts +2 -2
- package/src/sui/abis/0x1.json +391 -0
- package/src/sui/abis/0x3.json +20 -0
- package/src/sui/builtin/0x1.ts +44 -3
- package/src/sui/builtin/0x2.ts +0 -2
- package/src/sui/builtin/0x3.ts +1 -3
- package/src/sui/codegen/codegen.ts +1 -13
- package/src/sui/network.ts +3 -3
@@ -22,12 +22,12 @@ const mockField = {
|
|
22
22
|
|
23
23
|
export function mockApprovalLog(
|
24
24
|
contractAddress: string,
|
25
|
-
event: ApprovalEventObject
|
25
|
+
event: ApprovalEventObject,
|
26
26
|
): LogParams {
|
27
27
|
const contract = getERC20Contract(EthChainId.ETHEREUM, contractAddress);
|
28
28
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
29
29
|
"Approval(address,address,uint256)",
|
30
|
-
[event.owner, event.spender, event.value]
|
30
|
+
[event.owner, event.spender, event.value],
|
31
31
|
);
|
32
32
|
return {
|
33
33
|
...mockField,
|
@@ -40,12 +40,12 @@ export function mockApprovalLog(
|
|
40
40
|
|
41
41
|
export function mockOwnershipTransferredLog(
|
42
42
|
contractAddress: string,
|
43
|
-
event: OwnershipTransferredEventObject
|
43
|
+
event: OwnershipTransferredEventObject,
|
44
44
|
): LogParams {
|
45
45
|
const contract = getERC20Contract(EthChainId.ETHEREUM, contractAddress);
|
46
46
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
47
47
|
"OwnershipTransferred(address,address)",
|
48
|
-
[event.previousOwner, event.newOwner]
|
48
|
+
[event.previousOwner, event.newOwner],
|
49
49
|
);
|
50
50
|
return {
|
51
51
|
...mockField,
|
@@ -58,12 +58,12 @@ export function mockOwnershipTransferredLog(
|
|
58
58
|
|
59
59
|
export function mockTransferLog(
|
60
60
|
contractAddress: string,
|
61
|
-
event: TransferEventObject
|
61
|
+
event: TransferEventObject,
|
62
62
|
): LogParams {
|
63
63
|
const contract = getERC20Contract(EthChainId.ETHEREUM, contractAddress);
|
64
64
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
65
65
|
"Transfer(address,address,uint256)",
|
66
|
-
[event.from, event.to, event.value]
|
66
|
+
[event.from, event.to, event.value],
|
67
67
|
);
|
68
68
|
return {
|
69
69
|
...mockField,
|
@@ -119,7 +119,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
119
119
|
async name(
|
120
120
|
overrides?: Overrides,
|
121
121
|
preparedData?: PreparedData,
|
122
|
-
ethCallContext?: EthCallContext
|
122
|
+
ethCallContext?: EthCallContext,
|
123
123
|
): Promise<string> {
|
124
124
|
try {
|
125
125
|
return await this.contract.getFunction("name()")(overrides || {});
|
@@ -132,7 +132,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
132
132
|
async totalSupply(
|
133
133
|
overrides?: Overrides,
|
134
134
|
preparedData?: PreparedData,
|
135
|
-
ethCallContext?: EthCallContext
|
135
|
+
ethCallContext?: EthCallContext,
|
136
136
|
): Promise<bigint> {
|
137
137
|
try {
|
138
138
|
return await this.contract.getFunction("totalSupply()")(overrides || {});
|
@@ -145,7 +145,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
145
145
|
async decimals(
|
146
146
|
overrides?: Overrides,
|
147
147
|
preparedData?: PreparedData,
|
148
|
-
ethCallContext?: EthCallContext
|
148
|
+
ethCallContext?: EthCallContext,
|
149
149
|
): Promise<bigint> {
|
150
150
|
try {
|
151
151
|
return await this.contract.getFunction("decimals()")(overrides || {});
|
@@ -159,12 +159,12 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
159
159
|
who: string,
|
160
160
|
overrides?: Overrides,
|
161
161
|
preparedData?: PreparedData,
|
162
|
-
ethCallContext?: EthCallContext
|
162
|
+
ethCallContext?: EthCallContext,
|
163
163
|
): Promise<bigint> {
|
164
164
|
try {
|
165
165
|
return await this.contract.getFunction("balanceOf(address)")(
|
166
166
|
who,
|
167
|
-
overrides || {}
|
167
|
+
overrides || {},
|
168
168
|
);
|
169
169
|
} catch (e) {
|
170
170
|
const stack = new Error().stack;
|
@@ -175,7 +175,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
175
175
|
async symbol(
|
176
176
|
overrides?: Overrides,
|
177
177
|
preparedData?: PreparedData,
|
178
|
-
ethCallContext?: EthCallContext
|
178
|
+
ethCallContext?: EthCallContext,
|
179
179
|
): Promise<string> {
|
180
180
|
try {
|
181
181
|
return await this.contract.getFunction("symbol()")(overrides || {});
|
@@ -190,13 +190,13 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
190
190
|
spender: string,
|
191
191
|
overrides?: Overrides,
|
192
192
|
preparedData?: PreparedData,
|
193
|
-
ethCallContext?: EthCallContext
|
193
|
+
ethCallContext?: EthCallContext,
|
194
194
|
): Promise<bigint> {
|
195
195
|
try {
|
196
196
|
return await this.contract.getFunction("allowance(address,address)")(
|
197
197
|
owner,
|
198
198
|
spender,
|
199
|
-
overrides || {}
|
199
|
+
overrides || {},
|
200
200
|
);
|
201
201
|
} catch (e) {
|
202
202
|
const stack = new Error().stack;
|
@@ -212,7 +212,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
212
212
|
value: BigNumberish,
|
213
213
|
overrides?: Overrides,
|
214
214
|
preparedData?: PreparedData,
|
215
|
-
ethCallContext?: EthCallContext
|
215
|
+
ethCallContext?: EthCallContext,
|
216
216
|
): Promise<boolean> {
|
217
217
|
try {
|
218
218
|
return await this.contract
|
@@ -229,7 +229,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
229
229
|
value: BigNumberish,
|
230
230
|
overrides?: Overrides,
|
231
231
|
preparedData?: PreparedData,
|
232
|
-
ethCallContext?: EthCallContext
|
232
|
+
ethCallContext?: EthCallContext,
|
233
233
|
): Promise<boolean> {
|
234
234
|
try {
|
235
235
|
return await this.contract
|
@@ -245,7 +245,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
245
245
|
value: BigNumberish,
|
246
246
|
overrides?: Overrides,
|
247
247
|
preparedData?: PreparedData,
|
248
|
-
ethCallContext?: EthCallContext
|
248
|
+
ethCallContext?: EthCallContext,
|
249
249
|
): Promise<boolean> {
|
250
250
|
try {
|
251
251
|
return await this.contract
|
@@ -275,7 +275,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
275
275
|
approve(
|
276
276
|
spender: string,
|
277
277
|
value: BigNumberish,
|
278
|
-
ethCallContext: EthCallContext
|
278
|
+
ethCallContext: EthCallContext,
|
279
279
|
): EthCallParam {
|
280
280
|
try {
|
281
281
|
const iface = new Interface(["function approve(address,uint256)"]);
|
@@ -306,7 +306,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
306
306
|
from: string,
|
307
307
|
to: string,
|
308
308
|
value: BigNumberish,
|
309
|
-
ethCallContext: EthCallContext
|
309
|
+
ethCallContext: EthCallContext,
|
310
310
|
): EthCallParam {
|
311
311
|
try {
|
312
312
|
const iface = new Interface([
|
@@ -368,7 +368,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
368
368
|
transfer(
|
369
369
|
to: string,
|
370
370
|
value: BigNumberish,
|
371
|
-
ethCallContext: EthCallContext
|
371
|
+
ethCallContext: EthCallContext,
|
372
372
|
): EthCallParam {
|
373
373
|
try {
|
374
374
|
const iface = new Interface(["function transfer(address,uint256)"]);
|
@@ -385,7 +385,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
385
385
|
allowance(
|
386
386
|
owner: string,
|
387
387
|
spender: string,
|
388
|
-
ethCallContext: EthCallContext
|
388
|
+
ethCallContext: EthCallContext,
|
389
389
|
): EthCallParam {
|
390
390
|
try {
|
391
391
|
const iface = new Interface(["function allowance(address,address)"]);
|
@@ -421,7 +421,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
421
421
|
...overrides,
|
422
422
|
},
|
423
423
|
this.context.preparedData,
|
424
|
-
ethCallContext
|
424
|
+
ethCallContext,
|
425
425
|
);
|
426
426
|
}
|
427
427
|
|
@@ -437,7 +437,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
437
437
|
...overrides,
|
438
438
|
},
|
439
439
|
this.context.preparedData,
|
440
|
-
ethCallContext
|
440
|
+
ethCallContext,
|
441
441
|
);
|
442
442
|
}
|
443
443
|
|
@@ -453,7 +453,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
453
453
|
...overrides,
|
454
454
|
},
|
455
455
|
this.context.preparedData,
|
456
|
-
ethCallContext
|
456
|
+
ethCallContext,
|
457
457
|
);
|
458
458
|
}
|
459
459
|
|
@@ -470,7 +470,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
470
470
|
...overrides,
|
471
471
|
},
|
472
472
|
this.context.preparedData,
|
473
|
-
ethCallContext
|
473
|
+
ethCallContext,
|
474
474
|
);
|
475
475
|
}
|
476
476
|
|
@@ -486,14 +486,14 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
486
486
|
...overrides,
|
487
487
|
},
|
488
488
|
this.context.preparedData,
|
489
|
-
ethCallContext
|
489
|
+
ethCallContext,
|
490
490
|
);
|
491
491
|
}
|
492
492
|
|
493
493
|
async allowance(
|
494
494
|
owner: string,
|
495
495
|
spender: string,
|
496
|
-
overrides?: Overrides
|
496
|
+
overrides?: Overrides,
|
497
497
|
): Promise<bigint> {
|
498
498
|
const ethCallContext = {
|
499
499
|
chainId: this.context.chainId,
|
@@ -508,7 +508,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
508
508
|
...overrides,
|
509
509
|
},
|
510
510
|
this.context.preparedData,
|
511
|
-
ethCallContext
|
511
|
+
ethCallContext,
|
512
512
|
);
|
513
513
|
}
|
514
514
|
|
@@ -519,7 +519,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
519
519
|
async approve(
|
520
520
|
spender: string,
|
521
521
|
value: BigNumberish,
|
522
|
-
overrides?: Overrides
|
522
|
+
overrides?: Overrides,
|
523
523
|
): Promise<boolean> {
|
524
524
|
const ethCallContext = {
|
525
525
|
chainId: this.context.chainId,
|
@@ -534,14 +534,14 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
534
534
|
...overrides,
|
535
535
|
},
|
536
536
|
this.context.preparedData,
|
537
|
-
ethCallContext
|
537
|
+
ethCallContext,
|
538
538
|
);
|
539
539
|
},
|
540
540
|
async transferFrom(
|
541
541
|
from: string,
|
542
542
|
to: string,
|
543
543
|
value: BigNumberish,
|
544
|
-
overrides?: Overrides
|
544
|
+
overrides?: Overrides,
|
545
545
|
): Promise<boolean> {
|
546
546
|
const ethCallContext = {
|
547
547
|
chainId: this.context.chainId,
|
@@ -557,13 +557,13 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
557
557
|
...overrides,
|
558
558
|
},
|
559
559
|
this.context.preparedData,
|
560
|
-
ethCallContext
|
560
|
+
ethCallContext,
|
561
561
|
);
|
562
562
|
},
|
563
563
|
async transfer(
|
564
564
|
to: string,
|
565
565
|
value: BigNumberish,
|
566
|
-
overrides?: Overrides
|
566
|
+
overrides?: Overrides,
|
567
567
|
): Promise<boolean> {
|
568
568
|
const ethCallContext = {
|
569
569
|
chainId: this.context.chainId,
|
@@ -578,7 +578,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
578
578
|
...overrides,
|
579
579
|
},
|
580
580
|
this.context.preparedData,
|
581
|
-
ethCallContext
|
581
|
+
ethCallContext,
|
582
582
|
);
|
583
583
|
},
|
584
584
|
};
|
@@ -605,7 +605,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
605
605
|
approve(
|
606
606
|
spender: string,
|
607
607
|
value: BigNumberish,
|
608
|
-
overrides?: Overrides
|
608
|
+
overrides?: Overrides,
|
609
609
|
): EthCallParam {
|
610
610
|
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
611
611
|
if (overrides?.blockTag) {
|
@@ -640,7 +640,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
640
640
|
from: string,
|
641
641
|
to: string,
|
642
642
|
value: BigNumberish,
|
643
|
-
overrides?: Overrides
|
643
|
+
overrides?: Overrides,
|
644
644
|
): EthCallParam {
|
645
645
|
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
646
646
|
if (overrides?.blockTag) {
|
@@ -704,7 +704,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
704
704
|
transfer(
|
705
705
|
to: string,
|
706
706
|
value: BigNumberish,
|
707
|
-
overrides?: Overrides
|
707
|
+
overrides?: Overrides,
|
708
708
|
): EthCallParam {
|
709
709
|
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
710
710
|
if (overrides?.blockTag) {
|
@@ -723,7 +723,7 @@ export class ERC20BytesBoundContractView extends BoundContractView<
|
|
723
723
|
allowance(
|
724
724
|
owner: string,
|
725
725
|
spender: string,
|
726
|
-
overrides?: Overrides
|
726
|
+
overrides?: Overrides,
|
727
727
|
): EthCallParam {
|
728
728
|
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
729
729
|
if (overrides?.blockTag) {
|
@@ -758,14 +758,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
758
758
|
preprocessHandler?: (
|
759
759
|
event: ApprovalEvent,
|
760
760
|
ctx: ERC20BytesContext,
|
761
|
-
preprocessStore: { [k: string]: any }
|
762
|
-
) => Promise<PreprocessResult
|
761
|
+
preprocessStore: { [k: string]: any },
|
762
|
+
) => Promise<PreprocessResult>,
|
763
763
|
): this {
|
764
764
|
if (!filter) {
|
765
765
|
filter = templateContract.filters["Approval(address,address,uint256)"](
|
766
766
|
null,
|
767
767
|
null,
|
768
|
-
null
|
768
|
+
null,
|
769
769
|
);
|
770
770
|
}
|
771
771
|
return super.onEthEvent(handler, filter!, fetchConfig, preprocessHandler);
|
@@ -778,14 +778,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
778
778
|
preprocessHandler?: (
|
779
779
|
event: TransferEvent,
|
780
780
|
ctx: ERC20BytesContext,
|
781
|
-
preprocessStore: { [k: string]: any }
|
782
|
-
) => Promise<PreprocessResult
|
781
|
+
preprocessStore: { [k: string]: any },
|
782
|
+
) => Promise<PreprocessResult>,
|
783
783
|
): this {
|
784
784
|
if (!filter) {
|
785
785
|
filter = templateContract.filters["Transfer(address,address,uint256)"](
|
786
786
|
null,
|
787
787
|
null,
|
788
|
-
null
|
788
|
+
null,
|
789
789
|
);
|
790
790
|
}
|
791
791
|
return super.onEthEvent(handler, filter!, fetchConfig, preprocessHandler);
|
@@ -796,14 +796,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
796
796
|
fetchConfig?: Partial<EthFetchConfig>,
|
797
797
|
preprocessHandler?: (
|
798
798
|
call: NameCallTrace,
|
799
|
-
ctx: ERC20BytesContext
|
800
|
-
) => Promise<PreprocessResult
|
799
|
+
ctx: ERC20BytesContext,
|
800
|
+
) => Promise<PreprocessResult>,
|
801
801
|
): this {
|
802
802
|
return super.onEthTrace(
|
803
803
|
"0x06fdde03",
|
804
804
|
handler as any,
|
805
805
|
fetchConfig,
|
806
|
-
preprocessHandler
|
806
|
+
preprocessHandler,
|
807
807
|
);
|
808
808
|
}
|
809
809
|
|
@@ -812,14 +812,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
812
812
|
fetchConfig?: Partial<EthFetchConfig>,
|
813
813
|
preprocessHandler?: (
|
814
814
|
call: ApproveCallTrace,
|
815
|
-
ctx: ERC20BytesContext
|
816
|
-
) => Promise<PreprocessResult
|
815
|
+
ctx: ERC20BytesContext,
|
816
|
+
) => Promise<PreprocessResult>,
|
817
817
|
): this {
|
818
818
|
return super.onEthTrace(
|
819
819
|
"0x095ea7b3",
|
820
820
|
handler as any,
|
821
821
|
fetchConfig,
|
822
|
-
preprocessHandler
|
822
|
+
preprocessHandler,
|
823
823
|
);
|
824
824
|
}
|
825
825
|
|
@@ -828,14 +828,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
828
828
|
fetchConfig?: Partial<EthFetchConfig>,
|
829
829
|
preprocessHandler?: (
|
830
830
|
call: TotalSupplyCallTrace,
|
831
|
-
ctx: ERC20BytesContext
|
832
|
-
) => Promise<PreprocessResult
|
831
|
+
ctx: ERC20BytesContext,
|
832
|
+
) => Promise<PreprocessResult>,
|
833
833
|
): this {
|
834
834
|
return super.onEthTrace(
|
835
835
|
"0x18160ddd",
|
836
836
|
handler as any,
|
837
837
|
fetchConfig,
|
838
|
-
preprocessHandler
|
838
|
+
preprocessHandler,
|
839
839
|
);
|
840
840
|
}
|
841
841
|
|
@@ -844,14 +844,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
844
844
|
fetchConfig?: Partial<EthFetchConfig>,
|
845
845
|
preprocessHandler?: (
|
846
846
|
call: TransferFromCallTrace,
|
847
|
-
ctx: ERC20BytesContext
|
848
|
-
) => Promise<PreprocessResult
|
847
|
+
ctx: ERC20BytesContext,
|
848
|
+
) => Promise<PreprocessResult>,
|
849
849
|
): this {
|
850
850
|
return super.onEthTrace(
|
851
851
|
"0x23b872dd",
|
852
852
|
handler as any,
|
853
853
|
fetchConfig,
|
854
|
-
preprocessHandler
|
854
|
+
preprocessHandler,
|
855
855
|
);
|
856
856
|
}
|
857
857
|
|
@@ -860,14 +860,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
860
860
|
fetchConfig?: Partial<EthFetchConfig>,
|
861
861
|
preprocessHandler?: (
|
862
862
|
call: DecimalsCallTrace,
|
863
|
-
ctx: ERC20BytesContext
|
864
|
-
) => Promise<PreprocessResult
|
863
|
+
ctx: ERC20BytesContext,
|
864
|
+
) => Promise<PreprocessResult>,
|
865
865
|
): this {
|
866
866
|
return super.onEthTrace(
|
867
867
|
"0x313ce567",
|
868
868
|
handler as any,
|
869
869
|
fetchConfig,
|
870
|
-
preprocessHandler
|
870
|
+
preprocessHandler,
|
871
871
|
);
|
872
872
|
}
|
873
873
|
|
@@ -876,14 +876,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
876
876
|
fetchConfig?: Partial<EthFetchConfig>,
|
877
877
|
preprocessHandler?: (
|
878
878
|
call: BalanceOfCallTrace,
|
879
|
-
ctx: ERC20BytesContext
|
880
|
-
) => Promise<PreprocessResult
|
879
|
+
ctx: ERC20BytesContext,
|
880
|
+
) => Promise<PreprocessResult>,
|
881
881
|
): this {
|
882
882
|
return super.onEthTrace(
|
883
883
|
"0x70a08231",
|
884
884
|
handler as any,
|
885
885
|
fetchConfig,
|
886
|
-
preprocessHandler
|
886
|
+
preprocessHandler,
|
887
887
|
);
|
888
888
|
}
|
889
889
|
|
@@ -892,14 +892,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
892
892
|
fetchConfig?: Partial<EthFetchConfig>,
|
893
893
|
preprocessHandler?: (
|
894
894
|
call: SymbolCallTrace,
|
895
|
-
ctx: ERC20BytesContext
|
896
|
-
) => Promise<PreprocessResult
|
895
|
+
ctx: ERC20BytesContext,
|
896
|
+
) => Promise<PreprocessResult>,
|
897
897
|
): this {
|
898
898
|
return super.onEthTrace(
|
899
899
|
"0x95d89b41",
|
900
900
|
handler as any,
|
901
901
|
fetchConfig,
|
902
|
-
preprocessHandler
|
902
|
+
preprocessHandler,
|
903
903
|
);
|
904
904
|
}
|
905
905
|
|
@@ -908,14 +908,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
908
908
|
fetchConfig?: Partial<EthFetchConfig>,
|
909
909
|
preprocessHandler?: (
|
910
910
|
call: TransferCallTrace,
|
911
|
-
ctx: ERC20BytesContext
|
912
|
-
) => Promise<PreprocessResult
|
911
|
+
ctx: ERC20BytesContext,
|
912
|
+
) => Promise<PreprocessResult>,
|
913
913
|
): this {
|
914
914
|
return super.onEthTrace(
|
915
915
|
"0xa9059cbb",
|
916
916
|
handler as any,
|
917
917
|
fetchConfig,
|
918
|
-
preprocessHandler
|
918
|
+
preprocessHandler,
|
919
919
|
);
|
920
920
|
}
|
921
921
|
|
@@ -924,14 +924,14 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
924
924
|
fetchConfig?: Partial<EthFetchConfig>,
|
925
925
|
preprocessHandler?: (
|
926
926
|
call: AllowanceCallTrace,
|
927
|
-
ctx: ERC20BytesContext
|
928
|
-
) => Promise<PreprocessResult
|
927
|
+
ctx: ERC20BytesContext,
|
928
|
+
) => Promise<PreprocessResult>,
|
929
929
|
): this {
|
930
930
|
return super.onEthTrace(
|
931
931
|
"0xdd62ed3e",
|
932
932
|
handler as any,
|
933
933
|
fetchConfig,
|
934
|
-
preprocessHandler
|
934
|
+
preprocessHandler,
|
935
935
|
);
|
936
936
|
}
|
937
937
|
|
@@ -939,23 +939,23 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
939
939
|
Approval(
|
940
940
|
owner?: string | null,
|
941
941
|
spender?: string | null,
|
942
|
-
value?: null
|
942
|
+
value?: null,
|
943
943
|
): ApprovalEventFilter {
|
944
944
|
return templateContract.filters["Approval(address,address,uint256)"](
|
945
945
|
owner,
|
946
946
|
spender,
|
947
|
-
value
|
947
|
+
value,
|
948
948
|
);
|
949
949
|
},
|
950
950
|
Transfer(
|
951
951
|
from?: string | null,
|
952
952
|
to?: string | null,
|
953
|
-
value?: null
|
953
|
+
value?: null,
|
954
954
|
): TransferEventFilter {
|
955
955
|
return templateContract.filters["Transfer(address,address,uint256)"](
|
956
956
|
from,
|
957
957
|
to,
|
958
|
-
value
|
958
|
+
value,
|
959
959
|
);
|
960
960
|
},
|
961
961
|
};
|
@@ -963,7 +963,7 @@ export class ERC20BytesProcessor extends BaseProcessor<
|
|
963
963
|
protected CreateBoundContractView(): ERC20BytesBoundContractView {
|
964
964
|
const view = getERC20BytesContract(
|
965
965
|
this.config.network,
|
966
|
-
this.config.address
|
966
|
+
this.config.address,
|
967
967
|
);
|
968
968
|
return new ERC20BytesBoundContractView(this.config.address, view);
|
969
969
|
}
|
@@ -1004,14 +1004,14 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
|
|
1004
1004
|
preprocessHandler?: (
|
1005
1005
|
event: ApprovalEvent,
|
1006
1006
|
ctx: ERC20BytesContext,
|
1007
|
-
preprocessStore: { [k: string]: any }
|
1008
|
-
) => Promise<PreprocessResult
|
1007
|
+
preprocessStore: { [k: string]: any },
|
1008
|
+
) => Promise<PreprocessResult>,
|
1009
1009
|
): this {
|
1010
1010
|
if (!filter) {
|
1011
1011
|
filter = templateContract.filters["Approval(address,address,uint256)"](
|
1012
1012
|
null,
|
1013
1013
|
null,
|
1014
|
-
null
|
1014
|
+
null,
|
1015
1015
|
);
|
1016
1016
|
}
|
1017
1017
|
return super.onEthEvent(handler, filter!, fetchConfig, preprocessHandler);
|
@@ -1024,14 +1024,14 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
|
|
1024
1024
|
preprocessHandler?: (
|
1025
1025
|
event: TransferEvent,
|
1026
1026
|
ctx: ERC20BytesContext,
|
1027
|
-
preprocessStore: { [k: string]: any }
|
1028
|
-
) => Promise<PreprocessResult
|
1027
|
+
preprocessStore: { [k: string]: any },
|
1028
|
+
) => Promise<PreprocessResult>,
|
1029
1029
|
): this {
|
1030
1030
|
if (!filter) {
|
1031
1031
|
filter = templateContract.filters["Transfer(address,address,uint256)"](
|
1032
1032
|
null,
|
1033
1033
|
null,
|
1034
|
-
null
|
1034
|
+
null,
|
1035
1035
|
);
|
1036
1036
|
}
|
1037
1037
|
return super.onEthEvent(handler, filter!, fetchConfig, preprocessHandler);
|
@@ -1040,17 +1040,17 @@ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<
|
|
1040
1040
|
|
1041
1041
|
export function getERC20BytesContract(
|
1042
1042
|
chainId: EthChainId,
|
1043
|
-
address: string
|
1043
|
+
address: string,
|
1044
1044
|
): ERC20BytesContractView {
|
1045
1045
|
let contract = getContractByABI(
|
1046
1046
|
"ERC20Bytes",
|
1047
1047
|
address,
|
1048
|
-
chainId
|
1048
|
+
chainId,
|
1049
1049
|
) as ERC20BytesContractView;
|
1050
1050
|
if (!contract) {
|
1051
1051
|
const rawContract = ERC20Bytes__factory.connect(
|
1052
1052
|
address,
|
1053
|
-
getProvider(chainId)
|
1053
|
+
getProvider(chainId),
|
1054
1054
|
);
|
1055
1055
|
contract = new ERC20BytesContractView(rawContract);
|
1056
1056
|
addContractByABI("ERC20Bytes", address, chainId, contract);
|
@@ -1060,7 +1060,7 @@ export function getERC20BytesContract(
|
|
1060
1060
|
|
1061
1061
|
export function getERC20BytesContractOnContext(
|
1062
1062
|
context: EthContext,
|
1063
|
-
address: string
|
1063
|
+
address: string,
|
1064
1064
|
): ERC20BytesBoundContractView {
|
1065
1065
|
const view = getERC20BytesContract(context.getChainId(), address);
|
1066
1066
|
const boundView = new ERC20BytesBoundContractView(address, view);
|
@@ -18,12 +18,12 @@ const mockField = {
|
|
18
18
|
|
19
19
|
export function mockApprovalLog(
|
20
20
|
contractAddress: string,
|
21
|
-
event: ApprovalEventObject
|
21
|
+
event: ApprovalEventObject,
|
22
22
|
): LogParams {
|
23
23
|
const contract = getERC20BytesContract(EthChainId.ETHEREUM, contractAddress);
|
24
24
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
25
25
|
"Approval(address,address,uint256)",
|
26
|
-
[event.owner, event.spender, event.value]
|
26
|
+
[event.owner, event.spender, event.value],
|
27
27
|
);
|
28
28
|
return {
|
29
29
|
...mockField,
|
@@ -36,12 +36,12 @@ export function mockApprovalLog(
|
|
36
36
|
|
37
37
|
export function mockTransferLog(
|
38
38
|
contractAddress: string,
|
39
|
-
event: TransferEventObject
|
39
|
+
event: TransferEventObject,
|
40
40
|
): LogParams {
|
41
41
|
const contract = getERC20BytesContract(EthChainId.ETHEREUM, contractAddress);
|
42
42
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
43
43
|
"Transfer(address,address,uint256)",
|
44
|
-
[event.from, event.to, event.value]
|
44
|
+
[event.from, event.to, event.value],
|
45
45
|
);
|
46
46
|
return {
|
47
47
|
...mockField,
|