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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cns/bigquery.rb +1 -1
- data/lib/cns/etherscan.rb +36 -1
- 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: 374fe58e3d0340472364544853063dc3c353581c911f9576df0606ad687ec6bb
|
4
|
+
data.tar.gz: 6ebae187a6ed45b4dc785135a587ca0ca3807fbff7ec59068f2b2c7213009cde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90152a2f356e67dcd4827cd781f8f269a4dcadac41ae06085bf88cc061142f4aed07a2dfeeccf783960e011baf29ffe420b240a7541e74e57a6797600767e0da
|
7
|
+
data.tar.gz: 62eb674cb6febb1d313d7bd7c0f5c1ef64a2879ba4631f971dac28baa83d63490e7f8bc021bcf3923916e4f816d38e4d37f8e54baa93bd2097cb85ff3c9f67f5
|
data/Gemfile.lock
CHANGED
data/lib/cns/bigquery.rb
CHANGED
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:
|
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
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.
|
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
|
11
|
+
date: 2025-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|