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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37ac7f6b47ec227db52fcd1b884eaad186126dcba3ddf7ec88f4f9ab489ccf15
4
- data.tar.gz: 12d9366aec9a7e1325c6dd4d229136d4364e88b69f1f2619fad581a17b613e4f
3
+ metadata.gz: 2bdb0eedf31d8f78a873c37e69813f0787d800ad873303cdb620a9125f0b55fe
4
+ data.tar.gz: 620405ba10335f52bee78be5daba2ab5814b1cd993e5bd787b3b57b964c5d099
5
5
  SHA512:
6
- metadata.gz: d546d2261d6be7e39452fca60141c5f1a65db6422161b07dc11a6db64349c2c2211aa655c6c40be710cfbc5e58f3d63b9f8748d8fd890f55d83f2ea0c0e39765
7
- data.tar.gz: b420d85ca3009e5b8ad0f49b4d6b7fe37cff4ff1b0e84756ee65486939a25b4499da2b47383a6d082c846843f1ccc724e83cb0539278180c574081e27d19f4d8
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: format_trc20_balance(token['balance'], (token['token_decimal'] || 6).to_i),
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
- def format_trc20_balance(balance_str, decimals)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # lib/tron/version.rb
4
4
  module Tron
5
- VERSION = "1.0.7".freeze
5
+ VERSION = "1.0.8".freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tron.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Your Name