huginn_callisto_network_agent 0.1.92 → 0.1.94
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: 94a2ced9a139319c51abd434c0dbec948caa589f8cca6ba61ce34cbe522287e5
|
4
|
+
data.tar.gz: bb7b3ec33d6973285efda480fbbe895bc77948aa2472402642240e2fc1231eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ebb486621cc1229275ee8a76306e53dac540300f5d416c14e5f303de99ab15b866286685fb9085417e74c3cfe6306bbdade1b9ad89a5c420d06131aefb1430d
|
7
|
+
data.tar.gz: cfda6fc599f2848c539d18e4d156c7943f77e96da55d00c83d7519ab5d03e1b89586730af9f83a2d171c7a39c9d7c448bdd2603c7d1cd39f34befdef16864c9d
|
@@ -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', 'get_cs_stats']
|
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' 'get_cs_stats'") 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).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,27 @@ 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
|
+
elsif memory['last_vote_id'] != payload
|
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
|
+
else
|
332
|
+
log "no diff"
|
333
|
+
end
|
334
|
+
memory['last_vote_id'] = payload
|
335
|
+
|
336
|
+
end
|
337
|
+
|
317
338
|
def dao_get_last_vote_id()
|
318
339
|
uri = URI.parse("#{interpolated['rpc_server']}")
|
319
340
|
request = Net::HTTP::Post.new(uri)
|
@@ -1927,6 +1948,8 @@ module Agents
|
|
1927
1948
|
dao_vote_id(interpolated['value'],false)
|
1928
1949
|
when "get_cs_stats"
|
1929
1950
|
get_cs_stats()
|
1951
|
+
when "dao_check_new_proposal"
|
1952
|
+
dao_check_new_proposal()
|
1930
1953
|
else
|
1931
1954
|
log "Error: type has an invalid value (#{type})"
|
1932
1955
|
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.94
|
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-09-
|
11
|
+
date: 2024-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|