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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24061c2f0fb3329c6ad7a8ab15a1ede303540fc7
4
- data.tar.gz: a5de5871c9e31b270eb701f57ceba1bc18a7a605
3
+ metadata.gz: 372ac903b684c55409d2178d34aea62612585484
4
+ data.tar.gz: 5843eaf51407e72637a058b1637114addee17edd
5
5
  SHA512:
6
- metadata.gz: 21123a6e72030bc3ef4f66ccb0de652837930e11ccbf2b76413941859c9f62008ccfd969d607f292a6c5e714f3ef8f7546a8a37c9a9c9a8d0fd042db31ea79e2
7
- data.tar.gz: edac0b54f8967f23a7036e11912cc4add206646ce57a928a66f9e7af7675a681cd6121144b977b1ef4bb8ff9d13da0a7be32c278085bcca4c260abe6e0b39618
6
+ metadata.gz: 2a857ad77f9e450cff668f3b4dd7e5dcdf961696a727eeec8201bc6b4ac3462b267af7c3a513c3861b564cca25951efe5c329c572c42cf5e1ec3b72bcd186f94
7
+ data.tar.gz: eec15eec7fb42ce24b85efdb5bedd99fdaff889a70f03b162da0142bdbc5e112c955b68476b2ae1dab8635067d549e4099f37966ec7bdbeccbfa6db624fecd04
@@ -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.0'
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'
@@ -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
@@ -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 += '&gas=' + gas if gas
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.0
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-19 00:00:00.000000000 Z
11
+ date: 2017-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client