@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/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: unique symbol;
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
- export { ChainConfig, Endpoints, GLOBAL_CONFIG, GlobalConfig, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, State, StateStorage, StoreContext, USER_PROCESSOR, errorString, makeEthCallKey, mergeProcessResults, timeoutError };
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-PDNEVCRT.js";
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
@@ -41,7 +41,7 @@ import {
41
41
  require_minimal,
42
42
  require_src,
43
43
  trace
44
- } from "./chunk-PDNEVCRT.js";
44
+ } from "./chunk-N6FVCF37.js";
45
45
 
46
46
  // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
47
47
  var require_universalify = __commonJS({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.40.0-rc.22",
3
+ "version": "2.40.0-rc.24",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
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 = Symbol()
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
@@ -6,3 +6,4 @@ export * from './chain-config.js'
6
6
  export * from './service.js'
7
7
  export { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'
8
8
  export * from './db-context.js'
9
+ export * from './provider.js'