automate-sdk to easily create a new task:
Typescript Functions are still in private beta, make sure to use the beta version of the
automate-sdk to have access to itTypescript Function
Import the sdk and create task, passing your typescript function CID & arguments:cron trigger this way:
event trigger like this:
block trigger this way:
Solidity Function
Repeat the installation step as shown above, then import and instantiate the SDK:createTask to automate your function calls:
Examples
Deploy a contract & automate your function call:
Use a Checker to automate your function call:
If you need more configurable execution condition and/or dynamic input data, you can create a task using CheckerAutomated Transaction
TheCreateTaskOptions interface is used for configuring Automated Transactions with the same structure and options as defined above.
The only difference is you need to configure your automated transaction without the need for a checker function.
Example:
Single Execution Task
If you want to have Gelato call your function only once. If so, setsingleExec flag to true when calling createTask.