cns 0.5.8 → 0.5.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9aa79411673df0443dfdec54b4e893b027b1f549d78c935e4fe27ad0ef5551e5
4
- data.tar.gz: 711c3843a3a2ab8c4327f62707c97782c04e295d3b2fd1c29851001dbb1b245c
3
+ metadata.gz: 374fe58e3d0340472364544853063dc3c353581c911f9576df0606ad687ec6bb
4
+ data.tar.gz: 6ebae187a6ed45b4dc785135a587ca0ca3807fbff7ec59068f2b2c7213009cde
5
5
  SHA512:
6
- metadata.gz: a9538559df5fe47e726298ccd1694086203440ee435a386eda7d48e94b031678e19c0df01af6d8551779021a6ff3aa33d10e89979b5515617d2aa4a50bafce4a
7
- data.tar.gz: e48f19e2531609afe7fb0641a877fd970fc66da7215c8e6f19051cc1d475b8da720298ff9f327012b35e46d7f53e653bd651e39afc4c173929cc2e1fff8a008d
6
+ metadata.gz: 90152a2f356e67dcd4827cd781f8f269a4dcadac41ae06085bf88cc061142f4aed07a2dfeeccf783960e011baf29ffe420b240a7541e74e57a6797600767e0da
7
+ data.tar.gz: 62eb674cb6febb1d313d7bd7c0f5c1ef64a2879ba4631f971dac28baa83d63490e7f8bc021bcf3923916e4f816d38e4d37f8e54baa93bd2097cb85ff3c9f67f5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.5.8)
4
+ cns (0.5.9)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
data/lib/cns/bigquery.rb CHANGED
@@ -49,7 +49,7 @@ module Cns
49
49
 
50
50
  # mostra situacao completa entre etherscan & bigquery
51
51
  def mostra_seth
52
- apies.mostra_resumo
52
+ apies.mostra_resumo_simples
53
53
  end
54
54
 
55
55
  # @return [String] texto inicial transacoes
data/lib/cns/etherscan.rb CHANGED
@@ -142,7 +142,7 @@ module Cns
142
142
  # elimina transferencia from: (lax) to: (add) - esta transferencia aparece em from: (add) to: (lax)
143
143
  # .delete_if { |odl| add.casecmp?(odl[:to]) && lax.include?(odl[:from].downcase) }
144
144
  # elimina chaves irrelevantes (DL) & adiciona chave indice itx & adiciona identificador da carteira iax
145
- ary.map { |omp| omp.delete_if { |key, _| DL.include?(key) }.merge(itx: Integer(omp[:blockNumber]), iax: add) }
145
+ ary.map { |omp| omp.delete_if { |key, _| DL.include?(key) }.merge(itx: String(omp[:hash]), iax: add) }
146
146
  end
147
147
 
148
148
  # @param add (see Apibc#norml_es)
@@ -183,6 +183,20 @@ module Cns
183
183
  (novtx + novkx).sort { |ant, prx| ant[:itx] <=> prx[:itx] }
184
184
  end
185
185
 
186
+ # @return [String] texto carteiras & transacoes & ajuste dias
187
+ def mostra_resumo_simples
188
+ return unless dados.count.positive?
189
+
190
+ puts("\nid address etherscan bigquery")
191
+ dados.each { |obj| puts(formata_carteira_simples(obj)) }
192
+ mostra_transacao_norml
193
+ mostra_transacao_inter
194
+ mostra_transacao_block
195
+ mostra_transacao_token
196
+ mostra_transacao_withw
197
+ mostra_configuracao_ajuste_dias
198
+ end
199
+
186
200
  # @return [String] texto carteiras & transacoes & ajuste dias
187
201
  def mostra_resumo
188
202
  return unless dados.count.positive?
@@ -197,6 +211,16 @@ module Cns
197
211
  mostra_configuracao_ajuste_dias
198
212
  end
199
213
 
214
+ # @param [Hash] hjn dados juntos bigquery & etherscan
215
+ # @return [String] texto formatado duma carteira
216
+ def formata_carteira_simples(hjn)
217
+ format(
218
+ '%<s1>-6.6s %<s2>-42.42s ',
219
+ s1: hjn[:id],
220
+ s2: hjn[:ax]
221
+ ) + formata_valores_simples(hjn)
222
+ end
223
+
200
224
  # @param [Hash] hjn dados juntos bigquery & etherscan
201
225
  # @return [String] texto formatado duma carteira
202
226
  def formata_carteira(hjn)
@@ -207,6 +231,17 @@ module Cns
207
231
  ) + formata_valores(hjn)
208
232
  end
209
233
 
234
+ # @param (see formata_carteira)
235
+ # @return [String] texto formatado valores duma carteira
236
+ def formata_valores_simples(hjn)
237
+ format(
238
+ '%<v1>11.4f %<v2>11.4f %<ok>-3s',
239
+ v1: hjn[:es],
240
+ v2: hjn[:bs],
241
+ ok: ok?(hjn) ? 'OK' : 'NOK'
242
+ )
243
+ end
244
+
210
245
  # @param (see formata_carteira)
211
246
  # @return [String] texto formatado valores duma carteira
212
247
  def formata_valores(hjn)
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.5.8'
4
+ VERSION = '0.5.9'
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.5.8
4
+ version: 0.5.9
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: 2025-01-30 00:00:00.000000000 Z
11
+ date: 2025-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler