@sentio/runtime 2.54.0-rc.6 → 2.54.0-rc.8
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-2QIRVPGL.js +131 -0
- package/lib/{chunk-65634Y3V.js.map → chunk-2QIRVPGL.js.map} +1 -1
- package/lib/index.js +1 -1
- package/lib/processor-runner.js +30 -30
- package/lib/processor-runner.js.map +1 -1
- package/package.json +1 -1
- package/src/full-service.ts +22 -5
- package/src/gen/processor/protos/processor.ts +232 -0
- package/src/gen/service/common/protos/common.ts +255 -10
- package/lib/chunk-65634Y3V.js +0 -131
package/package.json
CHANGED
package/src/full-service.ts
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
import { CallContext } from 'nice-grpc'
|
2
2
|
import { createRequire } from 'module'
|
3
|
-
const require = createRequire(import.meta.url)
|
4
|
-
|
5
3
|
// Different than the simple one which
|
6
4
|
import {
|
7
5
|
DataBinding,
|
6
|
+
ExecutionConfig,
|
8
7
|
HandlerType,
|
9
8
|
PreprocessStreamRequest,
|
10
9
|
ProcessBindingsRequest,
|
11
|
-
ProcessStreamRequest,
|
12
10
|
ProcessConfigRequest,
|
13
11
|
ProcessorServiceImplementation,
|
14
|
-
StartRequest,
|
15
12
|
ProcessResult,
|
16
|
-
|
13
|
+
ProcessStreamRequest,
|
14
|
+
StartRequest
|
17
15
|
} from './gen/processor/protos/processor.js'
|
18
16
|
|
19
17
|
import { Empty } from '@sentio/protos'
|
@@ -22,6 +20,8 @@ import path from 'path'
|
|
22
20
|
import os from 'os'
|
23
21
|
import { GLOBAL_CONFIG } from './global-config.js'
|
24
22
|
|
23
|
+
const require = createRequire(import.meta.url)
|
24
|
+
|
25
25
|
function locatePackageJson(pkgId: string) {
|
26
26
|
const m = require.resolve(pkgId)
|
27
27
|
|
@@ -129,6 +129,23 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
129
129
|
return
|
130
130
|
}
|
131
131
|
switch (dataBinding.handlerType) {
|
132
|
+
case HandlerType.FUEL_TRANSACTION:
|
133
|
+
if (this.sdkMinorVersion < 55) {
|
134
|
+
dataBinding.handlerType = HandlerType.FUEL_CALL
|
135
|
+
if (dataBinding.data) {
|
136
|
+
dataBinding.data.fuelCall = dataBinding.data?.fuelTransaction
|
137
|
+
}
|
138
|
+
}
|
139
|
+
break
|
140
|
+
case HandlerType.FUEL_RECEIPT:
|
141
|
+
if (this.sdkMinorVersion < 55) {
|
142
|
+
dataBinding.handlerType = HandlerType.FUEL_CALL
|
143
|
+
if (dataBinding.data) {
|
144
|
+
dataBinding.data.fuelCall = dataBinding.data?.fuelLog
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
break
|
132
149
|
case HandlerType.APT_EVENT:
|
133
150
|
if (dataBinding.data?.aptEvent) {
|
134
151
|
if (dataBinding.data.aptEvent.rawTransaction && !dataBinding.data.aptEvent.transaction) {
|
@@ -215,6 +215,8 @@ export enum HandlerType {
|
|
215
215
|
SUI_OBJECT = 10,
|
216
216
|
SUI_OBJECT_CHANGE = 12,
|
217
217
|
FUEL_CALL = 13,
|
218
|
+
FUEL_RECEIPT = 19,
|
219
|
+
FUEL_TRANSACTION = 20,
|
218
220
|
FUEL_BLOCK = 17,
|
219
221
|
COSMOS_CALL = 14,
|
220
222
|
STARKNET_EVENT = 15,
|
@@ -267,6 +269,12 @@ export function handlerTypeFromJSON(object: any): HandlerType {
|
|
267
269
|
case 13:
|
268
270
|
case "FUEL_CALL":
|
269
271
|
return HandlerType.FUEL_CALL;
|
272
|
+
case 19:
|
273
|
+
case "FUEL_RECEIPT":
|
274
|
+
return HandlerType.FUEL_RECEIPT;
|
275
|
+
case 20:
|
276
|
+
case "FUEL_TRANSACTION":
|
277
|
+
return HandlerType.FUEL_TRANSACTION;
|
270
278
|
case 17:
|
271
279
|
case "FUEL_BLOCK":
|
272
280
|
return HandlerType.FUEL_BLOCK;
|
@@ -319,6 +327,10 @@ export function handlerTypeToJSON(object: HandlerType): string {
|
|
319
327
|
return "SUI_OBJECT_CHANGE";
|
320
328
|
case HandlerType.FUEL_CALL:
|
321
329
|
return "FUEL_CALL";
|
330
|
+
case HandlerType.FUEL_RECEIPT:
|
331
|
+
return "FUEL_RECEIPT";
|
332
|
+
case HandlerType.FUEL_TRANSACTION:
|
333
|
+
return "FUEL_TRANSACTION";
|
322
334
|
case HandlerType.FUEL_BLOCK:
|
323
335
|
return "FUEL_BLOCK";
|
324
336
|
case HandlerType.COSMOS_CALL:
|
@@ -1055,7 +1067,12 @@ export interface Data {
|
|
1055
1067
|
suiCall?: Data_SuiCall | undefined;
|
1056
1068
|
suiObject?: Data_SuiObject | undefined;
|
1057
1069
|
suiObjectChange?: Data_SuiObjectChange | undefined;
|
1070
|
+
fuelLog?:
|
1071
|
+
| Data_FuelReceipt
|
1072
|
+
| undefined;
|
1073
|
+
/** @deprecated */
|
1058
1074
|
fuelCall?: Data_FuelCall | undefined;
|
1075
|
+
fuelTransaction?: Data_FuelTransaction | undefined;
|
1059
1076
|
fuelBlock?: Data_FuelBlock | undefined;
|
1060
1077
|
cosmosCall?: Data_CosmosCall | undefined;
|
1061
1078
|
starknetEvents?: Data_StarknetEvent | undefined;
|
@@ -1145,6 +1162,17 @@ export interface Data_SuiObjectChange {
|
|
1145
1162
|
slot: bigint;
|
1146
1163
|
}
|
1147
1164
|
|
1165
|
+
export interface Data_FuelReceipt {
|
1166
|
+
transaction: { [key: string]: any } | undefined;
|
1167
|
+
timestamp: Date | undefined;
|
1168
|
+
receiptIndex: bigint;
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
export interface Data_FuelTransaction {
|
1172
|
+
transaction: { [key: string]: any } | undefined;
|
1173
|
+
timestamp: Date | undefined;
|
1174
|
+
}
|
1175
|
+
|
1148
1176
|
export interface Data_FuelCall {
|
1149
1177
|
transaction: { [key: string]: any } | undefined;
|
1150
1178
|
timestamp: Date | undefined;
|
@@ -8636,7 +8664,9 @@ function createBaseData(): Data {
|
|
8636
8664
|
suiCall: undefined,
|
8637
8665
|
suiObject: undefined,
|
8638
8666
|
suiObjectChange: undefined,
|
8667
|
+
fuelLog: undefined,
|
8639
8668
|
fuelCall: undefined,
|
8669
|
+
fuelTransaction: undefined,
|
8640
8670
|
fuelBlock: undefined,
|
8641
8671
|
cosmosCall: undefined,
|
8642
8672
|
starknetEvents: undefined,
|
@@ -8686,9 +8716,15 @@ export const Data = {
|
|
8686
8716
|
if (message.suiObjectChange !== undefined) {
|
8687
8717
|
Data_SuiObjectChange.encode(message.suiObjectChange, writer.uint32(106).fork()).ldelim();
|
8688
8718
|
}
|
8719
|
+
if (message.fuelLog !== undefined) {
|
8720
|
+
Data_FuelReceipt.encode(message.fuelLog, writer.uint32(162).fork()).ldelim();
|
8721
|
+
}
|
8689
8722
|
if (message.fuelCall !== undefined) {
|
8690
8723
|
Data_FuelCall.encode(message.fuelCall, writer.uint32(114).fork()).ldelim();
|
8691
8724
|
}
|
8725
|
+
if (message.fuelTransaction !== undefined) {
|
8726
|
+
Data_FuelTransaction.encode(message.fuelTransaction, writer.uint32(170).fork()).ldelim();
|
8727
|
+
}
|
8692
8728
|
if (message.fuelBlock !== undefined) {
|
8693
8729
|
Data_FuelBlock.encode(message.fuelBlock, writer.uint32(146).fork()).ldelim();
|
8694
8730
|
}
|
@@ -8805,6 +8841,13 @@ export const Data = {
|
|
8805
8841
|
|
8806
8842
|
message.suiObjectChange = Data_SuiObjectChange.decode(reader, reader.uint32());
|
8807
8843
|
continue;
|
8844
|
+
case 20:
|
8845
|
+
if (tag !== 162) {
|
8846
|
+
break;
|
8847
|
+
}
|
8848
|
+
|
8849
|
+
message.fuelLog = Data_FuelReceipt.decode(reader, reader.uint32());
|
8850
|
+
continue;
|
8808
8851
|
case 14:
|
8809
8852
|
if (tag !== 114) {
|
8810
8853
|
break;
|
@@ -8812,6 +8855,13 @@ export const Data = {
|
|
8812
8855
|
|
8813
8856
|
message.fuelCall = Data_FuelCall.decode(reader, reader.uint32());
|
8814
8857
|
continue;
|
8858
|
+
case 21:
|
8859
|
+
if (tag !== 170) {
|
8860
|
+
break;
|
8861
|
+
}
|
8862
|
+
|
8863
|
+
message.fuelTransaction = Data_FuelTransaction.decode(reader, reader.uint32());
|
8864
|
+
continue;
|
8815
8865
|
case 18:
|
8816
8866
|
if (tag !== 146) {
|
8817
8867
|
break;
|
@@ -8873,7 +8923,11 @@ export const Data = {
|
|
8873
8923
|
suiObjectChange: isSet(object.suiObjectChange)
|
8874
8924
|
? Data_SuiObjectChange.fromJSON(object.suiObjectChange)
|
8875
8925
|
: undefined,
|
8926
|
+
fuelLog: isSet(object.fuelLog) ? Data_FuelReceipt.fromJSON(object.fuelLog) : undefined,
|
8876
8927
|
fuelCall: isSet(object.fuelCall) ? Data_FuelCall.fromJSON(object.fuelCall) : undefined,
|
8928
|
+
fuelTransaction: isSet(object.fuelTransaction)
|
8929
|
+
? Data_FuelTransaction.fromJSON(object.fuelTransaction)
|
8930
|
+
: undefined,
|
8877
8931
|
fuelBlock: isSet(object.fuelBlock) ? Data_FuelBlock.fromJSON(object.fuelBlock) : undefined,
|
8878
8932
|
cosmosCall: isSet(object.cosmosCall) ? Data_CosmosCall.fromJSON(object.cosmosCall) : undefined,
|
8879
8933
|
starknetEvents: isSet(object.starknetEvents) ? Data_StarknetEvent.fromJSON(object.starknetEvents) : undefined,
|
@@ -8923,9 +8977,15 @@ export const Data = {
|
|
8923
8977
|
if (message.suiObjectChange !== undefined) {
|
8924
8978
|
obj.suiObjectChange = Data_SuiObjectChange.toJSON(message.suiObjectChange);
|
8925
8979
|
}
|
8980
|
+
if (message.fuelLog !== undefined) {
|
8981
|
+
obj.fuelLog = Data_FuelReceipt.toJSON(message.fuelLog);
|
8982
|
+
}
|
8926
8983
|
if (message.fuelCall !== undefined) {
|
8927
8984
|
obj.fuelCall = Data_FuelCall.toJSON(message.fuelCall);
|
8928
8985
|
}
|
8986
|
+
if (message.fuelTransaction !== undefined) {
|
8987
|
+
obj.fuelTransaction = Data_FuelTransaction.toJSON(message.fuelTransaction);
|
8988
|
+
}
|
8929
8989
|
if (message.fuelBlock !== undefined) {
|
8930
8990
|
obj.fuelBlock = Data_FuelBlock.toJSON(message.fuelBlock);
|
8931
8991
|
}
|
@@ -8986,9 +9046,15 @@ export const Data = {
|
|
8986
9046
|
message.suiObjectChange = (object.suiObjectChange !== undefined && object.suiObjectChange !== null)
|
8987
9047
|
? Data_SuiObjectChange.fromPartial(object.suiObjectChange)
|
8988
9048
|
: undefined;
|
9049
|
+
message.fuelLog = (object.fuelLog !== undefined && object.fuelLog !== null)
|
9050
|
+
? Data_FuelReceipt.fromPartial(object.fuelLog)
|
9051
|
+
: undefined;
|
8989
9052
|
message.fuelCall = (object.fuelCall !== undefined && object.fuelCall !== null)
|
8990
9053
|
? Data_FuelCall.fromPartial(object.fuelCall)
|
8991
9054
|
: undefined;
|
9055
|
+
message.fuelTransaction = (object.fuelTransaction !== undefined && object.fuelTransaction !== null)
|
9056
|
+
? Data_FuelTransaction.fromPartial(object.fuelTransaction)
|
9057
|
+
: undefined;
|
8992
9058
|
message.fuelBlock = (object.fuelBlock !== undefined && object.fuelBlock !== null)
|
8993
9059
|
? Data_FuelBlock.fromPartial(object.fuelBlock)
|
8994
9060
|
: undefined;
|
@@ -10276,6 +10342,172 @@ export const Data_SuiObjectChange = {
|
|
10276
10342
|
},
|
10277
10343
|
};
|
10278
10344
|
|
10345
|
+
function createBaseData_FuelReceipt(): Data_FuelReceipt {
|
10346
|
+
return { transaction: undefined, timestamp: undefined, receiptIndex: BigInt("0") };
|
10347
|
+
}
|
10348
|
+
|
10349
|
+
export const Data_FuelReceipt = {
|
10350
|
+
encode(message: Data_FuelReceipt, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
10351
|
+
if (message.transaction !== undefined) {
|
10352
|
+
Struct.encode(Struct.wrap(message.transaction), writer.uint32(10).fork()).ldelim();
|
10353
|
+
}
|
10354
|
+
if (message.timestamp !== undefined) {
|
10355
|
+
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim();
|
10356
|
+
}
|
10357
|
+
if (message.receiptIndex !== BigInt("0")) {
|
10358
|
+
if (BigInt.asIntN(64, message.receiptIndex) !== message.receiptIndex) {
|
10359
|
+
throw new globalThis.Error("value provided for field message.receiptIndex of type int64 too large");
|
10360
|
+
}
|
10361
|
+
writer.uint32(24).int64(message.receiptIndex.toString());
|
10362
|
+
}
|
10363
|
+
return writer;
|
10364
|
+
},
|
10365
|
+
|
10366
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Data_FuelReceipt {
|
10367
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
10368
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
10369
|
+
const message = createBaseData_FuelReceipt();
|
10370
|
+
while (reader.pos < end) {
|
10371
|
+
const tag = reader.uint32();
|
10372
|
+
switch (tag >>> 3) {
|
10373
|
+
case 1:
|
10374
|
+
if (tag !== 10) {
|
10375
|
+
break;
|
10376
|
+
}
|
10377
|
+
|
10378
|
+
message.transaction = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
10379
|
+
continue;
|
10380
|
+
case 2:
|
10381
|
+
if (tag !== 18) {
|
10382
|
+
break;
|
10383
|
+
}
|
10384
|
+
|
10385
|
+
message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
10386
|
+
continue;
|
10387
|
+
case 3:
|
10388
|
+
if (tag !== 24) {
|
10389
|
+
break;
|
10390
|
+
}
|
10391
|
+
|
10392
|
+
message.receiptIndex = longToBigint(reader.int64() as Long);
|
10393
|
+
continue;
|
10394
|
+
}
|
10395
|
+
if ((tag & 7) === 4 || tag === 0) {
|
10396
|
+
break;
|
10397
|
+
}
|
10398
|
+
reader.skipType(tag & 7);
|
10399
|
+
}
|
10400
|
+
return message;
|
10401
|
+
},
|
10402
|
+
|
10403
|
+
fromJSON(object: any): Data_FuelReceipt {
|
10404
|
+
return {
|
10405
|
+
transaction: isObject(object.transaction) ? object.transaction : undefined,
|
10406
|
+
timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
|
10407
|
+
receiptIndex: isSet(object.receiptIndex) ? BigInt(object.receiptIndex) : BigInt("0"),
|
10408
|
+
};
|
10409
|
+
},
|
10410
|
+
|
10411
|
+
toJSON(message: Data_FuelReceipt): unknown {
|
10412
|
+
const obj: any = {};
|
10413
|
+
if (message.transaction !== undefined) {
|
10414
|
+
obj.transaction = message.transaction;
|
10415
|
+
}
|
10416
|
+
if (message.timestamp !== undefined) {
|
10417
|
+
obj.timestamp = message.timestamp.toISOString();
|
10418
|
+
}
|
10419
|
+
if (message.receiptIndex !== BigInt("0")) {
|
10420
|
+
obj.receiptIndex = message.receiptIndex.toString();
|
10421
|
+
}
|
10422
|
+
return obj;
|
10423
|
+
},
|
10424
|
+
|
10425
|
+
create(base?: DeepPartial<Data_FuelReceipt>): Data_FuelReceipt {
|
10426
|
+
return Data_FuelReceipt.fromPartial(base ?? {});
|
10427
|
+
},
|
10428
|
+
fromPartial(object: DeepPartial<Data_FuelReceipt>): Data_FuelReceipt {
|
10429
|
+
const message = createBaseData_FuelReceipt();
|
10430
|
+
message.transaction = object.transaction ?? undefined;
|
10431
|
+
message.timestamp = object.timestamp ?? undefined;
|
10432
|
+
message.receiptIndex = object.receiptIndex ?? BigInt("0");
|
10433
|
+
return message;
|
10434
|
+
},
|
10435
|
+
};
|
10436
|
+
|
10437
|
+
function createBaseData_FuelTransaction(): Data_FuelTransaction {
|
10438
|
+
return { transaction: undefined, timestamp: undefined };
|
10439
|
+
}
|
10440
|
+
|
10441
|
+
export const Data_FuelTransaction = {
|
10442
|
+
encode(message: Data_FuelTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
10443
|
+
if (message.transaction !== undefined) {
|
10444
|
+
Struct.encode(Struct.wrap(message.transaction), writer.uint32(10).fork()).ldelim();
|
10445
|
+
}
|
10446
|
+
if (message.timestamp !== undefined) {
|
10447
|
+
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim();
|
10448
|
+
}
|
10449
|
+
return writer;
|
10450
|
+
},
|
10451
|
+
|
10452
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Data_FuelTransaction {
|
10453
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
10454
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
10455
|
+
const message = createBaseData_FuelTransaction();
|
10456
|
+
while (reader.pos < end) {
|
10457
|
+
const tag = reader.uint32();
|
10458
|
+
switch (tag >>> 3) {
|
10459
|
+
case 1:
|
10460
|
+
if (tag !== 10) {
|
10461
|
+
break;
|
10462
|
+
}
|
10463
|
+
|
10464
|
+
message.transaction = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
10465
|
+
continue;
|
10466
|
+
case 2:
|
10467
|
+
if (tag !== 18) {
|
10468
|
+
break;
|
10469
|
+
}
|
10470
|
+
|
10471
|
+
message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
10472
|
+
continue;
|
10473
|
+
}
|
10474
|
+
if ((tag & 7) === 4 || tag === 0) {
|
10475
|
+
break;
|
10476
|
+
}
|
10477
|
+
reader.skipType(tag & 7);
|
10478
|
+
}
|
10479
|
+
return message;
|
10480
|
+
},
|
10481
|
+
|
10482
|
+
fromJSON(object: any): Data_FuelTransaction {
|
10483
|
+
return {
|
10484
|
+
transaction: isObject(object.transaction) ? object.transaction : undefined,
|
10485
|
+
timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
|
10486
|
+
};
|
10487
|
+
},
|
10488
|
+
|
10489
|
+
toJSON(message: Data_FuelTransaction): unknown {
|
10490
|
+
const obj: any = {};
|
10491
|
+
if (message.transaction !== undefined) {
|
10492
|
+
obj.transaction = message.transaction;
|
10493
|
+
}
|
10494
|
+
if (message.timestamp !== undefined) {
|
10495
|
+
obj.timestamp = message.timestamp.toISOString();
|
10496
|
+
}
|
10497
|
+
return obj;
|
10498
|
+
},
|
10499
|
+
|
10500
|
+
create(base?: DeepPartial<Data_FuelTransaction>): Data_FuelTransaction {
|
10501
|
+
return Data_FuelTransaction.fromPartial(base ?? {});
|
10502
|
+
},
|
10503
|
+
fromPartial(object: DeepPartial<Data_FuelTransaction>): Data_FuelTransaction {
|
10504
|
+
const message = createBaseData_FuelTransaction();
|
10505
|
+
message.transaction = object.transaction ?? undefined;
|
10506
|
+
message.timestamp = object.timestamp ?? undefined;
|
10507
|
+
return message;
|
10508
|
+
},
|
10509
|
+
};
|
10510
|
+
|
10279
10511
|
function createBaseData_FuelCall(): Data_FuelCall {
|
10280
10512
|
return { transaction: undefined, timestamp: undefined };
|
10281
10513
|
}
|