cns 0.4.4 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45769e2c9873fde5f217a92be47bd9edcd0a77905ec9d27c1b82283e0213804e
4
- data.tar.gz: 5e7b71fe4bd2f7c8dc1d2dd61728f3613782c233a36bb25081632da492f3fc00
3
+ metadata.gz: 3bd191d0bb2b6088a834f51983adbce314f78ce5a55dde2b2ed572cdc601a469
4
+ data.tar.gz: '0816b8caf6d0942c023d10666dc14fd7ec2a154d6014cbd2130fe2e687b5d26c'
5
5
  SHA512:
6
- metadata.gz: eb5aae58de58afb5441027c272d3e66fb3f9fe7ff7466d530abf484c2ef5e636fb69755772a08f4e1423b3cf26adee16c623b3c448bd55f25da3a990f6f5448b
7
- data.tar.gz: 491c8dbab0204e1736c9438d84996be60bcaa8bccc1cf5592aa5d32cbabfb08d4ee1798c4af959eda2ff2762a0b5b99d43bc346cfaedf028f5d829f2aba8d094
6
+ metadata.gz: fc08e7233ff15f27d006a452fa8df0e8d2e5070d5d26d64636162aee9bf20059bdf4f68ad520103d9b7125ee9094d7f579effa9341effd56b5edf7bb704d9950
7
+ data.tar.gz: 603fe81b5a5437c087fcc8f1214716831ef172b0291a1c2c04cd2b021ad5d7310e9da00bc48aa97dd9172e4f9c298f39bd518c4a11e345d8034834bb78f68b6d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.4.4)
4
+ cns (0.4.6)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
@@ -20,12 +20,12 @@ GEM
20
20
  curb (1.0.5)
21
21
  declarative (0.0.20)
22
22
  e2mmap (0.1.0)
23
- faraday (2.7.11)
23
+ faraday (2.7.12)
24
24
  base64
25
25
  faraday-net_http (>= 2.0, < 3.1)
26
26
  ruby2_keywords (>= 0.0.4)
27
27
  faraday-net_http (3.0.2)
28
- google-apis-bigquery_v2 (0.60.0)
28
+ google-apis-bigquery_v2 (0.61.0)
29
29
  google-apis-core (>= 0.11.0, < 2.a)
30
30
  google-apis-core (0.11.2)
31
31
  addressable (~> 2.5, >= 2.5.1)
@@ -64,14 +64,14 @@ GEM
64
64
  kwalify (0.7.2)
65
65
  mini_mime (1.1.5)
66
66
  multi_json (1.15.0)
67
- nokogiri (1.15.4-x86_64-linux)
67
+ nokogiri (1.15.5-x86_64-linux)
68
68
  racc (~> 1.4)
69
69
  os (1.1.4)
70
70
  parallel (1.23.0)
71
71
  parser (2.7.2.0)
72
72
  ast (~> 2.4.1)
73
73
  psych (3.3.4)
74
- public_suffix (5.0.3)
74
+ public_suffix (5.0.4)
75
75
  racc (1.7.3)
76
76
  rainbow (3.1.1)
77
77
  rake (12.3.3)
data/lib/cns/bigquery.rb CHANGED
@@ -41,16 +41,6 @@ module Cns
41
41
  #apibc.mostra_resumo
42
42
  end
43
43
 
44
- # insere (caso existam) dados novos kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain no bigquery
45
- def processa_tudo
46
- processa_us
47
- processa_de
48
- #processa_frmt
49
- processa_eth
50
- processa_eos
51
- #processa_bc
52
- end
53
-
54
44
  # mostra situacao completa entre kraken/etherscan & bigquery
55
45
  def mostra_skrk
56
46
  apius.mostra_resumo
@@ -62,57 +52,68 @@ module Cns
62
52
  apies.mostra_resumo
63
53
  end
64
54
 
55
+ # insere (caso existam) dados novos kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain no bigquery
56
+ def processa_tudo
57
+ puts(Time.now.strftime("TRANSACOES %Y-%m-%d %H:%M ") + processa_us + ", " + processa_de + ", " + processa_eth + ", " + processa_eos)
58
+ end
59
+
65
60
  # insere (caso existam) dados novos kraken/etherscan no bigquery
66
61
  def processa_wkrk
67
- processa_us
68
- processa_eth
62
+ puts(Time.now.strftime("TRANSACOES %Y-%m-%d %H:%M ") + processa_us + ", " + processa_eth)
69
63
  end
70
64
 
71
65
  # insere (caso existam) dados novos etherscan no bigquery
72
66
  def processa_weth
73
- processa_eth
67
+ puts(Time.now.strftime("TRANSACOES %Y-%m-%d %H:%M ") + processa_eth)
74
68
  end
75
69
 
70
+ private
71
+
76
72
  # insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
77
73
  def processa_eth
78
- puts(format("%<n>4i TRANSACOES ETH NORMAIS\tINSERIDAS etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
79
- puts(format("%<n>4i TRANSACOES ETH INTERNAS\tINSERIDAS ethi", n: apies.novix.empty? ? 0 : dml(ethi_ins)))
80
- puts(format("%<n>4i TRANSACOES ETH BLOCK\tINSERIDAS ethp", n: apies.novpx.empty? ? 0 : dml(ethp_ins)))
81
- puts(format("%<n>4i TRANSACOES ETH WITHDRAWALS\tINSERIDAS ethw", n: apies.novwx.empty? ? 0 : dml(ethw_ins)))
82
- puts(format("%<n>4i TOKENS\tETH\t\tINSERIDAS ethk", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))
74
+ str = "ETH"
75
+ str << format(" %<n>i etht", n: dml(etht_ins)) if apies.novtx.count > 0
76
+ str << format(" %<n>i ethi", n: dml(ethi_ins)) if apies.novix.count > 0
77
+ str << format(" %<n>i ethp", n: dml(ethp_ins)) if apies.novpx.count > 0
78
+ str << format(" %<n>i ethw", n: dml(ethw_ins)) if apies.novwx.count > 0
79
+ str << format(" %<n>i ethk", n: dml(ethk_ins)) if apies.novkx.count > 0
80
+ str
83
81
  end
84
82
 
85
- private
86
-
87
83
  # insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
88
84
  def processa_us
89
- puts(format("%<n>4i TRADES\tKRAKEN\t\tINSERIDAS ust", n: apius.trades.empty? ? 0 : dml(ust_ins)))
90
- puts(format("%<n>4i LEDGER\tKRAKEN\t\tINSERIDAS usl", n: apius.ledger.empty? ? 0 : dml(usl_ins)))
85
+ str = "KRAKEN"
86
+ str << format(" %<n>i ust", n: dml(ust_ins)) if apius.trades.count > 0
87
+ str << format(" %<n>i usl", n: dml(usl_ins)) if apius.ledger.count > 0
88
+ str
91
89
  end
92
90
 
93
91
  # insere transacoes exchange bitcoinde novas nas tabelas det (trades), del (ledger)
94
92
  def processa_de
95
- puts(format("%<n>4i TRADES\tBITCOINDE\tINSERIDAS det", n: apide.trades.empty? ? 0 : dml(det_ins)))
96
- puts(format("%<n>4i LEDGER\tBITCOINDE\tINSERIDAS del", n: apide.ledger.empty? ? 0 : dml(del_ins)))
97
- end
98
-
99
- # insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
100
- def processa_frmt
101
- puts(format("%<n>4i LEDGER\tPAYMIUM\t\tINSERIDAS fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
102
- puts(format("%<n>4i LEDGER\tTHEROCK\t\tINSERIDAS mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
93
+ str = "BITCOINDE"
94
+ str << format(" %<n>i det", n: dml(det_ins)) if apide.trades.count > 0
95
+ str << format(" %<n>i del", n: dml(del_ins)) if apide.ledger.count > 0
96
+ str
103
97
  end
104
98
 
105
99
  # insere transacoes blockchain novas na tabela eos
106
100
  def processa_eos
107
- puts(format("%<n>4i TRANSACOES\tEOS\t\tINSERIDAS eos ", n: apigm.novax.empty? ? 0 : dml(eost_ins)))
101
+ str = "EOS"
102
+ str << format(" %<n>i eos ", n: dml(eost_ins)) if apigm.novax.count > 0
103
+ str
108
104
  end
109
105
 
106
+ # insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
107
+ # def processa_frmt
108
+ # puts(format("%<n>4i LEDGER\tPAYMIUM\t\tINSERIDAS fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
109
+ # puts(format("%<n>4i LEDGER\tTHEROCK\t\tINSERIDAS mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
110
+ # end
110
111
  # insere historico sados novos na tabela eth2bh
111
- def processa_bc
112
- # puts(format("%<n>4i ATTESTATIONS INSERIDAS eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
113
- # puts(format("%<n>4i PROPOSALS INSERIDAS eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
114
- puts(format("%<n>4i BALANCES\tETH2\t\tINSERIDOS eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
115
- end
112
+ # def processa_bc
113
+ # puts(format("%<n>4i ATTESTATIONS INSERIDAS eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
114
+ # puts(format("%<n>4i PROPOSALS INSERIDAS eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
115
+ # puts(format("%<n>4i BALANCES\tETH2\t\tINSERIDOS eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
116
+ # end
116
117
 
117
118
  # cria job bigquery & verifica execucao
118
119
  #
data/lib/cns/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cns
4
- VERSION = '0.4.4'
4
+ VERSION = '0.4.6'
5
5
  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
4
+ version: 0.4.6
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-17 00:00:00.000000000 Z
11
+ date: 2023-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler