Private ThreatScan WS

The documentation details is about the SolidityScan ThreatScan WebSocket events

The flow for quickscan ws is as follows:

  1. Register the token using auth_token_register event

  2. Using the token, send an event to perform a threatscan

1. WebSocket API Documentation

Overview

  • URL: api-ws.solidityscan.com

  • Protocol: wss

  • Description: This request requires authorization. The bearer token is sent in the auth_tokenrequest parameter.

Step 1. Auth Token Registration Description: The first step is to register with your auth token to generate an UUID.

{
    "action": "message",
    "payload": {
        "type": "auth_token_register",
        "body": {
            "auth_token": "{Your_Auth_Token}"
        }
    }
}

Response

{
    "type": "auth_token_register",
    "request_uuid": "Your_UUID",
    "payload": {
        "message": "Auth token registered."
    },
    "event_timestamp": "2024-04-19 11:37:17.854547"
}

ThreatScan

Sample Message Request:

{
    "action": "message",
    "payload": {
        "type": "private_threat_scan_initiate",
        "body": {
            "contract_address": "0xc2498D4fB17A956A847091D088f1D7f6fE745f5B",
            "contract_platform": "etherscan",
            "contract_chain": "mainnet"
        }
    }
}

  1. contract_address: The address of the contract to be scanned.

  2. contract_platform: The platform which the contract belongs to.

  3. contract_chain: The chain which the contract belongs to.

Sample Response:

{
  "type": "scan_status",
  "request_uuid": "a38c64000bf9c87f96ff169e7466d456",
  "payload": {
    "scan_id": "55079f0b72fd527c",
    "scan_status": "scan_done",
    "project_id": "11da4d57edd3c66e40c670ed099983b6",
    "scan_details": {
      "is_quick_scan": false,
      "compilerversion": "v0.8.24+commit.e11b9ed9",
      "contract_address": "0x5f2Acd4A5747737BA720F643e5CD84327e22C8b2",
      "contract_platform": "etherscan",
      "contract_chain": "mainnet",
      "contract_url": "https://etherscan.io/address/0x5f2Acd4A5747737BA720F643e5CD84327e22C8b2",
      "contractname": "ContractChecker",
      "currency": "ETH",
      "evmversion": "paris",
      "licensetype": "",
      "multi_file_scan_status": "scan_done",
      "multi_file_scan_summary": {
        "issue_severity_distribution": {
          "informational": 2,
          "low": 2,
          "medium": 1,
          "high": 0,
          "critical": 0,
          "gas": 0
        },
        "scan_time_taken": 6,
        "score_v2": "10.00",
        "lines_analyzed_count": 10
      },
      "node_reference_id": null,
      "project_id": "11da4d57edd3c66e40c670ed099983b6",
      "reporting_status": "not_generated",
      "scan_id": "55079f0b72fd527c",
      "scan_init_time": "2024-07-15T13:01:39.293656",
      "scan_status": "scan_done",
      "scan_status_err_msg": null,
      "scan_type": "block"
    }
  },
  "event_timestamp": "2024-07-15 13:01:52.988801"
}

Note: refer WS references for contract_platform and contract_chain values

Last updated