Monitor Custom Filters' Environment

:computer: Environment

I want to use a Monitor to listen to an event, and trigger an action based on a custom condition. This custom condition would require a smart contract call or an API call.


Is it possible to make API / Smart Contract calls inside a Monitor's custom filter? Do we have access to axios and ethers there? Or is it just plain javascript with no external dependencies?

Yes, custom filters use the most recent action dependency version. At the time of writing that would be v2024-01-18 which includes the following dependancies:

  "@openzeppelin/defender-kvstore-client": "1.52.0",
  "ethers": "5.5.3",
  "axios-retry": "3.5.0",
  "defender-autotask-client": "1.44.0",
  "defender-autotask-utils": "1.44.0",
  "@openzeppelin/defender-autotask-client": "1.52.0",
  "defender-relay-client": "1.44.0",
  "web3": "1.9.0",
  "defender-kvstore-client": "1.44.0",
  "defender-sentinel-client": "1.44.0",
  "@openzeppelin/defender-admin-client": "1.52.0",
  "": "^0.3.1",
  "": "^0.1.0-alpha.3",
  "fireblocks-sdk": "^2.5.4",
  "graphql-request": "3.4.0",
  "@openzeppelin/defender-autotask-utils": "1.52.0",
  "@openzeppelin/defender-sentinel-client": "1.52.0",
  "@openzeppelin/defender-sdk": "1.5.0",
  "axios": "^1.4.0",
  "@openzeppelin/defender-relay-client": "1.52.0",
  "defender-admin-client": "1.44.0",
  "@datadog/datadog-api-client": "^1.0.0-beta.5",
  "graphql": "^15.5.1",
  "@fireblocks/fireblocks-web3-provider": "^1.3.1"