etht 0.1.5 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/Rakefile +4 -2
- data/lib/etht.rb +5 -4
- data/lib/etht/bigquery.rb +47 -38
- data/lib/etht/carteiras.rb +30 -35
- data/lib/etht/formatar.rb +58 -38
- data/lib/etht/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: 7a4ad7470fa9f34376a9d8c23bfda947957d8d5ec81038fb093cc531724c4a34
|
4
|
+
data.tar.gz: 58347c74acaafd830dca7a21bc57cf090cca08490215f45c47859325fd520aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e35824b0aff4e74300246d2374306e9ff6fa1b1a3fa46b6a840c230feaa2ca76e2a6d443ac3dac9dc59b8a61de37986fc3ca3d57ec5d2f8d019605c2bd348ebd
|
7
|
+
data.tar.gz: 994efb07d372f8bcf2a8a2b0bad20d956f2adc64310ccde371635c40750a6fe8c39495ac04c7da46d119ffc2850a6d4d5b6e62b0f588434f4cbeec1c710c901f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
etht (0.1.
|
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.
|
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.
|
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
data/lib/etht.rb
CHANGED
@@ -26,11 +26,12 @@ module Etht
|
|
26
26
|
Bigquery.new(options).processa
|
27
27
|
end
|
28
28
|
|
29
|
-
desc 'show', 'mostra carteiras
|
30
|
-
option :v, type: :boolean, default: false, desc: 'mostra
|
31
|
-
|
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.
|
34
|
+
Bigquery.new(options).carteiras.mostra_resumo
|
34
35
|
end
|
35
36
|
|
36
37
|
default_task :show
|
data/lib/etht/bigquery.rb
CHANGED
@@ -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
|
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
|
32
|
-
@
|
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
|
-
#
|
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:
|
46
|
-
puts(format("%<n>2i LINHAS INSERIDAS #{BD}.ethk", n:
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
136
|
+
# @param cmd (see sql)
|
129
137
|
# @return [Boolean] job ok?
|
130
|
-
def job?(
|
131
|
-
@job = api.query_job(
|
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
|
145
|
+
# cria Structured Query Language (SQL) job bigquery
|
138
146
|
#
|
139
|
-
# @param
|
140
|
-
# @
|
141
|
-
|
142
|
-
|
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
|
154
|
+
# cria Data Manipulation Language (DML) job bigquery
|
146
155
|
#
|
147
|
-
# @param (see
|
148
|
-
# @return [
|
149
|
-
def
|
150
|
-
job?(
|
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
|
data/lib/etht/carteiras.rb
CHANGED
@@ -25,50 +25,50 @@ module Etht
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# @return [Array<Hash>] todos os dados etherscan - saldos & transacoes
|
28
|
-
def
|
29
|
-
@
|
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<
|
33
|
-
def
|
34
|
-
@
|
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
|
39
|
-
def
|
40
|
-
@
|
41
|
-
|
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<
|
45
|
-
def
|
46
|
-
@
|
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
|
50
|
-
def
|
51
|
-
@
|
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>]
|
55
|
-
def
|
56
|
-
@
|
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
|
60
|
-
def
|
61
|
-
|
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
|
65
|
-
def
|
66
|
-
|
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
|
70
|
-
def
|
71
|
-
(
|
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
|
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
|
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
|
data/lib/etht/formatar.rb
CHANGED
@@ -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
|
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
|
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:
|
27
|
-
to:
|
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
|
64
|
+
def formata_transacao_token(hkx)
|
35
65
|
format(
|
36
|
-
'%<bn>9i %<fr>-20.20s %<to>-20.20s %<dt>10.10s %<vl>11.3f
|
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:
|
39
|
-
to:
|
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
|
47
|
-
def
|
48
|
-
return unless
|
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
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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]
|
68
|
-
def
|
69
|
-
return unless
|
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
|
-
|
92
|
+
norml_sort.each { |e| puts(formata_transacao_norml(e)) }
|
73
93
|
end
|
74
94
|
|
75
|
-
# @return [String]
|
76
|
-
def
|
77
|
-
return unless
|
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---
|
80
|
-
|
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
|
85
|
-
return unless (
|
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=#{
|
107
|
+
puts("\nstring ajuste dias\n-h=#{todas_sort.map { |e| "#{e['blockNumber']}:0" }.join(' ')}")
|
88
108
|
end
|
89
109
|
end
|
90
110
|
end
|
data/lib/etht/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|