cns 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -16
- data/lib/cns/bigquery.rb +17 -13
- data/lib/cns/etherscan.rb +1 -1
- data/lib/cns/version.rb +1 -1
- data/lib/cns.rb +17 -9
- 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: 45769e2c9873fde5f217a92be47bd9edcd0a77905ec9d27c1b82283e0213804e
|
4
|
+
data.tar.gz: 5e7b71fe4bd2f7c8dc1d2dd61728f3613782c233a36bb25081632da492f3fc00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb5aae58de58afb5441027c272d3e66fb3f9fe7ff7466d530abf484c2ef5e636fb69755772a08f4e1423b3cf26adee16c623b3c448bd55f25da3a990f6f5448b
|
7
|
+
data.tar.gz: 491c8dbab0204e1736c9438d84996be60bcaa8bccc1cf5592aa5d32cbabfb08d4ee1798c4af959eda2ff2762a0b5b99d43bc346cfaedf028f5d829f2aba8d094
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cns (0.4.
|
4
|
+
cns (0.4.4)
|
5
5
|
curb
|
6
6
|
faraday
|
7
7
|
google-cloud-bigquery
|
@@ -14,18 +14,20 @@ GEM
|
|
14
14
|
public_suffix (>= 2.0.2, < 6.0)
|
15
15
|
ast (2.4.2)
|
16
16
|
backport (1.2.0)
|
17
|
-
|
17
|
+
base64 (0.2.0)
|
18
|
+
benchmark (0.3.0)
|
18
19
|
concurrent-ruby (1.2.2)
|
19
20
|
curb (1.0.5)
|
20
21
|
declarative (0.0.20)
|
21
22
|
e2mmap (0.1.0)
|
22
|
-
faraday (2.7.
|
23
|
+
faraday (2.7.11)
|
24
|
+
base64
|
23
25
|
faraday-net_http (>= 2.0, < 3.1)
|
24
26
|
ruby2_keywords (>= 0.0.4)
|
25
27
|
faraday-net_http (3.0.2)
|
26
|
-
google-apis-bigquery_v2 (0.
|
28
|
+
google-apis-bigquery_v2 (0.60.0)
|
27
29
|
google-apis-core (>= 0.11.0, < 2.a)
|
28
|
-
google-apis-core (0.11.
|
30
|
+
google-apis-core (0.11.2)
|
29
31
|
addressable (~> 2.5, >= 2.5.1)
|
30
32
|
googleauth (>= 0.16.2, < 2.a)
|
31
33
|
httpclient (>= 2.8.1, < 3.a)
|
@@ -34,7 +36,7 @@ GEM
|
|
34
36
|
retriable (>= 2.0, < 4.a)
|
35
37
|
rexml
|
36
38
|
webrick
|
37
|
-
google-cloud-bigquery (1.
|
39
|
+
google-cloud-bigquery (1.45.0)
|
38
40
|
concurrent-ruby (~> 1.0)
|
39
41
|
google-apis-bigquery_v2 (~> 0.1)
|
40
42
|
google-cloud-core (~> 1.6)
|
@@ -46,10 +48,9 @@ GEM
|
|
46
48
|
google-cloud-env (1.6.0)
|
47
49
|
faraday (>= 0.17.3, < 3.0)
|
48
50
|
google-cloud-errors (1.3.1)
|
49
|
-
googleauth (1.
|
51
|
+
googleauth (1.8.1)
|
50
52
|
faraday (>= 0.17.3, < 3.a)
|
51
53
|
jwt (>= 1.4, < 3.0)
|
52
|
-
memoist (~> 0.16)
|
53
54
|
multi_json (~> 1.11)
|
54
55
|
os (>= 0.9, < 2.0)
|
55
56
|
signet (>= 0.16, < 2.a)
|
@@ -61,10 +62,9 @@ GEM
|
|
61
62
|
kramdown-parser-gfm (1.1.0)
|
62
63
|
kramdown (~> 2.0)
|
63
64
|
kwalify (0.7.2)
|
64
|
-
|
65
|
-
mini_mime (1.1.2)
|
65
|
+
mini_mime (1.1.5)
|
66
66
|
multi_json (1.15.0)
|
67
|
-
nokogiri (1.15.
|
67
|
+
nokogiri (1.15.4-x86_64-linux)
|
68
68
|
racc (~> 1.4)
|
69
69
|
os (1.1.4)
|
70
70
|
parallel (1.23.0)
|
@@ -72,7 +72,7 @@ GEM
|
|
72
72
|
ast (~> 2.4.1)
|
73
73
|
psych (3.3.4)
|
74
74
|
public_suffix (5.0.3)
|
75
|
-
racc (1.7.
|
75
|
+
racc (1.7.3)
|
76
76
|
rainbow (3.1.1)
|
77
77
|
rake (12.3.3)
|
78
78
|
reek (6.0.2)
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
|
81
81
|
psych (~> 3.1)
|
82
82
|
rainbow (>= 2.0, < 4.0)
|
83
|
-
regexp_parser (2.8.
|
83
|
+
regexp_parser (2.8.2)
|
84
84
|
representable (3.2.0)
|
85
85
|
declarative (< 0.1.0)
|
86
86
|
trailblazer-option (>= 0.1.1, < 0.2.0)
|
@@ -107,7 +107,7 @@ GEM
|
|
107
107
|
slop (~> 3.4, >= 3.4.7)
|
108
108
|
ruby-progressbar (1.13.0)
|
109
109
|
ruby2_keywords (0.0.5)
|
110
|
-
signet (0.
|
110
|
+
signet (0.18.0)
|
111
111
|
addressable (~> 2.8)
|
112
112
|
faraday (>= 0.17.5, < 3.a)
|
113
113
|
jwt (>= 1.5, < 3.0)
|
@@ -127,8 +127,8 @@ GEM
|
|
127
127
|
thor (~> 1.0)
|
128
128
|
tilt (~> 2.0)
|
129
129
|
yard (~> 0.9, >= 0.9.24)
|
130
|
-
thor (1.
|
131
|
-
tilt (2.
|
130
|
+
thor (1.3.0)
|
131
|
+
tilt (2.3.0)
|
132
132
|
trailblazer-option (0.1.2)
|
133
133
|
uber (0.1.0)
|
134
134
|
unicode-display_width (1.8.0)
|
data/lib/cns/bigquery.rb
CHANGED
@@ -41,12 +41,6 @@ module Cns
|
|
41
41
|
#apibc.mostra_resumo
|
42
42
|
end
|
43
43
|
|
44
|
-
# mostra situacao completa entre kraken/etherscan & bigquery
|
45
|
-
def mostra_skrk
|
46
|
-
apius.mostra_resumo
|
47
|
-
apies.mostra_resumo
|
48
|
-
end
|
49
|
-
|
50
44
|
# insere (caso existam) dados novos kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain no bigquery
|
51
45
|
def processa_tudo
|
52
46
|
processa_us
|
@@ -57,12 +51,28 @@ module Cns
|
|
57
51
|
#processa_bc
|
58
52
|
end
|
59
53
|
|
60
|
-
#
|
54
|
+
# mostra situacao completa entre kraken/etherscan & bigquery
|
55
|
+
def mostra_skrk
|
56
|
+
apius.mostra_resumo
|
57
|
+
apies.mostra_resumo
|
58
|
+
end
|
59
|
+
|
60
|
+
# mostra situacao completa entre etherscan & bigquery
|
61
|
+
def mostra_seth
|
62
|
+
apies.mostra_resumo
|
63
|
+
end
|
64
|
+
|
65
|
+
# insere (caso existam) dados novos kraken/etherscan no bigquery
|
61
66
|
def processa_wkrk
|
62
67
|
processa_us
|
63
68
|
processa_eth
|
64
69
|
end
|
65
70
|
|
71
|
+
# insere (caso existam) dados novos etherscan no bigquery
|
72
|
+
def processa_weth
|
73
|
+
processa_eth
|
74
|
+
end
|
75
|
+
|
66
76
|
# insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
|
67
77
|
def processa_eth
|
68
78
|
puts(format("%<n>4i TRANSACOES ETH NORMAIS\tINSERIDAS etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
|
@@ -72,12 +82,6 @@ module Cns
|
|
72
82
|
puts(format("%<n>4i TOKENS\tETH\t\tINSERIDAS ethk", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))
|
73
83
|
end
|
74
84
|
|
75
|
-
# insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
|
76
|
-
def processa_weth
|
77
|
-
#puts(format("%<m>16s etht %<t>4i NORMAIS\t;ethi %<i>4i INTERNAS\t;ethp %<p>4i BLOCK\t;ethw %<w>4i WITHDRAWALS\t;ethk %<k>4i TOKENS", m: Time.now.strftime("%Y-%m-%d %k:%M"), t: apies.novtx.empty? ? 0 : dml(etht_ins), i: apies.novix.empty? ? 0 : dml(ethi_ins), p: apies.novpx.empty? ? 0 : dml(ethp_ins), w: apies.novwx.empty? ? 0 : dml(ethw_ins), k: apies.novkx.empty? ? 0 : dml(ethk_ins)))
|
78
|
-
processa_eth
|
79
|
-
end
|
80
|
-
|
81
85
|
private
|
82
86
|
|
83
87
|
# insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
|
data/lib/cns/etherscan.rb
CHANGED
@@ -231,7 +231,7 @@ module Cns
|
|
231
231
|
# @param (see formata_carteira)
|
232
232
|
# @return [Boolean] carteira tem transacoes novas(sim=NOK, nao=OK)?
|
233
233
|
def ok?(hjn)
|
234
|
-
hjn[:
|
234
|
+
hjn[:es].round(4) == hjn[:bs].round(4) && hjn[:bt].count == hjn[:et].count && hjn[:bi].count == hjn[:ei].count && hjn[:bp].count == hjn[:ep].count && hjn[:bk].count == hjn[:ek].count && hjn[:bw].count == hjn[:ew].count
|
235
235
|
end
|
236
236
|
|
237
237
|
# @example ether address inicio..fim
|
data/lib/cns/version.rb
CHANGED
data/lib/cns.rb
CHANGED
@@ -16,6 +16,14 @@ require('cns/version')
|
|
16
16
|
module Cns
|
17
17
|
# classe para carregar/mostrar dados transacoes eth & eos no bigquery
|
18
18
|
class CLI < Thor
|
19
|
+
desc 'seth', 'mostra eth transacoes'
|
20
|
+
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
21
|
+
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
22
|
+
# mostra eth transacoes
|
23
|
+
def seth
|
24
|
+
Bigquery.new(options).mostra_seth
|
25
|
+
end
|
26
|
+
|
19
27
|
desc 'weth', 'carrega transacoes eth no bigquery'
|
20
28
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
21
29
|
# carrega transacoes eth no bigquery
|
@@ -23,6 +31,14 @@ module Cns
|
|
23
31
|
Bigquery.new(options).processa_weth
|
24
32
|
end
|
25
33
|
|
34
|
+
desc 'skrk', 'mostra kraken/eth transacoes'
|
35
|
+
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
36
|
+
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
37
|
+
# mostra kraken/eth transacoes
|
38
|
+
def skrk
|
39
|
+
Bigquery.new(options).mostra_skrk
|
40
|
+
end
|
41
|
+
|
26
42
|
desc 'wkrk', 'carrega transacoes kraken/eth no bigquery'
|
27
43
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
28
44
|
# carrega transacoes kraken/eth no bigquery
|
@@ -45,14 +61,6 @@ module Cns
|
|
45
61
|
Bigquery.new(options).mostra_tudo
|
46
62
|
end
|
47
63
|
|
48
|
-
|
49
|
-
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
50
|
-
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
51
|
-
# mostra kraken/eth transacoes
|
52
|
-
def skrk
|
53
|
-
Bigquery.new(options).mostra_skrk
|
54
|
-
end
|
55
|
-
|
56
|
-
default_task :skrk
|
64
|
+
default_task :seth
|
57
65
|
end
|
58
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hernâni Rodrigues Vaz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|