Skip to content
/ advcash Public
forked from eriknakata/advcash

node.js wrapper for advcash cryptocurrency exchange

License

Notifications You must be signed in to change notification settings

ByMsx/advcash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Code Climate Test Coverage dependencies Status

Advcash

node.js wrapper for advcash cryptocurrency exchange

Documentation

The official documentation can be found here

Prerequisites

  • Node 6.0
  • Advcash account (click here to register)
  • Advcash api key

Installing

npm install --save advcash

Examples

All methods returns a promise as result

client

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
})

checkCurrencyExchange

Getting the currency exchange rate

Arguments

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
  }

getBalances

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"
    }
  ]

validateAccount

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
  }

validateAccounts

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]"
    }
  ]

Contributing

  • Erik Nakata
  • Leonardo Cadastro

License

This project is licensed under the MIT License - see the LICENSE file for details

About

node.js wrapper for advcash cryptocurrency exchange

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%