createAutomation
Create an automation for an account using one of the existing triggers.
Usage
const automation = await automationClient.createAutomation({
type: 'time-based',
data: {
trigger: {
triggerData: {
cronExpression: '*/60 * * * * *',
startDate: new Date().getTime(),
},
},
actions: [
{
type: 'static',
target: '0x503b54Ed1E62365F0c9e4caF1479623b08acbe77',
value: 100,
callData: '0x',
},
],
maxNumberOfExecutions: 10,
},
})
Parameters
trigger
The trigger data for the relevant trigger type.
actions
- type:
Action[]
Array of actions to be executed when the automation is triggered.
maxNumberOfExecutions
- Type:
number
Maximum number of executions for the automation.
Returns
id
- Type:
string
Id of the created automation.
hash
- Type:
Hex
(opens in a new tab)
Hash of the created automation to be signed by account owner to activate the automation.