etht 0.1.5 → 0.1.10

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: f5a76fade4364cb9ecc118fcfae181f13d84fe3e39ba85a6078e8974ab403652
4
- data.tar.gz: 269e68983b59463ec5aaeb3e0179b28f79f6a43135e2401269c467e0d90a74c4
3
+ metadata.gz: 7a4ad7470fa9f34376a9d8c23bfda947957d8d5ec81038fb093cc531724c4a34
4
+ data.tar.gz: 58347c74acaafd830dca7a21bc57cf090cca08490215f45c47859325fd520aa5
5
5
  SHA512:
6
- metadata.gz: 9f446bfb04b77cf6d7cfc366f12b564a6385837484d388121341dbb4fa26d36e07f30d3883871d8e7bbbe1a353a3ed838fa95a2aa5b1d15026a8fc099f6e8389
7
- data.tar.gz: 65936552f2176a0706e417579fa6747a8c7fcc9937a23d1f83fca413c2a964c6e37ee58cfd1dd086e964367d723e0ce828a130e182043129c4cc84117227ae75
6
+ metadata.gz: e35824b0aff4e74300246d2374306e9ff6fa1b1a3fa46b6a840c230feaa2ca76e2a6d443ac3dac9dc59b8a61de37986fc3ca3d57ec5d2f8d019605c2bd348ebd
7
+ data.tar.gz: 994efb07d372f8bcf2a8a2b0bad20d956f2adc64310ccde371635c40750a6fe8c39495ac04c7da46d119ffc2850a6d4d5b6e62b0f588434f4cbeec1c710c901f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- etht (0.1.5)
4
+ etht (0.1.10)
5
5
  faraday
6
6
  google-cloud-bigquery
7
7
  json
@@ -18,7 +18,7 @@ GEM
18
18
  declarative-option (0.1.0)
19
19
  faraday (1.0.1)
20
20
  multipart-post (>= 1.2, < 3)
21
- google-api-client (0.43.0)
21
+ google-api-client (0.44.0)
22
22
  addressable (~> 2.5, >= 2.5.1)
23
23
  googleauth (~> 0.9)
24
24
  httpclient (>= 2.8.1, < 3.0)
@@ -53,7 +53,7 @@ GEM
53
53
  multi_json (1.15.0)
54
54
  multipart-post (2.1.1)
55
55
  os (1.1.1)
56
- public_suffix (4.0.5)
56
+ public_suffix (4.0.6)
57
57
  rake (12.3.3)
58
58
  representable (3.0.4)
59
59
  declarative (< 0.1.0)
data/Rakefile CHANGED
@@ -1,2 +1,4 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
1
+ # frozen_string_literal: true
2
+
3
+ require('bundler/gem_tasks')
4
+ task(default: :build)
@@ -26,11 +26,12 @@ module Etht
26
26
  Bigquery.new(options).processa
27
27
  end
28
28
 
29
- desc 'show', 'mostra carteiras e dados bigquery & etherscan'
30
- option :v, type: :boolean, default: false, desc: 'mostra dados transacoes normais & token'
31
- # mostra carteiras e dados bigquery & etherscan
29
+ desc 'show', 'mostra reumo carteiras & transacoes'
30
+ option :v, type: :boolean, default: false, desc: 'mostra transacoes normais & token'
31
+ option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
32
+ # mostra reumo carteiras & transacoes
32
33
  def show
33
- Bigquery.new(options).carteiras.mostra
34
+ Bigquery.new(options).carteiras.mostra_resumo
34
35
  end
35
36
 
36
37
  default_task :show
@@ -15,10 +15,13 @@ module Etht
15
15
  attr_reader :job
16
16
  # @return [Thor::CoreExt::HashWithIndifferentAccess] opcoes trabalho
17
17
  attr_reader :ops
18
+ # @return (see sql)
19
+ attr_reader :sqr
18
20
 
19
21
  # @param [Thor::CoreExt::HashWithIndifferentAccess] pop opcoes trabalho
20
22
  # @option pop [Hash] :h ({}) configuracao ajuste reposicionamento temporal
21
- # @option pop [Boolean] :v (false) mostra dados transacoes normais & token?
23
+ # @option pop [Boolean] :v (false) mostra transacoes normais & token?
24
+ # @option pop [Boolean] :t (false) mostra transacoes todas ou somente novas?
22
25
  # @return [Bigquery] API bigquery & API etherscan
23
26
  def initialize(pop)
24
27
  # usa env GOOGLE_APPLICATION_CREDENTIALS para obter credentials
@@ -28,8 +31,8 @@ module Etht
28
31
  end
29
32
 
30
33
  # @return [Carteiras] API etherscan - processar transacoes normais e tokens
31
- def carteiras
32
- @carteiras ||= Carteiras.new(
34
+ def transacoes
35
+ @transacoes ||= Carteiras.new(
33
36
  {
34
37
  wb: sql("select * from #{BD}.walletEth order by 2")
35
38
  .map { |e| { id: e[:id], ax: e[:address], sl: e[:saldo].to_d.round(10) } },
@@ -40,22 +43,34 @@ module Etht
40
43
  )
41
44
  end
42
45
 
43
- # insere transacoes novas nas tabelas etht, ethk
46
+ # @return [Carteiras] API etherscan - processar carteiras & transacoes normais e tokens
47
+ def carteiras
48
+ transacoes
49
+ end
50
+
51
+ # insere transacoes novas nas tabelas etht (trx normais), ethk (trx token)
44
52
  def processa
45
- puts(format("%<n>2i LINHAS INSERIDAS #{BD}.etht", n: carteiras.novaest.count.positive? ? dml(etht_ins) : 0))
46
- puts(format("%<n>2i LINHAS INSERIDAS #{BD}.ethk", n: carteiras.novaesk.count.positive? ? dml(ethk_ins) : 0))
53
+ puts(format("%<n>2i LINHAS INSERIDAS #{BD}.etht", n: transacoes.norml.count.positive? ? dml(etht_ins) : 0))
54
+ puts(format("%<n>2i LINHAS INSERIDAS #{BD}.ethk", n: transacoes.token.count.positive? ? dml(ethk_ins) : 0))
47
55
  end
48
56
 
49
- # @return [String] comando insert SQL formatado bigquery.etht
57
+ # @return [String] comando insert SQL formatado etht (trx normais)
50
58
  def etht_ins
51
59
  "insert #{BD}.etht(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,value,gas," \
52
60
  'gasprice,iserror,txreceipt_status,input,contractaddress,cumulativegasused,gasused,confirmations,dias' \
53
- ") VALUES(#{carteiras.novaest.map { |e| etht_val1(e) }.join(',')})"
61
+ ") VALUES#{transacoes.norml.map { |e| etht_val1(e) }.join(',')}"
62
+ end
63
+
64
+ # @return [String] comando insert SQL formatado ethk (trx token)
65
+ def ethk_ins
66
+ "insert #{BD}.ethk(blocknumber,timestamp,txhash,nonce,blockhash,axfrom,contractaddress,axto,value,tokenname," \
67
+ 'tokensymbol,tokendecimal,transactionindex,gas,gasprice,gasused,cumulativegasused,input,confirmations,dias' \
68
+ ") VALUES#{transacoes.token.map { |e| ethk_val1(e) }.join(',')}"
54
69
  end
55
70
 
56
- # @return [String] valores formatados bigquery.etht parte1
71
+ # @return [String] valores formatados etht (trx normais parte1)
57
72
  def etht_val1(hes)
58
- "#{Integer(hes['blockNumber'])}," \
73
+ "(#{Integer(hes['blockNumber'])}," \
59
74
  "#{Integer(hes['timeStamp'])}," \
60
75
  "'#{hes['hash']}'," \
61
76
  "#{Integer(hes['nonce'])}," \
@@ -66,7 +81,7 @@ module Etht
66
81
  "#{etht_val2(hes)}"
67
82
  end
68
83
 
69
- # @return [String] valores formatados bigquery.etht parte2
84
+ # @return [String] valores formatados etht (trx normais parte2)
70
85
  def etht_val2(hes)
71
86
  "cast('#{hes['value']}' as numeric)," \
72
87
  "cast('#{hes['gas']}' as numeric)," \
@@ -77,23 +92,16 @@ module Etht
77
92
  "#{etht_val3(hes)}"
78
93
  end
79
94
 
80
- # @return [String] valores formatados bigquery.etht parte3
95
+ # @return [String] valores formatados etht (trx normais parte3)
81
96
  def etht_val3(hes)
82
97
  "#{hes['contractAddress'].length.zero? ? 'null' : "'#{hes['contractAddress']}'"}," \
83
98
  "0,cast('#{hes['gasUsed']}' as numeric),0," \
84
- "#{Integer(ops[:h][hes['blockNumber']] || 0)}"
85
- end
86
-
87
- # @return [String] comando insert SQL formatado bigquery.ethk
88
- def ethk_ins
89
- "insert #{BD}.ethk(blocknumber,timestamp,txhash,nonce,blockhash,axfrom,contractaddress,axto,value,tokenname," \
90
- 'tokensymbol,tokendecimal,transactionindex,gas,gasprice,gasused,cumulativegasused,input,confirmations,dias' \
91
- ") VALUES(#{carteiras.novaesk.map { |e| ethk_val1(e) }.join(',')})"
99
+ "#{Integer(ops[:h][hes['blockNumber']] || 0)})"
92
100
  end
93
101
 
94
- # @return [String] valores formatados bigquery.ethk parte1
102
+ # @return [String] valores formatados ethk (trx token parte1)
95
103
  def ethk_val1(hes)
96
- "#{Integer(hes['blockNumber'])}," \
104
+ "(#{Integer(hes['blockNumber'])}," \
97
105
  "#{Integer(hes['timeStamp'])}," \
98
106
  "'#{hes['hash']}'," \
99
107
  "#{Integer(hes['nonce'])}," \
@@ -102,7 +110,7 @@ module Etht
102
110
  "#{ethk_val2(hes)}"
103
111
  end
104
112
 
105
- # @return [String] valores formatados bigquery.ethk parte2
113
+ # @return [String] valores formatados ethk (trx token parte2)
106
114
  def ethk_val2(hes)
107
115
  "#{hes['contractAddress'].length.zero? ? 'null' : "'#{hes['contractAddress']}'"}," \
108
116
  "'#{hes['to']}'," \
@@ -114,40 +122,41 @@ module Etht
114
122
  "#{ethk_val3(hes)}"
115
123
  end
116
124
 
117
- # @return [String] valores formatados bigquery.ethk parte3
125
+ # @return [String] valores formatados ethk (trx token parte3)
118
126
  def ethk_val3(hes)
119
127
  "cast('#{hes['gas']}' as numeric)," \
120
128
  "cast('#{hes['gasPrice']}' as numeric)," \
121
129
  "cast('#{hes['gasUsed']}' as numeric),0," \
122
130
  "#{hes['input'].length.zero? ? 'null' : "'#{hes['input']}'"},0," \
123
- "#{Integer(ops[:h][hes['blockNumber']] || 0)}"
131
+ "#{Integer(ops[:h][hes['blockNumber']] || 0)})"
124
132
  end
125
133
 
126
134
  # cria job bigquery & verifica execucao
127
135
  #
128
- # @param [String] sql a executar
136
+ # @param cmd (see sql)
129
137
  # @return [Boolean] job ok?
130
- def job?(sql)
131
- @job = api.query_job(sql)
138
+ def job?(cmd)
139
+ @job = api.query_job(cmd)
132
140
  @job.wait_until_done!
133
141
  puts(@job.error['message']) if @job.failed?
134
142
  @job.failed?
135
143
  end
136
144
 
137
- # cria Data Manipulation Language (DML) job bigquery
145
+ # cria Structured Query Language (SQL) job bigquery
138
146
  #
139
- # @param (see job?)
140
- # @return [Integer] numero linhas afetadas
141
- def dml(sql)
142
- job?(sql) ? 0 : job.num_dml_affected_rows
147
+ # @param [String] cmd comando SQL a executar
148
+ # @param [String] red resultado quando SQL tem erro
149
+ # @return [Google::Cloud::Bigquery::Data] resultado do SQL
150
+ def sql(cmd, red = [])
151
+ @sqr = job?(cmd) ? red : job.data
143
152
  end
144
153
 
145
- # cria Structured Query Language (SQL) job bigquery
154
+ # cria Data Manipulation Language (DML) job bigquery
146
155
  #
147
- # @param (see job?)
148
- # @return [Array<Hash>] resultados do SQL
149
- def sql(sql)
150
- job?(sql) ? [] : job.data
156
+ # @param cmd (see sql)
157
+ # @return [Integer] numero linhas afetadas
158
+ def dml(cmd)
159
+ job?(cmd) ? 0 : job.num_dml_affected_rows
151
160
  end
152
161
  end
153
162
  end
@@ -25,50 +25,50 @@ module Etht
25
25
  end
26
26
 
27
27
  # @return [Array<Hash>] todos os dados etherscan - saldos & transacoes
28
- def dadoses
29
- @dadoses ||= api.multi_address_balance(dbq[:wb].map { |c| c[:ax] }).map { |e| base_etherscan(e) }
28
+ def des
29
+ @des ||= api.multi_address_balance(dbq[:wb].map { |c| c[:ax] }).map { |e| base_etherscan(e) }
30
30
  end
31
31
 
32
- # @return [Array<Integer>] lista blocknumbers novos de transacoes normais
33
- def novobnt
34
- @novobnt ||= (dadoses.map { |e| e[:tx].map { |n| Integer(n['blockNumber']) } }.flatten -
35
- dbq[:nt].map { |t| t[:blocknumber] }).uniq
32
+ # @return [Array<Hash>] todos os dados juntos bigquery & etherscan
33
+ def djn
34
+ @djn ||= dbq[:wb].map { |b| bigquery_etherscan(b, des.select { |s| b[:ax] == s[:ax] }.first) }
36
35
  end
37
36
 
38
- # @return [Array<Integer>] lista blocknumbers novos de transacoes token
39
- def novobnk
40
- @novobnk ||= (dadoses.map { |e| e[:kx].map { |n| Integer(n['blockNumber']) } }.flatten -
41
- dbq[:nk].map { |t| t[:blocknumber] }).uniq
37
+ # @return [Array<Integer>] lista blocknumbers de transacoes normais
38
+ def bnt
39
+ @bnt ||= (des.map { |e| e[:tx].map { |n| Integer(n['blockNumber']) } }.flatten -
40
+ (ops[:t] ? [] : dbq[:nt].map { |t| t[:blocknumber] })).uniq
42
41
  end
43
42
 
44
- # @return [Array<Hash>] lista transacoes normais novas
45
- def novaest
46
- @novaest ||= dadoses.map { |e| e[:tx].select { |s| novobnt.include?(Integer(s['blockNumber'])) } }.flatten.uniq
43
+ # @return [Array<Integer>] lista blocknumbers de transacoes token
44
+ def bnk
45
+ @bnk ||= (des.map { |e| e[:kx].map { |n| Integer(n['blockNumber']) } }.flatten -
46
+ (ops[:t] ? [] : dbq[:nk].map { |t| t[:blocknumber] })).uniq
47
47
  end
48
48
 
49
- # @return [Array<Hash>] lista transacoes tokan novas
50
- def novaesk
51
- @novaesk ||= dadoses.map { |e| e[:kx].select { |s| novobnk.include?(Integer(s['blockNumber'])) } }.flatten.uniq
49
+ # @return [Array<Hash>] lista transacoes normais
50
+ def norml
51
+ @norml ||= des.map { |e| e[:tx].select { |s| bnt.include?(Integer(s['blockNumber'])) } }.flatten.uniq
52
52
  end
53
53
 
54
- # @return [Array<Hash>] totdos dados juntos bigquery & etherscan
55
- def dadosjn
56
- @dadosjn ||= dbq[:wb].map { |b| bigquery_etherscan(b, dadoses.select { |s| b[:ax] == s[:ax] }.first) }
54
+ # @return [Array<Hash>] lista transacoes tokan
55
+ def token
56
+ @token ||= des.map { |e| e[:kx].select { |s| bnk.include?(Integer(s['blockNumber'])) } }.flatten.uniq
57
57
  end
58
58
 
59
- # @return [Array<Hash>] lista ordenada transacoes normais novas
60
- def sortest
61
- novaest.sort { |a, b| Integer(a['blockNumber']) <=> Integer(b['blockNumber']) }
59
+ # @return [Array<Hash>] lista ordenada transacoes normais
60
+ def norml_sort
61
+ norml.sort { |a, b| Integer(a['blockNumber']) <=> Integer(b['blockNumber']) }
62
62
  end
63
63
 
64
- # @return [Array<Hash>] lista ordenada transacoes tokan novas
65
- def sortesk
66
- novaesk.sort { |a, b| Integer(a['blockNumber']) <=> Integer(b['blockNumber']) }
64
+ # @return [Array<Hash>] lista ordenada transacoes tokan
65
+ def token_sort
66
+ token.sort { |a, b| Integer(a['blockNumber']) <=> Integer(b['blockNumber']) }
67
67
  end
68
68
 
69
- # @return [Array<Hash>] lista ordenada transacoes normais & tokan novas
70
- def totalha
71
- (novaest + novaesk).sort { |a, b| Integer(a['blockNumber']) <=> Integer(b['blockNumber']) }
69
+ # @return [Array<Hash>] lista ordenada todas as transacoes (normais & tokan)
70
+ def todas_sort
71
+ (norml + token).sort { |a, b| Integer(a['blockNumber']) <=> Integer(b['blockNumber']) }
72
72
  end
73
73
 
74
74
  # @param [Hash] hes dados etherscan
@@ -98,7 +98,7 @@ module Etht
98
98
  }
99
99
  end
100
100
 
101
- # @param [String] add endereco da carteira
101
+ # @param add (see formata_endereco)
102
102
  # @return [Array<Hash>] lista transacoes normais ligadas a uma carteira - sem elementos irrelevantes
103
103
  def etherscan_tx(add)
104
104
  api.normal_tx(add).map do |e|
@@ -108,7 +108,7 @@ module Etht
108
108
  end
109
109
  end
110
110
 
111
- # @param (see etherscan_tx)
111
+ # @param add (see formata_endereco)
112
112
  # @return [Array<Hash>] lista transacoes token ligadas a uma carteira - sem elementos irrelevantes
113
113
  def etherscan_kx(add)
114
114
  api.token_tx(add).map do |e|
@@ -117,10 +117,5 @@ module Etht
117
117
  e
118
118
  end
119
119
  end
120
-
121
- # @return [Boolean] carteira tem transacoes novas(sim=NOK, nao=OK)?
122
- def ok?(hjn)
123
- hjn[:bs] == hjn[:es] && hjn[:bt].count == hjn[:et].count && hjn[:bk].count == hjn[:ek].count
124
- end
125
120
  end
126
121
  end
@@ -4,8 +4,36 @@
4
4
  module Etht
5
5
  # (see Carteiras)
6
6
  class Carteiras
7
+ # @param [String] add endereco carteira ether
8
+ # @param [Integer] max chars a mostrar
9
+ # @return [String] endereco ether formatado
10
+ # @example ether address inicio..fim
11
+ # 0x10f3a0cf0b534c..c033cf32e8a03586
12
+ def formata_endereco(add, max)
13
+ i = Integer((max - 2) / 2)
14
+ e = (max <= 20 ? dbq[:wb].select { |s| s[:ax] == add }.first : nil) || { id: add }
15
+ max < 7 ? 'erro' : "#{e[:id][0, i - 3]}..#{add[-i - 3..]}"
16
+ end
17
+
18
+ # @parm [Hash] hjn dados juntos bigquery & etherscan
19
+ # @return [String] texto formatado duma carteira
20
+ def formata_carteira(hjn)
21
+ format(
22
+ '%<s1>-6.6s %<s2>-34.34s ',
23
+ s1: hjn[:id],
24
+ s2: formata_endereco(hjn[:ax], 34)
25
+ ) + formata_valores(hjn)
26
+ end
27
+
28
+ # @parm (see formata_carteira)
29
+ # @return [Boolean] carteira tem transacoes novas(sim=NOK, nao=OK)?
30
+ def ok?(hjn)
31
+ hjn[:bs] == hjn[:es] && hjn[:bt].count == hjn[:et].count && hjn[:bk].count == hjn[:ek].count
32
+ end
33
+
34
+ # @parm (see formata_carteira)
7
35
  # @return [String] texto formatado valores duma carteira
8
- def valores(hjn)
36
+ def formata_valores(hjn)
9
37
  format(
10
38
  '%<v1>10.6f %<n1>2i %<n3>2i %<v2>11.6f %<n2>2i %<n4>2i %<ok>-3s',
11
39
  v1: hjn[:bs],
@@ -18,73 +46,65 @@ module Etht
18
46
  )
19
47
  end
20
48
 
49
+ # @parm [Hash] htx transacao normal
21
50
  # @return [String] texto formatado transacao normal
22
- def formata_tx(htx)
51
+ def formata_transacao_norml(htx)
23
52
  format(
24
53
  '%<bn>9i %<fr>-20.20s %<to>-20.20s %<dt>10.10s %<vl>17.6f',
25
54
  bn: htx['blockNumber'],
26
- fr: ftx(htx['from'], 20),
27
- to: ftx(htx['to'], 20),
55
+ fr: formata_endereco(htx['from'], 20),
56
+ to: formata_endereco(htx['to'], 20),
28
57
  dt: Time.at(Integer(htx['timeStamp'])),
29
58
  vl: (htx['value'].to_d / 10**18).round(10)
30
59
  )
31
60
  end
32
61
 
62
+ # @parm [Hash] hkx transacao token
33
63
  # @return [String] texto formatado transacao token
34
- def formata_kx(hkx)
64
+ def formata_transacao_token(hkx)
35
65
  format(
36
- '%<bn>9i %<fr>-20.20s %<to>-20.20s %<dt>10.10s %<vl>11.3f %<sy>-5.5s',
66
+ '%<bn>9i %<fr>-20.20s %<to>-20.20s %<dt>10.10s %<sy>-5.5s %<vl>11.3f',
37
67
  bn: hkx['blockNumber'],
38
- fr: ftx(hkx['from'], 20),
39
- to: ftx(hkx['to'], 20),
68
+ fr: formata_endereco(hkx['from'], 20),
69
+ to: formata_endereco(hkx['to'], 20),
40
70
  dt: Time.at(Integer(hkx['timeStamp'])),
41
71
  vl: (hkx['value'].to_d / 10**18).round(10),
42
72
  sy: hkx['tokenSymbol']
43
73
  )
44
74
  end
45
75
 
46
- # @return [String] texto lista carteiras & lista transacoes & ajuste dias
47
- def mostra
48
- return unless dadosjn.count.positive?
76
+ # @return [String] texto carteiras & transacoes & ajuste dias
77
+ def mostra_resumo
78
+ return unless djn.count.positive?
49
79
 
50
80
  puts("\nid address ----bigquery---- ----etherscan----")
51
- dadosjn.each { |e| puts format('%<s1>-6.6s %<s2>-34.34s ', s1: e[:id], s2: ftx(e[:ax], 34)) + valores(e) }
52
- mostra_tx
53
- mostra_kx
54
- mostra_ha
55
- end
56
-
57
- # @example ether address inicio..fim
58
- # 0x10f3a0cf0b534c..c033cf32e8a03586
59
- # @param [String] add ether address
60
- # @param [Integer] max chars a mostrar
61
- # @return [String] ether address formatada
62
- def ftx(add, max)
63
- i = Integer((max - 2) / 2)
64
- max < 7 ? 'erro' : "#{add[0, i]}..#{add[-i..]}"
81
+ djn.each { |e| puts(formata_carteira(e)) }
82
+ mostra_transacao_norml
83
+ mostra_transacao_token
84
+ mostra_configuracao_ajuste_dias
65
85
  end
66
86
 
67
- # @return [String] lista transacoes normais
68
- def mostra_tx
69
- return unless novaest.count.positive? && ops[:v]
87
+ # @return [String] texto transacoes normais
88
+ def mostra_transacao_norml
89
+ return unless ops[:v] && norml.count.positive?
70
90
 
71
91
  puts("\ntx normal address from address to ---data--- ------valor------")
72
- sortest.each { |e| puts formata_tx(e) }
92
+ norml_sort.each { |e| puts(formata_transacao_norml(e)) }
73
93
  end
74
94
 
75
- # @return [String] lista transacoes token
76
- def mostra_kx
77
- return unless novaesk.count.positive? && ops[:v]
95
+ # @return [String] texto transacoes token
96
+ def mostra_transacao_token
97
+ return unless ops[:v] && token.count.positive?
78
98
 
79
- puts("\ntx token address from address to ---data--- ---valor--- token")
80
- sortesk.each { |e| puts formata_kx(e) }
99
+ puts("\ntx token address from address to ---data--- token ---valor---")
100
+ token_sort.each { |e| puts(formata_transacao_token(e)) }
81
101
  end
82
102
 
83
- # @return [String] texto configuracao ajuste dias
84
- def mostra_ha
85
- return unless (novaest.count + novaesk.count).positive? && ops[:v]
103
+ # @return [String] texto configuracao ajuste dias das transacoes (normais & tokan)
104
+ def mostra_configuracao_ajuste_dias
105
+ return unless (norml.count + token.count).positive?
86
106
 
87
- puts("\nstring ajuste dias\n-h=#{totalha.map { |e| "#{e['blockNumber']}:0" }.join(' ')}")
107
+ puts("\nstring ajuste dias\n-h=#{todas_sort.map { |e| "#{e['blockNumber']}:0" }.join(' ')}")
88
108
  end
89
109
  end
90
110
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Etht
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.10'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etht
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.10
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: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2020-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler