cronos_chain_scanner 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 52ca3f4634f77d69344ce1c5d25903d1b2836374935bc77a71ba7585af86dba6
4
- data.tar.gz: 4d9f22b0c2fdb360b82aaa115734e3fa70349f2376cacc00bdf074c55af1b991
3
+ metadata.gz: cb7778216c87b747047f78dfde57fda37a3b6519f842f2f0177cc30d86ed82a1
4
+ data.tar.gz: cc16ebf2c3ab529362f937da2de2e17ec68a83ddc2a776c36ea5467df19fbfa0
5
5
  SHA512:
6
- metadata.gz: 4c497250023771f2959580ad97f8956b92924cf6e668cff637206207ac62d8e3d49db5bf024ee5126be68edcb1f1afe206c514bc4cda949f34974d81230ee0ce
7
- data.tar.gz: e7ef49920c33ae5ea4f1b7a65da3afd4e7d1c872e4079f358c443849cce899f39847682e8bc322e979c2f6fbcfb9b192c5558bebdb564e6f7de4ded02c37adc6
6
+ metadata.gz: 3a70e16a9cd5c7a31d6bdcc4a727aeb54da8f741da469ccb7d74a4606307644f2287c7a4deae5d8d71c0190af9389686e20da02b906e5a07de034da1aacecffd
7
+ data.tar.gz: b03bcc5bb01e61b285611ac83f469892fbed488e6284e4cc364f6037696784665d326c9269d1d33edae8d659b748280590850c691765978ebc464d38f2c7ae0f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cronos_chain_scanner (0.1.4)
4
+ cronos_chain_scanner (0.1.5)
5
5
  faraday (~> 2.0)
6
6
  oj (~> 3.0)
7
7
 
data/README.md CHANGED
@@ -27,11 +27,19 @@ CronosChainScanner.net = 'testnet3' or CronosChainScanner.net = 'main' (default)
27
27
  ```ruby
28
28
  CronosChainScanner::Blocks.eth_block_number
29
29
 
30
+ CronosChainScanner::Contracts.listcontracts
31
+
30
32
  CronosChainScanner::Accounts.eth_get_balance(@address)
31
33
  CronosChainScanner::Accounts.txlist(@address, starttimestamp)
32
34
  CronosChainScanner::Accounts.tokenbalance(@contractaddress, @address)
33
35
 
34
36
  CronosChainScanner::Transactions.gettxinfo(@txhash)
37
+ CronosChainScanner::Transactions.gettxreceiptstatus(@txhash)
38
+ CronosChainScanner::Transactions.getstatus(@txhash)
39
+
40
+ CronosChainScanner::Tokens.getToken(@contractaddress)
41
+
42
+ CronosChainScanner::Contracts.listcontracts
35
43
  ```
36
44
 
37
45
  ## Development
@@ -10,6 +10,12 @@ module CronosChainScanner
10
10
 
11
11
  Request.get hash
12
12
  end
13
+
14
+ def getblockreward(blockno)
15
+ hash = DEFAULT_HASH.merge(action: 'getblockreward', blockno: blockno)
16
+
17
+ Request.get hash
18
+ end
13
19
  end
14
20
  end
15
21
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CronosChainScanner
4
+ class Contracts
5
+ class << self
6
+ DEFAULT_HASH = { module: 'contract' }.freeze
7
+
8
+ def listcontracts
9
+ hash = DEFAULT_HASH.merge(action: 'listcontracts')
10
+
11
+ Request.get hash
12
+ end
13
+ end
14
+ end
15
+ end
@@ -31,7 +31,6 @@ module CronosChainScanner
31
31
  end
32
32
 
33
33
  def params(hash)
34
- puts URI.encode_www_form(hash)
35
34
  '?' + URI.encode_www_form(hash)
36
35
  end
37
36
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CronosChainScanner
4
+ class Tokens
5
+ class << self
6
+ DEFAULT_HASH = { module: 'token' }.freeze
7
+
8
+ def getToken(contractaddress)
9
+ hash = DEFAULT_HASH.merge(action: 'getToken', contractaddress: contractaddress)
10
+
11
+ Request.get hash
12
+ end
13
+ end
14
+ end
15
+ end
@@ -17,6 +17,12 @@ module CronosChainScanner
17
17
 
18
18
  Request.get hash
19
19
  end
20
+
21
+ def getstatus(txhash)
22
+ hash = DEFAULT_HASH.merge(action: 'getstatus', txhash: txhash)
23
+
24
+ Request.get hash
25
+ end
20
26
  end
21
27
  end
22
28
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CronosChainScanner
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
 
@@ -5,6 +5,8 @@ require_relative "cronos_chain_scanner/request"
5
5
  require_relative "cronos_chain_scanner/accounts"
6
6
  require_relative "cronos_chain_scanner/transactions"
7
7
  require_relative "cronos_chain_scanner/blocks"
8
+ require_relative "cronos_chain_scanner/contracts"
9
+ require_relative "cronos_chain_scanner/tokens"
8
10
 
9
11
  module CronosChainScanner
10
12
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronos_chain_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - menghuanwd
@@ -97,7 +97,9 @@ files:
97
97
  - lib/cronos_chain_scanner.rb
98
98
  - lib/cronos_chain_scanner/accounts.rb
99
99
  - lib/cronos_chain_scanner/blocks.rb
100
+ - lib/cronos_chain_scanner/contracts.rb
100
101
  - lib/cronos_chain_scanner/request.rb
102
+ - lib/cronos_chain_scanner/tokens.rb
101
103
  - lib/cronos_chain_scanner/transactions.rb
102
104
  - lib/cronos_chain_scanner/version.rb
103
105
  homepage: https://github.com/menghuanwd/cronos_chain_scanner