/defender-autotask-examples

Example snippets for Defender Autotasks

Primary LanguageJavaScript

Defender Autotask Examples

This repository contains sample code snippets for Defender Autotasks. Follow the instructions in each folder for more info on how to use them.

Disclaimer: The scripts in this repository have not been audited. Please file an issue if you stumble upon any mistake.

  • The relay folder contains detailed examples on how to use the defender-relay-client package from an Autotask, both standalone and integrated with ethers.js, including local development and unit testing.
  • The typescript folder shows how to write an autotask in typescript, and use tsc to compile it to javascript that can be run within Defender.
  • The rollup folder includes a more complex example, that generates a bundle that incorporates additional dependencies not available in the Autotasks runtime, and embeds contract ABIs in the generated output.
  • The webpack folder is similar to the previous one, bundling dependencies and ABIs into a single file, but uses webpack as a code bundler instead of rollup.
  • The keep3rs folder contains autotasks to execute jobs as a keeper within the Keep3r Network, along with their respective unit tests.