Protocols

Get all protocols and the assets associated with your api key.

GET https://api.ironblocks.com/protocols

Query Parameters

NameTypeDescription

pageNumber

integer

Specify page number for pagination.

hideAssets

boolean

Should the assets be omitted from the response.

pageSize

integer

Specify page size for pagination.

[
  {
    "page": [
      {
        "protocols": {
          "protocolId": "600000000000000000000000",
          "descriptor": "dummy",
          "setttings": {
            "triggers": {
              "critical": {
                "detectionsGroup": [
                  [
                    "detector1",
                    "detector2"
                  ],
                  [
                    "detector1",
                    "detector3"
                  ],
                  [
                    "detector3",
                    "detector4"
                  ]
                ],
                "actions": [
                  "notification"
                ]
              }
            },
            "notificationChannels": [],
            "tracking": true,
            "detectors": [
              {
                "name": "detector1",
                "config": {
                  "threshold": 250000
                },
                "external": false
              },
              {
                "name": "detector2",
                "config": null,
                "external": false
              },
              {
                "name": "detector3",
                "config": null,
                "external": false
              },
              {
                "name": "detector4",
                "config": null,
                "external": false
              }
            ]
          },
          "assets": [
            {            
              "address": "0x0000000000000000000000000000000000000000",
              "chainId": 1,
              "protocol": "600000000000000000000000",
              "admins": [],
              "createdAt": "2023-07-12T14:00:10.750Z",
              "descriptor": "Contract1",
              "exposedMethods": [],
              "methods": {
                "0xa9059cbb": "transfer"
              },
              "privilegedMethods": [],
              "updatedAt": "2023-07-12T14:00:10.750Z",
            }
          ],
          "createdAt": "2023-07-12T14:00:10.750Z",
          "updatedAt": "2023-07-12T14:00:10.750Z"
        }
      }
    ],
    "pageNumber": 1,
    "total": 1
  }
]
curl -X 'GET' \
  'https://api.ironblocks.com/protocols' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${YOUR-API-KEY}'

Create a new protocol and associate it with your api key.

POST https://api.ironblocks.com/protocols/create

Request Body

NameTypeDescription

protocolName*

string

The name of your protocol.

assets

Asset[]

An array of assets to associate with the protocol. Type reference

notificationChannels

NotificationChannels[]

An array of notification channels for alerts. Type reference

{
    "protocolId": "600000000000000000000000",
    "message": "Protocol created succesfully"
}
curl -X 'POST' \
  'https://api.ironblocks.com/protocols/create' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${YOUR-API-KEY}'

Add assets to a given protocol id.

PUT https://api.ironblocks.com/protocols/assets/add

Request Body

NameTypeDescription

protocolId*

string

The protocol Id to add assets to. You can obtain it using the /protocols endpoint.

assets*

Asset[]

An array of assets to associate with the protocol. Type reference

{
    "message": "Assets added successfully",
    "changes": {
        "added": 10,
        "modified": 0
    }
}
curl -X 'PUT' \
  'https://api.ironblocks.com/protocols/assets/add' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${YOUR-API-KEY}'

Change protocol's notification channels.

PATCH https://api.ironblocks.com/protocols/notification-channels/replace

Request Body

NameTypeDescription

protocolId*

string

The protocol Id to replace the notification channels for.

You can obtain it using the /protocols endpoint.

notificationChannels*

NotificationChannels[]

An array of notification channels for alerts. Type reference

{
    "message": "Notification channels replaced successfully"
}
curl -X 'PATCH' \
  'https://api.ironblocks.com/protocols/notification-channels/replace' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${YOUR-API-KEY}'

Type reference

interface Asset {
    chainId: number
    abi: string
    address: string 
    admins: string[]
    descriptor: string // asset's name
}
interface NotificationChannel {
    name: "email" | "telegram" | "slack" | "webhook"
    contacts?: string[] // channel id
    url?: string // webhook url
}

Last updated