eth 0.5.10 → 0.5.12

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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Ellis
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-01-02 00:00:00.000000000 Z
12
+ date: 2024-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: forwardable
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: keccak
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -45,14 +59,14 @@ dependencies:
45
59
  requirements:
46
60
  - - "~>"
47
61
  - !ruby/object:Gem::Version
48
- version: '5.1'
62
+ version: '6.0'
49
63
  type: :runtime
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - "~>"
54
68
  - !ruby/object:Gem::Version
55
- version: '5.1'
69
+ version: '6.0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: openssl
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -120,6 +134,8 @@ files:
120
134
  - eth.gemspec
121
135
  - lib/eth.rb
122
136
  - lib/eth/abi.rb
137
+ - lib/eth/abi/decoder.rb
138
+ - lib/eth/abi/encoder.rb
123
139
  - lib/eth/abi/event.rb
124
140
  - lib/eth/abi/type.rb
125
141
  - lib/eth/address.rb
@@ -127,7 +143,6 @@ files:
127
143
  - lib/eth/chain.rb
128
144
  - lib/eth/client.rb
129
145
  - lib/eth/client/http.rb
130
- - lib/eth/client/http_auth.rb
131
146
  - lib/eth/client/ipc.rb
132
147
  - lib/eth/constant.rb
133
148
  - lib/eth/contract.rb
@@ -187,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
202
  - !ruby/object:Gem::Version
188
203
  version: '0'
189
204
  requirements: []
190
- rubygems_version: 3.3.25
205
+ rubygems_version: 3.2.32
191
206
  signing_key:
192
207
  specification_version: 4
193
208
  summary: Ruby Ethereum library.
@@ -1,73 +0,0 @@
1
- # Copyright (c) 2016-2023 The Ruby-Eth Contributors
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- require "net/http"
16
-
17
- # Provides the {Eth} module.
18
- module Eth
19
-
20
- # Provides an HTTP/S-RPC client with basic authentication.
21
- class Client::HttpAuth < Client
22
-
23
- # The host of the HTTP endpoint.
24
- attr_reader :host
25
-
26
- # The port of the HTTP endpoint.
27
- attr_reader :port
28
-
29
- # The full URI of the HTTP endpoint, including path.
30
- attr_reader :uri
31
-
32
- # Attribute indicator for SSL.
33
- attr_reader :ssl
34
-
35
- # Attribute for user.
36
- attr_reader :user
37
-
38
- # Constructor for the HTTP Client. Should not be used; use
39
- # {Client.create} intead.
40
- #
41
- # @param host [String] an URI pointing to an HTTP RPC-API.
42
- def initialize(host)
43
- super
44
- uri = URI.parse(host)
45
- raise ArgumentError, "Unable to parse the HTTP-URI!" unless ["http", "https"].include? uri.scheme
46
- @host = uri.host
47
- @port = uri.port
48
- @ssl = uri.scheme == "https"
49
- @user = uri.user
50
- @password = uri.password
51
- @uri = URI("#{uri.scheme}://#{uri.user}:#{uri.password}@#{@host}:#{@port}#{uri.path}")
52
- end
53
-
54
- # Sends an RPC request to the connected HTTP client.
55
- #
56
- # @param payload [Hash] the RPC request parameters.
57
- # @return [String] a JSON-encoded response.
58
- def send(payload)
59
- http = Net::HTTP.new(@host, @port)
60
- http.use_ssl = @ssl
61
- header = { "Content-Type" => "application/json" }
62
- request = Net::HTTP::Post.new(@uri, header)
63
- request.body = payload
64
- response = http.request(request)
65
- response.body
66
- end
67
- end
68
-
69
- private
70
-
71
- # Attribute for password.
72
- attr_reader :password
73
- end