expresscryptoapi v1.0.0
Node.js implementation of the ExpressCrypto API
š Homepage
Install
npm install expresscryptoapi
Run tests
npm run test
Usage
To start using the API, you need to firstly grab your API key and your User Token, then you need to start an instance of the class ExpressCrypto by doing:
const express = require("expresscryptoapi");
let ec = express("Your API Key", "Your User Token");
Then you can run any of the API methods.
API Methods
Note:
The API uses Promises to do the error handling, it'll return an error if the Status code of the response is not 200 or if there's some connection problem.
sendPayment(UserID, Currency, Amount)
Sends a specific amount of satoshies from the currency balance to the specified User ID.
Example:
ec.sendPayment("EC-UserId-XXX", "DOGE", "1")
.then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
sendReferralCommision(UserID, Currency, Amount)
Sends a specific amount of satoshies from the currency balance to the specified User ID as a referral payment.
Example:
ec.sendReferralCommision("EC-UserId-XXX", "DOGE", "1")
.then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
checkUserHash(UserID)
Checks if the specific User exists in the ExpressCrypto database.
Example:
ec.checkUserHash("EC-UserId-XXX")
.then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
getBalance(Currency)
Gets the balance for the specified currency.
Example:
ec.getBalance("BTC")
.then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
getAvailableCurrencies()
Gets the available currencies that ExpressCrypto accepts.
Example:
ec.getAvailableCurrencies()
.then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
getListOfSites()
Gets the list of sites registered in ExpressCrypto.
Example:
ec.getListOfSites()
.then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
Author
š¤ Houssem Ben Taher
š¤ Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
Give a āļø if this project helped you!
š License
This project is MIT licensed.
This README was generated with ā¤ļø by readme-md-generator