-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
fe55b2a
to
122357a
Compare
.registerAction(MultiSenderAction) | ||
.registerTrigger(ScheduledTrigger) | ||
// Creates a workflow from the given configuration object. | ||
.createFromConfig(config); |
There was a problem hiding this comment.
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?
abstract class AbstractAction { | ||
static id: string; | ||
|
||
abstract build(): Promise<CallDataBuilderReturnData>; | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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.
No description provided.