cns 2.0.7 → 2.0.8
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 +49 -47
- data/lib/cns/apibc.rb +39 -8
- data/lib/cns/bigquery.rb +2 -1
- data/lib/cns/etherscan.rb +18 -46
- data/lib/cns/version.rb +1 -1
- data/lib/cns.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9662468bbf6e6a3b21b1a4326b2416e79887037ea77a7009876e0ac543529eb4
|
|
4
|
+
data.tar.gz: 4f303a99616e125a22145e8811c4a6a96de4de4e05b99d07851bfad08a9e737f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e11db3bd04f6df2e7d2fb69c094d990887ed0be224a6f050a01bfea3e7b2e34a22a2b46e7b7403723b85f5e14ab80c3409a6dca2df941eb4258c78161acebe5
|
|
7
|
+
data.tar.gz: 857d01de778bb491a5f69481f20d4b3277aac83e95b6f2f9b5f65be7254a3510c09768e1a51dd4faef1acb1b6fae5355b13a3ed0b4e7221bc35ac557da6b5e61
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cns (2.0.
|
|
4
|
+
cns (2.0.8)
|
|
5
5
|
curb
|
|
6
6
|
faraday
|
|
7
7
|
faraday-retry
|
|
@@ -12,15 +12,15 @@ PATH
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
addressable (2.8.
|
|
16
|
-
public_suffix (>= 2.0.2, <
|
|
15
|
+
addressable (2.8.8)
|
|
16
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
17
17
|
ast (2.4.3)
|
|
18
18
|
backport (1.2.0)
|
|
19
19
|
base64 (0.3.0)
|
|
20
|
-
benchmark (0.
|
|
21
|
-
bigdecimal (3.
|
|
20
|
+
benchmark (0.5.0)
|
|
21
|
+
bigdecimal (3.3.1)
|
|
22
22
|
concurrent-ruby (1.3.5)
|
|
23
|
-
curb (1.
|
|
23
|
+
curb (1.2.2)
|
|
24
24
|
declarative (0.0.20)
|
|
25
25
|
diff-lcs (1.6.2)
|
|
26
26
|
dry-configurable (1.3.0)
|
|
@@ -52,29 +52,31 @@ GEM
|
|
|
52
52
|
dry-inflector (~> 1.0)
|
|
53
53
|
dry-logic (~> 1.4)
|
|
54
54
|
zeitwerk (~> 2.6)
|
|
55
|
-
faraday (2.
|
|
55
|
+
faraday (2.14.0)
|
|
56
56
|
faraday-net_http (>= 2.0, < 3.5)
|
|
57
57
|
json
|
|
58
58
|
logger
|
|
59
|
-
faraday-
|
|
60
|
-
|
|
59
|
+
faraday-follow_redirects (0.4.0)
|
|
60
|
+
faraday (>= 1, < 3)
|
|
61
|
+
faraday-net_http (3.4.2)
|
|
62
|
+
net-http (~> 0.5)
|
|
61
63
|
faraday-retry (2.3.2)
|
|
62
64
|
faraday (~> 2.0)
|
|
63
|
-
google-apis-bigquery_v2 (0.
|
|
65
|
+
google-apis-bigquery_v2 (0.96.0)
|
|
64
66
|
google-apis-core (>= 0.15.0, < 2.a)
|
|
65
|
-
google-apis-core (0.
|
|
66
|
-
addressable (~> 2.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
google-apis-core (1.0.2)
|
|
68
|
+
addressable (~> 2.8, >= 2.8.7)
|
|
69
|
+
faraday (~> 2.13)
|
|
70
|
+
faraday-follow_redirects (~> 0.3)
|
|
71
|
+
googleauth (~> 1.14)
|
|
72
|
+
mini_mime (~> 1.1)
|
|
71
73
|
representable (~> 3.0)
|
|
72
|
-
retriable (
|
|
73
|
-
google-cloud-bigquery (1.
|
|
74
|
+
retriable (~> 3.1)
|
|
75
|
+
google-cloud-bigquery (1.61.1)
|
|
74
76
|
bigdecimal (~> 3.0)
|
|
75
77
|
concurrent-ruby (~> 1.0)
|
|
76
78
|
google-apis-bigquery_v2 (~> 0.71)
|
|
77
|
-
google-apis-core (
|
|
79
|
+
google-apis-core (>= 0.18, < 2)
|
|
78
80
|
google-cloud-core (~> 1.6)
|
|
79
81
|
googleauth (~> 1.9)
|
|
80
82
|
mini_mime (~> 1.0)
|
|
@@ -86,19 +88,17 @@ GEM
|
|
|
86
88
|
faraday (>= 1.0, < 3.a)
|
|
87
89
|
google-cloud-errors (1.5.0)
|
|
88
90
|
google-logging-utils (0.2.0)
|
|
89
|
-
googleauth (1.
|
|
91
|
+
googleauth (1.16.0)
|
|
90
92
|
faraday (>= 1.0, < 3.a)
|
|
91
93
|
google-cloud-env (~> 2.2)
|
|
92
94
|
google-logging-utils (~> 0.1)
|
|
93
|
-
jwt (>= 1.4, <
|
|
95
|
+
jwt (>= 1.4, < 4.0)
|
|
94
96
|
multi_json (~> 1.11)
|
|
95
97
|
os (>= 0.9, < 2.0)
|
|
96
98
|
signet (>= 0.16, < 2.a)
|
|
97
|
-
httpclient (2.9.0)
|
|
98
|
-
mutex_m
|
|
99
99
|
jaro_winkler (1.6.1)
|
|
100
|
-
json (2.
|
|
101
|
-
jwt (
|
|
100
|
+
json (2.16.0)
|
|
101
|
+
jwt (3.1.2)
|
|
102
102
|
base64
|
|
103
103
|
kramdown (2.5.1)
|
|
104
104
|
rexml (>= 3.3.9)
|
|
@@ -110,24 +110,23 @@ GEM
|
|
|
110
110
|
memoist (0.16.2)
|
|
111
111
|
mini_mime (1.1.5)
|
|
112
112
|
multi_json (1.17.0)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
nokogiri (1.18.9-x86_64-linux-gnu)
|
|
113
|
+
net-http (0.8.0)
|
|
114
|
+
uri (>= 0.11.1)
|
|
115
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
|
117
116
|
racc (~> 1.4)
|
|
118
117
|
observer (0.1.2)
|
|
119
118
|
os (1.1.4)
|
|
120
119
|
ostruct (0.6.3)
|
|
121
120
|
parallel (1.27.0)
|
|
122
|
-
parser (3.3.
|
|
121
|
+
parser (3.3.10.0)
|
|
123
122
|
ast (~> 2.4.1)
|
|
124
123
|
racc
|
|
125
|
-
prism (1.
|
|
126
|
-
public_suffix (
|
|
124
|
+
prism (1.6.0)
|
|
125
|
+
public_suffix (7.0.0)
|
|
127
126
|
racc (1.8.1)
|
|
128
127
|
rainbow (3.1.1)
|
|
129
128
|
rake (12.3.3)
|
|
130
|
-
rbs (3.9.
|
|
129
|
+
rbs (3.9.5)
|
|
131
130
|
logger
|
|
132
131
|
reek (6.5.0)
|
|
133
132
|
dry-schema (~> 1.13)
|
|
@@ -135,7 +134,7 @@ GEM
|
|
|
135
134
|
parser (~> 3.3.0)
|
|
136
135
|
rainbow (>= 2.0, < 4.0)
|
|
137
136
|
rexml (~> 3.1)
|
|
138
|
-
regexp_parser (2.11.
|
|
137
|
+
regexp_parser (2.11.3)
|
|
139
138
|
representable (3.2.0)
|
|
140
139
|
declarative (< 0.1.0)
|
|
141
140
|
trailblazer-option (>= 0.1.1, < 0.2.0)
|
|
@@ -143,8 +142,8 @@ GEM
|
|
|
143
142
|
retriable (3.1.2)
|
|
144
143
|
reverse_markdown (3.0.0)
|
|
145
144
|
nokogiri
|
|
146
|
-
rexml (3.4.
|
|
147
|
-
rubocop (1.
|
|
145
|
+
rexml (3.4.4)
|
|
146
|
+
rubocop (1.81.7)
|
|
148
147
|
json (~> 2.3)
|
|
149
148
|
language_server-protocol (~> 3.17.0.2)
|
|
150
149
|
lint_roller (~> 1.1.0)
|
|
@@ -152,22 +151,22 @@ GEM
|
|
|
152
151
|
parser (>= 3.3.0.2)
|
|
153
152
|
rainbow (>= 2.2.2, < 4.0)
|
|
154
153
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
155
|
-
rubocop-ast (>= 1.
|
|
154
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
156
155
|
ruby-progressbar (~> 1.7)
|
|
157
156
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
158
|
-
rubocop-ast (1.
|
|
157
|
+
rubocop-ast (1.48.0)
|
|
159
158
|
parser (>= 3.3.7.2)
|
|
160
159
|
prism (~> 1.4)
|
|
161
160
|
rubocop-rake (0.7.1)
|
|
162
161
|
lint_roller (~> 1.1)
|
|
163
162
|
rubocop (>= 1.72.1)
|
|
164
163
|
ruby-progressbar (1.13.0)
|
|
165
|
-
signet (0.
|
|
164
|
+
signet (0.21.0)
|
|
166
165
|
addressable (~> 2.8)
|
|
167
166
|
faraday (>= 0.17.5, < 3.a)
|
|
168
|
-
jwt (>= 1.5, <
|
|
167
|
+
jwt (>= 1.5, < 4.0)
|
|
169
168
|
multi_json (~> 1.10)
|
|
170
|
-
solargraph (0.
|
|
169
|
+
solargraph (0.57.0)
|
|
171
170
|
backport (~> 1.2)
|
|
172
171
|
benchmark (~> 0.4)
|
|
173
172
|
bundler (~> 2.0)
|
|
@@ -180,22 +179,25 @@ GEM
|
|
|
180
179
|
ostruct (~> 0.6)
|
|
181
180
|
parser (~> 3.0)
|
|
182
181
|
prism (~> 1.4)
|
|
183
|
-
rbs (
|
|
182
|
+
rbs (>= 3.6.1, <= 4.0.0.dev.4)
|
|
184
183
|
reverse_markdown (~> 3.0)
|
|
185
|
-
rubocop (~> 1.
|
|
184
|
+
rubocop (~> 1.76)
|
|
186
185
|
thor (~> 1.0)
|
|
187
186
|
tilt (~> 2.0)
|
|
188
187
|
yard (~> 0.9, >= 0.9.24)
|
|
188
|
+
yard-activesupport-concern (~> 0.0)
|
|
189
189
|
yard-solargraph (~> 0.1)
|
|
190
190
|
thor (1.4.0)
|
|
191
191
|
tilt (2.6.1)
|
|
192
192
|
trailblazer-option (0.1.2)
|
|
193
193
|
uber (0.1.0)
|
|
194
|
-
unicode-display_width (3.
|
|
195
|
-
unicode-emoji (~> 4.
|
|
196
|
-
unicode-emoji (4.0
|
|
197
|
-
uri (1.
|
|
194
|
+
unicode-display_width (3.2.0)
|
|
195
|
+
unicode-emoji (~> 4.1)
|
|
196
|
+
unicode-emoji (4.1.0)
|
|
197
|
+
uri (1.1.1)
|
|
198
198
|
yard (0.9.37)
|
|
199
|
+
yard-activesupport-concern (0.0.1)
|
|
200
|
+
yard (>= 0.8)
|
|
199
201
|
yard-solargraph (0.1.0)
|
|
200
202
|
yard (~> 0.9)
|
|
201
203
|
zeitwerk (2.7.3)
|
data/lib/cns/apibc.rb
CHANGED
|
@@ -15,6 +15,7 @@ module Cns
|
|
|
15
15
|
@escn = bccn('https://api.etherscan.io')
|
|
16
16
|
@gmcn = bccn('https://eos.greymass.com')
|
|
17
17
|
@esky = ENV.fetch('ETHERSCAN_API_KEY', nil)
|
|
18
|
+
@blks = {} # Cache to store block numbers so we don't ask API repeatedly
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
# Get account balances for multiple ETH addresses
|
|
@@ -34,16 +35,19 @@ module Cns
|
|
|
34
35
|
|
|
35
36
|
# Get normal transactions for ETH address
|
|
36
37
|
# @param [String] add endereco ETH
|
|
38
|
+
# @param [Integer] days (Optional) Fetch only last N days
|
|
37
39
|
# @return [Array<Hash>] lista transacoes normais etherscan
|
|
38
|
-
def norml_es(add)
|
|
39
|
-
|
|
40
|
+
def norml_es(add, days: nil)
|
|
41
|
+
prm = days ? {startblock: start_block(days)} : {}
|
|
42
|
+
pag_es_req('txlist', add, prm)
|
|
40
43
|
end
|
|
41
44
|
|
|
42
45
|
# Get internal transactions for ETH address
|
|
43
46
|
# @param (see norml_es)
|
|
44
47
|
# @return [Array<Hash>] lista transacoes internas etherscan
|
|
45
|
-
def inter_es(add)
|
|
46
|
-
|
|
48
|
+
def inter_es(add, days: nil)
|
|
49
|
+
prm = days ? {startblock: start_block(days)} : {}
|
|
50
|
+
pag_es_req('txlistinternal', add, prm)
|
|
47
51
|
end
|
|
48
52
|
|
|
49
53
|
# Get mined blocks for ETH address
|
|
@@ -56,15 +60,17 @@ module Cns
|
|
|
56
60
|
# Get withdrawals for ETH address
|
|
57
61
|
# @param (see norml_es)
|
|
58
62
|
# @return [Array<Hash>] lista blocos etherscan
|
|
59
|
-
def withw_es(add)
|
|
60
|
-
|
|
63
|
+
def withw_es(add, days: nil)
|
|
64
|
+
prm = days ? {startblock: start_block(days)} : {}
|
|
65
|
+
pag_es_req('txsBeaconWithdrawal', add, prm)
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# Get token transfers for ETH address
|
|
64
69
|
# @param (see norml_es)
|
|
65
70
|
# @return [Array<Hash>] lista token transfer events etherscan
|
|
66
|
-
def token_es(add)
|
|
67
|
-
|
|
71
|
+
def token_es(add, days: nil)
|
|
72
|
+
prm = days ? {startblock: start_block(days)} : {}
|
|
73
|
+
pag_es_req('tokentx', add, prm)
|
|
68
74
|
end
|
|
69
75
|
|
|
70
76
|
# Get EOS account information
|
|
@@ -96,6 +102,31 @@ module Cns
|
|
|
96
102
|
|
|
97
103
|
private
|
|
98
104
|
|
|
105
|
+
# Calculate (and cache) the block number for N days ago
|
|
106
|
+
def start_block(days)
|
|
107
|
+
return 0 if days.nil?
|
|
108
|
+
return @blks[days] if @blks.key?(days)
|
|
109
|
+
|
|
110
|
+
res = block_req(Integer(Time.now - (days * 86_400)))
|
|
111
|
+
if res[:status] == '1'
|
|
112
|
+
blk = Integer(res[:result], 10)
|
|
113
|
+
@blks[days] = blk
|
|
114
|
+
blk
|
|
115
|
+
else
|
|
116
|
+
0
|
|
117
|
+
end
|
|
118
|
+
rescue StandardError
|
|
119
|
+
0
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# New dedicated method for Block API calls
|
|
123
|
+
def block_req(timestamp)
|
|
124
|
+
prm = {chainid: 1, module: 'block', action: 'getblocknobytime', timestamp: timestamp, closest: 'after', apikey: @esky}
|
|
125
|
+
pjsn(@escn.get('/v2/api', prm))
|
|
126
|
+
rescue Faraday::Error
|
|
127
|
+
{status: '0'}
|
|
128
|
+
end
|
|
129
|
+
|
|
99
130
|
# Make a request to the Etherscan API
|
|
100
131
|
# @param [String] act API action name
|
|
101
132
|
# @param [String] add Blockchain address
|
data/lib/cns/bigquery.rb
CHANGED
|
@@ -9,6 +9,7 @@ module Cns
|
|
|
9
9
|
# classe para processar bigquery
|
|
10
10
|
class Bigquery
|
|
11
11
|
extend Memoist
|
|
12
|
+
|
|
12
13
|
BD = 'hernanirvaz.coins'
|
|
13
14
|
FO = File.expand_path("~/#{File.basename($PROGRAM_NAME)}.log")
|
|
14
15
|
TB = {
|
|
@@ -79,7 +80,7 @@ module Cns
|
|
|
79
80
|
|
|
80
81
|
# mostra situacao completa entre etherscan & bigquery
|
|
81
82
|
def mseth
|
|
82
|
-
apies.
|
|
83
|
+
apies.mresumo
|
|
83
84
|
end
|
|
84
85
|
|
|
85
86
|
# @return [String] texto inicial transacoes
|
data/lib/cns/etherscan.rb
CHANGED
|
@@ -8,6 +8,7 @@ module Cns
|
|
|
8
8
|
# classe para processar transacoes do etherscan
|
|
9
9
|
class Etherscan
|
|
10
10
|
extend Memoist
|
|
11
|
+
|
|
11
12
|
# @return [Array<Hash>] todos os dados bigquery
|
|
12
13
|
# @return [Thor::CoreExt::HashWithIndifferentAccess] opcoes trabalho
|
|
13
14
|
attr_reader :bqd, :ops
|
|
@@ -59,19 +60,9 @@ module Cns
|
|
|
59
60
|
@ops = pop.transform_keys(&:to_sym)
|
|
60
61
|
end
|
|
61
62
|
|
|
62
|
-
# mostra resumo carteiras & transacoes & ajuste dias
|
|
63
|
-
def mresumo_simples
|
|
64
|
-
return unless bqexd.any?
|
|
65
|
-
|
|
66
|
-
puts("\nid address etherscan bigquery")
|
|
67
|
-
bqexd.each { |o| puts(focs(o)) }
|
|
68
|
-
mtransacoes_novas
|
|
69
|
-
mconfiguracao_ajuste_dias
|
|
70
|
-
end
|
|
71
|
-
|
|
72
63
|
# mostra resumo carteiras & transacoes & ajuste dias (com contadores)
|
|
73
64
|
def mresumo
|
|
74
|
-
return
|
|
65
|
+
return if bqexd.none?
|
|
75
66
|
|
|
76
67
|
puts("\nid address etherscan tn ti tb tk tw bigquery tn ti tb tk tw")
|
|
77
68
|
bqexd.each { |o| puts(foct(o)) }
|
|
@@ -95,26 +86,12 @@ module Cns
|
|
|
95
86
|
def mconfiguracao_ajuste_dias
|
|
96
87
|
TT.each do |p, c|
|
|
97
88
|
ntx = send(c[:new])
|
|
98
|
-
next
|
|
89
|
+
next if ntx.none?
|
|
99
90
|
|
|
100
91
|
puts("\najuste dias transacoes #{p}\n-h=#{ntx.sort_by { |s| -s[c[:sork]] }.map { |t| "#{t[c[:adjk]]}:0" }.join(' ')}")
|
|
101
92
|
end
|
|
102
93
|
end
|
|
103
94
|
|
|
104
|
-
# Format simple wallet summary
|
|
105
|
-
# @param [Hash] hjn dados juntos bigquery & etherscan
|
|
106
|
-
# @return [String] texto formatado duma carteira
|
|
107
|
-
def focs(hjn)
|
|
108
|
-
format(
|
|
109
|
-
'%<id>-6.6s %<address>-42.42s %<etherscan_value>13.6f %<bigquery_value>13.6f %<status>-3s',
|
|
110
|
-
id: hjn[:id],
|
|
111
|
-
address: hjn[:ax],
|
|
112
|
-
etherscan_value: hjn[:es],
|
|
113
|
-
bigquery_value: hjn[:bs],
|
|
114
|
-
status: ok?(hjn) ? 'OK' : 'NOK'
|
|
115
|
-
)
|
|
116
|
-
end
|
|
117
|
-
|
|
118
95
|
# Format detailed wallet summary with counters
|
|
119
96
|
# @param (see focs)
|
|
120
97
|
# @return [String] texto formatado duma carteira (com contadores)
|
|
@@ -139,23 +116,11 @@ module Cns
|
|
|
139
116
|
)
|
|
140
117
|
end
|
|
141
118
|
|
|
142
|
-
# Check if
|
|
119
|
+
# Check if wallets saldo
|
|
143
120
|
# @param (see focs)
|
|
144
|
-
# @return [Boolean] check saldo
|
|
121
|
+
# @return [Boolean] check saldo
|
|
145
122
|
def ok?(hjn)
|
|
146
|
-
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# @param (see focs)
|
|
150
|
-
# @return [Boolean] check contadores ipw
|
|
151
|
-
def okipw?(hjn)
|
|
152
|
-
oks?(hjn) && hjn[:bi].count == hjn[:ei].count && hjn[:bp].count == hjn[:ep].count && hjn[:bw].count == hjn[:ew].count
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
# @param (see focs)
|
|
156
|
-
# @return [Boolean] carteira tem transacoes novas (sim=NOK, nao=OK)?
|
|
157
|
-
def oks?(hjn)
|
|
158
|
-
hjn[:es].round(6) == hjn[:bs].round(6)
|
|
123
|
+
hjn[:es].round(4) == hjn[:bs].round(4)
|
|
159
124
|
end
|
|
160
125
|
|
|
161
126
|
# @example ether address inicio..fim
|
|
@@ -249,6 +214,12 @@ module Cns
|
|
|
249
214
|
ops[:t] || false
|
|
250
215
|
end
|
|
251
216
|
|
|
217
|
+
# Numero dias para buscar transacoes
|
|
218
|
+
# @return [Integer] days in the past to get transacoes
|
|
219
|
+
def dias
|
|
220
|
+
ops&.[](:d)&.positive? ? ops[:d] : nil
|
|
221
|
+
end
|
|
222
|
+
|
|
252
223
|
# Process timestamp
|
|
253
224
|
# @param [Hash] htx transacao
|
|
254
225
|
# @return [Hash] transaccao filtrada
|
|
@@ -288,14 +259,15 @@ module Cns
|
|
|
288
259
|
# @return [Hash] dados etherscan - address, saldo & transacoes
|
|
289
260
|
def esd(aes)
|
|
290
261
|
acc = aes[:account].downcase
|
|
262
|
+
dys = dias
|
|
291
263
|
{
|
|
292
264
|
ax: acc,
|
|
293
265
|
sl: aes[:balance].to_d / (10**18),
|
|
294
|
-
tx: ftik(acc, api.norml_es(acc)),
|
|
295
|
-
ix: ftik(acc, api.inter_es(acc)),
|
|
296
|
-
px: fppp(acc, api.block_es(acc)),
|
|
297
|
-
wx: fwww(acc, api.withw_es(acc)),
|
|
298
|
-
kx: ftik(acc, api.token_es(acc))
|
|
266
|
+
tx: ftik(acc, api.norml_es(acc, days: dys)),
|
|
267
|
+
ix: ftik(acc, api.inter_es(acc, days: dys)),
|
|
268
|
+
px: fppp(acc, api.block_es(acc)), # block_es (mining) does not support time filtering
|
|
269
|
+
wx: fwww(acc, api.withw_es(acc, days: dys)),
|
|
270
|
+
kx: ftik(acc, api.token_es(acc, days: dys))
|
|
299
271
|
}
|
|
300
272
|
end
|
|
301
273
|
|
data/lib/cns/version.rb
CHANGED
data/lib/cns.rb
CHANGED
|
@@ -16,6 +16,7 @@ module Cns
|
|
|
16
16
|
desc 'seth', 'mostra eth transacoes'
|
|
17
17
|
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
|
18
18
|
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
|
19
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
19
20
|
# mostra eth transacoes
|
|
20
21
|
def seth
|
|
21
22
|
Bigquery.new(options).mseth
|
|
@@ -23,6 +24,7 @@ module Cns
|
|
|
23
24
|
|
|
24
25
|
desc 'weth', 'carrega transacoes eth no bigquery'
|
|
25
26
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
|
27
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
26
28
|
# carrega transacoes eth no bigquery
|
|
27
29
|
def weth
|
|
28
30
|
Bigquery.new(options).pweth
|
|
@@ -30,6 +32,7 @@ module Cns
|
|
|
30
32
|
|
|
31
33
|
desc 'ceth', 'carrega transacoes eth no bigquery (cron)'
|
|
32
34
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
|
35
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
33
36
|
# carrega transacoes eth no bigquery (output to file)
|
|
34
37
|
def ceth
|
|
35
38
|
Bigquery.new(options).pceth
|
|
@@ -38,6 +41,7 @@ module Cns
|
|
|
38
41
|
desc 'skrk', 'mostra kraken/eth transacoes'
|
|
39
42
|
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
|
40
43
|
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
|
44
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
41
45
|
# mostra kraken/eth transacoes
|
|
42
46
|
def skrk
|
|
43
47
|
Bigquery.new(options).mskrk
|
|
@@ -45,6 +49,7 @@ module Cns
|
|
|
45
49
|
|
|
46
50
|
desc 'wkrk', 'carrega transacoes kraken/eth no bigquery'
|
|
47
51
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
|
52
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
48
53
|
# carrega transacoes kraken/eth no bigquery
|
|
49
54
|
def wkrk
|
|
50
55
|
Bigquery.new(options).pwkrk
|
|
@@ -52,6 +57,7 @@ module Cns
|
|
|
52
57
|
|
|
53
58
|
desc 'work', 'carrega transacoes novas no bigquery'
|
|
54
59
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
|
60
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
55
61
|
# carrega transacoes novas no bigquery
|
|
56
62
|
def work
|
|
57
63
|
Bigquery.new(options).ptudo
|
|
@@ -60,6 +66,7 @@ module Cns
|
|
|
60
66
|
desc 'show', 'mostra resumo transacoes'
|
|
61
67
|
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
|
62
68
|
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
|
69
|
+
option :d, type: :numeric, default: 0, desc: 'dias para buscar transacoes etherscan, 0=todas'
|
|
63
70
|
# mostra resumo transacoes
|
|
64
71
|
def show
|
|
65
72
|
Bigquery.new(options).mtudo
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cns
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hernâni Rodrigues Vaz
|
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
244
244
|
- !ruby/object:Gem::Version
|
|
245
245
|
version: '0'
|
|
246
246
|
requirements: []
|
|
247
|
-
rubygems_version: 3.
|
|
247
|
+
rubygems_version: 3.7.2
|
|
248
248
|
specification_version: 4
|
|
249
249
|
summary: Arquiva transactions etherscan/greymass/bitcoinde/kraken/paymium/therock
|
|
250
250
|
no bigquery.
|