Hardhat forking API

Through this API, users can manage Hardhat instances dynamically, providing a seamless integration for continuous development and testing.

Authentication

All API requests require the use of an API key. You must include your API key in the header of each request. Your API key authenticates your account with the service.

x-api-key: {{API_KEY}}

Replace {{API_KEY}} with your actual API key provided upon account registration.

Creating a new API key

  1. Navigate to the Settings page in your project

  2. Scroll down to API Setting and create a new API key

  1. Give your API key a name and store the secret. Ensure to keep your API key confidential for your Account's security.

API Base URL

https://c6yaznpyf4.execute-api.us-east-1.amazonaws.com/prod/api

All endpoints referenced in this documentation start with the above base URL

Endpoints

Creating Hardhat Instance

POST /hardhat/{{PROJECT_ID}}

Creates a new Hardhat instance for a given project.

Headers

Data Parameters

Sample call

  • Replace {{PROJECT_ID}} with the appropriate project ID

  • Replace {{PROVIDER_URL}} with the URL of your Ethereum provider

  • Ensure that the API_KEY is kept secure and not exposed in shared or public environments

curl --location 'https://c6yaznpyf4.execute-api.us-east-1.amazonaws.com/prod/api/hardhat/{{PROJECT_ID}}' \
--header 'x-api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "providerUrl": "{{PROVIDER_URL}}"
}'

Sample Response

{
  "message": "Hardhat instance created successfully", 
  "instanceId": 420
}

Deleting Hardhat instance

DELETE /hardhat/{{PROJECT_ID}}/{{CHAIN_ID}}

Deletes an existing Hardhat instance from a specific project and chain.

Headers

Sample Call

  • Replace {{PROJECT_ID}} and {{CHAIN_ID}} with the appropriate project and chain IDs

  • Ensure that the API_KEY is kept secure and not exposed in shared or public environments.

curl --location --request DELETE 'https://c6yaznpyf4.execute-api.us-east-1.amazonaws.com/prod/api/hardhat/{{PROJECT_ID}}/{{CHAIN_ID}}' \
--header 'x-api-key: {{API_KEY}}'

Sample Response

{
  "message": "Hardhat instance deleted successfully"
}

Last updated