{"_id":"@openzeppelin/defender-sentinel-client","_rev":"39-338c13c421223826ec85a886637bd99a","name":"@openzeppelin/defender-sentinel-client","dist-tags":{"rc":"1.54.0-rc.0","latest":"1.54.6"},"versions":{"1.45.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.45.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@1.45.0","maintainers":[{"name":"tirumerla","email":"tirumerla@gmail.com"},{"name":"frangio","email":"frangio.1@gmail.com"}],"dist":{"shasum":"7b3dfdf486ba0dc0e4ea5205be7e6063863bfd20","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.45.0.tgz","fileCount":37,"integrity":"sha512-orr1ZhtgihrXeBqX/3+ZejDnAdFVQLv5KOED1/yyjIF2DSG9qrTjhrsI91FroOw/JiWwVLdtrPEvyssID2MDqw==","signatures":[{"sig":"MEQCICBHF9M+bNq7eRUjuQPIsC2jFr3dmZCpacv/i1EMHW0DAiA4YIOWfR5IiQnyx/2Bqt7MH+QXLPRCc8RH/v+KinhIDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":173935},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^0.21.2","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.45.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.45.0_1686610969530_0.41285386537105806","host":"s3://npm-registry-packages"}},"1.46.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.46.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"b5f27b005a6c1ede7f584b7d1bef95b0deaee242","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.46.0.tgz","fileCount":37,"integrity":"sha512-oQMmLlDMHzOmX6sU2tOQZEK5jq25fv58e3F6M/vvo9tCXUvNHYHwie2Ug/SSdHhIkPvrGKX1npUI0+MrBAyLPA==","signatures":[{"sig":"MEUCIDCUItXk+guPNR3KkiB8ZniauTPSTd7cO78VyI18Kd8/AiEAn3nBwsnIErOmZMl/o0doxDwnFLgoQAUyvSlUlMIfPrQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":173009},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^0.21.2","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.46.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.46.0_1686722815303_0.9573353887991563","host":"s3://npm-registry-packages"}},"1.47.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.47.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"eaed39153729c66aa6bb69277cbdeaafc4003dcd","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.47.0.tgz","fileCount":37,"integrity":"sha512-PCk25UYKosQWJTKJBGDTRC/MrLuz0GKFn4VEXa12RSUpdVdMoEcGwC5eFkbw8UkYnG1sh7xT3T1V2MuVsh4ULg==","signatures":[{"sig":"MEQCIBepmYVj+yNSC42wdZ/5fpiayDp2sE0IYRUc3vP1nMrdAiBEifhHGtyqbvRGSo4Zah1W010/UVbfxY6dy2ZtyXbSBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102404},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.47.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.47.0_1689178037574_0.48247056354461626","host":"s3://npm-registry-packages"}},"1.47.1":{"name":"@openzeppelin/defender-sentinel-client","version":"1.47.1","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"227eb646b00c7f716a96426ca8a3d75d553ea12a","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.47.1.tgz","fileCount":66,"integrity":"sha512-rDAidyP7ExqPye7HovyCW5qLXRGpGkjOgIGXw/4pYkqkUSp4L1TnMO0Vg25Zswu5aiqjClln1HZUijFxdn5uig==","signatures":[{"sig":"MEQCIEpUByNBsSgzi33MKMqYYx2XT5CJrxA7uz7avdVg3OjiAiAKskB+77hjNfwIQWUjlINGpj3FXHnE0JKcXcKwmPkvLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153818},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.47.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.47.1_1690545316455_0.6651122974215908","host":"s3://npm-registry-packages"}},"1.48.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.48.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"293e91d80314f4ba18ad811daea72c1abbc5860a","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.48.0.tgz","fileCount":41,"integrity":"sha512-UoQTeC6Y3GK8uYWiyqMqnIOQHyI1SQ3MwOH0Z3OBbzR1xvCQZ+CcmBUnQQSxdfqcEXh+00MdUCRs+FbHZTESQQ==","signatures":[{"sig":"MEUCIGlAWkUkPeLtSbSVnum4fNatXm+icpQHWP6LHYF7HTp2AiEAwFGrMm0m9gawpPox5gD2zaKy+tpZ16k90ngKaB9qzt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104328},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.48.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.48.0_1691666410949_0.9298532641209885","host":"s3://npm-registry-packages"}},"1.49.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.49.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"25c1c9c2bb9bd0bb3e56382d68e87dc82912ec83","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.49.0.tgz","fileCount":66,"integrity":"sha512-fr39U1GRWvJP1fWgwqjTYCz7uhfVfXJReWcivwxMeaoyMl+jYFxj8NkMhqkkbmI6O4TUyNMsmAQ34qFf0IS0/A==","signatures":[{"sig":"MEQCIBsJTFD68MX5SHQGbjIe6XvpfPgva1yPFtQJ44/yQpJuAiBzHlXpaB2L8tgbpzeVzsrjAtgRaEt1KB2A22llGHy/OQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154516},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.49.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.49.0_1696865739262_0.18250907502322633","host":"s3://npm-registry-packages"}},"1.51.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.51.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"10c0bb9bf93e1a6e91517b90e937e9cdfdb3cb46","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.51.0.tgz","fileCount":66,"integrity":"sha512-+h0WaXQ0HOspCBH/GfLB1Q4je2wV7MtCOLDBxPjdHXIrbXw+1MLVRjThd0esUwrBnwyejtyQ2kNhcfa3oIkc8A==","signatures":[{"sig":"MEUCIAEwDdHTwkhVOVjgHNX/+xUlwZWqUSYy7EXojX+JZMZ0AiEAu2K/+5cIJJV1t96u1Z0RCviJV5cL5idOVVpc4dXm9mI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154516},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.51.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.51.0_1699378049899_0.0705752058224467","host":"s3://npm-registry-packages"}},"1.52.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.52.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"49d50f818089547b07854048614248cc635a31f6","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.52.0.tgz","fileCount":40,"integrity":"sha512-lLremDrvlAyZ+jy0e3T3XHzuWnlee0oV6PgQN7r+4PPR7+pMFRFJjIxJMeNO9e77jw1Ljcy9Gs6lDbwckGq82Q==","signatures":[{"sig":"MEYCIQDD7VLRvs8ncaRKHqrbkfXJe2OcFPpYCFqxz3H+7JVTXgIhAMHjqGC8JVaWcV9e2xGHv7K6A6LfmxFwUVvxPExzca1h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104475},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.52.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.52.0_1699580174097_0.6074800086041487","host":"s3://npm-registry-packages"}},"1.52.0-rc.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.52.0-rc.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"1614ca4a7be44609f491ff53f8066c30ff1dc2c0","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.52.0-rc.0.tgz","fileCount":41,"integrity":"sha512-8i52AwT+Q0kjVwnpX2LxkjmjXcZh2n3DUHbbOp8qE10RDZbRp9dZPW/cNRYnJdMlRJ+pYdr1whnq9HTXbJFEhg==","signatures":[{"sig":"MEUCIQDr/jQC/cx+RuHlaYCqE1ZsglHaxvehn8RUsmSRPrDUWgIgBU2F5a3Tw7S3vsZR5kogOJLW0iu+2Qo/lfGxMZGZdBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104883},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.52.0-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.52.0-rc.0_1700116500307_0.21841352562303107","host":"s3://npm-registry-packages"}},"1.52.0-rc.1":{"name":"@openzeppelin/defender-sentinel-client","version":"1.52.0-rc.1","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"bb0ea240e05c0a991ab583b8efde589deafd6a4a","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.52.0-rc.1.tgz","fileCount":41,"integrity":"sha512-lYri+xnwv81XBCQWoXMqN1dURl64ipDDbsnNHQJE4P1dfAnZv9OD4DuB8ylakVBx3+YRI2/BZNa8C9iV+MjghQ==","signatures":[{"sig":"MEYCIQDEpWRZLnjFgeH8Yp+RgqJcjn3DoTN2t62FEcE7pDxuPwIhAMd016rG2ww+vvDd+1Rx/LnYVe2C2Emd2QVukjWQtrm/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.52.0-rc.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":104990},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.52.0-rc.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.52.0-rc.1_1700133453474_0.3126323890877909","host":"s3://npm-registry-packages"}},"1.52.0-rc.2":{"name":"@openzeppelin/defender-sentinel-client","version":"1.52.0-rc.2","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"dfca5b4f2f18cc7b382e304c60fb1e6697ca2f03","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.52.0-rc.2.tgz","fileCount":41,"integrity":"sha512-DyBZqoWvBFQGv7F6cLxdbp7Z/AnoufH6kH2VuG6qIgk+gKGY9xSev1o5NhYDUwQp/NjfzL/m2UqOQJQT9kVpgA==","signatures":[{"sig":"MEQCIHLilX+XDpn5qFcLBqHjPGwhTAgi5nWylxQPA6UHK7h9AiA4pyjqI5pL6X/Psv/MFKjQtMHNfZNAJkpGDdT7O+fuFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.52.0-rc.2","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":104990},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.52.0-rc.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.52.0-rc.2_1700135227567_0.17882061306466612","host":"s3://npm-registry-packages"}},"1.52.0-rc.3":{"name":"@openzeppelin/defender-sentinel-client","version":"1.52.0-rc.3","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"8928629894028601f9ce0d8dfb0e0c1636fb4ada","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.52.0-rc.3.tgz","fileCount":41,"integrity":"sha512-n3iqrs4ZtNUOg1Q8yN8bvY+apITGhtoFUp8i9OWh2YCO2kPS9OSX84QRuptnEoHcTGlYMb63Yh9uAT6xe3QUKA==","signatures":[{"sig":"MEQCIHN/I8pNH64ObAC5EJOf/OwcZB1mR3mmw1PJoBCcF2ETAiBO8cwDjqwcawKtI/2DEPVSixYnJTm2h86elKBFWWy3kQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.52.0-rc.3","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":104990},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.52.0-rc.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.52.0-rc.3_1700139754975_0.2969555988442414","host":"s3://npm-registry-packages"}},"1.52.1-rc.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.52.1-rc.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"6b3e5d27f87e5f884f00cc5092e47050bb59b36d","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.52.1-rc.0.tgz","fileCount":3,"integrity":"sha512-6WPvAt1UsNV7g7udG22JYw7yVlFCga68W++7WrAdTLLvJCW8wN7YqQd4fvSvRzvDcvaKnjDPBLJSsw2sv+w+3w==","signatures":[{"sig":"MEUCIQDLjSHtgotZHvD/Sec+UL/t2xMph0lF1dH/6EfepYufCAIgEdouGlcZpsXkb3/PI+FUUDr/xYNQRiXs7lPgaFoPD5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.52.1-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":15198},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.52.1-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.52.1-rc.0_1700405078293_0.22129344648527605","host":"s3://npm-registry-packages"}},"1.53.0-rc.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.53.0-rc.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"713876ec4bca685faa406872912df57673ea63da","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.53.0-rc.0.tgz","fileCount":3,"integrity":"sha512-4PnumrjTNalYr645JkIHk6ZPFLxtYXpsZjAVPe4tx1fopad30ARsgrz+avqnpfI1EuDD7bkqIhfZ2v5e7rB7fw==","signatures":[{"sig":"MEUCIAKve/dxLcc5czhkMkkUGlGobeENuOfn75cvWdnG2TQlAiEAgB00e6+nez44TlakiiiOg6+H7zWqP9uzcu1kXbx/Lho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.53.0-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":15198},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.53.0-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.53.0-rc.0_1701162940992_0.9897295090405265","host":"s3://npm-registry-packages"}},"1.54.0-rc.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.0-rc.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"786ffadd35e22e229b1ae82ba78f637431cb1a03","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.0-rc.0.tgz","fileCount":3,"integrity":"sha512-5VOeLcetPS+4LstMsehlUqRjkh6aSui7wMpRf4r8zkzx1IjMNn+3SfgbA0AhFzikLGq1YcFjVyKwkkHsYXIi7A==","signatures":[{"sig":"MEUCIDpJDKp9QhbVpt95SqmbBvpS+tRWQZs7I053asCN44pxAiEA6586R8sgxV7jlk1lxGay2eIygVoPBc4yxTx7ib8aY2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.54.0-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":15198},"main":"./lib/index.js","types":"./lib/index.d.ts","readme":"# Defender Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\n\n## Install\n\n```bash\nnpm install @openzeppelin/defender-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Goerli network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'goerli',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.0-rc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.0-rc.0_1701822122569_0.3611978018901505","host":"s3://npm-registry-packages"}},"1.54.0":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.0","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"9125170a450eb7f1ac7fcd306e55e56f76e43173","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.0.tgz","fileCount":3,"integrity":"sha512-zSA/+X3BbFCG6QDGq1Ic49fid7nEugfLgT4ouTEqaIlcJx3/K007rUceR21xLvUkamZPj8Em2sKUgKmL273czg==","signatures":[{"sig":"MEYCIQDWjBk/M7d+ij2QDL2mfnhASpxsNX32VavMe3xOtoiFAwIhAPx96ZfQccY2+ATfDaqlTmlny/9F4KBUxkVG28ww9wbw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openzeppelin%2fdefender-sentinel-client@1.54.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":15188},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.0_1701985019463_0.7289988197277446","host":"s3://npm-registry-packages"}},"1.54.1":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.1","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"98738d091048bbd8e956a0a89a6701f0de5ba5f4","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.1.tgz","fileCount":40,"integrity":"sha512-Zy4GswU2+giAKL649CEpQXGk8AH2l7fvHWcdLHdKp88T96d4XhemZ5P7C1kWv2kdoHdRzLhIy2WKFKAigCOJdQ==","signatures":[{"sig":"MEQCIF7eK4asGtyFDnVko3lRySTR85qkoXX/5bwJwHmQT+igAiBYClwiK/5d/ca88OFeiXFJtir3XlAB5q8omj7bDN1uqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104582},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.0","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.1_1702021215483_0.6752179705560664","host":"s3://npm-registry-packages"}},"1.54.2":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.2","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"96da4973965e192514826263d2c3d759d44daf14","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.2.tgz","fileCount":40,"integrity":"sha512-5leiIFRoUq/WG3R/Hv/rROfEeWDpJyMUGBwNj17YrqHIeXn385qgJhtj9YI/C3tCDKh8CAyP0+Y3aZFnFNiutA==","signatures":[{"sig":"MEUCIQD4iFKcWUl9VjE035Gfkjl74XWbSheHhZe1sinoob0JvwIgDbYf35pTYZm/dyVPtKFyDTOXxWZkuoX9mEZB0d9fvdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107160},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"16.20.1","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.2_1715802967711_0.28245663346969385","host":"s3://npm-registry-packages"}},"1.54.3":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.3","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"91174f214af12f5d1be29a3a2bcdd89efac084a5","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.3.tgz","fileCount":66,"integrity":"sha512-x0jFym75PlhxqoQsqIgOGFIO3+YmJl1kjIgozlSedyM01VLTzXFrXbV1RM9BSp/DhyEA4jHQX2hKdBNoy7oUWg==","signatures":[{"sig":"MEQCIEneE+gTVAPXs5FlulUCFRwESsPz4+7Nf/VsmCDKXJ3sAiBNUOGt9l6uWuWzbasZPIKsOxZOai7yM44THpXAED9M9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154830},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.3_1716183726762_0.267713433780731","host":"s3://npm-registry-packages"}},"1.54.4":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.4","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"12d750038a67fe938a0a8bb8cf3675e5728a1fcd","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.4.tgz","fileCount":66,"integrity":"sha512-ZhxUDTEPKs/3KecHIpr0eDVbuE6Uh28u5kEskCRdAt8PcuAvoRQogz6cDX43WjRhe1SmYhkfLmhoPk6rsETFww==","signatures":[{"sig":"MEUCIDRk3zFiZMIylt8yMWozDeFEE8866pOiYGMqqXsOqSSCAiEAxqL4ZFIeYBiyeQRWQ5wltbvD1FRrWW6KAMFRoKajad0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154630},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.4_1716189030131_0.39403031769109575","host":"s3://npm-registry-packages"}},"1.54.5":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.5","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"d9fa435506e895a122776917b511f1da49b7985c","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.5.tgz","fileCount":40,"integrity":"sha512-CjRJxghkL5RelJ/WOi+VPlSyl9PKZ1y2BR304NGaIWgC7qK6hX8M9wxy3kkCuBBnDjZaCeGY8gv/CFt1znri7Q==","signatures":[{"sig":"MEUCIQDVmeCeuR8RWeNmjINYbxGeclOnlio1jDYTVLrCBeOzFgIgZhpqh6zsMfL+HBH4Af7ILYUBGALj3vcLrM3QROky7Bg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107504},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.5_1716415322672_0.845292758965835","host":"s3://npm-registry-packages"}},"1.54.6":{"name":"@openzeppelin/defender-sentinel-client","version":"1.54.6","author":{"name":"Nami Shah","email":"nami@openzeppelin.com"},"license":"MIT","_id":"@openzeppelin/defender-sentinel-client@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":"d61823515ea274c07288f6a4ecb262f29cc9eb02","tarball":"https://registry.npmjs.org/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.54.6.tgz","fileCount":40,"integrity":"sha512-MUEAldBdgF2AUBeG/TthuOvO3LF67huPrUgWnFYaeF2DvudrRUz1r5pilMbt9Iy5ORtw3mpFShiOx/jANEhBig==","signatures":[{"sig":"MEUCIQD71V+uM0mRK6bTRRolJ6g33whDbZJsQJDIx4eq5A7mRgIgcn5TSqWaYM7REAsAhbksScPNiIOynB22dnhUrnn0jTk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105740},"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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"axios":"^1.4.0","lodash":"^4.17.19","node-fetch":"^2.6.0","@ethersproject/abi":"^5.6.3","@openzeppelin/defender-base-client":"1.54.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/defender-sentinel-client_1.54.6_1716451907493_0.8858104747184097","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-06-12T23:02:49.408Z","modified":"2026-09-24T16:19:20.749Z","1.45.0":"2023-06-12T23:02:49.706Z","1.46.0":"2023-06-14T06:06:55.503Z","1.47.0":"2023-07-12T16:07:17.809Z","1.47.1":"2023-07-28T11:55:16.720Z","1.48.0":"2023-08-10T11:20:11.137Z","1.49.0":"2023-10-09T15:35:39.673Z","1.51.0":"2023-11-07T17:27:30.111Z","1.52.0":"2023-11-10T01:36:14.287Z","1.52.0-rc.0":"2023-11-16T06:35:00.455Z","1.52.0-rc.1":"2023-11-16T11:17:33.749Z","1.52.0-rc.2":"2023-11-16T11:47:07.818Z","1.52.0-rc.3":"2023-11-16T13:02:35.227Z","1.52.1-rc.0":"2023-11-19T14:44:38.448Z","1.53.0-rc.0":"2023-11-28T09:15:41.138Z","1.54.0-rc.0":"2023-12-06T00:22:02.736Z","1.54.0":"2023-12-07T21:36:59.652Z","1.54.1":"2023-12-08T07:40:15.673Z","1.54.2":"2024-05-15T19:56:07.851Z","1.54.3":"2024-05-20T05:42:06.929Z","1.54.4":"2024-05-20T07:10:30.371Z","1.54.5":"2024-05-22T22:02:02.922Z","1.54.6":"2024-05-23T08:11:47.630Z"},"bugs":{"url":"https://github.com/OpenZeppelin/defender-client/issues"},"author":{"name":"Nami Shah","email":"nami@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":"Defender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.","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 Sentinel Client\n\nDefender Sentinel allows you to monitor transactions by defining conditions on events, functions, and transaction parameters, and notifying via email, slack, telegram, discord, Autotasks, and more.\n\nFurther information can be found on the OpenZeppelin documentation page: https://docs.openzeppelin.com/defender/sentinel\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-sentinel-client\n```\n\n```bash\nyarn add @openzeppelin/defender-sentinel-client\n```\n\n## Usage\n\nStart by creating a new _Team API Key_ in Defender, and granting it the capability to manage sentinels. Use the newly created API key to initialize an instance of the Sentinel client.\n\n```js\nconst { SentinelClient } = require('@openzeppelin/defender-sentinel-client');\nconst client = new SentinelClient({ apiKey: API_KEY, apiSecret: API_SECRET });\n```\n\n### List Sentinels\n\nTo list existing sentinels, you can call the `list` function on the client, which returns a `CreateSentinelResponse[]` object:\n\n```js\nawait client.list();\n```\n\n### Create a Notification\n\nA sentinel requires a notification configuration to alert the right channels in case an event is triggered.\nIn order to do so, you can either use an existing notification ID (from another sentinel for example), or create a new one.\n\nThe following notification channels are available:\n\n- email\n- slack\n- discord\n- pager-duty\n- telegram\n- datadog\n- webhook\n- opsgenie\n\nThe `createNotificationChannel` function requires the `NotificationType` and `NotificationRequest` parameters respectively, and returns a `NotificationResponse` object.\n\n```js\nconst notification = await client.createNotificationChannel('email', {\n  name: 'MyEmailNotification',\n  config: {\n    emails: ['john@example.com'],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('slack', {\n  name: 'MySlackNotification',\n  config: {\n    url: 'https://slack.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('opsgenie', {\n  name: 'MyOpsgenieNotification',\n  config: {\n    apiKey: '123-secret',\n    instanceLocation: 'US',\n    responders: [{ username: 'emergency@email.io' }],\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('telegram', {\n  name: 'MyTelegramNotification',\n  config: {\n    botToken: 'abcd',\n    chatId: '123',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('pager-duty', {\n  name: 'MyPagerDutyNotification',\n  config: {\n    token: 'pager-duty-integration-token',\n    eventType: 'alert',\n    routingKey: 'integration-routing-key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('discord', {\n  name: 'MyDiscordNotification',\n  config: {\n    url: 'https://discord.com/url/key',\n  },\n  paused: false,\n});\n\nconst notification = await client.createNotificationChannel('datadog', {\n  name: 'MyDatadogNotification',\n  config: {\n    apiKey: 'abcd',\n    metricPrefix: 'prefix',\n  },\n  paused: false,\n});\n```\n\n### List notifications\n\nYou can also list existing notification channels:\n\n```js\nconst notificationChannels = await client.listNotificationChannels();\nconst { notificationId, type } = notificationChannels[0];\n```\n\nThis returns a `NotificationResponse[]` object.\n\n### Get a notification\n\nYou can also retrieve a single notification channel. The function takes as parameter the `GetNotificationRequest` object, which must include the `type` and `notificationId` properties.\n\n```js\nawait client.getNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\nThis returns a `NotificationResponse` object.\n\n### Update a notification\n\nYou can also update a single notification channel. The function takes as parameter the `UpdateNotificationRequest` object which must include the `type`, `notificationId` and `NotificationRequest` properties.\n\n```js\nawait client.updateNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n  name: 'MyUpdatedEmailNotification',\n  config: {\n    emails: ['johndoe@example.com'],\n  },\n  paused: false,\n});\n```\n\nThis returns a `NotificationResponse` object.\n\n### Delete a notification\n\nYou can also delete a notification channel. The function takes as a parameters the `DeleteNotificationRequest` object which must include the `type` and `notificationId` properties.\n\n```js\nawait client.deleteNotificationChannel({ type: 'email', notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb' });\n```\n\n### Notification Categories\n\nThere are 3 default notification categories.\n\n- High Severity\n- Medium Severity\n- Low Severity\n\nEach notification category can be associated with up to two notification channels. For instance, the High Severity category can be linked to a Slack channel and a webhook.\n\nA notification category can then be linked to a sentinel. If a sentinel does not have any notification channels assigned and is linked to a category, the notification channels linked to that category will be notified when the sentinel is triggered.\n\n**Note:** If a sentinel has both manually linked notification channels and channels associated with its category, the manually linked channels will take precedence and the category-associated channels will not be used. The sentinel will only notify the manually linked channels.\n\n### List notification categories\n\nYou can also list existing notification categories:\n\n```js\nconst notificationCategories = await client.listNotificationCategories();\nconst { categoryId, notificationIds } = notificationCategories[0];\n```\n\nThis request returns a `NotificationCategoryResponse[]` object.\n\n### Get a notification category\n\nYou can also retrieve a single notification category.\n\n```js\nawait client.getNotificationCategory('66a753ae-90ed-4373-a360-1c3f79610d15');\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Update a notification category\n\nYou can also update a single notification category. The only fields that can be updated are:\n\n- description\n- notificationIds\n\nChanging the `name` field is currently not supported. Any changes to the `name` field will be ignored.\n\n```js\nconst myNotification = await client.getNotificationChannel({\n  type: 'email',\n  notificationId: 'e595ce88-f525-4d5d-b4b9-8e859310b6fb',\n});\nawait client.updateNotificationCategory({\n  categoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  name: 'High Severity',\n  description: 'Attach this category to high-risk monitors',\n  notificationIds: [myNotification],\n});\n```\n\nThis request returns a `NotificationCategoryResponse` object.\n\n### Create a Sentinel\n\nThere are two types of sentinels, `BLOCK` and `FORTA`. For more information on when to use which type, have a look at the documentation [https://docs.openzeppelin.com/defender/sentinel#when-to-use](here).\n\nTo create a new sentinel, you need to provide the type, network, name, pause-state, conditions, alert threshold and notification configuration. This request is exported as type `CreateSentinelRequest`.\n\nAn example for a `BLOCK` sentinel is provided below. This sentinel will be named `MyNewSentinel` and will be monitoring the `renounceOwnership` function on the `0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2` contract on the Sepolia network.\nThe alert threshold is set to 2 times within 1 hour, and the user will be notified via email.\n\nFurthermore, you may optionally set the `riskCategory` property of your sentinel, which labels your sentinel under a certain category:\n`type SubscriberRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SUSPICIOUS' | 'FINANCIAL' | 'TECHNICAL';`.\n\n```js\nconst requestParameters = {\n  type: 'BLOCK',\n  network: 'sepolia',\n  // optional\n  confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset\n  name: 'MyNewSentinel',\n  address: '0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2',\n  abi: '[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{...}]',\n  // optional\n  paused: false,\n  // optional\n  eventConditions: [],\n  // optional\n  functionConditions: [{ functionSignature: 'renounceOwnership()' }],\n  // optional\n  txCondition: 'gasPrice > 0',\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n  // optional\n  // notificationChannels take priority over notification categories\n  // in this instance, notificationCategoryId will be ignored, unless notificationChannels is empty\n  notificationCategoryId: '66a753ae-90ed-4373-a360-1c3f79610d15',\n  // optional\n  riskCategory: 'TECHNICAL',\n};\n```\n\nIf you wish to trigger the sentinel based on additional events, you could add another `EventCondition` or `FunctionCondition` object, for example:\n\n```js\nfunctionConditions: [{ functionSignature: 'renounceOwnership()' }],\neventConditions: [\n  {\n    eventSignature: \"OwnershipTransferred(address,address)\",\n    expression: \"\\\"0xf5453Ac1b5A978024F0469ea36Be25887EA812b5,0x6B9501462d48F7e78Ba11c98508ee16d29a03412\\\"\"\n  }\n]\n```\n\nYou could also apply a transaction condition by modifying the `txCondition` property:\nPossible variables: `value`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `gasLimit`, `gasUsed`, `to`, `from`, `nonce`, `status` ('success', 'failed' or 'any'), `input`, or `transactionIndex`.\n\n```js\ntxCondition: 'gasPrice > 0',\n```\n\nYou can also construct a request for a `FORTA` sentinel as follows:\n\n```js\nconst requestParameters = {\n  type: 'FORTA',\n  name: 'MyNewFortaSentinel',\n  // optional\n  addresses: ['0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2'],\n  // optional\n  // NOTE: Forta have changed the terminology for 'Agent' to 'Detection Bot'.\n  // We will continue to refer to them as 'Agents' for now.\n  // agentIDs should be a list of your Bot IDs\n  agentIDs: ['0x8fe07f1a4d33b30be2387293f052c273660c829e9a6965cf7e8d485bcb871083'],\n  fortaConditions: {\n    // optional\n    alertIDs: undefined, // string[]\n    minimumScannerCount: 1, // default is 1\n    // optional\n    severity: 2, // (unknown=0, info=1, low=2, medium=3, high=4, critical=5)\n  },\n  // optional\n  paused: false,\n  // optional\n  autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n  // optional\n  autotaskTrigger: undefined,\n  // optional\n  alertThreshold: {\n    amount: 2,\n    windowSeconds: 3600,\n  },\n  // optional\n  alertTimeoutMs: 0,\n  notificationChannels: [notification.notificationId],\n};\n```\n\nOnce you have these parameters all setup, you can create a sentinel by calling the `create` function on the client. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.create(requestParameters);\n```\n\nAdditionally, the sentinel could invoke an autotask to further evaluate. Documentation around this can be found here: https://docs.openzeppelin.com/defender/sentinel#autotask_conditions.\n\n```js\n// If other conditions match, the sentinel will invoke this autotask to further evaluate.\nautotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964',\n// Define autotask within the notification configuration\nautotaskTrigger: '1abfee11-a5bc-51e5-1180-0675a5b24c61',\n```\n\n### Retrieve a Sentinel\n\nYou can retrieve a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.get('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Update a Sentinel\n\nTo update a sentinel, you can call the `update` function on the client. This will require the sentinel ID and a `UpdateSentinelRequest` object as parameters:\n\n```js\nawait client.update('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1', { name: 'My Updated Name', paused: true });\n```\n\n### Delete a Sentinel\n\nYou can delete a sentinel by ID. This will return a `DeletedSentinelResponse` object.\n\n```js\nawait client.delete('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### Pause and unpause a Sentinel\n\nYou can pause and unpause a sentinel by ID. This will return a `CreateSentinelResponse` object.\n\n```js\nawait client.pause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\nawait client.unpause('8181d9e0-88ce-4db0-802a-2b56e2e6a7b1');\n```\n\n### List Networks\n\nTo list tenant enabled networks, you can call the `listNetworks` function on the client, which returns a `Network[]` object:\n\n```js\nawait client.listNetworks(); // lists all networks\nawait client.listNetworks({ networkType: 'production' }); // lists only production networks\nawait client.listNetworks({ networkType: 'test' }); // lists only test networks\n```\n\n### Failed Requests\n\nFailed requests might return the following example response object:\n\n```js\n{\n  response: {\n    status: 404,\n    statusText: 'Not Found',\n    data: {\n      message: 'subscriber with id 8181d9e0-88ce-4db0-802a-2b56e2e6a7b1 not found.'\n    }\n  },\n  message: 'Request failed with status code 404',\n  request: {\n    path: '/subscribers/8181d9e0-88ce-4db0-802a-2b56e2e6a7b1',\n    method: 'GET'\n  }\n}\n```\n\n## FAQ\n\n**Can I use this package in a browser?**\n\nThis package is not designed to be used in a browser environment. Using this package requires sensitive API KEYS that should not be exposed publicly.\n","readmeFilename":"README.md"}