🌐SolidityScan Private API
The Private APIs can be called via two methods
WebSockets API
HTTP API
1. WebSocket API Documentation
Overview
The WebSocket API provided by SolidityScan allows users to initiate and monitor various types of scans, including Project Scans for GitHub, BitBucket, and GitLab projects, Block Scans for different blockchain platforms, and File Scans for individual files.
URL:
api-ws.solidityscan.com
Protocol: wss
Description: This request requires authorization. The bearer token is sent in the
auth_token
request parameter.
Step 1. Auth Token Registration Description: The first step is to register with your auth token to generate an UUID.
Scan Types
1. Project Scan: Supported Providers: GitHub, BitBucket, GitLab
Sample Message Request & Response:
provider: The provider of the project repository. In this case, it is
github
, indicating that the project is hosted on GitHub. Other supported valuesbitbucket
&gitlab
project_url: The URL of the project repository. It points to the GitHub repository where the SolidityScan project is hosted. Users can navigate to this URL to access the project's source code and other details.
project_name: The name of the project. This can be any name under 50 characters. In this case, it is "SolidityScan", indicating the name of the project hosted on GitHub.
project_type: Specifies the type of project. This is of two types
new
(A new scan)& toexisting
perform a rescan on an existing project.project_branch: This can be any existing branch that needs to be scanned.
recur_scans: A boolean (
true
orfalse
) value indicating whether recursive scans are enabled for the project. In this case, it is set to "false", suggesting that recursive scans are not enabled.project_visibility: Indicates the visibility level of the project repository accepts value
public
orprivate
. For the private repository, the user needs to configure private repository support from the integration page at https://solidityscan.com/integrations.skip_file_paths: An array of file paths or patterns to skip during scanning or processing. It is currently an empty array, indicating that no file paths are skipped during scans.
The scan data can be fetched from the S3 bucket. The JSON of the scan data sample can be found below.
Verified Contract Scan: Supported Chains: All listed chains
The scan data can be fetched from the S3 bucket. The JSON of the scan data sample can be found below.
File Upload Scans:
Step 1 - Fetching a pre-signed URL
file_name
- Supported file name extensions .sol
& .zip
It is required to supply a file name to generate a pre-signed S3 URL from our end. Note this is just a file name and not an actual file upload call.
Step 2 - Scan initiation Request
The value of the link
is the s3 link of the JSON response of the scan result data.
Sample Response:
Scan Lifespan and Events
Scan Initiation Acknowledgment:
Type:
private_project_scan_acknowledge
Sample:
Account Credits Update:
Type:
account_credits_update
Sample:
Scan Status Events:
Types:
scan_initiate
,scan_status
Sample:
Post Scan Completion Details:
Type:
scan_status
withscan_status
asscan_done
Sample:
2. HTTP API Documentation
Project Scan
Start a project scan
POST
https://api.solidityscan.com/private/api-project-scan/
Request Body
Project Scan Example
Verified Contract Scans
Start a block scan
POST
https://api.solidityscan.com/private/api-start-scan-block/
Request Body
Block Scan CURL Example
Generate Report
Generate Report
POST
https://api.solidityscan.com/private/api-generate-report/
Request Body
Generate Report CURL Example
This documentation provides a comprehensive guide for utilizing the WebSocket API, including connection details, supported scan types, and sample payloads.
Last updated