submer-crypto / whats-miner

Client library for WhatsMiner JSON over TCP API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

whats-miner

Client library for WhatsMiner JSON over TCP API.

npm install @thermocline-labs/whats-miner

Usage

The client instance exposes a promise based interface for communicating with the WhatsMiner JSON over TCP API. All the methods also accept an optional abort signal used to abort pending requests.

const { WhatsMiner, ResponseError } = require('@thermocline-labs/whats-miner')

const client = WhatsMiner('localhost', 4028)

try {
  const abortController = new AbortController()
  const summary = await client.summary(abortController.signal)

  console.log(summary)
} catch (err) {
  if (err instanceof ResponseError) {
    // Handle response error
    return
  }

  throw err
}

About

Client library for WhatsMiner JSON over TCP API

License:ISC License


Languages

Language:JavaScript 100.0%