flexpool
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

flexpool

License: MIT npm Quality Check

About

This package is a wrapper for the Flexpool API. It is written in TypeScript and is usable in either JavaScript or TypeScript projects. It comes with typings out of the box for your convenience. In addition to this package wrapping over API Endpoints, it also provides typings for all the API Endpoints.

Installation

You can install this package from NPM

  • npm install flexpool
  • yarn add flexpool

Usage

There are two exported objects in this package. Routes and Util. Routes provides a straight way to make the API requests, plain and simple (e.x. Routes.miner.balance(ADDRESS)), while Util will include utility methods and wrappers over the API requests that take params like address and worker in order to simplify them. This is so you don't have to supply things like the address for every request, and instead have an object representing, for example, a specific Miner, that you can just call methods on and have the address automatically stored.

Using Routes:

// CommonJS require
const { Routes } = require("flexpool");
// ES6 Import
import { Routes } from "flexpool";

Routes.miner.balance("0xeXXXXXXXXXXXXXX").then(data => console.log(data));

Using Util:

// CommonJS require
const { Utils } = require("flexpool");
// ES6 Import
import { Utils } from "flexpool";

const main_miner = Utils.miner("0xeXXXXXXXXXXXXXX");
main_miner.balance().then(data => console.log(data))

In addition to the above objects, all the API Typings are exported as well for your convenience. They are formatted as such: {HTTPMETHOD}{GROUP}{ACTION}, so for example GetMinerCurrentStats. All of these have a jsdoc comment (custom) of @destination which will tell you what endpoint the interface corresponds to.

Documentation

You can find the documentation at: https://zaida04.github.io/mining-pool-libs-documentation/

Contributing

Please see the main README.md for info on how to contribute to this package or the other mining-pool-wrappers packages.

LICENSE

Licensed under the MIT License

Have questions? Ask on my Discord

Package Sidebar

Install

npm i flexpool

Weekly Downloads

2

Version

0.0.4

License

MIT

Unpacked Size

137 kB

Total Files

43

Last publish

Collaborators

  • nico.03727