@sentio/sdk 1.41.0-rc.1 → 2.0.0-rc.10
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.d.ts +3 -2
- package/lib/builtin/eacaggregatorproxy/index.js +3 -5
- package/lib/builtin/eacaggregatorproxy/index.js.map +1 -1
- package/lib/builtin/eacaggregatorproxy/test-utils.d.ts +1 -1
- package/lib/builtin/eacaggregatorproxy/test-utils.js +9 -16
- package/lib/builtin/eacaggregatorproxy/test-utils.js.map +1 -1
- package/lib/builtin/erc1155/index.d.ts +3 -2
- package/lib/builtin/erc1155/index.js +3 -5
- package/lib/builtin/erc1155/index.js.map +1 -1
- package/lib/builtin/erc1155/test-utils.d.ts +1 -1
- package/lib/builtin/erc1155/test-utils.js +9 -16
- package/lib/builtin/erc1155/test-utils.js.map +1 -1
- package/lib/builtin/erc20/index.d.ts +3 -2
- package/lib/builtin/erc20/index.js +3 -5
- package/lib/builtin/erc20/index.js.map +1 -1
- package/lib/builtin/erc20/test-utils.d.ts +1 -1
- package/lib/builtin/erc20/test-utils.js +7 -13
- package/lib/builtin/erc20/test-utils.js.map +1 -1
- package/lib/builtin/erc20bytes/index.d.ts +3 -2
- package/lib/builtin/erc20bytes/index.js +3 -5
- package/lib/builtin/erc20bytes/index.js.map +1 -1
- package/lib/builtin/erc20bytes/test-utils.d.ts +1 -1
- package/lib/builtin/erc20bytes/test-utils.js +5 -10
- package/lib/builtin/erc20bytes/test-utils.js.map +1 -1
- package/lib/builtin/erc721/index.d.ts +3 -2
- package/lib/builtin/erc721/index.js +3 -5
- package/lib/builtin/erc721/index.js.map +1 -1
- package/lib/builtin/erc721/test-utils.d.ts +1 -1
- package/lib/builtin/erc721/test-utils.js +7 -13
- package/lib/builtin/erc721/test-utils.js.map +1 -1
- package/lib/builtin/index.d.ts +8 -4
- package/lib/builtin/index.js +8 -8
- package/lib/builtin/index.js.map +1 -1
- package/lib/builtin/internal/EACAggregatorProxy.d.ts +6 -6
- package/lib/builtin/internal/EACAggregatorProxy.js +1 -2
- package/lib/builtin/internal/EACAggregatorProxy.js.map +1 -1
- package/lib/builtin/internal/ERC1155.d.ts +6 -6
- package/lib/builtin/internal/ERC1155.js +1 -2
- package/lib/builtin/internal/ERC1155.js.map +1 -1
- package/lib/builtin/internal/ERC20.d.ts +5 -5
- package/lib/builtin/internal/ERC20.js +1 -2
- package/lib/builtin/internal/ERC20.js.map +1 -1
- package/lib/builtin/internal/ERC20Bytes.d.ts +4 -4
- package/lib/builtin/internal/ERC20Bytes.js +1 -2
- package/lib/builtin/internal/ERC20Bytes.js.map +1 -1
- package/lib/builtin/internal/ERC721.d.ts +5 -5
- package/lib/builtin/internal/ERC721.js +1 -2
- package/lib/builtin/internal/ERC721.js.map +1 -1
- package/lib/builtin/internal/WETH9.d.ts +6 -6
- package/lib/builtin/internal/WETH9.js +1 -2
- package/lib/builtin/internal/WETH9.js.map +1 -1
- package/lib/builtin/internal/common.d.ts +4 -2
- package/lib/builtin/internal/common.js +1 -2
- package/lib/builtin/internal/common.js.map +1 -1
- package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +6 -6
- package/lib/builtin/internal/eacaggregatorproxy_processor.js +69 -77
- package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
- package/lib/builtin/internal/erc1155_processor.d.ts +6 -6
- package/lib/builtin/internal/erc1155_processor.js +30 -38
- package/lib/builtin/internal/erc1155_processor.js.map +1 -1
- package/lib/builtin/internal/erc20_processor.d.ts +5 -5
- package/lib/builtin/internal/erc20_processor.js +39 -47
- package/lib/builtin/internal/erc20_processor.js.map +1 -1
- package/lib/builtin/internal/erc20bytes_processor.d.ts +4 -4
- package/lib/builtin/internal/erc20bytes_processor.js +33 -41
- package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
- package/lib/builtin/internal/erc721_processor.d.ts +5 -5
- package/lib/builtin/internal/erc721_processor.js +42 -50
- package/lib/builtin/internal/erc721_processor.js.map +1 -1
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js +4 -8
- package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC1155__factory.js +4 -8
- package/lib/builtin/internal/factories/ERC1155__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js +4 -8
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC20__factory.js +4 -8
- package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -1
- package/lib/builtin/internal/factories/ERC721__factory.js +4 -8
- package/lib/builtin/internal/factories/ERC721__factory.js.map +1 -1
- package/lib/builtin/internal/factories/WETH9__factory.js +4 -8
- package/lib/builtin/internal/factories/WETH9__factory.js.map +1 -1
- package/lib/builtin/internal/factories/index.d.ts +6 -6
- package/lib/builtin/internal/factories/index.js +6 -15
- package/lib/builtin/internal/factories/index.js.map +1 -1
- package/lib/builtin/internal/index.d.ts +13 -13
- package/lib/builtin/internal/index.js +7 -17
- package/lib/builtin/internal/index.js.map +1 -1
- package/lib/builtin/internal/weth9_processor.d.ts +6 -6
- package/lib/builtin/internal/weth9_processor.js +33 -41
- package/lib/builtin/internal/weth9_processor.js.map +1 -1
- package/lib/builtin/weth9/index.d.ts +3 -2
- package/lib/builtin/weth9/index.js +3 -5
- package/lib/builtin/weth9/index.js.map +1 -1
- package/lib/builtin/weth9/test-utils.d.ts +1 -1
- package/lib/builtin/weth9/test-utils.js +9 -16
- package/lib/builtin/weth9/test-utils.js.map +1 -1
- package/lib/core/base-context.d.ts +4 -4
- package/lib/core/base-context.js +7 -11
- package/lib/core/base-context.js.map +1 -1
- package/lib/core/big-decimal.js +3 -7
- package/lib/core/big-decimal.js.map +1 -1
- package/lib/core/bind-options.js +6 -13
- package/lib/core/bind-options.js.map +1 -1
- package/lib/core/context.d.ts +5 -5
- package/lib/core/context.js +14 -23
- package/lib/core/context.js.map +1 -1
- package/lib/core/core-plugin.js +9 -13
- package/lib/core/core-plugin.js.map +1 -1
- package/lib/core/event-tracker.d.ts +2 -2
- package/lib/core/event-tracker.js +6 -13
- package/lib/core/event-tracker.js.map +1 -1
- package/lib/core/exporter.d.ts +2 -2
- package/lib/core/exporter.js +4 -9
- package/lib/core/exporter.js.map +1 -1
- package/lib/core/index.d.ts +12 -9
- package/lib/core/index.js +12 -32
- package/lib/core/index.js.map +1 -1
- package/lib/core/logger.d.ts +2 -2
- package/lib/core/logger.js +7 -11
- package/lib/core/logger.js.map +1 -1
- package/lib/core/metadata.d.ts +4 -0
- package/lib/core/metadata.js +21 -7
- package/lib/core/metadata.js.map +1 -1
- package/lib/core/meter.d.ts +3 -7
- package/lib/core/meter.js +22 -57
- package/lib/core/meter.js.map +1 -1
- package/lib/core/meter.test.js.map +1 -1
- package/lib/core/numberish.d.ts +1 -1
- package/lib/core/numberish.js +12 -18
- package/lib/core/numberish.js.map +1 -1
- package/lib/core/numberish.test.js.map +1 -1
- package/lib/core/sui-plugin.js +12 -16
- package/lib/core/sui-plugin.js.map +1 -1
- package/lib/core/sui-processor.d.ts +1 -1
- package/lib/core/sui-processor.js +6 -12
- package/lib/core/sui-processor.js.map +1 -1
- package/lib/error.d.ts +1 -1
- package/lib/error.js +2 -7
- package/lib/error.js.map +1 -1
- package/lib/eth/account-processor-state.d.ts +1 -1
- package/lib/eth/account-processor-state.js +2 -6
- package/lib/eth/account-processor-state.js.map +1 -1
- package/lib/eth/account-processor.d.ts +7 -7
- package/lib/eth/account-processor.js +23 -27
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +9 -9
- package/lib/eth/base-processor-template.js +8 -17
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +8 -8
- package/lib/eth/base-processor.js +22 -31
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/binds.d.ts +3 -3
- package/lib/eth/binds.js +11 -19
- package/lib/eth/binds.js.map +1 -1
- package/lib/eth/eth-event.d.ts +5 -0
- package/lib/eth/eth-event.js +2 -0
- package/lib/eth/eth-event.js.map +1 -0
- package/lib/eth/eth-plugin.js +30 -34
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/generic-processor.d.ts +3 -3
- package/lib/eth/generic-processor.js +9 -13
- package/lib/eth/generic-processor.js.map +1 -1
- package/lib/{core → eth}/generic-processor.test.d.ts +0 -0
- package/lib/eth/generic-processor.test.js.map +1 -0
- package/lib/eth/index.d.ts +7 -6
- package/lib/eth/index.js +6 -14
- package/lib/eth/index.js.map +1 -1
- package/lib/eth/provider.js +12 -17
- package/lib/eth/provider.js.map +1 -1
- package/lib/eth/trace.js +1 -2
- package/lib/eth/trace.js.map +1 -1
- package/lib/index.d.ts +4 -5
- package/lib/index.js +5 -16
- package/lib/index.js.map +1 -1
- package/lib/promise-or-void.js +1 -2
- package/lib/target-ethers-sentio/{event-handler.js → event-handler.cjs} +4 -4
- package/lib/target-ethers-sentio/event-handler.cjs.map +1 -0
- package/lib/target-ethers-sentio/{event-handler.d.ts → event-handler.d.cts} +0 -0
- package/lib/target-ethers-sentio/{file.js → file.cjs} +19 -18
- package/lib/target-ethers-sentio/file.cjs.map +1 -0
- package/lib/target-ethers-sentio/{file.d.ts → file.d.cts} +0 -0
- package/lib/target-ethers-sentio/{functions-handler.js → functions-handler.cjs} +6 -7
- package/lib/target-ethers-sentio/functions-handler.cjs.map +1 -0
- package/lib/target-ethers-sentio/{functions-handler.d.ts → functions-handler.d.cts} +0 -0
- package/lib/target-ethers-sentio/{index.js → index.cjs} +8 -5
- package/lib/target-ethers-sentio/index.cjs.map +1 -0
- package/lib/target-ethers-sentio/{index.d.ts → index.d.cts} +0 -0
- package/lib/target-ethers-sentio/{types.js → types.cjs} +1 -1
- package/lib/target-ethers-sentio/types.cjs.map +1 -0
- package/lib/target-ethers-sentio/{types.d.ts → types.d.cts} +0 -0
- package/lib/target-ethers-sentio/{view-function.js → view-function.cjs} +5 -5
- package/lib/target-ethers-sentio/view-function.cjs.map +1 -0
- package/lib/target-ethers-sentio/{view-function.d.ts → view-function.d.cts} +0 -0
- package/lib/testing/index.d.ts +3 -2
- package/lib/testing/index.js +3 -10
- package/lib/testing/index.js.map +1 -1
- package/lib/testing/metric-utils.d.ts +1 -1
- package/lib/testing/metric-utils.js +7 -13
- package/lib/testing/metric-utils.js.map +1 -1
- package/lib/testing/test-processor-server.d.ts +3 -4
- package/lib/testing/test-processor-server.js +24 -29
- package/lib/testing/test-processor-server.js.map +1 -1
- package/lib/testing/test-provider.js +5 -9
- package/lib/testing/test-provider.js.map +1 -1
- package/lib/tsup.config.ts +28 -0
- package/lib/utils/chain.js +7 -12
- package/lib/utils/chain.js.map +1 -1
- package/lib/utils/conversion.d.ts +0 -5
- package/lib/utils/conversion.js +22 -27
- package/lib/utils/conversion.js.map +1 -1
- package/lib/utils/dex-price.js +14 -19
- 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.d.ts +4 -4
- package/lib/utils/index.js +4 -8
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/price.d.ts +11 -11
- package/lib/utils/price.js +10 -16
- package/lib/utils/price.js.map +1 -1
- package/lib/utils/token.d.ts +1 -1
- package/lib/utils/token.js +15 -21
- package/lib/utils/token.js.map +1 -1
- package/package.json +23 -19
- package/src/builtin/eacaggregatorproxy/index.ts +3 -2
- package/src/builtin/eacaggregatorproxy/test-utils.ts +1 -1
- package/src/builtin/erc1155/index.ts +3 -2
- package/src/builtin/erc1155/test-utils.ts +1 -1
- package/src/builtin/erc20/index.ts +3 -2
- package/src/builtin/erc20/test-utils.ts +1 -1
- package/src/builtin/erc20bytes/index.ts +3 -2
- package/src/builtin/erc20bytes/test-utils.ts +1 -1
- package/src/builtin/erc721/index.ts +3 -2
- package/src/builtin/erc721/test-utils.ts +1 -1
- package/src/builtin/index.ts +8 -4
- package/src/builtin/internal/EACAggregatorProxy.ts +6 -10
- package/src/builtin/internal/ERC1155.ts +6 -10
- package/src/builtin/internal/ERC20.ts +5 -8
- package/src/builtin/internal/ERC20Bytes.ts +4 -6
- package/src/builtin/internal/ERC721.ts +5 -8
- package/src/builtin/internal/WETH9.ts +6 -10
- package/src/builtin/internal/common.ts +5 -3
- package/src/builtin/internal/eacaggregatorproxy_processor.ts +2 -2
- package/src/builtin/internal/erc1155_processor.ts +2 -2
- package/src/builtin/internal/erc20_processor.ts +2 -2
- package/src/builtin/internal/erc20bytes_processor.ts +2 -2
- package/src/builtin/internal/erc721_processor.ts +2 -2
- package/src/builtin/internal/factories/index.ts +6 -6
- package/src/builtin/internal/index.ts +13 -13
- package/src/builtin/internal/weth9_processor.ts +2 -2
- package/src/builtin/weth9/index.ts +3 -2
- package/src/builtin/weth9/test-utils.ts +1 -1
- package/src/core/base-context.ts +4 -4
- package/src/core/context.ts +5 -6
- package/src/core/core-plugin.ts +3 -3
- package/src/core/event-tracker.ts +2 -2
- package/src/core/exporter.ts +3 -3
- package/src/core/index.ts +12 -9
- package/src/core/logger.ts +2 -2
- package/src/core/metadata.ts +23 -2
- package/src/core/meter.ts +3 -26
- package/src/core/numberish.ts +1 -1
- package/src/core/sui-plugin.ts +2 -2
- package/src/core/sui-processor.ts +1 -1
- package/src/error.ts +1 -1
- package/src/eth/account-processor-state.ts +1 -1
- package/src/eth/account-processor.ts +11 -11
- package/src/eth/base-processor-template.ts +8 -11
- package/src/eth/base-processor.ts +14 -28
- package/src/eth/binds.ts +3 -3
- package/src/eth/eth-event.ts +6 -0
- package/src/eth/eth-plugin.ts +3 -3
- package/src/eth/generic-processor.ts +5 -5
- package/src/eth/index.ts +8 -6
- package/src/index.ts +4 -6
- package/src/target-ethers-sentio/{event-handler.ts → event-handler.cts} +1 -1
- package/src/target-ethers-sentio/{file.ts → file.cts} +10 -9
- package/src/target-ethers-sentio/{functions-handler.ts → functions-handler.cts} +3 -4
- package/src/target-ethers-sentio/{index.ts → index.cts} +4 -1
- package/src/target-ethers-sentio/tsconfig.json +1 -1
- package/src/target-ethers-sentio/{types.ts → types.cts} +0 -0
- package/src/target-ethers-sentio/{view-function.ts → view-function.cts} +1 -1
- package/src/testing/index.ts +3 -3
- package/src/testing/metric-utils.ts +2 -2
- package/src/testing/test-processor-server.ts +5 -5
- package/src/testing/test-provider.ts +1 -1
- package/src/tsup.config.ts +28 -0
- package/src/utils/conversion.ts +21 -25
- package/src/utils/dex-price.ts +4 -5
- package/src/utils/index.ts +4 -4
- package/src/utils/price.ts +1 -1
- package/src/utils/token.ts +6 -6
- package/lib/core/generic-processor.test.js.map +0 -1
- package/lib/target-ethers-sentio/event-handler.js.map +0 -1
- package/lib/target-ethers-sentio/file.js.map +0 -1
- package/lib/target-ethers-sentio/functions-handler.js.map +0 -1
- package/lib/target-ethers-sentio/index.js.map +0 -1
- package/lib/target-ethers-sentio/types.js.map +0 -1
- package/lib/target-ethers-sentio/view-function.js.map +0 -1
- package/lib/webpack.config.js +0 -50
- package/src/webpack.config.js +0 -50
package/src/error.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListStateStorage } from '@sentio/runtime'
|
|
2
|
-
import { AccountProcessor } from './account-processor'
|
|
2
|
+
import { AccountProcessor } from './account-processor.js'
|
|
3
3
|
|
|
4
4
|
export class AccountProcessorState extends ListStateStorage<AccountProcessor> {
|
|
5
5
|
static INSTANCE = new AccountProcessorState()
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ERC20__factory, ERC721__factory } from '../builtin/internal'
|
|
2
|
-
import { AddressType,
|
|
3
|
-
import { AccountBindOptions } from '../core/bind-options'
|
|
1
|
+
import { ERC20__factory, ERC721__factory } from '../builtin/internal/index.js'
|
|
2
|
+
import { AddressType, EthFetchConfig, ProcessResult } from '@sentio/protos'
|
|
3
|
+
import { AccountBindOptions } from '../core/bind-options.js'
|
|
4
4
|
|
|
5
5
|
import { Network, LogParams } from 'ethers/providers'
|
|
6
6
|
|
|
7
|
-
import { TransferEvent as ERC20TransferEvent } from '../builtin/internal/ERC20'
|
|
8
|
-
import { TransferEvent as ERC721TransferEvent } from '../builtin/internal/ERC721'
|
|
7
|
+
import { TransferEvent as ERC20TransferEvent } from '../builtin/internal/ERC20.js'
|
|
8
|
+
import { TransferEvent as ERC721TransferEvent } from '../builtin/internal/ERC721.js'
|
|
9
9
|
|
|
10
|
-
import { ERC20Processor } from '../builtin/internal/erc20_processor'
|
|
11
|
-
import { ERC721Processor } from '../builtin/internal/erc721_processor'
|
|
10
|
+
import { ERC20Processor } from '../builtin/internal/erc20_processor.js'
|
|
11
|
+
import { ERC721Processor } from '../builtin/internal/erc721_processor.js'
|
|
12
12
|
|
|
13
|
-
import { AccountContext } from '../core/context'
|
|
14
|
-
import { PromiseOrVoid } from '../promise-or-void'
|
|
15
|
-
import { AddressOrTypeEventFilter, EventsHandler } from './base-processor'
|
|
13
|
+
import { AccountContext } from '../core/context.js'
|
|
14
|
+
import { PromiseOrVoid } from '../promise-or-void.js'
|
|
15
|
+
import { AddressOrTypeEventFilter, EventsHandler } from './base-processor.js'
|
|
16
16
|
import { Transaction, Block, TransactionReceipt, LogDescription } from 'ethers'
|
|
17
|
-
import { AccountProcessorState } from './account-processor-state'
|
|
17
|
+
import { AccountProcessorState } from './account-processor-state.js'
|
|
18
18
|
|
|
19
19
|
const ERC20_INTERFACE = ERC20__factory.createInterface()
|
|
20
20
|
const ERC721_INTERFACE = ERC721__factory.createInterface()
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { BoundContractView, ContractContext, ContractView } from '../core/context'
|
|
1
|
+
import { BoundContractView, ContractContext, ContractView } from '../core/context.js'
|
|
2
2
|
import { BaseContract, ContractEvent, Block, LogDescription } from 'ethers'
|
|
3
|
-
import { AddressOrTypeEventFilter, BaseProcessor } from './base-processor'
|
|
4
|
-
import { BindOptions, getOptionsSignature } from '../core/bind-options'
|
|
3
|
+
import { AddressOrTypeEventFilter, BaseProcessor } from './base-processor.js'
|
|
4
|
+
import { BindOptions, getOptionsSignature } from '../core/bind-options.js'
|
|
5
5
|
import { EthFetchConfig, HandleInterval, TemplateInstance } from '@sentio/protos'
|
|
6
|
-
import { PromiseOrVoid } from '../promise-or-void'
|
|
7
|
-
import { Trace } from './trace'
|
|
6
|
+
import { PromiseOrVoid } from '../promise-or-void.js'
|
|
7
|
+
import { Trace } from './trace.js'
|
|
8
8
|
import { ListStateStorage } from '@sentio/runtime'
|
|
9
9
|
import { EventFilter, LogParams, Network } from 'ethers/providers'
|
|
10
10
|
import { DeferredTopicFilter } from 'ethers/contract'
|
|
11
|
+
import { EthEvent } from './eth-event.js'
|
|
11
12
|
|
|
12
13
|
export class ProcessorTemplateProcessorState extends ListStateStorage<
|
|
13
14
|
BaseProcessorTemplate<BaseContract, BoundContractView<BaseContract, any>>
|
|
@@ -36,7 +37,7 @@ export abstract class BaseProcessorTemplate<
|
|
|
36
37
|
fetchConfig?: EthFetchConfig
|
|
37
38
|
}[] = []
|
|
38
39
|
eventHandlers: {
|
|
39
|
-
handler: (event:
|
|
40
|
+
handler: (event: EthEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
|
40
41
|
filter: DeferredTopicFilter | DeferredTopicFilter[]
|
|
41
42
|
fetchConfig?: EthFetchConfig
|
|
42
43
|
}[] = []
|
|
@@ -87,7 +88,7 @@ export abstract class BaseProcessorTemplate<
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
public onEvent(
|
|
90
|
-
handler: (event:
|
|
91
|
+
handler: (event: EthEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
91
92
|
filter: DeferredTopicFilter | DeferredTopicFilter[],
|
|
92
93
|
fetchConfig?: EthFetchConfig
|
|
93
94
|
) {
|
|
@@ -99,10 +100,6 @@ export abstract class BaseProcessorTemplate<
|
|
|
99
100
|
return this
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
public onBlock(handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid) {
|
|
103
|
-
return this.onBlockInterval(handler)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
103
|
public onBlockInterval(
|
|
107
104
|
handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
108
105
|
blockInterval = 1000,
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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'
|
|
1
|
+
import { Block, TransactionReceipt, BaseContract, Transaction, DeferredTopicFilter } from 'ethers'
|
|
2
|
+
import { LogParams, Network } from 'ethers/providers'
|
|
14
3
|
|
|
15
|
-
import { BoundContractView, ContractContext, ContractView } from '../core/context'
|
|
4
|
+
import { BoundContractView, ContractContext, ContractView } from '../core/context.js'
|
|
16
5
|
import {
|
|
17
6
|
AddressType,
|
|
18
7
|
Data_EthBlock,
|
|
@@ -22,10 +11,11 @@ import {
|
|
|
22
11
|
HandleInterval,
|
|
23
12
|
ProcessResult,
|
|
24
13
|
} from '@sentio/protos'
|
|
25
|
-
import { BindInternalOptions, BindOptions } from '../core/bind-options'
|
|
26
|
-
import { PromiseOrVoid } from '../promise-or-void'
|
|
27
|
-
import { Trace } from './trace'
|
|
14
|
+
import { BindInternalOptions, BindOptions } from '../core/bind-options.js'
|
|
15
|
+
import { PromiseOrVoid } from '../promise-or-void.js'
|
|
16
|
+
import { Trace } from './trace.js'
|
|
28
17
|
import { ServerError, Status } from 'nice-grpc'
|
|
18
|
+
import { EthEvent } from './eth-event.js'
|
|
29
19
|
|
|
30
20
|
export interface AddressOrTypeEventFilter extends DeferredTopicFilter {
|
|
31
21
|
addressType?: AddressType
|
|
@@ -88,7 +78,7 @@ export abstract class BaseProcessor<
|
|
|
88
78
|
}
|
|
89
79
|
|
|
90
80
|
public onEvent(
|
|
91
|
-
handler: (event:
|
|
81
|
+
handler: (event: EthEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
92
82
|
filter: DeferredTopicFilter | DeferredTopicFilter[],
|
|
93
83
|
fetchConfig?: EthFetchConfig
|
|
94
84
|
) {
|
|
@@ -128,8 +118,10 @@ export abstract class BaseProcessor<
|
|
|
128
118
|
const logParam = log as any as { topics: Array<string>; data: string }
|
|
129
119
|
|
|
130
120
|
const parsed = contractView.rawContract.interface.parseLog(logParam)
|
|
121
|
+
|
|
131
122
|
if (parsed) {
|
|
132
|
-
|
|
123
|
+
const event: EthEvent = { ...log, args: parsed.args }
|
|
124
|
+
await handler(event, ctx)
|
|
133
125
|
return ctx.getProcessResult()
|
|
134
126
|
}
|
|
135
127
|
return ProcessResult.fromPartial({})
|
|
@@ -138,14 +130,10 @@ export abstract class BaseProcessor<
|
|
|
138
130
|
return this
|
|
139
131
|
}
|
|
140
132
|
|
|
141
|
-
public onBlock(handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid) {
|
|
142
|
-
return this.onBlockInterval(handler)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
133
|
public onBlockInterval(
|
|
146
134
|
handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
147
|
-
blockInterval =
|
|
148
|
-
backfillBlockInterval =
|
|
135
|
+
blockInterval = 250,
|
|
136
|
+
backfillBlockInterval = 1000
|
|
149
137
|
) {
|
|
150
138
|
return this.onInterval(handler, undefined, {
|
|
151
139
|
recentInterval: blockInterval,
|
|
@@ -201,9 +189,7 @@ export abstract class BaseProcessor<
|
|
|
201
189
|
return this
|
|
202
190
|
}
|
|
203
191
|
|
|
204
|
-
public onAllEvents(
|
|
205
|
-
handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
|
206
|
-
) {
|
|
192
|
+
public onAllEvents(handler: (event: EthEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid) {
|
|
207
193
|
const _filters: DeferredTopicFilter[] = []
|
|
208
194
|
const tmpContract = this.CreateBoundContractView()
|
|
209
195
|
|
package/src/eth/binds.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BindOptions, getOptionsSignature } from '../core/bind-options'
|
|
2
|
-
import { ContractView } from '../core'
|
|
3
|
-
import { BaseProcessor } from './base-processor'
|
|
1
|
+
import { BindOptions, getOptionsSignature } from '../core/bind-options.js'
|
|
2
|
+
import { ContractView } from '../core/index.js'
|
|
3
|
+
import { BaseProcessor } from './base-processor.js'
|
|
4
4
|
import { Networkish, Network } from 'ethers/providers'
|
|
5
5
|
|
|
6
6
|
import { BaseContract } from 'ethers'
|
package/src/eth/eth-plugin.ts
CHANGED
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
} from '@sentio/protos'
|
|
16
16
|
|
|
17
17
|
import { ServerError, Status } from 'nice-grpc'
|
|
18
|
-
import { ProcessorState } from './binds'
|
|
19
|
-
import { AccountProcessorState } from './account-processor-state'
|
|
20
|
-
import { ProcessorTemplateProcessorState, TemplateInstanceState } from './base-processor-template'
|
|
18
|
+
import { ProcessorState } from './binds.js'
|
|
19
|
+
import { AccountProcessorState } from './account-processor-state.js'
|
|
20
|
+
import { ProcessorTemplateProcessorState, TemplateInstanceState } from './base-processor-template.js'
|
|
21
21
|
|
|
22
22
|
export class EthPlugin extends Plugin {
|
|
23
23
|
name: string = 'EthPlugin'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseContract } from 'ethers'
|
|
2
|
-
import { BoundContractView, ContractView } from '../core/context'
|
|
3
|
-
import { BindOptions } from '../core/bind-options'
|
|
4
|
-
import { BaseProcessor } from './base-processor'
|
|
5
|
-
import { getProvider } from './provider'
|
|
6
|
-
import { addProcessor } from './binds'
|
|
2
|
+
import { BoundContractView, ContractView } from '../core/context.js'
|
|
3
|
+
import { BindOptions } from '../core/bind-options.js'
|
|
4
|
+
import { BaseProcessor } from './base-processor.js'
|
|
5
|
+
import { getProvider } from './provider.js'
|
|
6
|
+
import { addProcessor } from './binds.js'
|
|
7
7
|
|
|
8
8
|
export class GenericProcessor extends BaseProcessor<
|
|
9
9
|
BaseContract,
|
package/src/eth/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { BaseProcessor } from './base-processor'
|
|
2
|
-
export { GenericProcessor } from './generic-processor'
|
|
3
|
-
export { BaseProcessorTemplate } from './base-processor-template'
|
|
4
|
-
export { getProvider, DummyProvider } from './provider'
|
|
5
|
-
export type { TypedCallTrace, Trace } from './trace'
|
|
6
|
-
export { EthPlugin } from './eth-plugin'
|
|
1
|
+
export { BaseProcessor } from './base-processor.js'
|
|
2
|
+
export { GenericProcessor } from './generic-processor.js'
|
|
3
|
+
export { BaseProcessorTemplate } from './base-processor-template.js'
|
|
4
|
+
export { getProvider, DummyProvider } from './provider.js'
|
|
5
|
+
export type { TypedCallTrace, Trace } from './trace.js'
|
|
6
|
+
export { EthPlugin } from './eth-plugin.js'
|
|
7
|
+
|
|
8
|
+
export { getProcessor, addProcessor, getContractByABI, addContractByABI } from './binds.js'
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export { transformEtherError, EthersError } from './error'
|
|
2
|
-
|
|
3
|
-
export { getProcessor, addProcessor, getContractByABI, addContractByABI } from './eth/binds'
|
|
1
|
+
export { transformEtherError, EthersError } from './error.js'
|
|
4
2
|
|
|
5
3
|
// TODO maybe remove this
|
|
6
4
|
export * from '@sentio/protos'
|
|
7
5
|
|
|
8
|
-
export * from './core'
|
|
9
|
-
export * from './eth'
|
|
6
|
+
export * from './core/index.js'
|
|
7
|
+
export * from './eth/index.js'
|
|
10
8
|
|
|
11
|
-
export * from './utils/chain'
|
|
9
|
+
export * from './utils/chain.js'
|
|
12
10
|
// export * from './api'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventDeclaration, Contract, getFullSignatureAsSymbolForEvent } from 'typechain'
|
|
2
|
-
import { getFullSignatureForEventPatched } from './types'
|
|
2
|
+
import { getFullSignatureForEventPatched } from './types.cjs'
|
|
3
3
|
import { generateEventInputs } from '@sentio/ethers-v6/dist/codegen/events'
|
|
4
4
|
|
|
5
5
|
export function generateEventHandler(event: EventDeclaration, contractName: string, includeArgTypes: boolean): string {
|
|
@@ -7,14 +7,15 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { reservedKeywords } from '@sentio/ethers-v6/dist/codegen/reserved-keywords'
|
|
9
9
|
import { getFullSignatureForEvent } from 'typechain/dist/utils/signatures'
|
|
10
|
-
import { codegenCallTraceTypes, generateCallHandlers } from './functions-handler'
|
|
11
|
-
import { generateEventFilters, generateEventHandlers } from './event-handler'
|
|
12
|
-
import { generateBoundViewFunctions, generateViewFunctions } from './view-function'
|
|
10
|
+
import { codegenCallTraceTypes, generateCallHandlers } from './functions-handler.cjs'
|
|
11
|
+
import { generateEventFilters, generateEventHandlers } from './event-handler.cjs'
|
|
12
|
+
import { generateBoundViewFunctions, generateViewFunctions } from './view-function.cjs'
|
|
13
13
|
|
|
14
14
|
export function codeGenIndex(contract: Contract): string {
|
|
15
15
|
return `
|
|
16
|
-
export * from '../internal/${contract.name.toLowerCase()}_processor'
|
|
17
|
-
export * from '../internal/${contract.name}'
|
|
16
|
+
export * from '../internal/${contract.name.toLowerCase()}_processor.js'
|
|
17
|
+
export * from '../internal/${contract.name}.js'
|
|
18
|
+
export * from './test-utils.js'
|
|
18
19
|
`
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -164,9 +165,9 @@ export class ${contract.name}ProcessorTemplate extends BaseProcessorTemplate<${c
|
|
|
164
165
|
'toBlockTag',
|
|
165
166
|
],
|
|
166
167
|
'@sentio/protos': ['EthFetchConfig'],
|
|
167
|
-
'./common': ['PromiseOrValue'],
|
|
168
|
-
'./index': [`${contract.name}`, `${contract.name}__factory`],
|
|
169
|
-
[`./${contract.name}`]: eventsImports.concat(uniqueStructImports),
|
|
168
|
+
'./common.js': ['PromiseOrValue'],
|
|
169
|
+
'./index.js': [`${contract.name}`, `${contract.name}__factory`],
|
|
170
|
+
[`./${contract.name}.js`]: eventsImports.concat(uniqueStructImports),
|
|
170
171
|
},
|
|
171
172
|
source
|
|
172
173
|
)
|
|
@@ -200,7 +201,7 @@ export function codeGenTestUtilsFile(contract: Contract): string {
|
|
|
200
201
|
const imports = createImportsForUsedIdentifiers(
|
|
201
202
|
{
|
|
202
203
|
'ethers/providers': ['LogParams'],
|
|
203
|
-
'.': [
|
|
204
|
+
'./index.js': [
|
|
204
205
|
`get${contract.name}Contract`,
|
|
205
206
|
...Object.values(contract.events).flatMap((events) => {
|
|
206
207
|
if (events.length === 1) {
|
|
@@ -2,10 +2,9 @@ import {
|
|
|
2
2
|
generateOutputComplexTypeAsArray,
|
|
3
3
|
generateOutputComplexTypesAsObject,
|
|
4
4
|
} from '@sentio/ethers-v6/dist/codegen/types'
|
|
5
|
-
import {
|
|
5
|
+
import { keccak_256 } from 'js-sha3'
|
|
6
6
|
import { FunctionDeclaration, getSignatureForFn } from 'typechain'
|
|
7
|
-
|
|
8
|
-
import { getFullSignatureAsSymbolForFunction } from './types'
|
|
7
|
+
import { getFullSignatureAsSymbolForFunction } from './types.cjs'
|
|
9
8
|
|
|
10
9
|
export function generateCallHandlers(fns: FunctionDeclaration[], contractName: string): string {
|
|
11
10
|
if (fns.length === 1) {
|
|
@@ -42,7 +41,7 @@ function generateCallHandler(fn: FunctionDeclaration, contractName: string, over
|
|
|
42
41
|
// utils.toUtf8Bytes(signature))
|
|
43
42
|
|
|
44
43
|
const test = new TextEncoder().encode(signature)
|
|
45
|
-
const sighash =
|
|
44
|
+
const sighash = "0x" + keccak_256(test).substring(0, 8)
|
|
46
45
|
|
|
47
46
|
return `
|
|
48
47
|
onCall${capitalizeFirstChar(overloadedName ?? fn.name)}(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Ethers from '@sentio/ethers-v6'
|
|
2
2
|
import { Config, extractAbi, extractDocumentation, FileDescription, parse, shortenFullJsonFilePath } from 'typechain'
|
|
3
3
|
import { dirname, join, relative } from 'path'
|
|
4
|
-
import { codeGenIndex, codeGenSentioFile, codeGenTestUtilsFile } from './file'
|
|
4
|
+
import { codeGenIndex, codeGenSentioFile, codeGenTestUtilsFile } from './file.cjs'
|
|
5
5
|
|
|
6
6
|
export default class EthersSentio extends Ethers {
|
|
7
7
|
constructor(config: Config) {
|
|
@@ -54,6 +54,9 @@ export default class EthersSentio extends Ethers {
|
|
|
54
54
|
if (file.path.endsWith('__factory.ts')) {
|
|
55
55
|
file.contents = '// @ts-nocheck\n' + file.contents
|
|
56
56
|
}
|
|
57
|
+
if (file.path.endsWith('factories/index.ts')) {
|
|
58
|
+
file.contents = file.contents.replaceAll("__factory'", "__factory.js'")
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
return files
|
|
59
62
|
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// https://github.com/dethcrypto/TypeChain/blob/015abb28bd22826611051f27e0ec96a00f9a0b61/packages/target-ethers-v5/src/codegen/functions.ts#L54
|
|
2
2
|
import { FunctionDeclaration } from 'typechain'
|
|
3
3
|
import { generateInputTypes, generateOutputTypes } from '@sentio/ethers-v6/dist/codegen/types'
|
|
4
|
-
import { getFullSignatureAsSymbolForFunction, getFullSignatureForFunction } from './types'
|
|
4
|
+
import { getFullSignatureAsSymbolForFunction, getFullSignatureForFunction } from './types.cjs'
|
|
5
5
|
|
|
6
6
|
function generateReturnTypes(fn: FunctionDeclaration) {
|
|
7
7
|
// sounds like returnResultObject should be true but we need to set false to make it work
|
package/src/testing/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TestProcessorServer } from './test-processor-server'
|
|
2
|
-
export { MetricValueToNumber, firstCounterValue, firstGaugeValue } from './metric-utils'
|
|
1
|
+
export { TestProcessorServer } from './test-processor-server.js'
|
|
2
|
+
export { MetricValueToNumber, firstCounterValue, firstGaugeValue } from './metric-utils.js'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export { loadTestProvidersFromEnv } from './test-provider.js' // TODO make the interface more standard and then export
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MetricValue, ProcessResult } from '@sentio/protos'
|
|
2
|
-
import { Numberish, BigDecimal } from '../core'
|
|
3
|
-
import { bytesToBigInt } from '../utils/conversion'
|
|
2
|
+
import { Numberish, BigDecimal } from '../core/index.js'
|
|
3
|
+
import { bytesToBigInt } from '../utils/conversion.js'
|
|
4
4
|
|
|
5
5
|
export function MetricValueToNumber(v: Partial<MetricValue> | undefined): Numberish | undefined {
|
|
6
6
|
if (v === undefined) {
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
ProcessConfigResponse,
|
|
11
11
|
ProcessorServiceImplementation,
|
|
12
12
|
StartRequest,
|
|
13
|
+
Empty,
|
|
13
14
|
} from '@sentio/protos'
|
|
14
15
|
import { CallContext } from 'nice-grpc-common'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { CHAIN_MAP } from '../utils/chain'
|
|
16
|
+
import { ProcessorServiceImpl, Endpoints, State } from '@sentio/runtime'
|
|
17
|
+
import { CHAIN_MAP } from '../utils/chain.js'
|
|
18
18
|
|
|
19
|
-
import { Trace } from '../eth/trace'
|
|
19
|
+
import { Trace } from '../eth/trace.js'
|
|
20
20
|
import { LogParams, Networkish, BlockParams, Network } from 'ethers/providers'
|
|
21
21
|
|
|
22
22
|
import { Block, Log } from 'ethers'
|
|
@@ -33,7 +33,7 @@ export class TestProcessorServer implements ProcessorServiceImplementation {
|
|
|
33
33
|
contractConfigs: ContractConfig[]
|
|
34
34
|
accountConfigs: AccountConfig[]
|
|
35
35
|
|
|
36
|
-
constructor(loader: () =>
|
|
36
|
+
constructor(loader: () => Promise<any>, httpEndpoints: Record<string, string> = {}) {
|
|
37
37
|
cleanTest()
|
|
38
38
|
|
|
39
39
|
this.service = new ProcessorServiceImpl(loader)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
esbuildOptions: (options) => {
|
|
5
|
+
options.banner = {
|
|
6
|
+
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
entry: {
|
|
10
|
+
lib: 'src/processor.ts',
|
|
11
|
+
},
|
|
12
|
+
minify: true,
|
|
13
|
+
sourcemap: 'inline',
|
|
14
|
+
clean: true,
|
|
15
|
+
format: 'esm',
|
|
16
|
+
external: [
|
|
17
|
+
'protobufjs',
|
|
18
|
+
'aptos',
|
|
19
|
+
'aptos-sdk',
|
|
20
|
+
'ethers',
|
|
21
|
+
'bs58',
|
|
22
|
+
'bn.js',
|
|
23
|
+
'csv-parse',
|
|
24
|
+
/^nice-grpc.*$/,
|
|
25
|
+
/^@(ethersproject|solana|project-serum).*$/,
|
|
26
|
+
/^@sentio\/(sdk|runtime|protos|bigdecimal|ethers).*$/,
|
|
27
|
+
],
|
|
28
|
+
})
|
package/src/utils/conversion.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { BigDecimal } from '../core/big-decimal'
|
|
2
|
-
import { Numberish } from '../core'
|
|
3
|
-
import { MetricValue } from '@sentio/protos'
|
|
4
|
-
|
|
5
|
-
export function toBigDecimal(n: bigint) {
|
|
6
|
-
return new BigDecimal(n.toString())
|
|
7
|
-
}
|
|
1
|
+
// import { BigDecimal } from '../core/big-decimal.js'
|
|
2
|
+
// import { Numberish } from '../core/index.js'
|
|
3
|
+
// import { MetricValue } from '@sentio/protos'
|
|
8
4
|
|
|
9
5
|
export function bytesToBigInt(bytes: Uint8Array) {
|
|
10
6
|
let intValue = BigInt(0)
|
|
@@ -14,21 +10,21 @@ export function bytesToBigInt(bytes: Uint8Array) {
|
|
|
14
10
|
return intValue
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
export function metricValueToNumberish(v: MetricValue): Numberish {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
13
|
+
// export function metricValueToNumberish(v: MetricValue): Numberish {
|
|
14
|
+
// if (v.doubleValue) {
|
|
15
|
+
// return v.doubleValue
|
|
16
|
+
// }
|
|
17
|
+
// if (v.bigInteger) {
|
|
18
|
+
// let intValue = bytesToBigInt(v.bigInteger.data)
|
|
19
|
+
// if (v.bigInteger.negative) {
|
|
20
|
+
// intValue = -intValue
|
|
21
|
+
// }
|
|
22
|
+
// return intValue
|
|
23
|
+
// }
|
|
24
|
+
//
|
|
25
|
+
// if (v.bigDecimal) {
|
|
26
|
+
// return new BigDecimal(v.bigDecimal)
|
|
27
|
+
// }
|
|
28
|
+
//
|
|
29
|
+
// throw Error("MetricValue doesn't contain any of possible value")
|
|
30
|
+
// }
|
package/src/utils/dex-price.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { getEACAggregatorProxyContract } from '../builtin/internal/eacaggregatorproxy_processor'
|
|
2
|
-
import path from 'path'
|
|
1
|
+
import { getEACAggregatorProxyContract } from '../builtin/internal/eacaggregatorproxy_processor.js'
|
|
3
2
|
import fs from 'fs'
|
|
4
|
-
// @ts-ignore type def not provided
|
|
5
3
|
import { parse } from 'csv-parse/sync'
|
|
6
4
|
import { BlockTag } from 'ethers/providers'
|
|
7
|
-
import { scaleDown } from './token'
|
|
5
|
+
import { scaleDown } from './token.js'
|
|
6
|
+
import url from 'url'
|
|
8
7
|
|
|
9
8
|
type OralceRecord = {
|
|
10
9
|
Pair: string
|
|
@@ -36,7 +35,7 @@ class DexPrice {
|
|
|
36
35
|
|
|
37
36
|
constructor(csvFileName: string, chainId: number) {
|
|
38
37
|
this.chainId = chainId
|
|
39
|
-
const csvFilePath =
|
|
38
|
+
const csvFilePath = url.fileURLToPath(new URL('./' + csvFileName, import.meta.url))
|
|
40
39
|
const fileContent = fs.readFileSync(csvFilePath, { encoding: 'utf-8' })
|
|
41
40
|
const headers = ['Pair', 'Asset', 'Type', 'Address']
|
|
42
41
|
|
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export *
|
|
2
|
-
export *
|
|
3
|
-
export *
|
|
4
|
-
export *
|
|
1
|
+
export * from './chain.js'
|
|
2
|
+
export * from './conversion.js'
|
|
3
|
+
export * from './token.js'
|
|
4
|
+
export * from './dex-price.js'
|
package/src/utils/price.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoinID, PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/
|
|
1
|
+
import { CoinID, PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/price'
|
|
2
2
|
import { createChannel, createClientFactory } from 'nice-grpc'
|
|
3
3
|
import { retryMiddleware, RetryOptions } from 'nice-grpc-client-middleware-retry'
|
|
4
4
|
import { Endpoints } from '@sentio/runtime'
|
package/src/utils/token.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { transformEtherError } from '../error'
|
|
2
|
-
import { getERC20Contract } from '../builtin/erc20'
|
|
3
|
-
import { getERC20BytesContract } from '../builtin/internal/erc20bytes_processor'
|
|
4
|
-
import { BigDecimal } from '../core/big-decimal'
|
|
5
|
-
import { toBigDecimal } from './conversion'
|
|
1
|
+
import { transformEtherError } from '../error.js'
|
|
2
|
+
import { getERC20Contract } from '../builtin/erc20/index.js'
|
|
3
|
+
import { getERC20BytesContract } from '../builtin/internal/erc20bytes_processor.js'
|
|
4
|
+
import { BigDecimal } from '../core/big-decimal.js'
|
|
5
|
+
// import { toBigDecimal } from './conversion'
|
|
6
6
|
// import { utils } from 'ethers'
|
|
7
|
-
import { PromiseOrValue } from '../builtin/internal/common'
|
|
7
|
+
import { PromiseOrValue } from '../builtin/internal/common.js'
|
|
8
8
|
import { decodeBytes32String } from 'ethers'
|
|
9
9
|
|
|
10
10
|
export interface TokenInfo {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generic-processor.test.js","sourceRoot":"","sources":["../../src/core/generic-processor.test.ts"],"names":[],"mappings":";AAAA,gCAAgC;;AAEhC,+BAA6B;AAE7B,2CAA4C;AAE5C,gEAA2D;AAC3D,wCAAmE;AAEnE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,IAAI,6BAAmB,CAAC,GAAG,EAAE;QAC3C,oCAAgB,CAAC,IAAI,CACnB;YACE,yEAAyE;YACzE,yEAAyE;SAC1E,EACD,EAAE,OAAO,EAAE,4CAA4C,EAAE,CAC1D,CAAC,WAAW,CAAC,UAAU,GAAG,EAAE,GAAG;YAC9B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;QAEF,oCAAgB,CAAC,IAAI,CAAC,oDAAoD,EAAE;YAC1E,OAAO,EAAE,4CAA4C;SACtD,CAAC,CAAC,WAAW,CAAC,UAAU,GAAG,EAAE,GAAG;YAC/B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,qBAAqB,EAAE,KAAK,IAA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QACR,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE,oEAAoE;QAC/E,gBAAgB,EAAE,GAAG;QACrB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,4CAA4C;QACrD,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE;YACN,oEAAoE;YACpE,oEAAoE;YACpE,oEAAoE;SACrE;QACD,eAAe,EAAE,oEAAoE;QACrF,QAAQ,EAAE,GAAG;KACd,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["// TODO move out of this package\n\nimport { expect } from 'chai'\n\nimport { HandlerType } from '@sentio/protos'\n\nimport { GenericProcessor } from '../eth/generic-processor'\nimport { TestProcessorServer, firstCounterValue } from '../testing'\n\ndescribe('Test Generic Processor', () => {\n const service = new TestProcessorServer(() => {\n GenericProcessor.bind(\n [\n 'event Transfer(address indexed from, address indexed to, uint256 value)',\n 'event Approval(address indexed from, address indexed to, uint256 value)',\n ],\n { address: '0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9' }\n ).onAllEvents(function (log, ctx) {\n ctx.meter.Counter('event_num').add(1)\n })\n\n GenericProcessor.bind('event WalletCreated(address wallet, address owner)', {\n address: '0x57E037F4d2c8BEa011Ad8a9A5AF4AaEEd508650f',\n }).onAllEvents(function (log, ctx) {\n ctx.meter.Counter('wallet').add(1)\n })\n })\n\n beforeAll(async () => {\n await service.start()\n })\n\n test('check configuration', async () => {\n const config = await service.getConfig({})\n expect(config.contractConfigs).length(2)\n expect(config.contractConfigs?.[0].contract?.name).equals('Generic')\n })\n\n test('Check log dispatch', async () => {\n const res = await service.testLogs([logData, logData])\n const counters = res.result?.counters\n expect(counters).length(2)\n expect(firstCounterValue(res.result, 'event_num')).equals(1)\n expect(counters?.[0].runtimeInfo?.from).equals(HandlerType.ETH_LOG)\n })\n\n test('Check log dispatch no buffer over rune', async () => {\n const logStr =\n '{\"address\":\"0x57e037f4d2c8bea011ad8a9a5af4aaeed508650f\",\"topics\":[\"0x5b03bfed1c14a02bdeceb5fa582eb1a5765fc0bc64ca0e6af4c20afc9487f081\"],\"data\":\"0x00000000000000000000000093269483a70c68d5c5bb63aac1e8f4ac59f498800000000000000000000000000c520e51c055cf63bab075715c1b860b2e9b8e24\",\"blockNumber\":\"0xc9d6d7\",\"transactionHash\":\"0x208af3250499672c2f07138b9aa236153c65c78ae4341b23c2763017afdd61a2\",\"transactionIndex\":\"0xf3\",\"blockHash\":\"0x6e3b100c34b510049e922fbe1c1dab1b0793be3d1229b632688e6a518cdd11b6\",\"logIndex\":\"0x14b\",\"removed\":false}'\n const res = await service.testLog(JSON.parse(logStr))\n console.log(JSON.stringify(res))\n })\n\n const logData = {\n index: 0,\n blockNumber: 14213252,\n blockHash: '0x83d646fac9350b281def8c4c37626f9d8efc95df801287b848c719edf35cdbaf',\n transactionIndex: 347,\n removed: false,\n address: '0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9',\n data: '0x00000000000000000000000000000000000000000000009a71db64810aaa0000',\n topics: [\n '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',\n '0x0000000000000000000000000000000000000000000000000000000000000000',\n '0x000000000000000000000000b329e39ebefd16f40d38f07643652ce17ca5bac1',\n ],\n transactionHash: '0x93355e0cb2c3490cb8a747029ff2dc8cdbde2407025b8391398436955afae303',\n logIndex: 428,\n }\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-handler.js","sourceRoot":"","sources":["../../src/target-ethers-sentio/event-handler.ts"],"names":[],"mappings":";;;AAAA,yCAAwF;AACxF,mCAAyD;AACzD,kEAA2E;AAE3E,SAAgB,oBAAoB,CAAC,KAAuB,EAAE,YAAoB,EAAE,eAAwB;IAC1G,MAAM,SAAS,GAAG,eAAe,CAAC,CAAC,CAAC,IAAA,4CAAgC,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAA;IACxF,MAAM,eAAe,GAAG,eAAe,CAAC,CAAC,C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