@icgio/icg-utils 1.9.6 → 1.9.8
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/constants/stablecoins.js +1 -1
- package/lib/utils.js +5 -7
- package/package.json +1 -1
package/constants/stablecoins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = ['
|
|
1
|
+
module.exports = ['DAI', 'FEI', 'FRAX', 'GUSD', 'PAX', 'SUSD', 'TUSD', 'USD', 'USDC', 'USDD', 'USDJ', 'USDK', 'USDP', 'USDT']
|
package/lib/utils.js
CHANGED
|
@@ -777,14 +777,12 @@ module.exports.parse_pair = function (pair) {
|
|
|
777
777
|
pair = pair.toUpperCase()
|
|
778
778
|
let time
|
|
779
779
|
;[pair, time] = _.split(pair, '_')
|
|
780
|
-
let result =
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
result = [pair.
|
|
784
|
-
} else if (pair.endsWith('QC')) {
|
|
785
|
-
result = [pair.substr(0, pair.length - 2), pair.substr(pair.length - 2, pair.length)]
|
|
780
|
+
let result = []
|
|
781
|
+
let stablecoin = stablecoins.find((c) => pair.endsWith(c))
|
|
782
|
+
if (stablecoin) {
|
|
783
|
+
result = [pair.slice(0, -stablecoin.length), stablecoin]
|
|
786
784
|
} else {
|
|
787
|
-
result = [pair.
|
|
785
|
+
result = [pair.slice(0, -3), pair.slice(-3)]
|
|
788
786
|
}
|
|
789
787
|
if (time) {
|
|
790
788
|
result[1] += '_' + time
|