tron.rb 1.0.2 → 1.0.4

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: 68e2df783fb208cc34d8e404c6c93b7fd27aae0066b2f6efec8650c739b5c623
4
- data.tar.gz: a13fae572eaebef060a24485db75d70d4d8a71a5952e62f18624b98926225258
3
+ metadata.gz: be59d0725833375ac579bd873677eb22814a8befb727df0e1ab001834f7d24ef
4
+ data.tar.gz: 8d37550f4418c2a5b7592b86ddd74b0a1eda37b8014d9b93e5edfc337f051cae
5
5
  SHA512:
6
- metadata.gz: f74287a0bd02186a0b8b2b7c4faf62a25fe4ba5e78168da5388855e21d9b3c36e6b5eaeda8d7ea2a787837729971fb033d3174d81352417f3839d043ccc5b275
7
- data.tar.gz: 21779f5695517650257c97719bb8903e4de98d4a0c69157816d2cf71a25420385cdfd9d3c8225f6c037a00cce41fe201f4ecbe75dd1231705d4424fe05f0cd79
6
+ metadata.gz: 71f329e6b189ace240c47daf9b21ee2e47d96a88e1c8dee1123fd112128109999fabc17b335c12d8ddf43c41b5a062b6e5acfbb01e299e22cb7a5d38cfea9d38
7
+ data.tar.gz: 42e4dbab34144d90091569eb66881d24ab42605bc3f69822b2d43e3bdf79a4551db191ba33577d353eac8108ef3fa2f9ad380f72e23d71692e58124b9ce7f8db
data/lib/tron/client.rb CHANGED
@@ -84,7 +84,7 @@ module Tron
84
84
  decimals: 6,
85
85
  address: nil,
86
86
  price_usd: trx_price,
87
- usd_value: trx_price ? (trx_balance * trx_price).round(2) : nil
87
+ usd_value: trx_price ? (trx_balance * trx_price) : nil
88
88
  }
89
89
  end
90
90
 
@@ -94,7 +94,7 @@ module Tron
94
94
 
95
95
  # Get USD price for this token
96
96
  price_usd = price_service.get_token_price_usd(token[:symbol].downcase)
97
- usd_value = price_usd ? (token[:balance] * price_usd).round(2) : nil
97
+ usd_value = price_usd ? (token[:balance] * price_usd) : nil
98
98
 
99
99
  tokens << {
100
100
  symbol: token[:symbol],
@@ -115,7 +115,7 @@ module Tron
115
115
 
116
116
  {
117
117
  address: address,
118
- total_value_usd: total_value_usd.round(2),
118
+ total_value_usd: total_value_usd,
119
119
  tokens: tokens
120
120
  }
121
121
  end
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.2".freeze
5
+ VERSION = "1.0.4".freeze
6
6
  end
data/lib/tron.rb CHANGED
@@ -8,7 +8,12 @@ require_relative 'tron/configuration'
8
8
  module Tron
9
9
  class << self
10
10
  def client
11
- @client ||= Client.new
11
+ @client ||= Client.new(
12
+ api_key: Client.configuration.api_key,
13
+ tronscan_api_key: Client.configuration.tronscan_api_key,
14
+ network: Client.configuration.network,
15
+ timeout: Client.configuration.timeout
16
+ )
12
17
  end
13
18
 
14
19
  def configure(&block)
@@ -16,6 +21,10 @@ module Tron
16
21
  Client.configure(&block)
17
22
  end
18
23
 
24
+ def configuration
25
+ Client.configuration
26
+ end
27
+
19
28
  # Delegate common methods to the default client
20
29
  def method_missing(method, *args, &block)
21
30
  if client.respond_to?(method)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tron.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Your Name
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-17 00:00:00.000000000 Z
11
+ date: 2025-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base58