{"_id":"@openzeppelin/defender-autotask-utils","_rev":"40-7e80c09fba950e14744fde9726ad39e5","name":"@openzeppelin/defender-autotask-utils","dist-tags":{"rc":"1.54.0-rc.0","latest":"1.54.6"},"versions":{"1.45.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.45.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.45.0","maintainers":[{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"078ad3d03b7a0f051e5d1f0fd6309b4041665913","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.45.0.tgz","fileCount":10,"integrity":"sha512-vEU4xAD6JrFHAd++U5qLI7zlr9sLeywxNPqsguN7zfh9HpksgePytdzL1WkavMlF7gV2iF8Bd9+QWG4gzADRZQ==","signatures":[{"sig":"MEQCIGUhF8KFuLHd/66NuOAKzVcgoXlCzDfer22E+i2JHDJnAiAy4BPusd+Y2iQvqGA+ssXOpMG9LcV3M+HaH9l9B+S7NA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110297},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.45.0_1686610968005_0.9787442328214238","host":"s3://npm-registry-packages"}},"1.46.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.46.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.46.0","maintainers":[{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"39b14ef6e13a5735587740d0fac8bdbf037aefb7","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.46.0.tgz","fileCount":10,"integrity":"sha512-j8cVKX2JJ+cv1OZSjIABi7/fMPKPBIriEEydUNH1O5MeYsndq8kEVYQvSSDVQBTU+lnZVRY+oAFytiWki9Wfog==","signatures":[{"sig":"MEQCIBZK46UXDz9H0IByLX0OEQajzTDYZ4NrJyhK1vDAx7muAiAGeh3R0JIEn8iiU1dp4CGCWcajpufcpRygQ9BuxlV35A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110353},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.46.0_1686722813979_0.6724366487302906","host":"s3://npm-registry-packages"}},"1.47.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.47.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.47.0","maintainers":[{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"d2729bc331bf3ca582f7f0a401d8e6737ae957a3","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.47.0.tgz","fileCount":10,"integrity":"sha512-U/hUnT+2L+O1KXXvdYx4U7fj5OcPYy8SaxCpEw8jWHI2RXLNOjwlyX3kwvsGVswW187zXb12JjIOzRkSHKQkLA==","signatures":[{"sig":"MEUCIHw4SJ5dZ4c93KGx/c06hZ5alAXnC47K2l7vdtbFbkBVAiEAwpOSdm0Y/Pu8wVabCrX7MpMp9Be8gaAx/HZ6EmG8K44=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52828},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"12d67c544a12ff299c02fad3c8c1848e164e0e5b","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.47.0_1689178035681_0.486173977593253","host":"s3://npm-registry-packages"}},"1.47.1":{"name":"@openzeppelin/defender-autotask-utils","version":"1.47.1","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.47.1","maintainers":[{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"7dadc57f8d4207b8939ba2b9941d84ba7d99c384","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.47.1.tgz","fileCount":16,"integrity":"sha512-lzFDYHi/qhE7+wXNj68I9rwyVJK1UFNV6LgYWbI6Neqv6d5qFky6j6uWLaQqocIxB0X2eXHiMQhuXSO7jSJz8Q==","signatures":[{"sig":"MEUCIH8qB8/F+JVAySfLHFcOvGm+1WNYX92ma1MiCz1FbczPAiEAjhvBp81+NcggV4cy4ON7ArenZmhWvjtIGHX0j3GjGYo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59484},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"Utils library for writing Defender Autotasks","directories":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.47.1_1690545034370_0.8416597550849547","host":"s3://npm-registry-packages"}},"1.48.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.48.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.48.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"mok0230","email":"dpmckeon@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"a2c04a386c84c4815810fe5a4cdad0861cc3698f","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.48.0.tgz","fileCount":11,"integrity":"sha512-m/pSQ2lMgtzVcxlwwl90Dz3FUphS35ZGPeZ+t6f01KCRTH8y3gq3y7rU/sxNzK61XsS+lNCvKh4oX0IfgL+hWw==","signatures":[{"sig":"MEYCIQCprTUvx31kJIpBk/7QM6vn+HK7NincfILRqe1RP8X7mAIhAJ5QyB9/OPqTGTuLLRNXCB41E5q5X51Hev8xyOKbJltJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53916},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/7.1.4/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.48.0_1691666405820_0.6392989693061906","host":"s3://npm-registry-packages"}},"1.49.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.49.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.49.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"4bc113847deb67aa85478deed410ca2aa8661dd0","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.49.0.tgz","fileCount":16,"integrity":"sha512-rJls6HOuddBsPJwbSmIN/nugdIsgdrwzgpVJC/hxv+amu0HsSkrH26LbcoDig7Eb2dp68Avtmo0EOyAUP1bNGA==","signatures":[{"sig":"MEUCICosqearegHcbJJ9e+JZeMPoXmJDj3gQIwOLnaD0IlsYAiEAhPLC4kxUZJm6olkxkDMfmHzhJhESLOY9fEtHaotid70=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60051},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"Utils library for writing Defender Autotasks","directories":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.49.0_1696865497945_0.002957650014990598","host":"s3://npm-registry-packages"}},"1.50.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.50.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.50.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"9bbc99e6a54258f112e6260d6adbc2f43a722d2b","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.50.0.tgz","fileCount":16,"integrity":"sha512-wuhm5idjsIiC7hdLj+z5ewDmyKx5q0tRXKHp05K9X8uo1CyLdHV2kKZjBrWzGE9qxVhJ79f9PzHZrLcyPHNDOg==","signatures":[{"sig":"MEYCIQDRfLofPwo5Zy5pDJDZ+eO7enBXdLHeWBkUelA8wXihFAIhAK8nXytMadD6EwR8aTzg5N+/e4dzEvNS7NJtLGRJ1kaV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60051},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"Utils library for writing Defender Autotasks","directories":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.50.0_1698213102624_0.8864638607120816","host":"s3://npm-registry-packages"}},"1.51.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.51.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.51.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"2413eec44b3421e6409e6ace69ad152fb5db02fd","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.51.0.tgz","fileCount":16,"integrity":"sha512-dhriRi/WJr7VFqfFp7IsHvrNL9jbaPr0I5HKC6OwiK7FIwlX7JX/QVdWulKNaq9QkASGMMu+eJLSmh25ZQGglw==","signatures":[{"sig":"MEUCIQDIzYVAz3AEoftIyZU8WSqgjonjJsAJemtzO2ImE4mwKAIgQbyiZ33HOHoymMMOcFjVUCHxliMcAT5Cx5Vh9JA2sjc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60051},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","description":"Utils library for writing Defender Autotasks","directories":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.51.0_1699377888841_0.328988064019774","host":"s3://npm-registry-packages"}},"1.52.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.52.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.52.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"66f52eea5749a818886a756fdc684e3a6e27abb7","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.52.0.tgz","fileCount":10,"integrity":"sha512-Lz/UqX+i50V/VjmtI9RWct2z45tvCG3EibtTQI3OkipBE9YC6hF2HFTOO0Q4DUu+hzYqKyAesf5ipxhndSoXLg==","signatures":[{"sig":"MEQCIEmG5WZ6CWiZsK+Ij75TIrH7zgm/CjcUAfJrzCaFLOkxAiBH1hn0p43oFMOS/gIjlZbOreHBxuzigtrRK9G5uKWrxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53315},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"3ed4bed14249f4d412d118d3067e6128c41bb76d","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.52.0_1699580172054_0.06209579907283369","host":"s3://npm-registry-packages"}},"1.52.0-rc.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.52.0-rc.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.52.0-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"fba24d9551850b8224e552bed03e1290bc42738e","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.52.0-rc.0.tgz","fileCount":11,"integrity":"sha512-Fs7dwpR5Q4eqVBehk2mWOY6CO0IwTMwPLejd+j+yni9BpYjK6we3F11O0WjRaWYnoIXjvV37X8/r/P0VkYu3Qg==","signatures":[{"sig":"MEYCIQDP9kYNeLQXFLg8UoKKbhiumavvsOHbVvgvHXNkhbRZAAIhAKtXioY7v/EuVh1Fp1vIGgxKg/y4Ht5UiOOopELBKkiI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":54263},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.52.0-rc.0_1700116497754_0.32597346621803314","host":"s3://npm-registry-packages"}},"1.52.0-rc.1":{"name":"@openzeppelin/defender-autotask-utils","version":"1.52.0-rc.1","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.52.0-rc.1","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"3d72571dc90b42e15adede1ffeea3e49bd60a5dd","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.52.0-rc.1.tgz","fileCount":11,"integrity":"sha512-eZsw4lmrWDb0EaGLyWCU4qQqBn9VLrz8kwcp7Ym0LAftYsReba2AeJG1cyBfw7vI+/JOPTKRCL9XxV9g3ZijbA==","signatures":[{"sig":"MEUCIFCUEyXyfh/2ziGQNihRoPWVr3rqidmpNHqrhhTzHZ/MAiEAvFow0Gf1Ciwu/AZnW1kYk08RP22L4+97dhJgzzomz8o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.52.0-rc.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":54370},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.52.0-rc.1_1700133449067_0.8315985663416359","host":"s3://npm-registry-packages"}},"1.52.0-rc.2":{"name":"@openzeppelin/defender-autotask-utils","version":"1.52.0-rc.2","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.52.0-rc.2","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"e8ae053a7029bbd6e8983d6821c76cbeadc9a2a9","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.52.0-rc.2.tgz","fileCount":11,"integrity":"sha512-FaK8F922HaHBZIqB2nfdeBJqIng3k8rckSAf1k2YG0omA3viVnTgPD6XsXrD7Oso8SakTKMmNrFfp8wD3KKskA==","signatures":[{"sig":"MEQCIBGS4h9PvYSZ34bbvv9gNwhz+Q8EmGf9fvVQWSr4fY2bAiBgQ0gdVYLLY3e7O4pMElIq33ldUPl312SF1ZbbAS/hKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.52.0-rc.2","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":54370},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.52.0-rc.2_1700135218279_0.9513069631405331","host":"s3://npm-registry-packages"}},"1.52.0-rc.3":{"name":"@openzeppelin/defender-autotask-utils","version":"1.52.0-rc.3","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.52.0-rc.3","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"634a8a0fb02e754efbf8ba9b66560dd5fa1617a2","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.52.0-rc.3.tgz","fileCount":11,"integrity":"sha512-rxGAnwRZ9qiCPsRL/Gn1sga52GFDqzFr1/gtEuZR9oixWBkJIiR4ch9baLCxkve50bzbd/bfmnhcr7QCmNkWSw==","signatures":[{"sig":"MEUCIBKvtbUwSnZWkLUI+kfXc51kESujOFDVG9Cz1X2BJnhHAiEAkQsZsjse8opGxi1ACAAeuJ+qKbTs2SS+vDAYpGVnexw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.52.0-rc.3","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":54370},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"ae9f6d4fedfe98d19a663cd803aa0ea900cc4b29","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.52.0-rc.3_1700139748909_0.37124846236097286","host":"s3://npm-registry-packages"}},"1.52.1-rc.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.52.1-rc.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.52.1-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"2e785b2eeb2686c6f2aab49b90213e3f7d37dbed","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.52.1-rc.0.tgz","fileCount":3,"integrity":"sha512-yo7/fJSS5+F/yrbXPzt0ZUWF7YIYUdiy1ZcHK+rNJu+Kci5FoCDJbwcAXol7AK9phb4qPt/X/ulsE3nQ5jaJAw==","signatures":[{"sig":"MEYCIQDL97Fwnws1IN9WilE0xFTG7gbaL/YjE/8XaI1p+tuJsgIhAK9SW6SSOc8UUXeNITuepI0mNA379D/pApf1Tkhnt7Bt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.52.1-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":6460},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"75f2dd88ddd843a57b592a47885b3d1e653cbc94","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.1/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.52.1-rc.0_1700405073558_0.7985900572901963","host":"s3://npm-registry-packages"}},"1.53.0-rc.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.53.0-rc.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.53.0-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"7f617a6993c7ec0e33f597c9ad2bbf48807436f5","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.53.0-rc.0.tgz","fileCount":3,"integrity":"sha512-H6bcPZ1c5aeW/OqqslEL8aIjDq355D00xXaIet3q2y3d2jtuJc+oQk69tqS41nxp1aUljLNXWSSIyrdc27sdag==","signatures":[{"sig":"MEYCIQDMLXtGGAI1ddgH/YekGoNOyv6Eb62C2SbVln/dyjYxtQIhALgbhz6t9etAXHx9ycL4lg5N37+eqtf/cMMAEE4zX6QI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.53.0-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":6460},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"1df9d1d1b44ceeced693bb24444d4edc1effa3e0","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/7.4.2/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.53.0-rc.0_1701162936777_0.03504121399650906","host":"s3://npm-registry-packages"}},"1.54.0-rc.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.0-rc.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.0-rc.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"3a69907fbe20f5d6090c4b2fb52a31f05dc20ef5","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.0-rc.0.tgz","fileCount":3,"integrity":"sha512-EbSyT6VSw791jE9vT/flBFrfDiF7qaTHS0MtRn2XvN+6B8sTtUOr+WdPaI87TITyuW7GbY7T6z9LdHj7Rq31dQ==","signatures":[{"sig":"MEUCIQDi/+i0GYJ2RFCR9i7RqfRxfCpE+vGH1Arxfk4zJsM/vgIgC5fL5XEMsGKJRhhdMScyeoVYCXmLGWxrkr44haiO+fk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.54.0-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":6460},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","gitHead":"f5a404590be2debd3a98bb7cd02820a3b035ab2c","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/8.0.0/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.0-rc.0_1701822117859_0.3727275592805428","host":"s3://npm-registry-packages"}},"1.54.0":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.0","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.0","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"f48ea93b43711abb7ccf9f77e89f5fcf835c5ca2","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.0.tgz","fileCount":3,"integrity":"sha512-QgwDdZuhHiMUDa97rnVkSFFVjMTDAJZIszgEVGfiEH61ZDQYofhE9RQ/Ys204DePVwAHUKBFQHnZcdbdYzAOqg==","signatures":[{"sig":"MEUCIDSxhcNshi5kqtHf493EYksuqBvnjMUtESUaf9nNMroMAiEAvbDz4nO4lAk8qxIDMZEfNlJGU199JXtUuce1ytP1J78=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-autotask-utils@1.54.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":6455},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"035dacd398375dc70295063aba5ce81f76b90f55","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/8.0.0/node@v16.20.0+x64 (linux)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.0_1701985014412_0.3754416069692834","host":"s3://npm-registry-packages"}},"1.54.1":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.1","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.1","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"4975a4932cc302d2bb1854f2dcc935b0aaed3073","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.1.tgz","fileCount":10,"integrity":"sha512-VWE6YrMy0mi4wkrigoR0oulJv3t5lWtNlT7831fRa8lIeKJTFScMqBVN515CKZfPfCn4YFXBAh8FZoe4q9e4rQ==","signatures":[{"sig":"MEUCIQDG2LlCBQmYoLEfDzIw66LEUsv2l/xu5CD4y6f3LvhlgQIgck+faLskAtVGqLaHtuwexaU6DiBMG5GAU2LseY6l5mY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53167},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"ff20768e5718ebff4bccc199508834bb7219f7c1","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.0+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.1_1702021212876_0.21240718863419916","host":"s3://npm-registry-packages"}},"1.54.2":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.2","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.2","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"d1f805198a4aa183bd0f1bd8baeb57b337dfb5dc","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.2.tgz","fileCount":10,"integrity":"sha512-/zT5BWgyeTu6jsGy1fT6+YTXbFTVyUQiWIzhhj+AdeQ6p4IoyM8q9UUwc7Ysn1i0mafdRnpnmy1aDs7Jtxa6Qw==","signatures":[{"sig":"MEUCIQCpBSW2gUlUMk3IyTuhwQuOovjKk+Y86s/cTe5MKXFpIgIgJd02nG+Hy5+N1Kr44XTgh5CKlinH9mcJ0nl3edlnKow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55992},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"a4f42ccd3773997da730ed215a2600dc94aefd43","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.20.1+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"16.20.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.2_1715802965867_0.4550063905436499","host":"s3://npm-registry-packages"}},"1.54.3":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.3","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.3","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"5ff3b9e9d8819a078de35ca552d72f38e1b22bc1","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.3.tgz","fileCount":16,"integrity":"sha512-qm3n+BKpApv32tBsmGMK0mFRv+snBA/MyY2z7WDMjs473/YsEwj8VFPde4y/ltDXkHooPhHzbaEMgw42wo9h+A==","signatures":[{"sig":"MEYCIQDUYpUF3j/eaZHLyHFpI7rJiCWRyCT8OzDuoIXARHL11wIhANdZk2psuQfVvFsvGV9zFp3k3175jVgrUORHKQG3T1u5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60158},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"https://github.com/OpenZeppelin/defender-client.git","type":"git"},"description":"Utils library for writing Defender Autotasks","directories":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.3_1716183804134_0.8089672476160579","host":"s3://npm-registry-packages"}},"1.54.4":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.4","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.4","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"3d6b6c79b896bfb5568164672570aec563f2dd46","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.4.tgz","fileCount":16,"integrity":"sha512-Z5L1AOuhsOWbP5/pJ0KXK2g2Ndik4w6DiBYzulDyucGzntdK7dJdChyTK9eekgSPIwcn9f2/jOtV5yOOLSqo+w==","signatures":[{"sig":"MEYCIQCU/cVp6jzZOJD4IlWoPBu/iDbSjIsto+NEKLfwekZvlgIhANykBAgYtKSDgKU4cf0neSaH2gfB4X38SFiW/UZv6PgY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60158},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"daddff62731a4b55075b57905d8c5b8c4eb3b80e","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"https://github.com/OpenZeppelin/defender-client.git","type":"git"},"description":"Utils library for writing Defender Autotasks","directories":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.4_1716188812061_0.3151151456341308","host":"s3://npm-registry-packages"}},"1.54.5":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.5","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.5","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"6d6bbdf3fcf39a5cb9d6c79ecc3bd593e0fd58dd","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.5.tgz","fileCount":10,"integrity":"sha512-k+A1eG0f8qrYTfo8BXmExE4E8YvbP4/LaYhjsZ0gYkW8BpkvAxXPzjWuj5k6xTJmaT8qerWoHSjBQi4OKnxLPw==","signatures":[{"sig":"MEQCIG5hsZ+vooXytT30Tn7OlaNa40Qyp5iM0v4NCm7Z/A8iAiAeC6TfonkipqtK/myLNkLp1bsgpRSoeWUsSHEb4h0LxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":56211},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"0fc43da796268b8c75d70179c7ea649b160dfd06","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v20.11.1+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"20.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.5_1716415319204_0.1597065214154305","host":"s3://npm-registry-packages"}},"1.54.6":{"name":"@openzeppelin/defender-autotask-utils","version":"1.54.6","author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-autotask-utils@1.54.6","maintainers":[{"name":"mcarlomagno","email":"marcoscarlomagno1@gmail.com"},{"name":"collins-oz","email":"collins.wekesa@openzeppelin.com"},{"name":"dylkil","email":"dylankilkenny95@gmail.com"},{"name":"zeljkox","email":"zeljko89markovic@gmail.com"},{"name":"namis","email":"me@nami.sh"},{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/OpenZeppelin/defender-client#readme","bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"dist":{"shasum":"e88b9c14264f7327191997b53eaa49b9e654350f","tarball":"https://registry.npmjs.org/@openzeppelin/defender-autotask-utils/-/defender-autotask-utils-1.54.6.tgz","fileCount":10,"integrity":"sha512-LeDr/hdB9XEoXUeSRkCFJmfz7QVXKraCuuO/ju4t6T4cua8AleOdeRTosmgcHAycZyz0yFJmGWBSe65ZZoh6VA==","signatures":[{"sig":"MEUCIQDMa26dE9KIhw/2KHlLyQsVcE+mKooLo/nl+55gJEGy+gIgBdvlvFo/uRuNRpE7rJMm0UEVozFKTALuepC1frLeBwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":54597},"main":"./lib/index.js","types":"./lib/index.d.ts","gitHead":"9eea3f7d413b8647b20e7b77a1c4ecd4186e4ed3","scripts":{"test":"yarn test:unit","build":"rm -rf lib && tsc","watch":"tsc -w","prepare":"yarn build","test:unit":"jest --verbose --passWithNoTests"},"_npmUser":{"name":"tirumerla","email":"tirumerla@gmail.com"},"deprecated":"This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead.","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v20.11.1+arm64 (darwin)","description":"Utils library for writing Defender Autotasks","directories":{},"_nodeVersion":"20.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-autotask-utils_1.54.6_1716451900774_0.3723968505031734","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-06-12T23:02:47.933Z","modified":"2026-09-24T16:19:15.385Z","1.45.0":"2023-06-12T23:02:48.172Z","1.46.0":"2023-06-14T06:06:54.150Z","1.47.0":"2023-07-12T16:07:15.917Z","1.47.1":"2023-07-28T11:50:34.540Z","1.48.0":"2023-08-10T11:20:05.996Z","1.49.0":"2023-10-09T15:31:38.154Z","1.50.0":"2023-10-25T05:51:42.774Z","1.51.0":"2023-11-07T17:24:49.003Z","1.52.0":"2023-11-10T01:36:12.258Z","1.52.0-rc.0":"2023-11-16T06:34:57.980Z","1.52.0-rc.1":"2023-11-16T11:17:29.290Z","1.52.0-rc.2":"2023-11-16T11:46:58.462Z","1.52.0-rc.3":"2023-11-16T13:02:29.248Z","1.52.1-rc.0":"2023-11-19T14:44:33.735Z","1.53.0-rc.0":"2023-11-28T09:15:36.932Z","1.54.0-rc.0":"2023-12-06T00:21:58.016Z","1.54.0":"2023-12-07T21:36:54.574Z","1.54.1":"2023-12-08T07:40:13.074Z","1.54.2":"2024-05-15T19:56:05.994Z","1.54.3":"2024-05-20T05:43:24.269Z","1.54.4":"2024-05-20T07:06:52.226Z","1.54.5":"2024-05-22T22:01:59.405Z","1.54.6":"2024-05-23T08:11:40.912Z"},"bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"author":{"name":"Santiago Palladino","email":"santiago@openzeppelin.com"},"license":"MIT","homepage":"https://github.com/OpenZeppelin/defender-client#readme","repository":{"url":"git+https://github.com/OpenZeppelin/defender-client.git","type":"git"},"description":"Utils library for writing Defender Autotasks","maintainers":[{"email":"collins.wekesa@openzeppelin.com","name":"collins-oz"},{"email":"tirumerla@gmail.com","name":"tirumerla"},{"email":"son.dinh@openzeppelin.com","name":"son-oz"}],"readme":"# Defender Autotask Utils\n\nThe [Defender Autotasks](https://docs.openzeppelin.com/defender/autotasks) service allows you to run small code snippets on a regular basis, via webhooks or from Sentinels that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Autotasks to automate regular actions on your contracts.\n\nThis library provides typings for simplifying the writing of Autotask code when using Typescript.\n\n_Note: For programmatically interacting with your Autotasks, such as updating their code from your local workstation, check out the [`defender-autotask-client`](https://www.npmjs.com/package/defender-autotask-client) package_.\n\n# End Of Support Notice\n\nWe will no longer be maintaining or supporting any additional releases for defender-client. Please migrate to defender-sdk as soon as possible to get all the benefits of defender 2.0 and more.\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-autotask-utils\n```\n\n```bash\nyarn add @openzeppelin/defender-autotask-utils\n```\n\n## Typings\n\nThis library includes typings for 1) the event payload injected by Defender when invoking an Autotask, and 2) the result expected by Defender from an Autotask when used as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n\n### `AutotaskEvent`\n\nEvent data injected by Defender when invoking an Autotask. Includes credentials for communicating with whitelisted internal services, as well as the main `request` object of type `AutotaskRequestData`. This data contains a main payload that varies depending on the Autotask trigger:\n\n- A generic object representing the HTTP payload when invoked [via webhook](https://docs.openzeppelin.com/defender/autotasks#webhook-handler)\n- A list of matches to evaluate as a `SentinelConditionRequest` when invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions).\n- A list of transactions matched by a Sentinel as a `SentinelTriggerEvent` when invoked as [Sentinel notification](https://docs.openzeppelin.com/defender/sentinel#autotask)\n\nExample usage for a Sentinel trigger event:\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelTriggerEvent,\n  SubscriberType,\n  BlockTriggerEvent,\n  FortaTriggerEvent,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent) {\n  const payload = event.request.body as SentinelTriggerEvent;\n\n  // You can either check the payload type to destructure the correct properties\n  if (payload.type == SubscriberType.BLOCK) {\n    const { transaction, matchReasons } = payload;\n  } else if (payload.type == SubscriberType.FORTA) {\n    const { alert, matchReasons } = payload;\n  }\n\n  // Or if you know what type of sentinel you'll be using\n\n  // Contract Sentinel\n  const contractPayload = event.request.body as BlockTriggerEvent;\n  const { transaction, matchReasons } = contractPayload;\n  // Forta Sentinel\n  const fortaPayload = event.request.body as FortaTriggerEvent;\n  const { alert, matchReasons } = fortaPayload;\n\n  // For forta Alerts you can check whether the alert is related to a transaction or a block\n  if (isTxAlert(alert)) {\n    // Do something here\n  } else if (isBlockAlert(alert)) {\n    // Do something here\n  }\n\n  // Rest of logic...\n}\n```\n\n### `SentinelConditionResponse`\n\nWhen invoked as a [Sentinel condition](https://docs.openzeppelin.com/defender/sentinel#autotask_conditions), the Autotask is expected to return the list of matches, refined from the set of potential transactions initially matched by the Sentinel.\n\n```typescript\nimport {\n  AutotaskEvent,\n  SentinelConditionRequest,\n  SentinelConditionResponse,\n  SentinelConditionMatch,\n  SubscriberType,\n  isTxAlert,\n  isBlockAlert,\n} from '@openzeppelin/defender-autotask-utils';\n\nexport async function handler(event: AutotaskEvent): Promise<SentinelConditionResponse> {\n  const { events } = event.request.body as SentinelConditionRequest;\n  const matches: SentinelConditionMatch[] = [];\n\n  for (const match of events) {\n    if (match.type == SubscriberType.BLOCK) {\n      // Custom logic to decide whether this tx should be matched by the Sentinel\n      if (!shouldMatch(match.transaction)) continue;\n    } else if (match.type == SubscriberType.FORTA) {\n      // For forta alerts you can check whether the alert is related to a transaction or a block\n      if (isTxAlert(match.alert)) {\n        // Do something here\n      } else if (isBlockAlert(match.alert)) {\n        // Do something here\n      }\n      if (!shouldMatch(match.alert)) continue;\n    }\n    // Metadata can be any JSON-marshalable object (or undefined)\n    matches.push({ hash: match.hash, metadata: { id: 'myCustomId' } });\n  }\n\n  return { matches };\n}\n```\n","readmeFilename":"README.md"}