@icgio/icg-utils 1.9.30 → 1.9.32
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/lib/influxdb.js +2 -0
- package/lib/utils.js +20 -0
- package/package.json +1 -1
package/lib/influxdb.js
CHANGED
|
@@ -78,6 +78,8 @@ class Influx {
|
|
|
78
78
|
p_temp = p_temp.floatField(field, p.fields[field])
|
|
79
79
|
} else if (field_type === 'integer') {
|
|
80
80
|
p_temp = p_temp.intField(field, p.fields[field])
|
|
81
|
+
} else if (field_type === 'string') {
|
|
82
|
+
p_temp = p_temp.stringField(field, p.fields[field])
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
if (p.timestamp) {
|
package/lib/utils.js
CHANGED
|
@@ -912,6 +912,25 @@ function sort_keys(dict) {
|
|
|
912
912
|
return _.fromPairs(_.sortBy(_.toPairs(dict), (e) => e[0]))
|
|
913
913
|
}
|
|
914
914
|
|
|
915
|
+
function convert_deposit_withdrawal_chain(chain) {
|
|
916
|
+
if (!chain) {
|
|
917
|
+
return null
|
|
918
|
+
}
|
|
919
|
+
chain = chain.toLowerCase()
|
|
920
|
+
|
|
921
|
+
if (['erc20', 'eth', 'ethereum'].includes(chain)) {
|
|
922
|
+
return 'ETH'
|
|
923
|
+
} else if (['bep20', 'bsc', 'bnb', 'bnb smart chain', 'bnb chain'].includes(chain)) {
|
|
924
|
+
return 'BNB'
|
|
925
|
+
} else if (['trc20', 'trx', 'tron'].includes(chain)) {
|
|
926
|
+
return 'TRON'
|
|
927
|
+
} else if (['sol', 'solana'].includes(chain)) {
|
|
928
|
+
return 'SOL'
|
|
929
|
+
} else {
|
|
930
|
+
return chain.toUpperCase()
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
915
934
|
module.exports = {
|
|
916
935
|
ordered_dict,
|
|
917
936
|
random_id,
|
|
@@ -937,4 +956,5 @@ module.exports = {
|
|
|
937
956
|
number_with_commas,
|
|
938
957
|
exchange_cur_quote_cur_converter,
|
|
939
958
|
sort_keys,
|
|
959
|
+
convert_deposit_withdrawal_chain
|
|
940
960
|
}
|