cns 0.4.6 → 0.4.7
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/lib/cns/bigquery.rb +24 -10
- data/lib/cns/version.rb +1 -1
- data/lib/cns.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a24c9cad5196eefe37baa1ae78f0cf5a0f5357a8af744f04aa229984ffbad6e8
|
4
|
+
data.tar.gz: aafa7826231e9fcb8613bfb0ec5c290c4159fbd64301335c993669a562c640f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d405b5023ab78dcf8b3530fb2f37cc0722b417483a2fa62a43215e9589420758f9a1d6aaf108083ff06a088f695f84bbee0d08e5a2ecdf6fbbfe9669439ed2f7
|
7
|
+
data.tar.gz: 7e50888e671d94ac3c5f3b9557577295ebefacc95bd94473dd7f70c95f73f0099a2a9c1f58ea1bcae56dffc4e110506833cd478a492e969064ac1e51510e2ee9
|
data/Gemfile.lock
CHANGED
data/lib/cns/bigquery.rb
CHANGED
@@ -6,6 +6,7 @@ require('bigdecimal/util')
|
|
6
6
|
# @author Hernani Rodrigues Vaz
|
7
7
|
module Cns
|
8
8
|
BD = 'hernanirvaz.coins'
|
9
|
+
FO = File.expand_path('~/' + File.basename($0) + '.out')
|
9
10
|
|
10
11
|
# classe para processar bigquery
|
11
12
|
class Bigquery
|
@@ -67,39 +68,52 @@ module Cns
|
|
67
68
|
puts(Time.now.strftime("TRANSACOES %Y-%m-%d %H:%M ") + processa_eth)
|
68
69
|
end
|
69
70
|
|
71
|
+
# insere (caso existam) dados novos etherscan no bigquery (output to file)
|
72
|
+
def processa_ceth
|
73
|
+
File.open(FO, mode: 'a') { |out| out.puts(Time.now.strftime("TRANSACOES %Y-%m-%d %H:%M ") + processa_eth) }
|
74
|
+
end
|
75
|
+
|
70
76
|
private
|
71
77
|
|
72
78
|
# insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
|
79
|
+
#
|
80
|
+
# @return [String] linhas & tabelas afetadas
|
73
81
|
def processa_eth
|
74
82
|
str = "ETH"
|
75
|
-
str
|
76
|
-
str
|
77
|
-
str
|
78
|
-
str
|
79
|
-
str
|
83
|
+
str += format(" %<n>i etht", n: dml(etht_ins)) if apies.novtx.count > 0
|
84
|
+
str += format(" %<n>i ethi", n: dml(ethi_ins)) if apies.novix.count > 0
|
85
|
+
str += format(" %<n>i ethp", n: dml(ethp_ins)) if apies.novpx.count > 0
|
86
|
+
str += format(" %<n>i ethw", n: dml(ethw_ins)) if apies.novwx.count > 0
|
87
|
+
str += format(" %<n>i ethk", n: dml(ethk_ins)) if apies.novkx.count > 0
|
80
88
|
str
|
81
89
|
end
|
82
90
|
|
83
91
|
# insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
|
92
|
+
#
|
93
|
+
# @return [String] linhas & tabelas afetadas
|
84
94
|
def processa_us
|
85
95
|
str = "KRAKEN"
|
86
|
-
str
|
87
|
-
str
|
96
|
+
str += format(" %<n>i ust", n: dml(ust_ins)) if apius.trades.count > 0
|
97
|
+
str += format(" %<n>i usl", n: dml(usl_ins)) if apius.ledger.count > 0
|
88
98
|
str
|
89
99
|
end
|
90
100
|
|
91
101
|
# insere transacoes exchange bitcoinde novas nas tabelas det (trades), del (ledger)
|
102
|
+
#
|
103
|
+
# @return [String] linhas & tabelas afetadas
|
92
104
|
def processa_de
|
93
105
|
str = "BITCOINDE"
|
94
|
-
str
|
95
|
-
str
|
106
|
+
str += format(" %<n>i det", n: dml(det_ins)) if apide.trades.count > 0
|
107
|
+
str += format(" %<n>i del", n: dml(del_ins)) if apide.ledger.count > 0
|
96
108
|
str
|
97
109
|
end
|
98
110
|
|
99
111
|
# insere transacoes blockchain novas na tabela eos
|
112
|
+
#
|
113
|
+
# @return [String] linhas & tabelas afetadas
|
100
114
|
def processa_eos
|
101
115
|
str = "EOS"
|
102
|
-
str
|
116
|
+
str += format(" %<n>i eos ", n: dml(eost_ins)) if apigm.novax.count > 0
|
103
117
|
str
|
104
118
|
end
|
105
119
|
|
data/lib/cns/version.rb
CHANGED
data/lib/cns.rb
CHANGED
@@ -31,6 +31,13 @@ module Cns
|
|
31
31
|
Bigquery.new(options).processa_weth
|
32
32
|
end
|
33
33
|
|
34
|
+
desc 'ceth', 'carrega transacoes eth no bigquery (cron)'
|
35
|
+
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
36
|
+
# carrega transacoes eth no bigquery (output to file)
|
37
|
+
def ceth
|
38
|
+
Bigquery.new(options).processa_ceth
|
39
|
+
end
|
40
|
+
|
34
41
|
desc 'skrk', 'mostra kraken/eth transacoes'
|
35
42
|
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
36
43
|
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|