Skip to content

Api for ethermine interaction

License

Wbaker7702/ethermine-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ethermine-api

Actions Status Actions Status Monthly Downloads

A Node.js wrapper for the Ethermine and Flypool APIs, allowing you to easily retrieve data about mining pools, miners, and workers.

Installation

Install the package using npm:

npm install ethermine-api

Usage

First, import and instantiate the Ethermine class:

const Ethermine = require('ethermine-api');
const ethermine = new Ethermine();

You can also specify an API URL for other pools:

const ethermine = new Ethermine('https://api-zcash.flypool.org');

All methods use a callback function with the format (error, data).

API Reference

getPoolStats(callback)

Get the pool's statistics.

ethermine.getPoolStats((err, data) => {
  if (!err) {
    console.log(data);
  }
});

getBlockHistory(callback)

Get the block history.

ethermine.getBlockHistory((err, data) => {
  if (!err) {
    console.log(data);
  }
});

getNetworkStats(callback)

Get the network statistics.

ethermine.getNetworkStats((err, data) => {
  if (!err) {
    console.log(data);
  }
});

getServersHistory(callback)

Get the servers' history.

ethermine.getServersHistory((err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerDashboard(miner, callback)

Get the miner's dashboard.

ethermine.getMinerDashboard('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerHistory(miner, callback)

Get the miner's history.

ethermine.getMinerHistory('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerPayouts(miner, callback)

Get the miner's payouts.

ethermine.getMinerPayouts('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerRounds(miner, callback)

Get the miner's rounds.

ethermine.getMinerRounds('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerSettings(miner, callback)

Get the miner's settings.

ethermine.getMinerSettings('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerCurrentStats(miner, callback)

Get the miner's current statistics.

ethermine.getMinerCurrentStats('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getMinerWorkers(miner, callback)

Get the miner's workers.

ethermine.getMinerWorkers('0x...', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getWorkerHistory(miner, worker, callback)

Get the worker's history.

ethermine.getWorkerHistory('0x...', 'workerName', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

getWorkerCurrentStats(miner, worker, callback)

Get the worker's current statistics.

ethermine.getWorkerCurrentStats('0x...', 'workerName', (err, data) => {
  if (!err) {
    console.log(data);
  }
});

setAPIurl(url, callback)

Set a new API URL.

ethermine.setAPIurl('https://api.ethpool.org', (err, result) => {
  if (!err) {
    console.log(result); // 'API URL set to: https://api.ethpool.org'
  }
});

Supported Pools

You can use the setAPIurl method to switch to any of the following supported pools:

  • api-ergo.flypool.org
  • api-etc.ethermine.org
  • api-zcash.flypool.org
  • api-ycash.flypool.org
  • api-beam.flypool.org
  • api-ravencoin.flypool.org
  • api.ethpool.org

About

Api for ethermine interaction

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%