Slush Pool JavaScript Library
This unofficial Slush Pool library provides convenient access to the Slush Pool API from client-side and server-side JavaScript applications.
Installation
npm install slushpool
# or
yarn add slushpool
Usage
The package needs to be configured with an access token from your Slush Pool account:
- Log in to Slush Pool.
- Go to Settings > Access Profiles.
- Select an existing access profile or create a new one.
- Select Allow access to web APIs in the access profile details.
- Click Generate new token.
- Click Save.
import slushpool from 'slushpool'
async function example() {
slushpool.init('YOUR_SLUSH_POOL_ACCESS_TOKEN')
const stats = await slushpool.stats()
const profile = await slushpool.profile()
const rewards = await slushpool.rewards()
const workers = await slushpool.workers()
}
Documentation
This library is a pretty lightweight wrapper around the Slush Pool API, so Slush Pool's API documentation is probably helpful. It also includes type definitions, so it should be convenient for TypeScript folks.