Webhooks

使用 Webhook 的方式接收 Bot 监控告警的信息

你可以在 如何设置 Webhook 里面配置选择使用 Webhook 接收数据,当该 Bot 监控告警被触发时,系统将会以POST的方式回调指定的 Webhook 中。

Event 告警回调数据示例

{
  "bot": {
    "id": "310921842431212166",
    "name": "ChainbotFactoryCN_Demo_event_formatTime"
  },
  "data": {
    "block": {
      "hash": "0x812c4e049074fc939f84a336b051d252ded717a00624659be5e9eaa0ea5c0e33",
      "height": 16145470,
      "time": "2022-12-09T06:49:47Z"
    },
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io",
      "type": "Ethereum"
    },
    "conditions": [],
    "event": {
      "contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "params": {
        "owner": "0x9173be58bf265c40385c6b3c4f8e80873c1255fd",
        "spender": "0x1111111254eeb25477b68fb85ed929f73a960582",
        "value": 1.157920892373162e+77
      },
      "rawEvent": {
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "blockHash": "0x812c4e049074fc939f84a336b051d252ded717a00624659be5e9eaa0ea5c0e33",
        "blockNumber": "0xf65c3e",
        "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
        "logIndex": "0x1b",
        "removed": false,
        "topics": [
          "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
          "0x0000000000000000000000009173be58bf265c40385c6b3c4f8e80873c1255fd",
          "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582"
        ],
        "transactionHash": "0xc0c8954508021711575e2e2261bf934f3228eb3cf51d5e836eafeaf66f7c9c86",
        "transactionIndex": "0xe"
      }
    },
    "transaction": {
      "hash": "0xc0c8954508021711575e2e2261bf934f3228eb3cf51d5e836eafeaf66f7c9c86"
    }
  },
  "subscription": {
    "id": "310921842766756486",
    "name": "ChainbotFactoryCN_Demo_event_formatTime1"
  },
  "time": "2022-12-09T06:49:49.993075864Z",
  "version": "1.0"
}

DEX 告警回调数据示例

{
  "bot": {
    "id": "311119159553604230",
    "name": "ChainbotFactoryCN_demo_dex"
  },
  "data": {
    "action": "sell",
    "block": {
      "hash": "0xdb082dbf8a51f4c7f2ff304329a133be42aeda04bad278b5a226c9c027ff9277",
      "height": 16145450,
      "time": "2022-12-09T06:45:47Z"
    },
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io",
      "type": "Ethereum"
    },
    "condition": {
      "param": "Swap",
      "symbol": "WhaleBuySell",
      "unit": "USD",
      "value": "1"
    },
    "dex": {
      "address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
      "name": "UniswapV3"
    },
    "price": "0.0007780715056737",
    "priceUSD": "0.99746853486837753388444328412",
    "tokenBase": {
      "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "amount": "100",
      "decimals": 6,
      "symbol": "USDT"
    },
    "tokenIn": {
      "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "amount": "100",
      "decimals": 6,
      "symbol": "USDT"
    },
    "tokenOut": {
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "amount": "-0.077807150567369",
      "decimals": 18,
      "symbol": "WETH"
    },
    "tokenQuote": {
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "amount": "-0.077807150567369",
      "decimals": 18,
      "symbol": "WETH"
    },
    "transaction": {
      "hash": "0x26ebda9060af58a0eb8097faa3afeab0694db52169d0bd0d6570a18bc60ff7cb"
    },
    "value": "0"
  },
  "subscription": {
    "id": "311120377680149126",
    "name": "ChainbotFactoryCN_demo_dex"
  },
  "time": "2022-12-09T06:45:50.911504167Z",
  "version": "1.0"
}

Value 告警回调数据示例

{
  "bot": {
    "id": "306859121112954304",
    "name": "ChainbotFactoryCN_demo_reserve_percent1"
  },
  "data": {
    "chain": {
      "chain_id": "1",
      "explore": "",
      "type": "Ethereum"
    },
    "conditions": {
      "_reserve0": {
        "field": "_reserve0",
        "method": "last",
        "result": 5394298.279736,
        "symbol": ">",
        "threshold": 546000,
        "timeRange": "5m",
        "value": 5394298.279736
      },
      "_reserve1": {
        "field": "_reserve1",
        "method": "last",
        "result": 5399252.162221,
        "symbol": ">",
        "threshold": 546000,
        "timeRange": "5m",
        "value": 5399252.162221
      },
      "percent": {
        "field": "percent",
        "method": "last",
        "result": 0.999082,
        "symbol": ">",
        "threshold": 0.9,
        "timeRange": "5m",
        "value": 0.9990824872896912
      }
    },
    "fields": [
      {
        "index": "0",
        "key": "_reserve0",
        "modifier": "function format(values){\n    return values['_reserve0']/1e6;\n}"
      },
      {
        "index": "1",
        "key": "_reserve1",
        "modifier": "function format(values){\n    return values['_reserve1']/1e6;\n}"
      },
      {
        "index": "percent",
        "key": "percent",
        "modifier": "function format(values){\n    return values['_reserve0']/values['_reserve1'];\n}"
      }
    ],
    "time_range": "60s",
    "values": {
      "_reserve0": 5394298.279736,
      "_reserve1": 5399252.162221,
      "percent": 0.9990824872896912
    }
  },
  "subscription": {
    "id": "306863510603150784",
    "name": "ChainbotFactoryCN_demo_reserve_percent1"
  },
  "time": "2022-12-09T07:23:12.18185473Z",
  "version": "1.0"
}

Transaction 告警回调数据示例

{
  "bot": {
    "id": "311120108020152966",
    "name": "ChainbotFactoryCN_test_tx_timeFormat"
  },
  "data": {
    "block": {
      "hash": "0x8bd5331676d308b7abfed895da1a68177661b4c9aee970702fb6c18eb3988e6e",
      "height": 16145663,
      "time": "2022-12-09T07:28:23Z"
    },
    "chain": {
      "chain_id": "1",
      "type": "Ethereum"
    },
    "conditions": [],
    "transaction": {
      "arguments": null,
      "chainId": "1",
      "from": "0xc7c669ad7cfaaaf77da193daf0967b38dea34437",
      "gas": "0x10e07",
      "gasPrice": "",
      "hash": "0x79ca5a9a1dd9000f41c73887a9391fc21652974102926c4cb002a2e5e7692168",
      "height": 16145663,
      "input": "0x23b872dd0000000000000000000000003ee764a5a659ba9ad28e3cf3fa467e75dad5a090000000000000000000000000bf69d9d87cc310544db068e5198c25e738a806ac0000000000000000000000000000000000000000000000000000000000000000",
      "maxFeePerGas": "0xda979d87c",
      "maxPriorityFeePerGas": "0x59682f00",
      "method": "transferFrom(address,address,uint256)",
      "nonce": "0xf65",
      "r": "0x4c520e66df875e38cf9d058ac679ce5c862a948d1c7e56156e736d8f98f9a7d8",
      "s": "0x498ae192afd44defdd06fb4d44cf2f158a60fb7d565a624af5f604d1cd236f1a",
      "success": false,
      "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "type": "0x2",
      "type_arguments": null,
      "v": "0x0",
      "value": "0"
    }
  },
  "subscription": {
    "id": "311120108288522886",
    "name": "ChainbotFactoryCN_demo_tx_timeFormat"
  },
  "time": "2022-12-09T07:28:27.122532348Z",
  "version": "1.0"
}

Block 告警回调数据示例

{
  "bot": {
    "id": "296436117295614241",
    "name": "ChainbotFactoryCN_demo_block_gasused<60%"
  },
  "data": {
    "block": {
      "baseFeePerGas": 27.617106321,
      "gasUsedPercent": 9.64783,
      "hash": "0xd99db0bb07609f60fcfff475247826633ee8245fde944e115dca5d27ffc891e7",
      "height": 16145678,
      "minter": "0x5c647ca5e2bc5bd17c40410fcb8003d38879ae50",
      "time": "2022-12-09T07:31:23Z"
    },
    "chain": {
      "chain_id": "1",
      "type": "Ethereum"
    },
    "conditions": [
      {
        "param": "gasUsedPercent",
        "symbol": "<",
        "unit": "Percent",
        "value": "60"
      }
    ]
  },
  "subscription": {
    "id": "310931430308166278",
    "name": "ChainbotFactoryCN_demo_block_gasused<60%"
  },
  "time": "2022-12-09T07:31:33.011598237Z",
  "version": "1.0"
}

NFT 告警回调数据示例

{
  "bot": {
    "id": "311159164322167430",
    "name": "ChainbotFactoryCN Demo"
  },
  "data": {
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io/",
      "type": "Ethereum"
    },
    "collection": {
      "slug": "cockpunch"
    },
    "conditions": [],
    "event": {
      "time": "2022-12-09T08:16:59+00:00",
      "timestamp": 1670573819000,
      "type": "Sold"
    },
    "item": {
      "market_link": "https://opensea.io/collection/cockpunch",
      "opensea_link": "https://opensea.io/collection/cockpunch",
      "token_id": "3462"
    },
    "maker": {
      "address": "0x0fe0e246423e61dae865bf1bf9a8e28344788c87"
    },
    "market": {
      "name": "opensea"
    },
    "payment": {
      "price": "0.92",
      "symbol": "ETH",
      "usd_price": "1280.8900000000001"
    },
    "quantity": "1",
    "taker": {
      "address": "0x54edade621180c64dd55b5b49f1541deb33a0c30"
    },
    "transaction": {
      "hash": "0xd70d5603b24ccb9d04b5304ff5e3a0abc00579180a9085eb0b53a791e9a2d221",
      "time": "2022-12-09T08:16:59+00:00",
      "timestamp": 1670573819000
    }
  },
  "subscription": {
    "id": "311159238225607302",
    "name": "ChainbotFactoryCN demo"
  },
  "time": "2022-12-09T08:16:59+00:00",
  "version": "1.0"
}

Snapshot 告警回调数据示例

{
  "bot": {
    "id": "310930122406673030",
    "name": "ChainbotFactoryCN_demo_snapshot_timeFormat"
  },
  "data": {
    "conditions": [
      {
        "field": "event",
        "symbol": "in",
        "value": "proposal/created,proposal/start,proposal/end,proposal/deleted"
      },
      {
        "field": "space",
        "symbol": "=",
        "value": "stgdao.eth"
      }
    ],
    "proposal": {
      "author": "0xE2D48F03082deeF8eb557B00a54aC9fc38Aa4709",
      "event": "proposal/start",
      "expire": 1663107416,
      "id": "0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c",
      "link": "https://snapshot.org/#/stgdao.eth/proposal/0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c",
      "network": "1",
      "space": "stgdao.eth",
      "state": "closed",
      "title": "SIP #16 - New Assets - DAI, FRAX, sUSD, LUSD"
    }
  },
  "subscription": {
    "id": "311139153012505222",
    "name": "ChainbotFactoryCN_demo_snapshot_timeFormat"
  },
  "time": "2022-12-09T07:13:14.208602165Z",
  "version": "1.0"
}

Arweave 告警回调数据示例

{
  "bot": {
    "id": "311124588459309702",
    "name": "ChainbotFactoryCN_demo_Arweave"
  },
  "data": {
    "block": {
      "hash": "4uamc6mU6VnKjkYptP_2oSGPoiX4QPl-BxJABAmNG2FI_65V_xuG3LVEBkzyKtX0",
      "height": 1073786,
      "time": "2022-12-09T06:57:37Z"
    },
    "conditions": [
      {
        "Field": "app-name",
        "Symbol": "==",
        "Type": "tags",
        "Value": "mirrorxyz"
      }
    ],
    "raw": {
      "authorship": {
        "algorithm": {
          "hash": "SHA-256",
          "name": "ECDSA"
        },
        "contributor": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e",
        "signature": "0x579405f6e09fafa64fe54390477ad2bfb0794d85f928507ef925aa13e7e5eca836a738a1b0bb263e9c3f4e37447758fe6c97e938592f37109f1ec0d50724ade31b",
        "signingKey": "{\"crv\":\"P-256\",\"ext\":true,\"key_ops\":[\"verify\"],\"kty\":\"EC\",\"x\":\"TyanSrigZWN0t1CfU0vJG7j46EbEEsfwv1zeM_s_BdA\",\"y\":\"_-gw58cXZTFcGgr_Kh5fp-bKl2TJW8q3IcIyVlQ8ly4\"}",
        "signingKeyMessage": "I authorize publishing on mirror.xyz from this device using:\n{\"crv\":\"P-256\",\"ext\":true,\"key_ops\":[\"verify\"],\"kty\":\"EC\",\"x\":\"TyanSrigZWN0t1CfU0vJG7j46EbEEsfwv1zeM_s_BdA\",\"y\":\"_-gw58cXZTFcGgr_Kh5fp-bKl2TJW8q3IcIyVlQ8ly4\"}",
        "signingKeySignature": "bBBjSXDS7XmGxLEHeiLtS3HuUpJPwz2rkFXntKZPJtW_40iUo-4Ce6H3eddh5-Ri0eR0kpf6n-iZJyKodWjo-g"
      },
      "content": {
        "body": "Nature",
        "timestamp": "1670568886",
        "title": "Natural Plants"
      },
      "digest": "_g_wWPCtW9zr0iCqw_RwdOXF4fwed668LUIridt3Jgw",
      "version": "04-25-2022",
      "wnft": {
        "chainId": 10,
        "description": "Nature\n",
        "fee": 250,
        "fundingRecipient": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e",
        "imageURI": "QmTRPi7K4NPiG4wRzto73rr5oX7ywGWYiraofc9hXF9pTM",
        "mediaAssetId": 308504,
        "name": "Natural Plants",
        "nonce": 7567765,
        "owner": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e",
        "price": 0,
        "proxyAddress": "0xA895b770e24f67fC07D9a20159322F431BE4EbCd",
        "renderer": "0x0000000000000000000000000000000000000000",
        "supply": 500,
        "symbol": "NATURALPLANTS"
      }
    },
    "tags": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "App-Name",
        "value": "MirrorXYZ"
      },
      {
        "name": "Contributor",
        "value": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e"
      },
      {
        "name": "Content-Digest",
        "value": "_g_wWPCtW9zr0iCqw_RwdOXF4fwed668LUIridt3Jgw"
      },
      {
        "name": "Original-Content-Digest",
        "value": "5K_-qHI1g5UR_Am2Ywa3a8fXzTRWOAJE0s0g_7Xy_D4"
      }
    ],
    "transaction": {
      "id": "8fVNscLRfvdkeM4EbVox8fK89oKdVo0ZlMWwfZmwSIg",
      "owner": {
        "address": "Ky1c1Kkt-jZ9sY1hvLF5nCf6WWdBhIU5Un_BMYh-t3c"
      }
    }
  },
  "subscription": {
    "id": "311124647330953862",
    "name": "ChainbotFactoryCN_demo_Arweave"
  },
  "time": "2022-12-09T07:00:50.708175204Z",
  "version": "1.0"
}

最后更新于