snapcard-api

Node.js client library for the SNAPCARD API.

Usage no npm install needed!

<script type="module">
  import snapcardApi from 'https://cdn.skypack.dev/snapcard-api';
</script>

README

SNAPCARD

Node.js client library for the Snapcard API.

Install

npm install snapcard

Usage

var snapcard = require('snapcard')({
    apiKey: 'a8OLGw7rrzsVjK8soHSnKOjLmqDGCTKW',
    secretKey: 'f7f09FbpEIjzBlRNT2yTfZVmZ0cBqpx0'
});

snapcard('GET', '/account')
    .then(function(data) {
    },
    function(data) {
    });

snapcard('POST', '/transfer', {
    source: 'wallet:2ef8mls9v9ovvqimiv2jmn0d33nf30dt',
    sourceAmount: 0.01,
    sourceCurrency: 'BTC',
    dest: 'email:test@snapcard.io'
})
    .then(successCallback, errorCallback);

Ability to override options used by the Request client on both constructor and per invocation:

var snapcard = require('snapcard')({
    apiKey: 'a8OLGw7rrzsVjK8soHSnKOjLmqDGCTKW',
    secretKey: 'f7f09FbpEIjzBlRNT2yTfZVmZ0cBpqx0',
    options: {
        timeout: 1500
    }
});
snapcard('GET', '/rates', {}, {
    timeout: 1500
})
    .then(successCallback, errorCallback);