faucethubapi-promise

1.0.1 • Public • Published

FaucethubAPI

Unofficial module for Faucethub API that uses Promises

Constructor

    /**
     * @param api_key Faucethub API Key
     * @param currency A valid currency acronym
     */
    constructor (api_key, currency = 'BTC')

send

    /**
     * @description The method to send coins to an address
     * @param to The coin address you are sending to
     * @param amount The amount to send in satoshi
     * @param referral Set this value to true, 1, or simply leave it blank. Use it to indicate that this payout is a referral earning
     * @param ip_address Include the user's IP address to help contribute to the fight against bots and malicious users
     * @return {Promise} 
     */
    public send(to, amount, referral, ip_address)

getPayouts

    /**
     * @description The method to get the last few payouts you did, up to 10.
     * @param count A value between 1 and 10, defaults to 1
     * @return {Promise} 
     */
    public getPayouts(count)

getCurrencies

    /**
     * @description The method to get a list of all the currencies we support on our platform and their status
     * @return {Promise} 
     */
    public getCurrencies()

getBalance

    /**
     * @description The method to get your account balance in any supported currency
     * @return {Promise} 
     */
    public getBalance() 

checkAddress

    /**
     * @description The method to check if their currency address belongs to an account
     * @param address The coin address you checking
     * @return {Promise} 
     */
    public checkAddress(address)

Example

    const FaucethubAPIPromise = require('faucethubapi-promise');
 
    let faucethubapipromise = new FaucethubAPIPromise('azertyuiopqsdfghjklmwxcvbn', 'DOGE')
    
    // Send 0.5 DOGE
    faucethubapipromise.send('DN2G517mi4snqc3eewBRLgdATVCfQwPQ6f', 50000000, false, "").then((res) => {
        console.log(res); // {"status":200,"message":"OK","payout_id":1234567890,"payout_user_hash":"2ezfdgr256zef5ze6fd5","currency":"DOGE","balance":269214569,"balance_bitcoin":2.69214569}
    });
   

Dependents (0)

Package Sidebar

Install

npm i faucethubapi-promise

Weekly Downloads

7

Version

1.0.1

License

MIT

Unpacked Size

6.5 kB

Total Files

3

Last publish

Collaborators

  • statorcrime