Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new event listener automation package #726

Merged
merged 48 commits into from
Dec 23, 2024

Conversation

FedericoAmura
Copy link
Contributor

@FedericoAmura FedericoAmura commented Nov 27, 2024

Description

This PR adds a new top-level package (no other package depends on this) used to define automations.

It uses a state machine to move between states based on conditions that every state continuously monitors

  • states execute one time actions
  • listeners monitor things onchain or offchain
  • transitions move machine between states based on their contained listeners

State machine is designed to allow for a functional interface that has no boundaries and therefore can do anything but also has a declarative interface that allows a client to send a machine definition over the wire to a long running server
Declarative interface can be extended with new types of states(actions) or transitions by adding their corresponding code that builds the final machine

For examples and more doc check the README file

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests
  • Manual testing automatizations included in README as examples

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…ck and the onMatch/onMismatch functions. Fixes when multiple events trigger transitions at nearly the same time
- move pkp config to context to allow for dynamic switching of pkps
- add support from capacityCreditTokens and therefore paid Lit networks
- add pkp and capacity credit nft minting states
- restricted state machine public interface
- use verrors in remaining normal errors
…ipulating methods to be used in functional interface
@Ansonhkg Ansonhkg changed the title feat: new automation package feat: new event listener automation package Dec 20, 2024
Copy link
Collaborator

@Ansonhkg Ansonhkg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very exciting! LGTM!

@FedericoAmura FedericoAmura merged commit b599a54 into master Dec 23, 2024
5 checks passed
@FedericoAmura FedericoAmura deleted the feature/lit-4031-new-listener-sdk branch December 23, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants