cronos_chain_scanner 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/hackathon.rb +13 -0
- data/lib/cronos_chain_scanner/accounts.rb +6 -0
- data/lib/cronos_chain_scanner/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dc21a7125349e23d94ebf1a5d5cfebb47a2869832d5926bddf0a146e5c3f56b
|
4
|
+
data.tar.gz: d9fafc96f68935ed67ce6b8a647144f5ea0558c3cd014e6a68db5faae010bc05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 222f33621072923e1950324a5a53da3768a7fd58e7855ab839259291774917938ebbc73513f43b3daf4c25c86bf300c5aaa11fe3659cf857675537347c9bf962
|
7
|
+
data.tar.gz: f958bc86a618ad413fb0cdb04e54b2415cb6c9ecb90f04913a4bc49e6e38cc28ebdd2cd427c779fee7b78a025088ae175643c7e361f160c2082c8d41bcb0ad37
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -30,6 +30,7 @@ CronosChainScanner::Blocks.eth_block_number
|
|
30
30
|
CronosChainScanner::Contracts.listcontracts
|
31
31
|
|
32
32
|
CronosChainScanner::Accounts.eth_get_balance(@address)
|
33
|
+
CronosChainScanner::Accounts.balance(@address)
|
33
34
|
CronosChainScanner::Accounts.txlist(@address, starttimestamp)
|
34
35
|
CronosChainScanner::Accounts.tokenbalance(@contractaddress, @address)
|
35
36
|
|
data/hackathon.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'cronos_chain_scanner'
|
2
|
+
require 'active_support'
|
3
|
+
|
4
|
+
CronosChainScanner.net = 'testnet3'
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
@address = '0x0eE92A5c08480A966B2B503821c49F936686E440'
|
9
|
+
@timestamp = (Time.now - 3.days).to_i
|
10
|
+
|
11
|
+
res_doc = CronosChainScanner::Accounts.txlist(@address, @timestamp)
|
12
|
+
|
13
|
+
puts res_doc
|
@@ -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
|
|
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.6
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- bin/console
|
95
95
|
- bin/setup
|
96
96
|
- cronos_chain_scanner.gemspec
|
97
|
+
- hackathon.rb
|
97
98
|
- lib/cronos_chain_scanner.rb
|
98
99
|
- lib/cronos_chain_scanner/accounts.rb
|
99
100
|
- lib/cronos_chain_scanner/blocks.rb
|