@stellar-expert/tx-meta-effects-parser 7.0.0-rc.1 → 7.0.0-rc.3
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/package.json
CHANGED
|
@@ -304,7 +304,7 @@ function processEventBodyValue(value) {
|
|
|
304
304
|
/*if (innerValue instanceof Array) //handle simple JS arrays
|
|
305
305
|
return innerValue.map(xdrParseScVal)*/
|
|
306
306
|
if (!innerValue) //scVoid
|
|
307
|
-
return
|
|
307
|
+
return null
|
|
308
308
|
return xdrParseScVal(value) //other scValue
|
|
309
309
|
}
|
|
310
310
|
|
package/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const {analyzeSignerChanges} = require('./aggregation/signer-changes-analyzer')
|
|
|
9
9
|
const contractPreimageEncoder = require('./parser/contract-preimage-encoder')
|
|
10
10
|
const xdrParserUtils = require('./parser/tx-xdr-parser-utils')
|
|
11
11
|
const effectTypes = require('./effect-types')
|
|
12
|
+
const events = require('node:events')
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Retrieve effects from transaction execution result metadata
|
|
@@ -139,6 +140,8 @@ function parseTxOperationsMeta({
|
|
|
139
140
|
}
|
|
140
141
|
const metaValue = meta.value()
|
|
141
142
|
const opMeta = metaValue.operations()
|
|
143
|
+
const isV4Meta = meta.arm() === 'v4'
|
|
144
|
+
let txEvents = isV4Meta ? metaValue.events() : undefined
|
|
142
145
|
|
|
143
146
|
//analyze operation effects for each operation
|
|
144
147
|
for (let i = 0; i < parsedTx.operations.length; i++) {
|
|
@@ -155,12 +158,20 @@ function parseTxOperationsMeta({
|
|
|
155
158
|
const isSorobanInvocation = operation.type === 'invokeHostFunction'
|
|
156
159
|
//only for Soroban contract invocation
|
|
157
160
|
if (isSorobanInvocation) {
|
|
158
|
-
const sorobanMeta = metaValue._attributes
|
|
161
|
+
const {sorobanMeta} = metaValue._attributes
|
|
159
162
|
if (sorobanMeta) {
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
if (sorobanMeta.events) {
|
|
164
|
+
params.events = sorobanMeta.events()
|
|
165
|
+
}
|
|
166
|
+
if (sorobanMeta.diagnosticEvents) {
|
|
167
|
+
params.diagnosticEvents = sorobanMeta.diagnosticEvents()
|
|
168
|
+
}
|
|
162
169
|
params.processSystemEvents = processSystemEvents
|
|
163
170
|
}
|
|
171
|
+
if (isV4Meta) {
|
|
172
|
+
params.diagnosticEvents = metaValue.diagnosticEvents()
|
|
173
|
+
params.events = metaValue.operations()[0].events()
|
|
174
|
+
}
|
|
164
175
|
params.mapSac = mapSac
|
|
165
176
|
}
|
|
166
177
|
const analyzer = new EffectsAnalyzer(params)
|