solana_rpc_ruby 1.3.0 → 1.3.1
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 +7 -0
 - data/lib/solana_rpc_ruby/helper_methods.rb +6 -5
 - data/lib/solana_rpc_ruby/methods_wrapper.rb +16 -12
 - data/lib/solana_rpc_ruby/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: e9d44c623f36aaad5aeb068bc6b1ca71786bd988068eb97f2e250a176bd10178
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9239493fe02ecf843e0de7bf26898702b1c68d508a21cc8ad98e82f67d21da36
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e01eaeff30dfd9ae82022aa265181a241ea5f0f6ac0910d321dd486e1fad7f3af43ba2fb242123201d61ca003fbf776b41281a7e76299b348c5090d17125597c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a8a49e3b09624652222fad6e02146b81414a5ebb527a2168090f03f051d2f81daac9d7f9a46997fe194327c35fa868807cd95564f73c00c74fa4a778ba3f2705
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -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.try(: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
         
     | 
    
        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: 1.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Block Logic Team
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023-03- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-03-30 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: faye-websocket
         
     |