tron.rb 1.0.7 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/tron/services/balance.rb +2 -12
- data/lib/tron/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bdb0eedf31d8f78a873c37e69813f0787d800ad873303cdb620a9125f0b55fe
|
4
|
+
data.tar.gz: 620405ba10335f52bee78be5daba2ab5814b1cd993e5bd787b3b57b964c5d099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b35093ddfd66ae5a09504d63620a48343ce5fd3f8dffdb62a1b33246dbcc2f47856a4c6450ca4a3fcf54898d0566dfd1e771cccd84abf69501758b3174bda877
|
7
|
+
data.tar.gz: b6f757a210af8b72acf3d8e505caf0ae6a47d7bedd7f241e0e0709542ae42d5b4dee5efa5ddf89470a4546f278ed3c096e21b95df01f9b9b4db2ec64f713cc9e
|
@@ -87,7 +87,7 @@ module Tron
|
|
87
87
|
{
|
88
88
|
symbol: token['token_abbr'] || token['token_name'],
|
89
89
|
name: token['token_name'],
|
90
|
-
balance:
|
90
|
+
balance: token['balance'].to_f,
|
91
91
|
decimals: (token['token_decimal'] || 6).to_i,
|
92
92
|
address: token['token_id']
|
93
93
|
}
|
@@ -154,17 +154,7 @@ module Tron
|
|
154
154
|
"#{whole}.#{fraction.to_s.rjust(decimals, '0')}"
|
155
155
|
end
|
156
156
|
|
157
|
-
|
158
|
-
# Convert to float while avoiding scientific notation for small numbers
|
159
|
-
balance = balance_str.to_f
|
160
|
-
|
161
|
-
# Format to avoid scientific notation for small numbers
|
162
|
-
if balance.abs < 1e-4 && balance != 0
|
163
|
-
format("%.#{decimals}f", balance).gsub(/0+$/, '')
|
164
|
-
else
|
165
|
-
balance
|
166
|
-
end
|
167
|
-
end
|
157
|
+
|
168
158
|
|
169
159
|
def api_headers
|
170
160
|
headers = { 'accept' => 'application/json' }
|
data/lib/tron/version.rb
CHANGED