eth 0.4.16 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/codeql.yml +15 -5
- data/.github/workflows/docs.yml +26 -0
- data/.github/workflows/spec.yml +52 -0
- data/.gitignore +24 -24
- data/.gitmodules +3 -3
- data/.yardopts +1 -0
- data/AUTHORS.txt +21 -0
- data/CHANGELOG.md +65 -10
- data/Gemfile +13 -2
- data/LICENSE.txt +202 -22
- data/README.md +199 -74
- data/bin/console +4 -4
- data/bin/setup +5 -4
- data/eth.gemspec +34 -29
- data/lib/eth/abi/type.rb +178 -0
- data/lib/eth/abi.rb +396 -0
- data/lib/eth/address.rb +55 -11
- data/lib/eth/api.rb +223 -0
- data/lib/eth/chain.rb +151 -0
- data/lib/eth/client/http.rb +63 -0
- data/lib/eth/client/ipc.rb +47 -0
- data/lib/eth/client.rb +232 -0
- data/lib/eth/constant.rb +71 -0
- data/lib/eth/eip712.rb +184 -0
- data/lib/eth/key/decrypter.rb +121 -88
- data/lib/eth/key/encrypter.rb +178 -99
- data/lib/eth/key.rb +136 -48
- data/lib/eth/rlp/decoder.rb +109 -0
- data/lib/eth/rlp/encoder.rb +78 -0
- data/lib/eth/rlp/sedes/big_endian_int.rb +66 -0
- data/lib/eth/rlp/sedes/binary.rb +97 -0
- data/lib/eth/rlp/sedes/list.rb +84 -0
- data/lib/eth/rlp/sedes.rb +74 -0
- data/lib/eth/rlp.rb +63 -0
- data/lib/eth/signature.rb +163 -0
- data/lib/eth/tx/eip1559.rb +336 -0
- data/lib/eth/tx/eip2930.rb +328 -0
- data/lib/eth/tx/legacy.rb +296 -0
- data/lib/eth/tx.rb +273 -143
- data/lib/eth/unit.rb +49 -0
- data/lib/eth/util.rb +235 -0
- data/lib/eth/version.rb +18 -1
- data/lib/eth.rb +33 -67
- metadata +50 -85
- data/.github/workflows/build.yml +0 -26
- data/lib/eth/gas.rb +0 -9
- data/lib/eth/open_ssl.rb +0 -264
- data/lib/eth/secp256k1.rb +0 -7
- data/lib/eth/sedes.rb +0 -40
- data/lib/eth/utils.rb +0 -130
data/lib/eth/util.rb
ADDED
@@ -0,0 +1,235 @@
|
|
1
|
+
# Copyright (c) 2016-2022 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 "digest/keccak"
|
16
|
+
|
17
|
+
# Provides the {Eth} module.
|
18
|
+
module Eth
|
19
|
+
|
20
|
+
# Defines handy tools for the {Eth} gem for convenience.
|
21
|
+
module Util
|
22
|
+
extend self
|
23
|
+
|
24
|
+
# Generates an Ethereum address from a given compressed or
|
25
|
+
# uncompressed binary or hexadecimal public key string.
|
26
|
+
#
|
27
|
+
# @param str [String] the public key to be converted.
|
28
|
+
# @return [Eth::Address] an Ethereum address.
|
29
|
+
def public_key_to_address(str)
|
30
|
+
str = hex_to_bin str if is_hex? str
|
31
|
+
bytes = keccak256(str[1..-1])[-20..-1]
|
32
|
+
Address.new bin_to_prefixed_hex bytes
|
33
|
+
end
|
34
|
+
|
35
|
+
# Hashes a string with the Keccak-256 algorithm.
|
36
|
+
#
|
37
|
+
# @param str [String] a string to be hashed.
|
38
|
+
# @return [String] a Keccak-256 hash of the given string.
|
39
|
+
def keccak256(str)
|
40
|
+
Digest::Keccak.new(256).digest str
|
41
|
+
end
|
42
|
+
|
43
|
+
# Unpacks a binary string to a hexa-decimal string.
|
44
|
+
#
|
45
|
+
# @param bin [String] a binary string to be unpacked.
|
46
|
+
# @return [String] a hexa-decimal string.
|
47
|
+
# @raise [TypeError] if value is not a string.
|
48
|
+
def bin_to_hex(bin)
|
49
|
+
raise TypeError, "Value must be an instance of String" unless bin.instance_of? String
|
50
|
+
bin.unpack("H*").first
|
51
|
+
end
|
52
|
+
|
53
|
+
# Packs a hexa-decimal string into a binary string. Also works with
|
54
|
+
# `0x`-prefixed strings.
|
55
|
+
#
|
56
|
+
# @param hex [String] a hexa-decimal string to be packed.
|
57
|
+
# @return [String] a packed binary string.
|
58
|
+
# @raise [TypeError] if value is not a string or string is not hex.
|
59
|
+
def hex_to_bin(hex)
|
60
|
+
raise TypeError, "Value must be an instance of String" unless hex.instance_of? String
|
61
|
+
hex = remove_hex_prefix hex
|
62
|
+
raise TypeError, "Non-hexadecimal digit found" unless is_hex? hex
|
63
|
+
[hex].pack("H*")
|
64
|
+
end
|
65
|
+
|
66
|
+
# Prefixes a hexa-decimal string with `0x`.
|
67
|
+
#
|
68
|
+
# @param hex [String] a hex-string to be prefixed.
|
69
|
+
# @return [String] a prefixed hex-string.
|
70
|
+
def prefix_hex(hex)
|
71
|
+
return hex if is_prefixed? hex
|
72
|
+
return "0x#{hex}"
|
73
|
+
end
|
74
|
+
|
75
|
+
# Removes the `0x` prefix of a hexa-decimal string.
|
76
|
+
#
|
77
|
+
# @param hex [String] a prefixed hex-string.
|
78
|
+
# @return [String] an unprefixed hex-string.
|
79
|
+
def remove_hex_prefix(hex)
|
80
|
+
return hex[2..-1] if is_prefixed? hex
|
81
|
+
return hex
|
82
|
+
end
|
83
|
+
|
84
|
+
# Unpacks a binary string to a prefixed hexa-decimal string.
|
85
|
+
#
|
86
|
+
# @param bin [String] a binary string to be unpacked.
|
87
|
+
# @return [String] a prefixed hexa-decimal string.
|
88
|
+
def bin_to_prefixed_hex(bin)
|
89
|
+
prefix_hex bin_to_hex bin
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks if a string is hex-adecimal.
|
93
|
+
#
|
94
|
+
# @param str [String] a string to be checked.
|
95
|
+
# @return [String] a match if true; `nil` if not.
|
96
|
+
def is_hex?(str)
|
97
|
+
return false unless str.is_a? String
|
98
|
+
str = remove_hex_prefix str
|
99
|
+
str.match /\A[0-9a-fA-F]*\z/
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks if a string is prefixed with `0x`.
|
103
|
+
#
|
104
|
+
# @param hex [String] a string to be checked.
|
105
|
+
# @return [String] a match if true; `nil` if not.
|
106
|
+
def is_prefixed?(hex)
|
107
|
+
hex.match /\A0x/
|
108
|
+
end
|
109
|
+
|
110
|
+
# Serializes an unsigned integer to big endian.
|
111
|
+
#
|
112
|
+
# @param num [Integer] unsigned integer to be serialized.
|
113
|
+
# @return [String] serialized big endian integer string.
|
114
|
+
# @raise [ArgumentError] if unsigned integer is out of bounds.
|
115
|
+
def serialize_int_to_big_endian(num)
|
116
|
+
num = num.to_i(16) if is_hex? num
|
117
|
+
unless num.is_a? Integer and num >= 0 and num <= Constant::UINT_MAX
|
118
|
+
raise ArgumentError, "Integer invalid or out of range: #{num}"
|
119
|
+
end
|
120
|
+
Rlp::Sedes.big_endian_int.serialize num
|
121
|
+
end
|
122
|
+
|
123
|
+
# Converts an integer to big endian.
|
124
|
+
#
|
125
|
+
# @param num [Integer] integer to be converted.
|
126
|
+
# @return [String] packed, big-endian integer string.
|
127
|
+
def int_to_big_endian(num)
|
128
|
+
hex = num.to_s(16) unless is_hex? num
|
129
|
+
hex = "0#{hex}" if hex.size.odd?
|
130
|
+
hex_to_bin hex
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes big endian data string to integer.
|
134
|
+
#
|
135
|
+
# @param str [String] serialized big endian integer string.
|
136
|
+
# @return [Integer] an deserialized unsigned integer.
|
137
|
+
def deserialize_big_endian_to_int(str)
|
138
|
+
Rlp::Sedes.big_endian_int.deserialize str.sub(/\A(\x00)+/, "")
|
139
|
+
end
|
140
|
+
|
141
|
+
# Converts a big endian to an interger.
|
142
|
+
#
|
143
|
+
# @param str [String] big endian to be converted.
|
144
|
+
# @return [Integer] an unpacked integer number.
|
145
|
+
def big_endian_to_int(str)
|
146
|
+
str.unpack("H*").first.to_i(16)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Converts a binary string to bytes.
|
150
|
+
#
|
151
|
+
# @param str [String] binary string to be converted.
|
152
|
+
# @return [Object] the string bytes.
|
153
|
+
def str_to_bytes(str)
|
154
|
+
is_bytes?(str) ? str : str.b
|
155
|
+
end
|
156
|
+
|
157
|
+
# Converts bytes to a binary string.
|
158
|
+
#
|
159
|
+
# @param bin [Object] bytes to be converted.
|
160
|
+
# @return [String] a packed binary string.
|
161
|
+
def bytes_to_str(bin)
|
162
|
+
bin.unpack("U*").pack("U*")
|
163
|
+
end
|
164
|
+
|
165
|
+
# Checks if a string is a byte-string.
|
166
|
+
#
|
167
|
+
# @param str [String] a string to check.
|
168
|
+
# @return [Boolean] true if it's an ASCII-8bit encoded byte-string.
|
169
|
+
def is_bytes?(str)
|
170
|
+
str && str.instance_of?(String) && str.encoding.name == Constant::BINARY_ENCODING
|
171
|
+
end
|
172
|
+
|
173
|
+
# Checks if the given item is a string primitive.
|
174
|
+
#
|
175
|
+
# @param item [Object] the item to check.
|
176
|
+
# @return [Boolean] true if it's a string primitive.
|
177
|
+
def is_primitive?(item)
|
178
|
+
item.instance_of?(String)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Checks if the given item is a list.
|
182
|
+
#
|
183
|
+
# @param item [Object] the item to check.
|
184
|
+
# @return [Boolean] true if it's a list.
|
185
|
+
def is_list?(item)
|
186
|
+
!is_primitive?(item) && item.respond_to?(:each)
|
187
|
+
end
|
188
|
+
|
189
|
+
# Ceil and integer to the next multiple of 32 bytes.
|
190
|
+
#
|
191
|
+
# @param num [Integer] the number to ciel up.
|
192
|
+
# @return [Integer] the ceiled to 32 integer.
|
193
|
+
def ceil32(num)
|
194
|
+
num % 32 == 0 ? num : (num + 32 - num % 32)
|
195
|
+
end
|
196
|
+
|
197
|
+
# Left-pad a number with a symbol.
|
198
|
+
#
|
199
|
+
# @param str [String] a serialized string to be padded.
|
200
|
+
# @param sym [String] a symbol used for left-padding.
|
201
|
+
# @param len [Integer] number of symbols for the final string.
|
202
|
+
# @return [String] a left-padded serialized string of wanted size.
|
203
|
+
def lpad(str, sym, len)
|
204
|
+
return str if str.size >= len
|
205
|
+
sym * (len - str.size) + str
|
206
|
+
end
|
207
|
+
|
208
|
+
# Left-pad a serialized string with zeros.
|
209
|
+
#
|
210
|
+
# @param str [String] a serialized string to be padded.
|
211
|
+
# @param len [Integer] number of symbols for the final string.
|
212
|
+
# @return [String] a zero-padded serialized string of wanted size.
|
213
|
+
def zpad(str, len)
|
214
|
+
lpad str, Constant::BYTE_ZERO, len
|
215
|
+
end
|
216
|
+
|
217
|
+
# Left-pad a hex number with zeros.
|
218
|
+
#
|
219
|
+
# @param hex [String] a hex-string to be padded.
|
220
|
+
# @param len [Integer] number of symbols for the final string.
|
221
|
+
# @return [String] a zero-padded serialized string of wanted size.
|
222
|
+
def zpad_hex(hex, len = 32)
|
223
|
+
zpad hex_to_bin(hex), len
|
224
|
+
end
|
225
|
+
|
226
|
+
# Left-pad an unsigned integer with zeros.
|
227
|
+
#
|
228
|
+
# @param num [Integer] an unsigned integer to be padded.
|
229
|
+
# @param len [Integer] number of symbols for the final string.
|
230
|
+
# @return [String] a zero-padded serialized string of wanted size.
|
231
|
+
def zpad_int(num, len = 32)
|
232
|
+
zpad serialize_int_to_big_endian(num), len
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
data/lib/eth/version.rb
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
# Copyright (c) 2016-2022 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
|
+
# Provides the {Eth} module.
|
1
16
|
module Eth
|
2
|
-
|
17
|
+
|
18
|
+
# Defines the version of the {Eth} module.
|
19
|
+
VERSION = "0.5.1".freeze
|
3
20
|
end
|
data/lib/eth.rb
CHANGED
@@ -1,69 +1,35 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# Copyright (c) 2016-2022 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
|
+
# Provides the {Eth} module.
|
6
16
|
module Eth
|
7
|
-
BYTE_ZERO = "\x00".freeze
|
8
|
-
UINT_MAX = 2**256 - 1
|
9
|
-
|
10
|
-
autoload :Address, 'eth/address'
|
11
|
-
autoload :Gas, 'eth/gas'
|
12
|
-
autoload :Key, 'eth/key'
|
13
|
-
autoload :OpenSsl, 'eth/open_ssl'
|
14
|
-
autoload :Secp256k1, 'eth/secp256k1'
|
15
|
-
autoload :Sedes, 'eth/sedes'
|
16
|
-
autoload :Tx, 'eth/tx'
|
17
|
-
autoload :Utils, 'eth/utils'
|
18
|
-
|
19
|
-
class << self
|
20
|
-
def configure
|
21
|
-
yield(configuration)
|
22
|
-
end
|
23
|
-
|
24
|
-
def replayable_chain_id
|
25
|
-
27
|
26
|
-
end
|
27
|
-
|
28
|
-
def chain_id
|
29
|
-
configuration.chain_id
|
30
|
-
end
|
31
|
-
|
32
|
-
def v_base
|
33
|
-
replayable_chain_id
|
34
|
-
end
|
35
|
-
|
36
|
-
def replayable_v?(v)
|
37
|
-
[replayable_chain_id, replayable_chain_id + 1].include? v
|
38
|
-
end
|
39
|
-
|
40
|
-
def tx_data_hex?
|
41
|
-
!!configuration.tx_data_hex
|
42
|
-
end
|
43
|
-
|
44
|
-
def chain_id_from_signature(signature)
|
45
|
-
return nil if Eth.replayable_v?(signature[:v])
|
46
|
-
|
47
|
-
cid = (signature[:v] - 35) / 2
|
48
|
-
(cid < 1) ? nil : cid
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
def configuration
|
54
|
-
@configuration ||= Configuration.new
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
class Configuration
|
59
|
-
attr_accessor :chain_id, :tx_data_hex
|
60
|
-
|
61
|
-
def initialize
|
62
|
-
self.chain_id = nil
|
63
|
-
self.tx_data_hex = true
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
class ValidationError < StandardError; end
|
68
|
-
class InvalidTransaction < ValidationError; end
|
69
17
|
end
|
18
|
+
|
19
|
+
# Loads the {Eth} module classes.
|
20
|
+
require "eth/abi"
|
21
|
+
require "eth/api"
|
22
|
+
require "eth/address"
|
23
|
+
require "eth/chain"
|
24
|
+
require "eth/constant"
|
25
|
+
require "eth/client"
|
26
|
+
require "eth/client/http"
|
27
|
+
require "eth/client/ipc"
|
28
|
+
require "eth/eip712"
|
29
|
+
require "eth/key"
|
30
|
+
require "eth/rlp"
|
31
|
+
require "eth/signature"
|
32
|
+
require "eth/tx"
|
33
|
+
require "eth/unit"
|
34
|
+
require "eth/util"
|
35
|
+
require "eth/version"
|
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.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Ellis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: keccak
|
@@ -17,56 +17,56 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '1.
|
20
|
+
version: '1.3'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '1.
|
27
|
+
version: '1.3'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: konstructor
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1.
|
34
|
+
version: '1.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1.
|
41
|
+
version: '1.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: rbsecp256k1
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '5.1'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '5.1'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: openssl
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '2.2'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '2.2'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: scrypt
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,63 +81,7 @@ dependencies:
|
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '3.0'
|
84
|
-
|
85
|
-
name: bundler
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '2.2'
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '2.2'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: pry
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - "~>"
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '0.14'
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - "~>"
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '0.14'
|
112
|
-
- !ruby/object:Gem::Dependency
|
113
|
-
name: rake
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - "~>"
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '13.0'
|
119
|
-
type: :development
|
120
|
-
prerelease: false
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - "~>"
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '13.0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: rspec
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - "~>"
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '3.10'
|
133
|
-
type: :development
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '3.10'
|
140
|
-
description: Library to build, parse, and sign Ethereum transactions.
|
84
|
+
description: Library to handle Ethereum accounts, messages, and transactions.
|
141
85
|
email:
|
142
86
|
- email@steveell.is
|
143
87
|
- ruby@q9f.cc
|
@@ -145,11 +89,14 @@ executables: []
|
|
145
89
|
extensions: []
|
146
90
|
extra_rdoc_files: []
|
147
91
|
files:
|
148
|
-
- ".github/workflows/build.yml"
|
149
92
|
- ".github/workflows/codeql.yml"
|
93
|
+
- ".github/workflows/docs.yml"
|
94
|
+
- ".github/workflows/spec.yml"
|
150
95
|
- ".gitignore"
|
151
96
|
- ".gitmodules"
|
152
97
|
- ".rspec"
|
98
|
+
- ".yardopts"
|
99
|
+
- AUTHORS.txt
|
153
100
|
- CHANGELOG.md
|
154
101
|
- Gemfile
|
155
102
|
- LICENSE.txt
|
@@ -159,25 +106,43 @@ files:
|
|
159
106
|
- bin/setup
|
160
107
|
- eth.gemspec
|
161
108
|
- lib/eth.rb
|
109
|
+
- lib/eth/abi.rb
|
110
|
+
- lib/eth/abi/type.rb
|
162
111
|
- lib/eth/address.rb
|
163
|
-
- lib/eth/
|
112
|
+
- lib/eth/api.rb
|
113
|
+
- lib/eth/chain.rb
|
114
|
+
- lib/eth/client.rb
|
115
|
+
- lib/eth/client/http.rb
|
116
|
+
- lib/eth/client/ipc.rb
|
117
|
+
- lib/eth/constant.rb
|
118
|
+
- lib/eth/eip712.rb
|
164
119
|
- lib/eth/key.rb
|
165
120
|
- lib/eth/key/decrypter.rb
|
166
121
|
- lib/eth/key/encrypter.rb
|
167
|
-
- lib/eth/
|
168
|
-
- lib/eth/
|
169
|
-
- lib/eth/
|
122
|
+
- lib/eth/rlp.rb
|
123
|
+
- lib/eth/rlp/decoder.rb
|
124
|
+
- lib/eth/rlp/encoder.rb
|
125
|
+
- lib/eth/rlp/sedes.rb
|
126
|
+
- lib/eth/rlp/sedes/big_endian_int.rb
|
127
|
+
- lib/eth/rlp/sedes/binary.rb
|
128
|
+
- lib/eth/rlp/sedes/list.rb
|
129
|
+
- lib/eth/signature.rb
|
170
130
|
- lib/eth/tx.rb
|
171
|
-
- lib/eth/
|
131
|
+
- lib/eth/tx/eip1559.rb
|
132
|
+
- lib/eth/tx/eip2930.rb
|
133
|
+
- lib/eth/tx/legacy.rb
|
134
|
+
- lib/eth/unit.rb
|
135
|
+
- lib/eth/util.rb
|
172
136
|
- lib/eth/version.rb
|
173
|
-
homepage: https://github.com/
|
137
|
+
homepage: https://github.com/q9f/eth.rb
|
174
138
|
licenses:
|
175
|
-
-
|
139
|
+
- Apache-2.0
|
176
140
|
metadata:
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
141
|
+
bug_tracker_uri: https://github.com/q9f/eth.rb/issues
|
142
|
+
changelog_uri: https://github.com/q9f/eth.rb/blob/main/CHANGELOG.md
|
143
|
+
documentation_uri: https://q9f.github.io/eth.rb/
|
144
|
+
github_repo: https://github.com/q9f/eth.rb
|
145
|
+
source_code_uri: https://github.com/q9f/eth.rb
|
181
146
|
post_install_message:
|
182
147
|
rdoc_options: []
|
183
148
|
require_paths:
|
@@ -186,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
151
|
requirements:
|
187
152
|
- - ">="
|
188
153
|
- !ruby/object:Gem::Version
|
189
|
-
version: '2.
|
154
|
+
version: '2.6'
|
190
155
|
- - "<"
|
191
156
|
- !ruby/object:Gem::Version
|
192
157
|
version: '4.0'
|
@@ -196,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
161
|
- !ruby/object:Gem::Version
|
197
162
|
version: '0'
|
198
163
|
requirements: []
|
199
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.3.5
|
200
165
|
signing_key:
|
201
166
|
specification_version: 4
|
202
|
-
summary:
|
167
|
+
summary: Ruby Ethereum library.
|
203
168
|
test_files: []
|
data/.github/workflows/build.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Build
|
3
|
-
|
4
|
-
on:
|
5
|
-
pull_request:
|
6
|
-
branches:
|
7
|
-
- develop
|
8
|
-
push:
|
9
|
-
branches:
|
10
|
-
- develop
|
11
|
-
|
12
|
-
jobs:
|
13
|
-
build:
|
14
|
-
runs-on: ubuntu-latest
|
15
|
-
steps:
|
16
|
-
- uses: actions/checkout@v2
|
17
|
-
- uses: ruby/setup-ruby@v1
|
18
|
-
with:
|
19
|
-
ruby-version: 3.0
|
20
|
-
- name: Install Dependencies
|
21
|
-
run: |
|
22
|
-
git submodule update --init
|
23
|
-
bundle install
|
24
|
-
- name: Run Tests
|
25
|
-
run: |
|
26
|
-
rspec
|