eost 0.1.5 → 0.1.11
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/.rubocop.yml +12 -0
- data/.travis.yml +1 -1
- data/Gemfile.lock +14 -14
- data/README.md +3 -3
- data/eost.gemspec +2 -4
- data/lib/eost.rb +38 -24
- data/lib/eost/bigquery.rb +128 -55
- data/lib/eost/carteiras.rb +109 -0
- data/lib/eost/eosscan.rb +214 -0
- data/lib/eost/folhacalculo.rb +49 -53
- data/lib/eost/formatar.rb +66 -0
- data/lib/eost/version.rb +1 -1
- data/specs/chain.json +256 -0
- data/specs/history.json +54 -0
- data/specs/wallet.json +12 -0
- metadata +10 -3
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# @author Hernani Rodrigues Vaz
|
4
|
+
module Eost
|
5
|
+
# (see Carteiras)
|
6
|
+
class Carteiras
|
7
|
+
# @param [Hash] hjn dados juntos bigquery & eosscan
|
8
|
+
# @return [String] texto formatado duma carteira
|
9
|
+
def formata_carteira(hjn)
|
10
|
+
format(
|
11
|
+
'%<s1>-12.12s %<v1>12.4f %<v2>12.4f %<nn>3i %<ok>-3s',
|
12
|
+
s1: hjn[:ax],
|
13
|
+
v1: hjn[:bs],
|
14
|
+
v2: hjn[:es],
|
15
|
+
nn: hjn[:nn].count,
|
16
|
+
ok: hjn[:ok] ? 'OK' : 'NOK'
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @param [Hash] htx transacao
|
21
|
+
# @return [String] texto formatado transacao
|
22
|
+
def formata_transacao(htx)
|
23
|
+
format(
|
24
|
+
'%<bn>9i %<fr>-12.12s %<to>-12.12s %<ac>-12.12s %<dt>10.10s %<vl>13.4f %<sy>-6.6s',
|
25
|
+
bn: htx['block_num'],
|
26
|
+
fr: act_data(htx)['from'],
|
27
|
+
to: act_data(htx)['to'],
|
28
|
+
ac: htx['action_trace']['act']['name'],
|
29
|
+
dt: Date.parse(htx['block_time']),
|
30
|
+
vl: act_data(htx)['quantity'].to_d,
|
31
|
+
sy: act_data(htx)['quantity'][/[[:upper:]]+/]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
# @param (see formata_transacao)
|
36
|
+
# @return [Hash] dados da acao
|
37
|
+
def act_data(htx)
|
38
|
+
htx['action_trace']['act']['data']
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [String] texto carteiras & transacoes & ajuste dias
|
42
|
+
def mostra_resumo
|
43
|
+
return unless djn.count.positive?
|
44
|
+
|
45
|
+
puts("\naddress --bigquery-- --eosscans-- new")
|
46
|
+
djn.each { |e| puts(formata_carteira(e)) }
|
47
|
+
mostra_transacoes_novas
|
48
|
+
mostra_configuracao_ajuste_dias
|
49
|
+
end
|
50
|
+
|
51
|
+
# @return [String] texto transacoes
|
52
|
+
def mostra_transacoes_novas
|
53
|
+
return unless ops[:v] && novas.count.positive?
|
54
|
+
|
55
|
+
puts("\nblock num add from add to accao ---data--- ----valor----")
|
56
|
+
novas_sort.each { |e| puts(formata_transacao(e)) }
|
57
|
+
end
|
58
|
+
|
59
|
+
# @return [String] texto configuracao ajuste dias das transacoes
|
60
|
+
def mostra_configuracao_ajuste_dias
|
61
|
+
return unless novas.count.positive?
|
62
|
+
|
63
|
+
puts("\nstring ajuste dias\n-h=#{novas_sort.map { |e| "#{e['block_num']}:0" }.join(' ')}")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/lib/eost/version.rb
CHANGED
data/specs/chain.json
ADDED
@@ -0,0 +1,256 @@
|
|
1
|
+
{
|
2
|
+
"abi_bin_to_json": {
|
3
|
+
"brief": "Convert bin hex back into Abi json definition.",
|
4
|
+
"params": {
|
5
|
+
"code": "name",
|
6
|
+
"action": "name",
|
7
|
+
"binargs": "bytes"
|
8
|
+
},
|
9
|
+
"results": {
|
10
|
+
"args": "bytes",
|
11
|
+
"required_scope": "name[]",
|
12
|
+
"required_auth": "name[]"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
|
16
|
+
"abi_json_to_bin": {
|
17
|
+
"brief": "Manually serialize json into binary hex. The binayargs is usually stored in Message.data.",
|
18
|
+
"params": {
|
19
|
+
"code": "name",
|
20
|
+
"action": "name",
|
21
|
+
"args": "bytes"
|
22
|
+
},
|
23
|
+
"results": {
|
24
|
+
"binargs": "bytes"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
|
28
|
+
"get_abi": {
|
29
|
+
"params": {
|
30
|
+
"account_name": "name"
|
31
|
+
},
|
32
|
+
"results": {
|
33
|
+
"account_name": "name",
|
34
|
+
"abi": "abi_def?"
|
35
|
+
}
|
36
|
+
},
|
37
|
+
|
38
|
+
"get_account": {
|
39
|
+
"brief": "Fetch a blockchain account",
|
40
|
+
"params": {
|
41
|
+
"account_name": "name"
|
42
|
+
},
|
43
|
+
"results": {
|
44
|
+
"account_name": "name",
|
45
|
+
"privileged": "bool",
|
46
|
+
"last_code_update": "time_point",
|
47
|
+
"created": "time_point",
|
48
|
+
"ram_quota": "int64",
|
49
|
+
"net_weight": "int64",
|
50
|
+
"cpu_weight": "int64",
|
51
|
+
"net_limit": "int64",
|
52
|
+
"cpu_limit": "int64",
|
53
|
+
"ram_usage": "int64",
|
54
|
+
"permissions": "vector<permission>"
|
55
|
+
}
|
56
|
+
},
|
57
|
+
|
58
|
+
"get_block": {
|
59
|
+
"brief": "Fetch a block from the blockchain.",
|
60
|
+
"params": {
|
61
|
+
"block_num_or_id": "string"
|
62
|
+
},
|
63
|
+
"results": {
|
64
|
+
"previous":"block_id",
|
65
|
+
"timestamp":"time",
|
66
|
+
"transaction_mroot":"checksum256",
|
67
|
+
"action_mroot":"checksum256",
|
68
|
+
"producer": "account_name",
|
69
|
+
"schedule_version":"uint32",
|
70
|
+
"producer_signature":"signature",
|
71
|
+
"transactions": "transaction[]",
|
72
|
+
"id": "fixed_bytes33",
|
73
|
+
"block_num": "uint32",
|
74
|
+
"ref_block_prefix": "uint32"
|
75
|
+
},
|
76
|
+
"errors": {
|
77
|
+
"unknown block": null
|
78
|
+
}
|
79
|
+
},
|
80
|
+
"get_block_header_state": {
|
81
|
+
"brief": "Fetch the minimum state necessary to validate transaction headers.",
|
82
|
+
"params": {
|
83
|
+
"block_num_or_id": "string"
|
84
|
+
},
|
85
|
+
"results": "string",
|
86
|
+
"errors": {
|
87
|
+
"block_id_type_exception": "Invalid block ID",
|
88
|
+
"unknown_block_exception": "Could not find reversible block"
|
89
|
+
}
|
90
|
+
},
|
91
|
+
"get_code": {
|
92
|
+
"brief": "Fetch smart contract code",
|
93
|
+
"params": {
|
94
|
+
"account_name": "name"
|
95
|
+
},
|
96
|
+
"results": {
|
97
|
+
"account_name": "name",
|
98
|
+
"wast": "string",
|
99
|
+
"code_hash": "sha256",
|
100
|
+
"abi": "optional<abi_def>"
|
101
|
+
}
|
102
|
+
},
|
103
|
+
|
104
|
+
"get_currency_balance": {
|
105
|
+
"params": {
|
106
|
+
"code": "name",
|
107
|
+
"account": "name",
|
108
|
+
"symbol": "optional<string>"
|
109
|
+
},
|
110
|
+
"results": "asset[]"
|
111
|
+
},
|
112
|
+
|
113
|
+
"get_currency_stats": {
|
114
|
+
"params": {
|
115
|
+
"code": "name",
|
116
|
+
"symbol": "string"
|
117
|
+
},
|
118
|
+
"results": {
|
119
|
+
"supply": "asset",
|
120
|
+
"max_supply": "asset",
|
121
|
+
"issuer": "account_name"
|
122
|
+
}
|
123
|
+
},
|
124
|
+
|
125
|
+
"get_info": {
|
126
|
+
"brief": "Return general network information.",
|
127
|
+
"params": null,
|
128
|
+
"results": {
|
129
|
+
"server_version" : "string",
|
130
|
+
"head_block_num" : "uint32",
|
131
|
+
"last_irreversible_block_num" : "uint32",
|
132
|
+
"last_irreversible_block_id" : "block_id",
|
133
|
+
"head_block_id" : "block_id",
|
134
|
+
"head_block_time" : "time_point_sec",
|
135
|
+
"head_block_producer" : "account_name",
|
136
|
+
"virtual_block_cpu_limit" : "uint64",
|
137
|
+
"virtual_block_net_limit" : "uint64",
|
138
|
+
"block_cpu_limit" : "uint64",
|
139
|
+
"block_net_limit" : "uint64"
|
140
|
+
}
|
141
|
+
},
|
142
|
+
"get_producers": {
|
143
|
+
"brief": "Fetch smart contract data from producer.",
|
144
|
+
"params": {
|
145
|
+
"json": { "type": "bool", "default": false},
|
146
|
+
"lower_bound": "string",
|
147
|
+
"limit": {"type": "uint32", "default": "10"}
|
148
|
+
},
|
149
|
+
"results": {
|
150
|
+
"rows": {
|
151
|
+
"type": "vector",
|
152
|
+
"doc": "one row per item, either encoded as hex String or JSON object"
|
153
|
+
},
|
154
|
+
"total_producer_vote_weight": {
|
155
|
+
"type": "float64",
|
156
|
+
"doc": "total vote"
|
157
|
+
},
|
158
|
+
"more": {
|
159
|
+
"type": "string",
|
160
|
+
"doc": "fill lower_bound with this value to fetch more rows"
|
161
|
+
}
|
162
|
+
}
|
163
|
+
},
|
164
|
+
"get_producer_schedule": {
|
165
|
+
"brief": "",
|
166
|
+
"params": {},
|
167
|
+
"results": {
|
168
|
+
"vector": "active",
|
169
|
+
"vector": "pending",
|
170
|
+
"vector": "proposed"
|
171
|
+
}
|
172
|
+
},
|
173
|
+
"get_raw_code_and_abi": {
|
174
|
+
"params": {
|
175
|
+
"account_name": "name"
|
176
|
+
},
|
177
|
+
"results": {
|
178
|
+
"account_name": "name",
|
179
|
+
"wasm": "bytes",
|
180
|
+
"abi": "abi_def?"
|
181
|
+
}
|
182
|
+
},
|
183
|
+
"get_required_keys": {
|
184
|
+
"params": {
|
185
|
+
"transaction": "transaction",
|
186
|
+
"available_keys": "set[public_key]"
|
187
|
+
},
|
188
|
+
"results": "Set[public_key]"
|
189
|
+
},
|
190
|
+
"get_scheduled_transactions": {
|
191
|
+
"brief": "",
|
192
|
+
"params": {
|
193
|
+
"json": { "type": "bool", "default": false},
|
194
|
+
"lower_bound": {"type": "string", "doc": "timestamp OR transaction ID"},
|
195
|
+
"limit": {"type": "uint32", "default": "50"}
|
196
|
+
},
|
197
|
+
"results": {
|
198
|
+
"vector": "transactions",
|
199
|
+
"more": {
|
200
|
+
"type": "string",
|
201
|
+
"doc": "fill lower_bound with this to fetch next set of transactions"
|
202
|
+
}
|
203
|
+
}
|
204
|
+
},
|
205
|
+
"get_table_rows": {
|
206
|
+
"brief": "Fetch smart contract data from an account.",
|
207
|
+
"params": {
|
208
|
+
"json": { "type": "bool", "default": false},
|
209
|
+
"code": "name",
|
210
|
+
"scope": "name",
|
211
|
+
"table": "name",
|
212
|
+
"table_key": "string",
|
213
|
+
"lower_bound": {"type": "string", "default": "0"},
|
214
|
+
"upper_bound": {"type": "string", "default": "-1"},
|
215
|
+
"limit": {"type": "uint32", "default": "10"}
|
216
|
+
},
|
217
|
+
"results": {
|
218
|
+
"rows": {
|
219
|
+
"type": "vector",
|
220
|
+
"doc": "one row per item, either encoded as hex String or JSON object"
|
221
|
+
},
|
222
|
+
"more": {
|
223
|
+
"type": "bool",
|
224
|
+
"doc": "true if last element"
|
225
|
+
}
|
226
|
+
}
|
227
|
+
},
|
228
|
+
|
229
|
+
"push_block": {
|
230
|
+
"brief": "Append a block to the chain database.",
|
231
|
+
"params": {
|
232
|
+
"block": "signed_block"
|
233
|
+
},
|
234
|
+
"results": null
|
235
|
+
},
|
236
|
+
|
237
|
+
"push_transaction": {
|
238
|
+
"brief": "Attempts to push the transaction into the pending queue.",
|
239
|
+
"params": {
|
240
|
+
"signed_transaction": "signed_transaction"
|
241
|
+
},
|
242
|
+
"results": {
|
243
|
+
"transaction_id": "fixed_bytes32",
|
244
|
+
"processed": "bytes"
|
245
|
+
}
|
246
|
+
},
|
247
|
+
|
248
|
+
"push_transactions": {
|
249
|
+
"brief": "Attempts to push transactions into the pending queue.",
|
250
|
+
"params": {
|
251
|
+
"signed_transaction[]": "signed_transaction"
|
252
|
+
},
|
253
|
+
"results": "vector[push_transaction.results]"
|
254
|
+
}
|
255
|
+
|
256
|
+
}
|
data/specs/history.json
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"get_actions": {
|
3
|
+
"params": {
|
4
|
+
"account_name": "account_name",
|
5
|
+
"pos": "int32?",
|
6
|
+
"offset": "int32?"
|
7
|
+
},
|
8
|
+
"results": {
|
9
|
+
"actions": "ordered_action_result[]",
|
10
|
+
"last_irreversible_block": "uint32",
|
11
|
+
"time_limit_exceeded_error": "bool?"
|
12
|
+
},
|
13
|
+
"structs": [{
|
14
|
+
"name": "ordered_action_result",
|
15
|
+
"fields": {
|
16
|
+
"global_action_seq": "uint64",
|
17
|
+
"account_action_seq": "int32",
|
18
|
+
"block_num": "uint32",
|
19
|
+
"block_time": "block_timestamp_type",
|
20
|
+
"action_trace": "variant"
|
21
|
+
}
|
22
|
+
}]
|
23
|
+
},
|
24
|
+
"get_transaction": {
|
25
|
+
"brief": "Retrieve a transaction from the blockchain.",
|
26
|
+
"params": {
|
27
|
+
"id": "transaction_id_type"
|
28
|
+
},
|
29
|
+
"results": {
|
30
|
+
"id": "transaction_id_type",
|
31
|
+
"trx": "variant",
|
32
|
+
"block_time": "block_timestamp_type",
|
33
|
+
"block_num": "uint32",
|
34
|
+
"last_irreversible_block": "uint32",
|
35
|
+
"traces": "variant[]"
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"get_key_accounts": {
|
39
|
+
"params": {
|
40
|
+
"public_key": "public_key_type"
|
41
|
+
},
|
42
|
+
"results": {
|
43
|
+
"account_names": "account_name[]"
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"get_controlled_accounts": {
|
47
|
+
"params": {
|
48
|
+
"controlling_account": "account_name"
|
49
|
+
},
|
50
|
+
"results": {
|
51
|
+
"controlled_accounts": "account_name[]"
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
data/specs/wallet.json
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
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
|
@@ -104,6 +104,7 @@ extensions: []
|
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
106
|
- ".gitignore"
|
107
|
+
- ".rubocop.yml"
|
107
108
|
- ".travis.yml"
|
108
109
|
- CODE_OF_CONDUCT.md
|
109
110
|
- Gemfile
|
@@ -117,8 +118,14 @@ files:
|
|
117
118
|
- exe/eost
|
118
119
|
- lib/eost.rb
|
119
120
|
- lib/eost/bigquery.rb
|
121
|
+
- lib/eost/carteiras.rb
|
122
|
+
- lib/eost/eosscan.rb
|
120
123
|
- lib/eost/folhacalculo.rb
|
124
|
+
- lib/eost/formatar.rb
|
121
125
|
- lib/eost/version.rb
|
126
|
+
- specs/chain.json
|
127
|
+
- specs/history.json
|
128
|
+
- specs/wallet.json
|
122
129
|
homepage: https://github.com/hernanirvaz/abank
|
123
130
|
licenses:
|
124
131
|
- MIT
|
@@ -140,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
147
|
- !ruby/object:Gem::Version
|
141
148
|
version: '0'
|
142
149
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.1.2
|
144
151
|
signing_key:
|
145
152
|
specification_version: 4
|
146
153
|
summary: Arquiva eos-transactions.csv no bigquery.
|