From 733154e44bde9dcd43a089ed2bc2c4ff65803e14 Mon Sep 17 00:00:00 2001 From: emanuel-sol Date: Sat, 1 Jun 2024 20:04:40 -0400 Subject: [PATCH 1/4] feat: add support for amoy --- src/types/schemas/definitions.schema.json | 1136 ++++++++++++++++++++- 1 file changed, 1135 insertions(+), 1 deletion(-) diff --git a/src/types/schemas/definitions.schema.json b/src/types/schemas/definitions.schema.json index b4ea47b..02cacdc 100644 --- a/src/types/schemas/definitions.schema.json +++ b/src/types/schemas/definitions.schema.json @@ -1 +1,1135 @@ -{"$id":"definitions.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Definitions","definitions":{"defender-id":{"title":"DefenderID","type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-(8|9|a|b)[0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"},"address":{"title":"Address","type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"risk-category":{"title":"RiskCategory","type":"string","enum":["NONE","GOVERNANCE","ACCESS-CONTROL","SUSPICIOUS","FINANCIAL","TECHNICAL"]},"public-network":{"title":"PublicNetwork","type":"string","enum":["mainnet","sepolia","goerli","xdai","sokol","fuse","bsc","bsctest","fantom","fantomtest","moonbase","moonriver","moonbeam","matic","mumbai","matic-zkevm","matic-zkevm-testnet","avalanche","fuji","arbitrum","arbitrum-nova","arbitrum-goerli","arbitrum-sepolia","optimism","optimism-goerli","optimism-sepolia","celo","alfajores","harmony-s0","harmony-test-s0","aurora","auroratest","hedera","hederatest","zksync","zksync-goerli","zksync-sepolia","base","base-goerli","base-sepolia","linea-goerli","linea","mantle","scroll","scroll-sepolia","meld","meld-kanazawa"]},"custom-network":{"title":"CustomNetwork","type":"string","enum":["x-dfk-avax-chain","x-dfk-avax-chain-test","x-security-alliance"]},"tenant-network":{"title":"TenantNetwork","type":"string"},"network":{"title":"Network","anyOf":[{"$ref":"#/definitions/supported-network"},{"$ref":"#/definitions/tenant-network"}]},"supported-network":{"title":"SupportedNetwork","oneOf":[{"$ref":"#/definitions/public-network"},{"$ref":"#/definitions/custom-network"}]},"policy":{"title":"Policy","type":"object","properties":{"gas-price-cap":{"type":"integer"},"whitelist-receivers":{"title":"WhitelistReceivers","type":"array","items":{"type":"string"}},"eip1559-pricing":{"type":"boolean"},"private-transactions":{"type":"boolean"}}},"relayer":{"title":"Relayer","type":"object","properties":{"name":{"type":"string"},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"min-balance":{"type":"integer"},"address-from-relayer":{"title":"AddressFromRelayer","anyOf":[{"type":"object"},{"type":"string"}]},"policy":{"$ref":"#/definitions/policy","format":"uri-reference"},"api-keys":{"title":"RelayerAPIKeys","type":"array","items":{"type":"string"}}},"required":["name","network","min-balance"]},"contract":{"title":"Contract","type":"object","properties":{"name":{"type":"string"},"address":{"$ref":"#/definitions/address","format":"uri-reference"},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"abi":{"$ref":"#/definitions/abi"},"nat-spec":{"type":"string"}},"required":["name","address","network"]},"notificationType":{"title":"NotificationType","type":"string","enum":["slack","email","discord","telegram","datadog","webhook","opsgenie","pager-duty"]},"datadogConfig":{"title":"DatadogConfig","type":"object","properties":{"api-key":{"type":"string"},"metric-prefix":{"type":"string","maxLength":100,"pattern":"^[A-Za-z]+[A-Za-z0-9_\\.]*\\.$"}},"required":["api-key","metric-prefix"]},"urlConfig":{"title":"UrlConfig","type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"telegramBotConfig":{"title":"TelegramConfig","type":"object","properties":{"bot-token":{"type":"string"},"chat-id":{"type":"string"}},"required":["bot-token","chat-id"]},"emailConfig":{"title":"EmailConfig","type":"object","properties":{"emails":{"title":"Emails","type":"array","items":{"type":"string","format":"email"},"default":[]}},"required":["emails"]},"opsgenieUserType":{"title":"OpsgenieUserType","type":"string","enum":["team","user","escalation","schedule"]},"opsgeniePriorityLevel":{"title":"OpsgeniePriorityLevel","type":"string","enum":["P1","P2","P3","P4","P5"]},"opsgenieInstanceLocation":{"title":"OpsgenieInstanceLocation","type":"string","enum":["US","EU"]},"opsgenieUser":{"title":"OpsgenieUser","type":"object","properties":{"username":{"type":"string"},"fullName":{"type":"string"},"id":{"type":"string"},"type":{"$ref":"#/definitions/opsgenieUserType"}},"required":["type","username"],"additionalProperties":false},"opsgenieConfig":{"title":"OpsgenieConfig","properties":{"apiKey":{"type":"string"},"instanceLocation":{"$ref":"#/definitions/opsgenieInstanceLocation"},"alias":{"type":"string","maxLength":512},"responders":{"title":"OpsgenieConfigResponders","type":"array","items":{"$ref":"#/definitions/opsgenieUser"}},"visibleTo":{"title":"OpsgenieConfigVisibleTo","type":"array","items":{"$ref":"#/definitions/opsgenieUser"}},"actions":{"title":"OpsgenieConfigActions","type":"array","maxItems":10,"items":{"type":"string","maxLength":50}},"tags":{"title":"OpsgenieConfigTags","type":"array","maxItems":10,"items":{"type":"string","maxLength":50}},"details":{"title":"OpsgenieConfigDetails","type":"object","additionalProperties":{"type":"string"}},"entity":{"type":"string","maxLength":512},"priority":{"$ref":"#/definitions/opsgeniePriorityLevel"},"note":{"type":"string","maxLength":25000}},"required":["apiKey","instanceLocation"],"additionalProperties":false},"pagerDutyEventType":{"title":"PagerDutyEventType","type":"string","enum":["change","alert"]},"pagerDutyEventAction":{"title":"PagerDutyEventAction","type":"string","enum":["trigger","acknowledge","resolve"]},"pagerDutySeverity":{"title":"PagerDutySeverity","type":"string","enum":["critical","error","warning","info"]},"pagerDutyConfig":{"title":"PagerDutyConfig","properties":{"token":{"type":"string"},"eventType":{"$ref":"#/definitions/pagerDutyEventType"},"routingKey":{"type":"string","maxLength":32,"minLength":32},"eventAction":{"$ref":"#/definitions/pagerDutyEventAction"},"dedupKey":{"type":"string","maxLength":255},"severity":{"$ref":"#/definitions/pagerDutySeverity"},"component":{"type":"string"},"group":{"type":"string"},"class":{"type":"string"},"customDetails":{"title":"PagerDutyConfigCustomDetails","type":"object","additionalProperties":{"type":"string"}}},"if":{"properties":{"eventType":{"const":"alert"}}},"then":{"required":["eventAction","severity"]},"required":["token","eventType","routingKey"],"additionalProperties":false},"notification":{"title":"Notification","type":"object","properties":{"type":{"$ref":"#/definitions/notificationType","format":"uri-reference"},"name":{"type":"string"},"paused":{"type":"boolean"},"config":{"title":"Config","type":"object","oneOf":[{"$ref":"#/definitions/emailConfig","format":"uri-reference"},{"$ref":"#/definitions/telegramBotConfig","format":"uri-reference"},{"$ref":"#/definitions/datadogConfig","format":"uri-reference"},{"$ref":"#/definitions/urlConfig","format":"uri-reference"},{"$ref":"#/definitions/opsgenieConfig","format":"uri-reference"},{"$ref":"#/definitions/pagerDutyConfig","format":"uri-reference"}]}},"required":["type","name","paused","config"]},"category":{"title":"Category","type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"notification-ids":{"title":"CategoryNotificationIds","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["name"]},"block-monitor":{"title":"BlockMonitor","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["BLOCK"]},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"contracts":{"title":"Contracts","type":"array","items":{"$ref":"#/definitions/contract-or-defender-id","format":"uri-reference"}},"addresses":{"title":"Addresses","type":"array","items":{"$ref":"#/definitions/address","format":"uri-reference"}},"abi":{"$ref":"#/definitions/abi"},"alert-threshold":{"title":"AlertThreshold","type":"object","properties":{"amount":{"type":"integer"},"window-seconds":{"type":"integer"}},"required":["amount","window-seconds"]},"paused":{"type":"boolean"},"skip-abi-validation":{"type":"boolean","description":"A boolean value that indicates whether the UI should skip ABI validation checks. Enable this if you wish to use custom or partial ABIs for your monitors."},"action-condition":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"action-trigger":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"confirm-level":{"oneOf":[{"type":"string","enum":["safe","finalized"]},{"type":"integer"}]},"notify-config":{"title":"NotifyConfig","type":"object","properties":{"timeout":{"type":"integer"},"message":{"type":"string"},"message-subject":{"type":"string"},"category":{"$ref":"#/definitions/category-or-defender-id","format":"uri-reference"},"channels":{"title":"Channels","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["channels"]},"conditions":{"title":"Conditions","type":"object","properties":{"event":{"title":"Event","type":"array","items":{"title":"EventItems","type":"object","properties":{"signature":{"type":"string"},"expression":{"type":"string"}},"required":["signature"]}},"function":{"title":"Function","type":"array","items":{"title":"FunctionItems","type":"object","properties":{"signature":{"type":"string"},"expression":{"type":"string"}},"required":["signature"]}},"transaction":{"type":"string"}}},"risk-category":{"$ref":"#/definitions/risk-category"}},"required":["name","type","network","notify-config"]},"forta-monitor":{"title":"FortaMonitor","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["FORTA"]},"network":{"$ref":"#/definitions/network","format":"uri-reference"},"contracts":{"title":"Contracts","type":"array","items":{"$ref":"#/definitions/contract-or-defender-id","format":"uri-reference"}},"addresses":{"title":"Addresses","type":"array","items":{"$ref":"#/definitions/address","format":"uri-reference"}},"abi":{"$ref":"#/definitions/abi"},"alert-threshold":{"title":"AlertThreshold","type":"object","properties":{"amount":{"type":"integer"},"window-seconds":{"type":"integer"}}},"paused":{"type":"boolean"},"action-condition":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"action-trigger":{"$ref":"#/definitions/action-or-defender-id","format":"uri-reference"},"notify-config":{"title":"NotifyConfig","type":"object","properties":{"timeout":{"type":"integer"},"message":{"type":"string"},"message-subject":{"type":"string"},"category":{"$ref":"#/definitions/category-or-defender-id","format":"uri-reference"},"channels":{"title":"Channels","type":"array","items":{"$ref":"#/definitions/notification-or-defender-id","format":"uri-reference"}}},"required":["channels"]},"conditions":{"title":"Conditions","type":"object","properties":{"min-scanner-count":{"type":"integer"},"severity":{"type":"integer","enum":[0,1,2,3,4,5]},"alert-ids":{"title":"AlertIDs","type":"array","items":{"type":"string"}}},"required":["min-scanner-count"]},"forta-node-id":{"type":"string"},"forta-last-processed-time":{"type":"string"},"agent-ids":{"title":"AgentIDs","type":"array","items":{"type":"string"}},"risk-category":{"$ref":"#/definitions/risk-category"}},"required":["name","type","notify-config"],"dependencies":{"addresses":["network"],"network":["addresses"]}},"monitor":{"title":"Monitor","type":"object","oneOf":[{"$ref":"#/definitions/block-monitor","format":"uri-reference"},{"$ref":"#/definitions/forta-monitor","format":"uri-reference"}]},"relayer-or-defender-id":{"title":"RelayerOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/relayer","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"action-or-defender-id":{"title":"ActionOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/action","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"monitor-or-defender-id":{"title":"MonitorOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/monitor","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"forked-network-or-defender-id":{"title":"ForkedNetworkOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/forked-network-request","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"private-network-or-defender-id":{"title":"PrivateNetworkOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/private-network-request","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"block-explorer-api-key-or-defender-id":{"title":"BlockExplorerApiKeyOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/block-explorer-api-key","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"category-or-defender-id":{"title":"CategoryOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/category","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"notification-or-defender-id":{"title":"NotificationOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/notification","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"contract-or-defender-id":{"title":"ContractOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/contract","format":"uri-reference"},{"title":"DefenderID","type":"string","pattern":"^[a-zA-Z0-9]+[-]{1}0x[a-fA-F0-9]{40}$"}]},"policy-or-defender-id":{"title":"PolicyOrDefenderID","anyOf":[{"type":"object","$ref":"#/definitions/policy","format":"uri-reference"},{"type":"string","$ref":"#/definitions/defender-id","format":"uri-reference"}]},"action":{"title":"Action","type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"relayer":{"$ref":"#/definitions/relayer-or-defender-id","format":"uri-reference"},"trigger":{"title":"Trigger","type":"object","properties":{"type":{"title":"TriggerType","type":"string","enum":["schedule","webhook","sentinel","monitor-filter"]},"cron":{"title":"TriggerCron","type":"string"},"frequency":{"title":"TriggerFrequency","type":"integer"}},"if":{"properties":{"type":{"const":"schedule"}}},"then":{"oneOf":[{"required":["cron"]},{"required":["frequency"]}]},"else":{},"required":["type"]},"paused":{"type":"boolean"},"environment-variables":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name","path","trigger","paused"]},"block-explorer-api-key":{"title":"BlockExplorerApiKey","type":"object","properties":{"key":{"type":"string"},"network":{"$ref":"#/definitions/network","format":"uri-reference"}},"required":["key","network"]},"abi":{"title":"AbiType","anyOf":[{"title":"StringABI","type":"string"},{"title":"ArrayABI","type":"array","items":{"type":"string"}}]},"safe-contracts":{"title":"SafeContracts","type":"object","additionalProperties":false,"required":["master","proxy-factory","multi-send-call-only"],"properties":{"master":{"$ref":"#/definitions/address","format":"uri-reference"},"proxy-factory":{"$ref":"#/definitions/address","format":"uri-reference"},"multi-send-call-only":{"$ref":"#/definitions/address","format":"uri-reference"},"create-call":{"$ref":"#/definitions/address","format":"uri-reference"}}},"tenant-network-eip-configuration":{"title":"TenantNetworkEIPConfiguration","type":"object","additionalProperties":false,"properties":{"isEIP1559":{"type":"boolean"}}},"tenant-network-configuration":{"title":"TenantNetworkConfiguration","type":"object","additionalProperties":false,"required":["symbol"],"properties":{"symbol":{"type":"string","minLength":3,"maxLength":6},"eips":{"$ref":"#/definitions/tenant-network-eip-configuration"},"safe-contracts":{"$ref":"#/definitions/safe-contracts"},"subgraph-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}},"forked-network-request":{"title":"ForkedNetworkRequest","type":"object","additionalProperties":false,"required":["name","supported-network","rpc-url"],"properties":{"name":{"$ref":"#/definitions/tenant-network"},"supported-network":{"$ref":"#/definitions/supported-network"},"rpc-url":{"type":"string","pattern":"^(http|https)://"},"api-key":{"type":"string"},"block-explorer-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}},"private-network-request":{"title":"PrivateNetworkRequest","type":"object","additionalProperties":false,"required":["name","configuration","rpc-url"],"properties":{"name":{"$ref":"#/definitions/tenant-network"},"configuration":{"$ref":"#/definitions/tenant-network-configuration"},"rpc-url":{"type":"string","pattern":"^(http|https)://"},"api-key":{"type":"string"},"block-explorer-url":{"type":"string","pattern":"^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"}}}}} +{ + "$id": "definitions.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Definitions", + "definitions": { + "defender-id": { + "title": "DefenderID", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-(8|9|a|b)[0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "address": { + "title": "Address", + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "risk-category": { + "title": "RiskCategory", + "type": "string", + "enum": ["NONE", "GOVERNANCE", "ACCESS-CONTROL", "SUSPICIOUS", "FINANCIAL", "TECHNICAL"] + }, + "public-network": { + "title": "PublicNetwork", + "type": "string", + "enum": [ + "alfajores", + "amoy", + "arbitrum", + "arbitrum-goerli", + "arbitrum-nova", + "arbitrum-sepolia", + "aurora", + "auroratest", + "avalanche", + "base", + "base-goerli", + "base-sepolia", + "bsc", + "bsctest", + "celo", + "fantom", + "fantomtest", + "fuji", + "fuse", + "goerli", + "harmony-s0", + "harmony-test-s0", + "hedera", + "hederatest", + "linea", + "linea-goerli", + "mainnet", + "mantle", + "matic", + "matic-zkevm", + "matic-zkevm-testnet", + "meld", + "meld-kanazawa", + "moonbase", + "moonbeam", + "moonriver", + "mumbai", + "optimism", + "optimism-goerli", + "optimism-sepolia", + "scroll", + "scroll-sepolia", + "sepolia", + "sokol", + "xdai", + "zksync", + "zksync-goerli", + "zksync-sepolia" + ] + }, + "custom-network": { + "title": "CustomNetwork", + "type": "string", + "enum": ["x-dfk-avax-chain", "x-dfk-avax-chain-test", "x-security-alliance"] + }, + "tenant-network": { + "title": "TenantNetwork", + "type": "string" + }, + "network": { + "title": "Network", + "anyOf": [ + { + "$ref": "#/definitions/supported-network" + }, + { + "$ref": "#/definitions/tenant-network" + } + ] + }, + "supported-network": { + "title": "SupportedNetwork", + "oneOf": [ + { + "$ref": "#/definitions/public-network" + }, + { + "$ref": "#/definitions/custom-network" + } + ] + }, + "policy": { + "title": "Policy", + "type": "object", + "properties": { + "gas-price-cap": { + "type": "integer" + }, + "whitelist-receivers": { + "title": "WhitelistReceivers", + "type": "array", + "items": { + "type": "string" + } + }, + "eip1559-pricing": { + "type": "boolean" + }, + "private-transactions": { + "type": "boolean" + } + } + }, + "relayer": { + "title": "Relayer", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "network": { + "$ref": "#/definitions/network", + "format": "uri-reference" + }, + "min-balance": { + "type": "integer" + }, + "address-from-relayer": { + "title": "AddressFromRelayer", + "anyOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + }, + "policy": { + "$ref": "#/definitions/policy", + "format": "uri-reference" + }, + "api-keys": { + "title": "RelayerAPIKeys", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "network", "min-balance"] + }, + "contract": { + "title": "Contract", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "address": { + "$ref": "#/definitions/address", + "format": "uri-reference" + }, + "network": { + "$ref": "#/definitions/network", + "format": "uri-reference" + }, + "abi": { + "$ref": "#/definitions/abi" + }, + "nat-spec": { + "type": "string" + } + }, + "required": ["name", "address", "network"] + }, + "notificationType": { + "title": "NotificationType", + "type": "string", + "enum": ["slack", "email", "discord", "telegram", "datadog", "webhook", "opsgenie", "pager-duty"] + }, + "datadogConfig": { + "title": "DatadogConfig", + "type": "object", + "properties": { + "api-key": { + "type": "string" + }, + "metric-prefix": { + "type": "string", + "maxLength": 100, + "pattern": "^[A-Za-z]+[A-Za-z0-9_\\.]*\\.$" + } + }, + "required": ["api-key", "metric-prefix"] + }, + "urlConfig": { + "title": "UrlConfig", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri" + } + }, + "required": ["url"] + }, + "telegramBotConfig": { + "title": "TelegramConfig", + "type": "object", + "properties": { + "bot-token": { + "type": "string" + }, + "chat-id": { + "type": "string" + } + }, + "required": ["bot-token", "chat-id"] + }, + "emailConfig": { + "title": "EmailConfig", + "type": "object", + "properties": { + "emails": { + "title": "Emails", + "type": "array", + "items": { + "type": "string", + "format": "email" + }, + "default": [] + } + }, + "required": ["emails"] + }, + "opsgenieUserType": { + "title": "OpsgenieUserType", + "type": "string", + "enum": ["team", "user", "escalation", "schedule"] + }, + "opsgeniePriorityLevel": { + "title": "OpsgeniePriorityLevel", + "type": "string", + "enum": ["P1", "P2", "P3", "P4", "P5"] + }, + "opsgenieInstanceLocation": { + "title": "OpsgenieInstanceLocation", + "type": "string", + "enum": ["US", "EU"] + }, + "opsgenieUser": { + "title": "OpsgenieUser", + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "fullName": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/opsgenieUserType" + } + }, + "required": ["type", "username"], + "additionalProperties": false + }, + "opsgenieConfig": { + "title": "OpsgenieConfig", + "properties": { + "apiKey": { + "type": "string" + }, + "instanceLocation": { + "$ref": "#/definitions/opsgenieInstanceLocation" + }, + "alias": { + "type": "string", + "maxLength": 512 + }, + "responders": { + "title": "OpsgenieConfigResponders", + "type": "array", + "items": { + "$ref": "#/definitions/opsgenieUser" + } + }, + "visibleTo": { + "title": "OpsgenieConfigVisibleTo", + "type": "array", + "items": { + "$ref": "#/definitions/opsgenieUser" + } + }, + "actions": { + "title": "OpsgenieConfigActions", + "type": "array", + "maxItems": 10, + "items": { + "type": "string", + "maxLength": 50 + } + }, + "tags": { + "title": "OpsgenieConfigTags", + "type": "array", + "maxItems": 10, + "items": { + "type": "string", + "maxLength": 50 + } + }, + "details": { + "title": "OpsgenieConfigDetails", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "entity": { + "type": "string", + "maxLength": 512 + }, + "priority": { + "$ref": "#/definitions/opsgeniePriorityLevel" + }, + "note": { + "type": "string", + "maxLength": 25000 + } + }, + "required": ["apiKey", "instanceLocation"], + "additionalProperties": false + }, + "pagerDutyEventType": { + "title": "PagerDutyEventType", + "type": "string", + "enum": ["change", "alert"] + }, + "pagerDutyEventAction": { + "title": "PagerDutyEventAction", + "type": "string", + "enum": ["trigger", "acknowledge", "resolve"] + }, + "pagerDutySeverity": { + "title": "PagerDutySeverity", + "type": "string", + "enum": ["critical", "error", "warning", "info"] + }, + "pagerDutyConfig": { + "title": "PagerDutyConfig", + "properties": { + "token": { + "type": "string" + }, + "eventType": { + "$ref": "#/definitions/pagerDutyEventType" + }, + "routingKey": { + "type": "string", + "maxLength": 32, + "minLength": 32 + }, + "eventAction": { + "$ref": "#/definitions/pagerDutyEventAction" + }, + "dedupKey": { + "type": "string", + "maxLength": 255 + }, + "severity": { + "$ref": "#/definitions/pagerDutySeverity" + }, + "component": { + "type": "string" + }, + "group": { + "type": "string" + }, + "class": { + "type": "string" + }, + "customDetails": { + "title": "PagerDutyConfigCustomDetails", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "if": { + "properties": { + "eventType": { + "const": "alert" + } + } + }, + "then": { + "required": ["eventAction", "severity"] + }, + "required": ["token", "eventType", "routingKey"], + "additionalProperties": false + }, + "notification": { + "title": "Notification", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/notificationType", + "format": "uri-reference" + }, + "name": { + "type": "string" + }, + "paused": { + "type": "boolean" + }, + "config": { + "title": "Config", + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/emailConfig", + "format": "uri-reference" + }, + { + "$ref": "#/definitions/telegramBotConfig", + "format": "uri-reference" + }, + { + "$ref": "#/definitions/datadogConfig", + "format": "uri-reference" + }, + { + "$ref": "#/definitions/urlConfig", + "format": "uri-reference" + }, + { + "$ref": "#/definitions/opsgenieConfig", + "format": "uri-reference" + }, + { + "$ref": "#/definitions/pagerDutyConfig", + "format": "uri-reference" + } + ] + } + }, + "required": ["type", "name", "paused", "config"] + }, + "category": { + "title": "Category", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "notification-ids": { + "title": "CategoryNotificationIds", + "type": "array", + "items": { + "$ref": "#/definitions/notification-or-defender-id", + "format": "uri-reference" + } + } + }, + "required": ["name"] + }, + "block-monitor": { + "title": "BlockMonitor", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["BLOCK"] + }, + "network": { + "$ref": "#/definitions/network", + "format": "uri-reference" + }, + "contracts": { + "title": "Contracts", + "type": "array", + "items": { + "$ref": "#/definitions/contract-or-defender-id", + "format": "uri-reference" + } + }, + "addresses": { + "title": "Addresses", + "type": "array", + "items": { + "$ref": "#/definitions/address", + "format": "uri-reference" + } + }, + "abi": { + "$ref": "#/definitions/abi" + }, + "alert-threshold": { + "title": "AlertThreshold", + "type": "object", + "properties": { + "amount": { + "type": "integer" + }, + "window-seconds": { + "type": "integer" + } + }, + "required": ["amount", "window-seconds"] + }, + "paused": { + "type": "boolean" + }, + "skip-abi-validation": { + "type": "boolean", + "description": "A boolean value that indicates whether the UI should skip ABI validation checks. Enable this if you wish to use custom or partial ABIs for your monitors." + }, + "action-condition": { + "$ref": "#/definitions/action-or-defender-id", + "format": "uri-reference" + }, + "action-trigger": { + "$ref": "#/definitions/action-or-defender-id", + "format": "uri-reference" + }, + "confirm-level": { + "oneOf": [ + { + "type": "string", + "enum": ["safe", "finalized"] + }, + { + "type": "integer" + } + ] + }, + "notify-config": { + "title": "NotifyConfig", + "type": "object", + "properties": { + "timeout": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "message-subject": { + "type": "string" + }, + "category": { + "$ref": "#/definitions/category-or-defender-id", + "format": "uri-reference" + }, + "channels": { + "title": "Channels", + "type": "array", + "items": { + "$ref": "#/definitions/notification-or-defender-id", + "format": "uri-reference" + } + } + }, + "required": ["channels"] + }, + "conditions": { + "title": "Conditions", + "type": "object", + "properties": { + "event": { + "title": "Event", + "type": "array", + "items": { + "title": "EventItems", + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "expression": { + "type": "string" + } + }, + "required": ["signature"] + } + }, + "function": { + "title": "Function", + "type": "array", + "items": { + "title": "FunctionItems", + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "expression": { + "type": "string" + } + }, + "required": ["signature"] + } + }, + "transaction": { + "type": "string" + } + } + }, + "risk-category": { + "$ref": "#/definitions/risk-category" + } + }, + "required": ["name", "type", "network", "notify-config"] + }, + "forta-monitor": { + "title": "FortaMonitor", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["FORTA"] + }, + "network": { + "$ref": "#/definitions/network", + "format": "uri-reference" + }, + "contracts": { + "title": "Contracts", + "type": "array", + "items": { + "$ref": "#/definitions/contract-or-defender-id", + "format": "uri-reference" + } + }, + "addresses": { + "title": "Addresses", + "type": "array", + "items": { + "$ref": "#/definitions/address", + "format": "uri-reference" + } + }, + "abi": { + "$ref": "#/definitions/abi" + }, + "alert-threshold": { + "title": "AlertThreshold", + "type": "object", + "properties": { + "amount": { + "type": "integer" + }, + "window-seconds": { + "type": "integer" + } + } + }, + "paused": { + "type": "boolean" + }, + "action-condition": { + "$ref": "#/definitions/action-or-defender-id", + "format": "uri-reference" + }, + "action-trigger": { + "$ref": "#/definitions/action-or-defender-id", + "format": "uri-reference" + }, + "notify-config": { + "title": "NotifyConfig", + "type": "object", + "properties": { + "timeout": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "message-subject": { + "type": "string" + }, + "category": { + "$ref": "#/definitions/category-or-defender-id", + "format": "uri-reference" + }, + "channels": { + "title": "Channels", + "type": "array", + "items": { + "$ref": "#/definitions/notification-or-defender-id", + "format": "uri-reference" + } + } + }, + "required": ["channels"] + }, + "conditions": { + "title": "Conditions", + "type": "object", + "properties": { + "min-scanner-count": { + "type": "integer" + }, + "severity": { + "type": "integer", + "enum": [0, 1, 2, 3, 4, 5] + }, + "alert-ids": { + "title": "AlertIDs", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["min-scanner-count"] + }, + "forta-node-id": { + "type": "string" + }, + "forta-last-processed-time": { + "type": "string" + }, + "agent-ids": { + "title": "AgentIDs", + "type": "array", + "items": { + "type": "string" + } + }, + "risk-category": { + "$ref": "#/definitions/risk-category" + } + }, + "required": ["name", "type", "notify-config"], + "dependencies": { + "addresses": ["network"], + "network": ["addresses"] + } + }, + "monitor": { + "title": "Monitor", + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/block-monitor", + "format": "uri-reference" + }, + { + "$ref": "#/definitions/forta-monitor", + "format": "uri-reference" + } + ] + }, + "relayer-or-defender-id": { + "title": "RelayerOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/relayer", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "action-or-defender-id": { + "title": "ActionOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/action", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "monitor-or-defender-id": { + "title": "MonitorOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/monitor", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "forked-network-or-defender-id": { + "title": "ForkedNetworkOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/forked-network-request", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "private-network-or-defender-id": { + "title": "PrivateNetworkOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/private-network-request", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "block-explorer-api-key-or-defender-id": { + "title": "BlockExplorerApiKeyOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/block-explorer-api-key", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "category-or-defender-id": { + "title": "CategoryOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/category", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "notification-or-defender-id": { + "title": "NotificationOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/notification", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "contract-or-defender-id": { + "title": "ContractOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/contract", + "format": "uri-reference" + }, + { + "title": "DefenderID", + "type": "string", + "pattern": "^[a-zA-Z0-9]+[-]{1}0x[a-fA-F0-9]{40}$" + } + ] + }, + "policy-or-defender-id": { + "title": "PolicyOrDefenderID", + "anyOf": [ + { + "type": "object", + "$ref": "#/definitions/policy", + "format": "uri-reference" + }, + { + "type": "string", + "$ref": "#/definitions/defender-id", + "format": "uri-reference" + } + ] + }, + "action": { + "title": "Action", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "relayer": { + "$ref": "#/definitions/relayer-or-defender-id", + "format": "uri-reference" + }, + "trigger": { + "title": "Trigger", + "type": "object", + "properties": { + "type": { + "title": "TriggerType", + "type": "string", + "enum": ["schedule", "webhook", "sentinel", "monitor-filter"] + }, + "cron": { + "title": "TriggerCron", + "type": "string" + }, + "frequency": { + "title": "TriggerFrequency", + "type": "integer" + } + }, + "if": { + "properties": { + "type": { + "const": "schedule" + } + } + }, + "then": { + "oneOf": [ + { + "required": ["cron"] + }, + { + "required": ["frequency"] + } + ] + }, + "else": {}, + "required": ["type"] + }, + "paused": { + "type": "boolean" + }, + "environment-variables": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": ["name", "path", "trigger", "paused"] + }, + "block-explorer-api-key": { + "title": "BlockExplorerApiKey", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "network": { + "$ref": "#/definitions/network", + "format": "uri-reference" + } + }, + "required": ["key", "network"] + }, + "abi": { + "title": "AbiType", + "anyOf": [ + { + "title": "StringABI", + "type": "string" + }, + { + "title": "ArrayABI", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "safe-contracts": { + "title": "SafeContracts", + "type": "object", + "additionalProperties": false, + "required": ["master", "proxy-factory", "multi-send-call-only"], + "properties": { + "master": { + "$ref": "#/definitions/address", + "format": "uri-reference" + }, + "proxy-factory": { + "$ref": "#/definitions/address", + "format": "uri-reference" + }, + "multi-send-call-only": { + "$ref": "#/definitions/address", + "format": "uri-reference" + }, + "create-call": { + "$ref": "#/definitions/address", + "format": "uri-reference" + } + } + }, + "tenant-network-eip-configuration": { + "title": "TenantNetworkEIPConfiguration", + "type": "object", + "additionalProperties": false, + "properties": { + "isEIP1559": { + "type": "boolean" + } + } + }, + "tenant-network-configuration": { + "title": "TenantNetworkConfiguration", + "type": "object", + "additionalProperties": false, + "required": ["symbol"], + "properties": { + "symbol": { + "type": "string", + "minLength": 3, + "maxLength": 6 + }, + "eips": { + "$ref": "#/definitions/tenant-network-eip-configuration" + }, + "safe-contracts": { + "$ref": "#/definitions/safe-contracts" + }, + "subgraph-url": { + "type": "string", + "pattern": "^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$" + } + } + }, + "forked-network-request": { + "title": "ForkedNetworkRequest", + "type": "object", + "additionalProperties": false, + "required": ["name", "supported-network", "rpc-url"], + "properties": { + "name": { + "$ref": "#/definitions/tenant-network" + }, + "supported-network": { + "$ref": "#/definitions/supported-network" + }, + "rpc-url": { + "type": "string", + "pattern": "^(http|https)://" + }, + "api-key": { + "type": "string" + }, + "block-explorer-url": { + "type": "string", + "pattern": "^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$" + } + } + }, + "private-network-request": { + "title": "PrivateNetworkRequest", + "type": "object", + "additionalProperties": false, + "required": ["name", "configuration", "rpc-url"], + "properties": { + "name": { + "$ref": "#/definitions/tenant-network" + }, + "configuration": { + "$ref": "#/definitions/tenant-network-configuration" + }, + "rpc-url": { + "type": "string", + "pattern": "^(http|https)://" + }, + "api-key": { + "type": "string" + }, + "block-explorer-url": { + "type": "string", + "pattern": "^(http(s)?://)[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$" + } + } + } + } +} From 4e7023ccf871ed9256213abf1f766c3a368b2e80 Mon Sep 17 00:00:00 2001 From: emanuel-sol Date: Sat, 1 Jun 2024 20:05:51 -0400 Subject: [PATCH 2/4] docs: update PublicNetowrk doc --- .../definitions-definitions-publicnetwork.md | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/types/docs/definitions-definitions-publicnetwork.md b/src/types/docs/definitions-definitions-publicnetwork.md index f77795a..ab3335d 100644 --- a/src/types/docs/definitions-definitions-publicnetwork.md +++ b/src/types/docs/definitions-definitions-publicnetwork.md @@ -8,50 +8,51 @@ | Value | Explanation | | :---------------------- | :---------- | -| `"mainnet"` | | -| `"sepolia"` | | -| `"goerli"` | | -| `"xdai"` | | -| `"sokol"` | | -| `"fuse"` | | +| `"alfajores"` | | +| `"amoy"` | | +| `"arbitrum"` | | +| `"arbitrum-goerli"` | | +| `"arbitrum-nova"` | | +| `"arbitrum-sepolia"` | | +| `"aurora"` | | +| `"auroratest"` | | +| `"avalanche"` | | +| `"base"` | | +| `"base-goerli"` | | +| `"base-sepolia"` | | | `"bsc"` | | | `"bsctest"` | | +| `"celo"` | | | `"fantom"` | | | `"fantomtest"` | | -| `"moonbase"` | | -| `"moonriver"` | | -| `"moonbeam"` | | -| `"matic"` | | -| `"mumbai"` | | -| `"matic-zkevm"` | | -| `"matic-zkevm-testnet"` | | -| `"avalanche"` | | | `"fuji"` | | -| `"arbitrum"` | | -| `"arbitrum-nova"` | | -| `"arbitrum-goerli"` | | -| `"arbitrum-sepolia"` | | -| `"optimism"` | | -| `"optimism-goerli"` | | -| `"optimism-sepolia"` | | -| `"celo"` | | -| `"alfajores"` | | +| `"fuse"` | | +| `"goerli"` | | | `"harmony-s0"` | | | `"harmony-test-s0"` | | -| `"aurora"` | | -| `"auroratest"` | | | `"hedera"` | | | `"hederatest"` | | -| `"zksync"` | | -| `"zksync-goerli"` | | -| `"zksync-sepolia"` | | -| `"base"` | | -| `"base-goerli"` | | -| `"base-sepolia"` | | -| `"linea-goerli"` | | | `"linea"` | | +| `"linea-goerli"` | | +| `"mainnet"` | | | `"mantle"` | | -| `"scroll"` | | -| `"scroll-sepolia"` | | +| `"matic"` | | +| `"matic-zkevm"` | | +| `"matic-zkevm-testnet"` | | | `"meld"` | | | `"meld-kanazawa"` | | +| `"moonbase"` | | +| `"moonbeam"` | | +| `"moonriver"` | | +| `"mumbai"` | | +| `"optimism"` | | +| `"optimism-goerli"` | | +| `"optimism-sepolia"` | | +| `"scroll"` | | +| `"scroll-sepolia"` | | +| `"sepolia"` | | +| `"sokol"` | | +| `"xdai"` | | +| `"zksync"` | | +| `"zksync-goerli"` | | +| `"zksync-sepolia"` | | From 4ac42aeb633b699f69c404b43b2fbb55a52842e1 Mon Sep 17 00:00:00 2001 From: emanuel-sol Date: Sat, 1 Jun 2024 20:08:50 -0400 Subject: [PATCH 3/4] feat: add type amoy to PublicNetwork --- src/types/types/resources.schema.d.ts | 501 +++++++++++++------------- 1 file changed, 251 insertions(+), 250 deletions(-) diff --git a/src/types/types/resources.schema.d.ts b/src/types/types/resources.schema.d.ts index d4485e5..0f8cbcc 100644 --- a/src/types/types/resources.schema.d.ts +++ b/src/types/types/resources.schema.d.ts @@ -10,53 +10,54 @@ export type RelayerOrDefenderID = Relayer | DefenderID; export type Network = SupportedNetwork | TenantNetwork; export type SupportedNetwork = PublicNetwork | CustomNetwork; export type PublicNetwork = - | 'mainnet' - | 'sepolia' - | 'goerli' - | 'xdai' - | 'sokol' - | 'fuse' - | 'bsc' - | 'bsctest' - | 'fantom' - | 'fantomtest' + | 'alfajores' + | 'amoy' + | 'arbitrum' + | 'arbitrum-goerli' + | 'arbitrum-nova' + | 'arbitrum-sepolia' + | 'aurora' + | 'auroratest' + | 'avalanche' + | 'base' + | 'base-goerli' + | 'base-sepolia' + | 'bsc' + | 'bsctest' + | 'celo' + | 'fantom' + | 'fantomtest' + | 'fuji' + | 'fuse' + | 'goerli' + | 'harmony-s0' + | 'harmony-test-s0' + | 'hedera' + | 'hederatest' + | 'linea' + | 'linea-goerli' + | 'mainnet' + | 'mantle' + | 'matic' + | 'matic-zkevm' + | 'matic-zkevm-testnet' + | 'meld' + | 'meld-kanazawa'; | 'moonbase' - | 'moonriver' - | 'moonbeam' - | 'matic' - | 'mumbai' - | 'matic-zkevm' - | 'matic-zkevm-testnet' - | 'avalanche' - | 'fuji' - | 'arbitrum' - | 'arbitrum-nova' - | 'arbitrum-goerli' - | 'arbitrum-sepolia' - | 'optimism' - | 'optimism-goerli' - | 'optimism-sepolia' - | 'celo' - | 'alfajores' - | 'harmony-s0' - | 'harmony-test-s0' - | 'aurora' - | 'auroratest' - | 'hedera' - | 'hederatest' - | 'zksync' - | 'zksync-goerli' - | 'zksync-sepolia' - | 'base' - | 'base-goerli' - | 'base-sepolia' - | 'linea-goerli' - | 'linea' - | 'mantle' - | 'scroll' - | 'scroll-sepolia' - | 'meld' - | 'meld-kanazawa'; + | 'moonbeam' + | 'moonriver' + | 'mumbai' + | 'optimism' + | 'optimism-goerli' + | 'optimism-sepolia' + | 'scroll' + | 'scroll-sepolia' + | 'sepolia' + | 'sokol' + | 'xdai' + | 'zksync' + | 'zksync-goerli' + | 'zksync-sepolia' export type CustomNetwork = 'x-dfk-avax-chain' | 'x-dfk-avax-chain-test' | 'x-security-alliance'; export type TenantNetwork = string; export type AddressFromRelayer = {} | string; @@ -69,14 +70,14 @@ export type TriggerFrequency = number; export type DefenderID1 = string; export type NotificationOrDefenderID = Notification | DefenderID2; export type NotificationType = - | 'slack' - | 'email' - | 'discord' - | 'telegram' - | 'datadog' - | 'webhook' - | 'opsgenie' - | 'pager-duty'; + | 'slack' + | 'email' + | 'discord' + | 'telegram' + | 'datadog' + | 'webhook' + | 'opsgenie' + | 'pager-duty'; export type Config = EmailConfig | TelegramConfig | DatadogConfig | UrlConfig | OpsgenieConfig | PagerDutyConfig; export type Emails = string[]; export type OpsgenieInstanceLocation = 'US' | 'EU'; @@ -87,32 +88,32 @@ export type OpsgenieConfigVisibleTo = OpsgenieUser[]; * @maxItems 10 */ export type OpsgenieConfigActions = - | [] - | [string] - | [string, string] - | [string, string, string] - | [string, string, string, string] - | [string, string, string, string, string] - | [string, string, string, string, string, string] - | [string, string, string, string, string, string, string] - | [string, string, string, string, string, string, string, string] - | [string, string, string, string, string, string, string, string, string] - | [string, string, string, string, string, string, string, string, string, string]; + | [] + | [string] + | [string, string] + | [string, string, string] + | [string, string, string, string] + | [string, string, string, string, string] + | [string, string, string, string, string, string] + | [string, string, string, string, string, string, string] + | [string, string, string, string, string, string, string, string] + | [string, string, string, string, string, string, string, string, string] + | [string, string, string, string, string, string, string, string, string, string]; /** * @maxItems 10 */ export type OpsgenieConfigTags = - | [] - | [string] - | [string, string] - | [string, string, string] - | [string, string, string, string] - | [string, string, string, string, string] - | [string, string, string, string, string, string] - | [string, string, string, string, string, string, string] - | [string, string, string, string, string, string, string, string] - | [string, string, string, string, string, string, string, string, string] - | [string, string, string, string, string, string, string, string, string, string]; + | [] + | [string] + | [string, string] + | [string, string, string] + | [string, string, string, string] + | [string, string, string, string, string] + | [string, string, string, string, string, string] + | [string, string, string, string, string, string, string] + | [string, string, string, string, string, string, string, string] + | [string, string, string, string, string, string, string, string, string] + | [string, string, string, string, string, string, string, string, string, string]; export type OpsgeniePriorityLevel = 'P1' | 'P2' | 'P3' | 'P4' | 'P5'; export type PagerDutyEventType = 'change' | 'alert'; export type PagerDutyEventAction = 'trigger' | 'acknowledge' | 'resolve'; @@ -173,270 +174,270 @@ export type Address6 = string; export type DefenderID9 = string; export interface Resources { - actions?: Actions; - notifications?: Notifications; - categories?: Categories; - relayers?: Relayers; - policies?: Policies; - contracts?: Contracts; - secrets?: ActionSecrets; - monitors?: Monitors; - 'block-explorer-api-keys'?: BlockExplorerApiKeys; - 'forked-networks'?: ForkedNetworks; - 'private-networks'?: PrivateNetworks; + actions?: Actions; + notifications?: Notifications; + categories?: Categories; + relayers?: Relayers; + policies?: Policies; + contracts?: Contracts; + secrets?: ActionSecrets; + monitors?: Monitors; + 'block-explorer-api-keys'?: BlockExplorerApiKeys; + 'forked-networks'?: ForkedNetworks; + 'private-networks'?: PrivateNetworks; } export interface Actions { - [k: string]: ActionOrDefenderID; + [k: string]: ActionOrDefenderID; } export interface Action { - name: string; - path: string; - relayer?: RelayerOrDefenderID; - trigger: Trigger; - paused: boolean; - 'environment-variables'?: { - [k: string]: string; - }; + name: string; + path: string; + relayer?: RelayerOrDefenderID; + trigger: Trigger; + paused: boolean; + 'environment-variables'?: { + [k: string]: string; + }; } export interface Relayer { - name: string; - network: Network; - 'min-balance': number; - 'address-from-relayer'?: AddressFromRelayer; - policy?: Policy; - 'api-keys'?: RelayerAPIKeys; + name: string; + network: Network; + 'min-balance': number; + 'address-from-relayer'?: AddressFromRelayer; + policy?: Policy; + 'api-keys'?: RelayerAPIKeys; } export interface Policy { - 'gas-price-cap'?: number; - 'whitelist-receivers'?: WhitelistReceivers; - 'eip1559-pricing'?: boolean; - 'private-transactions'?: boolean; + 'gas-price-cap'?: number; + 'whitelist-receivers'?: WhitelistReceivers; + 'eip1559-pricing'?: boolean; + 'private-transactions'?: boolean; } export interface Trigger { - type: TriggerType; - cron?: TriggerCron; - frequency?: TriggerFrequency; + type: TriggerType; + cron?: TriggerCron; + frequency?: TriggerFrequency; } export interface Notifications { - [k: string]: NotificationOrDefenderID; + [k: string]: NotificationOrDefenderID; } export interface Notification { - type: NotificationType; - name: string; - paused: boolean; - config: Config; + type: NotificationType; + name: string; + paused: boolean; + config: Config; } export interface EmailConfig { - emails: Emails; + emails: Emails; } export interface TelegramConfig { - 'bot-token': string; - 'chat-id': string; + 'bot-token': string; + 'chat-id': string; } export interface DatadogConfig { - 'api-key': string; - 'metric-prefix': string; + 'api-key': string; + 'metric-prefix': string; } export interface UrlConfig { - url: string; + url: string; } export interface OpsgenieConfig { - apiKey: string; - instanceLocation: OpsgenieInstanceLocation; - alias?: string; - responders?: OpsgenieConfigResponders; - visibleTo?: OpsgenieConfigVisibleTo; - actions?: OpsgenieConfigActions; - tags?: OpsgenieConfigTags; - details?: OpsgenieConfigDetails; - entity?: string; - priority?: OpsgeniePriorityLevel; - note?: string; + apiKey: string; + instanceLocation: OpsgenieInstanceLocation; + alias?: string; + responders?: OpsgenieConfigResponders; + visibleTo?: OpsgenieConfigVisibleTo; + actions?: OpsgenieConfigActions; + tags?: OpsgenieConfigTags; + details?: OpsgenieConfigDetails; + entity?: string; + priority?: OpsgeniePriorityLevel; + note?: string; } export interface OpsgenieUser { - username: string; - fullName?: string; - id?: string; - type: OpsgenieUserType; + username: string; + fullName?: string; + id?: string; + type: OpsgenieUserType; } export interface OpsgenieConfigDetails { - [k: string]: string; + [k: string]: string; } export interface PagerDutyConfig { - token: string; - eventType: PagerDutyEventType; - routingKey: string; - eventAction?: PagerDutyEventAction; - dedupKey?: string; - severity?: PagerDutySeverity; - component?: string; - group?: string; - class?: string; - customDetails?: PagerDutyConfigCustomDetails; + token: string; + eventType: PagerDutyEventType; + routingKey: string; + eventAction?: PagerDutyEventAction; + dedupKey?: string; + severity?: PagerDutySeverity; + component?: string; + group?: string; + class?: string; + customDetails?: PagerDutyConfigCustomDetails; } export interface PagerDutyConfigCustomDetails { - [k: string]: string; + [k: string]: string; } export interface Categories { - [k: string]: CategoryOrDefenderID; + [k: string]: CategoryOrDefenderID; } export interface Category { - name: string; - description?: string; - 'notification-ids'?: CategoryNotificationIds; + name: string; + description?: string; + 'notification-ids'?: CategoryNotificationIds; } export interface Relayers { - [k: string]: RelayerOrDefenderID1; + [k: string]: RelayerOrDefenderID1; } export interface Policies { - [k: string]: PolicyOrDefenderID; + [k: string]: PolicyOrDefenderID; } export interface Policy1 { - 'gas-price-cap'?: number; - 'whitelist-receivers'?: WhitelistReceivers; - 'eip1559-pricing'?: boolean; - 'private-transactions'?: boolean; + 'gas-price-cap'?: number; + 'whitelist-receivers'?: WhitelistReceivers; + 'eip1559-pricing'?: boolean; + 'private-transactions'?: boolean; } export interface Contracts { - [k: string]: ContractOrDefenderID; + [k: string]: ContractOrDefenderID; } export interface Contract { - name: string; - address: Address; - network: Network1; - abi?: AbiType; - 'nat-spec'?: string; + name: string; + address: Address; + network: Network1; + abi?: AbiType; + 'nat-spec'?: string; } export interface ActionSecrets { - global?: GlobalSecrets; - stack?: StackSecrets; + global?: GlobalSecrets; + stack?: StackSecrets; } export interface GlobalSecrets { - [k: string]: string; + [k: string]: string; } export interface StackSecrets { - [k: string]: string; + [k: string]: string; } export interface Monitors { - [k: string]: MonitorOrDefenderID; + [k: string]: MonitorOrDefenderID; } export interface BlockMonitor { - name: string; - type: 'BLOCK'; - network: Network2; - contracts?: Contracts1; - addresses?: Addresses; - abi?: AbiType; - 'alert-threshold'?: AlertThreshold; - paused?: boolean; - /** - * A boolean value that indicates whether the UI should skip ABI validation checks. Enable this if you wish to use custom or partial ABIs for your monitors. - */ - 'skip-abi-validation'?: boolean; - 'action-condition'?: ActionOrDefenderID1; - 'action-trigger'?: ActionOrDefenderID2; - 'confirm-level'?: ('safe' | 'finalized') | number; - 'notify-config': NotifyConfig; - conditions?: Conditions; - 'risk-category'?: RiskCategory; + name: string; + type: 'BLOCK'; + network: Network2; + contracts?: Contracts1; + addresses?: Addresses; + abi?: AbiType; + 'alert-threshold'?: AlertThreshold; + paused?: boolean; + /** + * A boolean value that indicates whether the UI should skip ABI validation checks. Enable this if you wish to use custom or partial ABIs for your monitors. + */ + 'skip-abi-validation'?: boolean; + 'action-condition'?: ActionOrDefenderID1; + 'action-trigger'?: ActionOrDefenderID2; + 'confirm-level'?: ('safe' | 'finalized') | number; + 'notify-config': NotifyConfig; + conditions?: Conditions; + 'risk-category'?: RiskCategory; } export interface AlertThreshold { - amount: number; - 'window-seconds': number; + amount: number; + 'window-seconds': number; } export interface NotifyConfig { - timeout?: number; - message?: string; - 'message-subject'?: string; - category?: CategoryOrDefenderID1; - channels: Channels; + timeout?: number; + message?: string; + 'message-subject'?: string; + category?: CategoryOrDefenderID1; + channels: Channels; } export interface Conditions { - event?: Event; - function?: Function; - transaction?: string; + event?: Event; + function?: Function; + transaction?: string; } export interface EventItems { - signature: string; - expression?: string; + signature: string; + expression?: string; } export interface FunctionItems { - signature: string; - expression?: string; + signature: string; + expression?: string; } export interface FortaMonitor { - name: string; - type: 'FORTA'; - network?: Network3; - contracts?: Contracts2; - addresses?: Addresses1; - abi?: AbiType; - 'alert-threshold'?: AlertThreshold1; - paused?: boolean; - 'action-condition'?: ActionOrDefenderID3; - 'action-trigger'?: ActionOrDefenderID4; - 'notify-config': NotifyConfig1; - conditions?: Conditions1; - 'forta-node-id'?: string; - 'forta-last-processed-time'?: string; - 'agent-ids'?: AgentIDs; - 'risk-category'?: RiskCategory; + name: string; + type: 'FORTA'; + network?: Network3; + contracts?: Contracts2; + addresses?: Addresses1; + abi?: AbiType; + 'alert-threshold'?: AlertThreshold1; + paused?: boolean; + 'action-condition'?: ActionOrDefenderID3; + 'action-trigger'?: ActionOrDefenderID4; + 'notify-config': NotifyConfig1; + conditions?: Conditions1; + 'forta-node-id'?: string; + 'forta-last-processed-time'?: string; + 'agent-ids'?: AgentIDs; + 'risk-category'?: RiskCategory; } export interface AlertThreshold1 { - amount?: number; - 'window-seconds'?: number; + amount?: number; + 'window-seconds'?: number; } export interface NotifyConfig1 { - timeout?: number; - message?: string; - 'message-subject'?: string; - category?: CategoryOrDefenderID2; - channels: Channels1; + timeout?: number; + message?: string; + 'message-subject'?: string; + category?: CategoryOrDefenderID2; + channels: Channels1; } export interface Conditions1 { - 'min-scanner-count': number; - severity?: 0 | 1 | 2 | 3 | 4 | 5; - 'alert-ids'?: AlertIDs; + 'min-scanner-count': number; + severity?: 0 | 1 | 2 | 3 | 4 | 5; + 'alert-ids'?: AlertIDs; } export interface BlockExplorerApiKeys { - [k: string]: BlockExplorerApiKeyOrDefenderID; + [k: string]: BlockExplorerApiKeyOrDefenderID; } export interface BlockExplorerApiKey { - key: string; - network: Network4; + key: string; + network: Network4; } export interface ForkedNetworks { - [k: string]: ForkedNetworkOrDefenderID; + [k: string]: ForkedNetworkOrDefenderID; } export interface ForkedNetworkRequest { - name: TenantNetwork; - 'supported-network': SupportedNetwork; - 'rpc-url': string; - 'api-key'?: string; - 'block-explorer-url'?: string; + name: TenantNetwork; + 'supported-network': SupportedNetwork; + 'rpc-url': string; + 'api-key'?: string; + 'block-explorer-url'?: string; } export interface PrivateNetworks { - [k: string]: PrivateNetworkOrDefenderID; + [k: string]: PrivateNetworkOrDefenderID; } export interface PrivateNetworkRequest { - name: TenantNetwork; - configuration: TenantNetworkConfiguration; - 'rpc-url': string; - 'api-key'?: string; - 'block-explorer-url'?: string; + name: TenantNetwork; + configuration: TenantNetworkConfiguration; + 'rpc-url': string; + 'api-key'?: string; + 'block-explorer-url'?: string; } export interface TenantNetworkConfiguration { - symbol: string; - eips?: TenantNetworkEIPConfiguration; - 'safe-contracts'?: SafeContracts; - 'subgraph-url'?: string; + symbol: string; + eips?: TenantNetworkEIPConfiguration; + 'safe-contracts'?: SafeContracts; + 'subgraph-url'?: string; } export interface TenantNetworkEIPConfiguration { - isEIP1559?: boolean; + isEIP1559?: boolean; } export interface SafeContracts { - master: Address3; - 'proxy-factory': Address4; - 'multi-send-call-only': Address5; - 'create-call'?: Address6; + master: Address3; + 'proxy-factory': Address4; + 'multi-send-call-only': Address5; + 'create-call'?: Address6; } From cb42414c4a7bc7b527dc709b9b78e4794366f1fb Mon Sep 17 00:00:00 2001 From: emanuel-sol Date: Sat, 1 Jun 2024 20:14:28 -0400 Subject: [PATCH 4/4] docs: update docs-schemas definitions --- .../docs-schemas/definitions.schema.json | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/types/docs-schemas/definitions.schema.json b/src/types/docs-schemas/definitions.schema.json index 111cad7..2fd6389 100644 --- a/src/types/docs-schemas/definitions.schema.json +++ b/src/types/docs-schemas/definitions.schema.json @@ -18,53 +18,54 @@ "title": "PublicNetwork", "type": "string", "enum": [ - "mainnet", - "sepolia", - "goerli", - "xdai", - "sokol", - "fuse", + "alfajores", + "amoy", + "arbitrum", + "arbitrum-goerli", + "arbitrum-nova", + "arbitrum-sepolia", + "aurora", + "auroratest", + "avalanche", + "base", + "base-goerli", + "base-sepolia", "bsc", "bsctest", + "celo", "fantom", "fantomtest", - "moonbase", - "moonriver", - "moonbeam", - "matic", - "mumbai", - "matic-zkevm", - "matic-zkevm-testnet", - "avalanche", "fuji", - "arbitrum", - "arbitrum-nova", - "arbitrum-goerli", - "arbitrum-sepolia", - "optimism", - "optimism-goerli", - "optimism-sepolia", - "celo", - "alfajores", + "fuse", + "goerli", "harmony-s0", "harmony-test-s0", - "aurora", - "auroratest", "hedera", "hederatest", - "zksync", - "zksync-goerli", - "zksync-sepolia", - "base", - "base-goerli", - "base-sepolia", - "linea-goerli", "linea", + "linea-goerli", + "mainnet", "mantle", + "matic", + "matic-zkevm", + "matic-zkevm-testnet", + "meld", + "meld-kanazawa", + "moonbase", + "moonbeam", + "moonriver", + "mumbai", + "optimism", + "optimism-goerli", + "optimism-sepolia", "scroll", "scroll-sepolia", - "meld", - "meld-kanazawa" + "sepolia", + "sokol", + "xdai", + "zksync", + "zksync-goerli", + "zksync-sepolia" ] }, "custom-network": {