etherscan 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/etherscan.gemspec +1 -1
- data/lib/etherscan/api.rb +14 -0
- data/lib/etherscan/call.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 372ac903b684c55409d2178d34aea62612585484
|
4
|
+
data.tar.gz: 5843eaf51407e72637a058b1637114addee17edd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a857ad77f9e450cff668f3b4dd7e5dcdf961696a727eeec8201bc6b4ac3462b267af7c3a513c3861b564cca25951efe5c329c572c42cf5e1ec3b72bcd186f94
|
7
|
+
data.tar.gz: eec15eec7fb42ce24b85efdb5bedd99fdaff889a70f03b162da0142bdbc5e112c955b68476b2ae1dab8635067d549e4099f37966ec7bdbeccbfa6db624fecd04
|
data/etherscan.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'etherscan'
|
8
|
-
spec.version = '0.1.
|
8
|
+
spec.version = '0.1.1'
|
9
9
|
spec.authors = ['wuminzhe']
|
10
10
|
spec.email = ['wuminzhe@gmail.com']
|
11
11
|
spec.description = 'Forked from: https://github.com/sebs/etherscanio-rb. 3rd party using to the API at etherscan.io'
|
data/lib/etherscan/api.rb
CHANGED
@@ -97,6 +97,20 @@ module Etherscan
|
|
97
97
|
end
|
98
98
|
end
|
99
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
|
+
|
100
114
|
module Proxy
|
101
115
|
class << self
|
102
116
|
def eth_block_number
|
data/lib/etherscan/call.rb
CHANGED
@@ -25,7 +25,11 @@ module Etherscan
|
|
25
25
|
:index,
|
26
26
|
:position,
|
27
27
|
:gasPrice,
|
28
|
-
:gas
|
28
|
+
:gas,
|
29
|
+
:fromBlock,
|
30
|
+
:toBlock,
|
31
|
+
:address,
|
32
|
+
:topics
|
29
33
|
|
30
34
|
CHAINS = {
|
31
35
|
mainnet: 'http://api.etherscan.io/api?',
|
@@ -77,7 +81,14 @@ module Etherscan
|
|
77
81
|
uri += '&index=' + index if index
|
78
82
|
uri += '&position=' + position if position
|
79
83
|
uri += '&gasPrice=' + gasPrice if gasPrice
|
80
|
-
uri += '&
|
84
|
+
uri += '&fromBlock=' + fromBlock if fromBlock
|
85
|
+
uri += '&toBlock=' + toBlock if toBlock
|
86
|
+
uri += '&address=' + address if address
|
87
|
+
if topics
|
88
|
+
topics.each do |topic|
|
89
|
+
uri += "&#{topic['name']}=" + topic['value']
|
90
|
+
end
|
91
|
+
end
|
81
92
|
@base + uri
|
82
93
|
end
|
83
94
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etherscan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wuminzhe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|