Skip to main content

V2 API Endpoints

Updated V2 API Documentation for DePIN Tracker Integration

Below is the updated outline of the API you need to implement to integrate your services with DePIN Tracker. This document details the required endpoints, input parameters, and expected responses. Our platform interacts with mining devices, retrieving their statuses, rewards, and associated metadata. Your API will need to implement the following GET endpoints to ensure seamless integration. Note: All endpoints are optional, but you must provide at least one of getStatus or getRewards for your DePIN to be added to the tracker. We strongly suggest implementing all possible endpoints.

1. https://api.yourservice.com/getStatus

Description: Fetches the current operational status and issues of a miner device.

  • Method: GET

  • Query Parameters:

    • deviceId (string): Unique identifier of the miner device.
    • secondaryDeviceId (string | null): Optional second identifier for the device, e.g., deviceSerialNumber or hexId.
  • Headers:

    • Authorization: You must provide us with your Authorization value.
  • Response (Status 200 - IMinerStatus):

    • issues (MinerIssueWithGravity[]): Array of current issues, each with a severity level (gravity).
      • Possible gravity values:
        • High
        • Medium
        • Low
      • The type must be in CamelCase, short, and descriptive (e.g., SpeedTestMissing, Offline).
      • Note: If the miner is down or offline, use Offline as the issue type with gravity set to High.
  • Response (Status 404): Miner does not exist.

Example Response (200):

{
"issues": [
{
"type": "SpeedTestMissing",
"gravity": "Medium"
},
{
"type": "Offline",
"gravity": "High"
}
]
}

Important: You must provide a complete list of possible issue types so we can display help labels to the user.


2. https://api.yourservice.com/getRewards

Description: Retrieves rewards earned by a miner over a specified period.

  • Method: GET

  • Query Parameters:

    • deviceId (string): Unique identifier of the miner.
    • secondaryDeviceId (string | null): Optional second identifier for the miner.
    • period (string): Time range for rewards. Accepted values are 1d, 3d, 7d, 14d, 30d, 365d, 24h, all.
  • Headers:

    • Authorization: You must provide us with your Authorization value.
  • Response (Status 200 - IAbstractReward[]):

    • date (string): Date of the reward in ISO 8601 format.
    • tokens (object[]): Array of tokens earned, each with an amount and symbol.
  • Response (Status 404): Miner does not exist.

  • Response (Status 200 - Empty Array): Miner exists but has no rewards.

Example Response (200):

[
{
"date": "2025-01-01T00:00:00Z",
"tokens": [
{ "amount": 10.5, "symbol": "HNT" },
{ "amount": 0.8, "symbol": "SOL" }
]
}
]

Example Response (200 - Empty Array):

[]

Notes:

  • Symbol must be in UPPERCASE. You must provide a list of token symbols with their respective links to Coinmarketcap (if listed).
  • This endpoint must not be paginated. We will query with period=all only once.

3. https://api.yourservice.com/getMinersByWallet

Description: Retrieves a list of miners associated with a specific wallet address.

  • Method: GET

  • Query Parameters:

    • walletAddress (string): Wallet address.
  • Headers:

    • Authorization: You must provide us with your Authorization value.
  • Response (Status 200 - IDevice[]):

    • deviceId (string): Unique identifier of the miner.
    • secondaryDeviceId (string | null): Optional secondary identifier.
    • friendlyName (string): User-friendly name of the miner.
    • type (MinerType): The DePIN name in CamelCase. We will provide this value to you.

Example Response (200):

[
{
"deviceId": "miner123",
"secondaryDeviceId": "serial456",
"friendlyName": "Main Miner",
"type": "Helium"
}
]

Example Response (200 - Empty Array):

[]

Note: Let us know if your network contains devices of significantly different types so we can define multiple MinerType values for you.


4. https://api.yourservice.com/getMinersByName

Description: Fetches miners based on their friendly name or alias.

  • Method: GET

  • Query Parameters:

    • name (string): Friendly name of the miner.
  • Headers:

    • Authorization: You must provide us with your Authorization value.
  • Response (Status 200 - IDevice[]):

    • deviceId (string): Unique identifier of the miner.
    • secondaryDeviceId (string | null): Optional secondary identifier.
    • friendlyName (string): User-friendly name of the miner.
    • type (MinerType): The DePIN name in CamelCase. We will provide this value to you.

Example Response (200):

[
{
"deviceId": "miner789",
"secondaryDeviceId": null,
"friendlyName": "Backup Miner",
"type": "Geodnet"
}
]

Example Response (200 - Empty Array):

[]

Note: Let us know if your network contains devices of significantly different types so we can define multiple MinerType values for you.


5. https://api.yourservice.com/getLocation

Description: Fetches the geographical location of a miner device.

  • Method: GET

  • Query Parameters:

    • deviceId (string): Unique identifier of the miner.
    • secondaryDeviceId (string | null): Optional second identifier.
  • Headers:

    • Authorization: You must provide us with your Authorization value.
  • Response (Status 200 - ILocation):

    • lat (number): Latitude of the miner.
    • lng (number): Longitude of the miner.
  • Response (Status 404): Miner ID is invalid.

Example Response (200):

{
"lat": 37.7749,
"lng": -122.4194
}

Example Response (404):

{
"error": "Invalid miner ID"
}