@sentio/sdk 1.40.5-rc.6 → 1.41.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.
- package/lib/builtin/eacaggregatorproxy/index.js +3 -16
- package/lib/builtin/eacaggregatorproxy/index.js.map +1 -1
- package/lib/builtin/eacaggregatorproxy/test-utils.d.ts +5 -5
- package/lib/builtin/eacaggregatorproxy/test-utils.js +8 -4
- package/lib/builtin/eacaggregatorproxy/test-utils.js.map +1 -1
- package/lib/builtin/erc1155/index.js +3 -16
- package/lib/builtin/erc1155/index.js.map +1 -1
- package/lib/builtin/erc1155/test-utils.d.ts +5 -5
- package/lib/builtin/erc1155/test-utils.js +8 -4
- package/lib/builtin/erc1155/test-utils.js.map +1 -1
- package/lib/builtin/erc20/index.js +3 -16
- package/lib/builtin/erc20/index.js.map +1 -1
- package/lib/builtin/erc20/test-utils.d.ts +4 -4
- package/lib/builtin/erc20/test-utils.js +6 -3
- package/lib/builtin/erc20/test-utils.js.map +1 -1
- package/lib/builtin/erc20bytes/index.js +3 -16
- package/lib/builtin/erc20bytes/index.js.map +1 -1
- package/lib/builtin/erc20bytes/test-utils.d.ts +3 -3
- package/lib/builtin/erc20bytes/test-utils.js +4 -2
- package/lib/builtin/erc20bytes/test-utils.js.map +1 -1
- package/lib/builtin/erc721/index.js +3 -16
- package/lib/builtin/erc721/index.js.map +1 -1
- package/lib/builtin/erc721/test-utils.d.ts +4 -4
- package/lib/builtin/erc721/test-utils.js +6 -3
- package/lib/builtin/erc721/test-utils.js.map +1 -1
- package/lib/builtin/index.js +5 -27
- package/lib/builtin/index.js.map +1 -1
- package/lib/builtin/internal/EACAggregatorProxy.d.ts +19 -430
- package/lib/builtin/internal/EACAggregatorProxy.js.map +1 -1
- package/lib/builtin/internal/ERC1155.d.ts +18 -161
- package/lib/builtin/internal/ERC1155.js.map +1 -1
- package/lib/builtin/internal/ERC20.d.ts +12 -279
- package/lib/builtin/internal/ERC20.js.map +1 -1
- package/lib/builtin/internal/ERC20Bytes.d.ts +11 -146
- package/lib/builtin/internal/ERC20Bytes.js.map +1 -1
- package/lib/builtin/internal/ERC721.d.ts +12 -222
- package/lib/builtin/internal/ERC721.js.map +1 -1
- package/lib/builtin/internal/WETH9.d.ts +16 -191
- package/lib/builtin/internal/WETH9.js.map +1 -1
- package/lib/builtin/internal/common.d.ts +3 -18
- package/lib/builtin/internal/common.js +6 -0
- package/lib/builtin/internal/common.js.map +1 -1
- package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +161 -168
- package/lib/builtin/internal/eacaggregatorproxy_processor.js +94 -288
- package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
- package/lib/builtin/internal/erc1155_processor.d.ts +45 -50
- package/lib/builtin/internal/erc1155_processor.js +68 -132
- package/lib/builtin/internal/erc1155_processor.js.map +1 -1
- package/lib/builtin/internal/erc20_processor.d.ts +59 -63
- package/lib/builtin/internal/erc20_processor.js +64 -155
- package/lib/builtin/internal/erc20_processor.js.map +1 -1
- package/lib/builtin/internal/erc20bytes_processor.d.ts +37 -40
- package/lib/builtin/internal/erc20bytes_processor.js +50 -118
- package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
- package/lib/builtin/internal/erc721_processor.d.ts +56 -60
- package/lib/builtin/internal/erc721_processor.js +66 -167
- package/lib/builtin/internal/erc721_processor.js.map +1 -1
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.d.ts +1 -2
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js +1 -1
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC1155__factory.d.ts +1 -2
- package/lib/builtin/internal/factories/ERC1155__factory.js +1 -1
- package/lib/builtin/internal/factories/ERC1155__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC20Bytes__factory.d.ts +1 -2
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js +1 -1
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC20__factory.d.ts +1 -2
- package/lib/builtin/internal/factories/ERC20__factory.js +1 -1
- package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC721__factory.d.ts +1 -2
- package/lib/builtin/internal/factories/ERC721__factory.js +1 -1
- package/lib/builtin/internal/factories/ERC721__factory.js.map +1 -1
- package/lib/builtin/internal/factories/WETH9__factory.d.ts +1 -2
- package/lib/builtin/internal/factories/WETH9__factory.js +1 -1
- package/lib/builtin/internal/factories/WETH9__factory.js.map +1 -1
- package/lib/builtin/internal/index.js +2 -24
- package/lib/builtin/internal/index.js.map +1 -1
- package/lib/builtin/internal/weth9_processor.d.ts +44 -49
- package/lib/builtin/internal/weth9_processor.js +70 -144
- package/lib/builtin/internal/weth9_processor.js.map +1 -1
- package/lib/builtin/weth9/index.js +3 -16
- package/lib/builtin/weth9/index.js.map +1 -1
- package/lib/builtin/weth9/test-utils.d.ts +5 -5
- package/lib/builtin/weth9/test-utils.js +8 -4
- package/lib/builtin/weth9/test-utils.js.map +1 -1
- package/lib/core/big-decimal.d.ts +6 -0
- package/lib/core/big-decimal.js +6 -2
- package/lib/core/big-decimal.js.map +1 -1
- package/lib/core/bind-options.d.ts +1 -1
- package/lib/core/bind-options.js +2 -2
- package/lib/core/bind-options.js.map +1 -1
- package/lib/core/context.d.ts +8 -14
- package/lib/core/context.js +7 -6
- package/lib/core/context.js.map +1 -1
- package/lib/core/core-plugin.d.ts +1 -1
- package/lib/core/core-plugin.js +1 -1
- package/lib/core/core-plugin.js.map +1 -1
- package/lib/core/generic-processor.test.js.map +1 -1
- package/lib/core/index.d.ts +0 -5
- package/lib/core/index.js +1 -9
- package/lib/core/index.js.map +1 -1
- package/lib/core/numberish.d.ts +2 -3
- package/lib/core/numberish.js +35 -33
- package/lib/core/numberish.js.map +1 -1
- package/lib/core/numberish.test.js.map +1 -1
- package/lib/core/sui-plugin.d.ts +1 -1
- package/lib/core/sui-plugin.js +1 -1
- package/lib/core/sui-plugin.js.map +1 -1
- package/lib/error.js +2 -2
- package/lib/error.js.map +1 -1
- package/lib/eth/account-processor-state.d.ts +5 -0
- package/lib/eth/account-processor-state.js +9 -0
- package/lib/eth/account-processor-state.js.map +1 -0
- package/lib/{core → eth}/account-processor.d.ts +4 -8
- package/lib/{core → eth}/account-processor.js +33 -42
- package/lib/eth/account-processor.js.map +1 -0
- package/lib/{core → eth}/base-processor-template.d.ts +7 -8
- package/lib/{core → eth}/base-processor-template.js +3 -3
- package/lib/eth/base-processor-template.js.map +1 -0
- package/lib/{core → eth}/base-processor.d.ts +7 -7
- package/lib/{core → eth}/base-processor.js +13 -18
- package/lib/eth/base-processor.js.map +1 -0
- package/lib/{binds.d.ts → eth/binds.d.ts} +4 -3
- package/lib/{binds.js → eth/binds.js} +3 -3
- package/lib/eth/binds.js.map +1 -0
- package/lib/{core → eth}/eth-plugin.d.ts +2 -2
- package/lib/{core → eth}/eth-plugin.js +19 -13
- package/lib/eth/eth-plugin.js.map +1 -0
- package/lib/{core → eth}/generic-processor.d.ts +3 -3
- package/lib/{core → eth}/generic-processor.js +5 -5
- package/lib/eth/generic-processor.js.map +1 -0
- package/lib/eth/index.d.ts +6 -0
- package/lib/eth/index.js +15 -0
- package/lib/eth/index.js.map +1 -0
- package/lib/eth/provider.d.ts +4 -0
- package/lib/eth/provider.js +74 -0
- package/lib/eth/provider.js.map +1 -0
- package/lib/{core → eth}/trace.d.ts +2 -2
- package/lib/{core → eth}/trace.js +0 -0
- package/lib/eth/trace.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +7 -23
- package/lib/index.js.map +1 -1
- package/lib/target-ethers-sentio/event-handler.d.ts +1 -0
- package/lib/target-ethers-sentio/event-handler.js +21 -5
- package/lib/target-ethers-sentio/event-handler.js.map +1 -1
- package/lib/target-ethers-sentio/file.js +59 -57
- package/lib/target-ethers-sentio/file.js.map +1 -1
- package/lib/target-ethers-sentio/functions-handler.js +7 -4
- package/lib/target-ethers-sentio/functions-handler.js.map +1 -1
- package/lib/target-ethers-sentio/index.d.ts +1 -1
- package/lib/target-ethers-sentio/index.js +3 -5
- package/lib/target-ethers-sentio/index.js.map +1 -1
- package/lib/target-ethers-sentio/view-function.js +15 -15
- package/lib/target-ethers-sentio/view-function.js.map +1 -1
- package/lib/testing/metric-utils.js +2 -2
- package/lib/testing/metric-utils.js.map +1 -1
- package/lib/testing/test-processor-server.d.ts +11 -11
- package/lib/testing/test-processor-server.js +7 -12
- package/lib/testing/test-processor-server.js.map +1 -1
- package/lib/testing/test-provider.js +1 -6
- package/lib/testing/test-provider.js.map +1 -1
- package/lib/utils/conversion.d.ts +2 -2
- package/lib/utils/conversion.js +12 -5
- package/lib/utils/conversion.js.map +1 -1
- package/lib/utils/dex-price.d.ts +1 -1
- package/lib/utils/dex-price.js +5 -6
- package/lib/utils/dex-price.js.map +1 -1
- package/lib/utils/dex-price.test.js.map +1 -1
- package/lib/utils/erc20.test.js.map +1 -1
- package/lib/utils/index.js +5 -27
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/token.d.ts +2 -3
- package/lib/utils/token.js +5 -6
- package/lib/utils/token.js.map +1 -1
- package/lib/webpack.config.js +1 -1
- package/package.json +7 -13
- package/src/builtin/eacaggregatorproxy/test-utils.ts +13 -9
- package/src/builtin/erc1155/test-utils.ts +13 -9
- package/src/builtin/erc20/test-utils.ts +10 -7
- package/src/builtin/erc20bytes/test-utils.ts +7 -5
- package/src/builtin/erc721/test-utils.ts +10 -7
- package/src/builtin/internal/EACAggregatorProxy.ts +20 -815
- package/src/builtin/internal/ERC1155.ts +20 -483
- package/src/builtin/internal/ERC20.ts +15 -641
- package/src/builtin/internal/ERC20Bytes.ts +13 -357
- package/src/builtin/internal/ERC721.ts +15 -601
- package/src/builtin/internal/WETH9.ts +20 -439
- package/src/builtin/internal/common.ts +33 -33
- package/src/builtin/internal/eacaggregatorproxy_processor.ts +344 -425
- package/src/builtin/internal/erc1155_processor.ts +202 -209
- package/src/builtin/internal/erc20_processor.ts +191 -225
- package/src/builtin/internal/erc20bytes_processor.ts +136 -165
- package/src/builtin/internal/erc721_processor.ts +218 -242
- package/src/builtin/internal/factories/EACAggregatorProxy__factory.ts +2 -3
- package/src/builtin/internal/factories/ERC1155__factory.ts +2 -3
- package/src/builtin/internal/factories/ERC20Bytes__factory.ts +2 -3
- package/src/builtin/internal/factories/ERC20__factory.ts +2 -3
- package/src/builtin/internal/factories/ERC721__factory.ts +2 -3
- package/src/builtin/internal/factories/WETH9__factory.ts +2 -3
- package/src/builtin/internal/weth9_processor.ts +176 -208
- package/src/builtin/weth9/test-utils.ts +13 -9
- package/src/core/big-decimal.ts +11 -0
- package/src/core/bind-options.ts +2 -3
- package/src/core/context.ts +14 -13
- package/src/core/core-plugin.ts +1 -1
- package/src/core/index.ts +0 -6
- package/src/core/numberish.ts +39 -40
- package/src/core/sui-plugin.ts +1 -1
- package/src/error.ts +1 -1
- package/src/eth/account-processor-state.ts +6 -0
- package/src/{core → eth}/account-processor.ts +40 -50
- package/src/{core → eth}/base-processor-template.ts +11 -12
- package/src/{core → eth}/base-processor.ts +37 -31
- package/src/{binds.ts → eth/binds.ts} +6 -5
- package/src/{core → eth}/eth-plugin.ts +19 -12
- package/src/{core → eth}/generic-processor.ts +5 -5
- package/src/eth/index.ts +6 -0
- package/src/eth/provider.ts +82 -0
- package/src/{core → eth}/trace.ts +2 -3
- package/src/index.ts +2 -3
- package/src/target-ethers-sentio/event-handler.ts +22 -5
- package/src/target-ethers-sentio/file.ts +65 -65
- package/src/target-ethers-sentio/functions-handler.ts +8 -4
- package/src/target-ethers-sentio/index.ts +1 -1
- package/src/target-ethers-sentio/view-function.ts +17 -18
- package/src/testing/metric-utils.ts +2 -2
- package/src/testing/test-processor-server.ts +23 -24
- package/src/testing/test-provider.ts +2 -7
- package/src/utils/conversion.ts +12 -5
- package/src/utils/dex-price.ts +3 -3
- package/src/utils/token.ts +10 -11
- package/src/webpack.config.js +1 -1
- package/lib/binds.js.map +0 -1
- package/lib/core/account-processor.js.map +0 -1
- package/lib/core/base-processor-template.js.map +0 -1
- package/lib/core/base-processor.js.map +0 -1
- package/lib/core/eth-plugin.js.map +0 -1
- package/lib/core/generic-processor.js.map +0 -1
- package/lib/core/trace.js.map +0 -1
package/src/core/bind-options.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Networkish } from '
|
|
2
|
-
import { getNetwork } from '@ethersproject/providers'
|
|
1
|
+
import { Networkish, Network } from 'ethers/providers'
|
|
3
2
|
|
|
4
3
|
export class BindOptions {
|
|
5
4
|
// Contract address
|
|
@@ -15,7 +14,7 @@ export class BindOptions {
|
|
|
15
14
|
export function getOptionsSignature(opts: BindOptions): string {
|
|
16
15
|
const sig = [opts.address]
|
|
17
16
|
if (opts.network) {
|
|
18
|
-
sig.push(
|
|
17
|
+
sig.push(Network.from(opts.network).chainId.toString())
|
|
19
18
|
}
|
|
20
19
|
if (opts.name) {
|
|
21
20
|
sig.push(opts.name)
|
package/src/core/context.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { BaseContract, Transaction, TransactionReceipt, Block, ContractEvent } from 'ethers'
|
|
2
|
+
import { LogParams } from 'ethers/providers'
|
|
3
|
+
|
|
1
4
|
import { RecordMetaData } from '@sentio/protos'
|
|
2
|
-
import { BaseContract, EventFilter, Transaction } from 'ethers'
|
|
3
|
-
import { Block, Log } from '@ethersproject/abstract-provider'
|
|
4
5
|
import { normalizeLabels } from './meter'
|
|
5
|
-
import { Trace } from '
|
|
6
|
+
import { Trace } from '../eth/trace'
|
|
6
7
|
import { Labels } from './metadata'
|
|
7
8
|
import { CHAIN_IDS } from '../utils/chain'
|
|
8
9
|
import { BaseContext } from './base-context'
|
|
9
|
-
import { TransactionReceipt } from '@ethersproject/providers'
|
|
10
10
|
|
|
11
11
|
export abstract class EthContext extends BaseContext {
|
|
12
12
|
chainId: number
|
|
13
13
|
address: string
|
|
14
|
-
private readonly log?:
|
|
14
|
+
private readonly log?: LogParams
|
|
15
15
|
block?: Block
|
|
16
16
|
private readonly trace?: Trace
|
|
17
17
|
blockNumber: bigint | number
|
|
@@ -25,7 +25,7 @@ export abstract class EthContext extends BaseContext {
|
|
|
25
25
|
address: string,
|
|
26
26
|
timestamp?: Date,
|
|
27
27
|
block?: Block,
|
|
28
|
-
log?:
|
|
28
|
+
log?: LogParams,
|
|
29
29
|
trace?: Trace,
|
|
30
30
|
transaction?: Transaction,
|
|
31
31
|
transactionReceipt?: TransactionReceipt
|
|
@@ -60,7 +60,7 @@ export abstract class EthContext extends BaseContext {
|
|
|
60
60
|
blockNumber: BigInt(this.blockNumber),
|
|
61
61
|
transactionIndex: this.log.transactionIndex,
|
|
62
62
|
transactionHash: this.transactionHash || '',
|
|
63
|
-
logIndex: this.log.
|
|
63
|
+
logIndex: this.log.index,
|
|
64
64
|
chainId: this.chainId.toString(),
|
|
65
65
|
name: name,
|
|
66
66
|
labels: normalizeLabels(labels),
|
|
@@ -118,12 +118,15 @@ export class ContractContext<
|
|
|
118
118
|
chainId: number,
|
|
119
119
|
timestamp?: Date,
|
|
120
120
|
block?: Block,
|
|
121
|
-
log?:
|
|
121
|
+
log?: LogParams,
|
|
122
122
|
trace?: Trace,
|
|
123
123
|
transaction?: Transaction,
|
|
124
124
|
transactionReceipt?: TransactionReceipt
|
|
125
125
|
) {
|
|
126
|
-
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
const address = view.rawContract.getAddress() as string
|
|
129
|
+
super(chainId, address, timestamp, block, log, trace, transaction, transactionReceipt)
|
|
127
130
|
view.context = this
|
|
128
131
|
this.contractName = contractName
|
|
129
132
|
this.contract = view
|
|
@@ -135,12 +138,10 @@ export class ContractContext<
|
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
export class ContractView<TContract extends BaseContract> {
|
|
138
|
-
filters: { [name: string]: (...args: Array<any>) => EventFilter }
|
|
139
141
|
protected contract: TContract
|
|
140
142
|
|
|
141
143
|
constructor(contract: TContract) {
|
|
142
144
|
this.contract = contract
|
|
143
|
-
this.filters = contract.filters
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
get rawContract() {
|
|
@@ -148,7 +149,7 @@ export class ContractView<TContract extends BaseContract> {
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
get provider() {
|
|
151
|
-
return this.contract.provider
|
|
152
|
+
return this.contract.runner?.provider
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
|
|
@@ -170,7 +171,7 @@ export class BoundContractView<TContract extends BaseContract, TContractView ext
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
get filters() {
|
|
173
|
-
return this.view.filters
|
|
174
|
+
return this.view.rawContract.filters
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
177
|
|
package/src/core/core-plugin.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { ExporterState } from './exporter'
|
|
|
8
8
|
export class CorePlugin extends Plugin {
|
|
9
9
|
name: string = 'CorePlugin'
|
|
10
10
|
|
|
11
|
-
configure(config: ProcessConfigResponse): void {
|
|
11
|
+
async configure(config: ProcessConfigResponse): Promise<void> {
|
|
12
12
|
// part 0, prepare metrics and event tracking configs
|
|
13
13
|
for (const metric of MetricState.INSTANCE.getValues()) {
|
|
14
14
|
config.metricConfigs.push({
|
package/src/core/index.ts
CHANGED
|
@@ -6,13 +6,7 @@ export { type Numberish, toBigInteger, toMetricValue, toBlockTag } from './numbe
|
|
|
6
6
|
|
|
7
7
|
export { BindOptions } from './bind-options'
|
|
8
8
|
|
|
9
|
-
export { BaseProcessor } from './base-processor'
|
|
10
|
-
export { GenericProcessor } from './generic-processor'
|
|
11
|
-
export { BaseProcessorTemplate } from './base-processor-template'
|
|
12
9
|
export { SuiBaseProcessor, SuiBindOptions } from './sui-processor'
|
|
13
10
|
|
|
14
|
-
export type { TypedCallTrace, Trace } from './trace'
|
|
15
|
-
|
|
16
|
-
export { EthPlugin } from './eth-plugin'
|
|
17
11
|
export { SuiPlugin } from './sui-plugin'
|
|
18
12
|
export { CorePlugin } from './core-plugin'
|
package/src/core/numberish.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { BigNumber } from 'ethers'
|
|
2
1
|
import { BigInteger, MetricValue } from '@sentio/protos'
|
|
3
2
|
import { BigDecimal } from '.'
|
|
4
|
-
import { BlockTag } from '
|
|
3
|
+
import { BlockTag } from 'ethers/providers'
|
|
5
4
|
|
|
6
|
-
export type Numberish = number |
|
|
5
|
+
export type Numberish = number | bigint | BigDecimal | string
|
|
7
6
|
|
|
8
7
|
export function toBlockTag(a: number | bigint): BlockTag {
|
|
9
8
|
if (typeof a === 'number') {
|
|
@@ -16,53 +15,52 @@ export function toBlockTag(a: number | bigint): BlockTag {
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
export function toMetricValue(value: Numberish): MetricValue {
|
|
19
|
-
if (value
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
return MetricValue.fromPartial({
|
|
28
|
-
bigInteger: bigDecimalToBigInteger(value),
|
|
29
|
-
})
|
|
30
|
-
} else {
|
|
31
|
-
if (value.isNaN()) {
|
|
32
|
-
throw new Error('Cannot record NaN value')
|
|
33
|
-
}
|
|
34
|
-
if (!value.isFinite()) {
|
|
35
|
-
// NaN also not finite
|
|
36
|
-
throw new Error('Cannot record infinite value')
|
|
37
|
-
}
|
|
18
|
+
if (typeof value === 'number') {
|
|
19
|
+
if (Number.isNaN(value)) {
|
|
20
|
+
throw new Error('Cannot record NaN value')
|
|
21
|
+
}
|
|
22
|
+
if (!Number.isFinite(value)) {
|
|
23
|
+
throw new Error('Cannot record infinite value')
|
|
24
|
+
}
|
|
25
|
+
if (Number.isInteger(value) && !Number.isSafeInteger(value)) {
|
|
38
26
|
return MetricValue.fromPartial({
|
|
39
|
-
|
|
27
|
+
bigInteger: toBigInteger(value),
|
|
40
28
|
})
|
|
41
29
|
}
|
|
30
|
+
|
|
31
|
+
return MetricValue.fromPartial({
|
|
32
|
+
doubleValue: Number(value),
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
if (typeof value === 'bigint') {
|
|
36
|
+
return MetricValue.fromPartial({
|
|
37
|
+
bigInteger: toBigInteger(value),
|
|
38
|
+
})
|
|
42
39
|
}
|
|
43
40
|
if (typeof value === 'string') {
|
|
44
41
|
return MetricValue.fromPartial({
|
|
45
42
|
bigDecimal: value,
|
|
46
43
|
})
|
|
47
44
|
}
|
|
48
|
-
if (
|
|
45
|
+
// if (value instanceof BigDecimal) {
|
|
46
|
+
// Carefully consider the use case here
|
|
47
|
+
if (value.isInteger()) {
|
|
49
48
|
return MetricValue.fromPartial({
|
|
50
|
-
bigInteger:
|
|
49
|
+
bigInteger: bigDecimalToBigInteger(value),
|
|
51
50
|
})
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (typeof value === 'number') {
|
|
55
|
-
if (Number.isNaN(value)) {
|
|
51
|
+
} else {
|
|
52
|
+
if (value.isNaN()) {
|
|
56
53
|
throw new Error('Cannot record NaN value')
|
|
57
54
|
}
|
|
58
|
-
if (!
|
|
55
|
+
if (!value.isFinite()) {
|
|
56
|
+
// NaN also not finite
|
|
59
57
|
throw new Error('Cannot record infinite value')
|
|
60
58
|
}
|
|
59
|
+
return MetricValue.fromPartial({
|
|
60
|
+
bigDecimal: value.toString(), // e.g. -7.350918e-428
|
|
61
|
+
})
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
return MetricValue.fromPartial({
|
|
64
|
-
doubleValue: Number(value),
|
|
65
|
-
})
|
|
63
|
+
// }
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
function bigDecimalToBigInteger(a: BigDecimal): BigInteger {
|
|
@@ -82,17 +80,18 @@ function intToBigInteger(a: bigint | number): BigInteger {
|
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
export function toBigInteger(a: Numberish): BigInteger {
|
|
85
|
-
if (a
|
|
86
|
-
return
|
|
83
|
+
if (typeof a === 'number') {
|
|
84
|
+
return intToBigInteger(a)
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return intToBigInteger(a.toBigInt())
|
|
86
|
+
if (typeof a === 'bigint') {
|
|
87
|
+
return intToBigInteger(a)
|
|
91
88
|
}
|
|
92
89
|
if (typeof a === 'string') {
|
|
93
90
|
return intToBigInteger(BigInt(a))
|
|
94
91
|
}
|
|
95
|
-
|
|
92
|
+
if (a instanceof BigDecimal) {
|
|
93
|
+
return bigDecimalToBigInteger(a)
|
|
94
|
+
}
|
|
96
95
|
return intToBigInteger(a)
|
|
97
96
|
|
|
98
97
|
// Following code is actually very slow
|
package/src/core/sui-plugin.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { SuiProcessorState } from './sui-processor'
|
|
|
9
9
|
export class SuiPlugin extends Plugin {
|
|
10
10
|
name: string = 'SuiPlugin'
|
|
11
11
|
|
|
12
|
-
configure(config: ProcessConfigResponse)
|
|
12
|
+
async configure(config: ProcessConfigResponse) {
|
|
13
13
|
for (const suiProcessor of SuiProcessorState.INSTANCE.getValues()) {
|
|
14
14
|
const contractConfig: ContractConfig = {
|
|
15
15
|
transactionConfig: [],
|
package/src/error.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { ListStateStorage } from '@sentio/runtime'
|
|
2
1
|
import { ERC20__factory, ERC721__factory } from '../builtin/internal'
|
|
3
2
|
import { AddressType, DummyProvider, EthFetchConfig, ProcessResult } from '@sentio/sdk'
|
|
4
|
-
import { AccountBindOptions } from '
|
|
5
|
-
|
|
3
|
+
import { AccountBindOptions } from '../core/bind-options'
|
|
4
|
+
|
|
5
|
+
import { Network, LogParams } from 'ethers/providers'
|
|
6
|
+
|
|
6
7
|
import { TransferEvent as ERC20TransferEvent } from '../builtin/internal/ERC20'
|
|
7
8
|
import { TransferEvent as ERC721TransferEvent } from '../builtin/internal/ERC721'
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
import { ERC20Processor } from '../builtin/internal/erc20_processor'
|
|
11
|
+
import { ERC721Processor } from '../builtin/internal/erc721_processor'
|
|
12
|
+
|
|
13
|
+
import { AccountContext } from '../core/context'
|
|
9
14
|
import { PromiseOrVoid } from '../promise-or-void'
|
|
10
|
-
import { Event } from '@ethersproject/contracts'
|
|
11
|
-
import { BytesLike } from '@ethersproject/bytes'
|
|
12
15
|
import { AddressOrTypeEventFilter, EventsHandler } from './base-processor'
|
|
13
|
-
import { Block } from '
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
export class AccountProcessorState extends ListStateStorage<AccountProcessor> {
|
|
17
|
-
static INSTANCE = new AccountProcessorState()
|
|
18
|
-
}
|
|
16
|
+
import { Transaction, Block, TransactionReceipt, LogDescription } from 'ethers'
|
|
17
|
+
import { AccountProcessorState } from './account-processor-state'
|
|
19
18
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
19
|
+
const ERC20_INTERFACE = ERC20__factory.createInterface()
|
|
20
|
+
const ERC721_INTERFACE = ERC721__factory.createInterface()
|
|
22
21
|
|
|
23
22
|
export class AccountProcessor {
|
|
24
23
|
config: AccountBindOptions
|
|
@@ -41,7 +40,7 @@ export class AccountProcessor {
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
public getChainId(): number {
|
|
44
|
-
return
|
|
43
|
+
return Number(Network.from(this.config.network || 1).chainId)
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
/**
|
|
@@ -58,7 +57,7 @@ export class AccountProcessor {
|
|
|
58
57
|
return this.onERC20(
|
|
59
58
|
handler,
|
|
60
59
|
tokensAddresses,
|
|
61
|
-
(address: string) =>
|
|
60
|
+
(address: string) => ERC721Processor.filters.Transfer(null, this.config.address),
|
|
62
61
|
fetchConfig
|
|
63
62
|
)
|
|
64
63
|
}
|
|
@@ -77,7 +76,7 @@ export class AccountProcessor {
|
|
|
77
76
|
return this.onERC20(
|
|
78
77
|
handler,
|
|
79
78
|
tokensAddresses,
|
|
80
|
-
(address: string) =>
|
|
79
|
+
(address: string) => ERC20Processor.filters.Transfer(this.config.address),
|
|
81
80
|
fetchConfig
|
|
82
81
|
)
|
|
83
82
|
}
|
|
@@ -97,7 +96,7 @@ export class AccountProcessor {
|
|
|
97
96
|
handler,
|
|
98
97
|
tokensAddresses,
|
|
99
98
|
(address: string) =>
|
|
100
|
-
|
|
99
|
+
ERC20Processor.filters.Transfer('0x0000000000000000000000000000000000000000', this.config.address),
|
|
101
100
|
fetchConfig
|
|
102
101
|
)
|
|
103
102
|
}
|
|
@@ -125,7 +124,7 @@ export class AccountProcessor {
|
|
|
125
124
|
return this.onERC721(
|
|
126
125
|
handler,
|
|
127
126
|
collections,
|
|
128
|
-
(address: string) =>
|
|
127
|
+
(address: string) => ERC721Processor.filters.Transfer(null, this.config.address),
|
|
129
128
|
fetchConfig
|
|
130
129
|
)
|
|
131
130
|
}
|
|
@@ -144,7 +143,7 @@ export class AccountProcessor {
|
|
|
144
143
|
return this.onERC721(
|
|
145
144
|
handler,
|
|
146
145
|
collections,
|
|
147
|
-
(address: string) =>
|
|
146
|
+
(address: string) => ERC721Processor.filters.Transfer(this.config.address),
|
|
148
147
|
fetchConfig
|
|
149
148
|
)
|
|
150
149
|
}
|
|
@@ -164,7 +163,7 @@ export class AccountProcessor {
|
|
|
164
163
|
handler,
|
|
165
164
|
collections,
|
|
166
165
|
(address: string) =>
|
|
167
|
-
|
|
166
|
+
ERC721Processor.filters.Transfer('0x0000000000000000000000000000000000000000', this.config.address),
|
|
168
167
|
fetchConfig
|
|
169
168
|
)
|
|
170
169
|
}
|
|
@@ -201,7 +200,7 @@ export class AccountProcessor {
|
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
protected onEvent(
|
|
204
|
-
handler: (event:
|
|
203
|
+
handler: (event: LogDescription, ctx: AccountContext) => PromiseOrVoid,
|
|
205
204
|
filter: AddressOrTypeEventFilter | AddressOrTypeEventFilter[],
|
|
206
205
|
fetchConfig?: EthFetchConfig
|
|
207
206
|
) {
|
|
@@ -215,21 +214,21 @@ export class AccountProcessor {
|
|
|
215
214
|
_filters.push(filter)
|
|
216
215
|
}
|
|
217
216
|
|
|
218
|
-
let hasVaildConfig = false
|
|
219
|
-
for (const filter of _filters) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (!hasVaildConfig) {
|
|
231
|
-
|
|
232
|
-
}
|
|
217
|
+
// let hasVaildConfig = false
|
|
218
|
+
// for (const filter of _filters) {
|
|
219
|
+
// if (filter.address) {
|
|
220
|
+
// hasVaildConfig = true
|
|
221
|
+
// break
|
|
222
|
+
// }
|
|
223
|
+
// if (filter.topics && filter.topics.length) {
|
|
224
|
+
// hasVaildConfig = true
|
|
225
|
+
// break
|
|
226
|
+
// }
|
|
227
|
+
// }
|
|
228
|
+
//
|
|
229
|
+
// if (!hasVaildConfig) {
|
|
230
|
+
// throw Error('no valid config has been found for this account')
|
|
231
|
+
// }
|
|
233
232
|
|
|
234
233
|
const config = this.config
|
|
235
234
|
|
|
@@ -237,29 +236,20 @@ export class AccountProcessor {
|
|
|
237
236
|
filters: _filters,
|
|
238
237
|
fetchConfig: fetchConfig || EthFetchConfig.fromPartial({}),
|
|
239
238
|
handler: async function (data) {
|
|
240
|
-
const log = data.log as
|
|
239
|
+
const log = data.log as { topics: Array<string>; data: string }
|
|
241
240
|
const ctx = new AccountContext(
|
|
242
241
|
chainId,
|
|
243
242
|
config.address,
|
|
244
243
|
data.timestamp,
|
|
245
244
|
data.block as Block,
|
|
246
|
-
log,
|
|
245
|
+
log as any as LogParams,
|
|
247
246
|
undefined,
|
|
248
247
|
data.transaction as Transaction,
|
|
249
248
|
data.transactionReceipt as TransactionReceipt
|
|
250
249
|
)
|
|
251
|
-
const
|
|
252
|
-
const parsed = ERC20_CONTRACT.interface.parseLog(log)
|
|
250
|
+
const parsed = ERC20_INTERFACE.parseLog(log)
|
|
253
251
|
if (parsed) {
|
|
254
|
-
|
|
255
|
-
event.decode = (data: BytesLike, topics?: Array<any>) => {
|
|
256
|
-
return ERC20_CONTRACT.interface.decodeEventLog(parsed.eventFragment, data, topics)
|
|
257
|
-
}
|
|
258
|
-
event.event = parsed.name
|
|
259
|
-
event.eventSignature = parsed.signature
|
|
260
|
-
|
|
261
|
-
// TODO fix this bug
|
|
262
|
-
await handler(event, ctx)
|
|
252
|
+
await handler(parsed, ctx)
|
|
263
253
|
return ctx.getProcessResult()
|
|
264
254
|
}
|
|
265
255
|
return ProcessResult.fromPartial({})
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { BoundContractView, ContractContext, ContractView } from '
|
|
2
|
-
import { Block } from '
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { BaseProcessor } from './base-processor'
|
|
6
|
-
import { BindOptions, getOptionsSignature } from './bind-options'
|
|
1
|
+
import { BoundContractView, ContractContext, ContractView } from '../core/context'
|
|
2
|
+
import { BaseContract, ContractEvent, Block, LogDescription } from 'ethers'
|
|
3
|
+
import { AddressOrTypeEventFilter, BaseProcessor } from './base-processor'
|
|
4
|
+
import { BindOptions, getOptionsSignature } from '../core/bind-options'
|
|
7
5
|
import { EthFetchConfig, HandleInterval, TemplateInstance } from '@sentio/protos'
|
|
8
|
-
import { getNetwork } from '@ethersproject/providers'
|
|
9
6
|
import { PromiseOrVoid } from '../promise-or-void'
|
|
10
7
|
import { Trace } from './trace'
|
|
11
8
|
import { ListStateStorage } from '@sentio/runtime'
|
|
9
|
+
import { EventFilter, LogParams, Network } from 'ethers/providers'
|
|
10
|
+
import { DeferredTopicFilter } from 'ethers/contract'
|
|
12
11
|
|
|
13
12
|
export class ProcessorTemplateProcessorState extends ListStateStorage<
|
|
14
13
|
BaseProcessorTemplate<BaseContract, BoundContractView<BaseContract, any>>
|
|
@@ -37,8 +36,8 @@ export abstract class BaseProcessorTemplate<
|
|
|
37
36
|
fetchConfig?: EthFetchConfig
|
|
38
37
|
}[] = []
|
|
39
38
|
eventHandlers: {
|
|
40
|
-
handler: (event:
|
|
41
|
-
filter:
|
|
39
|
+
handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
|
40
|
+
filter: DeferredTopicFilter | DeferredTopicFilter[]
|
|
42
41
|
fetchConfig?: EthFetchConfig
|
|
43
42
|
}[] = []
|
|
44
43
|
|
|
@@ -71,7 +70,7 @@ export abstract class BaseProcessorTemplate<
|
|
|
71
70
|
contract: {
|
|
72
71
|
address: options.address,
|
|
73
72
|
name: options.name || '',
|
|
74
|
-
chainId: options.network ?
|
|
73
|
+
chainId: options.network ? Network.from(options.network).chainId.toString() : '1',
|
|
75
74
|
abi: '',
|
|
76
75
|
},
|
|
77
76
|
startBlock: 0n,
|
|
@@ -88,8 +87,8 @@ export abstract class BaseProcessorTemplate<
|
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
public onEvent(
|
|
91
|
-
handler: (event:
|
|
92
|
-
filter:
|
|
90
|
+
handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
91
|
+
filter: DeferredTopicFilter | DeferredTopicFilter[],
|
|
93
92
|
fetchConfig?: EthFetchConfig
|
|
94
93
|
) {
|
|
95
94
|
this.eventHandlers.push({
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
Block,
|
|
3
|
+
ContractEvent,
|
|
4
|
+
Log,
|
|
5
|
+
TransactionReceipt,
|
|
6
|
+
BytesLike,
|
|
7
|
+
BaseContract,
|
|
8
|
+
Transaction,
|
|
9
|
+
DeferredTopicFilter,
|
|
10
|
+
LogDescription,
|
|
11
|
+
EventFragment,
|
|
12
|
+
} from 'ethers'
|
|
13
|
+
import { EventFilter, LogParams, Network } from 'ethers/providers'
|
|
4
14
|
|
|
5
|
-
import { BoundContractView, ContractContext, ContractView } from '
|
|
15
|
+
import { BoundContractView, ContractContext, ContractView } from '../core/context'
|
|
6
16
|
import {
|
|
7
17
|
AddressType,
|
|
8
18
|
Data_EthBlock,
|
|
@@ -12,14 +22,14 @@ import {
|
|
|
12
22
|
HandleInterval,
|
|
13
23
|
ProcessResult,
|
|
14
24
|
} from '@sentio/protos'
|
|
15
|
-
import { BindInternalOptions, BindOptions } from '
|
|
25
|
+
import { BindInternalOptions, BindOptions } from '../core/bind-options'
|
|
16
26
|
import { PromiseOrVoid } from '../promise-or-void'
|
|
17
27
|
import { Trace } from './trace'
|
|
18
28
|
import { ServerError, Status } from 'nice-grpc'
|
|
19
|
-
import { Transaction } from 'ethers'
|
|
20
29
|
|
|
21
|
-
export interface AddressOrTypeEventFilter extends
|
|
30
|
+
export interface AddressOrTypeEventFilter extends DeferredTopicFilter {
|
|
22
31
|
addressType?: AddressType
|
|
32
|
+
address?: string
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
export class EventsHandler {
|
|
@@ -74,17 +84,16 @@ export abstract class BaseProcessor<
|
|
|
74
84
|
protected abstract CreateBoundContractView(): TBoundContractView
|
|
75
85
|
|
|
76
86
|
public getChainId(): number {
|
|
77
|
-
return
|
|
87
|
+
return Number(Network.from(this.config.network).chainId)
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
public onEvent(
|
|
81
|
-
handler: (event:
|
|
82
|
-
filter:
|
|
91
|
+
handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
92
|
+
filter: DeferredTopicFilter | DeferredTopicFilter[],
|
|
83
93
|
fetchConfig?: EthFetchConfig
|
|
84
94
|
) {
|
|
85
95
|
const chainId = this.getChainId()
|
|
86
|
-
|
|
87
|
-
let _filters: EventFilter[] = []
|
|
96
|
+
let _filters: DeferredTopicFilter[] = []
|
|
88
97
|
|
|
89
98
|
if (Array.isArray(filter)) {
|
|
90
99
|
_filters = filter
|
|
@@ -101,7 +110,7 @@ export abstract class BaseProcessor<
|
|
|
101
110
|
if (!data.log) {
|
|
102
111
|
throw new ServerError(Status.INVALID_ARGUMENT, 'Log is empty')
|
|
103
112
|
}
|
|
104
|
-
const log = data.log as
|
|
113
|
+
const log = data.log as LogParams
|
|
105
114
|
|
|
106
115
|
const contractView = processor.CreateBoundContractView()
|
|
107
116
|
|
|
@@ -116,19 +125,11 @@ export abstract class BaseProcessor<
|
|
|
116
125
|
data.transaction as Transaction,
|
|
117
126
|
data.transactionReceipt as TransactionReceipt
|
|
118
127
|
)
|
|
119
|
-
|
|
120
|
-
const event: Event = <Event>log
|
|
121
|
-
const parsed = contractView.rawContract.interface.parseLog(log)
|
|
122
|
-
if (parsed) {
|
|
123
|
-
event.args = parsed.args
|
|
124
|
-
event.decode = (data: BytesLike, topics?: Array<any>) => {
|
|
125
|
-
return contractView.rawContract.interface.decodeEventLog(parsed.eventFragment, data, topics)
|
|
126
|
-
}
|
|
127
|
-
event.event = parsed.name
|
|
128
|
-
event.eventSignature = parsed.signature
|
|
128
|
+
const logParam = log as any as { topics: Array<string>; data: string }
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
const parsed = contractView.rawContract.interface.parseLog(logParam)
|
|
131
|
+
if (parsed) {
|
|
132
|
+
await handler(parsed, ctx)
|
|
132
133
|
return ctx.getProcessResult()
|
|
133
134
|
}
|
|
134
135
|
return ProcessResult.fromPartial({})
|
|
@@ -200,12 +201,17 @@ export abstract class BaseProcessor<
|
|
|
200
201
|
return this
|
|
201
202
|
}
|
|
202
203
|
|
|
203
|
-
public onAllEvents(
|
|
204
|
-
|
|
204
|
+
public onAllEvents(
|
|
205
|
+
handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
|
206
|
+
) {
|
|
207
|
+
const _filters: DeferredTopicFilter[] = []
|
|
205
208
|
const tmpContract = this.CreateBoundContractView()
|
|
206
209
|
|
|
207
|
-
for (const
|
|
208
|
-
|
|
210
|
+
for (const fragment of tmpContract.rawContract.interface.fragments) {
|
|
211
|
+
if (fragment.type === 'event') {
|
|
212
|
+
const filter = tmpContract.rawContract.filters[fragment.format()]
|
|
213
|
+
_filters.push(filter())
|
|
214
|
+
}
|
|
209
215
|
}
|
|
210
216
|
return this.onEvent(function (log, ctx) {
|
|
211
217
|
return handler(log, ctx)
|
|
@@ -228,7 +234,7 @@ export abstract class BaseProcessor<
|
|
|
228
234
|
const contractView = processor.CreateBoundContractView()
|
|
229
235
|
const contractInterface = contractView.rawContract.interface
|
|
230
236
|
const fragment = contractInterface.getFunction(signature)
|
|
231
|
-
if (!data.trace) {
|
|
237
|
+
if (!data.trace || !fragment) {
|
|
232
238
|
throw new ServerError(Status.INVALID_ARGUMENT, 'trace is null')
|
|
233
239
|
}
|
|
234
240
|
const trace = data.trace as Trace
|
|
@@ -236,7 +242,7 @@ export abstract class BaseProcessor<
|
|
|
236
242
|
return ProcessResult.fromPartial({})
|
|
237
243
|
}
|
|
238
244
|
const traceData = '0x' + trace.action.input.slice(10)
|
|
239
|
-
trace.args = contractInterface.
|
|
245
|
+
trace.args = contractInterface.getAbiCoder().decode(fragment.inputs, traceData)
|
|
240
246
|
|
|
241
247
|
const ctx = new ContractContext<TContract, TBoundContractView>(
|
|
242
248
|
contractName,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { BindOptions, getOptionsSignature } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { BindOptions, getOptionsSignature } from '../core/bind-options'
|
|
2
|
+
import { ContractView } from '../core'
|
|
3
|
+
import { BaseProcessor } from './base-processor'
|
|
4
|
+
import { Networkish, Network } from 'ethers/providers'
|
|
5
|
+
|
|
5
6
|
import { BaseContract } from 'ethers'
|
|
6
7
|
import { MapStateStorage } from '@sentio/runtime'
|
|
7
8
|
|
|
@@ -13,7 +14,7 @@ export class ProcessorState extends MapStateStorage<BaseProcessor<any, any>> {
|
|
|
13
14
|
const contracts = new Map<string, ContractView<BaseContract>>()
|
|
14
15
|
|
|
15
16
|
function getKey(abiName: string, address: string, network: Networkish) {
|
|
16
|
-
const chainId =
|
|
17
|
+
const chainId = Network.from(network).chainId.toString()
|
|
17
18
|
return [abiName, address.toLowerCase(), chainId].join('_')
|
|
18
19
|
}
|
|
19
20
|
|