cronos_chain_scanner 0.1.4 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -0
- data/lib/cronos_chain_scanner/accounts.rb +6 -0
- data/lib/cronos_chain_scanner/blocks.rb +6 -0
- data/lib/cronos_chain_scanner/contracts.rb +15 -0
- data/lib/cronos_chain_scanner/request.rb +0 -1
- data/lib/cronos_chain_scanner/tokens.rb +15 -0
- data/lib/cronos_chain_scanner/transactions.rb +6 -0
- data/lib/cronos_chain_scanner/version.rb +1 -1
- data/lib/cronos_chain_scanner.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 259fbd12cf721da39b67b2ac2def57de96051878a9ce966475b17c9a3c7ea512
|
4
|
+
data.tar.gz: a623bdea524320e6644fd6e99f848b7afbf30cbe9c458f8e4d428d93e05fb90d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6ee95d22f8cd54379ae9e1be003138c945d2d1d45fe230d572c321f412d8e967b459df35e86b027c4ca865e2e3c33171a4dc00f4621001389aa44ff47f5d258
|
7
|
+
data.tar.gz: 88b7ee88b4512af9f5f2ede0c6279f7555fa7c1262e7071d608f60b003444cf954a6fe811d6a742e3bfa2bb3e968f4ebac4ddd578cd28e3e9ee51da028f1a643
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -27,11 +27,20 @@ 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)
|
33
|
+
CronosChainScanner::Accounts.balance(@address)
|
31
34
|
CronosChainScanner::Accounts.txlist(@address, starttimestamp)
|
32
35
|
CronosChainScanner::Accounts.tokenbalance(@contractaddress, @address)
|
33
36
|
|
34
37
|
CronosChainScanner::Transactions.gettxinfo(@txhash)
|
38
|
+
CronosChainScanner::Transactions.gettxreceiptstatus(@txhash)
|
39
|
+
CronosChainScanner::Transactions.getstatus(@txhash)
|
40
|
+
|
41
|
+
CronosChainScanner::Tokens.getToken(@contractaddress)
|
42
|
+
|
43
|
+
CronosChainScanner::Contracts.listcontracts
|
35
44
|
```
|
36
45
|
|
37
46
|
## Development
|
@@ -11,6 +11,12 @@ module CronosChainScanner
|
|
11
11
|
Request.get hash
|
12
12
|
end
|
13
13
|
|
14
|
+
def balance(address)
|
15
|
+
hash = DEFAULT_HASH.merge(action: 'balance', address: address)
|
16
|
+
|
17
|
+
Request.get hash
|
18
|
+
end
|
19
|
+
|
14
20
|
def txlist(address, starttimestamp = nil, sort = 'desc')
|
15
21
|
hash = DEFAULT_HASH.merge(action: 'txlist', address: address, starttimestamp: starttimestamp, sort: sort)
|
16
22
|
|
@@ -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
|
@@ -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
|
data/lib/cronos_chain_scanner.rb
CHANGED
@@ -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,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronos_chain_scanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- menghuanwd
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -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
|