tron.rb 1.1.4 → 1.1.5
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/client.rb +8 -0
- data/lib/tron/services/transaction.rb +11 -0
- data/lib/tron/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 585ad45b691372d3698239c2bd3ad6c81a2f70409869867fb8e645ccba7aa29c
|
|
4
|
+
data.tar.gz: c45974ccdd37b4ce9ba68d0b395fc03ff08dad33d0997d90665ee376db2dfb0d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b79bee6d4053770cc2f9f2d3fe8971c23a7cc828f59d28364695653f5843be4badab7a6bc0753b715c6ff651ca96dbe9eaaa7a8afb11ce3462e0708ca42bf32a
|
|
7
|
+
data.tar.gz: 39a090312157fe64b22ad82d3c76aac72a9ba2be75279ddd276b29f3e5ec282248d5d15ad76fb90debe4d200b984b6c4aa698f8660a0b076cf8db76b5f6f260b
|
data/lib/tron/client.rb
CHANGED
|
@@ -4,6 +4,7 @@ require_relative 'services/balance'
|
|
|
4
4
|
require_relative 'services/resources'
|
|
5
5
|
require_relative 'services/price'
|
|
6
6
|
require_relative 'services/contract'
|
|
7
|
+
require_relative 'services/transaction'
|
|
7
8
|
|
|
8
9
|
module Tron
|
|
9
10
|
# The main client class for interacting with the TRON blockchain
|
|
@@ -81,6 +82,13 @@ module Tron
|
|
|
81
82
|
@contract_service ||= Services::Contract.new(@configuration)
|
|
82
83
|
end
|
|
83
84
|
|
|
85
|
+
# Returns the transaction service instance
|
|
86
|
+
#
|
|
87
|
+
# @return [Tron::Services::Transaction] the transaction service
|
|
88
|
+
def transaction_service
|
|
89
|
+
@transaction_service ||= Services::Transaction.new(@configuration)
|
|
90
|
+
end
|
|
91
|
+
|
|
84
92
|
# Get wallet balance information including TRX and TRC20 tokens
|
|
85
93
|
#
|
|
86
94
|
# @param address [String] TRON address to check
|
|
@@ -30,6 +30,17 @@ module Tron
|
|
|
30
30
|
broadcast_transaction(signed_tx)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Gets transaction information by transaction ID
|
|
34
|
+
#
|
|
35
|
+
# @param tx_id [String] the transaction ID (txID)
|
|
36
|
+
# @return [Hash] the transaction information from the blockchain
|
|
37
|
+
def get_transaction(tx_id)
|
|
38
|
+
endpoint = "#{@base_url}/wallet/gettransactionbyid"
|
|
39
|
+
payload = { value: tx_id }
|
|
40
|
+
|
|
41
|
+
Utils::HTTP.post(endpoint, payload)
|
|
42
|
+
end
|
|
43
|
+
|
|
33
44
|
private
|
|
34
45
|
|
|
35
46
|
# Signs a transaction locally using the private key
|
data/lib/tron/version.rb
CHANGED
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.1.
|
|
4
|
+
version: 1.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bolo Michelin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base58-alphabets
|