Skip to content

Commit

Permalink
chore: add contract method
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Feb 14, 2024
1 parent 3965ea1 commit 1bc222a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 16 deletions.
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions packages/valory/contracts/realitio/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/valory/contracts/realitio/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/trader/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
---
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1bc222a

Please sign in to comment.