cns 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2831cc8463f48af9870a6d577be3161c608e4d5b410c8b0976fab2b2d7d9bbe9
4
- data.tar.gz: 3de096f6a0d55a541731c67ed889c2134426f186bdc8d1e24b7d8cf8a6c4fd5f
3
+ metadata.gz: 61b5bd4279e22a5bc61efb12f3717d805aaefa15d46b4f98ef45a05c052b701e
4
+ data.tar.gz: 34984d55f0b46e72097d5a589b0f3d2700dd89fc8877ba0c2e38ad55c553fed8
5
5
  SHA512:
6
- metadata.gz: cdbcc626c2105243833bf26f447e5da36b113fe16ccd787f53c39fd800cb211cc159f49ff005936dff756070b0ecf2299e871874f212737569f0d1ed114e7844
7
- data.tar.gz: d580a5ff25b83296c3f8376b9dde8a2cd56b07bf9cdea937257f05dc42c596d031f208cb10f9ac538a10b7cdd6e8f4a4cfdd41f3545d08d731f87cf95dfaa265
6
+ metadata.gz: 524fc4c7bd9170238499712ab47c7f994f350421955e6e85af4ba1695992825f491ed201bcc8c9942df3f9aa9c2eb65ab0b50d8156e932239db1ff59ee57117f
7
+ data.tar.gz: 836882fa7b8e372b62d3399004bd97993cedd74fd7fe8da423ee95b1493de28053beed1ea9405b4382c537ad6950c079ebd974b048f3130ecd8e1453d2fd23b0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.7.0)
4
+ cns (0.7.1)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
data/lib/cns/bigquery.rb CHANGED
@@ -81,29 +81,29 @@ module Cns
81
81
 
82
82
  private
83
83
 
84
- # insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
84
+ # insere transacoes blockchain novas nas tabelas netht (norml), nethi (internas), nethp (block), nethw (withdrawals), nethk (token)
85
85
  #
86
86
  # @return [String] linhas & tabelas afetadas
87
87
  def processa_eth
88
88
  str = "ETH"
89
- str += format(" %<n>i etht", n: dml(etht_ins)) if apies.novtx.count > 0
90
- str += format(" %<n>i ethi", n: dml(ethi_ins)) if apies.novix.count > 0
91
- str += format(" %<n>i ethp", n: dml(ethp_ins)) if apies.novpx.count > 0
92
- str += format(" %<n>i ethw", n: dml(ethw_ins)) if apies.novwx.count > 0
93
- str += format(" %<n>i ethk", n: dml(ethk_ins)) if apies.novkx.count > 0
89
+ str += format(" %<n>i netht", n: dml(netht_ins)) if apies.novtx.count > 0
90
+ str += format(" %<n>i nethi", n: dml(nethi_ins)) if apies.novix.count > 0
91
+ str += format(" %<n>i nethp", n: dml(nethp_ins)) if apies.novpx.count > 0
92
+ str += format(" %<n>i nethw", n: dml(nethw_ins)) if apies.novwx.count > 0
93
+ str += format(" %<n>i nethk", n: dml(nethk_ins)) if apies.novkx.count > 0
94
94
  str
95
95
  end
96
96
 
97
- # insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
97
+ # insere transacoes blockchain novas nas tabelas netht (norml), nethi (internas), nethp (block), nethw (withdrawals), nethk (token)
98
98
  #
99
99
  # @return [String] linhas & tabelas afetadas
100
100
  def processa_ethc
101
101
  str = "ETH"
102
- str += format(" %<n>i etht", n: dml(ethtc_ins)) if apiesc.novtx.count > 0
103
- str += format(" %<n>i ethi", n: dml(ethic_ins)) if apiesc.novix.count > 0
104
- str += format(" %<n>i ethp", n: dml(ethpc_ins)) if apiesc.novpx.count > 0
105
- str += format(" %<n>i ethw", n: dml(ethwc_ins)) if apiesc.novwx.count > 0
106
- str += format(" %<n>i ethk", n: dml(ethkc_ins)) if apiesc.novkx.count > 0
102
+ str += format(" %<n>i netht", n: dml(netbt_ins)) if apiesc.novtx.count > 0
103
+ str += format(" %<n>i nethi", n: dml(netbi_ins)) if apiesc.novix.count > 0
104
+ str += format(" %<n>i nethp", n: dml(netbp_ins)) if apiesc.novpx.count > 0
105
+ str += format(" %<n>i nethw", n: dml(netbw_ins)) if apiesc.novwx.count > 0
106
+ str += format(" %<n>i nethk", n: dml(netbk_ins)) if apiesc.novkx.count > 0
107
107
  str
108
108
  end
109
109
 
@@ -169,12 +169,12 @@ module Cns
169
169
  def apies
170
170
  @apies ||= Etherscan.new(
171
171
  {
172
- wb: sql("select * from #{BD}.walletEth order by 2"),
173
- nt: sql("select * from #{BD}.ethtx"),
174
- ni: sql("select * from #{BD}.ethix"),
175
- np: sql("select * from #{BD}.ethpx"),
176
- nw: sql("select * from #{BD}.ethwx"),
177
- nk: sql("select * from #{BD}.ethkx")
172
+ wb: sql("select * from #{BD}.weth order by 2"),
173
+ ni: sql("select * from #{BD}.netai"),
174
+ nk: sql("select * from #{BD}.netak"),
175
+ np: sql("select * from #{BD}.netap"),
176
+ nt: sql("select * from #{BD}.netat"),
177
+ nw: sql("select * from #{BD}.netaw")
178
178
  },
179
179
  ops
180
180
  )
@@ -184,12 +184,12 @@ module Cns
184
184
  def apiesc
185
185
  @apies ||= Etherscan.new(
186
186
  {
187
- wb: sql("select * from #{BD}.walletEthc order by 2"),
188
- nt: sql("select * from #{BD}.ethtxc"),
189
- ni: sql("select * from #{BD}.ethixc"),
190
- np: sql("select * from #{BD}.ethpxc"),
191
- nw: sql("select * from #{BD}.ethwxc"),
192
- nk: sql("select * from #{BD}.ethkxc")
187
+ wb: sql("select * from #{BD}.wetc order by 2"),
188
+ ni: sql("select * from #{BD}.netbi"),
189
+ nk: sql("select * from #{BD}.netbk"),
190
+ np: sql("select * from #{BD}.netbp"),
191
+ nt: sql("select * from #{BD}.netbt"),
192
+ nw: sql("select * from #{BD}.netbw")
193
193
  },
194
194
  ops
195
195
  )
@@ -199,8 +199,8 @@ module Cns
199
199
  def apigm
200
200
  @apigm ||= Greymass.new(
201
201
  {
202
- wb: sql("select * from #{BD}.walletEos order by 2"),
203
- nt: sql("select * from #{BD}.eostx")
202
+ wb: sql("select * from #{BD}.weos order by 2"),
203
+ nt: sql("select * from #{BD}.neosx")
204
204
  },
205
205
  ops
206
206
  )
@@ -210,10 +210,9 @@ module Cns
210
210
  def apius
211
211
  @apius ||= Kraken.new(
212
212
  {
213
- #sl: sql("select sum(btc) xxbt,sum(eth) xeth,sum(eos) eos,sum(eur) zeur from #{BD}.ussl")[0],
214
- sl: sql("select * from #{BD}.ussl")[0],
215
- nt: sql("select * from #{BD}.ust order by time,txid"),
216
- nl: sql("select * from #{BD}.usl order by time,txid")
213
+ sl: sql("select * from #{BD}.cuss")[0],
214
+ nt: sql("select * from #{BD}.cust order by time,txid"),
215
+ nl: sql("select * from #{BD}.cusl order by time,txid")
217
216
  },
218
217
  ops
219
218
  )
@@ -223,112 +222,124 @@ module Cns
223
222
  def apide
224
223
  @apide ||= Bitcoinde.new(
225
224
  {
226
- sl: sql("select * from #{BD}.desl")[0],
227
- nt: sql("select * from #{BD}.det order by time,txid"),
228
- nl: sql("select * from #{BD}.del order by time,txid")
225
+ sl: sql("select * from #{BD}.cdes")[0],
226
+ nt: sql("select * from #{BD}.cdet order by time,txid"),
227
+ nl: sql("select * from #{BD}.cdel order by time,txid")
229
228
  },
230
229
  ops
231
230
  )
232
231
  end
233
232
 
234
- # @return [String] comando insert SQL formatado etht (norml)
235
- def etht_ins
236
- "insert #{BD}.etht(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,iax," \
237
- 'value,gas,gasprice,gasused,iserror,txreceipt_status,input,contractaddress,dias' \
238
- ") VALUES#{apies.novtx.map { |obj| etht_1val(obj) }.join(',')}"
233
+ # @return [String] comando insert SQL formatado netht (norml)
234
+ def bnetht_ins
235
+ "insert #{BD}.netht(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,iax," \
236
+ 'value,gas,gasprice,gasused,iserror,txreceipt_status,input,contractaddress,dias) VALUES'
239
237
  end
240
238
 
241
- # @return [String] comando insert SQL formatado ethi (internas)
242
- def ethi_ins
243
- "insert #{BD}.ethi(blocknumber,timestamp,txhash,axfrom,axto,iax," \
244
- 'value,contractaddress,input,type,gas,gasused,traceid,iserror,errcode' \
245
- ") VALUES#{apies.novix.map { |obj| ethi_1val(obj) }.join(',')}"
239
+ # @return [String] comando insert SQL formatado nethi (internas)
240
+ def bnethi_ins
241
+ "insert #{BD}.nethi(blocknumber,timestamp,txhash,axfrom,axto,iax," \
242
+ 'value,contractaddress,input,type,gas,gasused,traceid,iserror,errcode) VALUES'
246
243
  end
247
244
 
248
- # @return [String] comando insert SQL formatado ethp (block)
249
- def ethp_ins
250
- "insert #{BD}.ethp(blocknumber,timestamp,blockreward,iax" \
251
- ") VALUES#{apies.novpx.map { |obj| ethp_1val(obj) }.join(',')}"
245
+ # @return [String] comando insert SQL formatado nethp (block)
246
+ def bnethp_ins
247
+ "insert #{BD}.nethp(blocknumber,timestamp,blockreward,iax) VALUES"
252
248
  end
253
249
 
254
- # @return [String] comando insert SQL formatado ethw (withdrawals)
255
- def ethw_ins
256
- "insert #{BD}.ethw(withdrawalindex,validatorindex,address,amount,blocknumber,timestamp" \
257
- ") VALUES#{apies.novwx.map { |obj| ethw_1val(obj) }.join(',')}"
250
+ # @return [String] comando insert SQL formatado nethw (withdrawals)
251
+ def bnethw_ins
252
+ "insert #{BD}.nethw(withdrawalindex,validatorindex,address,amount,blocknumber,timestamp) VALUES"
258
253
  end
259
254
 
260
- # @return [String] comando insert SQL formatado ethk (token)
261
- def ethk_ins
262
- "insert #{BD}.ethk(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,iax," \
263
- 'value,tokenname,tokensymbol,tokendecimal,gas,gasprice,gasused,input,contractaddress,dias' \
264
- ") VALUES#{apies.novkx.map { |obj| ethk_1val(obj) }.join(',')}"
255
+ # @return [String] comando insert SQL formatado nethk (token)
256
+ def bnethk_ins
257
+ "insert #{BD}.nethk(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,iax," \
258
+ 'value,tokenname,tokensymbol,tokendecimal,gas,gasprice,gasused,input,contractaddress,dias) VALUES'
265
259
  end
266
260
 
267
- # @return [String] comando insert SQL formatado etht (norml)
268
- def ethtc_ins
269
- "insert #{BD}.etht(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,iax," \
270
- 'value,gas,gasprice,gasused,iserror,txreceipt_status,input,contractaddress,dias' \
271
- ") VALUES#{apiesc.novtx.map { |obj| etht_1val(obj) }.join(',')}"
261
+ # @return [String] comando insert SQL formatado netht (norml)
262
+ def netht_ins
263
+ "#{bnetht_ins}#{apies.novtx.map { |obj| netht_1val(obj) }.join(',')}"
272
264
  end
273
265
 
274
- # @return [String] comando insert SQL formatado ethi (internas)
275
- def ethic_ins
276
- "insert #{BD}.ethi(blocknumber,timestamp,txhash,axfrom,axto,iax," \
277
- 'value,contractaddress,input,type,gas,gasused,traceid,iserror,errcode' \
278
- ") VALUES#{apiesc.novix.map { |obj| ethi_1val(obj) }.join(',')}"
266
+ # @return [String] comando insert SQL formatado nethi (internas)
267
+ def nethi_ins
268
+ "#{bnethi_ins}#{apies.novix.map { |obj| nethi_1val(obj) }.join(',')}"
279
269
  end
280
270
 
281
- # @return [String] comando insert SQL formatado ethp (block)
282
- def ethpc_ins
283
- "insert #{BD}.ethp(blocknumber,timestamp,blockreward,iax" \
284
- ") VALUES#{apiesc.novpx.map { |obj| ethp_1val(obj) }.join(',')}"
271
+ # @return [String] comando insert SQL formatado nethp (block)
272
+ def nethp_ins
273
+ "#{bnethp_ins}#{apies.novpx.map { |obj| nethp_1val(obj) }.join(',')}"
285
274
  end
286
275
 
287
- # @return [String] comando insert SQL formatado ethw (withdrawals)
288
- def ethwc_ins
289
- "insert #{BD}.ethw(withdrawalindex,validatorindex,address,amount,blocknumber,timestamp" \
290
- ") VALUES#{apiesc.novwx.map { |obj| ethw_1val(obj) }.join(',')}"
276
+ # @return [String] comando insert SQL formatado nethw (withdrawals)
277
+ def nethw_ins
278
+ "#{bnethw_ins}#{apies.novwx.map { |obj| nethw_1val(obj) }.join(',')}"
291
279
  end
292
280
 
293
- # @return [String] comando insert SQL formatado ethk (token)
294
- def ethkc_ins
295
- "insert #{BD}.ethk(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,iax," \
296
- 'value,tokenname,tokensymbol,tokendecimal,gas,gasprice,gasused,input,contractaddress,dias' \
297
- ") VALUES#{apiesc.novkx.map { |obj| ethk_1val(obj) }.join(',')}"
281
+ # @return [String] comando insert SQL formatado nethk (token)
282
+ def nethk_ins
283
+ "#{bnethk_ins}#{apies.novkx.map { |obj| nethk_1val(obj) }.join(',')}"
284
+ end
285
+
286
+ # @return [String] comando insert SQL formatado netht (norml)
287
+ def netbt_ins
288
+ "#{bnetht_ins}#{apiesc.novtx.map { |obj| netht_1val(obj) }.join(',')}"
289
+ end
290
+
291
+ # @return [String] comando insert SQL formatado nethi (internas)
292
+ def netbi_ins
293
+ "#{bnethi_ins}#{apiesc.novix.map { |obj| nethi_1val(obj) }.join(',')}"
294
+ end
295
+
296
+ # @return [String] comando insert SQL formatado nethp (block)
297
+ def netbp_ins
298
+ "#{bnethp_ins}#{apiesc.novpx.map { |obj| nethp_1val(obj) }.join(',')}"
299
+ end
300
+
301
+ # @return [String] comando insert SQL formatado nethw (withdrawals)
302
+ def netbw_ins
303
+ "#{bnethw_ins}#{apiesc.novwx.map { |obj| nethw_1val(obj) }.join(',')}"
304
+ end
305
+
306
+ # @return [String] comando insert SQL formatado nethk (token)
307
+ def netbk_ins
308
+ "#{bnethk_ins}#{apiesc.novkx.map { |obj| nethk_1val(obj) }.join(',')}"
298
309
  end
299
310
 
300
311
  # @return [String] comando insert SQL formatado eos
301
312
  def eost_ins
302
- "insert #{BD}.eos(gseq,aseq,bnum,time,contract,action,acfrom,acto,iax,amount,moeda,memo,dias" \
313
+ "insert #{BD}.neost(gseq,aseq,bnum,time,contract,action,acfrom,acto,iax,amount,moeda,memo,dias" \
303
314
  ") VALUES#{apigm.novax.map { |obj| eost_1val(obj) }.join(',')}"
304
315
  end
305
316
 
306
317
  # @return [String] comando insert SQL formatado det (trades)
307
318
  def det_ins
308
- "insert #{BD}.det(txid,time,tp,user,btc,eur,dtc,dias) VALUES#{apide.trades.map { |obj| det_1val(obj) }.join(',')}"
319
+ "insert #{BD}.cdet(txid,time,tp,user,btc,eur,dtc,dias) VALUES#{apide.trades.map { |obj| det_1val(obj) }.join(',')}"
309
320
  end
310
321
 
311
322
  # @return [String] comando insert SQL formatado del (ledger)
312
323
  def del_ins
313
- "insert #{BD}.del(txid,time,tp,add,moe,qt,fee) VALUES#{apide.ledger.map { |obj| del_val(obj) }.join(',')}"
324
+ "insert #{BD}.cdel(txid,time,tp,add,moe,qt,fee) VALUES#{apide.ledger.map { |obj| del_val(obj) }.join(',')}"
314
325
  end
315
326
 
316
327
  # @return [String] comando insert SQL formatado ust (trades)
317
328
  def ust_ins
318
- "insert #{BD}.ust(txid,ordertxid,pair,time,type,ordertype,price,cost,fee,vol,margin,misc,ledgers,dias) " \
329
+ "insert #{BD}.cust(txid,ordertxid,pair,time,type,ordertype,price,cost,fee,vol,margin,misc,ledgers,dias) " \
319
330
  "VALUES#{apius.trades.map { |key, val| ust_1val(key, val) }.join(',')}"
320
331
  end
321
332
 
322
333
  # @return [String] comando insert SQL formatado usl (ledger)
323
334
  def usl_ins
324
- "insert #{BD}.usl(txid,refid,time,type,aclass,asset,amount,fee) " \
335
+ "insert #{BD}.cusl(txid,refid,time,type,aclass,asset,amount,fee) " \
325
336
  "VALUES#{apius.ledger.map { |key, val| usl_val(key, val) }.join(',')}"
326
337
  end
327
338
 
328
339
  # @example (see Apibc#norml_es)
329
340
  # @param [Hash] htx transacao norml etherscan
330
- # @return [String] valores formatados etht (norml parte1)
331
- def etht_1val(htx)
341
+ # @return [String] valores formatados netht (norml parte1)
342
+ def netht_1val(htx)
332
343
  "(#{Integer(htx[:blockNumber])}," \
333
344
  "#{Integer(htx[:timeStamp])}," \
334
345
  "'#{htx[:hash]}'," \
@@ -338,12 +349,12 @@ module Cns
338
349
  "'#{htx[:from]}'," \
339
350
  "'#{htx[:to]}'," \
340
351
  "'#{htx[:iax]}'," \
341
- "#{etht_2val(htx)}"
352
+ "#{netht_2val(htx)}"
342
353
  end
343
354
 
344
- # @param (see etht_1val)
345
- # @return [String] valores formatados etht (norml parte2)
346
- def etht_2val(htx)
355
+ # @param (see netht_1val)
356
+ # @return [String] valores formatados netht (norml parte2)
357
+ def netht_2val(htx)
347
358
  txr = htx[:txreceipt_status]
348
359
  "cast('#{htx[:value]}' as numeric)," \
349
360
  "cast('#{htx[:gas]}' as numeric)," \
@@ -351,12 +362,12 @@ module Cns
351
362
  "cast('#{htx[:gasUsed]}' as numeric)," \
352
363
  "#{Integer(htx[:isError])}," \
353
364
  "#{txr.length.zero? ? 'null' : txr}," \
354
- "#{etht_3val(htx)}"
365
+ "#{netht_3val(htx)}"
355
366
  end
356
367
 
357
- # @param (see etht_1val)
358
- # @return [String] valores formatados etht (norml parte3)
359
- def etht_3val(htx)
368
+ # @param (see netht_1val)
369
+ # @return [String] valores formatados netht (norml parte3)
370
+ def netht_3val(htx)
360
371
  cta = htx[:contractAddress]
361
372
  inp = htx[:input]
362
373
  "#{inp.length.zero? ? 'null' : "'#{inp}'"}," \
@@ -366,8 +377,8 @@ module Cns
366
377
 
367
378
  # @example (see Apibc#inter_es)
368
379
  # @param [Hash] htx transacao internas etherscan
369
- # @return [String] valores formatados ethi (internas parte1)
370
- def ethi_1val(htx)
380
+ # @return [String] valores formatados nethi (internas parte1)
381
+ def nethi_1val(htx)
371
382
  cta = htx[:contractAddress]
372
383
  "(#{Integer(htx[:blockNumber])}," \
373
384
  "#{Integer(htx[:timeStamp])}," \
@@ -377,12 +388,12 @@ module Cns
377
388
  "'#{htx[:iax]}'," \
378
389
  "cast('#{htx[:value]}' as numeric)," \
379
390
  "#{cta.length.zero? ? 'null' : "'#{cta}'"}," \
380
- "#{ethi_2val(htx)}"
391
+ "#{nethi_2val(htx)}"
381
392
  end
382
393
 
383
- # @param (see ethi_1val)
384
- # @return [String] valores formatados ethi (internas parte2)
385
- def ethi_2val(htx)
394
+ # @param (see nethi_1val)
395
+ # @return [String] valores formatados nethi (internas parte2)
396
+ def nethi_2val(htx)
386
397
  inp = htx[:input]
387
398
  tid = htx[:traceId]
388
399
  txr = htx[:errCode]
@@ -397,8 +408,8 @@ module Cns
397
408
 
398
409
  # @example (see Apibc#block_es)
399
410
  # @param [Hash] htx transacao block etherscan
400
- # @return [String] valores formatados ethi (block parte1)
401
- def ethp_1val(htx)
411
+ # @return [String] valores formatados nethi (block parte1)
412
+ def nethp_1val(htx)
402
413
  "(#{Integer(htx[:blockNumber])}," \
403
414
  "#{Integer(htx[:timeStamp])}," \
404
415
  "cast('#{htx[:blockReward]}' as numeric)," \
@@ -407,8 +418,8 @@ module Cns
407
418
 
408
419
  # @example (see Apibc#block_es)
409
420
  # @param [Hash] htx transacao withdrawals etherscan
410
- # @return [String] valores formatados ethi (withdrawals parte1)
411
- def ethw_1val(htx)
421
+ # @return [String] valores formatados nethi (withdrawals parte1)
422
+ def nethw_1val(htx)
412
423
  "(#{Integer(htx[:withdrawalIndex])}," \
413
424
  "#{Integer(htx[:validatorIndex])}," \
414
425
  "'#{htx[:address]}'," \
@@ -419,8 +430,8 @@ module Cns
419
430
 
420
431
  # @example (see Apibc#token_es)
421
432
  # @param [Hash] hkx token event etherscan
422
- # @return [String] valores formatados ethk (token parte1)
423
- def ethk_1val(hkx)
433
+ # @return [String] valores formatados nethk (token parte1)
434
+ def nethk_1val(hkx)
424
435
  "(#{Integer(hkx[:blockNumber])}," \
425
436
  "#{Integer(hkx[:timeStamp])}," \
426
437
  "'#{hkx[:hash]}'," \
@@ -430,12 +441,12 @@ module Cns
430
441
  "'#{hkx[:from]}'," \
431
442
  "'#{hkx[:to]}'," \
432
443
  "'#{hkx[:iax]}'," \
433
- "#{ethk_2val(hkx)}"
444
+ "#{nethk_2val(hkx)}"
434
445
  end
435
446
 
436
- # @param (see ethk_1val)
437
- # @return [String] valores formatados ethk (token parte2)
438
- def ethk_2val(hkx)
447
+ # @param (see nethk_1val)
448
+ # @return [String] valores formatados nethk (token parte2)
449
+ def nethk_2val(hkx)
439
450
  "cast('#{hkx[:value]}' as numeric)," \
440
451
  "'#{hkx[:tokenName]}'," \
441
452
  "'#{hkx[:tokenSymbol]}'," \
@@ -443,12 +454,12 @@ module Cns
443
454
  "cast('#{hkx[:gas]}' as numeric)," \
444
455
  "cast('#{hkx[:gasPrice]}' as numeric)," \
445
456
  "cast('#{hkx[:gasUsed]}' as numeric)," \
446
- "#{ethk_3val(hkx)}"
457
+ "#{nethk_3val(hkx)}"
447
458
  end
448
459
 
449
- # @param (see ethk_1val)
450
- # @return [String] valores formatados ethk (token parte3)
451
- def ethk_3val(hkx)
460
+ # @param (see nethk_1val)
461
+ # @return [String] valores formatados nethk (token parte3)
462
+ def nethk_3val(hkx)
452
463
  cta = hkx[:contractAddress]
453
464
  inp = hkx[:input]
454
465
  "#{inp.length.zero? ? 'null' : "'#{inp}'"}," \
data/lib/cns/etherscan.rb CHANGED
@@ -259,24 +259,6 @@ module Cns
259
259
  )
260
260
  end
261
261
 
262
- # @param (see formata_carteira)
263
- # @example set hjn
264
- # {
265
- # id: wbq[:id],
266
- # ax: xbq = wbq[:ax],
267
- # bs: wbq[:sl], INPORTANTE saldo bigquery
268
- # bt: bqd[:nt].select { |ont| ont[:axfrom].casecmp?(xbq) },
269
- # bi: bqd[:ni].select { |oni| oni[:iax].casecmp?(xbq) },
270
- # bp: bqd[:np].select { |onp| onp[:iax].casecmp?(xbq) },
271
- # bw: bqd[:nw].select { |onw| onw[:iax].casecmp?(xbq) },
272
- # bk: bqd[:nk].select { |onk| onk[:iax].casecmp?(xbq) },
273
- # es: hbc[:sl], INPORTANTE saldo etherscan
274
- # et: hbc[:tx],
275
- # ei: hbc[:ix],
276
- # ep: hbc[:px],
277
- # ew: hbc[:wx],
278
- # ek: hbc[:kx]
279
- # }
280
262
  # @return [Boolean] carteira tem transacoes novas(sim=NOK, nao=OK)?
281
263
  def ok?(hjn)
282
264
  hjn[:es].round(4) == hjn[:bs].round(4) && hjn[:bi].count == hjn[:ei].count && hjn[:bp].count == hjn[:ep].count && hjn[:bw].count == hjn[:ew].count
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.7.0'
4
+ VERSION = '0.7.1'
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.7.0
4
+ version: 0.7.1
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-02-04 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler