etherscan 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- metadata +15 -230
- data/.gitignore +0 -13
- data/Gemfile +0 -5
- data/README.md +0 -17
- data/Rakefile +0 -10
- data/etherscan.gemspec +0 -33
- data/lib/etherscan/api.rb +0 -225
- data/lib/etherscan/call.rb +0 -102
- data/lib/etherscan.rb +0 -11
- data/spec/api/account/balance_spec.rb +0 -15
- data/spec/api/account/balancemulti_spec.rb +0 -21
- data/spec/api/account/getminedblocks_spec.rb +0 -24
- data/spec/api/account/txlist_internal_spec.rb +0 -28
- data/spec/api/account/txlist_spec.rb +0 -27
- data/spec/api/block_getblockreward_spec.rb +0 -13
- data/spec/api/contract_spec.rb +0 -13
- data/spec/api/transaction_getstatus_spec.rb +0 -13
- data/spec/etehrscanio_call_api_key_spec.rb +0 -14
- data/spec/etherscan_call_params_spec.rb +0 -94
- data/spec/etherscanio_call_spec.rb +0 -31
- data/spec/etherscanio_spec.rb +0 -12
- data/spec/fixtures/account/balance.json +0 -1
- data/spec/fixtures/account/balance_multiple.json +0 -1
- data/spec/fixtures/account/getminedblocks.json +0 -1
- data/spec/fixtures/account/txlist.json +0 -1
- data/spec/fixtures/account/txlist_internal.json +0 -1
- data/spec/fixtures/block_getblockreward.json +0 -1
- data/spec/fixtures/contract_getabi.json +0 -1
- data/spec/fixtures/proxy/eth_blocknumber.json +0 -1
- data/spec/fixtures/proxy/eth_call.json +0 -1
- data/spec/fixtures/proxy/eth_estimategas.json +0 -1
- data/spec/fixtures/proxy/eth_gasprice.json +0 -1
- data/spec/fixtures/proxy/eth_getblockbynumber.json +0 -1
- data/spec/fixtures/proxy/eth_getblocktransactioncountbynumber.json +0 -1
- data/spec/fixtures/proxy/eth_getcode.json +0 -1
- data/spec/fixtures/proxy/eth_getstorageat.json +0 -1
- data/spec/fixtures/proxy/eth_gettransactionbyhash.json +0 -1
- data/spec/fixtures/proxy/eth_gettransactionbynumberandindex.json +0 -1
- data/spec/fixtures/proxy/eth_gettransactioncount.json +0 -1
- data/spec/fixtures/proxy/eth_gettransactionreceipt.json +0 -1
- data/spec/fixtures/proxy/eth_getunclebyblockbynumberandindex.json +0 -1
- data/spec/fixtures/proxy/eth_sendrawtransaction.json +0 -1
- data/spec/fixtures/stats/ethprice.json +0 -1
- data/spec/fixtures/stats/ethsupply.json +0 -1
- data/spec/fixtures/stats/tokensupply.json +0 -1
- data/spec/fixtures/token/tokensupply.json +0 -1
- data/spec/fixtures/transaction_getstatus.json +0 -1
- data/spec/spec_helper.rb +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 02fe5c2f28f3931d545116485b98ad1464be2aafba56ef96b400e4006e140dc1
|
4
|
+
data.tar.gz: a7acfe273d5b76d31de3dcfe7766e538f90043d24906035ae525d33e89bd0a35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b04843c6de3e52d3e2ba7de86a18ef192fae439c7cee5797b0ae41ccda5240c7114b13b7df2f3c6bc456f59003d0a945ce0170abe51efd876231bcffa9d44574
|
7
|
+
data.tar.gz: e7773c1740d4e85ca3ba881cae36c190fc9b29afdb3f2a5d4ecf60ed8fa1ae318008fbfbb4264f470bcc33cb5e22e4101e0caecf27594c3afb473bbb77b47166
|
metadata
CHANGED
@@ -1,216 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etherscan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
7
|
+
- Aki Wu
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9.2
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.2
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: json
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 2.1.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 2.1.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
14
|
+
name: activesupport
|
71
15
|
requirement: !ruby/object:Gem::Requirement
|
72
16
|
requirements:
|
73
17
|
- - ">="
|
74
18
|
- !ruby/object:Gem::Version
|
75
19
|
version: '0'
|
76
|
-
type: :
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: guard
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: guard-rspec
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: guard-rubocop
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: webmock
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
20
|
+
type: :runtime
|
147
21
|
prerelease: false
|
148
22
|
version_requirements: !ruby/object:Gem::Requirement
|
149
23
|
requirements:
|
150
24
|
- - ">="
|
151
25
|
- !ruby/object:Gem::Version
|
152
26
|
version: '0'
|
153
|
-
description:
|
154
|
-
to the API at etherscan.io'
|
27
|
+
description: etherscan.io API wrapper, or, etherscan compatible API wrapper
|
155
28
|
email:
|
156
29
|
- wuminzhe@gmail.com
|
157
30
|
executables: []
|
158
31
|
extensions: []
|
159
|
-
extra_rdoc_files:
|
160
|
-
|
161
|
-
files:
|
162
|
-
- ".gitignore"
|
163
|
-
- Gemfile
|
164
|
-
- README.md
|
165
|
-
- Rakefile
|
166
|
-
- etherscan.gemspec
|
167
|
-
- lib/etherscan.rb
|
168
|
-
- lib/etherscan/api.rb
|
169
|
-
- lib/etherscan/call.rb
|
170
|
-
- spec/api/account/balance_spec.rb
|
171
|
-
- spec/api/account/balancemulti_spec.rb
|
172
|
-
- spec/api/account/getminedblocks_spec.rb
|
173
|
-
- spec/api/account/txlist_internal_spec.rb
|
174
|
-
- spec/api/account/txlist_spec.rb
|
175
|
-
- spec/api/block_getblockreward_spec.rb
|
176
|
-
- spec/api/contract_spec.rb
|
177
|
-
- spec/api/transaction_getstatus_spec.rb
|
178
|
-
- spec/etehrscanio_call_api_key_spec.rb
|
179
|
-
- spec/etherscan_call_params_spec.rb
|
180
|
-
- spec/etherscanio_call_spec.rb
|
181
|
-
- spec/etherscanio_spec.rb
|
182
|
-
- spec/fixtures/account/balance.json
|
183
|
-
- spec/fixtures/account/balance_multiple.json
|
184
|
-
- spec/fixtures/account/getminedblocks.json
|
185
|
-
- spec/fixtures/account/txlist.json
|
186
|
-
- spec/fixtures/account/txlist_internal.json
|
187
|
-
- spec/fixtures/block_getblockreward.json
|
188
|
-
- spec/fixtures/contract_getabi.json
|
189
|
-
- spec/fixtures/proxy/eth_blocknumber.json
|
190
|
-
- spec/fixtures/proxy/eth_call.json
|
191
|
-
- spec/fixtures/proxy/eth_estimategas.json
|
192
|
-
- spec/fixtures/proxy/eth_gasprice.json
|
193
|
-
- spec/fixtures/proxy/eth_getblockbynumber.json
|
194
|
-
- spec/fixtures/proxy/eth_getblocktransactioncountbynumber.json
|
195
|
-
- spec/fixtures/proxy/eth_getcode.json
|
196
|
-
- spec/fixtures/proxy/eth_getstorageat.json
|
197
|
-
- spec/fixtures/proxy/eth_gettransactionbyhash.json
|
198
|
-
- spec/fixtures/proxy/eth_gettransactionbynumberandindex.json
|
199
|
-
- spec/fixtures/proxy/eth_gettransactioncount.json
|
200
|
-
- spec/fixtures/proxy/eth_gettransactionreceipt.json
|
201
|
-
- spec/fixtures/proxy/eth_getunclebyblockbynumberandindex.json
|
202
|
-
- spec/fixtures/proxy/eth_sendrawtransaction.json
|
203
|
-
- spec/fixtures/stats/ethprice.json
|
204
|
-
- spec/fixtures/stats/ethsupply.json
|
205
|
-
- spec/fixtures/stats/tokensupply.json
|
206
|
-
- spec/fixtures/token/tokensupply.json
|
207
|
-
- spec/fixtures/transaction_getstatus.json
|
208
|
-
- spec/spec_helper.rb
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files: []
|
209
34
|
homepage: https://github.com/wuminzhe/etherscan
|
210
35
|
licenses:
|
211
36
|
- MIT
|
212
37
|
metadata: {}
|
213
|
-
post_install_message:
|
38
|
+
post_install_message:
|
214
39
|
rdoc_options: []
|
215
40
|
require_paths:
|
216
41
|
- lib
|
@@ -225,48 +50,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
50
|
- !ruby/object:Gem::Version
|
226
51
|
version: '0'
|
227
52
|
requirements: []
|
228
|
-
|
229
|
-
|
230
|
-
signing_key:
|
53
|
+
rubygems_version: 3.3.7
|
54
|
+
signing_key:
|
231
55
|
specification_version: 4
|
232
|
-
summary:
|
233
|
-
test_files:
|
234
|
-
- spec/api/account/balance_spec.rb
|
235
|
-
- spec/api/account/balancemulti_spec.rb
|
236
|
-
- spec/api/account/getminedblocks_spec.rb
|
237
|
-
- spec/api/account/txlist_internal_spec.rb
|
238
|
-
- spec/api/account/txlist_spec.rb
|
239
|
-
- spec/api/block_getblockreward_spec.rb
|
240
|
-
- spec/api/contract_spec.rb
|
241
|
-
- spec/api/transaction_getstatus_spec.rb
|
242
|
-
- spec/etehrscanio_call_api_key_spec.rb
|
243
|
-
- spec/etherscan_call_params_spec.rb
|
244
|
-
- spec/etherscanio_call_spec.rb
|
245
|
-
- spec/etherscanio_spec.rb
|
246
|
-
- spec/fixtures/account/balance.json
|
247
|
-
- spec/fixtures/account/balance_multiple.json
|
248
|
-
- spec/fixtures/account/getminedblocks.json
|
249
|
-
- spec/fixtures/account/txlist.json
|
250
|
-
- spec/fixtures/account/txlist_internal.json
|
251
|
-
- spec/fixtures/block_getblockreward.json
|
252
|
-
- spec/fixtures/contract_getabi.json
|
253
|
-
- spec/fixtures/proxy/eth_blocknumber.json
|
254
|
-
- spec/fixtures/proxy/eth_call.json
|
255
|
-
- spec/fixtures/proxy/eth_estimategas.json
|
256
|
-
- spec/fixtures/proxy/eth_gasprice.json
|
257
|
-
- spec/fixtures/proxy/eth_getblockbynumber.json
|
258
|
-
- spec/fixtures/proxy/eth_getblocktransactioncountbynumber.json
|
259
|
-
- spec/fixtures/proxy/eth_getcode.json
|
260
|
-
- spec/fixtures/proxy/eth_getstorageat.json
|
261
|
-
- spec/fixtures/proxy/eth_gettransactionbyhash.json
|
262
|
-
- spec/fixtures/proxy/eth_gettransactionbynumberandindex.json
|
263
|
-
- spec/fixtures/proxy/eth_gettransactioncount.json
|
264
|
-
- spec/fixtures/proxy/eth_gettransactionreceipt.json
|
265
|
-
- spec/fixtures/proxy/eth_getunclebyblockbynumberandindex.json
|
266
|
-
- spec/fixtures/proxy/eth_sendrawtransaction.json
|
267
|
-
- spec/fixtures/stats/ethprice.json
|
268
|
-
- spec/fixtures/stats/ethsupply.json
|
269
|
-
- spec/fixtures/stats/tokensupply.json
|
270
|
-
- spec/fixtures/token/tokensupply.json
|
271
|
-
- spec/fixtures/transaction_getstatus.json
|
272
|
-
- spec/spec_helper.rb
|
56
|
+
summary: etherscan.io API wrapper, or, etherscan compatible API wrapper
|
57
|
+
test_files: []
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# etherscan
|
2
|
-
|
3
|
-
Access to the API of etherscan.io and the ethereum blockchain
|
4
|
-
|
5
|
-
Forked from: https://github.com/sebs/etherscanio-rb
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
etherscan is published to rubygems.
|
10
|
-
|
11
|
-
Dpl requires ruby with a version greater than 1.9.3
|
12
|
-
* To install: gem install etherscan
|
13
|
-
|
14
|
-
|
15
|
-
## Work in Progress
|
16
|
-
|
17
|
-
Neither is is this stable, nor secure. Although all releases will be going through rubygems.
|
data/Rakefile
DELETED
data/etherscan.gemspec
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
lib = File.expand_path('../lib', __FILE__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'etherscan'
|
8
|
-
spec.version = '0.1.4'
|
9
|
-
spec.authors = ['wuminzhe']
|
10
|
-
spec.email = ['wuminzhe@gmail.com']
|
11
|
-
spec.description = 'Forked from: https://github.com/sebs/etherscanio-rb. 3rd party using to the API at etherscan.io'
|
12
|
-
spec.summary = 'An etherscan.io api wrapper'
|
13
|
-
spec.homepage = 'https://github.com/wuminzhe/etherscan'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
spec.extra_rdoc_files = ['README.md']
|
22
|
-
|
23
|
-
spec.add_dependency 'faraday', '0.9.2'
|
24
|
-
spec.add_dependency 'json', '2.1.0'
|
25
|
-
spec.add_development_dependency 'bundler'
|
26
|
-
spec.add_development_dependency 'rake'
|
27
|
-
spec.add_development_dependency 'rspec'
|
28
|
-
spec.add_development_dependency 'guard'
|
29
|
-
spec.add_development_dependency 'guard-rspec'
|
30
|
-
spec.add_development_dependency 'rubocop'
|
31
|
-
spec.add_development_dependency 'guard-rubocop'
|
32
|
-
spec.add_development_dependency 'webmock'
|
33
|
-
end
|
data/lib/etherscan/api.rb
DELETED
@@ -1,225 +0,0 @@
|
|
1
|
-
module Etherscan
|
2
|
-
class << self
|
3
|
-
attr_accessor :api_key, :chain
|
4
|
-
end
|
5
|
-
|
6
|
-
module Account
|
7
|
-
class << self
|
8
|
-
def txlist(address, startblock, endblock, sort = 'desc', page = nil, offset = nil)
|
9
|
-
call = Etherscan::Call.new(Etherscan.chain, 'account', 'txlist')
|
10
|
-
call.api_key = Etherscan.api_key
|
11
|
-
call.address = address
|
12
|
-
call.startblock = startblock
|
13
|
-
call.endblock = endblock
|
14
|
-
call.page = page
|
15
|
-
call.offset = offset
|
16
|
-
call.sort = sort
|
17
|
-
call.fetch
|
18
|
-
end
|
19
|
-
|
20
|
-
def txlistinternal(address, startblock, endblock, sort = 'desc', page = nil, offset = nil)
|
21
|
-
call = Etherscan::Call.new(Etherscan.chain, 'account', 'txlistinternal')
|
22
|
-
call.api_key = Etherscan.api_key
|
23
|
-
call.address = address
|
24
|
-
call.startblock = startblock
|
25
|
-
call.endblock = endblock
|
26
|
-
call.page = page
|
27
|
-
call.offset = offset
|
28
|
-
call.sort = sort
|
29
|
-
call.fetch
|
30
|
-
end
|
31
|
-
|
32
|
-
def txlistinternal_txhash(txhash)
|
33
|
-
call = Etherscan::Call.new(Etherscan.chain, 'account', 'txlistinternal')
|
34
|
-
call.api_key = Etherscan.api_key
|
35
|
-
call.txhash = txhash
|
36
|
-
call.fetch
|
37
|
-
end
|
38
|
-
|
39
|
-
def balance(address, tag)
|
40
|
-
call = Etherscan::Call.new(Etherscan.chain, 'account', 'balance')
|
41
|
-
call.api_key = Etherscan.api_key
|
42
|
-
call.address = address
|
43
|
-
call.tag = tag
|
44
|
-
call.fetch
|
45
|
-
end
|
46
|
-
|
47
|
-
def getminedblocks(address, blocktype, page = nil, offset = nil)
|
48
|
-
call = Etherscan::Call.new(Etherscan.chain, 'account', 'getminedblocks')
|
49
|
-
call.api_key = Etherscan.api_key
|
50
|
-
call.page = page
|
51
|
-
call.offset = offset
|
52
|
-
call.address = address
|
53
|
-
call.blocktype = blocktype
|
54
|
-
call.fetch
|
55
|
-
end
|
56
|
-
|
57
|
-
def balancemulti(address, tag)
|
58
|
-
call = Etherscan::Call.new(Etherscan.chain, 'account', 'balancemulti')
|
59
|
-
call.api_key = Etherscan.api_key
|
60
|
-
call.address = address
|
61
|
-
call.tag = tag
|
62
|
-
call.fetch
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
module Contract
|
68
|
-
class << self
|
69
|
-
def getabi(address)
|
70
|
-
call = Etherscan::Call.new(Etherscan.chain, 'contract', 'getabi')
|
71
|
-
call.api_key = Etherscan.api_key
|
72
|
-
call.address = address
|
73
|
-
call.fetch
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
module Transaction
|
79
|
-
class << self
|
80
|
-
def getstatus(txhash)
|
81
|
-
call = Etherscan::Call.new(Etherscan.chain, 'transaction', 'getstatus')
|
82
|
-
call.api_key = Etherscan.api_key
|
83
|
-
call.txhash = txhash
|
84
|
-
call.fetch
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
module Block
|
90
|
-
class << self
|
91
|
-
def getblockreward(blockno)
|
92
|
-
call = Etherscan::Call.new(Etherscan.chain, 'block', 'getblockreward')
|
93
|
-
call.api_key = Etherscan.api_key
|
94
|
-
call.blockno = blockno
|
95
|
-
call.fetch
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
module Logs
|
101
|
-
class << self
|
102
|
-
def get_logs(fromBlock, toBlock, address, topics)
|
103
|
-
call = Etherscan::Call.new(Etherscan.chain, 'logs', 'getLogs')
|
104
|
-
call.api_key = Etherscan.api_key
|
105
|
-
call.fromBlock = fromBlock
|
106
|
-
call.toBlock = toBlock
|
107
|
-
call.address = address
|
108
|
-
call.topics = topics
|
109
|
-
call.fetch
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
module Proxy
|
115
|
-
class << self
|
116
|
-
def eth_block_number
|
117
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_blockNumber')
|
118
|
-
call.api_key = Etherscan.api_key
|
119
|
-
call.fetch
|
120
|
-
end
|
121
|
-
|
122
|
-
def eth_get_block_by_number(tag, boolean)
|
123
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getBlockByNumber')
|
124
|
-
call.api_key = Etherscan.api_key
|
125
|
-
call.tag = tag
|
126
|
-
call.boolean = boolean
|
127
|
-
call.fetch
|
128
|
-
end
|
129
|
-
|
130
|
-
def eth_get_transaction_by_hash(txhash)
|
131
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getTransactionByHash')
|
132
|
-
call.api_key = Etherscan.api_key
|
133
|
-
call.txhash = txhash
|
134
|
-
call.fetch
|
135
|
-
end
|
136
|
-
|
137
|
-
def eth_get_uncle_by_block_number_and_index(tag, index)
|
138
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getUncleByBlockNumberAndIndex')
|
139
|
-
call.api_key = Etherscan.api_key
|
140
|
-
call.tag = tag
|
141
|
-
call.index = index
|
142
|
-
call.fetch
|
143
|
-
end
|
144
|
-
|
145
|
-
def eth_get_block_transaction_count_by_number(tag)
|
146
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getBlockTransactionCountByNumber')
|
147
|
-
call.api_key = Etherscan.api_key
|
148
|
-
call.tag = tag
|
149
|
-
call.fetch
|
150
|
-
end
|
151
|
-
|
152
|
-
def eth_get_transaction_by_block_number_and_index(tag, index)
|
153
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getTransactionByBlockNumberAndIndex')
|
154
|
-
call.api_key = Etherscan.api_key
|
155
|
-
call.tag = tag
|
156
|
-
call.index = index
|
157
|
-
call.fetch
|
158
|
-
end
|
159
|
-
|
160
|
-
def eth_get_transaction_count(address, tag)
|
161
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getTransactionCount')
|
162
|
-
call.api_key = Etherscan.api_key
|
163
|
-
call.address = address
|
164
|
-
call.tag = tag
|
165
|
-
call.fetch
|
166
|
-
end
|
167
|
-
|
168
|
-
def eth_send_raw_transaction(hex)
|
169
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_sendRawTransaction')
|
170
|
-
call.api_key = Etherscan.api_key
|
171
|
-
call.hex = hex
|
172
|
-
call.fetch
|
173
|
-
end
|
174
|
-
|
175
|
-
def eth_get_transaction_receipt(txhash)
|
176
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getTransactionReceipt')
|
177
|
-
call.api_key = Etherscan.api_key
|
178
|
-
call.txhash = txhash
|
179
|
-
call.fetch
|
180
|
-
end
|
181
|
-
|
182
|
-
def eth_call(to, data, tag)
|
183
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_call')
|
184
|
-
call.api_key = Etherscan.api_key
|
185
|
-
call.to = to
|
186
|
-
call.data = data
|
187
|
-
call.tag = tag
|
188
|
-
call.fetch
|
189
|
-
end
|
190
|
-
|
191
|
-
def eth_get_code(address, tag)
|
192
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getCode')
|
193
|
-
call.api_key = Etherscan.api_key
|
194
|
-
call.address = address
|
195
|
-
call.tag = tag
|
196
|
-
call.fetch
|
197
|
-
end
|
198
|
-
|
199
|
-
def eth_get_storage_at(address, position, tag)
|
200
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_getStorageAt')
|
201
|
-
call.api_key = Etherscan.api_key
|
202
|
-
call.address = address
|
203
|
-
call.position = position
|
204
|
-
call.tag = tag
|
205
|
-
call.fetch
|
206
|
-
end
|
207
|
-
|
208
|
-
def eth_gas_price
|
209
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_gasPrice')
|
210
|
-
call.api_key = Etherscan.api_key
|
211
|
-
call.fetch
|
212
|
-
end
|
213
|
-
|
214
|
-
def eth_estimate_gas(to, value, gas_price, gas)
|
215
|
-
call = Etherscan::Call.new(Etherscan.chain, 'proxy', 'eth_estimateGas')
|
216
|
-
call.api_key = Etherscan.api_key
|
217
|
-
call.to = to
|
218
|
-
call.value = value
|
219
|
-
call.gasPrice = gas_price
|
220
|
-
call.gas = gas
|
221
|
-
call.fetch
|
222
|
-
end
|
223
|
-
end
|
224
|
-
end
|
225
|
-
end
|