@bithomp/xrpl-api 3.7.23 → 3.7.24
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.
|
@@ -260,18 +260,19 @@ function adjustBalancesForPaymentChannel(balanceChanges, metadata, nativeCurrenc
|
|
|
260
260
|
else {
|
|
261
261
|
unlockedAmount = new bignumber_js_1.default(channelChanges.amount.value).minus(channelChanges?.balance?.value || "0");
|
|
262
262
|
}
|
|
263
|
-
if (unlockedAmount.isZero()) {
|
|
264
|
-
|
|
263
|
+
if (!unlockedAmount.isZero()) {
|
|
264
|
+
adjustBalancesChanges(balanceChanges, channelChanges.source.address, [
|
|
265
|
+
{ currency: channelChanges.amount.currency, value: `-${unlockedAmount.toString()}` },
|
|
266
|
+
]);
|
|
265
267
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
]);
|
|
268
|
+
if (channelChanges.balanceChange) {
|
|
269
|
+
if (channelChanges.source.address !== tx.Account && channelChanges?.balance && channelChanges?.amount) {
|
|
270
|
+
const returnedAmount = new bignumber_js_1.default(channelChanges.amount.value).minus(new bignumber_js_1.default(channelChanges.balance.value));
|
|
271
|
+
if (!returnedAmount.isZero()) {
|
|
272
|
+
adjustBalancesChanges(balanceChanges, channelChanges.source.address, [
|
|
273
|
+
{ currency: channelChanges.amount.currency, value: `-${returnedAmount.toString()}` },
|
|
274
|
+
]);
|
|
275
|
+
}
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
}
|