cns 0.4.1 → 0.4.3

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: 7ade5495375425e6c5f292f2333785f17246ab1d54b0492830e2d61fe1d6d88e
4
- data.tar.gz: 8781b2c9d6b6885496b4ececf3766b626b88720122443a280d57c9281ea8d250
3
+ metadata.gz: 1eb8b20b87c583f48d121aa34c064856359e287984a237c9c807f53391f7a93b
4
+ data.tar.gz: 94b0b7971a7abaa87bbcd75807609f1ed0e175b504d26ff7d4879aaae2764347
5
5
  SHA512:
6
- metadata.gz: 5bc3e8f04510a917f5e8d7f150b86f73a3ca22f5f7da041f61b00113838723d6b1e089c919914e04653af40e837a836460bd6b347ae93c544a32c8bc8a2d33ab
7
- data.tar.gz: 5a5f0b86db6d8688f2abc96ea82ae0ecf416cd35e1e64cb04160a2184cc33b351bd084e70f4f7979629e74f613c8e93ec012146281847cbe611273e69a8c46ec
6
+ metadata.gz: 87a6da8d1389c9fdf8a3c668856030c2c7b3f70f9261bbed7c5f7051eb31a703f93a9acce46356d72eaf197fdec73cca802ca11dea0bd8b2b7792a1d8194f75f
7
+ data.tar.gz: 32fbe0ea5b6479784774de1efffb213314ff33ad70dbab5e8f50e64ec1250c6bc99f085961da4f243a935b4e73ae01bb4c07861f6a5d730ac137105b113a8551
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.4.1)
4
+ cns (0.4.3)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
@@ -10,22 +10,24 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.4)
13
+ addressable (2.8.5)
14
14
  public_suffix (>= 2.0.2, < 6.0)
15
15
  ast (2.4.2)
16
16
  backport (1.2.0)
17
- benchmark (0.2.1)
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.10)
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.57.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.1)
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.43.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.7.0)
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
- memoist (0.16.2)
65
- mini_mime (1.1.2)
65
+ mini_mime (1.1.5)
66
66
  multi_json (1.15.0)
67
- nokogiri (1.15.3-x86_64-linux)
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.1)
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.1)
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.17.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.2.2)
131
- tilt (2.2.0)
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,6 +41,12 @@ 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
+
44
50
  # insere (caso existam) dados novos kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain no bigquery
45
51
  def processa_tudo
46
52
  processa_us
@@ -51,6 +57,12 @@ module Cns
51
57
  #processa_bc
52
58
  end
53
59
 
60
+ # insere (caso existam) dados novos kraken/etherscan/ no bigquery
61
+ def processa_wkrk
62
+ processa_us
63
+ processa_eth
64
+ end
65
+
54
66
  # insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
55
67
  def processa_eth
56
68
  puts(format("%<n>4i TRANSACOES ETH NORMAIS\tINSERIDAS etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
@@ -62,7 +74,8 @@ module Cns
62
74
 
63
75
  # insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
64
76
  def processa_weth
65
- 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)))
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
66
79
  end
67
80
 
68
81
  private
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[:bs].round(4) == hjn[:es].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
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cns
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.3'
5
5
  end
data/lib/cns.rb CHANGED
@@ -23,6 +23,13 @@ module Cns
23
23
  Bigquery.new(options).processa_weth
24
24
  end
25
25
 
26
+ desc 'wkrk', 'carrega transacoes kraken/eth no bigquery'
27
+ option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
28
+ # carrega transacoes kraken/eth no bigquery
29
+ def wkrk
30
+ Bigquery.new(options).processa_wkrk
31
+ end
32
+
26
33
  desc 'work', 'carrega transacoes novas no bigquery'
27
34
  option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
28
35
  # carrega transacoes novas no bigquery
@@ -38,6 +45,14 @@ module Cns
38
45
  Bigquery.new(options).mostra_tudo
39
46
  end
40
47
 
41
- default_task :show
48
+ desc 'skrk', 'mostra kraken/eth transacoes'
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
42
57
  end
43
58
  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.1
4
+ version: 0.4.3
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-07-28 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler