@sentio/runtime 1.38.1-rc.1 → 1.39.0-rc.1

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/plugin.js CHANGED
@@ -20,6 +20,9 @@ class PluginManager {
20
20
  plugins = [];
21
21
  typesToPlugin = new Map();
22
22
  register(plugin) {
23
+ if (this.plugins.find((p) => p.name === plugin.name)) {
24
+ return;
25
+ }
23
26
  this.plugins.push(plugin);
24
27
  for (const handlerType of plugin.supportedHandlers) {
25
28
  const exsited = this.typesToPlugin.get(handlerType);
package/lib/plugin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;AAAA,2CAA6G;AAE7G,MAAsB,MAAM;IAC1B,IAAI,CAAQ;IACZ,iBAAiB,GAAkB,EAAE,CAAA;IAErC,SAAS,CAAC,MAA6B,IAAG,CAAC;IAC3C,KAAK,CAAC,KAAmB,IAAG,CAAC;IAC7B,SAAS,CAAC,MAA6B;QACrC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,CAAC,cAAc,CAAC,OAAoB;QACvC,OAAO,sBAAa,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;CACF;AAZD,wBAYC;AAED,MAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAA;IAErC,OAAO,GAAa,EAAE,CAAA;IACtB,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAA;IAE9C,QAAQ,CAAC,MAAc;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACzB,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,iBAAiB,EAAE;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YACnD,IAAI,OAAO,EAAE;gBACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,WAAW,KAAK,OAAO,CAAC,IAAI,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;aAC3F;YACD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;SAC5C;IACH,CAAC;IAED,SAAS,CAAC,MAA6B;QACrC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5D,CAAC;IAED,KAAK,CAAC,KAAmB;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACvD,CAAC;IAED,SAAS,CAAC,MAA6B;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,cAAc,CAAC,OAAoB;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC1D,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;SACxD;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;;AAnCH,sCAoCC","sourcesContent":["import { DataBinding, HandlerType, ProcessConfigResponse, ProcessResult, StartRequest } from '@sentio/protos'\n\nexport abstract class Plugin {\n name: string\n supportedHandlers: HandlerType[] = []\n\n configure(config: ProcessConfigResponse) {}\n start(start: StartRequest) {}\n stateDiff(config: ProcessConfigResponse): boolean {\n return false\n }\n async processBinding(request: DataBinding): Promise<ProcessResult> {\n return ProcessResult.fromPartial({})\n }\n}\n\nexport class PluginManager {\n static INSTANCE = new PluginManager()\n\n plugins: Plugin[] = []\n typesToPlugin = new Map<HandlerType, Plugin>()\n\n register(plugin: Plugin) {\n this.plugins.push(plugin)\n for (const handlerType of plugin.supportedHandlers) {\n const exsited = this.typesToPlugin.get(handlerType)\n if (exsited) {\n throw new Error(`Duplicate plugin for ${handlerType}: ${exsited.name} and ${plugin.name}`)\n }\n this.typesToPlugin.set(handlerType, plugin)\n }\n }\n\n configure(config: ProcessConfigResponse) {\n this.plugins.forEach((plugin) => plugin.configure(config))\n }\n\n start(start: StartRequest) {\n this.plugins.forEach((plugin) => plugin.start(start))\n }\n\n stateDiff(config: ProcessConfigResponse): boolean {\n return this.plugins.some((plugin) => plugin.stateDiff(config))\n }\n\n processBinding(request: DataBinding): Promise<ProcessResult> {\n const plugin = this.typesToPlugin.get(request.handlerType)\n if (!plugin) {\n throw new Error(`No plugin for ${request.handlerType}`)\n }\n return plugin.processBinding(request)\n }\n}\n"]}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;AAAA,2CAA6G;AAE7G,MAAsB,MAAM;IAC1B,IAAI,CAAQ;IACZ,iBAAiB,GAAkB,EAAE,CAAA;IAErC,SAAS,CAAC,MAA6B,IAAG,CAAC;IAC3C,KAAK,CAAC,KAAmB,IAAG,CAAC;IAC7B,SAAS,CAAC,MAA6B;QACrC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,CAAC,cAAc,CAAC,OAAoB;QACvC,OAAO,sBAAa,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;CACF;AAZD,wBAYC;AAED,MAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAA;IAErC,OAAO,GAAa,EAAE,CAAA;IACtB,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAA;IAE9C,QAAQ,CAAC,MAAc;QACrB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;YACpD,OAAM;SACP;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEzB,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,iBAAiB,EAAE;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YACnD,IAAI,OAAO,EAAE;gBACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,WAAW,KAAK,OAAO,CAAC,IAAI,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;aAC3F;YACD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;SAC5C;IACH,CAAC;IAED,SAAS,CAAC,MAA6B;QACrC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5D,CAAC;IAED,KAAK,CAAC,KAAmB;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACvD,CAAC;IAED,SAAS,CAAC,MAA6B;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,cAAc,CAAC,OAAoB;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC1D,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;SACxD;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;;AAvCH,sCAwCC","sourcesContent":["import { DataBinding, HandlerType, ProcessConfigResponse, ProcessResult, StartRequest } from '@sentio/protos'\n\nexport abstract class Plugin {\n name: string\n supportedHandlers: HandlerType[] = []\n\n configure(config: ProcessConfigResponse) {}\n start(start: StartRequest) {}\n stateDiff(config: ProcessConfigResponse): boolean {\n return false\n }\n async processBinding(request: DataBinding): Promise<ProcessResult> {\n return ProcessResult.fromPartial({})\n }\n}\n\nexport class PluginManager {\n static INSTANCE = new PluginManager()\n\n plugins: Plugin[] = []\n typesToPlugin = new Map<HandlerType, Plugin>()\n\n register(plugin: Plugin) {\n if (this.plugins.find((p) => p.name === plugin.name)) {\n return\n }\n this.plugins.push(plugin)\n\n for (const handlerType of plugin.supportedHandlers) {\n const exsited = this.typesToPlugin.get(handlerType)\n if (exsited) {\n throw new Error(`Duplicate plugin for ${handlerType}: ${exsited.name} and ${plugin.name}`)\n }\n this.typesToPlugin.set(handlerType, plugin)\n }\n }\n\n configure(config: ProcessConfigResponse) {\n this.plugins.forEach((plugin) => plugin.configure(config))\n }\n\n start(start: StartRequest) {\n this.plugins.forEach((plugin) => plugin.start(start))\n }\n\n stateDiff(config: ProcessConfigResponse): boolean {\n return this.plugins.some((plugin) => plugin.stateDiff(config))\n }\n\n processBinding(request: DataBinding): Promise<ProcessResult> {\n const plugin = this.typesToPlugin.get(request.handlerType)\n if (!plugin) {\n throw new Error(`No plugin for ${request.handlerType}`)\n }\n return plugin.processBinding(request)\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
3
  "license": "Apache-2.0",
4
- "version": "1.38.1-rc.1",
4
+ "version": "1.39.0-rc.1",
5
5
  "scripts": {
6
6
  "compile": "tsc -p .",
7
7
  "build": "yarn compile",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@ethersproject/providers": "~5.7.0",
13
- "@sentio/protos": "^1.38.1-rc.1",
13
+ "@sentio/protos": "^1.39.0-rc.1",
14
14
  "bignumber.js": "^9.1.0",
15
15
  "command-line-args": "^5.2.1",
16
16
  "command-line-usage": "^6.1.3",
@@ -46,5 +46,5 @@
46
46
  "!{lib,src}/tests",
47
47
  "!**/*.test.{js,ts}"
48
48
  ],
49
- "gitHead": "a32aa3e285bf12dff1f3a0f79cf7f11f9196d5e8"
49
+ "gitHead": "c5bc3b02a7db211691fd194895f3f687111e723b"
50
50
  }
@@ -399,6 +399,11 @@ export interface BlockHandlerConfig {
399
399
  handlerId: number;
400
400
  }
401
401
 
402
+ export interface EthFetchConfig {
403
+ transaction: boolean;
404
+ transactionReceipt: boolean;
405
+ }
406
+
402
407
  export interface TraceHandlerConfig {
403
408
  signature: string;
404
409
  handlerId: number;
@@ -421,9 +426,14 @@ export interface InstructionHandlerConfig {
421
426
  rawDataInstruction: boolean;
422
427
  }
423
428
 
429
+ export interface AptosFetchConfig {
430
+ resourceChanges: boolean;
431
+ }
432
+
424
433
  export interface AptosEventHandlerConfig {
425
434
  filters: AptosEventFilter[];
426
435
  handlerId: number;
436
+ fetchConfig: AptosFetchConfig | undefined;
427
437
  }
428
438
 
429
439
  export interface AptosEventFilter {
@@ -434,6 +444,7 @@ export interface AptosEventFilter {
434
444
  export interface AptosCallHandlerConfig {
435
445
  filters: AptosCallFilter[];
436
446
  handlerId: number;
447
+ fetchConfig: AptosFetchConfig | undefined;
437
448
  }
438
449
 
439
450
  export interface AptosCallFilter {
@@ -456,6 +467,7 @@ export interface ProcessBindingResponse {
456
467
  configUpdated: boolean;
457
468
  }
458
469
 
470
+ /** @deprecated */
459
471
  export interface RawTransaction {
460
472
  raw: Uint8Array;
461
473
  programAccountId?: string | undefined;
@@ -2089,6 +2101,64 @@ export const BlockHandlerConfig = {
2089
2101
  },
2090
2102
  };
2091
2103
 
2104
+ function createBaseEthFetchConfig(): EthFetchConfig {
2105
+ return { transaction: false, transactionReceipt: false };
2106
+ }
2107
+
2108
+ export const EthFetchConfig = {
2109
+ encode(message: EthFetchConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2110
+ if (message.transaction === true) {
2111
+ writer.uint32(8).bool(message.transaction);
2112
+ }
2113
+ if (message.transactionReceipt === true) {
2114
+ writer.uint32(16).bool(message.transactionReceipt);
2115
+ }
2116
+ return writer;
2117
+ },
2118
+
2119
+ decode(input: _m0.Reader | Uint8Array, length?: number): EthFetchConfig {
2120
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2121
+ let end = length === undefined ? reader.len : reader.pos + length;
2122
+ const message = createBaseEthFetchConfig();
2123
+ while (reader.pos < end) {
2124
+ const tag = reader.uint32();
2125
+ switch (tag >>> 3) {
2126
+ case 1:
2127
+ message.transaction = reader.bool();
2128
+ break;
2129
+ case 2:
2130
+ message.transactionReceipt = reader.bool();
2131
+ break;
2132
+ default:
2133
+ reader.skipType(tag & 7);
2134
+ break;
2135
+ }
2136
+ }
2137
+ return message;
2138
+ },
2139
+
2140
+ fromJSON(object: any): EthFetchConfig {
2141
+ return {
2142
+ transaction: isSet(object.transaction) ? Boolean(object.transaction) : false,
2143
+ transactionReceipt: isSet(object.transactionReceipt) ? Boolean(object.transactionReceipt) : false,
2144
+ };
2145
+ },
2146
+
2147
+ toJSON(message: EthFetchConfig): unknown {
2148
+ const obj: any = {};
2149
+ message.transaction !== undefined && (obj.transaction = message.transaction);
2150
+ message.transactionReceipt !== undefined && (obj.transactionReceipt = message.transactionReceipt);
2151
+ return obj;
2152
+ },
2153
+
2154
+ fromPartial(object: DeepPartial<EthFetchConfig>): EthFetchConfig {
2155
+ const message = createBaseEthFetchConfig();
2156
+ message.transaction = object.transaction ?? false;
2157
+ message.transactionReceipt = object.transactionReceipt ?? false;
2158
+ return message;
2159
+ },
2160
+ };
2161
+
2092
2162
  function createBaseTraceHandlerConfig(): TraceHandlerConfig {
2093
2163
  return { signature: "", handlerId: 0 };
2094
2164
  }
@@ -2348,8 +2418,55 @@ export const InstructionHandlerConfig = {
2348
2418
  },
2349
2419
  };
2350
2420
 
2421
+ function createBaseAptosFetchConfig(): AptosFetchConfig {
2422
+ return { resourceChanges: false };
2423
+ }
2424
+
2425
+ export const AptosFetchConfig = {
2426
+ encode(message: AptosFetchConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2427
+ if (message.resourceChanges === true) {
2428
+ writer.uint32(8).bool(message.resourceChanges);
2429
+ }
2430
+ return writer;
2431
+ },
2432
+
2433
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosFetchConfig {
2434
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2435
+ let end = length === undefined ? reader.len : reader.pos + length;
2436
+ const message = createBaseAptosFetchConfig();
2437
+ while (reader.pos < end) {
2438
+ const tag = reader.uint32();
2439
+ switch (tag >>> 3) {
2440
+ case 1:
2441
+ message.resourceChanges = reader.bool();
2442
+ break;
2443
+ default:
2444
+ reader.skipType(tag & 7);
2445
+ break;
2446
+ }
2447
+ }
2448
+ return message;
2449
+ },
2450
+
2451
+ fromJSON(object: any): AptosFetchConfig {
2452
+ return { resourceChanges: isSet(object.resourceChanges) ? Boolean(object.resourceChanges) : false };
2453
+ },
2454
+
2455
+ toJSON(message: AptosFetchConfig): unknown {
2456
+ const obj: any = {};
2457
+ message.resourceChanges !== undefined && (obj.resourceChanges = message.resourceChanges);
2458
+ return obj;
2459
+ },
2460
+
2461
+ fromPartial(object: DeepPartial<AptosFetchConfig>): AptosFetchConfig {
2462
+ const message = createBaseAptosFetchConfig();
2463
+ message.resourceChanges = object.resourceChanges ?? false;
2464
+ return message;
2465
+ },
2466
+ };
2467
+
2351
2468
  function createBaseAptosEventHandlerConfig(): AptosEventHandlerConfig {
2352
- return { filters: [], handlerId: 0 };
2469
+ return { filters: [], handlerId: 0, fetchConfig: undefined };
2353
2470
  }
2354
2471
 
2355
2472
  export const AptosEventHandlerConfig = {
@@ -2360,6 +2477,9 @@ export const AptosEventHandlerConfig = {
2360
2477
  if (message.handlerId !== 0) {
2361
2478
  writer.uint32(16).int32(message.handlerId);
2362
2479
  }
2480
+ if (message.fetchConfig !== undefined) {
2481
+ AptosFetchConfig.encode(message.fetchConfig, writer.uint32(26).fork()).ldelim();
2482
+ }
2363
2483
  return writer;
2364
2484
  },
2365
2485
 
@@ -2376,6 +2496,9 @@ export const AptosEventHandlerConfig = {
2376
2496
  case 2:
2377
2497
  message.handlerId = reader.int32();
2378
2498
  break;
2499
+ case 3:
2500
+ message.fetchConfig = AptosFetchConfig.decode(reader, reader.uint32());
2501
+ break;
2379
2502
  default:
2380
2503
  reader.skipType(tag & 7);
2381
2504
  break;
@@ -2388,6 +2511,7 @@ export const AptosEventHandlerConfig = {
2388
2511
  return {
2389
2512
  filters: Array.isArray(object?.filters) ? object.filters.map((e: any) => AptosEventFilter.fromJSON(e)) : [],
2390
2513
  handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0,
2514
+ fetchConfig: isSet(object.fetchConfig) ? AptosFetchConfig.fromJSON(object.fetchConfig) : undefined,
2391
2515
  };
2392
2516
  },
2393
2517
 
@@ -2399,6 +2523,8 @@ export const AptosEventHandlerConfig = {
2399
2523
  obj.filters = [];
2400
2524
  }
2401
2525
  message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId));
2526
+ message.fetchConfig !== undefined &&
2527
+ (obj.fetchConfig = message.fetchConfig ? AptosFetchConfig.toJSON(message.fetchConfig) : undefined);
2402
2528
  return obj;
2403
2529
  },
2404
2530
 
@@ -2406,6 +2532,9 @@ export const AptosEventHandlerConfig = {
2406
2532
  const message = createBaseAptosEventHandlerConfig();
2407
2533
  message.filters = object.filters?.map((e) => AptosEventFilter.fromPartial(e)) || [];
2408
2534
  message.handlerId = object.handlerId ?? 0;
2535
+ message.fetchConfig = (object.fetchConfig !== undefined && object.fetchConfig !== null)
2536
+ ? AptosFetchConfig.fromPartial(object.fetchConfig)
2537
+ : undefined;
2409
2538
  return message;
2410
2539
  },
2411
2540
  };
@@ -2469,7 +2598,7 @@ export const AptosEventFilter = {
2469
2598
  };
2470
2599
 
2471
2600
  function createBaseAptosCallHandlerConfig(): AptosCallHandlerConfig {
2472
- return { filters: [], handlerId: 0 };
2601
+ return { filters: [], handlerId: 0, fetchConfig: undefined };
2473
2602
  }
2474
2603
 
2475
2604
  export const AptosCallHandlerConfig = {
@@ -2480,6 +2609,9 @@ export const AptosCallHandlerConfig = {
2480
2609
  if (message.handlerId !== 0) {
2481
2610
  writer.uint32(16).int32(message.handlerId);
2482
2611
  }
2612
+ if (message.fetchConfig !== undefined) {
2613
+ AptosFetchConfig.encode(message.fetchConfig, writer.uint32(26).fork()).ldelim();
2614
+ }
2483
2615
  return writer;
2484
2616
  },
2485
2617
 
@@ -2496,6 +2628,9 @@ export const AptosCallHandlerConfig = {
2496
2628
  case 2:
2497
2629
  message.handlerId = reader.int32();
2498
2630
  break;
2631
+ case 3:
2632
+ message.fetchConfig = AptosFetchConfig.decode(reader, reader.uint32());
2633
+ break;
2499
2634
  default:
2500
2635
  reader.skipType(tag & 7);
2501
2636
  break;
@@ -2508,6 +2643,7 @@ export const AptosCallHandlerConfig = {
2508
2643
  return {
2509
2644
  filters: Array.isArray(object?.filters) ? object.filters.map((e: any) => AptosCallFilter.fromJSON(e)) : [],
2510
2645
  handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0,
2646
+ fetchConfig: isSet(object.fetchConfig) ? AptosFetchConfig.fromJSON(object.fetchConfig) : undefined,
2511
2647
  };
2512
2648
  },
2513
2649
 
@@ -2519,6 +2655,8 @@ export const AptosCallHandlerConfig = {
2519
2655
  obj.filters = [];
2520
2656
  }
2521
2657
  message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId));
2658
+ message.fetchConfig !== undefined &&
2659
+ (obj.fetchConfig = message.fetchConfig ? AptosFetchConfig.toJSON(message.fetchConfig) : undefined);
2522
2660
  return obj;
2523
2661
  },
2524
2662
 
@@ -2526,6 +2664,9 @@ export const AptosCallHandlerConfig = {
2526
2664
  const message = createBaseAptosCallHandlerConfig();
2527
2665
  message.filters = object.filters?.map((e) => AptosCallFilter.fromPartial(e)) || [];
2528
2666
  message.handlerId = object.handlerId ?? 0;
2667
+ message.fetchConfig = (object.fetchConfig !== undefined && object.fetchConfig !== null)
2668
+ ? AptosFetchConfig.fromPartial(object.fetchConfig)
2669
+ : undefined;
2529
2670
  return message;
2530
2671
  },
2531
2672
  };
package/src/plugin.ts CHANGED
@@ -21,7 +21,11 @@ export class PluginManager {
21
21
  typesToPlugin = new Map<HandlerType, Plugin>()
22
22
 
23
23
  register(plugin: Plugin) {
24
+ if (this.plugins.find((p) => p.name === plugin.name)) {
25
+ return
26
+ }
24
27
  this.plugins.push(plugin)
28
+
25
29
  for (const handlerType of plugin.supportedHandlers) {
26
30
  const exsited = this.typesToPlugin.get(handlerType)
27
31
  if (exsited) {