@stellar-expert/tx-meta-effects-parser 5.2.0 → 5.3.0
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
|
@@ -115,7 +115,7 @@ class EventsAnalyzer {
|
|
|
115
115
|
}
|
|
116
116
|
break
|
|
117
117
|
//handle standard token contract events
|
|
118
|
-
//see https://github.com/stellar/rs-soroban-sdk/blob/
|
|
118
|
+
//see https://github.com/stellar/rs-soroban-sdk/blob/main/soroban-sdk/src/token.rs
|
|
119
119
|
case 'transfer': {
|
|
120
120
|
if (!matchEventTopicsShape(topics, ['address', 'address', 'str?']))
|
|
121
121
|
return
|
|
@@ -212,6 +212,19 @@ class EventsAnalyzer {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
break
|
|
215
|
+
case 'set_admin': {
|
|
216
|
+
if (!matchEventTopicsShape(topics, ['address', 'str?']))
|
|
217
|
+
return //throw new Error('Non-standard event')
|
|
218
|
+
const currentAdmin = xdrParseScVal(topics[1])
|
|
219
|
+
const newAdmin = processEventBodyValue(body.data())
|
|
220
|
+
if (!this.matchInvocationEffect(e => e.function === 'set_admin' && matchArrays([currentAdmin, newAdmin], [this.effectsAnalyzer.source, e.args])))
|
|
221
|
+
return
|
|
222
|
+
this.effectsAnalyzer.setAdmin(contractId, newAdmin)
|
|
223
|
+
if (topics.length > 2) {
|
|
224
|
+
mapSacContract(this.effectsAnalyzer, contractId, xdrParseAsset(xdrParseScVal(topics[2])))
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
break
|
|
215
228
|
/*case 'approve': { //TODO: think about processing this effect
|
|
216
229
|
if (!matchEventTopicsShape(topics, ['address', 'address', 'str?']))
|
|
217
230
|
throw new Error('Non-standard event')
|
package/src/effects-analyzer.js
CHANGED
|
@@ -375,6 +375,15 @@ class EffectsAnalyzer {
|
|
|
375
375
|
restoreFootprint() {
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
+
setAdmin(contractId, newAdmin) {
|
|
379
|
+
const effect = {
|
|
380
|
+
type: effectTypes.contractUpdated,
|
|
381
|
+
contract: contractId,
|
|
382
|
+
admin: newAdmin
|
|
383
|
+
}
|
|
384
|
+
this.addEffect(effect)
|
|
385
|
+
}
|
|
386
|
+
|
|
378
387
|
processDexOperationEffects() {
|
|
379
388
|
//process trades first
|
|
380
389
|
for (const claimedOffer of this.result.claimedOffers) {
|