Crypitor
Home
  • Overview
    • Introduction
    • Blockchain limitations
    • Our solution
    • Techstack
    • Benefit
    • Use cases
      • Transaction Monitoring
      • DApp Integration
      • Cross-Chain Communication
      • Payment system
      • Security Alerts
  • How To Use
    • Create Monitor
    • Native Transfer Event
    • Erc20 Transfer Event
    • Erc721 Transfer Event
  • Webhook
    • Deliveries
  • Network
    • Supported Networks
    • Webhook Delivery for Confirmations
  • Self Hosted
    • Quick start
    • Creating a Monitor
    • Start Development
Powered by GitBook
On this page
  • Step 1: Create a Monitor
  • Step 2: Add an Address to the Monitor

Was this helpful?

  1. Self Hosted

Creating a Monitor

This guide explains how to create and configure a monitor for real-time blockchain event monitoring using Crypitor's API and curl commands.

Step 1: Create a Monitor

To create a monitor, use the following curl command:

curl -X 'POST' \
  'http://localhost:3000/monitor' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "projectId": "DefaultProject",
  "network": "Ethereum",
  "condition": {
    "native": true,
    "internal": false,
    "erc721": true,
    "erc20": true,
    "specific": false,
    "cryptos": {
      "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": true
    }
  },
  "notification": {
    "method": "Webhook",
    "url": "https://example.com",
    "authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==",
    "secretToken": ""
  },
  "type": "all",
  "note": "My crypitor monitoring",
  "tags": [
      "Hello",
      "Crypitor"
  ],
  "name": "My First Monitor"
}'

Response:

On successful creation, the response will include details about the monitor:

{
  "code": 0,
  "message": "OK",
  "data": {
    "projectId": "DefaultProject",
    "monitorId": "mo_AAGBUxOjyqbCYjt8",
    "network": "Ethereum",
    "name": "My First Monitor",
    "condition": {
      "native": true,
      "internal": false,
      "erc721": true,
      "erc20": true,
      "specific": false,
      "cryptos": {
        "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": true
      }
    },
    "notification": {
      "method": "Webhook",
      "url": "https://example.com",
      "authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
    },
    "type": "all",
    "note": "My crypitor monitoring",
    "tags": [
      "Hello",
      "Crypitor"
    ],
    "dateCreated": "2024-06-11T08:19:17.975Z",
    "disabled": false,
    "addressCount": 0,
    "webhookCount": 0
  }
}

Step 2: Add an Address to the Monitor

After creating the monitor, you can add addresses to it using the monitor ID from the previous response. Use the following curl command to add an address:

curl -X 'POST' \
  'http://localhost:3002/address' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "monitorId": "mo_AAGBUxOjyqbCYjt8",
  "addresses": [
    "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  ]
}'

Response

{
  "code": 0,
  "message": "OK",
  "data": [
    {
      "monitorId": "mo_AAGBUxOjyqbCYjt8",
      "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "network": "Ethereum",
      "dateCreated": "2024-06-11T08:24:24.691Z"
    }
  ]
}

PreviousQuick startNextStart Development

Last updated 11 months ago

Was this helpful?