@sentio/sdk 0.1.4 → 0.1.5

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.
@@ -25,12 +25,12 @@ async function uploadFile(options, apiKeyOverride) {
25
25
  process.exit(1);
26
26
  }
27
27
  if (!fs_1.default.existsSync(PROCESSOR_FILE)) {
28
- console.error(chalk_1.default.red("File not existed ", PROCESSOR_FILE, "don't use --nobuild"));
28
+ console.error(chalk_1.default.red('File not existed ', PROCESSOR_FILE, "don't use --nobuild"));
29
29
  process.exit(1);
30
30
  }
31
31
  else {
32
32
  const stat = fs_1.default.statSync(PROCESSOR_FILE);
33
- console.log("Packed processor file size", Math.floor(stat.size / 1024) + "K, last modified", stat.mtime);
33
+ console.log('Packed processor file size', Math.floor(stat.size / 1024) + 'K, last modified', stat.mtime);
34
34
  }
35
35
  const data = new form_data_1.default();
36
36
  data.append('attachment', fs_1.default.createReadStream(PROCESSOR_FILE));
@@ -26,6 +26,7 @@ module.exports = {
26
26
  mode: 'production',
27
27
  externals: {
28
28
  ethers: 'commonjs2 ethers',
29
+ "@ethersproject": "commonjs2 @ethersproject",
29
30
  '@sentio/sdk': 'root sentio_sdk',
30
31
  },
31
32
  }
package/dist/context.d.ts CHANGED
@@ -21,3 +21,10 @@ export declare class ContractWrapper<TContract extends BaseContract> {
21
21
  constructor(contract: TContract);
22
22
  get _underlineContract(): TContract;
23
23
  }
24
+ export declare class SolanaContext {
25
+ histograms: HistogramResult[];
26
+ counters: CounterResult[];
27
+ meter: Meter;
28
+ address: string;
29
+ constructor(address: string);
30
+ }
package/dist/context.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContractWrapper = exports.Context = void 0;
3
+ exports.SolanaContext = exports.ContractWrapper = exports.Context = void 0;
4
4
  const meter_1 = require("./meter");
5
5
  class Context {
6
6
  contract;
@@ -32,4 +32,15 @@ class ContractWrapper {
32
32
  }
33
33
  }
34
34
  exports.ContractWrapper = ContractWrapper;
35
+ class SolanaContext {
36
+ histograms = [];
37
+ counters = [];
38
+ meter;
39
+ address;
40
+ constructor(address) {
41
+ this.meter = new meter_1.Meter(this);
42
+ this.address = address;
43
+ }
44
+ }
45
+ exports.SolanaContext = SolanaContext;
35
46
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAGA,mCAA+B;AAE/B,MAAa,OAAO;IAClB,QAAQ,CAAkB;IAC1B,OAAO,CAAQ;IACf,GAAG,CAAM;IACT,KAAK,CAAQ;IACb,UAAU,GAAsB,EAAE,CAAA;IAClC,QAAQ,GAAoB,EAAE,CAAA;IAC9B,KAAK,CAAO;IAEZ,YAAY,QAA0B,EAAE,OAAe,EAAE,KAAa,EAAE,GAAS;QAC/E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;CACF;AAhBD,0BAgBC;AAED,MAAa,eAAe;IAChB,QAAQ,CAAW;IAE7B,OAAO,CAA0D;IACjE,KAAK,CAAO;IAEZ,YAAY,QAAmB;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;IACjC,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;CACF;AAdD,0CAcC"}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAGA,mCAA+B;AAE/B,MAAa,OAAO;IAClB,QAAQ,CAAkB;IAC1B,OAAO,CAAQ;IACf,GAAG,CAAM;IACT,KAAK,CAAQ;IACb,UAAU,GAAsB,EAAE,CAAA;IAClC,QAAQ,GAAoB,EAAE,CAAA;IAC9B,KAAK,CAAO;IAEZ,YAAY,QAA0B,EAAE,OAAe,EAAE,KAAa,EAAE,GAAS;QAC/E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;CACF;AAhBD,0BAgBC;AAED,MAAa,eAAe;IAChB,QAAQ,CAAW;IAE7B,OAAO,CAA0D;IACjE,KAAK,CAAO;IAEZ,YAAY,QAAmB;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;IACjC,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;CACF;AAdD,0CAcC;AAED,MAAa,aAAa;IACxB,UAAU,GAAsB,EAAE,CAAA;IAClC,QAAQ,GAAoB,EAAE,CAAA;IAC9B,KAAK,CAAO;IAEZ,OAAO,CAAQ;IAEf,YAAY,OAAe;QACzB,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF;AAXD,sCAWC"}
@@ -19,6 +19,8 @@ export interface ContractConfig {
19
19
  startBlock: Long;
20
20
  endBlock: Long;
21
21
  chunkSize: number;
22
+ transactionConfig: TransactionHandlerConfig[];
23
+ instructionConfig: InstructionHandlerConfig[];
22
24
  }
23
25
  export interface ContractInfo {
24
26
  name: string;
@@ -39,6 +41,10 @@ export interface TransactionHandlerConfig {
39
41
  handlerName: string;
40
42
  address: string;
41
43
  }
44
+ export interface InstructionHandlerConfig {
45
+ handlerName: string;
46
+ address: string;
47
+ }
42
48
  export interface Topic {
43
49
  hashes: string[];
44
50
  }
@@ -51,9 +57,15 @@ export interface ProcessLogResponse {
51
57
  export interface ProcessTransactionRequest {
52
58
  transaction: Transaction | undefined;
53
59
  }
60
+ export interface ProcessInstructionRequest {
61
+ instruction: Instruction | undefined;
62
+ }
54
63
  export interface ProcessTransactionResponse {
55
64
  result: O11yResult | undefined;
56
65
  }
66
+ export interface ProcessInstructionResponse {
67
+ result: O11yResult | undefined;
68
+ }
57
69
  export interface ProcessBlockRequest {
58
70
  block: Block | undefined;
59
71
  chainId: number;
@@ -71,6 +83,12 @@ export interface Log {
71
83
  export interface Transaction {
72
84
  txHash: string;
73
85
  raw: Uint8Array;
86
+ programAccountId: string;
87
+ }
88
+ export interface Instruction {
89
+ instructionData: string;
90
+ raw: Uint8Array;
91
+ programAccountId: string;
74
92
  }
75
93
  export interface Block {
76
94
  raw: Uint8Array;
@@ -170,6 +188,13 @@ export declare const TransactionHandlerConfig: {
170
188
  toJSON(message: TransactionHandlerConfig): unknown;
171
189
  fromPartial(object: DeepPartial<TransactionHandlerConfig>): TransactionHandlerConfig;
172
190
  };
191
+ export declare const InstructionHandlerConfig: {
192
+ encode(message: InstructionHandlerConfig, writer?: _m0.Writer): _m0.Writer;
193
+ decode(input: _m0.Reader | Uint8Array, length?: number): InstructionHandlerConfig;
194
+ fromJSON(object: any): InstructionHandlerConfig;
195
+ toJSON(message: InstructionHandlerConfig): unknown;
196
+ fromPartial(object: DeepPartial<InstructionHandlerConfig>): InstructionHandlerConfig;
197
+ };
173
198
  export declare const Topic: {
174
199
  encode(message: Topic, writer?: _m0.Writer): _m0.Writer;
175
200
  decode(input: _m0.Reader | Uint8Array, length?: number): Topic;
@@ -198,6 +223,13 @@ export declare const ProcessTransactionRequest: {
198
223
  toJSON(message: ProcessTransactionRequest): unknown;
199
224
  fromPartial(object: DeepPartial<ProcessTransactionRequest>): ProcessTransactionRequest;
200
225
  };
226
+ export declare const ProcessInstructionRequest: {
227
+ encode(message: ProcessInstructionRequest, writer?: _m0.Writer): _m0.Writer;
228
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProcessInstructionRequest;
229
+ fromJSON(object: any): ProcessInstructionRequest;
230
+ toJSON(message: ProcessInstructionRequest): unknown;
231
+ fromPartial(object: DeepPartial<ProcessInstructionRequest>): ProcessInstructionRequest;
232
+ };
201
233
  export declare const ProcessTransactionResponse: {
202
234
  encode(message: ProcessTransactionResponse, writer?: _m0.Writer): _m0.Writer;
203
235
  decode(input: _m0.Reader | Uint8Array, length?: number): ProcessTransactionResponse;
@@ -205,6 +237,13 @@ export declare const ProcessTransactionResponse: {
205
237
  toJSON(message: ProcessTransactionResponse): unknown;
206
238
  fromPartial(object: DeepPartial<ProcessTransactionResponse>): ProcessTransactionResponse;
207
239
  };
240
+ export declare const ProcessInstructionResponse: {
241
+ encode(message: ProcessInstructionResponse, writer?: _m0.Writer): _m0.Writer;
242
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProcessInstructionResponse;
243
+ fromJSON(object: any): ProcessInstructionResponse;
244
+ toJSON(message: ProcessInstructionResponse): unknown;
245
+ fromPartial(object: DeepPartial<ProcessInstructionResponse>): ProcessInstructionResponse;
246
+ };
208
247
  export declare const ProcessBlockRequest: {
209
248
  encode(message: ProcessBlockRequest, writer?: _m0.Writer): _m0.Writer;
210
249
  decode(input: _m0.Reader | Uint8Array, length?: number): ProcessBlockRequest;
@@ -240,6 +279,13 @@ export declare const Transaction: {
240
279
  toJSON(message: Transaction): unknown;
241
280
  fromPartial(object: DeepPartial<Transaction>): Transaction;
242
281
  };
282
+ export declare const Instruction: {
283
+ encode(message: Instruction, writer?: _m0.Writer): _m0.Writer;
284
+ decode(input: _m0.Reader | Uint8Array, length?: number): Instruction;
285
+ fromJSON(object: any): Instruction;
286
+ toJSON(message: Instruction): unknown;
287
+ fromPartial(object: DeepPartial<Instruction>): Instruction;
288
+ };
243
289
  export declare const Block: {
244
290
  encode(message: Block, writer?: _m0.Writer): _m0.Writer;
245
291
  decode(input: _m0.Reader | Uint8Array, length?: number): Block;
@@ -414,6 +460,26 @@ export declare const ProcessorDefinition: {
414
460
  readonly responseStream: false;
415
461
  readonly options: {};
416
462
  };
463
+ readonly processInstruction: {
464
+ readonly name: "ProcessInstruction";
465
+ readonly requestType: {
466
+ encode(message: ProcessInstructionRequest, writer?: _m0.Writer): _m0.Writer;
467
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProcessInstructionRequest;
468
+ fromJSON(object: any): ProcessInstructionRequest;
469
+ toJSON(message: ProcessInstructionRequest): unknown;
470
+ fromPartial(object: DeepPartial<ProcessInstructionRequest>): ProcessInstructionRequest;
471
+ };
472
+ readonly requestStream: false;
473
+ readonly responseType: {
474
+ encode(message: ProcessInstructionResponse, writer?: _m0.Writer): _m0.Writer;
475
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProcessInstructionResponse;
476
+ fromJSON(object: any): ProcessInstructionResponse;
477
+ toJSON(message: ProcessInstructionResponse): unknown;
478
+ fromPartial(object: DeepPartial<ProcessInstructionResponse>): ProcessInstructionResponse;
479
+ };
480
+ readonly responseStream: false;
481
+ readonly options: {};
482
+ };
417
483
  };
418
484
  };
419
485
  export interface ProcessorServiceImplementation<CallContextExt = {}> {
@@ -423,6 +489,7 @@ export interface ProcessorServiceImplementation<CallContextExt = {}> {
423
489
  processLog(request: ProcessLogRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ProcessLogResponse>>;
424
490
  processTransaction(request: ProcessTransactionRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ProcessTransactionResponse>>;
425
491
  processBlock(request: ProcessBlockRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ProcessBlockResponse>>;
492
+ processInstruction(request: ProcessInstructionRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ProcessInstructionResponse>>;
426
493
  }
427
494
  export interface ProcessorClient<CallOptionsExt = {}> {
428
495
  getConfig(request: DeepPartial<ProcessConfigRequest>, options?: CallOptions & CallOptionsExt): Promise<ProcessConfigResponse>;
@@ -431,6 +498,7 @@ export interface ProcessorClient<CallOptionsExt = {}> {
431
498
  processLog(request: DeepPartial<ProcessLogRequest>, options?: CallOptions & CallOptionsExt): Promise<ProcessLogResponse>;
432
499
  processTransaction(request: DeepPartial<ProcessTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<ProcessTransactionResponse>;
433
500
  processBlock(request: DeepPartial<ProcessBlockRequest>, options?: CallOptions & CallOptionsExt): Promise<ProcessBlockResponse>;
501
+ processInstruction(request: DeepPartial<ProcessInstructionRequest>, options?: CallOptions & CallOptionsExt): Promise<ProcessInstructionResponse>;
434
502
  }
435
503
  declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
436
504
  declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ProcessorDefinition = exports.CounterResult = exports.HistogramResult = exports.MetricValue = exports.RecordMetaData_LabelsEntry = exports.RecordMetaData = exports.O11yResult = exports.Block = exports.Transaction = exports.Log = exports.LogBinding = exports.ProcessBlockResponse = exports.ProcessBlockRequest = exports.ProcessTransactionResponse = exports.ProcessTransactionRequest = exports.ProcessLogResponse = exports.ProcessLogRequest = exports.Topic = exports.TransactionHandlerConfig = exports.HandlerCondition = exports.LogHandlerConfig = exports.BlockHandlerConfig = exports.ContractInfo = exports.ContractConfig = exports.ProcessConfigResponse = exports.ProcessConfigRequest = exports.ProjectConfig = void 0;
6
+ exports.ProcessorDefinition = exports.CounterResult = exports.HistogramResult = exports.MetricValue = exports.RecordMetaData_LabelsEntry = exports.RecordMetaData = exports.O11yResult = exports.Block = exports.Instruction = exports.Transaction = exports.Log = exports.LogBinding = exports.ProcessBlockResponse = exports.ProcessBlockRequest = exports.ProcessInstructionResponse = exports.ProcessTransactionResponse = exports.ProcessInstructionRequest = exports.ProcessTransactionRequest = exports.ProcessLogResponse = exports.ProcessLogRequest = exports.Topic = exports.InstructionHandlerConfig = exports.TransactionHandlerConfig = exports.HandlerCondition = exports.LogHandlerConfig = exports.BlockHandlerConfig = exports.ContractInfo = exports.ContractConfig = exports.ProcessConfigResponse = exports.ProcessConfigRequest = exports.ProjectConfig = void 0;
7
7
  const long_1 = __importDefault(require("long"));
8
8
  const empty_1 = require("../../google/protobuf/empty");
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
@@ -168,6 +168,8 @@ function createBaseContractConfig() {
168
168
  startBlock: long_1.default.UZERO,
169
169
  endBlock: long_1.default.UZERO,
170
170
  chunkSize: 0,
171
+ transactionConfig: [],
172
+ instructionConfig: [],
171
173
  };
172
174
  }
173
175
  exports.ContractConfig = {
@@ -190,6 +192,12 @@ exports.ContractConfig = {
190
192
  if (message.chunkSize !== 0) {
191
193
  writer.uint32(48).int32(message.chunkSize);
192
194
  }
195
+ for (const v of message.transactionConfig) {
196
+ exports.TransactionHandlerConfig.encode(v, writer.uint32(58).fork()).ldelim();
197
+ }
198
+ for (const v of message.instructionConfig) {
199
+ exports.InstructionHandlerConfig.encode(v, writer.uint32(66).fork()).ldelim();
200
+ }
193
201
  return writer;
194
202
  },
195
203
  decode(input, length) {
@@ -217,6 +225,12 @@ exports.ContractConfig = {
217
225
  case 6:
218
226
  message.chunkSize = reader.int32();
219
227
  break;
228
+ case 7:
229
+ message.transactionConfig.push(exports.TransactionHandlerConfig.decode(reader, reader.uint32()));
230
+ break;
231
+ case 8:
232
+ message.instructionConfig.push(exports.InstructionHandlerConfig.decode(reader, reader.uint32()));
233
+ break;
220
234
  default:
221
235
  reader.skipType(tag & 7);
222
236
  break;
@@ -242,6 +256,12 @@ exports.ContractConfig = {
242
256
  ? long_1.default.fromValue(object.endBlock)
243
257
  : long_1.default.UZERO,
244
258
  chunkSize: isSet(object.chunkSize) ? Number(object.chunkSize) : 0,
259
+ transactionConfig: Array.isArray(object?.transactionConfig)
260
+ ? object.transactionConfig.map((e) => exports.TransactionHandlerConfig.fromJSON(e))
261
+ : [],
262
+ instructionConfig: Array.isArray(object?.instructionConfig)
263
+ ? object.instructionConfig.map((e) => exports.InstructionHandlerConfig.fromJSON(e))
264
+ : [],
245
265
  };
246
266
  },
247
267
  toJSON(message) {
@@ -266,6 +286,18 @@ exports.ContractConfig = {
266
286
  (obj.endBlock = (message.endBlock || long_1.default.UZERO).toString());
267
287
  message.chunkSize !== undefined &&
268
288
  (obj.chunkSize = Math.round(message.chunkSize));
289
+ if (message.transactionConfig) {
290
+ obj.transactionConfig = message.transactionConfig.map((e) => e ? exports.TransactionHandlerConfig.toJSON(e) : undefined);
291
+ }
292
+ else {
293
+ obj.transactionConfig = [];
294
+ }
295
+ if (message.instructionConfig) {
296
+ obj.instructionConfig = message.instructionConfig.map((e) => e ? exports.InstructionHandlerConfig.toJSON(e) : undefined);
297
+ }
298
+ else {
299
+ obj.instructionConfig = [];
300
+ }
269
301
  return obj;
270
302
  },
271
303
  fromPartial(object) {
@@ -289,6 +321,10 @@ exports.ContractConfig = {
289
321
  ? long_1.default.fromValue(object.endBlock)
290
322
  : long_1.default.UZERO;
291
323
  message.chunkSize = object.chunkSize ?? 0;
324
+ message.transactionConfig =
325
+ object.transactionConfig?.map((e) => exports.TransactionHandlerConfig.fromPartial(e)) || [];
326
+ message.instructionConfig =
327
+ object.instructionConfig?.map((e) => exports.InstructionHandlerConfig.fromPartial(e)) || [];
292
328
  return message;
293
329
  },
294
330
  };
@@ -562,6 +598,59 @@ exports.TransactionHandlerConfig = {
562
598
  return message;
563
599
  },
564
600
  };
601
+ function createBaseInstructionHandlerConfig() {
602
+ return { handlerName: "", address: "" };
603
+ }
604
+ exports.InstructionHandlerConfig = {
605
+ encode(message, writer = minimal_1.default.Writer.create()) {
606
+ if (message.handlerName !== "") {
607
+ writer.uint32(10).string(message.handlerName);
608
+ }
609
+ if (message.address !== "") {
610
+ writer.uint32(18).string(message.address);
611
+ }
612
+ return writer;
613
+ },
614
+ decode(input, length) {
615
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
616
+ let end = length === undefined ? reader.len : reader.pos + length;
617
+ const message = createBaseInstructionHandlerConfig();
618
+ while (reader.pos < end) {
619
+ const tag = reader.uint32();
620
+ switch (tag >>> 3) {
621
+ case 1:
622
+ message.handlerName = reader.string();
623
+ break;
624
+ case 2:
625
+ message.address = reader.string();
626
+ break;
627
+ default:
628
+ reader.skipType(tag & 7);
629
+ break;
630
+ }
631
+ }
632
+ return message;
633
+ },
634
+ fromJSON(object) {
635
+ return {
636
+ handlerName: isSet(object.handlerName) ? String(object.handlerName) : "",
637
+ address: isSet(object.address) ? String(object.address) : "",
638
+ };
639
+ },
640
+ toJSON(message) {
641
+ const obj = {};
642
+ message.handlerName !== undefined &&
643
+ (obj.handlerName = message.handlerName);
644
+ message.address !== undefined && (obj.address = message.address);
645
+ return obj;
646
+ },
647
+ fromPartial(object) {
648
+ const message = createBaseInstructionHandlerConfig();
649
+ message.handlerName = object.handlerName ?? "";
650
+ message.address = object.address ?? "";
651
+ return message;
652
+ },
653
+ };
565
654
  function createBaseTopic() {
566
655
  return { hashes: [] };
567
656
  }
@@ -764,6 +853,57 @@ exports.ProcessTransactionRequest = {
764
853
  return message;
765
854
  },
766
855
  };
856
+ function createBaseProcessInstructionRequest() {
857
+ return { instruction: undefined };
858
+ }
859
+ exports.ProcessInstructionRequest = {
860
+ encode(message, writer = minimal_1.default.Writer.create()) {
861
+ if (message.instruction !== undefined) {
862
+ exports.Instruction.encode(message.instruction, writer.uint32(10).fork()).ldelim();
863
+ }
864
+ return writer;
865
+ },
866
+ decode(input, length) {
867
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
868
+ let end = length === undefined ? reader.len : reader.pos + length;
869
+ const message = createBaseProcessInstructionRequest();
870
+ while (reader.pos < end) {
871
+ const tag = reader.uint32();
872
+ switch (tag >>> 3) {
873
+ case 1:
874
+ message.instruction = exports.Instruction.decode(reader, reader.uint32());
875
+ break;
876
+ default:
877
+ reader.skipType(tag & 7);
878
+ break;
879
+ }
880
+ }
881
+ return message;
882
+ },
883
+ fromJSON(object) {
884
+ return {
885
+ instruction: isSet(object.instruction)
886
+ ? exports.Instruction.fromJSON(object.instruction)
887
+ : undefined,
888
+ };
889
+ },
890
+ toJSON(message) {
891
+ const obj = {};
892
+ message.instruction !== undefined &&
893
+ (obj.instruction = message.instruction
894
+ ? exports.Instruction.toJSON(message.instruction)
895
+ : undefined);
896
+ return obj;
897
+ },
898
+ fromPartial(object) {
899
+ const message = createBaseProcessInstructionRequest();
900
+ message.instruction =
901
+ object.instruction !== undefined && object.instruction !== null
902
+ ? exports.Instruction.fromPartial(object.instruction)
903
+ : undefined;
904
+ return message;
905
+ },
906
+ };
767
907
  function createBaseProcessTransactionResponse() {
768
908
  return { result: undefined };
769
909
  }
@@ -815,6 +955,57 @@ exports.ProcessTransactionResponse = {
815
955
  return message;
816
956
  },
817
957
  };
958
+ function createBaseProcessInstructionResponse() {
959
+ return { result: undefined };
960
+ }
961
+ exports.ProcessInstructionResponse = {
962
+ encode(message, writer = minimal_1.default.Writer.create()) {
963
+ if (message.result !== undefined) {
964
+ exports.O11yResult.encode(message.result, writer.uint32(10).fork()).ldelim();
965
+ }
966
+ return writer;
967
+ },
968
+ decode(input, length) {
969
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
970
+ let end = length === undefined ? reader.len : reader.pos + length;
971
+ const message = createBaseProcessInstructionResponse();
972
+ while (reader.pos < end) {
973
+ const tag = reader.uint32();
974
+ switch (tag >>> 3) {
975
+ case 1:
976
+ message.result = exports.O11yResult.decode(reader, reader.uint32());
977
+ break;
978
+ default:
979
+ reader.skipType(tag & 7);
980
+ break;
981
+ }
982
+ }
983
+ return message;
984
+ },
985
+ fromJSON(object) {
986
+ return {
987
+ result: isSet(object.result)
988
+ ? exports.O11yResult.fromJSON(object.result)
989
+ : undefined,
990
+ };
991
+ },
992
+ toJSON(message) {
993
+ const obj = {};
994
+ message.result !== undefined &&
995
+ (obj.result = message.result
996
+ ? exports.O11yResult.toJSON(message.result)
997
+ : undefined);
998
+ return obj;
999
+ },
1000
+ fromPartial(object) {
1001
+ const message = createBaseProcessInstructionResponse();
1002
+ message.result =
1003
+ object.result !== undefined && object.result !== null
1004
+ ? exports.O11yResult.fromPartial(object.result)
1005
+ : undefined;
1006
+ return message;
1007
+ },
1008
+ };
818
1009
  function createBaseProcessBlockRequest() {
819
1010
  return { block: undefined, chainId: 0 };
820
1011
  }
@@ -1025,7 +1216,7 @@ exports.Log = {
1025
1216
  },
1026
1217
  };
1027
1218
  function createBaseTransaction() {
1028
- return { txHash: "", raw: new Uint8Array() };
1219
+ return { txHash: "", raw: new Uint8Array(), programAccountId: "" };
1029
1220
  }
1030
1221
  exports.Transaction = {
1031
1222
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -1035,6 +1226,9 @@ exports.Transaction = {
1035
1226
  if (message.raw.length !== 0) {
1036
1227
  writer.uint32(18).bytes(message.raw);
1037
1228
  }
1229
+ if (message.programAccountId !== "") {
1230
+ writer.uint32(26).string(message.programAccountId);
1231
+ }
1038
1232
  return writer;
1039
1233
  },
1040
1234
  decode(input, length) {
@@ -1050,6 +1244,9 @@ exports.Transaction = {
1050
1244
  case 2:
1051
1245
  message.raw = reader.bytes();
1052
1246
  break;
1247
+ case 3:
1248
+ message.programAccountId = reader.string();
1249
+ break;
1053
1250
  default:
1054
1251
  reader.skipType(tag & 7);
1055
1252
  break;
@@ -1061,6 +1258,9 @@ exports.Transaction = {
1061
1258
  return {
1062
1259
  txHash: isSet(object.txHash) ? String(object.txHash) : "",
1063
1260
  raw: isSet(object.raw) ? bytesFromBase64(object.raw) : new Uint8Array(),
1261
+ programAccountId: isSet(object.programAccountId)
1262
+ ? String(object.programAccountId)
1263
+ : "",
1064
1264
  };
1065
1265
  },
1066
1266
  toJSON(message) {
@@ -1068,12 +1268,83 @@ exports.Transaction = {
1068
1268
  message.txHash !== undefined && (obj.txHash = message.txHash);
1069
1269
  message.raw !== undefined &&
1070
1270
  (obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array()));
1271
+ message.programAccountId !== undefined &&
1272
+ (obj.programAccountId = message.programAccountId);
1071
1273
  return obj;
1072
1274
  },
1073
1275
  fromPartial(object) {
1074
1276
  const message = createBaseTransaction();
1075
1277
  message.txHash = object.txHash ?? "";
1076
1278
  message.raw = object.raw ?? new Uint8Array();
1279
+ message.programAccountId = object.programAccountId ?? "";
1280
+ return message;
1281
+ },
1282
+ };
1283
+ function createBaseInstruction() {
1284
+ return { instructionData: "", raw: new Uint8Array(), programAccountId: "" };
1285
+ }
1286
+ exports.Instruction = {
1287
+ encode(message, writer = minimal_1.default.Writer.create()) {
1288
+ if (message.instructionData !== "") {
1289
+ writer.uint32(10).string(message.instructionData);
1290
+ }
1291
+ if (message.raw.length !== 0) {
1292
+ writer.uint32(18).bytes(message.raw);
1293
+ }
1294
+ if (message.programAccountId !== "") {
1295
+ writer.uint32(26).string(message.programAccountId);
1296
+ }
1297
+ return writer;
1298
+ },
1299
+ decode(input, length) {
1300
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1301
+ let end = length === undefined ? reader.len : reader.pos + length;
1302
+ const message = createBaseInstruction();
1303
+ while (reader.pos < end) {
1304
+ const tag = reader.uint32();
1305
+ switch (tag >>> 3) {
1306
+ case 1:
1307
+ message.instructionData = reader.string();
1308
+ break;
1309
+ case 2:
1310
+ message.raw = reader.bytes();
1311
+ break;
1312
+ case 3:
1313
+ message.programAccountId = reader.string();
1314
+ break;
1315
+ default:
1316
+ reader.skipType(tag & 7);
1317
+ break;
1318
+ }
1319
+ }
1320
+ return message;
1321
+ },
1322
+ fromJSON(object) {
1323
+ return {
1324
+ instructionData: isSet(object.instructionData)
1325
+ ? String(object.instructionData)
1326
+ : "",
1327
+ raw: isSet(object.raw) ? bytesFromBase64(object.raw) : new Uint8Array(),
1328
+ programAccountId: isSet(object.programAccountId)
1329
+ ? String(object.programAccountId)
1330
+ : "",
1331
+ };
1332
+ },
1333
+ toJSON(message) {
1334
+ const obj = {};
1335
+ message.instructionData !== undefined &&
1336
+ (obj.instructionData = message.instructionData);
1337
+ message.raw !== undefined &&
1338
+ (obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array()));
1339
+ message.programAccountId !== undefined &&
1340
+ (obj.programAccountId = message.programAccountId);
1341
+ return obj;
1342
+ },
1343
+ fromPartial(object) {
1344
+ const message = createBaseInstruction();
1345
+ message.instructionData = object.instructionData ?? "";
1346
+ message.raw = object.raw ?? new Uint8Array();
1347
+ message.programAccountId = object.programAccountId ?? "";
1077
1348
  return message;
1078
1349
  },
1079
1350
  };
@@ -1630,6 +1901,14 @@ exports.ProcessorDefinition = {
1630
1901
  responseStream: false,
1631
1902
  options: {},
1632
1903
  },
1904
+ processInstruction: {
1905
+ name: "ProcessInstruction",
1906
+ requestType: exports.ProcessInstructionRequest,
1907
+ requestStream: false,
1908
+ responseType: exports.ProcessInstructionResponse,
1909
+ responseStream: false,
1910
+ options: {},
1911
+ },
1633
1912
  },
1634
1913
  };
1635
1914
  var globalThis = (() => {