@stellar-expert/tx-meta-effects-parser 7.0.0-rc.15 → 7.0.0-rc.17
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
|
@@ -22,7 +22,7 @@ function parseLedgerEntryChanges(ledgerEntryChanges, filter = undefined) {
|
|
|
22
22
|
let containsTtl = false
|
|
23
23
|
for (let i = 0; i < ledgerEntryChanges.length; i++) {
|
|
24
24
|
const entry = ledgerEntryChanges[i]
|
|
25
|
-
const type = entry._value._arm
|
|
25
|
+
const type = entry._value._arm || entry._value._attributes.data._arm
|
|
26
26
|
if (filter && !filter.has(type)) //skip filtered ledger entry types
|
|
27
27
|
continue
|
|
28
28
|
const action = entry._arm
|
|
@@ -43,7 +43,7 @@ function parseLedgerEntryChanges(ledgerEntryChanges, filter = undefined) {
|
|
|
43
43
|
break
|
|
44
44
|
case 'updated':
|
|
45
45
|
if (type === 'contractCode')
|
|
46
|
-
|
|
46
|
+
console.error(new UnexpectedTxMetaChangeError({type, action})) //happens only in protocol 20
|
|
47
47
|
if (!state && stateData.keyHash) { //likely, restored state
|
|
48
48
|
const restored = changes.find(ch => ch.action === 'restored' && ch.type === stateData.entry && ch.after.keyHash === stateData.keyHash)
|
|
49
49
|
state = restored?.after
|
|
@@ -234,13 +234,15 @@ function parseLiquidityPoolEntry(value) {
|
|
|
234
234
|
|
|
235
235
|
function parseOfferEntry(value) {
|
|
236
236
|
const offerEntryXdr = value.value()
|
|
237
|
+
const rprice = offerEntryXdr.price()
|
|
237
238
|
const data = {
|
|
238
239
|
entry: 'offer',
|
|
239
240
|
id: offerEntryXdr.offerId().toString(),
|
|
240
241
|
account: xdrParseAccountAddress(offerEntryXdr.sellerId()),
|
|
241
242
|
asset: [xdrParseAsset(offerEntryXdr.selling()), xdrParseAsset(offerEntryXdr.buying())],
|
|
242
243
|
amount: offerEntryXdr.amount().toString(),
|
|
243
|
-
price: xdrParsePrice(
|
|
244
|
+
price: xdrParsePrice(rprice),
|
|
245
|
+
rprice,
|
|
244
246
|
flags: offerEntryXdr.flags()
|
|
245
247
|
}
|
|
246
248
|
return data
|