User Endpoint

  • Access to the API is limited to 150 requests / minutes / ip.
  • All API Response are cached for 2 minutes.
  • All endpoints are CORS enabled.
  • Endpoint: http://api.grinmint.com

Dashboard

Returns json data about a single user dashboard.

  • URL

    /v1/user/:user/dashboard

  • Method:

    GET

  • URL Params

    Required:

    user=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Description
      status bool Response Status
      statistics object Response Status
      - last_seen string Last time the user submitted a share
      - current_hashrate number Current user hashrate
      - average_hashrate number Average user hashrate
      - valid_shares number Number of valid shares submitted
      - rejected_shares number Number of rejected shares submitted
      - stale_shares number Number of stale shares submitted
      - active_workers number Number of active workers
      - immature_balance number Immature user balance
      - unpaid_balance number Unpaid user balance
      workers []object Array of workers
      - name string Name of the worker
      - agent string Agent of the worker
      - last_seen string Last time the user submitted a share
      - current_hashrate number Current user hashrate
      - average_hashrate number Average user hashrate
      - valid_shares number Number of valid shares submitted
      - rejected_shares number Number of rejected shares submitted
      - stale_shares number Number of stale shares submitted
      settings object User settings
      - monitor bool If monitoring is enabled or not
      - wallet string Anonymized user wallet address
  • Error Response:

    • Code: 404 or 500

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/dashboard",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });
    

User Stats

Returns json data containing various statistics about a specific user.

  • URL

    /v1/user/:user/userStats

  • Method:

    GET

  • URL Params

    Required:

    user=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Description
      status bool Response Status
      last_seen string Last time the user submitted a share
      current_hashrate number Current user hashrate
      average_hashrate number Average user hashrate
      valid_shares number Number of valid shares submitted
      rejected_shares number Number of rejected shares submitted
      stale_shares number Number of stale shares submitted
      active_workers number Number of active workers
      immature_balance number Immature user balance
      unpaid_balance number Unpaid user balance
  • Error Response:

    • Code: 404 or 500

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/userStats",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });
    

User History

Get a list of user historical hashrates from the pool.

  • URL

    /v1/user/:user/userHistory

  • Method:

    GET

  • URL Params

    Required:

    user=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Description
      status bool Response Status
      hashrates []object Last 24 hours user hashrate
      - time number Time of the data
      - hashrate number Hashrate at that time
      - average_hashrate number Average hashrate at that time
  • Error Response:

    • Code: 404 or 500

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/userHistory",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });
    

Payout Stats

Get the list of payouts from the pool.

  • URL

    /v1/user/:user/payoutStats

  • Method:

    GET

  • URL Params

    Required:

    user=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Description
      status bool Response Status
      payouts []object List of last 100 payouts
      - paid_on number Paid on
      - amount number Amount sent
      - tx_id string Transaction ID
      - status string Status of the payout
  • Error Response:

    • Code: 404 or 500

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/payoutStats",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });
    

User Settings

Get the user settings.

  • URL

    /v1/user/:user/userSettings

  • Method:

    GET

  • URL Params

    Required:

    user=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Description
      status bool Response Status
      wallet string Anonymized user wallet address
      monitor bool Whether monitoring is enabled
  • Error Response:

    • Code: 404 or 500

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/userSettings",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });
    

Update User Settings

Update user settings. Whether to enable monitoring on workers or set/update the wallet address to receive HTTP payouts. If monitoring is true, you'll receive an email every time one of your worker goes down.

  • URL

    /v1/user/:user/updateUserSettings?pass=x&monitor=x&wallet=x

  • Method:

    POST

  • URL Params

    Required:

    • user=[string]
    • pass=[string]
    • monitor=[bool]
    • wallet=[string]
  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Description
      status bool Response Status
      monitor bool Whether monitoring is enabled
  • Error Response:

    • Code: 404 or 500

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/updateUserSettings?pass=iamvoldemort&monitor=true&wallet=192.168.1.1:13416",
        dataType: "json",
        type : "POST",
        success : function(r) {
          console.log(r);
        }
      });
    

Request Payout

Request a payout from the pool. The pool will send it to you as soon as the wallet is available.
Minimum payout is 0.01 grin.
Currently two payout methods are supported:
-http: the pool wallet will send the transaction directly to your Grin node. Your wallet must be reachable from the internet.
-email: the pool wallet will send you an email with a file transaction. Then you must import the transaction in your wallet with the grin wallet receive command. Finally, you must upload the output file using our website page or using the finalizeTransaction endpoint.

  • URL

    /v1/user/:user/requestPayout?method=xxx

  • Method:

    POST

  • URL Params

    Required:

    user=[string]

    method=[string]

    pass=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200

    • Content:

      Field Type Value Description
      status bool true Response Status
      amount number Amount sent
  • Error Response:

    • Code: 404, 500 or 503

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/requestPayout?method=email&pass=iamvoldemort",
        dataType: "json",
        type : "POST",
        success : function(r) {
          console.log(r);
        }
      });
    

Finalize Payout

Finalize payout endpoint. Specifically designed for email payouts. When you receive a payout by email you have to receive it in Grin. Then you need to upload the created response transaction on GrinMint with this endpoint in order to finalize the payout.

  • URL

    /v1/user/:user/finalizePayout?pass=x

  • Method:

    POST

  • URL Params

    Required:

    user=[string]

    pass=[string]

  • Data Params

    Required: A transaction slate in JSON.

    Field Type Description
    num_participants number The number of participants intended to take part in this transaction
    id number Unique transaction ID, selected by sender
    tx object The core transaction data (inputs, outputs, kernels and kernel offset)
    - offset []number The kernel “offset” k2, excess is k1G after splitting the key k = k1 + k2
    - body object The transaction body - inputs/outputs/kernels
    - - inputs []object List of inputs spent by the transaction
    - - - features object The features of the output being spent
    - - - - bits number Representation of the features in bits
    - - - commit []number The commit referencing the output being spent
    - - outputs []object List of outputs the transaction produces
    - - - features object Options for an output’s structure or use
    - - - - bits number Representation of the features in bits
    - - - commit []number The homomorphic commitment representing the output amount
    - - - proof []number A proof that the commitment is in the right range
    - - kernels []object List of kernels that make up this transaction (usually a single kernel)
    - - - features object Options for a kernel’s structure or use
    - - - - bits number Representation of the features in bits
    - - - fee number Fee originally included in the transaction this proof is for
    - - - lock_height number The max lock_height of all inputs to this transaction
    - - - excess []number Remainder of the sum of all transaction commitments
    - - - excess_sig []number The signature proving the excess is a valid public key (signs the tx fee)
    amount number Base amount (excluding fee)
    fee number Fee amount
    height number Block height for the transaction
    lock_height number Lock height
    participant_data object Participant data
    - id number Id of participant in the transaction. (For now, 0=sender, 1=rec)
    - public_blind_excess []number Public key corresponding to private blinding factor
    - public_nonce []number Public key corresponding to private nonce
    - part_sig []number Public partial signature
  • Success Response:

    • Code: 200

    • Content:

      Field Type Value Description
      status bool true Response Status
      amount number Amount sent
  • Error Response:

    • Code: 404, 500 or 503

    • Content:

      Field Type Description
      status bool Response Status
      message string Reason for error
  • Sample Call:

      $.ajax({
        url: "/v1/user/quentin@blockcypher.com/finalizePayout?pass=iamvoldemort",
        dataType: "json",
        type : "POST",
        success : function(r) {
          console.log(r);
        },
        data: {
          file: tx.response.json
        },
      });