node.js wrapper for advcash cryptocurrency exchange
The official documentation can be found here
- Node 6.0
- Advcash account (click here to register)
- Advcash api key
npm install --save advcash
All methods returns a promise as result
var advcash = require('advcash');
var options = {
password: 'password created previously',
apiName: 'api created previously',
email: 'email used to create the advcash account'
};
advcash(options).then(function(client) {
// client is ready
})
Getting the currency exchange rate
Name | Type | Description |
---|---|---|
from | String | USD, EUR, RUR, GBP, UAH, BTC |
to | String | USD, EUR, RUR, GBP, UAH, BTC |
action | String | BUY, SELL |
amount | Float | Transaction amount (accuracy – up to two digits after decimal point) |
var arguments = {
from: "BTC",
to: "USD",
action: "SELL",
amount: 0.5
};
client.checkCurrencyExchange(arguments).then(function(response) {
console.log(response)
})
Response
{
"amountExchanged": 636.32,
"rate": 1272.63,
"from": "BTC",
"to": "USD",
"action": "SELL",
"amount": 0.5
}
Get Balance per User’s Wallets
client.getBalances().then(function(balances) {
console.log(balances)
})
Response
[
{
"amount": 0.55,
"id": "U768564323906"
},
{
"amount": 0.80,
"id": "E527005319826"
}
]
Checking matching the first and last name of the user in the Advanced Cash system with the name and last name in a third-party system
var arguments = {
email: "[email protected]",
firstName: "First name example",
lastName: "Last name example"
};
client.validateAccount(arguments).then(function(response) {
console.log(response)
})
Response
{
"firstNameMatchingPercentage": 90.55,
"rate": 55.56
}
Validation of Account’s Existence
var emails = ['[email protected]', '[email protected]']
client.validateAccounts(emails).then(function(response) {
console.log(response)
})
Response
[
{
"present": false,
"accountEmail": "[email protected]"
},
{
"present": true,
"accountEmail": "[email protected]"
}
]
- Erik Nakata
- Leonardo Cadastro
This project is licensed under the MIT License - see the LICENSE file for details