NAV Navbar
shell javascript

Introduction

MatterPool API Documentation

Contact

Contact us for feedback and questions, we love to hear your feedback.

@mxtterpool

Rate Limits

10 requests per minute

Dashboard Authentication

Note: This uses cookies for authentication. See Login below on how to obtain a session. The resulting cookie will need to be sent along for requests

Login User

Get your credentials at https://pool.matterpool.io

curl -X POST https://api.matterpool.io/api/login -H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \
-H "api_key: your-api-key" \
-d '{ "email": "foo@bar1234.com", "password": "your-password"}'

const matterpool = require('matterpool');
const result = await matterpool.login('foo@bar.com', 'your password');

The above command returns JSON structured like this:

Note: The cookie mpsession is set. It must be passed along for future requests.

Cookie contents Set-Cookie: mpsession=eyJwYXNzcG9ydCI6eyJ1c2VyIjp7ImVtYWlsIjoibmV3QG5ldy5jb20iLCJsb2dpblRpbWUiOjE1Nzc3NzEwMTYwNDR9fX0=; path=/; expires=Wed, 01 Jan 2020 05:43:36 GMT; httponly

{
    "email": "foo@bar1234.com",
    "id": "dbada750-2b8f-11ea-b480-c5f245fe186d"
}
// Note that Set-Cookie for `mpsession` is also set
// Make sure to attach this cookie in subsequent requests

This endpoint retrieves POW Boost by hash

HTTP Request

POST https://api.matterpool.io/api/login

Body Parameters

Parameter Description
email email of user
password password of user

Get Session

curl "https://api.matterpool.io/api/session" -H "api_key: your-api-key"

const matterpool = require('matterpool');
const result = await matterpool.getSession();

The above command returns JSON structured like this:

{
    "email": "foo@bar1234.com",
    "loginTime": "1577771352559"
}

This endpoint gets logged in user session

HTTP Request

GET https://api.matterpool.io/api/session

Request Body

Parameter Description

Response Body

Parameter Description
loginTime When session logged in
email user email

POW Boost

Get Boost Work

Output { txid: 32-bite digest, index: 32-bit index }

Inputs Reference - optional. The HASH256 value of the data to be searched for. Tag - optional. The tag to filter by. Begin time - optional. End time - optional. Max results - optional. Index - optional. Return results starting with the indexth highest difficulty. Response list of work objects in difficulty order.

curl "https://api.matterpool.io/api/v1/boost/list" -H "api_key: your-api-key"

const matterpool = require('matterpool');
const result = await matterpool.getBoostList('000000....');

The above command returns JSON structured like this:

{
  "reference": "32-byte digest",
  "difficulty-redeemed": "123444",
  "difficulty-unredeemed":" 43244",
  "redeemed-outputs": [
      {
        "txid": "1234ac...",
        "index": 0
      }
    ],
    "unredeemed-outputs": [
      {
        "txid": "dda14...",
        "index": 2
      },
      {
        "txid": "a35a...",
        "index": 0
      }
    ]
}

This endpoint retrieves list of Boost work

HTTP Request

GET https://api.matterpool.io/api/v1/boost/list?reference=000123a..&tag=cats&begin_time=1222334445&end_time=1222534445&max_results=10&index=

Query Parameters

Parameter Description
reference (optional) The HASH256 value of the data to be searched for.
tag (optional) optional. The tag to filter by.
begin_time (optional) optional.
end_time (optional) optional.
max_results (optional) optional.
index (optional) Return results starting with the index'th highest difficulty.

Response

{
  "data": [
    {
      "reference": "32-byte digest",
      "difficulty-redeemed": "123444",
      "difficulty-unredeemed":" 43244",
      "redeemed-outputs": [
        {
          "txid": "1234ac...",
          "index": 0
        }
      ],
      "unredeemed-outputs": [
        {
          "txid": "dda14...",
          "index": 2
        },
        {
          "txid": "a35a...",
          "index": 0
        }
      ]
    }
  ]
}

Get Boost Header by Boosthash

curl "https://api.matterpool.io/api/v1/boost/:boosthash" -H "api_key: your-api-key"

const matterpool = require('matterpool');
const result = await matterpool.getBoostHeader('000000....');

The above command returns JSON structured like this:

{
    "int32": 12,
    "digest256": "000...",
    "digest160": "0A..",
    "uint64": 12353,
    "uint64": 5332433,
    "uint32": 1234,
    "uint32": 44432
}

This endpoint retrieves POW Boost by hash

HTTP Request

GET https://api.matterpool.io/api/v1/boost/:boosthash

URL Parameters

Parameter Description
boosthash The hash of the data structure

Create Boost Request


curl -X POST https://api.matterpool.io/api/v1/boost -H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \
-H "api_key: your-api-key" \
-d '{ "target": "aaa" .... }'

curl -X 'POST' "https://api.matterpool.io/api/v1/boost" -H "api_key: your-api-key"

const matterpool = require('matterpool');
const result = await matterpool.createBoostJob(['....', '....']);

The above command returns JSON structured like this:

{
  "id": "1234",
  "data": {
    "int32": 12,
    "digest256": "000...",
    "digest160": "0A..",
    "uint64": 12353,
    "uint64": 5332433,
    "uint32": 1234,
    "uint32": 44432
  }
}

This endpoint creates POW boost request

HTTP Request

POST https://api.matterpool.io/api/v1/boost

Request Body

Parameter Description
... tbd

Errors

The MatterPool API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The resource is forbidden.
404 Not Found -- The specified resource could not be found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The resource requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many resources! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.