@stellar-expert/tx-meta-effects-parser 5.0.2 → 5.0.4
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 +1 -1
- package/src/index.js +6 -2
- package/src/tx-xdr-parser-utils.js +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -110,8 +110,12 @@ function parseTxOperationsMeta({network, tx, result, meta}) {
|
|
|
110
110
|
effect.source = (before || after).address
|
|
111
111
|
res.effects.push(effect)
|
|
112
112
|
}
|
|
113
|
-
if (before.balance !== after.balance) { //
|
|
114
|
-
|
|
113
|
+
if (isFeeBump && before.balance !== after.balance) { //fee bump fee calculation bug
|
|
114
|
+
const currentFee = BigInt(feeEffect.charged)
|
|
115
|
+
const diff = BigInt(after.balance) - BigInt(before.balance)
|
|
116
|
+
if (diff < currentFee) { // do not allow negative fee
|
|
117
|
+
feeEffect.charged = (currentFee - diff).toString()
|
|
118
|
+
}
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
const metaValue = meta.value()
|
|
@@ -47,7 +47,7 @@ function xdrParseAccountAddress(accountId, muxedAccountsSupported = false) {
|
|
|
47
47
|
throw new TxMetaEffectParserError(`Unsupported account type: ${accountId.arm()}`)
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
if (accountId instanceof
|
|
50
|
+
if (accountId instanceof Uint8Array) {
|
|
51
51
|
return StrKey.encodeEd25519PublicKey(accountId)
|
|
52
52
|
}
|
|
53
53
|
throw new TypeError(`Failed to identify and parse account address: ${accountId}`)
|