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: add new JSON format for Workflows #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

extg3
Copy link
Contributor

@extg3 extg3 commented Jun 25, 2024

No description provided.

ARCHITECTURE.md Outdated
- **type**: Specifies a multi-send action by the application.
- **options**:
- **items**: An array of objects representing the assets to be sent, each containing:
- **asset**: An object representing the ERC20 token, or `null` for native tokens.
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to make it optional

ARCHITECTURE.md Outdated
```ts
const wf = workflowFactory
// Registers an action with the workflow using its type and the corresponding options
.registerAction('Application.MultiSender', MultiSenderAction) // => new MultiSenderAction(options)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to duplicate type when registering? Can't we just pull it from action config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Good point, it could public property of Action, like MultiSenderAction.id. What do you think?


```json
{
"type": "Application.MultiSender",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we include the version?
For example we change the input parameters for an action, and user makes a call from the old version of sdk
Then it will fail deserializing on our side

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it will be configured via package version itself

@extg3 extg3 force-pushed the json-workflow-spec branch from fe55b2a to 122357a Compare June 28, 2024 19:05
.registerAction(MultiSenderAction)
.registerTrigger(ScheduledTrigger)
// Creates a workflow from the given configuration object.
.createFromConfig(config);
Copy link
Member

Choose a reason for hiding this comment

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

I didn't understand why this config is needed. We already have registered actions & triggers, why do we need another config?

Comment on lines +237 to +241
abstract class AbstractAction {
static id: string;

abstract build(): Promise<CallDataBuilderReturnData>;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why is interface not suitable for us?

Copy link
Member

Choose a reason for hiding this comment

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

type BuildResult = {
  callData: [],
  state: any
}

interface BuildableAction {
  build(provider: Provider, vault: Vault): Promise<BuildResult>
  ...
}


```ts
class MultiSenderAction extends AbstractAction {
static id = 'Application.MultiSender';
Copy link
Member

Choose a reason for hiding this comment

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

As for the ID, we may have problems with that. We want to be able to create custom triggers and actions, which means that there may be collisions with the identification of actions & triggers. In addition, it is not fully disclosed how it will be serialized and deserialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants