diff --git a/packages/packages.json b/packages/packages.json index eccd8273c..d91ac9aaf 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -4,8 +4,8 @@ "skill/valory/decision_maker_abci/0.1.0": "bafybeiguvfiaytb7i3p5sluubvehvzcu4wdzch4avdyxhj6332mkohv674", "skill/valory/trader_abci/0.1.0": "bafybeigjkkphi7y2nlq7nc4unookfvyn5vwfqus27g2qtldctuan6fiipa", "contract/valory/market_maker/0.1.0": "bafybeif4mm2s3gxtvp227yypkcnna5ftec7vajcftvtbdmqddh7nprah5m", - "agent/valory/trader/0.1.0": "bafybeiege455u6bfg42amizcfmxgz5hzdkuwzx3rt5q6oogf3gqaqmfyfi", - "service/valory/trader/0.1.0": "bafybeieh2ttygh6rkfuxvqhvpyahar2dstwlqe64xwrb4q4f2ukcnrcgaq", + "agent/valory/trader/0.1.0": "bafybeide5rc6gsg2pe2gzqopt2eypqmjm5z3wvkql6fyfexupm424cvbzi", + "service/valory/trader/0.1.0": "bafybeickxpbvulbpnca6me7s3jroynhcam4mjfydhdkgr2apcbputooohm", "contract/valory/erc20/0.1.0": "bafybeieqj7dea4tcv6z2yqkgtmhd23vbiycsr5trhwxdvlbwulpl6vhmam", "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeidkeozxuznavfqotsuaahmaajciz7lpro5wxe5y6um2w5k2ag6ohe", "contract/valory/mech/0.1.0": "bafybeihvc6btuk3nvernzcx4qpezvuhiw2wwnagqj5nkeljvszghv7mq64", @@ -13,7 +13,7 @@ "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeifov35k2ifwagzyfvl7km6je6tmyvcqgrccldob3zmbx2af2wzque", "contract/valory/agent_registry/0.1.0": "bafybeifwdtwxdc2jdlhzdyxctqdmoz6zroxf5o4nhuok5l4luvnofqavty", - "contract/valory/service_staking_token/0.1.0": "bafybeibifxmoeaiptovouispl5jdgm4lduzcfgsx723zlw45cfpllecuwy" + "contract/valory/service_staking_token/0.1.0": "bafybeifzynpmjjkvsxraujft4sirmsh56vgqvtf2zt5l4fzrcdicgus4s4" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeie7xyems76v5b4wc2lmaidcujizpxfzjnnwdeokmhje53g7ym25ii", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index c9b2e0977..f328327e2 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -26,7 +26,7 @@ contracts: - valory/realitio:0.1.0:bafybeiamgkwwqhray4fs2hlipwxkq7mosmi7ev7jut4vneetaaycc4ruji - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 - valory/agent_registry:0.1.0:bafybeifwdtwxdc2jdlhzdyxctqdmoz6zroxf5o4nhuok5l4luvnofqavty -- valory/service_staking_token:0.1.0:bafybeibifxmoeaiptovouispl5jdgm4lduzcfgsx723zlw45cfpllecuwy +- valory/service_staking_token:0.1.0:bafybeifzynpmjjkvsxraujft4sirmsh56vgqvtf2zt5l4fzrcdicgus4s4 protocols: - open_aea/signing:1.0.0:bafybeie7xyems76v5b4wc2lmaidcujizpxfzjnnwdeokmhje53g7ym25ii - valory/abci:0.1.0:bafybeihmzlmmb4pdo3zkhg6ehuyaa4lhw7bfpclln2o2z7v3o6fcep26iu diff --git a/packages/valory/contracts/service_staking_token/contract.py b/packages/valory/contracts/service_staking_token/contract.py index 79a5e1724..ad8eb0c87 100644 --- a/packages/valory/contracts/service_staking_token/contract.py +++ b/packages/valory/contracts/service_staking_token/contract.py @@ -112,3 +112,26 @@ def get_next_checkpoint_ts( contract = cls.get_instance(ledger_api, contract_address) ts = contract.functions.getNextRewardCheckpointTimestamp().call() return dict(data=ts) + + @classmethod + def get_liveness_period( + cls, + ledger_api: LedgerApi, + contract_address: str, + ) -> JSONLike: + """Retrieve the liveness period.""" + contract = cls.get_instance(ledger_api, contract_address) + liveness_period = contract.functions.livenessPeriod().call() + return dict(data=liveness_period) + + @classmethod + def get_service_info( + cls, + ledger_api: LedgerApi, + contract_address: str, + service_id: int, + ) -> JSONLike: + """Retrieve the service info for a service.""" + contract = cls.get_instance(ledger_api, contract_address) + info = contract.functions.mapServiceInfo(service_id).call() + return dict(data=info) diff --git a/packages/valory/contracts/service_staking_token/contract.yaml b/packages/valory/contracts/service_staking_token/contract.yaml index 44eba46d2..fb83e1d8f 100644 --- a/packages/valory/contracts/service_staking_token/contract.yaml +++ b/packages/valory/contracts/service_staking_token/contract.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeid3wfzglolebuo6jrrsopswzu4lk77bm76mvw3euizlsjtnt3wmgu build/ServiceStakingToken.json: bafybeie2xbccvzmjuptqfqumctv6gtyyeoxe7fkx3t7fgbto7wbdugbqxm - contract.py: bafybeihyuap3ndb7ov7fkqr5ybsazikph47oeallykzbs6wdbyvvwruerq + contract.py: bafybeiamj36g4p35m4k5q3umqiujzz3zcflrmjwwnfn4k6ijqrdlgrpfem fingerprint_ignore_patterns: [] contracts: [] class_name: ServiceStakingTokenContract diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 19f3e4b81..965e6f494 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeiege455u6bfg42amizcfmxgz5hzdkuwzx3rt5q6oogf3gqaqmfyfi +agent: valory/trader:0.1.0:bafybeide5rc6gsg2pe2gzqopt2eypqmjm5z3wvkql6fyfexupm424cvbzi number_of_agents: 4 deployment: {} ---