solana_rpc_ruby 1.3.0 → 2.0.0
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/CHANGELOG.md +12 -0
- data/lib/solana_rpc_ruby/helper_methods.rb +6 -5
- data/lib/solana_rpc_ruby/methods_wrapper.rb +18 -13
- data/lib/solana_rpc_ruby/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38dad501bea927a8b385091626086b55a163627aa45dd53db41fbe406386c8f2
|
4
|
+
data.tar.gz: 0db454403d0df36e44d9b684c146bcdaebb1a51cf2760b604834c2bc513608a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d29c3963c62382852f7ab2261f70184a7807f1e2fb2e0230f30564c0163d1fccd30f27469ee77edaf5cb1ea40e50d6c8e42f73dbcfcfac811d003b47a61fc6b
|
7
|
+
data.tar.gz: 1067d94229ca472a4a17798efe82891633fecbf2f8368f8f9d753053f77a7560a02deca30ae3cd4f9c686c6131fcc643519b9783dc12a6a66bda683c56f36f44
|
data/CHANGELOG.md
CHANGED
@@ -33,3 +33,15 @@
|
|
33
33
|
* Add warns to deprecated methods
|
34
34
|
* Update docs
|
35
35
|
* Small fixes
|
36
|
+
|
37
|
+
## 1.3.0
|
38
|
+
* Upgrade Ruby to v2.7.5
|
39
|
+
* Minor dependency upgrades
|
40
|
+
|
41
|
+
## 1.3.1
|
42
|
+
* Adds supports of maxSupportedTransactionVersion for get_block method
|
43
|
+
|
44
|
+
## 2.0.0
|
45
|
+
* Fix get_transaction when running without encoding parameter
|
46
|
+
* Add support for maxSupportedTransactionVersion for get_transaction
|
47
|
+
* Update ruby to 3.1.4 and bundler to 2.3.26
|
@@ -3,14 +3,15 @@ module SolanaRpcRuby
|
|
3
3
|
module HelperMethods
|
4
4
|
# Checks if the object is nil or empty.
|
5
5
|
#
|
6
|
-
# @param object [String, Array, Hash]
|
6
|
+
# @param object [String, Array, Hash, Integer, NilClass]
|
7
7
|
#
|
8
8
|
# @return [Boolean]
|
9
9
|
def blank?(object)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
unless [String, Array, Hash, Integer, NilClass].include? object.class
|
11
|
+
raise ArgumentError, 'Object must be a String, Array or Hash or Integer or nil class.'
|
12
|
+
end
|
13
|
+
|
14
|
+
object.nil? || (object.respond_to?(:empty?) && object.empty?)
|
14
15
|
end
|
15
16
|
|
16
17
|
# Creates method name to match names required by Solana RPC JSON.
|
@@ -108,22 +108,26 @@ module SolanaRpcRuby
|
|
108
108
|
# @param commitment [String]
|
109
109
|
#
|
110
110
|
# @return [Response, ApiError] Response when success, ApiError on failure.
|
111
|
-
def get_block(slot,
|
112
|
-
|
113
|
-
|
111
|
+
def get_block(slot, params = {})
|
112
|
+
params[:rewards] ||= true
|
113
|
+
params[:max_supported_transaction_version] ||= 0
|
114
114
|
|
115
|
-
|
115
|
+
http_method = :post
|
116
|
+
method = create_method_name(__method__)
|
116
117
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
118
|
+
params_build = {}
|
119
|
+
params_build['encoding'] = params[:encoding] unless blank?(params[:encoding])
|
120
|
+
params_build['transactionDetails'] = params[:transaction_details] unless blank?(params[:transaction_details])
|
121
|
+
params_build['rewards'] = params[:rewards] unless params[:rewards].nil?
|
122
|
+
params_build['commitment'] = params[:commitment] unless blank?(params[:commitment])
|
123
|
+
params_build['maxSupportedTransactionVersion'] =
|
124
|
+
params[:max_supported_transaction_version] unless blank?(params[:max_supported_transaction_version])
|
122
125
|
|
123
|
-
|
124
|
-
|
126
|
+
params_request = []
|
127
|
+
params_request << slot
|
128
|
+
params_request << params_build unless params_build.empty?
|
125
129
|
|
126
|
-
body = create_json_body(method, method_params:
|
130
|
+
body = create_json_body(method, method_params: params_request)
|
127
131
|
|
128
132
|
send_request(body, http_method)
|
129
133
|
end
|
@@ -1109,7 +1113,7 @@ module SolanaRpcRuby
|
|
1109
1113
|
# @param commitment [String]
|
1110
1114
|
#
|
1111
1115
|
# @return [Response, ApiError] Response when success, ApiError on failure.
|
1112
|
-
def get_transaction(transaction_signature, encoding: '', commitment: nil)
|
1116
|
+
def get_transaction(transaction_signature, encoding: '', commitment: nil, max_supported_transaction_version: nil)
|
1113
1117
|
http_method = :post
|
1114
1118
|
method = create_method_name(__method__)
|
1115
1119
|
|
@@ -1118,6 +1122,7 @@ module SolanaRpcRuby
|
|
1118
1122
|
|
1119
1123
|
params_hash['commitment'] = commitment unless blank?(commitment)
|
1120
1124
|
params_hash['encoding'] = encoding unless blank?(encoding)
|
1125
|
+
params_hash['maxSupportedTransactionVersion'] = max_supported_transaction_version unless blank?(max_supported_transaction_version)
|
1121
1126
|
|
1122
1127
|
params << transaction_signature
|
1123
1128
|
params << params_hash unless params_hash.empty?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solana_rpc_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Block Logic Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faye-websocket
|
@@ -241,7 +241,7 @@ licenses:
|
|
241
241
|
metadata:
|
242
242
|
documentation_uri: https://www.rubydoc.info/github/Block-Logic/solana-rpc-ruby
|
243
243
|
source_code_uri: https://github.com/Block-Logic/solana-rpc-ruby
|
244
|
-
post_install_message:
|
244
|
+
post_install_message:
|
245
245
|
rdoc_options: []
|
246
246
|
require_paths:
|
247
247
|
- lib
|
@@ -256,8 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
- !ruby/object:Gem::Version
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
260
|
-
signing_key:
|
259
|
+
rubygems_version: 3.3.26
|
260
|
+
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Ruby wrapper for solana JSON RPC API.
|
263
263
|
test_files: []
|