@bithomp/xrpl-api 3.2.13 → 3.2.14
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.
|
@@ -75,7 +75,7 @@ function flipTrustlinePerspective(quantity) {
|
|
|
75
75
|
return {
|
|
76
76
|
address: quantity.balance.issuer,
|
|
77
77
|
balance: {
|
|
78
|
-
issuer: quantity.
|
|
78
|
+
issuer: quantity.balance.issuer,
|
|
79
79
|
currency: quantity.balance.currency,
|
|
80
80
|
value: negatedBalance.toString(),
|
|
81
81
|
counterparty: quantity.address,
|
|
@@ -88,13 +88,25 @@ function parseTrustlineQuantity(node, valueParser) {
|
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
90
|
const fields = lodash_1.default.isEmpty(node.newFields) ? node.finalFields : node.newFields;
|
|
91
|
+
const previousFields = node.previousFields;
|
|
92
|
+
let viewLowest = true;
|
|
93
|
+
if (previousFields && previousFields.Balance && previousFields.Balance.value !== "0") {
|
|
94
|
+
viewLowest = previousFields.Balance.value[0] !== "-";
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
viewLowest = fields.Balance.value[0] !== "-";
|
|
98
|
+
}
|
|
99
|
+
const sign = viewLowest ? 1 : -1;
|
|
100
|
+
const currency = fields.Balance.currency;
|
|
101
|
+
const issuer = viewLowest ? fields.HighLimit.issuer : fields.LowLimit.issuer;
|
|
102
|
+
const holder = viewLowest ? fields.LowLimit.issuer : fields.HighLimit.issuer;
|
|
91
103
|
const result = {
|
|
92
|
-
address:
|
|
104
|
+
address: holder,
|
|
93
105
|
balance: {
|
|
94
|
-
issuer
|
|
95
|
-
currency
|
|
96
|
-
value: value.toString(),
|
|
97
|
-
counterparty:
|
|
106
|
+
issuer,
|
|
107
|
+
currency,
|
|
108
|
+
value: value.times(sign).toString(),
|
|
109
|
+
counterparty: issuer,
|
|
98
110
|
},
|
|
99
111
|
};
|
|
100
112
|
return [result, flipTrustlinePerspective(result)];
|
|
@@ -49,14 +49,25 @@ function parseTrustlineQuantity(node, valueParser) {
|
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
51
|
const fields = lodash_1.default.isEmpty(node.newFields) ? node.finalFields : node.newFields;
|
|
52
|
-
const
|
|
52
|
+
const previousFields = node.previousFields;
|
|
53
|
+
let viewLowest = true;
|
|
54
|
+
if (previousFields && previousFields.Balance && previousFields.Balance.value !== "0") {
|
|
55
|
+
viewLowest = previousFields.Balance.value[0] !== "-";
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
viewLowest = fields.Balance.value[0] !== "-";
|
|
59
|
+
}
|
|
60
|
+
const sign = viewLowest ? 1 : -1;
|
|
61
|
+
const currency = fields.Balance.currency;
|
|
62
|
+
const issuer = viewLowest ? fields.HighLimit.issuer : fields.LowLimit.issuer;
|
|
63
|
+
const holder = viewLowest ? fields.LowLimit.issuer : fields.HighLimit.issuer;
|
|
53
64
|
const result = {
|
|
54
|
-
address:
|
|
65
|
+
address: holder,
|
|
55
66
|
lockedBalance: {
|
|
56
|
-
issuer
|
|
57
|
-
currency
|
|
58
|
-
value: value.toString(),
|
|
59
|
-
counterparty:
|
|
67
|
+
issuer,
|
|
68
|
+
currency,
|
|
69
|
+
value: value.times(sign).toString(),
|
|
70
|
+
counterparty: issuer,
|
|
60
71
|
},
|
|
61
72
|
};
|
|
62
73
|
return [result];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bithomp/xrpl-api",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.14",
|
|
4
4
|
"description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"elliptic": "^6.6.1",
|
|
59
59
|
"lodash": "^4.17.21",
|
|
60
60
|
"ripple-address-codec": "^5.0.0",
|
|
61
|
-
"ripple-binary-codec": "^2.
|
|
62
|
-
"xrpl": "^4.
|
|
61
|
+
"ripple-binary-codec": "^2.3.0",
|
|
62
|
+
"xrpl": "^4.2.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@eslint/eslintrc": "^3.2.0",
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
"@types/lodash": "^4.17.15",
|
|
69
69
|
"@types/mocha": "^10.0.10",
|
|
70
70
|
"@types/nconf": "^0.10.7",
|
|
71
|
-
"@types/node": "^22.13.
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
73
|
-
"@typescript-eslint/parser": "^8.
|
|
71
|
+
"@types/node": "^22.13.4",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
73
|
+
"@typescript-eslint/parser": "^8.24.1",
|
|
74
74
|
"chai": "^4.5.0",
|
|
75
75
|
"chai-as-promised": "^7.1.2",
|
|
76
|
-
"eslint": "^9.20.
|
|
76
|
+
"eslint": "^9.20.1",
|
|
77
77
|
"eslint-config-prettier": "^10.0.1",
|
|
78
78
|
"eslint-plugin-chai-friendly": "^1.0.1",
|
|
79
79
|
"eslint-plugin-import": "^2.31.0",
|