cns 0.2.0 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +48 -40
- data/lib/cns/bigquery1.rb +10 -10
- data/lib/cns/bigquery2.rb +1 -1
- data/lib/cns/etherscan1.rb +2 -2
- data/lib/cns/version.rb +1 -1
- 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: a47862314401c42edfb5a5d8755d61426eff0ec3bb442cc7212ea248882b6851
|
4
|
+
data.tar.gz: 8295b8dd35aa236f53161ede0e1a5f09226d07380dd92e2cbbd889a54f5656e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 794219bb93e08571b3413157a2290e7c8b1812c23ff548fcd4adc75322aa345785e1c4fc8394b5c102022d791cac4fc62bb2b52f6b680e2136752266444022b1
|
7
|
+
data.tar.gz: 3f4f1e6c6c0b17a4501d32eb5a90a8270311d0d19ee268911bb49e73ff8c87a73f80185a2f4997441dd9e6e81e345097c902a6fa2d952740964d40293ed5da2b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cns (0.2.
|
4
|
+
cns (0.2.5)
|
5
5
|
curb
|
6
6
|
faraday
|
7
7
|
google-cloud-bigquery
|
@@ -12,41 +12,47 @@ GEM
|
|
12
12
|
specs:
|
13
13
|
addressable (2.7.0)
|
14
14
|
public_suffix (>= 2.0.2, < 5.0)
|
15
|
-
ast (2.4.
|
15
|
+
ast (2.4.2)
|
16
16
|
backport (1.1.2)
|
17
17
|
benchmark (0.1.1)
|
18
|
-
concurrent-ruby (1.1.
|
18
|
+
concurrent-ruby (1.1.8)
|
19
19
|
curb (0.9.11)
|
20
20
|
declarative (0.0.20)
|
21
|
-
declarative-option (0.1.0)
|
22
21
|
e2mmap (0.1.0)
|
23
|
-
faraday (1.
|
22
|
+
faraday (1.4.1)
|
23
|
+
faraday-excon (~> 1.1)
|
24
24
|
faraday-net_http (~> 1.0)
|
25
|
+
faraday-net_http_persistent (~> 1.1)
|
25
26
|
multipart-post (>= 1.2, < 3)
|
26
|
-
ruby2_keywords
|
27
|
-
faraday-
|
28
|
-
|
27
|
+
ruby2_keywords (>= 0.0.4)
|
28
|
+
faraday-excon (1.1.0)
|
29
|
+
faraday-net_http (1.0.1)
|
30
|
+
faraday-net_http_persistent (1.1.0)
|
31
|
+
google-apis-bigquery_v2 (0.9.0)
|
32
|
+
google-apis-core (~> 0.1)
|
33
|
+
google-apis-core (0.3.0)
|
29
34
|
addressable (~> 2.5, >= 2.5.1)
|
30
|
-
googleauth (~> 0.
|
35
|
+
googleauth (~> 0.14)
|
31
36
|
httpclient (>= 2.8.1, < 3.0)
|
32
37
|
mini_mime (~> 1.0)
|
33
38
|
representable (~> 3.0)
|
34
39
|
retriable (>= 2.0, < 4.0)
|
35
40
|
rexml
|
36
|
-
signet (~> 0.
|
37
|
-
|
41
|
+
signet (~> 0.14)
|
42
|
+
webrick
|
43
|
+
google-cloud-bigquery (1.31.0)
|
38
44
|
concurrent-ruby (~> 1.0)
|
39
|
-
google-
|
45
|
+
google-apis-bigquery_v2 (~> 0.1)
|
40
46
|
google-cloud-core (~> 1.2)
|
41
47
|
googleauth (~> 0.9)
|
42
48
|
mini_mime (~> 1.0)
|
43
|
-
google-cloud-core (1.
|
49
|
+
google-cloud-core (1.6.0)
|
44
50
|
google-cloud-env (~> 1.0)
|
45
51
|
google-cloud-errors (~> 1.0)
|
46
|
-
google-cloud-env (1.
|
52
|
+
google-cloud-env (1.5.0)
|
47
53
|
faraday (>= 0.17.3, < 2.0)
|
48
|
-
google-cloud-errors (1.0
|
49
|
-
googleauth (0.
|
54
|
+
google-cloud-errors (1.1.0)
|
55
|
+
googleauth (0.16.2)
|
50
56
|
faraday (>= 0.17.3, < 2.0)
|
51
57
|
jwt (>= 1.4, < 3.0)
|
52
58
|
memoist (~> 0.16)
|
@@ -55,64 +61,64 @@ GEM
|
|
55
61
|
signet (~> 0.14)
|
56
62
|
httpclient (2.8.3)
|
57
63
|
jaro_winkler (1.5.4)
|
58
|
-
jwt (2.2.
|
59
|
-
kramdown (2.3.
|
64
|
+
jwt (2.2.3)
|
65
|
+
kramdown (2.3.1)
|
60
66
|
rexml
|
61
67
|
kramdown-parser-gfm (1.1.0)
|
62
68
|
kramdown (~> 2.0)
|
63
69
|
kwalify (0.7.2)
|
64
70
|
memoist (0.16.2)
|
65
|
-
mini_mime (1.0
|
66
|
-
mini_portile2 (2.5.
|
71
|
+
mini_mime (1.1.0)
|
72
|
+
mini_portile2 (2.5.1)
|
67
73
|
multi_json (1.15.0)
|
68
74
|
multipart-post (2.1.1)
|
69
|
-
nokogiri (1.11.
|
75
|
+
nokogiri (1.11.3)
|
70
76
|
mini_portile2 (~> 2.5.0)
|
71
77
|
racc (~> 1.4)
|
72
78
|
os (1.1.1)
|
73
79
|
parallel (1.20.1)
|
74
|
-
parser (
|
80
|
+
parser (3.0.1.1)
|
75
81
|
ast (~> 2.4.1)
|
76
|
-
psych (3.3.
|
82
|
+
psych (3.3.1)
|
77
83
|
public_suffix (4.0.6)
|
78
84
|
racc (1.5.2)
|
79
85
|
rainbow (3.0.0)
|
80
86
|
rake (12.3.3)
|
81
|
-
reek (6.0.
|
87
|
+
reek (6.0.4)
|
82
88
|
kwalify (~> 0.7.0)
|
83
|
-
parser (
|
89
|
+
parser (~> 3.0.0)
|
84
90
|
psych (~> 3.1)
|
85
91
|
rainbow (>= 2.0, < 4.0)
|
86
|
-
regexp_parser (2.
|
87
|
-
representable (3.
|
92
|
+
regexp_parser (2.1.1)
|
93
|
+
representable (3.1.1)
|
88
94
|
declarative (< 0.1.0)
|
89
|
-
|
95
|
+
trailblazer-option (>= 0.1.1, < 0.2.0)
|
90
96
|
uber (< 0.2.0)
|
91
97
|
retriable (3.1.2)
|
92
98
|
reverse_markdown (2.0.0)
|
93
99
|
nokogiri
|
94
|
-
rexml (3.2.
|
95
|
-
rubocop (1.
|
100
|
+
rexml (3.2.5)
|
101
|
+
rubocop (1.13.0)
|
96
102
|
parallel (~> 1.10)
|
97
|
-
parser (>=
|
103
|
+
parser (>= 3.0.0.0)
|
98
104
|
rainbow (>= 2.2.2, < 4.0)
|
99
105
|
regexp_parser (>= 1.8, < 3.0)
|
100
106
|
rexml
|
101
107
|
rubocop-ast (>= 1.2.0, < 2.0)
|
102
108
|
ruby-progressbar (~> 1.7)
|
103
|
-
unicode-display_width (>= 1.4.0, <
|
104
|
-
rubocop-ast (1.
|
105
|
-
parser (>=
|
109
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
110
|
+
rubocop-ast (1.5.0)
|
111
|
+
parser (>= 3.0.1.1)
|
106
112
|
rubocop-rake (0.5.1)
|
107
113
|
rubocop
|
108
114
|
ruby-progressbar (1.11.0)
|
109
|
-
ruby2_keywords (0.0.
|
110
|
-
signet (0.
|
115
|
+
ruby2_keywords (0.0.4)
|
116
|
+
signet (0.15.0)
|
111
117
|
addressable (~> 2.3)
|
112
118
|
faraday (>= 0.17.3, < 2.0)
|
113
119
|
jwt (>= 1.5, < 3.0)
|
114
120
|
multi_json (~> 1.10)
|
115
|
-
solargraph (0.40.
|
121
|
+
solargraph (0.40.4)
|
116
122
|
backport (~> 1.1)
|
117
123
|
benchmark
|
118
124
|
bundler (>= 1.17.2)
|
@@ -120,16 +126,18 @@ GEM
|
|
120
126
|
jaro_winkler (~> 1.5)
|
121
127
|
kramdown (~> 2.3)
|
122
128
|
kramdown-parser-gfm (~> 1.1)
|
123
|
-
parser (~>
|
129
|
+
parser (~> 3.0)
|
124
130
|
reverse_markdown (>= 1.0.5, < 3)
|
125
131
|
rubocop (>= 0.52)
|
126
132
|
thor (~> 1.0)
|
127
133
|
tilt (~> 2.0)
|
128
134
|
yard (~> 0.9, >= 0.9.24)
|
129
|
-
thor (1.0
|
135
|
+
thor (1.1.0)
|
130
136
|
tilt (2.0.10)
|
137
|
+
trailblazer-option (0.1.1)
|
131
138
|
uber (0.1.0)
|
132
|
-
unicode-display_width (
|
139
|
+
unicode-display_width (2.0.0)
|
140
|
+
webrick (1.7.0)
|
133
141
|
yard (0.9.26)
|
134
142
|
|
135
143
|
PLATFORMS
|
data/lib/cns/bigquery1.rb
CHANGED
@@ -55,38 +55,38 @@ module Cns
|
|
55
55
|
|
56
56
|
# insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
|
57
57
|
def processa_us
|
58
|
-
puts(format("%<n>4i TRADES
|
59
|
-
puts(format("%<n>4i LEDGER
|
58
|
+
puts(format("%<n>4i TRADES\tKRAKEN\t\tINSERIDAS ust", n: apius.trades.empty? ? 0 : dml(ust_ins)))
|
59
|
+
puts(format("%<n>4i LEDGER\tKRAKEN\t\tINSERIDAS usl", n: apius.ledger.empty? ? 0 : dml(usl_ins)))
|
60
60
|
end
|
61
61
|
|
62
62
|
# insere transacoes exchange bitcoinde novas nas tabelas det (trades), del (ledger)
|
63
63
|
def processa_de
|
64
|
-
puts(format("%<n>4i TRADES
|
65
|
-
puts(format("%<n>4i LEDGER
|
64
|
+
puts(format("%<n>4i TRADES\tBITCOINDE\tINSERIDAS det", n: apide.trades.empty? ? 0 : dml(det_ins)))
|
65
|
+
puts(format("%<n>4i LEDGER\tBITCOINDE\tINSERIDAS del", n: apide.ledger.empty? ? 0 : dml(del_ins)))
|
66
66
|
end
|
67
67
|
|
68
68
|
# insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
|
69
69
|
def processa_frmt
|
70
|
-
puts(format("%<n>4i LEDGER
|
71
|
-
puts(format("%<n>4i LEDGER
|
70
|
+
puts(format("%<n>4i LEDGER\tPAYMIUM\t\tINSERIDAS fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
|
71
|
+
puts(format("%<n>4i LEDGER\tTHEROCK\t\tINSERIDAS mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
|
72
72
|
end
|
73
73
|
|
74
74
|
# insere transacoes blockchain novas nas tabelas etht (norml), ethk (token)
|
75
75
|
def processa_eth
|
76
|
-
puts(format("%<n>4i TRANSACOES
|
77
|
-
puts(format("%<n>4i
|
76
|
+
puts(format("%<n>4i TRANSACOES\tETH\t\tINSERIDAS etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
|
77
|
+
puts(format("%<n>4i TOKENS\tETH\t\tINSERIDAS ethk", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))
|
78
78
|
end
|
79
79
|
|
80
80
|
# insere transacoes blockchain novas na tabela eos
|
81
81
|
def processa_eos
|
82
|
-
puts(format("%<n>4i TRANSACOES
|
82
|
+
puts(format("%<n>4i TRANSACOES\tEOS\t\tINSERIDAS eos ", n: apigm.novax.empty? ? 0 : dml(eost_ins)))
|
83
83
|
end
|
84
84
|
|
85
85
|
# insere historico sados novos na tabela eth2bh
|
86
86
|
def processa_bc
|
87
87
|
# puts(format("%<n>4i ATTESTATIONS INSERIDAS #{BD}.eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
|
88
88
|
# puts(format("%<n>4i PROPOSALS INSERIDAS #{BD}.eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
|
89
|
-
puts(format("%<n>4i BALANCES
|
89
|
+
puts(format("%<n>4i BALANCES\tETH2\t\tINSERIDOS eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
|
90
90
|
end
|
91
91
|
|
92
92
|
# cria job bigquery & verifica execucao
|
data/lib/cns/bigquery2.rb
CHANGED
@@ -15,7 +15,7 @@ module Cns
|
|
15
15
|
# @return [String] comando insert SQL formatado eth2bh
|
16
16
|
def eth2bh_ins
|
17
17
|
"insert #{BD}.eth2bh(balance,effectivebalance,epoch,validatorindex" \
|
18
|
-
") VALUES#{apibc.nov[0..
|
18
|
+
") VALUES#{apibc.nov[0..1300].map { |obj| eth2bh_1val(obj) }.join(',')}"
|
19
19
|
end
|
20
20
|
|
21
21
|
# @return [Etherscan] API blockchain ETH
|
data/lib/cns/etherscan1.rb
CHANGED
@@ -68,7 +68,7 @@ module Cns
|
|
68
68
|
# @param [Hash] abc account etherscan
|
69
69
|
# @return [Hash] dados etherscan - address, saldo & transacoes
|
70
70
|
def base_bc(abc)
|
71
|
-
acc = abc[:account]
|
71
|
+
acc = abc[:account].downcase
|
72
72
|
{
|
73
73
|
ax: acc,
|
74
74
|
sl: (abc[:balance].to_d / 10**18).round(10),
|
@@ -99,7 +99,7 @@ module Cns
|
|
99
99
|
def filtrar_tx(add, ary)
|
100
100
|
# elimina transferencia from: (lax) to: (add) - esta transferencia aparece em from: (add) to: (lax)
|
101
101
|
# elimina chaves irrelevantes (DL) & adiciona chave indice itx & adiciona identificador da carteira iax
|
102
|
-
ary.delete_if { |odl| odl[:to]
|
102
|
+
ary.delete_if { |odl| add.casecmp?(odl[:to]) && lax.include?(odl[:from].downcase) }
|
103
103
|
.map { |omp| omp.delete_if { |key, _| DL.include?(key) }.merge(itx: Integer(omp[:blockNumber]), iax: add) }
|
104
104
|
end
|
105
105
|
|
data/lib/cns/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.5
|
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: 2021-
|
11
|
+
date: 2021-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|