@sentio/sdk 2.40.0-rc.2 → 2.40.0-rc.20
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/aptos-processor.d.ts +1 -1
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +1 -1
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/context.d.ts +2 -2
- package/lib/aptos/context.d.ts.map +1 -1
- package/lib/aptos/context.js +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts.map +1 -1
- package/lib/aptos/ext/aptos-dex.js +1 -1
- package/lib/aptos/ext/aptos-dex.js.map +1 -1
- package/lib/aptos/ext/coin-event.d.ts +1 -1
- package/lib/aptos/ext/coin-event.d.ts.map +1 -1
- package/lib/aptos/ext/coin.js +2 -2
- package/lib/aptos/ext/coin.js.map +1 -1
- package/lib/eth/account-processor.d.ts +21 -7
- package/lib/eth/account-processor.d.ts.map +1 -1
- package/lib/eth/account-processor.js +2 -2
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +24 -8
- package/lib/eth/base-processor-template.d.ts.map +1 -1
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +30 -10
- package/lib/eth/base-processor.d.ts.map +1 -1
- package/lib/eth/base-processor.js +6 -6
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +100 -31
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +1295 -46
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts +55 -16
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +510 -16
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts +79 -24
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +1039 -36
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +46 -13
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +512 -18
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts +67 -20
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +826 -28
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts +64 -19
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +607 -22
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/event-handler.js +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +21 -3
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.d.ts +4 -0
- package/lib/eth/codegen/function-calls.d.ts.map +1 -1
- package/lib/eth/codegen/function-calls.js +83 -5
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/codegen/types.d.ts +1 -0
- package/lib/eth/codegen/types.d.ts.map +1 -1
- package/lib/eth/codegen/types.js +13 -0
- package/lib/eth/codegen/types.js.map +1 -1
- package/lib/eth/context.d.ts +4 -0
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +4 -0
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth-plugin.d.ts +27 -9
- package/lib/eth/eth-plugin.d.ts.map +1 -1
- package/lib/eth/eth-plugin.js +17 -17
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/generic-processor.test.js.map +1 -1
- package/lib/eth/index.d.ts +1 -0
- package/lib/eth/index.d.ts.map +1 -1
- package/lib/eth/index.js +1 -0
- package/lib/eth/index.js.map +1 -1
- package/lib/solana/builtin/spl-token-processor.d.ts +1 -1
- package/lib/solana/builtin/spl-token-processor.d.ts.map +1 -1
- package/lib/solana/builtin/spl-token-processor.js +1 -1
- package/lib/solana/builtin/spl-token-processor.js.map +1 -1
- package/lib/solana/solana-context.d.ts +1 -1
- package/lib/solana/solana-context.js +2 -2
- package/lib/store/cache.d.ts +14 -0
- package/lib/store/cache.d.ts.map +1 -0
- package/lib/store/cache.js +35 -0
- package/lib/store/cache.js.map +1 -0
- package/lib/store/store.d.ts +2 -3
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +34 -8
- package/lib/store/store.js.map +1 -1
- package/lib/sui/context.d.ts +1 -1
- package/lib/sui/context.d.ts.map +1 -1
- package/lib/sui/sui-processor.d.ts +1 -1
- package/lib/sui/sui-processor.d.ts.map +1 -1
- package/lib/sui/sui-processor.js +1 -1
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/aptos-facet.d.ts +1 -1
- package/lib/testing/aptos-facet.js +2 -2
- package/lib/testing/sui-facet.js +1 -1
- package/lib/utils/dex-price.d.ts +1 -0
- package/lib/utils/dex-price.d.ts.map +1 -1
- package/lib/utils/dex-price.js +13 -2
- package/lib/utils/dex-price.js.map +1 -1
- package/package.json +8 -7
- package/src/aptos/aptos-processor.ts +1 -1
- package/src/aptos/context.ts +2 -2
- package/src/aptos/ext/aptos-dex.ts +1 -1
- package/src/aptos/ext/coin-event.ts +1 -1
- package/src/aptos/ext/coin.ts +2 -2
- package/src/eth/account-processor.ts +28 -12
- package/src/eth/base-processor-template.ts +16 -8
- package/src/eth/base-processor.ts +25 -16
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +1643 -123
- package/src/eth/builtin/internal/erc1155-processor.ts +724 -42
- package/src/eth/builtin/internal/erc20-processor.ts +1368 -90
- package/src/eth/builtin/internal/erc20bytes-processor.ts +685 -49
- package/src/eth/builtin/internal/erc721-processor.ts +1116 -70
- package/src/eth/builtin/internal/weth9-processor.ts +798 -63
- package/src/eth/codegen/event-handler.ts +1 -1
- package/src/eth/codegen/file.ts +26 -3
- package/src/eth/codegen/function-calls.ts +101 -8
- package/src/eth/codegen/types.ts +22 -1
- package/src/eth/context.ts +7 -0
- package/src/eth/eth-plugin.ts +31 -26
- package/src/eth/index.ts +2 -0
- package/src/solana/builtin/spl-token-processor.ts +1 -1
- package/src/solana/solana-context.ts +2 -2
- package/src/store/cache.ts +46 -0
- package/src/store/store.ts +62 -34
- package/src/sui/context.ts +1 -1
- package/src/sui/sui-processor.ts +1 -1
- package/src/testing/aptos-facet.ts +2 -2
- package/src/testing/sui-facet.ts +1 -1
- package/src/utils/dex-price.ts +15 -2
- package/lib/utils/chainlink-oracles-sepolia.csv +0 -19
- package/lib/utils/chainlink-oracles.csv +0 -217
@@ -4,7 +4,7 @@ import { SuiNetwork } from './network.js';
|
|
4
4
|
import { SuiContext, SuiObjectChangeContext } from './context.js';
|
5
5
|
import { MoveCallSuiTransaction, SuiEvent, SuiTransactionBlockResponse, SuiObjectChange } from '@mysten/sui.js/client';
|
6
6
|
import { CallHandler, EventFilter, EventHandler, FunctionNameAndCallFilter, ObjectChangeHandler, TransactionFilter } from '../move/index.js';
|
7
|
-
import { MoveCoder } from '
|
7
|
+
import { MoveCoder } from './index.js';
|
8
8
|
import { Labels } from '../core/index.js';
|
9
9
|
import { Required } from 'utility-types';
|
10
10
|
export declare const DEFAULT_FETCH_CONFIG: MoveFetchConfig;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sui-processor.d.ts","sourceRoot":"","sources":["../../src/sui/sui-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,MA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GAAG,EAAE,UAAU,KAAK,IAAI,EAAE,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAK1G,kBAAkB,CAChB,OAAO,EAAE,CAAC,WAAW,EAAE,2BAA2B,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,EAC5E,MAAM,CAAC,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACrC,IAAI;IAiCP,SAAS,CAAC,cAAc,CACtB,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,sBAAsB,KAAK,IAAI,EAC1E,IAAI,EAAE,MAAM,GACX,IAAI;CAuBR;AAED,qBAAa,mBAAoB,SAAQ,gBAAgB;IACvD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,mBAAmB;CAG1D;AAED,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,kBAAkB;IAGzE,kBAAkB,CAChB,OAAO,EAAE,CAAC,WAAW,EAAE,2BAA2B,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,EAC5E,MAAM,EAAE,iBAAiB,EACzB,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACrC,IAAI;IAQA,cAAc,CACnB,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,sBAAsB,KAAK,IAAI,EAC1E,IAAI,EAAE,MAAM,GACX,IAAI;CAGR"}
|
package/lib/sui/sui-processor.js
CHANGED
@@ -5,7 +5,7 @@ import { ServerError, Status } from 'nice-grpc';
|
|
5
5
|
import { SuiContext, SuiObjectChangeContext } from './context.js';
|
6
6
|
import { accountAddressString, parseMoveType, SPLITTER } from '../move/index.js';
|
7
7
|
import { getMoveCalls } from './utils.js';
|
8
|
-
import { defaultMoveCoder } from '
|
8
|
+
import { defaultMoveCoder } from './index.js';
|
9
9
|
export const DEFAULT_FETCH_CONFIG = {
|
10
10
|
resourceChanges: false,
|
11
11
|
allEvents: false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sui-processor.js","sourceRoot":"","sources":["../../src/sui/sui-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACnG,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EACL,oBAAoB,EAMpB,aAAa,EACb,QAAQ,EAET,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAa,MAAM,
|
1
|
+
{"version":3,"file":"sui-processor.js","sourceRoot":"","sources":["../../src/sui/sui-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACnG,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EACL,oBAAoB,EAMpB,aAAa,EACb,QAAQ,EAET,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAa,MAAM,YAAY,CAAA;AAIxD,MAAM,CAAC,MAAM,o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AAC,IAAI,CAAC,OAA4B,EAAE,GAAG,CAAC,CAAA;gBACrD,OAAO,GAAG,CAAC,gBAAgB,EAAE,CAAA;YAC/B,CAAC;YACD,IAAI;SACL,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,gBAAgB;IACvD,MAAM,CAAC,IAAI,CAAC,OAAuB;QACjC,OAAO,IAAI,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,IAAI,CAAC,OAAwC;QAClD,OAAO,IAAI,kBAAkB,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAA;IAClE,CAAC;IACD,kBAAkB,CAChB,OAA4E,EAC5E,MAAyB,EACzB,WAAsC;QAEtC,gCAAgC;QAChC,sEAAsE;QACtE,+FAA+F;QAC/F,IAAI;QACJ,OAAO,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAA;IAC/D,CAAC;IAEM,cAAc,CACnB,OAA0E,EAC1E,IAAY;QAEZ,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { UserTransactionResponse } from '@aptos-labs/ts-sdk';
|
2
2
|
import { TestProcessorServer } from './test-processor-server.js';
|
3
|
-
import { AptosNetwork } from '
|
3
|
+
import { AptosNetwork } from '../aptos/index.js';
|
4
4
|
export declare class AptosFacet {
|
5
5
|
server: TestProcessorServer;
|
6
6
|
constructor(server: TestProcessorServer);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { HandlerType } from '@sentio/protos';
|
2
|
-
import { AptosNetwork } from '
|
3
|
-
import { parseMoveType, accountTypeString } from '
|
2
|
+
import { AptosNetwork } from '../aptos/index.js';
|
3
|
+
import { parseMoveType, accountTypeString } from '../move/index.js';
|
4
4
|
export class AptosFacet {
|
5
5
|
server;
|
6
6
|
constructor(server) {
|
package/lib/testing/sui-facet.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { HandlerType } from '@sentio/protos';
|
2
|
-
import { accountTypeString, parseMoveType, SPLITTER } from '
|
2
|
+
import { accountTypeString, parseMoveType, SPLITTER } from '../move/index.js';
|
3
3
|
import { SuiNetwork } from '../sui/index.js';
|
4
4
|
import { getMoveCalls } from '../sui/utils.js';
|
5
5
|
export class SuiFacet {
|
package/lib/utils/dex-price.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dex-price.d.ts","sourceRoot":"","sources":["../../src/utils/dex-price.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"dex-price.d.ts","sourceRoot":"","sources":["../../src/utils/dex-price.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAW1C,oBAAY,SAAS;IACnB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,GAAG,IAAI;CACR;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASpD;AAID,cAAM,QAAQ;IACZ,cAAc,sBAA4B;IAC1C,cAAc,sBAA4B;IAC1C,cAAc,sBAA4B;IAC1C,YAAY,sBAA4B;IAExC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;gBAEhB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAqC9C,QAAQ,CACZ,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,QAAmB,EAC7B,IAAI,GAAE,SAAyB,GAC9B,OAAO,CAAC,cAAc,CAAC;CAwD3B;AAED,eAAO,MAAM,gBAAgB,UAA6D,CAAA;AAC1F,eAAO,MAAM,eAAe,UAAoE,CAAA"}
|
package/lib/utils/dex-price.js
CHANGED
@@ -1,15 +1,25 @@
|
|
1
1
|
import { getEACAggregatorProxyContract } from '../eth/builtin/eacaggregatorproxy.js';
|
2
2
|
import fs from 'fs';
|
3
3
|
import { parse } from 'csv-parse/sync';
|
4
|
-
import url from 'url';
|
5
4
|
import { scaleDown } from '../core/big-decimal.js';
|
6
5
|
import { EthChainId } from '@sentio/chain';
|
6
|
+
import { createRequire } from 'module';
|
7
|
+
import path from 'path';
|
7
8
|
export var PriceUnit;
|
8
9
|
(function (PriceUnit) {
|
9
10
|
PriceUnit[PriceUnit["USD"] = 0] = "USD";
|
10
11
|
PriceUnit[PriceUnit["ETH"] = 1] = "ETH";
|
11
12
|
PriceUnit[PriceUnit["BTC"] = 2] = "BTC";
|
12
13
|
})(PriceUnit || (PriceUnit = {}));
|
14
|
+
export function getPackageRoot(pkgId) {
|
15
|
+
const require = createRequire(import.meta.url);
|
16
|
+
const m = require.resolve(pkgId);
|
17
|
+
let dir = path.dirname(m);
|
18
|
+
while (!fs.existsSync(path.join(dir, 'package.json'))) {
|
19
|
+
dir = path.dirname(dir);
|
20
|
+
}
|
21
|
+
return dir;
|
22
|
+
}
|
13
23
|
// Load price feed from https://docs.chain.link/docs/data-feeds/price-feeds/addresses/?network=ethereum
|
14
24
|
// and then use EACAggregatorProxy contract to get price
|
15
25
|
class DexPrice {
|
@@ -20,7 +30,8 @@ class DexPrice {
|
|
20
30
|
chainId;
|
21
31
|
constructor(csvFileName, chainId) {
|
22
32
|
this.chainId = chainId;
|
23
|
-
const
|
33
|
+
const packageRoot = getPackageRoot('@sentio/sdk');
|
34
|
+
const csvFilePath = path.join(packageRoot, 'src', 'utils', csvFileName);
|
24
35
|
const fileContent = fs.readFileSync(csvFilePath, { encoding: 'utf-8' });
|
25
36
|
const headers = ['Pair', 'Asset', 'Type', 'Address'];
|
26
37
|
const records = parse(fileContent, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dex-price.js","sourceRoot":"","sources":["../../src/utils/dex-price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,
|
1
|
+
{"version":3,"file":"dex-price.js","sourceRoot":"","sources":["../../src/utils/dex-price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,IAAI,MAAM,MAAM,CAAA;AASvB,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,uCAAO,CAAA;IACP,uCAAO,CAAA;IACP,uCAAO,CAAA;AACT,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAOD,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC9C,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAEhC,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACzB,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,c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"2.40.0-rc.
|
3
|
+
"version": "2.40.0-rc.20",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -65,6 +65,7 @@
|
|
65
65
|
"csv-parse": "^5.5.3",
|
66
66
|
"ethers": "npm:@sentio/ethers@6.13.1",
|
67
67
|
"fuels": "^0.90.0",
|
68
|
+
"graphql": "^16.9.0",
|
68
69
|
"js-sha3": "^0.9.3",
|
69
70
|
"lru-cache": "^10.2.0",
|
70
71
|
"mkdirp": "^1.0.4",
|
@@ -74,17 +75,15 @@
|
|
74
75
|
"nice-grpc-prometheus": "^0.2.2",
|
75
76
|
"node-fetch": "^3.3.2",
|
76
77
|
"p-queue": "^8.0.1",
|
77
|
-
"prettier": "^3.2.4",
|
78
78
|
"prettier2": "npm:prettier@2.8.8",
|
79
79
|
"radash": "^12.0.0",
|
80
80
|
"reflect-metadata": "^0.2.2",
|
81
81
|
"superstruct_solana": "npm:superstruct@^0.14.2",
|
82
82
|
"typechain": "^8.3.2",
|
83
|
-
"typedoc": "^0.26.0",
|
84
83
|
"utility-types": "^3.11.0",
|
85
84
|
"yaml": "^2.3.4",
|
86
|
-
"@sentio/protos": "2.40.0-rc.
|
87
|
-
"@sentio/runtime": "^2.40.0-rc.
|
85
|
+
"@sentio/protos": "2.40.0-rc.20",
|
86
|
+
"@sentio/runtime": "^2.40.0-rc.20"
|
88
87
|
},
|
89
88
|
"peerDependencies": {
|
90
89
|
"tsup": "npm:@sentio/tsup@^6.7.2"
|
@@ -93,7 +92,9 @@
|
|
93
92
|
"@certusone/wormhole-sdk": "^0.10.16",
|
94
93
|
"@types/google-protobuf": "^3.15.12",
|
95
94
|
"@types/mkdirp": "^1.0.2",
|
96
|
-
"
|
95
|
+
"prettier": "^3.2.4",
|
96
|
+
"tslib": "^2.6.2",
|
97
|
+
"typedoc": "^0.26.0"
|
97
98
|
},
|
98
99
|
"engines": {
|
99
100
|
"node": ">=16"
|
@@ -101,7 +102,7 @@
|
|
101
102
|
"scripts": {
|
102
103
|
"build": "pnpm gen && pnpm compile",
|
103
104
|
"build:all": "pnpm --filter=$(node -p \"require('./package.json').name\")... build",
|
104
|
-
"compile": "tsc && cp src/
|
105
|
+
"compile": "tsc && cp src/tsup.config.ts lib",
|
105
106
|
"gen": "pnpm gen:eth && pnpm gen:aptos && pnpm gen:sui && pnpm gen:solana && pnpm gen:fuel && pnpm gen:store",
|
106
107
|
"gen:aptos": "tsx src/aptos/codegen/run.ts src/aptos/abis src/aptos/builtin && pnpm gen:aptos_test",
|
107
108
|
"gen:aptos_test": "tsx src/aptos/codegen/run.ts src/aptos/tests/abis src/aptos/tests/types",
|
package/src/aptos/context.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RecordMetaData } from '@sentio/protos'
|
2
|
-
import { type Labels, normalizeLabels } from '
|
3
|
-
import { MoveCoder } from '
|
2
|
+
import { type Labels, normalizeLabels } from '../index.js'
|
3
|
+
import { MoveCoder } from './index.js'
|
4
4
|
import {
|
5
5
|
Aptos,
|
6
6
|
Event,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BigDecimal } from '@sentio/bigdecimal'
|
2
2
|
import { calculateValueInUsd, getCoinInfo, whitelistCoins, whiteListed } from './coin.js'
|
3
|
-
import { AptosResourcesContext, AptosContext, AptosNetwork } from '
|
3
|
+
import { AptosResourcesContext, AptosContext, AptosNetwork } from '../index.js'
|
4
4
|
import { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js'
|
5
5
|
import { MoveResource, Event, MoveModuleBytecode } from '@aptos-labs/ts-sdk'
|
6
6
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Event, UserTransactionResponse, WriteSetChangeWriteResource } from '@aptos-labs/ts-sdk'
|
2
|
-
import { coin } from '
|
2
|
+
import { coin } from '../builtin/0x1.js'
|
3
3
|
import { parseMoveType } from '../../move/index.js'
|
4
4
|
|
5
5
|
export function findNewCoinBalances(evt: Event, tx: UserTransactionResponse, coin: string): coin.Coin<any> | undefined {
|
package/src/aptos/ext/coin.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { getPriceByType } from '
|
1
|
+
import { getPriceByType } from '../../utils/index.js'
|
2
2
|
import fetch from 'node-fetch'
|
3
3
|
import { accountTypeString, parseMoveType, SPLITTER } from '@typemove/move'
|
4
4
|
import { SimpleCoinInfo } from '../../move/ext/move-dex.js'
|
5
5
|
import { AptosNetwork, getClient } from '../network.js'
|
6
|
-
import { coin } from '
|
6
|
+
import { coin } from '../builtin/0x1.js'
|
7
7
|
import { MoveStructId } from '@aptos-labs/ts-sdk'
|
8
8
|
import { AptosChainId } from '@sentio/chain'
|
9
9
|
|
@@ -51,7 +51,8 @@ export class AccountProcessor {
|
|
51
51
|
fetchConfig?: Partial<EthFetchConfig>,
|
52
52
|
preprocessHandler: (
|
53
53
|
event: ERC20TransferEvent,
|
54
|
-
ctx: AccountContext
|
54
|
+
ctx: AccountContext,
|
55
|
+
preprocessStore: { [k: string]: any }
|
55
56
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
56
57
|
) {
|
57
58
|
return this.onERC20(
|
@@ -76,7 +77,8 @@ export class AccountProcessor {
|
|
76
77
|
fetchConfig?: Partial<EthFetchConfig>,
|
77
78
|
preprocessHandler: (
|
78
79
|
event: ERC20TransferEvent,
|
79
|
-
ctx: AccountContext
|
80
|
+
ctx: AccountContext,
|
81
|
+
preprocessStore: { [k: string]: any }
|
80
82
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
81
83
|
) {
|
82
84
|
return this.onERC20(
|
@@ -101,7 +103,8 @@ export class AccountProcessor {
|
|
101
103
|
fetchConfig?: Partial<EthFetchConfig>,
|
102
104
|
preprocessHandler: (
|
103
105
|
event: ERC20TransferEvent,
|
104
|
-
ctx: AccountContext
|
106
|
+
ctx: AccountContext,
|
107
|
+
preprocessStore: { [k: string]: any }
|
105
108
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
106
109
|
) {
|
107
110
|
return this.onERC20(
|
@@ -121,7 +124,8 @@ export class AccountProcessor {
|
|
121
124
|
fetchConfig?: Partial<EthFetchConfig>,
|
122
125
|
preprocessHandler: (
|
123
126
|
event: ERC20TransferEvent,
|
124
|
-
ctx: AccountContext
|
127
|
+
ctx: AccountContext,
|
128
|
+
preprocessStore: { [k: string]: any }
|
125
129
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
126
130
|
) {
|
127
131
|
return this.onERC(handler, tokensAddresses, defaultFilter, AddressType.ERC20, fetchConfig, preprocessHandler)
|
@@ -140,7 +144,8 @@ export class AccountProcessor {
|
|
140
144
|
fetchConfig?: Partial<EthFetchConfig>,
|
141
145
|
preprocessHandler: (
|
142
146
|
event: ERC721TransferEvent,
|
143
|
-
ctx: AccountContext
|
147
|
+
ctx: AccountContext,
|
148
|
+
preprocessStore: { [k: string]: any }
|
144
149
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
145
150
|
) {
|
146
151
|
return this.onERC721(
|
@@ -165,7 +170,8 @@ export class AccountProcessor {
|
|
165
170
|
fetchConfig?: Partial<EthFetchConfig>,
|
166
171
|
preprocessHandler: (
|
167
172
|
event: ERC721TransferEvent,
|
168
|
-
ctx: AccountContext
|
173
|
+
ctx: AccountContext,
|
174
|
+
preprocessStore: { [k: string]: any }
|
169
175
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
170
176
|
) {
|
171
177
|
return this.onERC721(
|
@@ -190,7 +196,8 @@ export class AccountProcessor {
|
|
190
196
|
fetchConfig?: Partial<EthFetchConfig>,
|
191
197
|
preprocessHandler: (
|
192
198
|
event: ERC721TransferEvent,
|
193
|
-
ctx: AccountContext
|
199
|
+
ctx: AccountContext,
|
200
|
+
preprocessStore: { [k: string]: any }
|
194
201
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
195
202
|
) {
|
196
203
|
return this.onERC721(
|
@@ -210,7 +217,8 @@ export class AccountProcessor {
|
|
210
217
|
fetchConfig?: Partial<EthFetchConfig>,
|
211
218
|
preprocessHandler: (
|
212
219
|
event: ERC721TransferEvent,
|
213
|
-
ctx: AccountContext
|
220
|
+
ctx: AccountContext,
|
221
|
+
preprocessStore: { [k: string]: any }
|
214
222
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
215
223
|
) {
|
216
224
|
return this.onERC(handler, collections, defaultFilter, AddressType.ERC721, fetchConfig, preprocessHandler)
|
@@ -222,7 +230,11 @@ export class AccountProcessor {
|
|
222
230
|
defaultFilter: (address: string) => AddressOrTypeEventFilter,
|
223
231
|
addressType: AddressType,
|
224
232
|
fetchConfig?: Partial<EthFetchConfig>,
|
225
|
-
preprocessHandler: (
|
233
|
+
preprocessHandler: (
|
234
|
+
event: any,
|
235
|
+
ctx: AccountContext,
|
236
|
+
preprocessStore: { [k: string]: any }
|
237
|
+
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
226
238
|
) {
|
227
239
|
const filters = []
|
228
240
|
for (const token of contractAddresses) {
|
@@ -243,7 +255,11 @@ export class AccountProcessor {
|
|
243
255
|
handler: (event: TypedEvent, ctx: AccountContext) => PromiseOrVoid,
|
244
256
|
filter: AddressOrTypeEventFilter | AddressOrTypeEventFilter[],
|
245
257
|
fetchConfig?: Partial<EthFetchConfig>,
|
246
|
-
preprocessHandler: (
|
258
|
+
preprocessHandler: (
|
259
|
+
event: TypedEvent,
|
260
|
+
ctx: AccountContext,
|
261
|
+
preprocessStore: { [k: string]: any }
|
262
|
+
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
247
263
|
) {
|
248
264
|
const chainId = this.getChainId()
|
249
265
|
|
@@ -302,7 +318,7 @@ export class AccountProcessor {
|
|
302
318
|
}
|
303
319
|
return ProcessResult.fromPartial({})
|
304
320
|
},
|
305
|
-
preprocessHandler: async function (data) {
|
321
|
+
preprocessHandler: async function (data, preprocessStore: { [k: string]: any }) {
|
306
322
|
const { log, block, transaction, transactionReceipt } = formatEthData(data)
|
307
323
|
if (!log) {
|
308
324
|
throw new ServerError(Status.INVALID_ARGUMENT, 'Log is empty')
|
@@ -323,7 +339,7 @@ export class AccountProcessor {
|
|
323
339
|
const parsed = ERC20_INTERFACE.parseLog(logParam)
|
324
340
|
if (parsed) {
|
325
341
|
const event: TypedEvent = { ...log, name: parsed.name, args: fixEmptyKey(parsed) }
|
326
|
-
return preprocessHandler(event, ctx)
|
342
|
+
return preprocessHandler(event, ctx, preprocessStore)
|
327
343
|
}
|
328
344
|
return PreprocessResult.fromPartial({})
|
329
345
|
}
|
@@ -26,7 +26,8 @@ export abstract class BaseProcessorTemplate<
|
|
26
26
|
handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
27
27
|
preprocessHandler: (
|
28
28
|
block: BlockParams,
|
29
|
-
ctx: ContractContext<TContract, TBoundContractView
|
29
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
30
|
+
preprocessStore: { [k: string]: any }
|
30
31
|
) => Promise<PreprocessResult>
|
31
32
|
blockInterval?: HandleInterval
|
32
33
|
timeIntervalInMinutes?: HandleInterval
|
@@ -37,7 +38,8 @@ export abstract class BaseProcessorTemplate<
|
|
37
38
|
handler: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
38
39
|
preprocessHandler: (
|
39
40
|
trace: TypedCallTrace,
|
40
|
-
ctx: ContractContext<TContract, TBoundContractView
|
41
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
42
|
+
preprocessStore: { [k: string]: any }
|
41
43
|
) => Promise<PreprocessResult>
|
42
44
|
fetchConfig?: EthFetchConfig
|
43
45
|
}[] = []
|
@@ -45,7 +47,8 @@ export abstract class BaseProcessorTemplate<
|
|
45
47
|
handler: (event: TypedEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
|
46
48
|
preprocessHandler: (
|
47
49
|
event: TypedEvent,
|
48
|
-
ctx: ContractContext<TContract, TBoundContractView
|
50
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
51
|
+
preprocessStore: { [k: string]: any }
|
49
52
|
) => Promise<PreprocessResult>
|
50
53
|
filter: DeferredTopicFilter | DeferredTopicFilter[]
|
51
54
|
fetchConfig?: EthFetchConfig
|
@@ -112,7 +115,8 @@ export abstract class BaseProcessorTemplate<
|
|
112
115
|
fetchConfig?: Partial<EthFetchConfig>,
|
113
116
|
preprocessHandler: (
|
114
117
|
event: TypedEvent,
|
115
|
-
ctx: ContractContext<TContract, TBoundContractView
|
118
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
119
|
+
preprocessStore: { [k: string]: any }
|
116
120
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
117
121
|
) {
|
118
122
|
this.eventHandlers.push({
|
@@ -131,7 +135,8 @@ export abstract class BaseProcessorTemplate<
|
|
131
135
|
fetchConfig?: EthFetchConfig,
|
132
136
|
preprocessHandler: (
|
133
137
|
block: BlockParams,
|
134
|
-
ctx: ContractContext<TContract, TBoundContractView
|
138
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
139
|
+
preprocessStore: { [k: string]: any }
|
135
140
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
136
141
|
) {
|
137
142
|
return this.onInterval(
|
@@ -153,7 +158,8 @@ export abstract class BaseProcessorTemplate<
|
|
153
158
|
fetchConfig?: EthFetchConfig,
|
154
159
|
preprocessHandler: (
|
155
160
|
block: BlockParams,
|
156
|
-
ctx: ContractContext<TContract, TBoundContractView
|
161
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
162
|
+
preprocessStore: { [k: string]: any }
|
157
163
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
158
164
|
) {
|
159
165
|
return this.onInterval(
|
@@ -172,7 +178,8 @@ export abstract class BaseProcessorTemplate<
|
|
172
178
|
fetchConfig: EthFetchConfig | undefined,
|
173
179
|
preprocessHandler: (
|
174
180
|
block: BlockParams,
|
175
|
-
ctx: ContractContext<TContract, TBoundContractView
|
181
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
182
|
+
preprocessStore: { [k: string]: any }
|
176
183
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
177
184
|
) {
|
178
185
|
this.blockHandlers.push({
|
@@ -191,7 +198,8 @@ export abstract class BaseProcessorTemplate<
|
|
191
198
|
fetchConfig?: Partial<EthFetchConfig>,
|
192
199
|
preprocessHandler: (
|
193
200
|
trace: TypedCallTrace,
|
194
|
-
ctx: ContractContext<TContract, TBoundContractView
|
201
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
202
|
+
preprocessStore: { [k: string]: any }
|
195
203
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
196
204
|
) {
|
197
205
|
this.traceHandlers.push({
|
@@ -31,14 +31,14 @@ export const defaultPreprocessHandler = () => (<PreprocessResult>{ ethCallParams
|
|
31
31
|
export class EventsHandler {
|
32
32
|
filters: AddressOrTypeEventFilter[]
|
33
33
|
handler: (event: Data_EthLog) => Promise<ProcessResult>
|
34
|
-
preprocessHandler?: (event: Data_EthLog) => Promise<PreprocessResult>
|
34
|
+
preprocessHandler?: (event: Data_EthLog, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>
|
35
35
|
fetchConfig: EthFetchConfig
|
36
36
|
}
|
37
37
|
|
38
38
|
export class TraceHandler {
|
39
39
|
signatures: string[]
|
40
40
|
handler: (trace: Data_EthTrace) => Promise<ProcessResult>
|
41
|
-
preprocessHandler?: (event: Data_EthTrace) => Promise<PreprocessResult>
|
41
|
+
preprocessHandler?: (event: Data_EthTrace, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>
|
42
42
|
fetchConfig: EthFetchConfig
|
43
43
|
}
|
44
44
|
|
@@ -46,13 +46,13 @@ export class BlockHandler {
|
|
46
46
|
blockInterval?: HandleInterval
|
47
47
|
timeIntervalInMinutes?: HandleInterval
|
48
48
|
handler: (block: Data_EthBlock) => Promise<ProcessResult>
|
49
|
-
preprocessHandler?: (event: Data_EthBlock) => Promise<PreprocessResult>
|
49
|
+
preprocessHandler?: (event: Data_EthBlock, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>
|
50
50
|
fetchConfig: EthFetchConfig
|
51
51
|
}
|
52
52
|
|
53
53
|
export class TransactionHandler {
|
54
54
|
handler: (block: Data_EthTransaction) => Promise<ProcessResult>
|
55
|
-
preprocessHandler?: (event: Data_EthTransaction) => Promise<PreprocessResult>
|
55
|
+
preprocessHandler?: (event: Data_EthTransaction, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>
|
56
56
|
fetchConfig: EthFetchConfig
|
57
57
|
}
|
58
58
|
|
@@ -314,7 +314,8 @@ export abstract class BaseProcessor<
|
|
314
314
|
fetchConfig?: Partial<EthFetchConfig>,
|
315
315
|
preprocessHandler: (
|
316
316
|
event: TypedEvent,
|
317
|
-
ctx: ContractContext<TContract, TBoundContractView
|
317
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
318
|
+
preprocessStore: { [k: string]: any }
|
318
319
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
319
320
|
): this {
|
320
321
|
const chainId = this.getChainId()
|
@@ -382,7 +383,10 @@ export abstract class BaseProcessor<
|
|
382
383
|
}
|
383
384
|
return ProcessResult.fromPartial({})
|
384
385
|
},
|
385
|
-
preprocessHandler: async function (
|
386
|
+
preprocessHandler: async function (
|
387
|
+
data: Data_EthLog,
|
388
|
+
preprocessStore: { [k: string]: any }
|
389
|
+
): Promise<PreprocessResult> {
|
386
390
|
const { log, block, transaction, transactionReceipt } = formatEthData(data)
|
387
391
|
if (!log) {
|
388
392
|
throw new ServerError(Status.INVALID_ARGUMENT, 'Log is empty')
|
@@ -427,7 +431,7 @@ export abstract class BaseProcessor<
|
|
427
431
|
}
|
428
432
|
if (parsed) {
|
429
433
|
const event: TypedEvent = { ...log, name: parsed.name, args: fixEmptyKey(parsed) }
|
430
|
-
return preprocessHandler(event, ctx)
|
434
|
+
return preprocessHandler(event, ctx, preprocessStore)
|
431
435
|
}
|
432
436
|
return PreprocessResult.fromPartial({})
|
433
437
|
}
|
@@ -442,7 +446,8 @@ export abstract class BaseProcessor<
|
|
442
446
|
fetchConfig?: Partial<EthFetchConfig>,
|
443
447
|
preprocessHandler: (
|
444
448
|
block: RichBlock,
|
445
|
-
ctx: ContractContext<TContract, TBoundContractView
|
449
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
450
|
+
preprocessStore: { [k: string]: any }
|
446
451
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
447
452
|
): this {
|
448
453
|
return this.onInterval(
|
@@ -464,7 +469,8 @@ export abstract class BaseProcessor<
|
|
464
469
|
fetchConfig?: Partial<EthFetchConfig>,
|
465
470
|
preprocessHandler: (
|
466
471
|
block: RichBlock,
|
467
|
-
ctx: ContractContext<TContract, TBoundContractView
|
472
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
473
|
+
preprocessStore: { [k: string]: any }
|
468
474
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
469
475
|
): this {
|
470
476
|
return this.onInterval(
|
@@ -483,7 +489,8 @@ export abstract class BaseProcessor<
|
|
483
489
|
fetchConfig: Partial<EthFetchConfig> | undefined,
|
484
490
|
preprocessHandler: (
|
485
491
|
block: RichBlock,
|
486
|
-
ctx: ContractContext<TContract, TBoundContractView
|
492
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
493
|
+
preprocessStore: { [k: string]: any }
|
487
494
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
488
495
|
): this {
|
489
496
|
const chainId = this.getChainId()
|
@@ -516,7 +523,7 @@ export abstract class BaseProcessor<
|
|
516
523
|
await handler(block, ctx)
|
517
524
|
return ctx.stopAndGetResult()
|
518
525
|
},
|
519
|
-
preprocessHandler: async function (data: Data_EthBlock) {
|
526
|
+
preprocessHandler: async function (data: Data_EthBlock, preprocessStore: { [k: string]: any }) {
|
520
527
|
const { block } = formatEthData(data)
|
521
528
|
|
522
529
|
if (!block) {
|
@@ -537,7 +544,7 @@ export abstract class BaseProcessor<
|
|
537
544
|
undefined,
|
538
545
|
processor.config.baseLabels
|
539
546
|
)
|
540
|
-
return preprocessHandler(block, ctx)
|
547
|
+
return preprocessHandler(block, ctx, preprocessStore)
|
541
548
|
},
|
542
549
|
timeIntervalInMinutes: timeInterval,
|
543
550
|
blockInterval: blockInterval,
|
@@ -552,7 +559,8 @@ export abstract class BaseProcessor<
|
|
552
559
|
fetchConfig?: Partial<EthFetchConfig>,
|
553
560
|
preprocessHandler: (
|
554
561
|
trace: TypedCallTrace,
|
555
|
-
ctx: ContractContext<TContract, TBoundContractView
|
562
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
563
|
+
preprocessStore: { [k: string]: any }
|
556
564
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
557
565
|
): this {
|
558
566
|
const chainId = this.getChainId()
|
@@ -610,7 +618,7 @@ export abstract class BaseProcessor<
|
|
610
618
|
await handler(typedTrace, ctx)
|
611
619
|
return ctx.stopAndGetResult()
|
612
620
|
},
|
613
|
-
preprocessHandler: async function (data: Data_EthTrace) {
|
621
|
+
preprocessHandler: async function (data: Data_EthTrace, preprocessStore: { [k: string]: any }) {
|
614
622
|
const contractView = processor.CreateBoundContractView()
|
615
623
|
const contractInterface = contractView.rawContract.interface
|
616
624
|
const { trace, block, transaction, transactionReceipt } = formatEthData(data)
|
@@ -651,7 +659,7 @@ export abstract class BaseProcessor<
|
|
651
659
|
transactionReceipt,
|
652
660
|
processor.config.baseLabels
|
653
661
|
)
|
654
|
-
return preprocessHandler(typedTrace, ctx)
|
662
|
+
return preprocessHandler(typedTrace, ctx, preprocessStore)
|
655
663
|
}
|
656
664
|
})
|
657
665
|
return this
|
@@ -662,7 +670,8 @@ export abstract class BaseProcessor<
|
|
662
670
|
fetchConfig?: Partial<EthFetchConfig>,
|
663
671
|
preprocessHandler: (
|
664
672
|
trace: TypedCallTrace,
|
665
|
-
ctx: ContractContext<TContract, TBoundContractView
|
673
|
+
ctx: ContractContext<TContract, TBoundContractView>,
|
674
|
+
preprocessStore: { [k: string]: any }
|
666
675
|
) => Promise<PreprocessResult> = defaultPreprocessHandler
|
667
676
|
): this {
|
668
677
|
const tmpContract = this.CreateBoundContractView()
|