├── .github ├── PULL_REQUEST_TEMPLATE.md ├── RELEASE_PR.md ├── dependabot.yml └── workflows │ ├── main_workflow.yml │ └── release.yaml ├── .gitignore ├── .gitleaks.toml ├── .gitleaksignore ├── .pre-commit-config.yaml ├── .pylintrc ├── .spelling ├── AUTHORS.md ├── CONTRIBUTING.md ├── HISTORY.md ├── LICENSE ├── Makefile ├── Pipfile ├── README.md ├── SECURITY.md ├── docs ├── fonts │ ├── Inter-Bold.ttf │ ├── Inter-Regular.ttf │ └── Manrope-Bold.ttf ├── images │ ├── FSM.png │ ├── favicon.ico │ ├── favicon16x16.png │ ├── favicon32x32.png │ ├── favicon96x96.png │ ├── iekit.svg │ ├── logo.svg │ └── logo_purple.svg ├── index.md └── stylesheets │ └── extra.css ├── mints ├── 01.json ├── 01.png ├── 02.json ├── 02.png ├── 03.json ├── 03.png ├── 04.json ├── 04.png ├── 05.json ├── 05.png ├── 06.json ├── 06.png ├── 07.json ├── 07.png ├── 08.json ├── 08.png ├── 09.json ├── 09.png ├── 10.json ├── 10.png ├── 11.json ├── 11.png ├── 12.json ├── 12.png ├── 13.json ├── 13.png ├── 14.json ├── 14.png ├── 15.json ├── 15.png ├── 16.json ├── 16.png ├── mapping.txt └── whitelist.txt ├── mkdocs.yml ├── packages ├── __init__.py ├── packages.json └── valory │ ├── __init__.py │ ├── agents │ ├── __init__.py │ ├── farcaster_test │ │ ├── __init__.py │ │ └── aea-config.yaml │ └── impact_evaluator │ │ ├── __init__.py │ │ ├── aea-config.yaml │ │ └── tests │ │ ├── __init__.py │ │ ├── helpers │ │ ├── __init__.py │ │ ├── constants.py │ │ ├── data │ │ │ └── json_server │ │ │ │ └── data.json │ │ ├── docker.py │ │ └── fixtures.py │ │ └── test_impact_evaluator.py │ ├── connections │ ├── farcaster │ │ ├── __init__.py │ │ ├── connection.py │ │ ├── connection.yaml │ │ └── readme.md │ ├── openai │ │ ├── __init__.py │ │ ├── connection.py │ │ ├── connection.yaml │ │ └── readme.md │ └── twitter │ │ ├── __init__.py │ │ ├── connection.py │ │ ├── connection.yaml │ │ └── readme.md │ ├── contracts │ ├── __init__.py │ ├── agent_registry │ │ ├── __init__.py │ │ ├── build │ │ │ └── AgentRegistry.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── compatibility_fallback_handler │ │ ├── __init__.py │ │ ├── build │ │ │ └── compatibility_fallback_handler.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── dynamic_contribution │ │ ├── __init__.py │ │ ├── build │ │ │ └── DynamicContribution.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── erc20 │ │ ├── README.md │ │ ├── __init__.py │ │ ├── build │ │ │ └── ERC20.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── mech │ │ ├── README.md │ │ ├── __init__.py │ │ ├── build │ │ │ └── mech.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── mech_marketplace │ │ ├── README.md │ │ ├── __init__.py │ │ ├── build │ │ │ └── mech.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── mech_marketplace_legacy │ │ ├── README.md │ │ ├── __init__.py │ │ ├── build │ │ │ └── mech.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── mech_mm │ │ ├── README.md │ │ ├── __init__.py │ │ ├── build │ │ │ └── mech.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── staking │ │ ├── README.md │ │ ├── __init__.py │ │ ├── build │ │ │ └── staking.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── veolas_delegation │ │ ├── __init__.py │ │ ├── build │ │ │ └── DelegateContribute.json │ │ ├── contract.py │ │ └── contract.yaml │ └── wveolas │ │ ├── __init__.py │ │ ├── build │ │ └── wveolas.json │ │ ├── contract.py │ │ └── contract.yaml │ ├── protocols │ ├── llm │ │ ├── README.md │ │ ├── __init__.py │ │ ├── dialogues.py │ │ ├── llm.proto │ │ ├── llm_pb2.py │ │ ├── message.py │ │ ├── protocol.yaml │ │ ├── serialization.py │ │ └── tests │ │ │ ├── test_llm_dialogues.py │ │ │ └── test_llm_messages.py │ ├── srr │ │ ├── README.md │ │ ├── __init__.py │ │ ├── dialogues.py │ │ ├── message.py │ │ ├── protocol.yaml │ │ ├── serialization.py │ │ ├── srr.proto │ │ ├── srr_pb2.py │ │ └── tests │ │ │ ├── test_srr_dialogues.py │ │ │ └── test_srr_messages.py │ └── twitter │ │ ├── README.md │ │ ├── __init__.py │ │ ├── dialogues.py │ │ ├── message.py │ │ ├── protocol.yaml │ │ ├── serialization.py │ │ ├── tests │ │ ├── test_twitter_dialogues.py │ │ └── test_twitter_messages.py │ │ ├── twitter.proto │ │ └── twitter_pb2.py │ ├── services │ ├── impact_evaluator │ │ ├── README.md │ │ └── service.yaml │ └── impact_evaluator_local │ │ ├── README.md │ │ └── service.yaml │ └── skills │ ├── __init__.py │ ├── ceramic_read_abci │ ├── __init__.py │ ├── behaviours.py │ ├── ceramic │ │ ├── __init__.py │ │ └── payloads.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ ├── ceramic_write_abci │ ├── __init__.py │ ├── behaviours.py │ ├── ceramic │ │ ├── __init__.py │ │ └── payloads.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ ├── decision_making_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ ├── tasks │ │ ├── campaign_validation_preparation.py │ │ ├── finished_pipeline_preparation.py │ │ ├── llm_preparation.py │ │ ├── read_stream_preparation.py │ │ ├── score_preparations.py │ │ ├── signature_validation.py │ │ ├── staking.py │ │ ├── task_preparations.py │ │ ├── tweet_validation_preparation.py │ │ ├── twitter_preparation.py │ │ ├── week_in_olas_preparations.py │ │ └── write_stream_preparation.py │ ├── test_tools │ │ ├── __init__.py │ │ └── tasks.py │ └── tests │ │ ├── __init__.py │ │ ├── centaur_configs.py │ │ ├── test_behaviours.py │ │ ├── test_campaign_validation.py │ │ ├── test_ceramic_db.py │ │ ├── test_dialogues.py │ │ ├── test_finished_pipeline_preparation.py │ │ ├── test_handlers.py │ │ ├── test_llm_preparation.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ ├── test_read_stream_preparation.py │ │ ├── test_rounds.py │ │ ├── test_score_preparations.py │ │ ├── test_task_preparations.py │ │ ├── test_tweet_validation_preparation.py │ │ ├── test_twitter_preparation.py │ │ ├── test_week_in_olas_preparations.py │ │ └── test_write_stream_preparation.py │ ├── dynamic_nft_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ ├── farcaster_test_abci │ ├── __init__.py │ ├── behaviours.py │ ├── composition.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ └── skill.yaml │ ├── farcaster_write_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ └── skill.yaml │ ├── generic_scoring_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ ├── impact_evaluator_abci │ ├── __init__.py │ ├── behaviours.py │ ├── composition.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ └── test_models.py │ ├── llm_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ ├── mech_interact_abci │ ├── __init__.py │ ├── behaviours │ │ ├── __init__.py │ │ ├── base.py │ │ ├── request.py │ │ ├── response.py │ │ └── round_behaviour.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ ├── states │ │ ├── __init__.py │ │ ├── base.py │ │ ├── final_states.py │ │ ├── request.py │ │ └── response.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ └── utils.py │ ├── olas_week_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── prompts.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ ├── staking_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ └── skill.yaml │ ├── twitter_scoring_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── prompts.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ │ ├── __init__.py │ │ ├── test_behaviours.py │ │ ├── test_dialogues.py │ │ ├── test_handlers.py │ │ ├── test_models.py │ │ ├── test_payloads.py │ │ └── test_rounds.py │ └── twitter_write_abci │ ├── __init__.py │ ├── behaviours.py │ ├── dialogues.py │ ├── fsm_specification.yaml │ ├── handlers.py │ ├── models.py │ ├── payloads.py │ ├── rounds.py │ ├── skill.yaml │ └── tests │ ├── __init__.py │ ├── test_behaviours.py │ ├── test_dialogues.py │ ├── test_handlers.py │ ├── test_models.py │ ├── test_payloads.py │ └── test_rounds.py ├── pytest.ini ├── run_agent.sh ├── run_farcaster_test.sh ├── run_service.sh ├── run_service_single.sh ├── sample.env ├── scripts ├── ContributeManager.json ├── __init__.py ├── aea-config-replace.py ├── bump.py ├── ceramic │ ├── __init__.py │ ├── ceramic.py │ ├── payloads.py │ ├── schemas │ │ ├── centaurs_stream_schema.json │ │ ├── db_stream_schema.json │ │ ├── default_centaurs_stream.json │ │ ├── default_db_stream.json │ │ ├── default_generic_points_stream.json │ │ └── generic_points_stream_schema.json │ └── streams.py ├── ceramic_hello_world.py ├── check_doc_ipfs_hashes.py ├── check_staking.py ├── clone_contribute_streams.py ├── contributors.json ├── create_streams.py ├── fix_ceramic_epochs.py ├── migrate_ceramic_db.py ├── read_contribute_streams.py ├── read_stream.py ├── rebuild_tenderly.py ├── stake.py ├── update_stream.py └── write_schemas.py ├── setup.py └── tox.ini /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Proposed changes 2 | 3 | Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. 4 | 5 | ## Fixes 6 | 7 | If it fixes a bug or resolves a feature request, be sure to link to that issue. 8 | 9 | ## Types of changes 10 | 11 | What types of changes does your code introduce? (A **breaking change** is a fix or feature that would cause existing functionality and APIs to not work as expected.) 12 | _Put an `x` in the box that applies_ 13 | 14 | - [ ] Non-breaking fix (non-breaking change which fixes an issue) 15 | - [ ] Breaking fix (breaking change which fixes an issue) 16 | - [ ] Non-breaking feature (non-breaking change which adds functionality) 17 | - [ ] Breaking feature (breaking change which adds functionality) 18 | - [ ] Refactor (non-breaking change which changes implementation) 19 | - [ ] Messy (mixture of the above - requires explanation!) 20 | 21 | ## Checklist 22 | 23 | _Put an `x` in the boxes that apply._ 24 | 25 | - [ ] I have read the [CONTRIBUTING](../blob/main/CONTRIBUTING.md) doc 26 | - [ ] I am making a pull request against the `main` branch (left side). Also you should start your branch off our `main`. 27 | - [ ] Lint and unit tests pass locally with my changes 28 | - [ ] I have added tests that prove my fix is effective or that my feature works 29 | - [ ] I have locally run services that could be impacted and they do not present failures derived from my changes 30 | 31 | ## Further comments 32 | 33 | If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... 34 | -------------------------------------------------------------------------------- /.github/RELEASE_PR.md: -------------------------------------------------------------------------------- 1 | ## Release summary 2 | 3 | Version number: [e.g. 1.0.1] 4 | 5 | ## Release details 6 | 7 | Describe in short the main changes with the new release. 8 | 9 | ## Checklist 10 | 11 | _Put an `x` in the boxes that apply._ 12 | 13 | - [ ] I have read the [CONTRIBUTING](../main/CONTRIBUTING.md) doc 14 | - [ ] I am making a pull request against the `main` branch (left side), from `develop` 15 | - [ ] I've updated the dependencies versions to the latest, wherever is possible. 16 | - [ ] Lint and unit tests pass locally (please run tests also manually, not only with `tox`) 17 | - [ ] I built the documentation and updated it with the latest changes 18 | - [ ] I've added an item in `HISTORY.md` for this release 19 | - [ ] I bumped the version number in the `__init__.py` file. 20 | - [ ] I published the latest version on TestPyPI and checked that the following command work: 21 | ```pip install project-name== --index-url https://test.pypi.org/simple --force --no-cache-dir --no-deps``` 22 | - [ ] After merging the PR, I'll publish the build also on PyPI. Then, I'll make sure the following 23 | command will work: 24 | ```pip install project-name-template== --force --no-cache-dir --no-deps``` 25 | - [ ] After merging the PR, I'll tag the repo with `v${VERSION_NUMVER}` (e.g. `v0.1.2`) 26 | 27 | 28 | ## Further comments 29 | 30 | Write here any other comment about the release, if any. 31 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | 4 | # Maintain dependencies for Pip 5 | - package-ecosystem: "pip" 6 | directory: "." 7 | schedule: 8 | interval: "weekly" 9 | target-branch: "develop" 10 | labels: 11 | - "dependencies" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .mypy_cache 3 | .DS_Store 4 | .pytest_cache 5 | coverage.xml 6 | .tox 7 | .coverage 8 | .hypothesis 9 | htmlcov 10 | *.egg-info 11 | Pipfile.lock 12 | abci_build_*/ 13 | keys.json 14 | leak_report 15 | packages/valory/connections/* 16 | !packages/valory/connections/twitter 17 | !packages/valory/connections/openai 18 | !packages/valory/connections/farcaster 19 | packages/valory/contracts/service_registry 20 | packages/valory/contracts/gnosis_safe 21 | packages/valory/contracts/gnosis_safe_proxy_factory 22 | packages/valory/contracts/multisend 23 | packages/valory/protocols/* 24 | !packages/valory/protocols/twitter 25 | !packages/valory/protocols/llm 26 | !packages/valory/protocols/srr 27 | packages/valory/skills/abstract_abci 28 | packages/valory/skills/abstract_round_abci 29 | packages/valory/skills/registration_abci 30 | packages/valory/skills/reset_pause_abci 31 | packages/valory/skills/safe_deployment_abci 32 | packages/valory/skills/transaction_settlement_abci 33 | packages/valory/skills/termination_abci 34 | packages/open_aea 35 | *.pyc 36 | .vscode/ 37 | .zed/ 38 | .coverage* 39 | .dmypy.json 40 | 41 | .env 42 | 43 | ethereum_private_key.txt 44 | 45 | impact_evaluator 46 | !packages/valory/agents/impact_evaluator 47 | !packages/valory/services/impact_evaluator 48 | 49 | temp/ 50 | 51 | impact_evaluator_local/ 52 | 53 | farcaster_test/ 54 | !packages/valory/agents/farcaster_test/ 55 | keys1.json 56 | 57 | tenderly_vnets.json 58 | 59 | stream.json 60 | 61 | contribute_centaurs.json 62 | 63 | contribute_db.json 64 | 65 | contribute_generic_points.json 66 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/zricethezav/gitleaks 3 | rev: v8.15.3 4 | hooks: 5 | - id: gitleaks 6 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | ignore-patterns=.*_pb2.py 3 | ignore-paths=^packages/valory/.*$ 4 | 5 | [MESSAGES CONTROL] 6 | disable=C0103,R0801,C0301,C0204,C0209,W1203,C0302,R1735,R0913,R0901,R0904,R1729,R0912,W0511,E0611 7 | 8 | [DESIGN] 9 | # min-public-methods=1 10 | max-public-methods=55 11 | # max-returns=10 12 | # max-bool-expr=7 13 | max-args=6 14 | # max-locals=31 15 | # max-statements=80 16 | max-parents=10 17 | max-branches=34 18 | max-attributes=8 19 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Authors 2 | 3 | This is the official list of authors for copyright purposes. 4 | 5 | * David Vilela [dvilelaf](https://github.com/dvilelaf) 6 | * David Minarsch [DavidMinarsch](https://github.com/DavidMinarsch) 7 | * Anna Sambrook [annasambrook](https://github.com/annasambrook) -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | # Release History - `IEKit` 2 | 3 | ## 0.2.8 (2023-06-26) 4 | 5 | - Fixes `web3` dependency #63 6 | - Bumps frameworks to `open-autonomy-0.10.10.post1` and `open-aea-1.37.0` #62 7 | - Prepares for minting the service #61 8 | - Fixes olas links #60 9 | 10 | ## 0.2.7 (2023-06-20) 11 | 12 | - Bumps `open-autonomy` framework to `v0.10.6` #58 13 | - Updates Twitter registration requirements #59 14 | 15 | ## 0.2.6 (2023-06-07) 16 | 17 | - Bumps `open-autonomy` framework to `v0.10.5.post2` #57 18 | - Pins typing extension #56 19 | 20 | ## 0.2.5 (2023-05-31) 21 | 22 | - Bumps frameworks to `open-autonomy-0.10.5.post1` and `open-aea-1.34.0` #55 23 | - Bumps to `tomte@v0.2.12` and cleans up the repo #53 24 | - Implements twitter shortened link verification #52 25 | 26 | ## 0.2.4 (2023-05-09) 27 | 28 | - Bumps frameworks to `open-autonomy-0.10.3` and `open-aea-1.33` 29 | - Implements t.co link verification for registrations 30 | 31 | ## 0.2.3 (2023-04-25) 32 | 33 | - Bumps `open-autonomy` framework 34 | 35 | # 0.2.2 (2023-04-14) 36 | 37 | - Bumps `open-autonomy` and `open-aea` frameworks 38 | - Adds extra overrides to the agent and the service 39 | 40 | # 0.2.1.post1 (2023-04-03) 41 | 42 | - Bump `open-autonomy` to `v0.10.0.post2` 43 | - Sets the `p2p_libp2p_client` as non abstract to enable `ACN` 44 | 45 | # 0.2.1 (2023-03-29) 46 | 47 | - Fixes an issue with the Ceramic protocol not being able to process big integers 48 | - Adds the period number to the healthcheck 49 | 50 | # 0.2.0 (2023-03-27) 51 | 52 | - Bumps to open-autonomy@v0.10.0.post1, open-aea@1.31.0, and tomte@0.2.4 53 | - The skills have been extracted and the FSM reworked 54 | - The service now also reads generic scores from a Ceramic stream (apart from the Twitter scores) 55 | - Implements wallet linking via tweets 56 | - Adds liccheck to the linters 57 | - Updates documentation 58 | 59 | # 0.1.0 (2023-03-15) 60 | 61 | - First release of IEKit 62 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | # we don't specify dependencies for the library here for intallation as per: https://pipenv-fork.readthedocs.io/en/latest/advanced.html#pipfile-vs-setuppy 8 | # aea/autonomy package dependencies are specified in their respective configuration yaml files and as dev dependencies below 9 | 10 | [dev-packages] 11 | # we fix exact versions as it's sufficient to have at least one set of compatible dependencies for development 12 | aiohttp = "<4.0.0,>=3.8.5" 13 | asn1crypto = "==1.5.1" 14 | Authlib = "==1.2.0" 15 | certifi = "==2021.10.8" 16 | cryptography = "==44.0.2" 17 | dag-cbor = "==0.3.3" 18 | grpcio = "==1.53.0" 19 | jsonschema = "<4.4.0,>=4.3.0" 20 | jsonpatch = "==1.32" 21 | hypothesis = "==6.21.6" 22 | multiformats = "==0.3.1.post4" 23 | pre-commit = "==3.0.1" 24 | py-ecc = "==6.0.0" 25 | pytz = "==2022.2.1" 26 | pytest = "==7.2.1" 27 | pytest-asyncio = ">=0.21.0,<0.22.0" 28 | pytest-cov = "==4.0.0" 29 | pytest-randomly = "==3.12.0" 30 | openapi-core = "==0.15.0" 31 | openapi-spec-validator = "<0.5.0,>=0.4.0" 32 | open-aea = "==1.65.0" 33 | open-aea-ledger-ethereum = "==1.65.0" 34 | open-aea-ledger-cosmos = "==1.65.0" 35 | open-aea-cli-ipfs = "==1.65.0" 36 | open-aea-test-autonomy = "==0.19.9" 37 | open-autonomy = {version = "==0.19.9", extras = ["all"]} 38 | tomte = {version = "==0.2.17", extras = ["cli", "tests"]} 39 | requests = ">=2.28.1,<2.31.2" 40 | openai = "==1.55.3" 41 | bases = "==0.3.0" 42 | typing_validation = "==1.1.0" 43 | typing_extensions = "==4.11.0" 44 | tweepy = "==4.14.0" 45 | twitter_text_parser = "==3.0.0" 46 | py-multibase = "==1.0.3" 47 | py-multicodec = "==0.2.1" 48 | py-eth-sig-utils = "*" 49 | protobuf = "<4.25.0,>=4.21.6" 50 | farcaster = "==0.7.11" 51 | rich = "==13.9.4" 52 | 53 | [requires] 54 | python_version = "3.10" 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IEKit 2 | An toolkit for autonomous services implementing a decentralized Impact Evaluator built with the [Open Autonomy](https://open-autonomy.docs.autonolas.tech/open-autonomy/) framework. 3 | 4 | The demo service for the IEKit tracks mentions of [@autonolas](https://twitter.com/autonolas) on Twitter, assigns scores to them and writes those scores to a [Ceramic](https://ceramic.network/) stream. 5 | 6 | ## Running a demo service 7 | 8 | To learn how to run a demo service based on the IEKit, read the [IEKit technical docs](https://open-autonomy.docs.autonolas.tech/product/iekit/). 9 | 10 | ## For Developers 11 | 12 | Prepare the environment to build your own IEKit-based service. 13 | 14 | - Clone the repository: 15 | 16 | git clone git@github.com:valory-xyz/iekit.git 17 | 18 | - System requirements: 19 | 20 | - Python `>=3.8` 21 | - [Tendermint](https://docs.tendermint.com/v0.34/introduction/install.html) `==0.34.19` 22 | - [IPFS node](https://docs.ipfs.io/install/command-line/#official-distributions) `==0.6.0` 23 | - [Pipenv](https://pipenv.pypa.io/en/latest/installation.html) `>=2021.x.xx` 24 | - [Docker Engine](https://docs.docker.com/engine/install/) `<25.0` 25 | - [Docker Compose](https://docs.docker.com/compose/install/) 26 | 27 | - Pull pre-built images: 28 | 29 | docker pull valory/autonolas-registries:latest 30 | docker pull valory/safe-contract-net:latest 31 | 32 | - Create development environment: 33 | 34 | make new_env && pipenv shell 35 | 36 | - Configure command line: 37 | 38 | autonomy init --reset --author valory --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https" 39 | 40 | - Pull packages: 41 | 42 | autonomy packages sync --update-packages 43 | 44 | - Create some dummy Ceramic streams 45 | 46 | python create_streams.py 47 | 48 | - Fill in the required env vars in `.sample_env` 49 | 50 | - Run a single agent service: 51 | 52 | bash run_service_single.sh 53 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | This document outlines security procedures and general policies for the `IEKit` project. 4 | 5 | ## Supported Versions 6 | 7 | The following table shows which versions of `IEKit` are currently being supported with security updates. 8 | 9 | | Version | Supported | 10 | |------------|--------------------| 11 | | `v0.2.8` | :white_check_mark: | 12 | | `< v0.2.8` | :x: | 13 | 14 | ## Reporting a Vulnerability 15 | 16 | The `IEKit` team and community take all security bugs in `IEKit` seriously. Thank you for improving the security of `IEKit`. We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions. 17 | 18 | Report security bugs by emailing `info@valory.xyz`. 19 | 20 | The lead maintainer will acknowledge your email within 48 hours, and will send a more detailed response within 48 hours indicating the next steps in handling your report. After the initial reply to your report, the security team will endeavour to keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. 21 | 22 | Report security bugs in third-party modules to the person or team maintaining the module. 23 | 24 | ## Disclosure Policy 25 | 26 | When the security team receives a security bug report, they will assign it to a primary handler. This person will coordinate the fix and release process, involving the following steps: 27 | 28 | - Confirm the problem and determine the affected versions. 29 | - Audit code to find any potential similar problems. 30 | - Prepare fixes for all releases still under maintenance. These fixes will be released as fast as possible to PyPI. 31 | 32 | ## Comments on this Policy 33 | 34 | If you have suggestions on how this process could be improved please submit a pull request. 35 | -------------------------------------------------------------------------------- /docs/fonts/Inter-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/fonts/Inter-Bold.ttf -------------------------------------------------------------------------------- /docs/fonts/Inter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/fonts/Inter-Regular.ttf -------------------------------------------------------------------------------- /docs/fonts/Manrope-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/fonts/Manrope-Bold.ttf -------------------------------------------------------------------------------- /docs/images/FSM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/images/FSM.png -------------------------------------------------------------------------------- /docs/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/images/favicon.ico -------------------------------------------------------------------------------- /docs/images/favicon16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/images/favicon16x16.png -------------------------------------------------------------------------------- /docs/images/favicon32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/images/favicon32x32.png -------------------------------------------------------------------------------- /docs/images/favicon96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/docs/images/favicon96x96.png -------------------------------------------------------------------------------- /mints/01.json: -------------------------------------------------------------------------------- 1 | {"name":"contract/valory/dynamic_contribution:0.1.0","description":"Contract package wrapping DynamicContribution contract instances.","code_uri":"ipfs://bafybeidhhoaimoxagkjtfezas7egq5dwrq3vtkikrbws3vbimpftxzjw6m","image":"ipfs://bafybeihtpxmebney7apr5ynjuneyxcipecl4r237twoxz53bqd5kavlacy","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/01.png -------------------------------------------------------------------------------- /mints/02.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/ceramic_read_abci:0.1.0","description":"A skill that reads data from a Ceramic stream.","code_uri":"ipfs://bafybeib4v4t7lzqfsftfhd6e6ctcnarl7rizd7vigeiomvvhcjfyc5r23m","image":"ipfs://bafybeifvkxhrwg2uxycpegqaggskhwkzyfhsnognvzh2wz4pdlhq4taphu","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/02.png -------------------------------------------------------------------------------- /mints/03.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/ceramic_write_abci:0.1.0","description":"A skill that writes data to a Ceramic stream.","code_uri":"ipfs://bafybeienxgaiaehbq5e4ehjufv44z3p632rmku67yh5s5t4aah2d4lm4yu","image":"ipfs://bafybeic36z2gn5adgfjcqxzsd5wjwxlnryz5iub2qmd4zz3eqnz7icx6ca","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/03.png -------------------------------------------------------------------------------- /mints/04.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/dynamic_nft_abci:0.1.0","description":"A skill that dynamically updates NFT images according to user scores.","code_uri":"ipfs://bafybeifunwos3tva7upqm3c43jc2p3rpiflgiuew33g3c36sma4obguzvi","image":"ipfs://bafybeie2exfuqimpg6mmrhglccd5qgrxgnstmz6xha7ordybyz2luggnc4","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/04.png -------------------------------------------------------------------------------- /mints/05.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/generic_scoring_abci:0.1.0","description":"A skill that updates user scores with new points previously read from a Ceramic stream.","code_uri":"ipfs://bafybeibnao2hl2774kkwcvyj2636o6fako46swqnpwr2jmr3s45r4txxqu","image":"ipfs://bafybeigl5mm6jaokuzfthsbs376dlyvuwjp7mmrggbrxo4u3wzoziz7yfq","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/05.png -------------------------------------------------------------------------------- /mints/06.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/path_switch_abci:0.1.0","description":"A decision making skill where the FSM execution path is dynamically set.","code_uri":"ipfs://bafybeigo42z4ufwdatwzkrhmxx6koaqpn4gijrb6jfhcljehbngyssr3xy","image":"ipfs://bafybeie46ejzfzjlws7oukds3hwdbaemg35fr74qtgspel7aaxailircuy","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/06.png -------------------------------------------------------------------------------- /mints/07.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/twitter_scoring_abci:0.1.0","description":"A skill that reads mentions from the Twitter API and assigns scores to the users.","code_uri":"ipfs://bafybeicqqdpz4m4egac2aggfkdqqwvy4prcwi7dmw4eclqafenvtd6g7bi","image":"ipfs://bafybeifjmdajswgmlvjj6nfqpznhvcb2zk5p2ycmoll7kkeuvqmc3d2j3y","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/07.png -------------------------------------------------------------------------------- /mints/08.json: -------------------------------------------------------------------------------- 1 | {"name":"skill/valory/impact_evaluator_abci:0.1.0","description":"The chained abci for the impact_evaluator skill.","code_uri":"ipfs://bafybeiglp7l5y32atfcmx562grvmjq3q7sczh3bau6r7ok7rbaskolaj3y","image":"ipfs://bafybeicwpj4ns5ncxwqhlsd5wmunbm6izn3xewrix42rxharmr3jcuegpe","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/08.png -------------------------------------------------------------------------------- /mints/09.json: -------------------------------------------------------------------------------- 1 | {"name":"agent/valory/impact_evaluator:0.1.0","description":"The impact evaluator agent.","code_uri":"ipfs://bafybeiadxqzvi3xf46mx2vnwufjztaxpult5k6p6xtyi6u3gbpt4a5tifa","image":"ipfs://bafybeiafi3ky7wcc7ydagp2yae7o6dresdsxiurhsmzofvinvob6s3vsle","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/09.png -------------------------------------------------------------------------------- /mints/10.json: -------------------------------------------------------------------------------- 1 | {"name":"service/valory/impact_evaluator:0.1.0","description":"A service that tracks community members' contributions, scores them and updates their NFT images autonomously.","code_uri":"ipfs://bafybeiardhpwclgos62vqc22fmq6nmvwvyr7uccdaakfj2ku3rfmlqdkq4","image":"ipfs://bafybeiatfihrulmx3drp6bphvp2d2wxurm2sc3vp674gqso4wevomx4csm","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/10.png -------------------------------------------------------------------------------- /mints/11.json: -------------------------------------------------------------------------------- 1 | {"name":"protocol/valory/twitter:0.1.0","description":"A protocol for interacting with Twitter.","code_uri":"ipfs://bafybeig7dugazhljpb4qtu4zfnoimttvivopiq574rogjz3qggf5eysnk4","image":"ipfs://bafybeid7oib4i5vepzbotjq2ozyxcsfikxd5lzxv2xadun7u5f4owc3fiy","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/11.png -------------------------------------------------------------------------------- /mints/12.json: -------------------------------------------------------------------------------- 1 | {"name":"protocol/valory/srr:0.1.0","description":"A protocol for basic json-based request-response interactions.","code_uri":"ipfs://bafybeihrixgptxuqpf2s4nujypwlv5aed2nboozq5kl4c26cxw6r7si2x4","image":"ipfs://bafybeiggd3enittdifx2nfqsdwj7r4rwh5cciqvaonjr73qb4orgyvulsm","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/12.png -------------------------------------------------------------------------------- /mints/13.json: -------------------------------------------------------------------------------- 1 | {"name":"connection/valory/twitter:0.1.0","description":"Connection for interacting with the twitter API.","code_uri":"ipfs://bafybeibju7477agfjcveypdv4smso2iy6vy2iqy5lz2ua2bbjhyxlm5dre","image":"ipfs://bafybeiemoigusksxwl4cabogzgsef2blconwia6l2tkljnaf7xnbaohadi","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/13.png -------------------------------------------------------------------------------- /mints/14.json: -------------------------------------------------------------------------------- 1 | {"name":"connection/valory/farcaster:0.1.0","description":"The farcaster connection provides a wrapper around Farcaster SDK.","code_uri":"ipfs://bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi","image":"ipfs://bafybeiesmdpal6hee6ol2upu7sytkkzw6v3upwwt4qcvmkj3vllms646v4","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/14.png -------------------------------------------------------------------------------- /mints/15.json: -------------------------------------------------------------------------------- 1 | {"name":"agent/valory/contribute:0.1.0","description":"A participant in Contribute (https://contribute.olas.network/)","code_uri":"ipfs://bafybeia7l4jxwavcmwbzf7ds77fojlbqol56fqlon2j4cnolq72l3kjj5u","image":"ipfs://bafybeibo4ekemharye655w3h5ig46yxs7hmnrpnwwtocd6ph2sdszgjovi","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/15.png -------------------------------------------------------------------------------- /mints/16.json: -------------------------------------------------------------------------------- 1 | {"name":"service/valory/contribute:0.1.0","description":"A participant in Contribute (https://contribute.olas.network/)","code_uri":"ipfs://bafybeighdhddceq6fjwwh2rcqtfxsemlwuoe4jlksfmjw5dmpjumwxxobm","image":"ipfs://bafybeiekac6qj7cfmydk5j3u24l7jjflwj22toblaao62iegzhqjl2253a","attributes":[{"trait_type":"version","value":"0.1.0"}]} -------------------------------------------------------------------------------- /mints/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valory-xyz/IEKit/547732ed5782f0b74b42ee376741496252410a86/mints/16.png -------------------------------------------------------------------------------- /mints/mapping.txt: -------------------------------------------------------------------------------- 1 | token_id-"component_id" 2 | 64-"contract/valory/dynamic_contribution/0.1.0" 3 | 65-"skill/valory/ceramic_read_abci/0.1.0" 4 | 66-"skill/valory/ceramic_write_abci/0.1.0" 5 | 67-"skill/valory/dynamic_nft_abci/0.1.0" 6 | 68-"skill/valory/generic_scoring_abci/0.1.0" 7 | 69-"skill/valory/path_switch_abci/0.1.0" 8 | 70-"skill/valory/twitter_scoring_abci/0.1.0" 9 | 71-"skill/valory/impact_evaluator_abci/0.1.0" 10 | 191-"protocol/valory/twitter/0.1.0" 11 | 192-"protocol/valory/srr/0.1.0" 12 | 193-"connection/valory/twitter/0.1.0" 13 | 194-"connection/valory/farcaster/0.1.0" 14 | --- 15 | token_id-"agent_id" 16 | 6-"agent/valory/impact_evaluator/0.1.0" 17 | 41-"agent/valory/contribute/0.1.0" 18 | --- 19 | token_id-"service_id" (Gnosis Chain) 20 | 6-"service/valory/impact_evaluator/0.1.0" 21 | X-"service/valory/contribute/0.1.0" 22 | -------------------------------------------------------------------------------- /mints/whitelist.txt: -------------------------------------------------------------------------------- 1 | agent/valory/farcaster_test/0.1.0 2 | skill/valory/farcaster_test_abci/0.1.0 3 | service/valory/impact_evaluator_local/0.1.0 -------------------------------------------------------------------------------- /packages/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """AEA Local package registry.""" 21 | -------------------------------------------------------------------------------- /packages/valory/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2023 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /packages/valory/agents/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Agents authored by 'valory'.""" 21 | -------------------------------------------------------------------------------- /packages/valory/agents/farcaster_test/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Package for valory/farcaster_test agent.""" 21 | from pathlib import Path 22 | 23 | 24 | PACKAGE_DIR = Path(__file__).parent 25 | -------------------------------------------------------------------------------- /packages/valory/agents/impact_evaluator/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Package for valory/impact_evaluator agent.""" 21 | from pathlib import Path 22 | 23 | 24 | PACKAGE_DIR = Path(__file__).parent 25 | -------------------------------------------------------------------------------- /packages/valory/agents/impact_evaluator/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2022-2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Tests package for valory/impact_evaluator agent.""" 21 | -------------------------------------------------------------------------------- /packages/valory/agents/impact_evaluator/tests/helpers/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2022-2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test helpers for balancer/autonomous_fund agent.""" 21 | -------------------------------------------------------------------------------- /packages/valory/agents/impact_evaluator/tests/helpers/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Defines constant used in the ImpactEvaluator docker image.""" 21 | 22 | # the network is configured with these accounts 23 | ACCOUNTS = [ 24 | ( 25 | "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0", 26 | "0x6cbed15c793ce57650b9877cf6fa156fbef513c4e6134f022a85b1ffdd59b2a1", 27 | ), 28 | ( 29 | "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", 30 | "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d", 31 | ), 32 | ( 33 | "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b", 34 | "0x6370fd033278c143179d81c5526140625662b8daa446c22ee2d73db3707e620c", 35 | ), 36 | ( 37 | "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d", 38 | "0x646f1ce2fdad0e6deeeb5c7e8e5543bdde65e86029e2fd9fc169899c440a7913", 39 | ), 40 | ] 41 | 42 | # NOTE: these addresses are deterministic 43 | DYNAMIC_CONTRIBUTION_CONTRACT_ADDRESS = "0x5FbDB2315678afecb367f032d93F642f64180aa3" 44 | -------------------------------------------------------------------------------- /packages/valory/connections/farcaster/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2024 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | """Farcaster connection.""" 22 | -------------------------------------------------------------------------------- /packages/valory/connections/farcaster/connection.yaml: -------------------------------------------------------------------------------- 1 | name: farcaster 2 | author: valory 3 | version: 0.1.0 4 | type: connection 5 | description: The farcaster connection provides a wrapper around Farcaster SDK. 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeigwa4fd4m4rlk2ulhwbiul4rcrr4p6t4cais6to4ge2qz4ng3yo4i 10 | connection.py: bafybeieq5lzzpaqvp4czwlr25nv5dcg5aji4ou4vnwxljz2z5aw5pa2gxu 11 | readme.md: bafybeicyxpek46od5mxdshhdrq7leoqp7mucaftanthcnmrtrplwcmtqda 12 | fingerprint_ignore_patterns: [] 13 | connections: [] 14 | protocols: 15 | - valory/srr:0.1.0:bafybeihrixgptxuqpf2s4nujypwlv5aed2nboozq5kl4c26cxw6r7si2x4 16 | class_name: FarcasterConnection 17 | config: 18 | farcaster_mnemonic: null 19 | excluded_protocols: [] 20 | restricted_to_protocols: [] 21 | dependencies: 22 | farcaster: 23 | version: ==0.7.11 24 | is_abstract: false 25 | cert_requests: [] 26 | -------------------------------------------------------------------------------- /packages/valory/connections/farcaster/readme.md: -------------------------------------------------------------------------------- 1 | # Farcaster Connection 2 | 3 | The farcaster connection provides a wrapper around Farcaster SDK. -------------------------------------------------------------------------------- /packages/valory/connections/openai/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2023 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | 22 | # -*- coding: utf-8 -*- 23 | # ------------------------------------------------------------------------------ 24 | # 25 | # Copyright 2023 valory 26 | # 27 | # Licensed under the Apache License, Version 2.0 (the "License"); 28 | # you may not use this file except in compliance with the License. 29 | # You may obtain a copy of the License at 30 | # 31 | # http://www.apache.org/licenses/LICENSE-2.0 32 | # 33 | # Unless required by applicable law or agreed to in writing, software 34 | # distributed under the License is distributed on an "AS IS" BASIS, 35 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 36 | # See the License for the specific language governing permissions and 37 | # limitations under the License. 38 | # 39 | # ------------------------------------------------------------------------------ 40 | 41 | """Openai connection.""" 42 | -------------------------------------------------------------------------------- /packages/valory/connections/openai/connection.yaml: -------------------------------------------------------------------------------- 1 | name: openai 2 | author: valory 3 | version: 0.1.0 4 | type: connection 5 | description: The openai connection provides a wrapper around OpenAI SDK. 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeiagnziswj5tll4yzx63u4hvat4yieoaaqt5b67chvvqxg5th5mxz4 10 | connection.py: bafybeib3rhiizzi2cyn4oixoqmus237iwkkpzfywqa2fbgajy6qmd6csbm 11 | readme.md: bafybeibqbvpfn6i2w7vxk2m65gizd2hcofu7mdzp2yusx7uupelztme724 12 | fingerprint_ignore_patterns: [] 13 | connections: [] 14 | protocols: 15 | - valory/llm:1.0.0:bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4 16 | class_name: OpenaiConnection 17 | config: 18 | engine: text-davinci-003 19 | max_tokens: 2000 20 | openai_api_key: null 21 | temperature: 0.7 22 | use_openai_staging_api: false 23 | openai_staging_api: http://host.docker.internal:5000/openai 24 | excluded_protocols: [] 25 | restricted_to_protocols: [] 26 | dependencies: 27 | openai: 28 | version: ==1.55.3 29 | requests: 30 | version: ==2.28.1 31 | is_abstract: false 32 | cert_requests: [] 33 | -------------------------------------------------------------------------------- /packages/valory/connections/openai/readme.md: -------------------------------------------------------------------------------- 1 | # OpenAI Connection 2 | 3 | The openai connection provides a wrapper around OpenAI SDK. -------------------------------------------------------------------------------- /packages/valory/connections/twitter/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2023 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | 22 | # -*- coding: utf-8 -*- 23 | # ------------------------------------------------------------------------------ 24 | # 25 | # Copyright 2023 valory 26 | # 27 | # Licensed under the Apache License, Version 2.0 (the "License"); 28 | # you may not use this file except in compliance with the License. 29 | # You may obtain a copy of the License at 30 | # 31 | # http://www.apache.org/licenses/LICENSE-2.0 32 | # 33 | # Unless required by applicable law or agreed to in writing, software 34 | # distributed under the License is distributed on an "AS IS" BASIS, 35 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 36 | # See the License for the specific language governing permissions and 37 | # limitations under the License. 38 | # 39 | # ------------------------------------------------------------------------------ 40 | 41 | """Scaffold of a connection.""" 42 | -------------------------------------------------------------------------------- /packages/valory/connections/twitter/connection.yaml: -------------------------------------------------------------------------------- 1 | name: twitter 2 | author: valory 3 | version: 0.1.0 4 | type: connection 5 | description: Connection for interacting with the twitter API. 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeibxwzkyh7odchnlkeczpguencdjiizm4nezfmi4drybn2zd25xdkq 10 | connection.py: bafybeierlebgcuq3q7sepfhf2swfzm2rhxjdx3cogefjixjfpsyknkr26u 11 | readme.md: bafybeihg5yfzgqvg5ngy7r2o5tfeqnelx2ffxw4po5hmheqjfhumpmxpoq 12 | fingerprint_ignore_patterns: [] 13 | connections: [] 14 | protocols: 15 | - valory/twitter:0.1.0:bafybeig7dugazhljpb4qtu4zfnoimttvivopiq574rogjz3qggf5eysnk4 16 | class_name: TwitterConnection 17 | config: 18 | access_secret: 19 | access_token: 20 | auth_token: 21 | consumer_key: 22 | consumer_secret: 23 | use_twitter_staging_api: false 24 | twitter_staging_api: http://host.docker.internal:5000/twitter/create_tweet 25 | excluded_protocols: [] 26 | restricted_to_protocols: [] 27 | dependencies: 28 | tweepy: 29 | version: ==4.14.0 30 | requests: 31 | version: ==2.28.1 32 | open-aea-cli-ipfs: 33 | version: ==1.65.0 34 | is_abstract: false 35 | cert_requests: [] 36 | -------------------------------------------------------------------------------- /packages/valory/connections/twitter/readme.md: -------------------------------------------------------------------------------- 1 | # Scaffold connection 2 | The scaffold connection acts as a boilerplate for a newly created connection. 3 | 4 | ## Usage 5 | Create a scaffold connection with the `aea scaffold connection {NAME}` command and implement your own connection. 6 | -------------------------------------------------------------------------------- /packages/valory/contracts/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2023 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /packages/valory/contracts/agent_registry/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for the agent registry contract.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/agent_registry/contract.yaml: -------------------------------------------------------------------------------- 1 | name: agent_registry 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Agent Registry contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeibpoladl6yrvlwydhypulk2juvl7pfi3dnkhs2msx3am2ew57zika 10 | build/AgentRegistry.json: bafybeicoe5elvvsv2neiirsdn4uddrilizmyib3x4mvpklr7olhj2kh4ue 11 | contract.py: bafybeihc6fm7driw67wf7vijj2kcdptxawjog35gokojakwmwnutevzwtm 12 | fingerprint_ignore_patterns: [] 13 | contracts: [] 14 | class_name: AgentRegistryContract 15 | contract_interface_paths: 16 | ethereum: build/AgentRegistry.json 17 | dependencies: 18 | open-aea-ledger-ethereum: 19 | version: ==1.65.0 20 | open-aea-test-autonomy: 21 | version: ==0.19.9 22 | web3: 23 | version: <7,>=6.0.0 24 | -------------------------------------------------------------------------------- /packages/valory/contracts/compatibility_fallback_handler/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2021-2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for Safe's CompatibilityFallbackHandler contract.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/compatibility_fallback_handler/contract.yaml: -------------------------------------------------------------------------------- 1 | name: compatibility_fallback_handler 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Safe CompatibilityFallbackHandler contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeigyvgpsfdvw2ir5dliybm7oedojjffp5k4jifewhbcce7uk5isyse 10 | build/compatibility_fallback_handler.json: bafybeiaviobfcfldps5ka32eo3sy2fhqn55ivrmevyzmcbjhy26jfiwh2u 11 | contract.py: bafybeidpyi7muuzqjdyxdjdwx4tr2mghhg6wgqlgcybldexoc36ee5a6oy 12 | fingerprint_ignore_patterns: [] 13 | contracts: [] 14 | class_name: CompatibilityFallbackHandlerContract 15 | contract_interface_paths: 16 | ethereum: build/compatibility_fallback_handler.json 17 | dependencies: 18 | open-aea-ledger-ethereum: 19 | version: ==1.65.0 20 | -------------------------------------------------------------------------------- /packages/valory/contracts/dynamic_contribution/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for the dynamic_contribution contract.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/dynamic_contribution/contract.yaml: -------------------------------------------------------------------------------- 1 | name: dynamic_contribution 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Contract package wrapping DynamicContribution contract instances. 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeidk77j5zmvjhf42ie7grv33hzjedgc6vdiwn22uzhlwuo6xh6hmsi 10 | build/DynamicContribution.json: bafybeicq5ee4hba3h6tsluzvdrtyvzllpqsseqys66e24bfrpjlegnxome 11 | contract.py: bafybeihjmzvnatebdf2upizuko2i7syopco5io67twomlwdb7wmh4tsasu 12 | fingerprint_ignore_patterns: [] 13 | class_name: DynamicContributionContract 14 | contract_interface_paths: 15 | ethereum: build/DynamicContribution.json 16 | dependencies: 17 | open-aea-ledger-ethereum: 18 | version: ==1.65.0 19 | web3: 20 | version: <7,>=6.0.0 21 | hexbytes: {} 22 | eth-utils: 23 | version: ==2.2.0 24 | contracts: [] 25 | -------------------------------------------------------------------------------- /packages/valory/contracts/erc20/README.md: -------------------------------------------------------------------------------- 1 | # ERC20 token contract 2 | -------------------------------------------------------------------------------- /packages/valory/contracts/erc20/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for an ERC20 token.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/erc20/contract.yaml: -------------------------------------------------------------------------------- 1 | name: erc20 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: ERC20 token contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | README.md: bafybeifmfma6rglvpa22odtozyosnp5mwljum64utxip2wgmezuhnjjjyi 10 | __init__.py: bafybeif5vpc3dfrlxlch7brbhmdwksabyzddpfqgm56vdbbkek3t3br6ke 11 | build/ERC20.json: bafybeiemn5b5nszuss7xj6lmvmjuendltp6wz7ubihdvd7c6wqw4bohbpa 12 | contract.py: bafybeien5pkaqqlwhp76r2jepzh4c2ww7nbyuyhwxqseeeojxpcmulxixm 13 | fingerprint_ignore_patterns: [] 14 | contracts: [] 15 | class_name: ERC20 16 | contract_interface_paths: 17 | ethereum: build/ERC20.json 18 | dependencies: 19 | ecdsa: 20 | version: '>=0.15' 21 | eth_typing: {} 22 | hexbytes: {} 23 | open-aea-ledger-ethereum: 24 | version: ==1.65.0 25 | open-aea-test-autonomy: 26 | version: ==0.19.9 27 | packaging: {} 28 | py-eth-sig-utils: {} 29 | requests: 30 | version: ==2.28.1 31 | web3: 32 | version: <7,>=6.0.0 33 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech/README.md: -------------------------------------------------------------------------------- 1 | # Agent Mech contract 2 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for an agent Mech.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech/contract.yaml: -------------------------------------------------------------------------------- 1 | name: mech 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Agent mech contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | README.md: bafybeibl4uw7rs6mwh7zuvdnqmj2o2xyr7nx5qk3w7torwx3jg6farn6ca 10 | __init__.py: bafybeicx5pxh3cxnml2biuuoebvafvu5tvy6mgkzyjzuubuoeebb5yzjsm 11 | build/mech.json: bafybeibrocnkmfe46ylcso7245qq5ysl5z6ydr4xumjt6zl4satc7uqt4m 12 | contract.py: bafybeigp6yw7fo6mu2bzokwje54m5qii5p7gomtfbb7rsjqp43oj6262u4 13 | fingerprint_ignore_patterns: [] 14 | contracts: [] 15 | class_name: Mech 16 | contract_interface_paths: 17 | ethereum: build/mech.json 18 | dependencies: 19 | open-aea-ledger-ethereum: 20 | version: ==1.65.0 21 | web3: 22 | version: <7,>=6.0.0 23 | eth_typing: {} 24 | eth-utils: 25 | version: ==2.2.0 26 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_marketplace/README.md: -------------------------------------------------------------------------------- 1 | # Agent Mech Marketplace Contract 2 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_marketplace/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for an agent MechMarketplace.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_marketplace/contract.yaml: -------------------------------------------------------------------------------- 1 | name: mech_marketplace 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Agent mech marketplace contract. 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | README.md: bafybeihygfmkbo4cegrqnz5ws6bbjaifubvk7r2uyvuanxpqy24l634tba 10 | __init__.py: bafybeie6625ddrcph7pcxef4fbfcuhyd6yuzdyyqcoqpc5xdjb4rttw7my 11 | build/mech.json: bafybeidprjeyuu45svcbfjrft6xj6u43lwkpjkmeojsva3g7mgld4jw5ma 12 | contract.py: bafybeienbbvraebeigne4mmks7766m7ccfbw5egen3hiyvawezktky5diy 13 | fingerprint_ignore_patterns: [] 14 | contracts: [] 15 | class_name: MechMarketplace 16 | contract_interface_paths: 17 | ethereum: build/mech.json 18 | dependencies: 19 | open-aea-ledger-ethereum: 20 | version: ==1.65.0 21 | web3: 22 | version: <7,>=6.0.0 23 | eth_typing: {} 24 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_marketplace_legacy/README.md: -------------------------------------------------------------------------------- 1 | # Agent Mech Marketplace Legacy Contract 2 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_marketplace_legacy/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2024-2025 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for an agent MechMarketplaceLegacy.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_marketplace_legacy/contract.yaml: -------------------------------------------------------------------------------- 1 | name: mech_marketplace_legacy 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Agent mech marketplace contract. 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | README.md: bafybeic3ldpphjsteilzj36ittzrj2jm55qwp2fn7qubbf4q4wpdpzm6y4 10 | __init__.py: bafybeih566schek7lxlxjkfb2medntav3kfnnqfhog35iolgljfxsobaxu 11 | build/mech.json: bafybeifhlumph2hdxmn7bohkqnivdggwaz26kwr7mvd5v4pjunyl6siqpi 12 | contract.py: bafybeigvlshil7rjpbubipbo5r7au2e6qkbhiwg67wekhx6qeminjiyfti 13 | fingerprint_ignore_patterns: [] 14 | contracts: [] 15 | class_name: MechMarketplaceLegacy 16 | contract_interface_paths: 17 | ethereum: build/mech.json 18 | dependencies: 19 | open-aea-ledger-ethereum: 20 | version: ==1.65.0 21 | web3: 22 | version: <7,>=6.0.0 23 | eth_typing: {} 24 | eth-utils: 25 | version: ==2.2.0 26 | hexbytes: {} 27 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_mm/README.md: -------------------------------------------------------------------------------- 1 | # Agent Mech for marketplace contract 2 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_mm/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2025 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for an agent Mech.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/mech_mm/contract.yaml: -------------------------------------------------------------------------------- 1 | name: mech_mm 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: Agent mech contract for mech marketplace 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | README.md: bafybeiarlqourpkb4tcynaznvawyqqu4ofwtte6qb464net2btjd44lppa 10 | __init__.py: bafybeicghancjavdrn34fliduqfi4ltghqs6uwo2qdxw2tftbq7hz2wuom 11 | build/mech.json: bafybeigfnspnth45gkxuibzuua3b3xax2cnbhoataf6kdjyz4inugxqc7y 12 | contract.py: bafybeicvzjify326ri4ww3jywy5f77bvawnpzi22oy6x2ioj5zr7iqgocy 13 | fingerprint_ignore_patterns: [] 14 | contracts: [] 15 | class_name: MechMM 16 | contract_interface_paths: 17 | ethereum: build/mech.json 18 | dependencies: 19 | open-aea-ledger-ethereum: 20 | version: ==1.65.0 21 | web3: 22 | version: <7,>=6.0.0 23 | eth_typing: {} 24 | eth-utils: 25 | version: ==2.2.0 26 | -------------------------------------------------------------------------------- /packages/valory/contracts/staking/README.md: -------------------------------------------------------------------------------- 1 | # Contribute staking contract 2 | -------------------------------------------------------------------------------- /packages/valory/contracts/staking/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for an ERC20 token.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/staking/contract.yaml: -------------------------------------------------------------------------------- 1 | name: staking 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: contribute staking contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | README.md: bafybeiclvbed42bmvsm3qqxosfu4kxbc6vuhxaant2od2hmszpkznh3z74 10 | __init__.py: bafybeif5vpc3dfrlxlch7brbhmdwksabyzddpfqgm56vdbbkek3t3br6ke 11 | build/staking.json: bafybeia2o6m3k6uwrz5qua5dcmljc3tfd477yjw6lsmfzoyjrjohtffuie 12 | contract.py: bafybeiczfgpdb5f7mbryfam2il4bnhyu7xugi45efq23r6frjdzmm3prru 13 | fingerprint_ignore_patterns: [] 14 | contracts: [] 15 | class_name: Staking 16 | contract_interface_paths: 17 | ethereum: build/staking.json 18 | dependencies: 19 | open-aea-ledger-ethereum: 20 | version: ==1.65.0 21 | web3: 22 | version: <7,>=6.0.0 23 | -------------------------------------------------------------------------------- /packages/valory/contracts/veolas_delegation/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2021-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for the veolas_delegation contract.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/veolas_delegation/contract.yaml: -------------------------------------------------------------------------------- 1 | name: veolas_delegation 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: veolas_delegation contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeigyd3v35lzfmckfrucgknh55arblioofflclkw72e4m2elizwkj24 10 | build/DelegateContribute.json: bafybeigeu2df4b3637s7vwcbqe2vdau6cuk3rbxvkc32bg2byljidiblgm 11 | contract.py: bafybeieljzh5oc45koauuon4bz7kor5iezzgpqjdbztywlys7fbkr6mf7q 12 | fingerprint_ignore_patterns: [] 13 | contracts: [] 14 | class_name: VeOLASDelegationContract 15 | contract_interface_paths: 16 | ethereum: build/DelegateContribute.json 17 | dependencies: 18 | open-aea-ledger-ethereum: 19 | version: ==1.65.0 20 | -------------------------------------------------------------------------------- /packages/valory/contracts/wveolas/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2021-2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the support resources for the wveolas contract.""" 21 | -------------------------------------------------------------------------------- /packages/valory/contracts/wveolas/contract.yaml: -------------------------------------------------------------------------------- 1 | name: wveolas 2 | author: valory 3 | version: 0.1.0 4 | type: contract 5 | description: wveolas contract 6 | license: Apache-2.0 7 | aea_version: '>=1.0.0, <2.0.0' 8 | fingerprint: 9 | __init__.py: bafybeibtn3d7h6xkaudftjmqi47rg6c45nvbjbu77rcnhalj7xxujzgbru 10 | build/wveolas.json: bafybeid4ypbtauutpx4hktinxecxecp2moxzny5cyky3anp6peu33slax4 11 | contract.py: bafybeib52j57zi2tsm7g4bnv75nxdbmbmsxmf7coxw3cyzgrdxzctlzgmy 12 | fingerprint_ignore_patterns: [] 13 | contracts: [] 14 | class_name: WveOLASContract 15 | contract_interface_paths: 16 | ethereum: build/wveolas.json 17 | dependencies: 18 | open-aea-ledger-ethereum: 19 | version: ==1.65.0 20 | -------------------------------------------------------------------------------- /packages/valory/protocols/llm/README.md: -------------------------------------------------------------------------------- 1 | # LLM Protocol 2 | 3 | ## Description 4 | 5 | This is a protocol for interacting with LLm. 6 | 7 | ## Specification 8 | 9 | ```yaml 10 | --- 11 | name: llm 12 | author: valory 13 | version: 1.0.0 14 | description: A protocol for LLM requests and responses. 15 | license: Apache-2.0 16 | aea_version: '>=1.0.0, <2.0.0' 17 | protocol_specification_id: valory/llm:1.0.0 18 | speech_acts: 19 | request: 20 | prompt_template: pt:str 21 | prompt_values: pt:dict[pt:str, pt:str] 22 | response: 23 | value: pt:str 24 | ... 25 | --- 26 | initiation: [request] 27 | reply: 28 | request: [response] 29 | response: [] 30 | termination: [response] 31 | roles: {skill, connection} 32 | end_states: [successful] 33 | keep_terminal_state_dialogues: false 34 | ... 35 | ``` 36 | 37 | ## Links 38 | 39 | -------------------------------------------------------------------------------- /packages/valory/protocols/llm/llm.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package aea.valory.llm.v1_0_0; 4 | 5 | message LlmMessage{ 6 | 7 | // Performatives and contents 8 | message Request_Performative{ 9 | string prompt_template = 1; 10 | map prompt_values = 2; 11 | } 12 | 13 | message Response_Performative{ 14 | string value = 1; 15 | } 16 | 17 | 18 | oneof performative{ 19 | Request_Performative request = 5; 20 | Response_Performative response = 6; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/valory/protocols/llm/protocol.yaml: -------------------------------------------------------------------------------- 1 | name: llm 2 | author: valory 3 | version: 1.0.0 4 | protocol_specification_id: valory/llm:1.0.0 5 | type: protocol 6 | description: A protocol for LLM requests and responses. 7 | license: Apache-2.0 8 | aea_version: '>=1.0.0, <2.0.0' 9 | fingerprint: 10 | README.md: bafybeicetvgjqzw4lgggv2kxwsxshery2mow3becpquk3b4qdb5g6p76tm 11 | __init__.py: bafybeihpfshhgdil3vzraagsfrq42cirxvg7ced5duhpe6kbqgo7g7v72m 12 | dialogues.py: bafybeigspfpqhdvgnwbiahxsc2qlilmzbcxyrffcwoilvnb7hx76uanul4 13 | llm.proto: bafybeiah7wq6spk7sr2ctwlutj3dn6sq3erbgm6ihja7abl7czoyoanyu4 14 | llm_pb2.py: bafybeifwerxjwysdotin5bjglloh2sqbeb7iwitpp2mfrne4fs2q3vj2ta 15 | message.py: bafybeidcpa427xs4jagfmt2l72mel5f4vidrb6hnzewnqlicydw64y4ir4 16 | serialization.py: bafybeie55m7zgbbbogrgbh5kzymdmipfe2qv7qloclw7bjyqnuswela4wa 17 | tests/test_llm_dialogues.py: bafybeihnug7m5c6733v6w5kdjpxrhgdcoz2vmg2mqjdle5yxqrvufp52im 18 | tests/test_llm_messages.py: bafybeidur77uf5moysw2zfborvlpc24fytcncucwsh6gqt3dufj5sl7srq 19 | fingerprint_ignore_patterns: [] 20 | dependencies: 21 | protobuf: {} 22 | -------------------------------------------------------------------------------- /packages/valory/protocols/srr/README.md: -------------------------------------------------------------------------------- 1 | # Simple-Request-Response Protocol 2 | 3 | ## Description 4 | 5 | This is a simple protocol for basic json-based request-response interactions. 6 | 7 | ## Specification 8 | 9 | ```yaml 10 | --- 11 | name: srr 12 | author: valory 13 | version: 0.1.0 14 | description: A protocol for basic json-based request-response interactions. 15 | license: Apache-2.0 16 | aea_version: '>=1.0.0, <2.0.0' 17 | protocol_specification_id: valory/srr:0.1.0 18 | speech_acts: 19 | request: 20 | payload: pt:str 21 | response: 22 | payload: pt:str 23 | error: pt:bool 24 | ... 25 | --- 26 | initiation: [request] 27 | reply: 28 | request: [response] 29 | response: [] 30 | termination: [response] 31 | roles: {skill, connection} 32 | end_states: [successful] 33 | keep_terminal_state_dialogues: false 34 | ... 35 | ``` 36 | 37 | ## Links 38 | 39 | -------------------------------------------------------------------------------- /packages/valory/protocols/srr/protocol.yaml: -------------------------------------------------------------------------------- 1 | name: srr 2 | author: valory 3 | version: 0.1.0 4 | protocol_specification_id: valory/srr:0.1.0 5 | type: protocol 6 | description: A protocol for basic json-based request-response interactions. 7 | license: Apache-2.0 8 | aea_version: '>=1.0.0, <2.0.0' 9 | fingerprint: 10 | README.md: bafybeiepnbkmpcrxj2bvnffo24uhl3y73ehk6fhe4aicw4q44rvvdaoi6u 11 | __init__.py: bafybeigmb7s3ozegf7odbr3m66iifv7kyyuk2ag4d3x6scvbyjuljcpxma 12 | dialogues.py: bafybeic5ga2iguthymeiyt3j3wy3miy2xtscbo6m2hq3yfimb7wutrz244 13 | message.py: bafybeifavqxnybecdguexor4xityfjq4cdhl7d3l3jcbtveo527fdlofqa 14 | serialization.py: bafybeigzcpf6gmpdq4ae3qzrlcm3tfave6ao2bg36362bajtp3nnecizam 15 | srr.proto: bafybeih6as35mfl5jae444qoasknbvdfzkp6irzu6tarhegrx57jncofga 16 | srr_pb2.py: bafybeigiz3xlb6cbfzynpje7punwoqcraq4gwu5jykylpsq5luqtinjtey 17 | tests/test_srr_dialogues.py: bafybeih3k4v23rjmy54m7xadorsvz5teomejoycwtiikqt2q3w7ggph7i4 18 | tests/test_srr_messages.py: bafybeibcegoyibnfbzkdwdzv2pzbqagsh7hbsfn2zvbob56bzwm7ie2ocu 19 | fingerprint_ignore_patterns: [] 20 | dependencies: 21 | protobuf: {} 22 | -------------------------------------------------------------------------------- /packages/valory/protocols/srr/srr.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package aea.valory.srr.v0_1_0; 4 | 5 | message SrrMessage{ 6 | 7 | // Performatives and contents 8 | message Request_Performative{ 9 | string payload = 1; 10 | } 11 | 12 | message Response_Performative{ 13 | string payload = 1; 14 | bool error = 2; 15 | } 16 | 17 | 18 | oneof performative{ 19 | Request_Performative request = 5; 20 | Response_Performative response = 6; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/valory/protocols/srr/srr_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: srr.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import descriptor_pool as _descriptor_pool 7 | from google.protobuf import symbol_database as _symbol_database 8 | from google.protobuf.internal import builder as _builder 9 | 10 | 11 | # @@protoc_insertion_point(imports) 12 | 13 | _sym_db = _symbol_database.Default() 14 | 15 | 16 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 17 | b"\n\tsrr.proto\x12\x15\x61\x65\x61.valory.srr.v0_1_0\"\x96\x02\n\nSrrMessage\x12I\n\x07request\x18\x05 \x01(\x0b\x32\x36.aea.valory.srr.v0_1_0.SrrMessage.Request_PerformativeH\x00\x12K\n\x08response\x18\x06 \x01(\x0b\x32\x37.aea.valory.srr.v0_1_0.SrrMessage.Response_PerformativeH\x00\x1a'\n\x14Request_Performative\x12\x0f\n\x07payload\x18\x01 \x01(\t\x1a\x37\n\x15Response_Performative\x12\x0f\n\x07payload\x18\x01 \x01(\t\x12\r\n\x05\x65rror\x18\x02 \x01(\x08\x42\x0e\n\x0cperformativeb\x06proto3" 18 | ) 19 | 20 | _globals = globals() 21 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) 22 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "srr_pb2", _globals) 23 | if _descriptor._USE_C_DESCRIPTORS == False: 24 | DESCRIPTOR._options = None 25 | _globals["_SRRMESSAGE"]._serialized_start = 37 26 | _globals["_SRRMESSAGE"]._serialized_end = 315 27 | _globals["_SRRMESSAGE_REQUEST_PERFORMATIVE"]._serialized_start = 203 28 | _globals["_SRRMESSAGE_REQUEST_PERFORMATIVE"]._serialized_end = 242 29 | _globals["_SRRMESSAGE_RESPONSE_PERFORMATIVE"]._serialized_start = 244 30 | _globals["_SRRMESSAGE_RESPONSE_PERFORMATIVE"]._serialized_end = 299 31 | # @@protoc_insertion_point(module_scope) 32 | -------------------------------------------------------------------------------- /packages/valory/protocols/twitter/README.md: -------------------------------------------------------------------------------- 1 | # Twitter Protocol 2 | 3 | ## Description 4 | 5 | This is a protocol for interacting with Twitter. 6 | 7 | ## Specification 8 | 9 | ```yaml 10 | --- 11 | name: twitter 12 | author: valory 13 | version: 0.1.0 14 | description: A protocol for interacting with Twitter. 15 | license: Apache-2.0 16 | aea_version: '>=1.0.0, <2.0.0' 17 | protocol_specification_id: valory/twitter:0.1.0 18 | speech_acts: 19 | create_tweet: 20 | text: pt:str 21 | tweet_created: 22 | tweet_id: pt:str 23 | error: 24 | message: pt:str 25 | ... 26 | --- 27 | initiation: [create_tweet] 28 | reply: 29 | create_tweet: [tweet_created, error] 30 | tweet_created: [] 31 | error: [] 32 | termination: [tweet_created, error] 33 | roles: {skill, connection} 34 | end_states: [successful] 35 | keep_terminal_state_dialogues: false 36 | ... 37 | ``` 38 | 39 | ## Links 40 | 41 | -------------------------------------------------------------------------------- /packages/valory/protocols/twitter/protocol.yaml: -------------------------------------------------------------------------------- 1 | name: twitter 2 | author: valory 3 | version: 0.1.0 4 | protocol_specification_id: valory/twitter:0.1.0 5 | type: protocol 6 | description: A protocol for interacting with Twitter. 7 | license: Apache-2.0 8 | aea_version: '>=1.0.0, <2.0.0' 9 | fingerprint: 10 | README.md: bafybeiaagbdeh4zropm6fcvorzv3ca4k6vfu7ya4wicesm4j2qtkoqada4 11 | __init__.py: bafybeih5sj6mqcrnmctng5tkyqwdvbvk7usvirvuldd4q5ou6x4xnrh5um 12 | dialogues.py: bafybeibxkkxvdzxgw5otuu4seej6rptybs7dzc3zbdmlalx6frxw5lsp2u 13 | message.py: bafybeidlcwtwhcuql55loiuguu5j6bum36hz4klzbmnshryrk2jiomfn5u 14 | serialization.py: bafybeiahmlp56h6dmkvb7qtmt3f2sofpvnctdp3e6i4zjbitqrwe24dqwi 15 | tests/test_twitter_dialogues.py: bafybeibu4cmtkmf5iaf54axcny2yaan2dt56dorv5664tg37fnxhsjgpya 16 | tests/test_twitter_messages.py: bafybeie5eyw2t5n6ck3iu3l6yv543kmk4tpqwb4curjyzyzqdwubghonza 17 | twitter.proto: bafybeieaepg4kzjpzkbhg7amwfjmk77esizsjedkr524m6pd2cqfzykbgm 18 | twitter_pb2.py: bafybeiexfvi6gta5wpk5tdhkpu2p3pq4lp253q22ld5u4kfln7erqz3aay 19 | fingerprint_ignore_patterns: [] 20 | dependencies: 21 | protobuf: {} 22 | -------------------------------------------------------------------------------- /packages/valory/protocols/twitter/twitter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package aea.valory.twitter.v0_1_0; 4 | 5 | message TwitterMessage{ 6 | 7 | // Performatives and contents 8 | message Create_Tweet_Performative{ 9 | string text = 1; 10 | } 11 | 12 | message Tweet_Created_Performative{ 13 | string tweet_id = 1; 14 | } 15 | 16 | message Error_Performative{ 17 | string message = 1; 18 | } 19 | 20 | 21 | oneof performative{ 22 | Create_Tweet_Performative create_tweet = 5; 23 | Error_Performative error = 6; 24 | Tweet_Created_Performative tweet_created = 7; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/valory/services/impact_evaluator/README.md: -------------------------------------------------------------------------------- 1 | ## Impact Evaluator Service 2 | 3 | A service that tracks community members' contributions, scores them and updates their NFT images autonomously. 4 | -------------------------------------------------------------------------------- /packages/valory/services/impact_evaluator_local/README.md: -------------------------------------------------------------------------------- 1 | ## Impact Evaluator Service 2 | 3 | A service that tracks community members' contributions, scores them and updates their NFT images autonomously. 4 | -------------------------------------------------------------------------------- /packages/valory/skills/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2023 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/ceramic_read_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/ceramic/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains code to prepare ceramic payloads.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - API_ERROR 3 | - DONE 4 | - NO_MAJORITY 5 | - RETRY 6 | - ROUND_TIMEOUT 7 | default_start_state: StreamReadRound 8 | final_states: 9 | - FinishedReadingRound 10 | label: CeramicReadAbciApp 11 | start_states: 12 | - StreamReadRound 13 | states: 14 | - FinishedReadingRound 15 | - StreamReadRound 16 | transition_func: 17 | (StreamReadRound, API_ERROR): StreamReadRound 18 | (StreamReadRound, DONE): FinishedReadingRound 19 | (StreamReadRound, NO_MAJORITY): StreamReadRound 20 | (StreamReadRound, RETRY): StreamReadRound 21 | (StreamReadRound, ROUND_TIMEOUT): StreamReadRound 22 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the CeramicReadAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class StreamReadPayload(BaseTxPayload): 29 | """Represent a transaction payload for the StreamReadRound.""" 30 | 31 | content: str 32 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the ceramic read skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the CeramicRead.""" 21 | 22 | import packages.valory.skills.ceramic_read_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the CeramicRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the CeramicRead.""" 21 | 22 | import packages.valory.skills.ceramic_read_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the CeramicRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the CeramicRead.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.ceramic_read_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of CeramicRead.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_read_abci/tests/test_payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains payload tests for the CeramicReadAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | from typing import Hashable, Type 24 | 25 | import pytest 26 | 27 | from packages.valory.skills.ceramic_read_abci.payloads import ( 28 | BaseTxPayload, 29 | StreamReadPayload, 30 | ) 31 | 32 | 33 | @dataclass 34 | class PayloadTestCase: 35 | """PayloadTestCase""" 36 | 37 | payload_cls: Type[BaseTxPayload] 38 | content: Hashable 39 | 40 | 41 | @pytest.mark.parametrize( 42 | "test_case", 43 | [ 44 | PayloadTestCase( 45 | payload_cls=StreamReadPayload, 46 | content="payload_test_content", 47 | ), 48 | ], 49 | ) 50 | def test_payloads(test_case: PayloadTestCase) -> None: 51 | """Tests for TwitterScoringAbciApp payloads""" 52 | 53 | payload = test_case.payload_cls( 54 | sender="sender", 55 | content=test_case.content, 56 | ) 57 | assert payload.sender == "sender" 58 | assert payload.content == test_case.content 59 | assert payload.from_json(payload.json) == payload 60 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/ceramic_write_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/ceramic/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains code to prepare ceramic payloads.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - API_ERROR 3 | - DID_NOT_SEND 4 | - DONE 5 | - DONE_CONTINUE 6 | - DONE_FINISHED 7 | - MAX_RETRIES_ERROR 8 | - NO_MAJORITY 9 | - ROUND_TIMEOUT 10 | - VERIFICATION_ERROR 11 | default_start_state: RandomnessRound 12 | final_states: 13 | - FinishedMaxRetriesRound 14 | - FinishedVerificationRound 15 | label: CeramicWriteAbciApp 16 | start_states: 17 | - RandomnessRound 18 | states: 19 | - FinishedMaxRetriesRound 20 | - FinishedVerificationRound 21 | - RandomnessRound 22 | - SelectKeeperRound 23 | - StreamWriteRound 24 | - VerificationRound 25 | transition_func: 26 | (RandomnessRound, DONE): SelectKeeperRound 27 | (RandomnessRound, NO_MAJORITY): RandomnessRound 28 | (RandomnessRound, ROUND_TIMEOUT): RandomnessRound 29 | (SelectKeeperRound, DONE): StreamWriteRound 30 | (SelectKeeperRound, NO_MAJORITY): RandomnessRound 31 | (SelectKeeperRound, ROUND_TIMEOUT): RandomnessRound 32 | (StreamWriteRound, API_ERROR): RandomnessRound 33 | (StreamWriteRound, DID_NOT_SEND): RandomnessRound 34 | (StreamWriteRound, DONE): VerificationRound 35 | (StreamWriteRound, MAX_RETRIES_ERROR): FinishedMaxRetriesRound 36 | (StreamWriteRound, ROUND_TIMEOUT): RandomnessRound 37 | (VerificationRound, DONE_CONTINUE): StreamWriteRound 38 | (VerificationRound, DONE_FINISHED): FinishedVerificationRound 39 | (VerificationRound, NO_MAJORITY): RandomnessRound 40 | (VerificationRound, ROUND_TIMEOUT): RandomnessRound 41 | (VerificationRound, VERIFICATION_ERROR): RandomnessRound 42 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the CeramicWriteAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class RandomnessPayload(BaseTxPayload): 29 | """Represent a transaction payload of type 'randomness'.""" 30 | 31 | round_id: int 32 | randomness: str 33 | 34 | 35 | @dataclass(frozen=True) 36 | class SelectKeeperPayload(BaseTxPayload): 37 | """Represent a transaction payload of type 'select_keeper'.""" 38 | 39 | keeper: str 40 | 41 | 42 | @dataclass(frozen=True) 43 | class StreamWritePayload(BaseTxPayload): 44 | """Represent a transaction payload for the StreamWriteRound.""" 45 | 46 | content: str 47 | 48 | 49 | @dataclass(frozen=True) 50 | class VerificationPayload(BaseTxPayload): 51 | """Represent a transaction payload for the VerificationRound.""" 52 | 53 | content: str 54 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the ceramic write skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the CeramicWrite.""" 21 | 22 | import packages.valory.skills.ceramic_write_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the CeramicWrite can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the CeramicWrite.""" 21 | 22 | import packages.valory.skills.ceramic_write_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the CeramicWrite can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/ceramic_write_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the CeramicWrite.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.ceramic_write_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of CeramicWrite.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/decision_making_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the DecisionMakingAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class DecisionMakingPayload(BaseTxPayload): 29 | """Represent a transaction payload for the DecisionMakingRound.""" 30 | 31 | content: str 32 | 33 | 34 | @dataclass(frozen=True) 35 | class PostTxDecisionPayload(BaseTxPayload): 36 | """Represent a transaction payload for the PostTxDecisionRound.""" 37 | 38 | event: str 39 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/tasks/score_preparations.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains the logic for task preparations.""" 21 | from packages.valory.skills.decision_making_abci.rounds import Event 22 | from packages.valory.skills.decision_making_abci.tasks.task_preparations import ( 23 | TaskPreparation, 24 | ) 25 | 26 | 27 | class ScorePreparation(TaskPreparation): 28 | """ScorePreparation""" 29 | 30 | task_name = "score" 31 | task_event = Event.SCORE.value 32 | 33 | def check_extra_conditions(self): 34 | """Check extra conditions""" 35 | yield 36 | return True 37 | 38 | def _pre_task(self): 39 | """Preparations before running the task""" 40 | yield 41 | updates = {} 42 | return updates, self.task_event 43 | 44 | def _post_task(self): 45 | """Preparations after running the task""" 46 | updates = {} 47 | yield 48 | return updates, None 49 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/test_tools/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2021-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test tools package for decision_making_abci base tests.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the decision making skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the DecisionMaking.""" 21 | 22 | import packages.valory.skills.decision_making_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' module can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the decision_making_abci.""" 21 | import packages.valory.skills.decision_making_abci.handlers # noqa 22 | 23 | 24 | def test_import() -> None: 25 | """Test that the 'handlers.py' of the GenericScoring can be imported.""" 26 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the decision_making_abci.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.decision_making_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of GenericScoring.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /packages/valory/skills/decision_making_abci/tests/test_payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains payload tests for the ProposalCollector.""" 21 | 22 | from packages.valory.skills.decision_making_abci.payloads import DecisionMakingPayload 23 | 24 | 25 | def test_sync_delegations_payload() -> None: 26 | """Test `SynchronizeDelegationsPayload`.""" 27 | 28 | payload = DecisionMakingPayload(sender="sender", content="content") 29 | 30 | assert payload.sender == "sender" 31 | assert payload.content == "content" 32 | assert payload.data == {"content": "content"} 33 | -------------------------------------------------------------------------------- /packages/valory/skills/dynamic_nft_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/dynamic_nft_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/dynamic_nft_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - CONTRACT_ERROR 3 | - DONE 4 | - NO_MAJORITY 5 | - ROUND_TIMEOUT 6 | default_start_state: TokenTrackRound 7 | final_states: 8 | - FinishedTokenTrackRound 9 | label: DynamicNFTAbciApp 10 | start_states: 11 | - TokenTrackRound 12 | states: 13 | - FinishedTokenTrackRound 14 | - TokenTrackRound 15 | transition_func: 16 | (TokenTrackRound, CONTRACT_ERROR): TokenTrackRound 17 | (TokenTrackRound, DONE): FinishedTokenTrackRound 18 | (TokenTrackRound, NO_MAJORITY): TokenTrackRound 19 | (TokenTrackRound, ROUND_TIMEOUT): TokenTrackRound 20 | -------------------------------------------------------------------------------- /packages/valory/skills/dynamic_nft_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the DynamicNFTAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class TokenTrackPayload(BaseTxPayload): 29 | """Represent a transaction payload for the TokenTrackRound.""" 30 | 31 | content: str 32 | -------------------------------------------------------------------------------- /packages/valory/skills/dynamic_nft_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the tests for the Dynamic NFT ABCI skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/dynamic_nft_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the DynamicNFT skill.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.dynamic_nft_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: # pylint: disable=too-few-public-methods 27 | """Test SharedState of DynamicNFT skill.""" 28 | 29 | def test_initialization( # pylint: disable=no-self-use 30 | self, 31 | ) -> None: 32 | """Test initialization.""" 33 | SharedState(name="", skill_context=DummyContext()) 34 | -------------------------------------------------------------------------------- /packages/valory/skills/dynamic_nft_abci/tests/test_payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains payload tests for the DynamicNFTAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | from typing import Hashable 24 | 25 | import pytest 26 | 27 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 28 | from packages.valory.skills.dynamic_nft_abci.payloads import TokenTrackPayload 29 | 30 | 31 | @dataclass 32 | class PayloadTestCase: 33 | """PayloadTestCase""" 34 | 35 | payload_cls: BaseTxPayload 36 | content: Hashable 37 | 38 | 39 | @pytest.mark.parametrize( 40 | "test_case", 41 | [ 42 | PayloadTestCase( 43 | payload_cls=TokenTrackPayload, 44 | content="payload_test_content", 45 | ), 46 | ], 47 | ) 48 | def test_payloads(test_case: PayloadTestCase) -> None: 49 | """Tests for DynamicNFTAbciApp payloads""" 50 | 51 | payload = test_case.payload_cls(sender="sender", content=test_case.content) 52 | assert payload.sender == "sender" 53 | assert payload.content == test_case.content 54 | assert payload.from_json(payload.json) == payload 55 | -------------------------------------------------------------------------------- /packages/valory/skills/farcaster_test_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the impact evaluator skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/farcaster_test_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/farcaster_test_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - API_ERROR 3 | - CONTINUE 4 | - DONE 5 | - NO_MAJORITY 6 | - RESET_AND_PAUSE_TIMEOUT 7 | - ROUND_TIMEOUT 8 | default_start_state: RegistrationStartupRound 9 | final_states: [] 10 | label: FarcasterTestSkillAbciApp 11 | start_states: 12 | - RegistrationRound 13 | - RegistrationStartupRound 14 | states: 15 | - FarcasterWriteRound 16 | - RandomnessFarcasterRound 17 | - RegistrationRound 18 | - RegistrationStartupRound 19 | - ResetAndPauseRound 20 | - SelectKeeperFarcasterRound 21 | transition_func: 22 | (FarcasterWriteRound, API_ERROR): RandomnessFarcasterRound 23 | (FarcasterWriteRound, CONTINUE): FarcasterWriteRound 24 | (FarcasterWriteRound, DONE): ResetAndPauseRound 25 | (FarcasterWriteRound, ROUND_TIMEOUT): RandomnessFarcasterRound 26 | (RandomnessFarcasterRound, DONE): SelectKeeperFarcasterRound 27 | (RandomnessFarcasterRound, NO_MAJORITY): RandomnessFarcasterRound 28 | (RandomnessFarcasterRound, ROUND_TIMEOUT): RandomnessFarcasterRound 29 | (RegistrationRound, DONE): RandomnessFarcasterRound 30 | (RegistrationRound, NO_MAJORITY): RegistrationRound 31 | (RegistrationStartupRound, DONE): RandomnessFarcasterRound 32 | (ResetAndPauseRound, DONE): RandomnessFarcasterRound 33 | (ResetAndPauseRound, NO_MAJORITY): ResetAndPauseRound 34 | (ResetAndPauseRound, RESET_AND_PAUSE_TIMEOUT): ResetAndPauseRound 35 | (SelectKeeperFarcasterRound, DONE): FarcasterWriteRound 36 | (SelectKeeperFarcasterRound, NO_MAJORITY): RandomnessFarcasterRound 37 | (SelectKeeperFarcasterRound, ROUND_TIMEOUT): RandomnessFarcasterRound 38 | -------------------------------------------------------------------------------- /packages/valory/skills/farcaster_write_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - API_ERROR 3 | - CONTINUE 4 | - DONE 5 | - NO_MAJORITY 6 | - ROUND_TIMEOUT 7 | default_start_state: RandomnessFarcasterRound 8 | final_states: 9 | - FinishedFarcasterWriteRound 10 | label: FarcasterWriteAbciApp 11 | start_states: 12 | - RandomnessFarcasterRound 13 | states: 14 | - FarcasterWriteRound 15 | - FinishedFarcasterWriteRound 16 | - RandomnessFarcasterRound 17 | - SelectKeeperFarcasterRound 18 | transition_func: 19 | (FarcasterWriteRound, API_ERROR): RandomnessFarcasterRound 20 | (FarcasterWriteRound, CONTINUE): FarcasterWriteRound 21 | (FarcasterWriteRound, DONE): FinishedFarcasterWriteRound 22 | (FarcasterWriteRound, ROUND_TIMEOUT): RandomnessFarcasterRound 23 | (RandomnessFarcasterRound, DONE): SelectKeeperFarcasterRound 24 | (RandomnessFarcasterRound, NO_MAJORITY): RandomnessFarcasterRound 25 | (RandomnessFarcasterRound, ROUND_TIMEOUT): RandomnessFarcasterRound 26 | (SelectKeeperFarcasterRound, DONE): FarcasterWriteRound 27 | (SelectKeeperFarcasterRound, NO_MAJORITY): RandomnessFarcasterRound 28 | (SelectKeeperFarcasterRound, ROUND_TIMEOUT): RandomnessFarcasterRound 29 | -------------------------------------------------------------------------------- /packages/valory/skills/farcaster_write_abci/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the shared state for the abci skill of FarcasterWriteAbciApp.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.models import ApiSpecs, BaseParams 23 | from packages.valory.skills.abstract_round_abci.models import ( 24 | BenchmarkTool as BaseBenchmarkTool, 25 | ) 26 | from packages.valory.skills.abstract_round_abci.models import Requests as BaseRequests 27 | from packages.valory.skills.abstract_round_abci.models import ( 28 | SharedState as BaseSharedState, 29 | ) 30 | from packages.valory.skills.farcaster_write_abci.rounds import FarcasterWriteAbciApp 31 | 32 | 33 | class SharedState(BaseSharedState): 34 | """Keep the current shared state of the skill.""" 35 | 36 | abci_app_cls = FarcasterWriteAbciApp 37 | 38 | 39 | class Params(BaseParams): 40 | """Parameters.""" 41 | 42 | class RandomnessApi(ApiSpecs): 43 | """A model that wraps ApiSpecs for randomness api specifications.""" 44 | 45 | Requests = BaseRequests 46 | BenchmarkTool = BaseBenchmarkTool 47 | -------------------------------------------------------------------------------- /packages/valory/skills/farcaster_write_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the FarcasterWriteAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class RandomnessPayload(BaseTxPayload): 29 | """Represent a transaction payload of type 'randomness'.""" 30 | 31 | round_id: int 32 | randomness: str 33 | 34 | 35 | @dataclass(frozen=True) 36 | class SelectKeeperPayload(BaseTxPayload): 37 | """Represent a transaction payload of type 'select_keeper'.""" 38 | 39 | keeper: str 40 | 41 | 42 | @dataclass(frozen=True) 43 | class FarcasterWritePayload(BaseTxPayload): 44 | """Represent a transaction payload for the FarcasterWriteRound.""" 45 | 46 | content: str 47 | 48 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/generic_scoring_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - DONE 3 | - NO_MAJORITY 4 | - ROUND_TIMEOUT 5 | default_start_state: GenericScoringRound 6 | final_states: 7 | - FinishedGenericScoringRound 8 | label: GenericScoringAbciApp 9 | start_states: 10 | - GenericScoringRound 11 | states: 12 | - FinishedGenericScoringRound 13 | - GenericScoringRound 14 | transition_func: 15 | (GenericScoringRound, DONE): FinishedGenericScoringRound 16 | (GenericScoringRound, NO_MAJORITY): GenericScoringRound 17 | (GenericScoringRound, ROUND_TIMEOUT): GenericScoringRound 18 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the shared state for the abci skill of GenericScoringAbciApp.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.models import BaseParams 23 | from packages.valory.skills.abstract_round_abci.models import ( 24 | BenchmarkTool as BaseBenchmarkTool, 25 | ) 26 | from packages.valory.skills.abstract_round_abci.models import Requests as BaseRequests 27 | from packages.valory.skills.decision_making_abci.models import ( 28 | CeramicDB as BaseCeramicDB, 29 | ) 30 | from packages.valory.skills.decision_making_abci.models import ( 31 | SharedState as BaseSharedState, 32 | ) 33 | from packages.valory.skills.generic_scoring_abci.rounds import GenericScoringAbciApp 34 | 35 | 36 | class SharedState(BaseSharedState): 37 | """Keep the current shared state of the skill.""" 38 | 39 | abci_app_cls = GenericScoringAbciApp 40 | 41 | 42 | Params = BaseParams 43 | Requests = BaseRequests 44 | BenchmarkTool = BaseBenchmarkTool 45 | CeramicDB = BaseCeramicDB 46 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the GenericScoringAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class GenericScoringPayload(BaseTxPayload): 29 | """Represent a transaction payload for the GenericScoringRound.""" 30 | 31 | content: str 32 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the generic scoring skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the GenericScoring.""" 21 | 22 | import packages.valory.skills.generic_scoring_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the GenericScoring can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the GenericScoring.""" 21 | 22 | import packages.valory.skills.generic_scoring_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the GenericScoring can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/generic_scoring_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the GenericScoring.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.generic_scoring_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of GenericScoring.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /packages/valory/skills/impact_evaluator_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the impact evaluator skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/impact_evaluator_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/impact_evaluator_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the tests for the contribution skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/impact_evaluator_abci/tests/test_behaviours.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | # pylint: skip-file 20 | 21 | """This package contains round behaviours of the contribution skill.""" 22 | from packages.valory.skills.impact_evaluator_abci.behaviours import ( # noqa 23 | ImpactEvaluatorConsensusBehaviour, 24 | ) 25 | 26 | 27 | def test_import() -> None: 28 | """Test that the 'behaviours.py' of the contribution skill can be imported.""" 29 | -------------------------------------------------------------------------------- /packages/valory/skills/impact_evaluator_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the contribution skill.""" 21 | 22 | import packages.valory.skills.impact_evaluator_abci.dialogues # pylint: disable=unused-import # noqa: F401 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the contribution skill can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/impact_evaluator_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the contribution skill.""" 21 | 22 | import packages.valory.skills.impact_evaluator_abci.handlers # pylint: disable=unused-import # noqa: F401 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the contribution skill can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the llm skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/llm_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - DID_NOT_SEND 3 | - DONE 4 | - DONE_CONTINUE 5 | - DONE_FINISHED 6 | - NO_MAJORITY 7 | - ROUND_TIMEOUT 8 | default_start_state: LLMRandomnessRound 9 | final_states: 10 | - FinishedLLMRound 11 | label: LLMAbciApp 12 | start_states: 13 | - LLMRandomnessRound 14 | states: 15 | - FinishedLLMRound 16 | - LLMRandomnessRound 17 | - LLMRound 18 | - LLMSelectKeeperRound 19 | transition_func: 20 | (LLMRandomnessRound, DONE): LLMSelectKeeperRound 21 | (LLMRandomnessRound, NO_MAJORITY): LLMRandomnessRound 22 | (LLMRandomnessRound, ROUND_TIMEOUT): LLMRandomnessRound 23 | (LLMRound, DID_NOT_SEND): LLMRandomnessRound 24 | (LLMRound, DONE_CONTINUE): LLMRound 25 | (LLMRound, DONE_FINISHED): FinishedLLMRound 26 | (LLMRound, ROUND_TIMEOUT): LLMRandomnessRound 27 | (LLMSelectKeeperRound, DONE): LLMRound 28 | (LLMSelectKeeperRound, NO_MAJORITY): LLMRandomnessRound 29 | (LLMSelectKeeperRound, ROUND_TIMEOUT): LLMRandomnessRound 30 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the shared state for the abci skill of ProposalVoterAbciApp.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.models import ApiSpecs, BaseParams 23 | from packages.valory.skills.abstract_round_abci.models import ( 24 | BenchmarkTool as BaseBenchmarkTool, 25 | ) 26 | from packages.valory.skills.abstract_round_abci.models import Requests as BaseRequests 27 | from packages.valory.skills.abstract_round_abci.models import ( 28 | SharedState as BaseSharedState, 29 | ) 30 | from packages.valory.skills.llm_abci.rounds import LLMAbciApp 31 | 32 | 33 | class SharedState(BaseSharedState): 34 | """Keep the current shared state of the skill.""" 35 | 36 | abci_app_cls = LLMAbciApp 37 | 38 | 39 | class RandomnessApi(ApiSpecs): 40 | """A model that wraps ApiSpecs for randomness api specifications.""" 41 | 42 | 43 | Params = BaseParams 44 | Requests = BaseRequests 45 | BenchmarkTool = BaseBenchmarkTool 46 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the ProposalVoterAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class RandomnessPayload(BaseTxPayload): 29 | """Represent a transaction payload of type 'randomness'.""" 30 | 31 | round_id: int 32 | randomness: str 33 | 34 | 35 | @dataclass(frozen=True) 36 | class SelectKeeperPayload(BaseTxPayload): 37 | """Represent a transaction payload of type 'select_keeper'.""" 38 | 39 | keeper: str 40 | 41 | 42 | @dataclass(frozen=True) 43 | class LLMPayload(BaseTxPayload): 44 | """Represent a transaction payload for the SettingsManager.""" 45 | 46 | content: str 47 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the llm skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the CeramicRead.""" 21 | 22 | import packages.valory.skills.llm_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the CeramicRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the CeramicRead.""" 21 | 22 | import packages.valory.skills.llm_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the CeramicRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the CeramicRead.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.llm_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of CeramicRead.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /packages/valory/skills/llm_abci/tests/test_payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains payload tests for the CeramicReadAbciApp.""" 21 | 22 | from packages.valory.skills.llm_abci.payloads import ( 23 | LLMPayload, 24 | RandomnessPayload, 25 | SelectKeeperPayload, 26 | ) 27 | 28 | 29 | def test_randomness() -> None: 30 | """Tests for payloads""" 31 | 32 | payload = RandomnessPayload( 33 | sender="sender", 34 | round_id=1, 35 | randomness="randomness", 36 | ) 37 | assert payload.sender == "sender" 38 | assert payload.round_id == 1 39 | assert payload.randomness == "randomness" 40 | 41 | 42 | def test_select_keeper() -> None: 43 | """Tests for payloads""" 44 | 45 | payload = SelectKeeperPayload( 46 | sender="sender", 47 | keeper="keeper", 48 | ) 49 | assert payload.sender == "sender" 50 | assert payload.keeper == "keeper" 51 | 52 | 53 | def test_llm() -> None: 54 | """Tests for payloads""" 55 | 56 | payload = LLMPayload( 57 | sender="sender", 58 | content="content", 59 | ) 60 | assert payload.sender == "sender" 61 | assert payload.content == "content" 62 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the mech interact skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/mech_interact_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/behaviours/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains the behaviours for the mech interact skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/behaviours/round_behaviour.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains the round behaviour of MechInteractAbciApp.""" 21 | 22 | from typing import Set, Type 23 | 24 | from packages.valory.skills.abstract_round_abci.behaviour_utils import BaseBehaviour 25 | from packages.valory.skills.abstract_round_abci.behaviours import AbstractRoundBehaviour 26 | from packages.valory.skills.mech_interact_abci.behaviours.request import ( 27 | MechRequestBehaviour, 28 | ) 29 | from packages.valory.skills.mech_interact_abci.behaviours.response import ( 30 | MechResponseBehaviour, 31 | ) 32 | from packages.valory.skills.mech_interact_abci.rounds import MechInteractAbciApp 33 | 34 | 35 | class MechInteractRoundBehaviour(AbstractRoundBehaviour): 36 | """MechInteractRoundBehaviour""" 37 | 38 | initial_behaviour_cls = MechRequestBehaviour 39 | abci_app_cls = MechInteractAbciApp # type: ignore 40 | behaviours: Set[Type[BaseBehaviour]] = {MechRequestBehaviour, MechResponseBehaviour} 41 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - DONE 3 | - NO_MAJORITY 4 | - ROUND_TIMEOUT 5 | - SKIP_REQUEST 6 | default_start_state: MechRequestRound 7 | final_states: 8 | - FinishedMechRequestRound 9 | - FinishedMechRequestSkipRound 10 | - FinishedMechResponseRound 11 | - FinishedMechResponseTimeoutRound 12 | label: MechInteractAbciApp 13 | start_states: 14 | - MechRequestRound 15 | - MechResponseRound 16 | states: 17 | - FinishedMechRequestRound 18 | - FinishedMechRequestSkipRound 19 | - FinishedMechResponseRound 20 | - FinishedMechResponseTimeoutRound 21 | - MechRequestRound 22 | - MechResponseRound 23 | transition_func: 24 | (MechRequestRound, DONE): FinishedMechRequestRound 25 | (MechRequestRound, NO_MAJORITY): MechRequestRound 26 | (MechRequestRound, ROUND_TIMEOUT): MechRequestRound 27 | (MechRequestRound, SKIP_REQUEST): FinishedMechRequestSkipRound 28 | (MechResponseRound, DONE): FinishedMechResponseRound 29 | (MechResponseRound, NO_MAJORITY): MechResponseRound 30 | (MechResponseRound, ROUND_TIMEOUT): FinishedMechResponseTimeoutRound 31 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2025 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the MechInteractAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | from typing import Optional 24 | 25 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 26 | 27 | 28 | @dataclass(frozen=True) 29 | class MechRequestPayload(BaseTxPayload): 30 | """Represent a transaction payload for the MechRequestRound.""" 31 | 32 | tx_submitter: Optional[str] 33 | tx_hash: Optional[str] 34 | price: Optional[int] 35 | chain_id: Optional[str] 36 | safe_contract_address: Optional[str] 37 | mech_requests: Optional[str] 38 | mech_responses: Optional[str] 39 | marketplace_compatibility_cache: Optional[str] # ToDO 40 | 41 | 42 | @dataclass(frozen=True) 43 | class MechResponsePayload(BaseTxPayload): 44 | """Represent a transaction payload for the MechResponseRound.""" 45 | 46 | mech_responses: str 47 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/states/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains the rounds for the mech interact abci skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/states/final_states.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the final states of the mech interact abci app.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.base import DegenerateRound 23 | 24 | 25 | class FinishedMechRequestRound(DegenerateRound): 26 | """FinishedMechRequestRound""" 27 | 28 | 29 | class FinishedMechRequestSkipRound(DegenerateRound): 30 | """FinishedMechRequestSkipRound""" 31 | 32 | 33 | class FinishedMechResponseRound(DegenerateRound): 34 | """FinishedMechResponseRound""" 35 | 36 | 37 | class FinishedMechResponseTimeoutRound(DegenerateRound): 38 | """FinishedMechResponseTimeoutRound""" 39 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/states/response.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the response state of the mech interaction abci app.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.base import get_name 23 | from packages.valory.skills.mech_interact_abci.payloads import MechResponsePayload 24 | from packages.valory.skills.mech_interact_abci.states.base import ( 25 | MechInteractionRound, 26 | SynchronizedData, 27 | ) 28 | 29 | 30 | class MechResponseRound(MechInteractionRound): 31 | """A round for collecting the responses from a Mech.""" 32 | 33 | payload_class = MechResponsePayload 34 | selection_key = get_name(SynchronizedData.mech_responses) 35 | collection_key = get_name(SynchronizedData.participant_to_responses) 36 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Tests for the mech interact abci skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the MechInteract.""" 21 | 22 | import packages.valory.skills.mech_interact_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the MechInteract can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the MechInteract.""" 21 | 22 | import packages.valory.skills.mech_interact_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the MechInteract can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the MechInteract.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.mech_interact_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of MechInteract.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/tests/test_payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This package contains payload tests for the MechInteractAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | from typing import Hashable, Type 24 | 25 | import pytest 26 | 27 | from packages.valory.skills.mech_interact_abci.payloads import BaseTxPayload 28 | 29 | 30 | @dataclass 31 | class PayloadTestCase: 32 | """PayloadTestCase""" 33 | 34 | name: str 35 | payload_cls: Type[BaseTxPayload] 36 | content: Hashable 37 | 38 | 39 | # TODO: provide test cases 40 | @pytest.mark.parametrize("test_case", []) 41 | def test_payloads(test_case: PayloadTestCase) -> None: 42 | """Tests for MechInteractAbciApp payloads""" 43 | 44 | payload = test_case.payload_cls(sender="sender", content=test_case.content) 45 | assert payload.sender == "sender" 46 | assert payload.from_json(payload.json) == payload 47 | -------------------------------------------------------------------------------- /packages/valory/skills/mech_interact_abci/utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2025 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains utility functions and classes for the mech interact abci skill.""" 21 | 22 | import json 23 | from dataclasses import asdict, is_dataclass 24 | from typing import Any 25 | 26 | 27 | class DataclassEncoder(json.JSONEncoder): 28 | """A custom JSON encoder for dataclasses.""" 29 | 30 | def default(self, o: Any) -> Any: 31 | """The default JSON encoder.""" 32 | if is_dataclass(o) and not isinstance(o, type): 33 | result = asdict(o) 34 | # Ensure important fields are preserved even if they have default values 35 | if hasattr(o, "requestId") and o.requestId != 0: 36 | result["requestId"] = o.requestId 37 | if hasattr(o, "result") and o.result is not None: 38 | result["result"] = o.result 39 | return result 40 | return super().default(o) 41 | -------------------------------------------------------------------------------- /packages/valory/skills/olas_week_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/olas_week_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/olas_week_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the OlasWeek skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/olas_week_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the OlasWeek.""" 21 | from enum import Enum 22 | from typing import Type, cast 23 | from unittest.mock import MagicMock 24 | 25 | import pytest 26 | from aea.protocols.dialogue.base import Dialogues 27 | 28 | from packages.valory.skills.olas_week_abci.dialogues import LlmDialogue, LlmDialogues 29 | 30 | 31 | @pytest.mark.parametrize( 32 | "dialogues_cls,expected_role_from_first_message", 33 | [ 34 | (LlmDialogues, LlmDialogue.Role.SKILL), 35 | ], 36 | ) 37 | def test_dialogues_creation( 38 | dialogues_cls: Type[LlmDialogues], expected_role_from_first_message: Enum 39 | ) -> None: 40 | """Test XDialogues creations.""" 41 | dialogues = cast(Dialogues, dialogues_cls(name="", skill_context=MagicMock())) 42 | assert ( 43 | expected_role_from_first_message 44 | == dialogues._role_from_first_message( # pylint: disable=protected-access 45 | MagicMock(), MagicMock() 46 | ) 47 | ) 48 | -------------------------------------------------------------------------------- /packages/valory/skills/olas_week_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023-2024 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the OlasWeek.""" 21 | 22 | import packages.valory.skills.olas_week_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the OlasWeek can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/staking_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - DONE 3 | - NO_MAJORITY 4 | - PROCESS_UPDATES 5 | - ROUND_TIMEOUT 6 | default_start_state: ActivityScoreRound 7 | final_states: 8 | - FinishedActivityRound 9 | - FinishedActivityUpdatePreparationRound 10 | - FinishedCheckpointPreparationRound 11 | - FinishedDAAPreparationRound 12 | label: StakingAbciApp 13 | start_states: 14 | - ActivityScoreRound 15 | - CheckpointPreparationRound 16 | - DAAPreparationRound 17 | states: 18 | - ActivityScoreRound 19 | - ActivityUpdatePreparationRound 20 | - CheckpointPreparationRound 21 | - DAAPreparationRound 22 | - FinishedActivityRound 23 | - FinishedActivityUpdatePreparationRound 24 | - FinishedCheckpointPreparationRound 25 | - FinishedDAAPreparationRound 26 | transition_func: 27 | (ActivityScoreRound, DONE): FinishedActivityRound 28 | (ActivityScoreRound, NO_MAJORITY): ActivityScoreRound 29 | (ActivityScoreRound, PROCESS_UPDATES): ActivityUpdatePreparationRound 30 | (ActivityScoreRound, ROUND_TIMEOUT): ActivityScoreRound 31 | (ActivityUpdatePreparationRound, DONE): FinishedActivityUpdatePreparationRound 32 | (ActivityUpdatePreparationRound, NO_MAJORITY): ActivityUpdatePreparationRound 33 | (ActivityUpdatePreparationRound, ROUND_TIMEOUT): ActivityUpdatePreparationRound 34 | (CheckpointPreparationRound, DONE): FinishedCheckpointPreparationRound 35 | (CheckpointPreparationRound, NO_MAJORITY): CheckpointPreparationRound 36 | (CheckpointPreparationRound, ROUND_TIMEOUT): CheckpointPreparationRound 37 | (DAAPreparationRound, DONE): FinishedDAAPreparationRound 38 | (DAAPreparationRound, NO_MAJORITY): DAAPreparationRound 39 | (DAAPreparationRound, ROUND_TIMEOUT): DAAPreparationRound 40 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_scoring_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/twitter_scoring_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_scoring_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the tests for the twitter_scoring_abci skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_scoring_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the ScoreRead.""" 21 | 22 | import packages.valory.skills.twitter_scoring_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the ScoreRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_scoring_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the ScoreRead.""" 21 | 22 | import packages.valory.skills.twitter_scoring_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the ScoreRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the implementation of the default skill.""" 21 | 22 | from aea.configurations.base import PublicId 23 | 24 | 25 | PUBLIC_ID = PublicId.from_str("valory/twitter_write_abci:0.1.0") 26 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/fsm_specification.yaml: -------------------------------------------------------------------------------- 1 | alphabet_in: 2 | - API_ERROR 3 | - CONTINUE 4 | - DONE 5 | - NO_MAJORITY 6 | - ROUND_TIMEOUT 7 | default_start_state: RandomnessTwitterRound 8 | final_states: 9 | - FinishedTwitterWriteRound 10 | label: TwitterWriteAbciApp 11 | start_states: 12 | - RandomnessTwitterRound 13 | states: 14 | - FinishedTwitterWriteRound 15 | - RandomnessTwitterRound 16 | - SelectKeeperTwitterRound 17 | - TwitterWriteRound 18 | transition_func: 19 | (RandomnessTwitterRound, DONE): SelectKeeperTwitterRound 20 | (RandomnessTwitterRound, NO_MAJORITY): RandomnessTwitterRound 21 | (RandomnessTwitterRound, ROUND_TIMEOUT): RandomnessTwitterRound 22 | (SelectKeeperTwitterRound, DONE): TwitterWriteRound 23 | (SelectKeeperTwitterRound, NO_MAJORITY): RandomnessTwitterRound 24 | (SelectKeeperTwitterRound, ROUND_TIMEOUT): RandomnessTwitterRound 25 | (TwitterWriteRound, API_ERROR): RandomnessTwitterRound 26 | (TwitterWriteRound, CONTINUE): TwitterWriteRound 27 | (TwitterWriteRound, DONE): FinishedTwitterWriteRound 28 | (TwitterWriteRound, ROUND_TIMEOUT): RandomnessTwitterRound 29 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/payloads.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains the transaction payloads of the TwitterWriteAbciApp.""" 21 | 22 | from dataclasses import dataclass 23 | 24 | from packages.valory.skills.abstract_round_abci.base import BaseTxPayload 25 | 26 | 27 | @dataclass(frozen=True) 28 | class RandomnessPayload(BaseTxPayload): 29 | """Represent a transaction payload of type 'randomness'.""" 30 | 31 | round_id: int 32 | randomness: str 33 | 34 | 35 | @dataclass(frozen=True) 36 | class SelectKeeperPayload(BaseTxPayload): 37 | """Represent a transaction payload of type 'select_keeper'.""" 38 | 39 | keeper: str 40 | 41 | 42 | @dataclass(frozen=True) 43 | class TwitterWritePayload(BaseTxPayload): 44 | """Represent a transaction payload for the TwitterWriteRound.""" 45 | 46 | content: str 47 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This module contains tests for the twitter write skill.""" 21 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/tests/test_dialogues.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the dialogues.py module of the CeramicRead.""" 21 | 22 | import packages.valory.skills.twitter_write_abci.dialogues # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'dialogues.py' of the CeramicRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/tests/test_handlers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the handlers.py module of the CeramicRead.""" 21 | 22 | import packages.valory.skills.twitter_write_abci.handlers # noqa 23 | 24 | 25 | def test_import() -> None: 26 | """Test that the 'handlers.py' of the CeramicRead can be imported.""" 27 | -------------------------------------------------------------------------------- /packages/valory/skills/twitter_write_abci/tests/test_models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """Test the models.py module of the CeramicRead.""" 21 | 22 | from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext 23 | from packages.valory.skills.twitter_write_abci.models import SharedState 24 | 25 | 26 | class TestSharedState: 27 | """Test SharedState of CeramicRead.""" 28 | 29 | def test_initialization(self) -> None: 30 | """Test initialization.""" 31 | SharedState(name="", skill_context=DummyContext()) 32 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | log_cli = 1 3 | log_cli_level = DEBUG 4 | log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s) 5 | log_cli_date_format=%Y-%m-%d %H:%M:%S 6 | 7 | markers = 8 | integration: marks end-to-end tests which require the oef, soef, ledger or other network services 9 | unstable: marks test as unstable (won't be run in CI) 10 | ledger: marks tests which require ledger test networks (ethereum, cosmos, fetchai); these tests should also be marked 'integration' 11 | flaky: marks tests which are flaky and worth re-running 12 | sync: marks test for run in sync mode 13 | profiling: marks profiler tests that must be run separately to avoid garbage collector interferences 14 | 15 | filterwarnings = 16 | ignore:the imp module is deprecated in favour of importlib:DeprecationWarning 17 | ignore:Call to deprecated create function FileDescriptor(). 18 | ignore:Call to deprecated create function Descriptor(). 19 | ignore:Call to deprecated create function FieldDescriptor(). 20 | ignore:Call to deprecated create function EnumValueDescriptor(). 21 | ignore:Call to deprecated create function EnumDescriptor(). 22 | ignore:The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file. 23 | ignore:'resultcallback' has been renamed to 'result_callback'. The old name will be removed in Click 8.1. 24 | ignore:There is no current event loop 25 | ignore::DeprecationWarning 26 | -------------------------------------------------------------------------------- /run_agent.sh: -------------------------------------------------------------------------------- 1 | cleanup() { 2 | echo "Terminating tendermint..." 3 | if kill -0 "$tm_subprocess_pid" 2>/dev/null; then 4 | kill "$tm_subprocess_pid" 5 | wait "$tm_subprocess_pid" 2>/dev/null 6 | fi 7 | echo "Tendermint terminated" 8 | } 9 | 10 | # Load env vars 11 | source .env 12 | repo_path=$PWD 13 | 14 | # Link cleanup to the exit signal 15 | trap cleanup EXIT 16 | 17 | # Remove previous agent if exists 18 | if test -d impact_evaluator; then 19 | echo "Removing previous agent build" 20 | rm -r impact_evaluator 21 | fi 22 | 23 | # Remove empty directories to avoid wrong hashes 24 | find . -empty -type d -delete 25 | 26 | # Ensure that third party packages are correctly synced 27 | make clean 28 | AUTONOMY_VERSION=v$(autonomy --version | grep -oP '(?<=version\s)\S+') 29 | AEA_VERSION=v$(aea --version | grep -oP '(?<=version\s)\S+') 30 | autonomy packages sync --source valory-xyz/open-aea:$AEA_VERSION --source valory-xyz/open-autonomy:$AUTONOMY_VERSION --update-packages 31 | 32 | # Ensure hashes are updated 33 | autonomy packages lock 34 | 35 | # Fetch the agent 36 | autonomy fetch --local --agent valory/impact_evaluator 37 | 38 | # Replace params with env vars 39 | source .env 40 | python scripts/aea-config-replace.py 41 | 42 | # Copy and add the keys and issue certificates 43 | cd impact_evaluator 44 | cp $PWD/../ethereum_private_key.txt . 45 | autonomy add-key ethereum ethereum_private_key.txt 46 | autonomy issue-certificates 47 | 48 | # Run tendermint 49 | rm -r ~/.tendermint 50 | tendermint init > /dev/null 2>&1 51 | echo "Starting Tendermint..." 52 | tendermint node --proxy_app=tcp://127.0.0.1:26658 --rpc.laddr=tcp://127.0.0.1:26657 --p2p.laddr=tcp://0.0.0.0:26656 --p2p.seeds= --consensus.create_empty_blocks=true > /dev/null 2>&1 & 53 | tm_subprocess_pid=$! 54 | 55 | # Run the agent 56 | aea -s run -------------------------------------------------------------------------------- /run_farcaster_test.sh: -------------------------------------------------------------------------------- 1 | rm -r farcaster_test 2 | find . -empty -type d -delete # remove empty directories to avoid wrong hashes 3 | autonomy packages lock 4 | autonomy fetch --local --agent valory/farcaster_test && cd farcaster_test 5 | 6 | # Replace aea-config with the configured one 7 | aeaconfig="/home/david/Cloud/env/contribute/farcaster-aea-config.yaml" 8 | if [ -e "$aeaconfig" ]; then 9 | cp $aeaconfig ./aea-config.yaml 10 | fi 11 | 12 | cp $PWD/../ethereum_private_key.txt . 13 | autonomy add-key ethereum ethereum_private_key.txt 14 | autonomy issue-certificates 15 | aea -s run -------------------------------------------------------------------------------- /run_service.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | REPO_PATH=$PWD 4 | 5 | # Remove previous service build 6 | if test -d impact_evaluator; then 7 | echo "Removing previous service build" 8 | sudo rm -r impact_evaluator 9 | fi 10 | 11 | # Push packages and fetch service 12 | make clean 13 | 14 | autonomy push-all 15 | 16 | autonomy fetch --local --service valory/impact_evaluator && cd impact_evaluator 17 | 18 | # Build the image 19 | autonomy init --reset --author valory --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https" 20 | autonomy build-image 21 | 22 | # Copy .env file 23 | cp $REPO_PATH/.env . 24 | 25 | # Copy the keys and build the deployment 26 | cp $REPO_PATH/keys.json . 27 | autonomy deploy build -ltm 28 | 29 | # Run the deployment 30 | folder_name=$(ls -d abci_build_????/) 31 | autonomy deploy run --build-dir $folder_name -------------------------------------------------------------------------------- /run_service_single.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | REPO_PATH=$PWD 4 | 5 | export $(grep -v '^#' .1env | xargs) 6 | 7 | # Remove previous service build 8 | if test -d impact_evaluator_local; then 9 | echo "Removing previous service build" 10 | sudo rm -r impact_evaluator_local 11 | fi 12 | 13 | # Push packages and fetch service 14 | make clean 15 | 16 | autonomy push-all 17 | 18 | autonomy fetch --local --service valory/impact_evaluator_local && cd impact_evaluator_local 19 | 20 | # Build the image 21 | autonomy init --reset --author valory --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https" 22 | autonomy build-image 23 | 24 | # Copy .env file 25 | cp $REPO_PATH/.env . 26 | 27 | # Copy the keys and build the deployment 28 | cp $REPO_PATH/keys1.json ./keys.json 29 | autonomy deploy build -ltm 30 | 31 | # Run the deployment 32 | folder_name=$(ls -d abci_build_????/) 33 | autonomy deploy run --build-dir $folder_name -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------------ 3 | # 4 | # Copyright 2021-2023 Valory AG 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # ------------------------------------------------------------------------------ 19 | 20 | """This directory contains scripts for workflow automation and project maintenance.""" 21 | -------------------------------------------------------------------------------- /scripts/ceramic/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2024 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | -------------------------------------------------------------------------------- /scripts/ceramic/schemas/default_db_stream.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": { 3 | "2146": { 4 | "points": 101500, 5 | "token_id": "187", 6 | "discord_id": null, 7 | "twitter_id": "1761132611533934592", 8 | "discord_handle": null, 9 | "twitter_handle": "tsunami_0x", 10 | "wallet_address": null, 11 | "service_multisig": null, 12 | "service_id": null, 13 | "tweets": { 14 | "1773360094882697540": { 15 | "points": 100, 16 | "campaign": "OlasNetwork", 17 | "epoch": 1, 18 | "timestamp": "1761132611533934592", 19 | "counted_for_activity": false 20 | } 21 | } 22 | } 23 | }, 24 | "module_data": { 25 | "generic": { 26 | "latest_update_id": "0" 27 | }, 28 | "twitter": { 29 | "current_period": "2024-02-02", 30 | "latest_hashtag_tweet_id": "1753121332232061266", 31 | "latest_mention_tweet_id": "1753440222279307363", 32 | "last_tweet_pull_window_reset": "1706883725.160153", 33 | "number_of_tweets_pulled_today": "0" 34 | }, 35 | "dynamic_nft": { 36 | "last_parsed_block": "0" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /scripts/ceramic/schemas/default_generic_points_stream.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": {}, 3 | "module_data": { 4 | "generic": { 5 | "latest_update_id": 0 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /scripts/ceramic/schemas/generic_points_stream_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema", 3 | "definitions": { 4 | "user": { 5 | "type": "object", 6 | "properties": { 7 | "points": { 8 | "type": "integer" 9 | }, 10 | "discord_id": { 11 | "type": "string" 12 | }, 13 | "discord_handle": { 14 | "type": "string" 15 | }, 16 | "wallet_address": { 17 | "type": "string" 18 | } 19 | }, 20 | "required": ["points", "discord_id", "discord_handle", "wallet_address"], 21 | "additionalProperties": false 22 | } 23 | }, 24 | "type": "object", 25 | "properties": { 26 | "users": { 27 | "type": "object", 28 | "patternProperties": { 29 | "^[0-9]+$": { 30 | "$ref": "#/definitions/user" 31 | } 32 | } 33 | }, 34 | "module_data": { 35 | "type": "object", 36 | "properties": { 37 | "generic": { 38 | "type": "object", 39 | "properties": { 40 | "latest_update_id": { 41 | "type": "integer" 42 | } 43 | }, 44 | "required": ["latest_update_id"], 45 | "additionalProperties": false 46 | } 47 | }, 48 | "required": ["generic"], 49 | "additionalProperties": false 50 | } 51 | }, 52 | "required": ["users", "module_data"], 53 | "additionalProperties": false 54 | } -------------------------------------------------------------------------------- /scripts/ceramic_hello_world.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2025 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | """Hello world""" 22 | 23 | import json 24 | import os 25 | 26 | from ceramic.ceramic import Ceramic # pylint: disable=import-error 27 | 28 | 29 | DUMMY_DID = { 30 | "did": "did:key:z6MkszfuezSP8ftgHRhMr8AX8uyTjtKpcia4bP19TBgmhEPs", 31 | "seed": "9a683e9b21777b5b159974c35c4766bc0c4522855aefc8de30876dbaa252f179" 32 | } 33 | 34 | ceramic = Ceramic(os.getenv("CERAMIC_API_BASE")) 35 | 36 | # CREATE 37 | print("Creating stream...") 38 | stream_data = {"hello": "world"} 39 | stream_id = ceramic.create_stream( 40 | DUMMY_DID["did"], 41 | DUMMY_DID["seed"], 42 | stream_data, 43 | ) 44 | 45 | # READ 46 | print("Reading stream...") 47 | data, _, _ = ceramic.get_data(stream_id) 48 | print(json.dumps(data, indent=4)) 49 | 50 | # UPDATE 51 | print("Updating stream...") 52 | new_data = {"foo": "bar"} 53 | ceramic.update_stream( 54 | DUMMY_DID["did"], 55 | DUMMY_DID["seed"], 56 | stream_id, 57 | new_data, 58 | ) 59 | 60 | # READ 61 | print("Reading stream...") 62 | data, _, _ = ceramic.get_data(stream_id) 63 | print(json.dumps(data, indent=4)) 64 | -------------------------------------------------------------------------------- /scripts/fix_ceramic_epochs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2025 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | """Fix epochs""" 22 | 23 | import json 24 | 25 | 26 | with open("contribute_db.json", "r", encoding="utf-8") as db_file: 27 | data = json.load(db_file) 28 | 29 | 30 | for user_id, user_data in data["users"].items(): 31 | for tweet_id, tweet in user_data["tweets"].items(): 32 | if tweet["epoch"] and tweet["epoch"] > 38: 33 | print(f"Tweet {tweet_id} from user {user_data['twitter_handle']}: {tweet['epoch']} -> {38}") 34 | tweet["epoch"] = 38 35 | 36 | 37 | with open("contribute_db.json", "w", encoding="utf-8") as db_file: 38 | json.dump(data, db_file, indent=4) 39 | -------------------------------------------------------------------------------- /scripts/read_stream.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2024 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | """This package contains code to read streams on Ceramic.""" 22 | # pylint: disable=import-error 23 | 24 | import json 25 | import os 26 | 27 | import dotenv 28 | from ceramic.ceramic import Ceramic 29 | 30 | 31 | dotenv.load_dotenv(override=True) 32 | 33 | ceramic = Ceramic(os.getenv("CERAMIC_API_BASE")) 34 | 35 | stream_id = os.getenv("CERAMIC_DB_STREAM_ID") 36 | 37 | # Get the data 38 | data, _, _ = ceramic.get_data(stream_id) 39 | 40 | # Save to json 41 | with open("stream.json", "w", encoding="utf-8") as out_file: 42 | json.dump(data, out_file, indent=4) 43 | 44 | print(f"Done reading stream {stream_id}") 45 | -------------------------------------------------------------------------------- /scripts/update_stream.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021-2025 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | """This package contains code to update streams on Ceramic.""" 22 | # pylint: disable=import-error 23 | 24 | import json 25 | import os 26 | 27 | import dotenv 28 | from ceramic.ceramic import Ceramic 29 | from ceramic.streams import ( # pylint: disable=unused-import 30 | CONTRIBUTE_PROD_CENTAURS_STREAM_ID, 31 | CONTRIBUTE_PROD_DB_STREAM_ID, 32 | ) 33 | 34 | 35 | dotenv.load_dotenv(override=True) 36 | 37 | ceramic = Ceramic(os.getenv("CERAMIC_API_BASE")) 38 | ceramic_did_str = "did:key:" + str(os.getenv("CERAMIC_DID_STR")) 39 | ceramic_did_seed = os.getenv("CERAMIC_DID_SEED") 40 | 41 | stream_id = os.getenv("CERAMIC_DB_STREAM_ID") 42 | 43 | # Load from json 44 | with open("stream.json", "r", encoding="utf-8") as inf: 45 | new_data = json.load(inf) 46 | 47 | # Update stream 48 | ceramic.update_stream( 49 | ceramic_did_str, 50 | ceramic_did_seed, 51 | stream_id, 52 | new_data, 53 | ) 54 | 55 | print("Done") 56 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # ------------------------------------------------------------------------------ 4 | # 5 | # Copyright 2021 Valory AG 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | # ------------------------------------------------------------------------------ 20 | 21 | from setuptools import find_packages, setup 22 | 23 | 24 | if __name__ == "__main__": 25 | setup(packages=[]) 26 | 27 | 28 | 29 | 30 | 31 | 32 | --------------------------------------------------------------------------------