@sentio/runtime 2.54.0-rc.1 → 2.54.0-rc.11
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-PSAWYB4F.js +131 -0
- package/lib/{chunk-TFBOZ4CH.js.map → chunk-PSAWYB4F.js.map} +1 -1
- package/lib/index.d.ts +11 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/processor-runner.js +38 -38
- package/lib/processor-runner.js.map +1 -1
- package/package.json +1 -1
- package/src/full-service.ts +26 -5
- package/src/gen/processor/protos/processor.ts +385 -9
- package/src/gen/service/common/protos/common.ts +255 -10
- package/src/utils.ts +55 -0
- package/lib/chunk-TFBOZ4CH.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'
|
@@ -21,6 +19,9 @@ import fs from 'fs-extra'
|
|
21
19
|
import path from 'path'
|
22
20
|
import os from 'os'
|
23
21
|
import { GLOBAL_CONFIG } from './global-config.js'
|
22
|
+
import { compareSemver } from './utils.js'
|
23
|
+
|
24
|
+
const require = createRequire(import.meta.url)
|
24
25
|
|
25
26
|
function locatePackageJson(pkgId: string) {
|
26
27
|
const m = require.resolve(pkgId)
|
@@ -34,6 +35,7 @@ function locatePackageJson(pkgId: string) {
|
|
34
35
|
}
|
35
36
|
|
36
37
|
export class FullProcessorServiceImpl implements ProcessorServiceImplementation {
|
38
|
+
private sdkVersion: string
|
37
39
|
constructor(instance: ProcessorServiceImplementation) {
|
38
40
|
this.instance = instance
|
39
41
|
const sdkPackageJson = locatePackageJson('@sentio/sdk')
|
@@ -43,10 +45,12 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
43
45
|
|
44
46
|
const version = sdkPackageJson.version.split('.')
|
45
47
|
this.sdkMinorVersion = parseInt(version[1])
|
48
|
+
this.sdkVersion = sdkPackageJson.version
|
46
49
|
}
|
47
50
|
|
48
51
|
instance: ProcessorServiceImplementation
|
49
52
|
sdkMinorVersion: number
|
53
|
+
semver: string
|
50
54
|
|
51
55
|
async getConfig(request: ProcessConfigRequest, context: CallContext) {
|
52
56
|
const config = await this.instance.getConfig(request, context)
|
@@ -129,6 +133,23 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
129
133
|
return
|
130
134
|
}
|
131
135
|
switch (dataBinding.handlerType) {
|
136
|
+
case HandlerType.FUEL_TRANSACTION:
|
137
|
+
if (compareSemver(this.sdkVersion, '2.54.0-rc.7') < 0) {
|
138
|
+
dataBinding.handlerType = HandlerType.FUEL_CALL
|
139
|
+
if (dataBinding.data) {
|
140
|
+
dataBinding.data.fuelCall = dataBinding.data?.fuelTransaction
|
141
|
+
}
|
142
|
+
}
|
143
|
+
break
|
144
|
+
case HandlerType.FUEL_RECEIPT:
|
145
|
+
if (compareSemver(this.sdkVersion, '2.54.0-rc.7') < 0) {
|
146
|
+
dataBinding.handlerType = HandlerType.FUEL_CALL
|
147
|
+
if (dataBinding.data) {
|
148
|
+
dataBinding.data.fuelCall = dataBinding.data?.fuelLog
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
break
|
132
153
|
case HandlerType.APT_EVENT:
|
133
154
|
if (dataBinding.data?.aptEvent) {
|
134
155
|
if (dataBinding.data.aptEvent.rawTransaction && !dataBinding.data.aptEvent.transaction) {
|