@sentio/runtime 2.40.0-rc.22 → 2.40.0-rc.24
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/{chunk-PDNEVCRT.js → chunk-N6FVCF37.js} +4982 -3345
- package/lib/index.d.ts +7 -2
- package/lib/index.js +5 -1
- package/lib/processor-runner.js +1 -1
- package/package.json +1 -1
- package/src/db-context.ts +2 -2
- package/src/index.ts +1 -0
- package/src/multicall.ts +1616 -0
- package/src/provider.ts +1 -0
- package/src/service.ts +60 -12
package/lib/index.d.ts
CHANGED
@@ -5,10 +5,12 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
|
5
5
|
import { Required } from 'utility-types';
|
6
6
|
import { CallContext } from 'nice-grpc';
|
7
7
|
import _m0 from 'protobufjs/minimal.js';
|
8
|
+
import { JsonRpcProvider, Provider } from 'ethers';
|
9
|
+
import { EthChainId } from '@sentio/chain';
|
8
10
|
|
9
11
|
type Request = Omit<DBRequest, 'opId'>;
|
10
12
|
type RequestType = keyof Request;
|
11
|
-
declare const timeoutError:
|
13
|
+
declare const timeoutError: Error;
|
12
14
|
declare class StoreContext {
|
13
15
|
readonly subject: Subject<DeepPartial$1<ProcessStreamResponse>>;
|
14
16
|
readonly processId: number;
|
@@ -374,4 +376,7 @@ interface GlobalConfig {
|
|
374
376
|
}
|
375
377
|
declare const GLOBAL_CONFIG: GlobalConfig;
|
376
378
|
|
377
|
-
|
379
|
+
declare const DummyProvider: JsonRpcProvider;
|
380
|
+
declare function getProvider(chainId?: EthChainId): Provider;
|
381
|
+
|
382
|
+
export { ChainConfig, DummyProvider, Endpoints, GLOBAL_CONFIG, GlobalConfig, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, State, StateStorage, StoreContext, USER_PROCESSOR, errorString, getProvider, makeEthCallKey, mergeProcessResults, timeoutError };
|
package/lib/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
2
2
|
import {
|
3
|
+
DummyProvider,
|
3
4
|
Endpoints,
|
4
5
|
GLOBAL_CONFIG,
|
5
6
|
Plugin,
|
@@ -9,10 +10,11 @@ import {
|
|
9
10
|
USER_PROCESSOR,
|
10
11
|
__publicField,
|
11
12
|
errorString,
|
13
|
+
getProvider,
|
12
14
|
makeEthCallKey,
|
13
15
|
mergeProcessResults,
|
14
16
|
timeoutError
|
15
|
-
} from "./chunk-
|
17
|
+
} from "./chunk-N6FVCF37.js";
|
16
18
|
|
17
19
|
// src/state.ts
|
18
20
|
var _State = class {
|
@@ -76,6 +78,7 @@ var ListStateStorage = class extends StateStorage {
|
|
76
78
|
}
|
77
79
|
};
|
78
80
|
export {
|
81
|
+
DummyProvider,
|
79
82
|
Endpoints,
|
80
83
|
GLOBAL_CONFIG,
|
81
84
|
ListStateStorage,
|
@@ -88,6 +91,7 @@ export {
|
|
88
91
|
StoreContext,
|
89
92
|
USER_PROCESSOR,
|
90
93
|
errorString,
|
94
|
+
getProvider,
|
91
95
|
makeEthCallKey,
|
92
96
|
mergeProcessResults,
|
93
97
|
timeoutError
|
package/lib/processor-runner.js
CHANGED
package/package.json
CHANGED
package/src/db-context.ts
CHANGED
@@ -24,7 +24,7 @@ const STORE_BATCH_SIZE = process.env['STORE_BATCH_SIZE'] ? parseInt(process.env[
|
|
24
24
|
type Request = Omit<DBRequest, 'opId'>
|
25
25
|
type RequestType = keyof Request
|
26
26
|
|
27
|
-
export const timeoutError =
|
27
|
+
export const timeoutError = new Error('timeout')
|
28
28
|
|
29
29
|
export class StoreContext {
|
30
30
|
private static opCounter = 0n
|
@@ -181,7 +181,7 @@ export class StoreContext {
|
|
181
181
|
private sendBatch() {
|
182
182
|
if (this.upsertBatch) {
|
183
183
|
const { request, opId, timer } = this.upsertBatch
|
184
|
-
console.debug('sending batch upsert', opId, 'batch size', request?.entity.length)
|
184
|
+
// console.debug('sending batch upsert', opId, 'batch size', request?.entity.length)
|
185
185
|
clearTimeout(timer)
|
186
186
|
this.upsertBatch = undefined
|
187
187
|
this.subject.next({
|
package/src/index.ts
CHANGED