huginn_callisto_network_agent 0.1.83 → 0.1.85
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/lib/huginn_callisto_network_agent/callisto_network_agent.rb +10 -12
- 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: e413837711159b9a4b8daebbb25a1b604897b41b9f51401b85d7817513139cac
|
4
|
+
data.tar.gz: 4ebf78dd64060dfcb6bcd09766f25eee3f9570331b8134c9318e1b1440bf0ce7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 648c94e951e5ecb7582d6e530b9c943adb0ad5f0f134d92f8c03864d3c91c4d57250d81ce3d3a58d51381384faf5cdb0044548322cf5eff389495317b7549966
|
7
|
+
data.tar.gz: e07ec83a4a4c680d6de559a4acd5ed6b792aa17ce242eb6b1de67edd1d2bf7514c28d446c394801ff0c43859c66c8565d27cf58c932f636d8f5eee39774ca1f4
|
@@ -454,43 +454,41 @@ module Agents
|
|
454
454
|
dead_address = '0x000000000000000000000000000000000000dead'
|
455
455
|
internal = true
|
456
456
|
tx_list = []
|
457
|
-
|
457
|
+
burnt_clo = 0
|
458
|
+
burnt_type2 = 0
|
459
|
+
burnt_dead = 0
|
458
460
|
(interpolated['first_block']..interpolated['last_block']).each do |i|
|
459
461
|
transactions = get_data(i.to_i,internal)
|
460
|
-
gas_used = transactions['result']['gasUsed'].to_i(16)
|
461
462
|
transactions['result']['transactions'].each do |tx|
|
462
463
|
if !tx.empty?
|
463
464
|
tx_list << tx
|
464
465
|
if tx['type'] == "0x2"
|
465
|
-
|
466
|
-
fees =
|
466
|
+
gas_fee = transactions['result']['baseFeePerGas'].to_i(16)
|
467
|
+
fees = ( transactions['result']['gasUsed'].to_i(16) * gas_fee.to_f ) / (10 ** 18)
|
467
468
|
else
|
468
469
|
fees = 0
|
469
470
|
end
|
470
471
|
if tx['to'] == dead_address
|
471
|
-
burnt = tx['value'].to_i(16) / 10**18
|
472
|
+
burnt = tx['value'].to_i(16).to_f / 10**18
|
472
473
|
else
|
473
474
|
burnt = 0
|
474
475
|
end
|
475
476
|
end
|
476
|
-
|
477
|
-
|
477
|
+
burnt_type2 += fees
|
478
|
+
burnt_dead += burnt
|
478
479
|
end
|
479
480
|
end
|
481
|
+
burnt_clo = ( burnt_type2 / tx_list.count ) + burnt_dead
|
480
482
|
top_tx = most_common_from(tx_list)
|
481
483
|
top_count = tx_list.count { |hash| hash['from'] == top_tx }
|
482
484
|
miners_count = tx_list.select { |hash| all_miners.include?(hash['from']) }
|
483
|
-
# log "miners_count #{miners_count.count}"
|
484
485
|
shitty_count = tx_list.select { |hash| shitty_wallets.include?(hash['from']) }
|
485
486
|
callosha_count = tx_list.select { |hash| hash['to'] == callosha_address }
|
486
487
|
twobears_count = tx_list.select { |hash| hash['to'] == twobears_address }
|
487
488
|
vipwarz_count = tx_list.select { |hash| hash['to'] == vipwarz_address }
|
488
489
|
slotmachine_count = tx_list.select { |hash| hash['to'] == slotmachine_address }
|
489
|
-
# log "shitty_count #{shitty_count.count}"
|
490
490
|
active = tx_list.map { |p| p['from'] }.uniq.count
|
491
|
-
|
492
|
-
# log "total : #{tx_list.count}"
|
493
|
-
create_event :payload => { 'total_tx' => "#{tx_list.count}", 'total_active' => "#{active}", 'burnt_clo' => "#{burnt_ether}", 'top_wallet': {'address' => "#{top_tx}", 'percentage' => "#{percentage(top_count.to_i,tx_list.count.to_i)}"}, 'shitty': {'address': 'shitty', 'shitty_percentage' => "#{percentage(shitty_count.count,tx_list.count.to_i)}"}, 'miners': {'address': "miners", 'percentage' => "#{percentage(miners_count.count,tx_list.count.to_i)}"}, 'callosha': {'address': callosha_address, 'percentage' => "#{percentage(callosha_count.count,tx_list.count.to_i)}"}, 'twobears': {'address': twobears_address, 'percentage' => "#{percentage(twobears_count.count,tx_list.count.to_i)}"}, 'vipwarz': {'address': vipwarz_address, 'percentage' => "#{percentage(vipwarz_count.count,tx_list.count.to_i)}"}, 'slotmachine': {'address': slotmachine_address, 'percentage' => "#{percentage(slotmachine_count.count,tx_list.count.to_i)}"}}
|
491
|
+
create_event :payload => { 'total_tx' => "#{tx_list.count}", 'total_active' => "#{active}", 'burnt_clo' => "#{burnt_clo}", 'top_wallet': {'address' => "#{top_tx}", 'percentage' => "#{percentage(top_count.to_i,tx_list.count.to_i)}"}, 'shitty': {'address': 'shitty', 'shitty_percentage' => "#{percentage(shitty_count.count,tx_list.count.to_i)}"}, 'miners': {'address': "miners", 'percentage' => "#{percentage(miners_count.count,tx_list.count.to_i)}"}, 'callosha': {'address': callosha_address, 'percentage' => "#{percentage(callosha_count.count,tx_list.count.to_i)}"}, 'twobears': {'address': twobears_address, 'percentage' => "#{percentage(twobears_count.count,tx_list.count.to_i)}"}, 'vipwarz': {'address': vipwarz_address, 'percentage' => "#{percentage(vipwarz_count.count,tx_list.count.to_i)}"}, 'slotmachine': {'address': slotmachine_address, 'percentage' => "#{percentage(slotmachine_count.count,tx_list.count.to_i)}"}}
|
494
492
|
|
495
493
|
end
|
496
494
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_callisto_network_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.85
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Germain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|