huginn_callisto_network_agent 0.1.91 → 0.1.93
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eb13f3083bddf8ecb58c3ec3082c851eab4310bbf512311ef46d67cafb0bf3b
|
4
|
+
data.tar.gz: 58975f5f955c6da1bd8a220dbc4e3072fb27e4c49d30da4487b07836481e0030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1497c91aff9d79f0fbf4b566ccb4e17922d7509dcf6571c1ad9cbfa1f025760eb4155e50db5421bc93582fba257c37c01eec29d4b23fa3504fea23c980c25ba6
|
7
|
+
data.tar.gz: a6c8f3a5a3bf5b13b7c9d5b4b80894578c06ff880ba8f08d631ed6dbdc11d6294754b5db88160fba7099d93f38d209655b57719e710f55d454e3c849bfefe621
|
@@ -64,7 +64,7 @@ module Agents
|
|
64
64
|
form_configurable :expected_receive_period_in_days, type: :string
|
65
65
|
form_configurable :changes_only, type: :boolean
|
66
66
|
form_configurable :vote, type: :boolean
|
67
|
-
form_configurable :type, type: :array, values: ['get_balance', 'net_peerCount', 'net_version', 'eth_protocolVersion', 'eth_gasPrice', 'eth_getTransactionCount', 'stake_reward_clo', 'get_tokens_balance', 'eth_getBlockByNumber', 'soy_farming_soy_clo_pending_rewards', 'soy_farming_soy_cloe_pending_rewards', 'stake_reward_soy', 'soy_farming_soy_btt_pending_rewards', 'soy_cs_pending_rewards', 'clo_sendtx', 'get_tx_by_address_with_filter', 'start_cs_clo', 'withdraw_cs_clo', 'get_tx_stats', 'callosha_slots', '2bears_check_order_by_id', 'get_abi_json', 'dao_auto_claim', 'dao_check_missing_vote', 'dao_vote_id']
|
67
|
+
form_configurable :type, type: :array, values: ['get_balance', 'net_peerCount', 'net_version', 'eth_protocolVersion', 'eth_gasPrice', 'eth_getTransactionCount', 'stake_reward_clo', 'get_tokens_balance', 'eth_getBlockByNumber', 'soy_farming_soy_clo_pending_rewards', 'soy_farming_soy_cloe_pending_rewards', 'stake_reward_soy', 'soy_farming_soy_btt_pending_rewards', 'soy_cs_pending_rewards', 'clo_sendtx', 'get_tx_by_address_with_filter', 'start_cs_clo', 'withdraw_cs_clo', 'get_tx_stats', 'callosha_slots', '2bears_check_order_by_id', 'get_abi_json', 'dao_auto_claim', 'dao_check_missing_vote', 'dao_vote_id', 'get_cs_stats' , 'dao_check_new_proposal']
|
68
68
|
form_configurable :wallet, type: :string
|
69
69
|
form_configurable :rpc_server, type: :string
|
70
70
|
form_configurable :wallet_password, type: :string
|
@@ -76,13 +76,13 @@ module Agents
|
|
76
76
|
form_configurable :last_block, type: :string
|
77
77
|
form_configurable :sql_db, type: :string
|
78
78
|
def validate_options
|
79
|
-
errors.add(:base, "type has invalid value: should be 'get_balance' 'net_peerCount' 'net_version' 'eth_protocolVersion' 'eth_gasPrice' 'eth_getTransactionCount' 'stake_reward_clo' 'get_tokens_balance' 'eth_getBlockByNumber' 'soy_farming_soy_clo_pending_rewards' 'soy_farming_soy_cloe_pending_rewards' 'stake_reward_soy' 'soy_farming_soy_btt_pending_rewards' 'soy_cs_pending_rewards' 'clo_sendtx' 'get_tx_by_address_with_filter' 'start_cs_clo' 'withdraw_cs_clo' 'get_tx_stats' 'callosha_slots' '2bears_check_order_by_id' 'get_abi_json' 'dao_auto_claim' 'dao_check_missing_vote' 'dao_vote_id'") if interpolated['type'].present? && !%w(get_balance net_peerCount net_version eth_protocolVersion eth_gasPrice eth_getTransactionCount stake_reward_clo get_tokens_balance eth_getBlockByNumber soy_farming_soy_clo_pending_rewards soy_farming_soy_cloe_pending_rewards stake_reward_soy soy_farming_soy_btt_pending_rewards soy_cs_pending_rewards clo_sendtx get_tx_by_address_with_filter start_cs_clo withdraw_cs_clo get_tx_stats callosha_slots 2bears_check_order_by_id get_abi_json dao_auto_claim dao_check_missing_vote dao_vote_id).include?(interpolated['type'])
|
79
|
+
errors.add(:base, "type has invalid value: should be 'get_balance' 'net_peerCount' 'net_version' 'eth_protocolVersion' 'eth_gasPrice' 'eth_getTransactionCount' 'stake_reward_clo' 'get_tokens_balance' 'eth_getBlockByNumber' 'soy_farming_soy_clo_pending_rewards' 'soy_farming_soy_cloe_pending_rewards' 'stake_reward_soy' 'soy_farming_soy_btt_pending_rewards' 'soy_cs_pending_rewards' 'clo_sendtx' 'get_tx_by_address_with_filter' 'start_cs_clo' 'withdraw_cs_clo' 'get_tx_stats' 'callosha_slots' '2bears_check_order_by_id' 'get_abi_json' 'dao_auto_claim' 'dao_check_missing_vote' 'dao_vote_id' 'get_cs_stats' 'dao_check_new_proposal'") if interpolated['type'].present? && !%w(get_balance net_peerCount net_version eth_protocolVersion eth_gasPrice eth_getTransactionCount stake_reward_clo get_tokens_balance eth_getBlockByNumber soy_farming_soy_clo_pending_rewards soy_farming_soy_cloe_pending_rewards stake_reward_soy soy_farming_soy_btt_pending_rewards soy_cs_pending_rewards clo_sendtx get_tx_by_address_with_filter start_cs_clo withdraw_cs_clo get_tx_stats callosha_slots 2bears_check_order_by_id get_abi_json dao_auto_claim dao_check_missing_vote dao_vote_id get_cs_stats dao_check_new_proposal).include?(interpolated['type'])
|
80
80
|
|
81
81
|
unless options['wallet_password'].present? || !['clo_sendtx' 'start_cs_clo' 'withdraw_cs_clo' 'dao_auto_claim'].include?(options['type'])
|
82
82
|
errors.add(:base, "wallet_password is a required field")
|
83
83
|
end
|
84
84
|
|
85
|
-
unless options['value'].present? || !['clo_sendtx' 'start_cs_clo' 'callosha_slots' '2bears_check_order_by_id' 'dao_check_missing_vote' 'dao_vote_id'
|
85
|
+
unless options['value'].present? || !['clo_sendtx' 'start_cs_clo' 'callosha_slots' '2bears_check_order_by_id' 'dao_check_missing_vote' 'dao_vote_id'].include?(options['type'])
|
86
86
|
errors.add(:base, "value is a required field")
|
87
87
|
end
|
88
88
|
|
@@ -314,6 +314,25 @@ module Agents
|
|
314
314
|
|
315
315
|
end
|
316
316
|
|
317
|
+
def dao_check_new_proposal()
|
318
|
+
|
319
|
+
payload = dao_get_last_vote_id()
|
320
|
+
|
321
|
+
if !memory['last_vote_id'].present?
|
322
|
+
proposal = dao_check_proposal(payload)
|
323
|
+
proposal['owner_human_readable'] = owner_finder(proposal['owner_address'].downcase)
|
324
|
+
create_event payload: proposal
|
325
|
+
else
|
326
|
+
for i in memory['last_vote_id']..payload do
|
327
|
+
proposal = dao_check_proposal(i)
|
328
|
+
proposal['owner_human_readable'] = owner_finder(proposal['owner_address'].downcase)
|
329
|
+
create_event payload: proposal
|
330
|
+
end
|
331
|
+
end
|
332
|
+
memory['last_vote_id'] = payload
|
333
|
+
|
334
|
+
end
|
335
|
+
|
317
336
|
def dao_get_last_vote_id()
|
318
337
|
uri = URI.parse("#{interpolated['rpc_server']}")
|
319
338
|
request = Net::HTTP::Post.new(uri)
|
@@ -455,6 +474,15 @@ module Agents
|
|
455
474
|
return JSON.parse(response.body)
|
456
475
|
end
|
457
476
|
|
477
|
+
def get_cs_stats()
|
478
|
+
uri = URI.parse("http://web3wrapper:5000/cs/stats_last_30d")
|
479
|
+
response = Net::HTTP.get_response(uri)
|
480
|
+
|
481
|
+
log_curl_output(response.code,response.body)
|
482
|
+
|
483
|
+
create_event payload: response.body
|
484
|
+
end
|
485
|
+
|
458
486
|
def dao_auto_claim()
|
459
487
|
last_vote_id = dao_get_last_vote_id()
|
460
488
|
user_claim_list = dao_check_claim_list(last_vote_id)
|
@@ -1916,6 +1944,10 @@ module Agents
|
|
1916
1944
|
dao_check_missing_vote()
|
1917
1945
|
when "dao_vote_id"
|
1918
1946
|
dao_vote_id(interpolated['value'],false)
|
1947
|
+
when "get_cs_stats"
|
1948
|
+
get_cs_stats()
|
1949
|
+
when "dao_check_new_proposal"
|
1950
|
+
dao_check_new_proposal()
|
1919
1951
|
else
|
1920
1952
|
log "Error: type has an invalid value (#{type})"
|
1921
1953
|
end
|
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.93
|
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-
|
11
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|