From 1bc222a9a89e83c84c8d7e0eedd457266aec7ea2 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Wed, 14 Feb 2024 19:24:59 +0100 Subject: [PATCH] chore: add contract method --- packages/packages.json | 12 ++++++------ packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/contracts/realitio/contract.py | 12 ++++++++++++ packages/valory/contracts/realitio/contract.yaml | 2 +- packages/valory/services/trader/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../skills/tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 28 insertions(+), 16 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index f8d3ed328..21a8e523e 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,15 +1,15 @@ { "dev": { "skill/valory/market_manager_abci/0.1.0": "bafybeifdf6uoscrgvlgqceqcph2pgoygobznw6hbodpav7lubbqsyh4kby", - "skill/valory/decision_maker_abci/0.1.0": "bafybeidfsazphtmlkliahx67a63wfyxtmllhgxmqjm6j7xk4zjlofkrscm", - "skill/valory/trader_abci/0.1.0": "bafybeiblp2ivghezf4m3gimn5rb45f7mwmbskipmhdydbpa4h63j6ni7rq", + "skill/valory/decision_maker_abci/0.1.0": "bafybeihyomvfirrrzeb4jognvwmj3e6bib4ft3pfol6am5c2dlxi6a4bye", + "skill/valory/trader_abci/0.1.0": "bafybeibwhss7qpr7dsfodz4r4utex3buftjdbxns5ipie4s7pxpjakom3i", "contract/valory/market_maker/0.1.0": "bafybeihtjp5z2v6ax3fieu2hnwajlzlfpiadgmrsm24pd4rr2tjq33xt3i", - "agent/valory/trader/0.1.0": "bafybeicrptoz2pzzstjk3hioyuhbeuc2nvjgdwa6qugvvj6nqsiuqf53xm", - "service/valory/trader/0.1.0": "bafybeig57wz2cqdpsu5sta5pd3ddjnj74qh4lmx6lg2lqzs6gz372jmw4y", + "agent/valory/trader/0.1.0": "bafybeihtz6acrkeaq7ldunuoytwyx4fpdpqpjon6rmlqi55y3oqlgejyky", + "service/valory/trader/0.1.0": "bafybeihjvutwwzjvetoc4275hauolp4nnkqj4tyhr4ezbl6s3mlghggl6y", "contract/valory/erc20/0.1.0": "bafybeihy56fit7nc5e5f2h7bp7b2dvthibldyinynuxfzxvalhfo2zhvji", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicwu2lrwubcdaj22f553ugf5zndh6gcwup4edhp773tnhpsmxyuf4", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeids3e5atipzggnouk42c7jzxiea4i6sdxaenpgnelydhirxrcmbg4", "contract/valory/mech/0.1.0": "bafybeihns2sdru2g562dh5rymc4owdj7ymkm4o6ld7ahed46f7vp2bj7om", - "contract/valory/realitio/0.1.0": "bafybeibszl2k2n7ddvyjkxzdlzshcotgkoegqadkne3f2rzqxmoyefxp6u", + "contract/valory/realitio/0.1.0": "bafybeifiglhz3tclhbzadk33pbd5yoillqxh24hygutlxs6sjk64emxvcq", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe", "contract/valory/agent_registry/0.1.0": "bafybeihciea74zyqtl7bsa7kv6wsudix7uh4ri64dlyufrxlm2e2xcqoeu", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 7c1dc1772..249f62777 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -23,7 +23,7 @@ contracts: - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeihns2sdru2g562dh5rymc4owdj7ymkm4o6ld7ahed46f7vp2bj7om - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe -- valory/realitio:0.1.0:bafybeibszl2k2n7ddvyjkxzdlzshcotgkoegqadkne3f2rzqxmoyefxp6u +- valory/realitio:0.1.0:bafybeifiglhz3tclhbzadk33pbd5yoillqxh24hygutlxs6sjk64emxvcq - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 - valory/agent_registry:0.1.0:bafybeihciea74zyqtl7bsa7kv6wsudix7uh4ri64dlyufrxlm2e2xcqoeu - valory/service_staking_token:0.1.0:bafybeif2rfugwe6flohxe5p4y5so56saeq5blpnuckuhjwoh2m65dj3qhi @@ -44,10 +44,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeibnwjcjx4lluf4cwb6es5peelu3gm7vrzlieygrzpbjlubxpvbvzy - valory/termination_abci:0.1.0:bafybeifdtxgldw33kwvsavcituzewwbr6iqfcsgk5qouqfhpwdrivyyyom - valory/transaction_settlement_abci:0.1.0:bafybeifpnkwgwpzz6uwrvfgurm26allr6shjfbp7bfbrxwy64sw3nf3fsa -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicwu2lrwubcdaj22f553ugf5zndh6gcwup4edhp773tnhpsmxyuf4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeids3e5atipzggnouk42c7jzxiea4i6sdxaenpgnelydhirxrcmbg4 - valory/market_manager_abci:0.1.0:bafybeifdf6uoscrgvlgqceqcph2pgoygobznw6hbodpav7lubbqsyh4kby -- valory/decision_maker_abci:0.1.0:bafybeidfsazphtmlkliahx67a63wfyxtmllhgxmqjm6j7xk4zjlofkrscm -- valory/trader_abci:0.1.0:bafybeiblp2ivghezf4m3gimn5rb45f7mwmbskipmhdydbpa4h63j6ni7rq +- valory/decision_maker_abci:0.1.0:bafybeihyomvfirrrzeb4jognvwmj3e6bib4ft3pfol6am5c2dlxi6a4bye +- valory/trader_abci:0.1.0:bafybeibwhss7qpr7dsfodz4r4utex3buftjdbxns5ipie4s7pxpjakom3i - valory/staking_abci:0.1.0:bafybeif6aq2f3rbznfn33wrcut2q73vlpmsztqaq6lag5tx46vv5p2gvwy default_ledger: ethereum required_ledgers: diff --git a/packages/valory/contracts/realitio/contract.py b/packages/valory/contracts/realitio/contract.py index f89eca75e..5a6624e6a 100644 --- a/packages/valory/contracts/realitio/contract.py +++ b/packages/valory/contracts/realitio/contract.py @@ -401,3 +401,15 @@ def get_submit_answer_tx( ], ) return dict(data=data) + + @classmethod + def balance_of( + cls, + ledger_api: LedgerApi, + contract_address: str, + address: str, + ) -> JSONLike: + """Get balance for an address""" + contract = cls.get_instance(ledger_api, contract_address) + data = contract.functions.balanceOf(address).call() + return dict(data=data) diff --git a/packages/valory/contracts/realitio/contract.yaml b/packages/valory/contracts/realitio/contract.yaml index 186abac60..6d8fc8ef6 100644 --- a/packages/valory/contracts/realitio/contract.yaml +++ b/packages/valory/contracts/realitio/contract.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeictahkgfmlqv5kksvj6klmxtmjdpeq4sp3x7dp2yr5x4kmzbcihse build/Realitio.json: bafybeiagi7zoeoy5s7duhg4oeuekj2s6z5mad2z6g2pn3n5elsvze25qiu - contract.py: bafybeienj6eeslkn4f6p6sw44nfk6cne5bd65omo2mmeexjrpvhkflvspi + contract.py: bafybeifhewo7b6sr4ihqohqhij2ffjikcjxjuzxmttj5z6mjzwudx7kc34 fingerprint_ignore_patterns: [] class_name: RealitioContract contract_interface_paths: diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 024575de8..38098d7d2 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:bafybeicrptoz2pzzstjk3hioyuhbeuc2nvjgdwa6qugvvj6nqsiuqf53xm +agent: valory/trader:0.1.0:bafybeihtz6acrkeaq7ldunuoytwyx4fpdpqpjon6rmlqi55y3oqlgejyky number_of_agents: 4 deployment: {} --- diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 8a02dcbef..2ad92a3c5 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -64,7 +64,7 @@ contracts: - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeihns2sdru2g562dh5rymc4owdj7ymkm4o6ld7ahed46f7vp2bj7om - valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe -- valory/realitio:0.1.0:bafybeibszl2k2n7ddvyjkxzdlzshcotgkoegqadkne3f2rzqxmoyefxp6u +- valory/realitio:0.1.0:bafybeifiglhz3tclhbzadk33pbd5yoillqxh24hygutlxs6sjk64emxvcq - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 - valory/agent_registry:0.1.0:bafybeihciea74zyqtl7bsa7kv6wsudix7uh4ri64dlyufrxlm2e2xcqoeu - valory/transfer_nft_condition:0.1.0:bafybeiab7p2jky5g6jjznpqkf4znyjp5ko466usgv5pntdlqi6uss456y4 diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 280266d0f..16461a744 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -25,8 +25,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeifpnkwgwpzz6uwrvfgurm26allr6shjfbp7bfbrxwy64sw3nf3fsa - valory/termination_abci:0.1.0:bafybeifdtxgldw33kwvsavcituzewwbr6iqfcsgk5qouqfhpwdrivyyyom - valory/market_manager_abci:0.1.0:bafybeifdf6uoscrgvlgqceqcph2pgoygobznw6hbodpav7lubbqsyh4kby -- valory/decision_maker_abci:0.1.0:bafybeidfsazphtmlkliahx67a63wfyxtmllhgxmqjm6j7xk4zjlofkrscm -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicwu2lrwubcdaj22f553ugf5zndh6gcwup4edhp773tnhpsmxyuf4 +- valory/decision_maker_abci:0.1.0:bafybeihyomvfirrrzeb4jognvwmj3e6bib4ft3pfol6am5c2dlxi6a4bye +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeids3e5atipzggnouk42c7jzxiea4i6sdxaenpgnelydhirxrcmbg4 - valory/staking_abci:0.1.0:bafybeif6aq2f3rbznfn33wrcut2q73vlpmsztqaq6lag5tx46vv5p2gvwy behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index d42fcc0ca..80e6e125d 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -21,7 +21,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeige5agrztgzfevyglf7mb4o7pzfttmq4f6zi765y4g2zvftbyowru skills: - valory/abstract_round_abci:0.1.0:bafybeicrzndcdbue34yxwwb4hmmdhgzw4owcdcdag3ifj6thpx5wie3dp4 -- valory/decision_maker_abci:0.1.0:bafybeidfsazphtmlkliahx67a63wfyxtmllhgxmqjm6j7xk4zjlofkrscm +- valory/decision_maker_abci:0.1.0:bafybeihyomvfirrrzeb4jognvwmj3e6bib4ft3pfol6am5c2dlxi6a4bye - valory/staking_abci:0.1.0:bafybeif6aq2f3rbznfn33wrcut2q73vlpmsztqaq6lag5tx46vv5p2gvwy behaviours: main: