erc20 0.2.0 → 0.2.2
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/Gemfile +14 -14
- data/Gemfile.lock +111 -101
- data/Rakefile +1 -0
- data/bin/erc20 +6 -3
- data/erc20.gemspec +9 -9
- data/hardhat/Dockerfile +1 -1
- data/hardhat/package.json +2 -3
- data/lib/erc20/erc20.rb +1 -1
- data/lib/erc20/fake_wallet.rb +1 -1
- data/lib/erc20/wallet.rb +3 -3
- metadata +28 -53
- data/.0pdd.yml +0 -5
- data/.gitattributes +0 -7
- data/.github/workflows/actionlint.yml +0 -25
- data/.github/workflows/codecov.yml +0 -27
- data/.github/workflows/copyrights.yml +0 -19
- data/.github/workflows/hadolint.yml +0 -16
- data/.github/workflows/markdown-lint.yml +0 -23
- data/.github/workflows/pdd.yml +0 -19
- data/.github/workflows/rake.yml +0 -38
- data/.github/workflows/reuse.yml +0 -19
- data/.github/workflows/shellcheck.yml +0 -19
- data/.github/workflows/typos.yml +0 -19
- data/.github/workflows/xcop.yml +0 -19
- data/.github/workflows/yamllint.yml +0 -21
- data/.gitignore +0 -10
- data/.gitleaksignore +0 -2
- data/.pdd +0 -7
- data/.rubocop.yml +0 -49
- data/.rultor.yml +0 -26
- data/.yamllint.yml +0 -12
- data/renovate.json +0 -6
- data/test/erc20/test_fake_wallet.rb +0 -118
- data/test/erc20/test_wallet.rb +0 -343
- data/test/erc20/test_wallet_live.rb +0 -126
- data/test/test__helper.rb +0 -206
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c08a8151c3b858912e6b40ced427a77c2d33c6ce3a711d96f00d8f13a01ee933
|
|
4
|
+
data.tar.gz: 3853551598ac144a032b6a2411adfa73f8f49356269c387445f32d0c0a0c517f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49bc0f49f5a18010b4f74890d83a17e1de7441aa5d5f812c6faec1749bafef923c580cf0cfd542011089d7c992181f2ffdb9c3330e71fe5a070e0311fe14b45a
|
|
7
|
+
data.tar.gz: cde6abdded1980fa70565aa2a2d261816e5d3ca32f62dfdfdc4911129ba6591216fbfed94803d6f32023ce8a7de168ac80a9ea42cf186e6c1a0241d042ae057e
|
data/Gemfile
CHANGED
|
@@ -6,26 +6,26 @@
|
|
|
6
6
|
source 'https://rubygems.org'
|
|
7
7
|
gemspec
|
|
8
8
|
|
|
9
|
-
gem 'backtrace', '
|
|
9
|
+
gem 'backtrace', '~>0.4', require: false
|
|
10
10
|
gem 'concurrent-ruby', '~>1.2', require: false
|
|
11
|
-
gem 'cucumber', '~>
|
|
12
|
-
gem 'donce', '
|
|
13
|
-
gem 'faraday', '
|
|
14
|
-
gem 'loog', '
|
|
15
|
-
gem 'minitest', '~>
|
|
11
|
+
gem 'cucumber', '~>10.0', require: false
|
|
12
|
+
gem 'donce', '~>0.2', require: false
|
|
13
|
+
gem 'faraday', '~>2.14', require: false
|
|
14
|
+
gem 'loog', '~>0.6', require: false
|
|
15
|
+
gem 'minitest', '~>6.0', require: false
|
|
16
16
|
gem 'minitest-reporters', '~>1.7', require: false
|
|
17
17
|
gem 'minitest-retry', '~>0.2', require: false
|
|
18
|
-
gem 'qbash', '
|
|
18
|
+
gem 'qbash', '~>0.4', require: false
|
|
19
19
|
gem 'rake', '~>13.2', require: false
|
|
20
|
-
gem 'random-port', '
|
|
20
|
+
gem 'random-port', '~>0.7', require: false
|
|
21
|
+
gem 'rdoc', '~>6.17', require: false
|
|
21
22
|
gem 'rubocop', '~>1.75', require: false
|
|
22
|
-
gem 'rubocop-minitest', '
|
|
23
|
-
gem 'rubocop-performance', '
|
|
24
|
-
gem 'rubocop-rake', '
|
|
25
|
-
gem 'rubocop-rspec', '>0', require: false
|
|
23
|
+
gem 'rubocop-minitest', '~>0.38', require: false
|
|
24
|
+
gem 'rubocop-performance', '~>1.25', require: false
|
|
25
|
+
gem 'rubocop-rake', '~>0.7', require: false
|
|
26
26
|
gem 'simplecov', '~>0.22', require: false
|
|
27
|
-
gem 'simplecov-cobertura', '~>
|
|
27
|
+
gem 'simplecov-cobertura', '~>3.1', require: false
|
|
28
28
|
gem 'threads', '~>0.4', require: false
|
|
29
|
-
gem 'typhoeus', '
|
|
29
|
+
gem 'typhoeus', '~>1.5', require: false
|
|
30
30
|
gem 'webmock', '~>3.23', require: false
|
|
31
31
|
gem 'yard', '~>0.9', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -2,82 +2,83 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
erc20 (0.0.0)
|
|
5
|
-
eth (
|
|
6
|
-
faye-websocket (
|
|
7
|
-
json (
|
|
8
|
-
jsonrpc-client (
|
|
9
|
-
loog (
|
|
10
|
-
slop (
|
|
5
|
+
eth (~> 0.5)
|
|
6
|
+
faye-websocket (~> 0.11)
|
|
7
|
+
json (~> 2.10)
|
|
8
|
+
jsonrpc-client (~> 0.1)
|
|
9
|
+
loog (~> 0.4)
|
|
10
|
+
slop (~> 4.0)
|
|
11
11
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
addressable (2.8.
|
|
16
|
-
public_suffix (>= 2.0.2, <
|
|
15
|
+
addressable (2.8.8)
|
|
16
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
17
17
|
ansi (1.5.0)
|
|
18
18
|
ast (2.4.3)
|
|
19
|
-
backtrace (0.4.
|
|
20
|
-
base64 (0.
|
|
21
|
-
bigdecimal (
|
|
19
|
+
backtrace (0.4.1)
|
|
20
|
+
base64 (0.3.0)
|
|
21
|
+
bigdecimal (4.0.1)
|
|
22
22
|
builder (3.3.0)
|
|
23
|
-
concurrent-ruby (1.3.
|
|
24
|
-
crack (1.0.
|
|
23
|
+
concurrent-ruby (1.3.6)
|
|
24
|
+
crack (1.0.1)
|
|
25
25
|
bigdecimal
|
|
26
26
|
rexml
|
|
27
|
-
cucumber (
|
|
27
|
+
cucumber (10.2.0)
|
|
28
|
+
base64 (~> 0.2)
|
|
28
29
|
builder (~> 3.2)
|
|
29
|
-
cucumber-ci-environment (> 9, <
|
|
30
|
-
cucumber-core (>
|
|
31
|
-
cucumber-cucumber-expressions (
|
|
32
|
-
cucumber-
|
|
33
|
-
cucumber-html-formatter (> 20.3, < 22)
|
|
34
|
-
cucumber-messages (> 19, < 25)
|
|
30
|
+
cucumber-ci-environment (> 9, < 12)
|
|
31
|
+
cucumber-core (> 15, < 17)
|
|
32
|
+
cucumber-cucumber-expressions (> 17, < 20)
|
|
33
|
+
cucumber-html-formatter (> 21, < 23)
|
|
35
34
|
diff-lcs (~> 1.5)
|
|
35
|
+
logger (~> 1.6)
|
|
36
36
|
mini_mime (~> 1.1)
|
|
37
37
|
multi_test (~> 1.1)
|
|
38
|
-
sys-uname (~> 1.
|
|
39
|
-
cucumber-ci-environment (
|
|
40
|
-
cucumber-core (
|
|
41
|
-
cucumber-gherkin (
|
|
42
|
-
cucumber-messages (
|
|
43
|
-
cucumber-tag-expressions (>
|
|
44
|
-
cucumber-cucumber-expressions (
|
|
38
|
+
sys-uname (~> 1.3)
|
|
39
|
+
cucumber-ci-environment (11.0.0)
|
|
40
|
+
cucumber-core (16.0.0)
|
|
41
|
+
cucumber-gherkin (> 33, < 40)
|
|
42
|
+
cucumber-messages (> 28, < 33)
|
|
43
|
+
cucumber-tag-expressions (> 6, < 9)
|
|
44
|
+
cucumber-cucumber-expressions (18.0.1)
|
|
45
45
|
bigdecimal
|
|
46
|
-
cucumber-gherkin (
|
|
47
|
-
cucumber-messages (
|
|
48
|
-
cucumber-html-formatter (
|
|
49
|
-
cucumber-messages (> 19, <
|
|
50
|
-
cucumber-messages (
|
|
51
|
-
cucumber-tag-expressions (
|
|
46
|
+
cucumber-gherkin (36.1.0)
|
|
47
|
+
cucumber-messages (> 25, < 30)
|
|
48
|
+
cucumber-html-formatter (22.2.0)
|
|
49
|
+
cucumber-messages (> 19, < 31)
|
|
50
|
+
cucumber-messages (29.0.1)
|
|
51
|
+
cucumber-tag-expressions (8.1.0)
|
|
52
|
+
date (3.5.1)
|
|
52
53
|
diff-lcs (1.6.2)
|
|
53
54
|
docile (1.4.1)
|
|
54
55
|
donce (0.2.4)
|
|
55
56
|
backtrace (~> 0.3)
|
|
56
57
|
os (~> 1.1)
|
|
57
58
|
qbash (~> 0.3)
|
|
58
|
-
elapsed (0.0
|
|
59
|
-
loog (
|
|
60
|
-
tago (
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
elapsed (0.2.0)
|
|
60
|
+
loog (~> 0.6)
|
|
61
|
+
tago (~> 0.1)
|
|
62
|
+
erb (6.0.1)
|
|
63
|
+
eth (0.5.13)
|
|
63
64
|
forwardable (~> 1.3)
|
|
64
65
|
keccak (~> 1.3)
|
|
65
66
|
konstructor (~> 1.0)
|
|
66
67
|
openssl (>= 2.2, < 4.0)
|
|
67
68
|
rbsecp256k1 (~> 6.0)
|
|
68
69
|
scrypt (~> 3.0)
|
|
69
|
-
ethon (0.
|
|
70
|
+
ethon (0.15.0)
|
|
70
71
|
ffi (>= 1.15.0)
|
|
71
72
|
eventmachine (1.2.7)
|
|
72
|
-
faraday (2.
|
|
73
|
+
faraday (2.14.0)
|
|
73
74
|
faraday-net_http (>= 2.0, < 3.5)
|
|
74
75
|
json
|
|
75
76
|
logger
|
|
76
|
-
faraday-net_http (3.4.
|
|
77
|
-
net-http (
|
|
78
|
-
faye-websocket (0.
|
|
77
|
+
faraday-net_http (3.4.2)
|
|
78
|
+
net-http (~> 0.5)
|
|
79
|
+
faye-websocket (0.12.0)
|
|
79
80
|
eventmachine (>= 0.12.0)
|
|
80
|
-
websocket-driver (>= 0.
|
|
81
|
+
websocket-driver (>= 0.8.0)
|
|
81
82
|
ffi (1.17.2-arm64-darwin)
|
|
82
83
|
ffi (1.17.2-x64-mingw-ucrt)
|
|
83
84
|
ffi (1.17.2-x86_64-darwin)
|
|
@@ -85,9 +86,9 @@ GEM
|
|
|
85
86
|
ffi-compiler (1.3.2)
|
|
86
87
|
ffi (>= 1.15.5)
|
|
87
88
|
rake
|
|
88
|
-
forwardable (1.
|
|
89
|
-
hashdiff (1.1
|
|
90
|
-
json (2.
|
|
89
|
+
forwardable (1.4.0)
|
|
90
|
+
hashdiff (1.2.1)
|
|
91
|
+
json (2.18.0)
|
|
91
92
|
jsonrpc-client (0.1.4)
|
|
92
93
|
faraday
|
|
93
94
|
multi_json (>= 1.1.0)
|
|
@@ -98,9 +99,11 @@ GEM
|
|
|
98
99
|
logger (1.7.0)
|
|
99
100
|
loog (0.6.1)
|
|
100
101
|
logger (~> 1.0)
|
|
102
|
+
memoist3 (1.0.0)
|
|
101
103
|
mini_mime (1.1.5)
|
|
102
104
|
mini_portile2 (2.8.9)
|
|
103
|
-
minitest (
|
|
105
|
+
minitest (6.0.0)
|
|
106
|
+
prism (~> 1.5)
|
|
104
107
|
minitest-reporters (1.7.1)
|
|
105
108
|
ansi
|
|
106
109
|
builder
|
|
@@ -108,36 +111,43 @@ GEM
|
|
|
108
111
|
ruby-progressbar
|
|
109
112
|
minitest-retry (0.2.5)
|
|
110
113
|
minitest (>= 5.0)
|
|
111
|
-
multi_json (1.
|
|
114
|
+
multi_json (1.18.0)
|
|
112
115
|
multi_test (1.1.0)
|
|
113
|
-
net-http (0.
|
|
114
|
-
uri
|
|
115
|
-
openssl (3.3.
|
|
116
|
+
net-http (0.9.1)
|
|
117
|
+
uri (>= 0.11.1)
|
|
118
|
+
openssl (3.3.2)
|
|
116
119
|
os (1.1.4)
|
|
117
120
|
parallel (1.27.0)
|
|
118
|
-
parser (3.3.
|
|
121
|
+
parser (3.3.10.0)
|
|
119
122
|
ast (~> 2.4.1)
|
|
120
123
|
racc
|
|
121
|
-
pkg-config (1.6.
|
|
122
|
-
prism (1.
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
pkg-config (1.6.5)
|
|
125
|
+
prism (1.6.0)
|
|
126
|
+
psych (5.3.1)
|
|
127
|
+
date
|
|
128
|
+
stringio
|
|
129
|
+
public_suffix (7.0.0)
|
|
130
|
+
qbash (0.4.8)
|
|
125
131
|
backtrace (> 0)
|
|
126
132
|
elapsed (> 0)
|
|
127
133
|
loog (> 0)
|
|
128
134
|
tago (> 0)
|
|
129
135
|
racc (1.8.1)
|
|
130
136
|
rainbow (3.1.1)
|
|
131
|
-
rake (13.
|
|
132
|
-
random-port (0.7.
|
|
133
|
-
tago (
|
|
137
|
+
rake (13.3.1)
|
|
138
|
+
random-port (0.7.6)
|
|
139
|
+
tago (~> 0.0)
|
|
134
140
|
rbsecp256k1 (6.0.0)
|
|
135
141
|
mini_portile2 (~> 2.8)
|
|
136
142
|
pkg-config (~> 1.5)
|
|
137
143
|
rubyzip (~> 2.3)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
rdoc (6.17.0)
|
|
145
|
+
erb
|
|
146
|
+
psych (>= 4.0.0)
|
|
147
|
+
tsort
|
|
148
|
+
regexp_parser (2.11.3)
|
|
149
|
+
rexml (3.4.4)
|
|
150
|
+
rubocop (1.82.0)
|
|
141
151
|
json (~> 2.3)
|
|
142
152
|
language_server-protocol (~> 3.17.0.2)
|
|
143
153
|
lint_roller (~> 1.1.0)
|
|
@@ -145,62 +155,62 @@ GEM
|
|
|
145
155
|
parser (>= 3.3.0.2)
|
|
146
156
|
rainbow (>= 2.2.2, < 4.0)
|
|
147
157
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
148
|
-
rubocop-ast (>= 1.
|
|
158
|
+
rubocop-ast (>= 1.48.0, < 2.0)
|
|
149
159
|
ruby-progressbar (~> 1.7)
|
|
150
160
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
151
|
-
rubocop-ast (1.
|
|
161
|
+
rubocop-ast (1.48.0)
|
|
152
162
|
parser (>= 3.3.7.2)
|
|
153
163
|
prism (~> 1.4)
|
|
154
|
-
rubocop-minitest (0.38.
|
|
164
|
+
rubocop-minitest (0.38.2)
|
|
155
165
|
lint_roller (~> 1.1)
|
|
156
166
|
rubocop (>= 1.75.0, < 2.0)
|
|
157
167
|
rubocop-ast (>= 1.38.0, < 2.0)
|
|
158
|
-
rubocop-performance (1.
|
|
168
|
+
rubocop-performance (1.26.1)
|
|
159
169
|
lint_roller (~> 1.1)
|
|
160
170
|
rubocop (>= 1.75.0, < 2.0)
|
|
161
|
-
rubocop-ast (>= 1.
|
|
171
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
162
172
|
rubocop-rake (0.7.1)
|
|
163
173
|
lint_roller (~> 1.1)
|
|
164
174
|
rubocop (>= 1.72.1)
|
|
165
|
-
rubocop-rspec (3.6.0)
|
|
166
|
-
lint_roller (~> 1.1)
|
|
167
|
-
rubocop (~> 1.72, >= 1.72.1)
|
|
168
175
|
ruby-progressbar (1.13.0)
|
|
169
176
|
rubyzip (2.4.1)
|
|
170
|
-
scrypt (3.0
|
|
177
|
+
scrypt (3.1.0)
|
|
171
178
|
ffi-compiler (>= 1.0, < 2.0)
|
|
172
|
-
rake (
|
|
179
|
+
rake (~> 13)
|
|
173
180
|
simplecov (0.22.0)
|
|
174
181
|
docile (~> 1.1)
|
|
175
182
|
simplecov-html (~> 0.11)
|
|
176
183
|
simplecov_json_formatter (~> 0.1)
|
|
177
|
-
simplecov-cobertura (
|
|
184
|
+
simplecov-cobertura (3.1.0)
|
|
178
185
|
rexml
|
|
179
186
|
simplecov (~> 0.19)
|
|
180
|
-
simplecov-html (0.13.
|
|
187
|
+
simplecov-html (0.13.2)
|
|
181
188
|
simplecov_json_formatter (0.1.4)
|
|
182
189
|
slop (4.10.1)
|
|
183
|
-
|
|
190
|
+
stringio (3.2.0)
|
|
191
|
+
sys-uname (1.4.1)
|
|
184
192
|
ffi (~> 1.1)
|
|
185
|
-
|
|
186
|
-
|
|
193
|
+
memoist3 (~> 1.0.0)
|
|
194
|
+
tago (0.6.0)
|
|
195
|
+
threads (0.5.0)
|
|
187
196
|
backtrace (~> 0)
|
|
188
197
|
concurrent-ruby (~> 1.0)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
198
|
+
tsort (0.2.0)
|
|
199
|
+
typhoeus (1.5.0)
|
|
200
|
+
ethon (>= 0.9.0, < 0.16.0)
|
|
201
|
+
unicode-display_width (3.2.0)
|
|
202
|
+
unicode-emoji (~> 4.1)
|
|
203
|
+
unicode-emoji (4.2.0)
|
|
204
|
+
uri (1.1.1)
|
|
205
|
+
webmock (3.26.1)
|
|
196
206
|
addressable (>= 2.8.0)
|
|
197
207
|
crack (>= 0.3.2)
|
|
198
208
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
199
|
-
websocket-driver (0.
|
|
209
|
+
websocket-driver (0.8.0)
|
|
200
210
|
base64
|
|
201
211
|
websocket-extensions (>= 0.1.0)
|
|
202
212
|
websocket-extensions (0.1.5)
|
|
203
|
-
yard (0.9.
|
|
213
|
+
yard (0.9.38)
|
|
204
214
|
|
|
205
215
|
PLATFORMS
|
|
206
216
|
arm64-darwin-22
|
|
@@ -212,28 +222,28 @@ PLATFORMS
|
|
|
212
222
|
x86_64-linux
|
|
213
223
|
|
|
214
224
|
DEPENDENCIES
|
|
215
|
-
backtrace (
|
|
225
|
+
backtrace (~> 0.4)
|
|
216
226
|
concurrent-ruby (~> 1.2)
|
|
217
|
-
cucumber (~>
|
|
218
|
-
donce (
|
|
227
|
+
cucumber (~> 10.0)
|
|
228
|
+
donce (~> 0.2)
|
|
219
229
|
erc20!
|
|
220
|
-
faraday (
|
|
221
|
-
loog (
|
|
222
|
-
minitest (~>
|
|
230
|
+
faraday (~> 2.14)
|
|
231
|
+
loog (~> 0.6)
|
|
232
|
+
minitest (~> 6.0)
|
|
223
233
|
minitest-reporters (~> 1.7)
|
|
224
234
|
minitest-retry (~> 0.2)
|
|
225
|
-
qbash (
|
|
235
|
+
qbash (~> 0.4)
|
|
226
236
|
rake (~> 13.2)
|
|
227
|
-
random-port (
|
|
237
|
+
random-port (~> 0.7)
|
|
238
|
+
rdoc (~> 6.17)
|
|
228
239
|
rubocop (~> 1.75)
|
|
229
|
-
rubocop-minitest (
|
|
230
|
-
rubocop-performance (
|
|
231
|
-
rubocop-rake (
|
|
232
|
-
rubocop-rspec (> 0)
|
|
240
|
+
rubocop-minitest (~> 0.38)
|
|
241
|
+
rubocop-performance (~> 1.25)
|
|
242
|
+
rubocop-rake (~> 0.7)
|
|
233
243
|
simplecov (~> 0.22)
|
|
234
|
-
simplecov-cobertura (~>
|
|
244
|
+
simplecov-cobertura (~> 3.1)
|
|
235
245
|
threads (~> 0.4)
|
|
236
|
-
typhoeus (
|
|
246
|
+
typhoeus (~> 1.5)
|
|
237
247
|
webmock (~> 3.23)
|
|
238
248
|
yard (~> 0.9)
|
|
239
249
|
|
data/Rakefile
CHANGED
data/bin/erc20
CHANGED
|
@@ -116,10 +116,13 @@ Options are:"
|
|
|
116
116
|
raise 'Address is required' if address.nil?
|
|
117
117
|
log.debug("Sending ERC20 tokens to #{address}")
|
|
118
118
|
amount = opts.arguments[3]
|
|
119
|
-
raise 'Amount argument is required' if amount.nil?
|
|
119
|
+
raise 'Amount argument is required (for example, "19.9usdt")' if amount.nil?
|
|
120
120
|
raise 'Amount is not valid' unless /^[0-9]+(usdt)?$/.match?(amount)
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
if /^[0-9]+$/.match?(amount)
|
|
122
|
+
amount = amount.to_i
|
|
123
|
+
elsif /^[0-9]usdt+$/.match?(amount)
|
|
124
|
+
amount = (amount.gsub(/usdt^/, '').to_f * 1_000_000).to_i
|
|
125
|
+
end
|
|
123
126
|
log.debug("Sending #{amount} ERC20 tokens")
|
|
124
127
|
puts wallet.pay(priv.private_hex, address, amount)
|
|
125
128
|
when 'eth_pay'
|
data/erc20.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ require_relative 'lib/erc20/erc20'
|
|
|
8
8
|
|
|
9
9
|
Gem::Specification.new do |s|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
|
11
|
-
s.required_ruby_version = '
|
|
11
|
+
s.required_ruby_version = '~>3.0'
|
|
12
12
|
s.name = 'erc20'
|
|
13
13
|
s.version = ERC20::VERSION
|
|
14
14
|
s.license = 'MIT'
|
|
@@ -20,16 +20,16 @@ Gem::Specification.new do |s|
|
|
|
20
20
|
'Ethereum node to provide JSON RPC and Websockets API.'
|
|
21
21
|
s.authors = ['Yegor Bugayenko']
|
|
22
22
|
s.email = 'yegor256@gmail.com'
|
|
23
|
-
s.homepage = '
|
|
24
|
-
s.files = `git ls-files`.split($RS)
|
|
23
|
+
s.homepage = 'https://github.com/yegor256/erc20.rb'
|
|
24
|
+
s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.split($RS)
|
|
25
25
|
s.rdoc_options = ['--charset=UTF-8']
|
|
26
26
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
27
27
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
|
28
|
-
s.add_dependency 'eth', '
|
|
29
|
-
s.add_dependency 'faye-websocket', '
|
|
30
|
-
s.add_dependency 'json', '
|
|
31
|
-
s.add_dependency 'jsonrpc-client', '
|
|
32
|
-
s.add_dependency 'loog', '
|
|
33
|
-
s.add_dependency 'slop', '
|
|
28
|
+
s.add_dependency 'eth', '~>0.5'
|
|
29
|
+
s.add_dependency 'faye-websocket', '~>0.11'
|
|
30
|
+
s.add_dependency 'json', '~>2.10'
|
|
31
|
+
s.add_dependency 'jsonrpc-client', '~>0.1'
|
|
32
|
+
s.add_dependency 'loog', '~>0.4'
|
|
33
|
+
s.add_dependency 'slop', '~>4.0'
|
|
34
34
|
s.metadata['rubygems_mfa_required'] = 'true'
|
|
35
35
|
end
|
data/hardhat/Dockerfile
CHANGED
data/hardhat/package.json
CHANGED
data/lib/erc20/erc20.rb
CHANGED
data/lib/erc20/fake_wallet.rb
CHANGED
|
@@ -71,7 +71,7 @@ class ERC20::FakeWallet
|
|
|
71
71
|
|
|
72
72
|
# Get ERC20 amount (in tokens) that was sent in the given transaction.
|
|
73
73
|
#
|
|
74
|
-
# @param [String]
|
|
74
|
+
# @param [String] _txn Hex of transaction
|
|
75
75
|
# @return [Integer] Balance, in ERC20 tokens
|
|
76
76
|
def sum_of(_txn)
|
|
77
77
|
42_000_000
|
data/lib/erc20/wallet.rb
CHANGED
|
@@ -130,7 +130,7 @@ class ERC20::Wallet
|
|
|
130
130
|
# An address in Ethereum may have many balances. One of them is the main
|
|
131
131
|
# balance in ETH crypto. This balance is checked by this method.
|
|
132
132
|
#
|
|
133
|
-
# @param [String]
|
|
133
|
+
# @param [String] address Public key, in hex, starting from '0x'
|
|
134
134
|
# @return [Integer] Balance, in ETH
|
|
135
135
|
def eth_balance(address)
|
|
136
136
|
raise 'Address can\'t be nil' unless address
|
|
@@ -358,7 +358,7 @@ class ERC20::Wallet
|
|
|
358
358
|
u = url(http: false)
|
|
359
359
|
log_it(:debug, "Connecting ##{subscription_id} to #{u.hostname}:#{u.port}...")
|
|
360
360
|
contract = @contract
|
|
361
|
-
log_url = "ws#{
|
|
361
|
+
log_url = "ws#{'s' if @ssl}://#{u.hostname}:#{u.port}"
|
|
362
362
|
ws = Faye::WebSocket::Client.new(u.to_s, [], proxy: @proxy ? { origin: @proxy } : {}, ping: 60)
|
|
363
363
|
timer = nil
|
|
364
364
|
ws.on(:open) do
|
|
@@ -471,7 +471,7 @@ class ERC20::Wallet
|
|
|
471
471
|
end
|
|
472
472
|
|
|
473
473
|
def url(http: true)
|
|
474
|
-
URI.parse("#{http ? 'http' : 'ws'}#{
|
|
474
|
+
URI.parse("#{http ? 'http' : 'ws'}#{'s' if @ssl}://#{@host}:#{@port}#{http ? @http_path : @ws_path}")
|
|
475
475
|
end
|
|
476
476
|
|
|
477
477
|
def jsonrpc
|