@sentio/runtime 2.40.0-rc.1 → 2.40.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _sentio_protos from '@sentio/protos';
2
- import { DeepPartial as DeepPartial$1, ProcessStreamResponse, DBResponse, DBRequest_DBUpsert, DBRequest, HandlerType, ProcessConfigResponse, StartRequest, DataBinding, PreparedData, ProcessResult, PreprocessResult, ProcessorServiceImplementation, ProcessConfigRequest, Empty, ProcessBindingsRequest, ProcessBindingResponse, ProcessStreamRequest } from '@sentio/protos';
2
+ import { DeepPartial as DeepPartial$1, ProcessStreamResponse, DBResponse, DBRequest_DBUpsert, DBRequest, HandlerType, ProcessConfigResponse, StartRequest, DataBinding, PreparedData, ProcessResult, PreprocessResult, EthCallParam, ProcessorServiceImplementation, ProcessConfigRequest, Empty, ProcessBindingsRequest, ProcessBindingResponse, ProcessStreamRequest, PreprocessStreamRequest, PreprocessStreamResponse } from '@sentio/protos';
3
3
  import { Subject } from 'rxjs';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
5
  import { Required } from 'utility-types';
@@ -85,6 +85,7 @@ declare abstract class ListStateStorage<T> extends StateStorage<T[]> {
85
85
  declare function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'>;
86
86
  declare function errorString(e: Error): string;
87
87
  declare const USER_PROCESSOR = "user_processor";
88
+ declare function makeEthCallKey(param: EthCallParam): string;
88
89
 
89
90
  declare class Endpoints {
90
91
  static INSTANCE: Endpoints;
@@ -106,15 +107,16 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
106
107
  unhandled: Error;
107
108
  private readonly loader;
108
109
  private readonly shutdownHandler?;
110
+ private readonly preprocessedEthCalls;
109
111
  constructor(loader: () => Promise<any>, shutdownHandler?: () => void);
110
112
  getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse>;
111
113
  start(request: StartRequest, context: CallContext): Promise<Empty>;
112
114
  stop(request: Empty, context: CallContext): Promise<Empty>;
113
115
  processBindings(request: ProcessBindingsRequest, options?: CallContext): Promise<ProcessBindingResponse>;
114
- preprocessBindings(request: ProcessBindingsRequest, options?: CallContext): Promise<{
115
- [calldata: string]: any[];
116
+ preprocessBindings(bindings: DataBinding[], dbContext?: StoreContext, options?: CallContext): Promise<{
117
+ [ethCallKey: string]: string;
116
118
  }>;
117
- preprocessBinding(request: DataBinding, options?: CallContext): Promise<PreprocessResult>;
119
+ preprocessBinding(request: DataBinding, dbContext?: StoreContext, options?: CallContext): Promise<PreprocessResult>;
118
120
  processBinding(request: DataBinding, preparedData: PreparedData | undefined, options?: CallContext): Promise<ProcessResult>;
119
121
  processBindingsStream(requests: AsyncIterable<ProcessStreamRequest>, context: CallContext): AsyncGenerator<{
120
122
  processId?: number | undefined;
@@ -279,6 +281,67 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
279
281
  } | undefined;
280
282
  } | undefined;
281
283
  }, void, undefined>;
284
+ handlePreprocessRequests(requests: AsyncIterable<PreprocessStreamRequest>, subject: Subject<DeepPartial$1<PreprocessStreamResponse>>): Promise<void>;
285
+ preprocessBindingsStream(requests: AsyncIterable<PreprocessStreamRequest>, context: CallContext): AsyncGenerator<{
286
+ processId?: number | undefined;
287
+ dbRequest?: {
288
+ opId?: bigint | undefined;
289
+ get?: {
290
+ entity?: string | undefined;
291
+ id?: string | undefined;
292
+ } | undefined;
293
+ upsert?: {
294
+ entity?: string[] | undefined;
295
+ id?: string[] | undefined;
296
+ data?: {
297
+ [x: string]: any;
298
+ }[] | undefined;
299
+ entityData?: {
300
+ fields?: {
301
+ [x: string]: {
302
+ nullValue?: _sentio_protos.RichValue_NullValue | undefined;
303
+ intValue?: number | undefined;
304
+ floatValue?: number | undefined;
305
+ bytesValue?: Uint8Array | undefined;
306
+ boolValue?: boolean | undefined;
307
+ stringValue?: string | undefined;
308
+ timestampValue?: Date | undefined;
309
+ bigintValue?: {
310
+ negative?: boolean | undefined;
311
+ data?: Uint8Array | undefined;
312
+ } | undefined;
313
+ bigdecimalValue?: {
314
+ value?: {
315
+ negative?: boolean | undefined;
316
+ data?: Uint8Array | undefined;
317
+ } | undefined;
318
+ exp?: number | undefined;
319
+ } | undefined;
320
+ listValue?: {
321
+ values?: any[] | undefined;
322
+ } | undefined;
323
+ } | undefined;
324
+ } | undefined;
325
+ }[] | undefined;
326
+ } | undefined;
327
+ delete?: {
328
+ entity?: string[] | undefined;
329
+ id?: string[] | undefined;
330
+ } | undefined;
331
+ list?: {
332
+ entity?: string | undefined;
333
+ filters?: {
334
+ field?: string | undefined;
335
+ op?: _sentio_protos.DBRequest_DBOperator | undefined;
336
+ value?: {
337
+ values?: any[] | undefined;
338
+ } | undefined;
339
+ }[] | undefined;
340
+ cursor?: string | undefined;
341
+ pageSize?: number | undefined;
342
+ } | undefined;
343
+ } | undefined;
344
+ }, void, undefined>;
282
345
  private handleRequests;
283
346
  }
284
347
 
@@ -305,4 +368,4 @@ interface GlobalConfig {
305
368
  }
306
369
  declare const GLOBAL_CONFIG: GlobalConfig;
307
370
 
308
- export { ChainConfig, Endpoints, GLOBAL_CONFIG, GlobalConfig, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, State, StateStorage, StoreContext, USER_PROCESSOR, errorString, mergeProcessResults, timeoutError };
371
+ export { ChainConfig, Endpoints, GLOBAL_CONFIG, GlobalConfig, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, State, StateStorage, StoreContext, USER_PROCESSOR, errorString, makeEthCallKey, mergeProcessResults, timeoutError };
package/lib/index.js CHANGED
@@ -9,9 +9,10 @@ import {
9
9
  USER_PROCESSOR,
10
10
  __publicField,
11
11
  errorString,
12
+ makeEthCallKey,
12
13
  mergeProcessResults,
13
14
  timeoutError
14
- } from "./chunk-LMUCLUM5.js";
15
+ } from "./chunk-FFU5RYDX.js";
15
16
 
16
17
  // src/state.ts
17
18
  var _State = class {
@@ -87,6 +88,7 @@ export {
87
88
  StoreContext,
88
89
  USER_PROCESSOR,
89
90
  errorString,
91
+ makeEthCallKey,
90
92
  mergeProcessResults,
91
93
  timeoutError
92
94
  };
@@ -40,7 +40,7 @@ import {
40
40
  require_minimal,
41
41
  require_src,
42
42
  trace
43
- } from "./chunk-LMUCLUM5.js";
43
+ } from "./chunk-FFU5RYDX.js";
44
44
 
45
45
  // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
46
46
  var require_universalify = __commonJS({
@@ -51259,6 +51259,9 @@ var FullProcessorServiceImpl = class {
51259
51259
  async *processBindingsStream(requests, context2) {
51260
51260
  yield* this.instance.processBindingsStream(requests, context2);
51261
51261
  }
51262
+ async *preprocessBindingsStream(requests, context2) {
51263
+ yield* this.instance.preprocessBindingsStream(requests, context2);
51264
+ }
51262
51265
  adjustResult(res) {
51263
51266
  }
51264
51267
  adjustDataBinding(dataBinding) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.40.0-rc.1",
3
+ "version": "2.40.0-rc.10",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -6,6 +6,7 @@ const require = createRequire(import.meta.url)
6
6
  import {
7
7
  DataBinding,
8
8
  HandlerType,
9
+ PreprocessStreamRequest,
9
10
  ProcessBindingsRequest,
10
11
  ProcessStreamRequest,
11
12
  ProcessConfigRequest,
@@ -111,6 +112,10 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
111
112
  yield* this.instance.processBindingsStream(requests, context)
112
113
  }
113
114
 
115
+ async *preprocessBindingsStream(requests: AsyncIterable<PreprocessStreamRequest>, context: CallContext) {
116
+ yield* this.instance.preprocessBindingsStream(requests, context)
117
+ }
118
+
114
119
  private adjustResult(res: ProcessResult): void {}
115
120
 
116
121
  private adjustDataBinding(dataBinding: DataBinding): void {