New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

faucethub-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

faucethub-api

API for service faucethub.io

unpublished
latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Unofficial faucethub.io API

Library for faucet on faucethub.io

Install

npm install faucethub-api

Using

For all methods check official docs: faucethub.io/api ###Interface

/**
 * @param api_key {String} - api key
 * @param currency {String} - currency for faucet (BTC, LTC, DOGE, ...)
 * @constructor
 */
const FaucethubAPI = require('faucethub-api');

/**
 * get-request without body
 * @param callback {Function.<Object>}
 * */
FaucethubAPI.getBalance(callback);

/**
 * @param address {String} currency address
 * @param callback {Function.<Object>}
 * */
FaucethubAPI.checkAddress(address, callback);

/**
 * put-request with header "Content-Type: application/x-www-form-urlencoded" and body
 * @param address {String} currency address
 * @param amount {Number} amount of currency in satoshi
 * @param callback {Function.<Object>}
 * */
FaucethubAPI.send(address, amount, callback);

/**
 * @param count {Number} count of last rewards
 * @param callback {Function.<Object>}
 * */
FaucethubAPI.payouts(count,  callback);

###example

const FaucethubAPI = require('faucethub-api');
const api_key = "abcdefghijklmnopqrstuvwxyz";
const currency = "DOGE";

const faucethubApi = new  FaucethubAPI(api_key,currency);

faucethubApi.getBalance(res => {
    console.log(res);
});
/**
{
  "status": 200,
  "message": "OK",
  "currency": "DOGE",
  "balance": 1000000000000,
  "balance_bitcoin": 10000
}
*/

faucethubApi.payouts(10, res => {
    console.log(res);
});
/**
{
  "status": 200,
  "message": "OK",
  "rewards": [
    {
      "to": "CURRENCY_ADDRESS_HERE",
      "amount": 1,
      "date": "17-11-16 10:38:48 GMT"
    },
    {
      "to": "CURRENCY_ADDRESS_HERE",
      "amount": 1,
      "date": "17-11-16 10:38:33 GMT"
    }
  ]
}
*/

faucethubApi.checkAddress("DMtLpJF8a2GHFZNFD6wLf4ZprdorAC4a5r", res => {
    console.log(res);
});
/**
{
  "status": 200,
  "message": "OK",
  "payout_user_hash": "SOME_HASH"
}
*/

faucethubApi.send("DMtLpJF8a2GHFZNFD6wLf4ZprdorAC4a5r", 100000000 /* 1 DOGE */, res => {
    console.log(res);
});
/**
{
  "status": 200,
  "message": "OK",
  "rate_limit_remaining": 1.24004514,
  "currency": "DOGE",
  "balance": 29000000,
  "balance_bitcoin": 0.290000,
  "payout_id": 1234,
  "payout_user_hash": "SOME_HASH"
}
*/

Keywords

faucethub.io

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts