0.1.3 • Published 4 years ago

kollet-io v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Kollet API Wrapper

Node API wrapper for the Kollet Merchant API

Features

  • Get all the cryptocurrencies supported by Kollet.
  • Generate a payment address. This is the address that customers pay to.
  • Get a balance of a particular cryptocurrency.
  • Get an estimated fee for sending funds on a particular cryptocurrency network.
  • Send out funds to another wallet address on a particular cryptocurrency network.

📦 Installation

npm i kollet-io

📝 Confuring and using module

To access the API, you will need an accessToken or API Key from the merchant dashboard.

Loading module

Load the module via require and pass your API key to the Kollet class.

const Kollet = require("kollet-io")

let client = new Kollet(process.env.accessToken);

Common Usages

Get all available currencies

client.getCurrencies()
    .then(res => console.log(res))
    .catch(err => console.log(err))

Create payment address

  • Takes the currency, label and optional meta data (type object) as arguments

client.createAddress('btc', 'kollet_user')
    .then(res => console.log(res))
    .catch(err => console.log(err))

Get balance of a particular cryptocurrency

  • Accepts code of supported cryptocurrency e.g. btc
client.getBalance("btc")
    .then(res => console.log(res))
    .catch(err => console.log(err))

Get an estimated fee for sending funds on a particular cryptocurrency network.

  • Accepts amount to send, currency code and duration
client.estimateNetworkFee("0.000536", "btc", "FASTEST")
    .then(res => console.log(res))
    .catch(err => console.log(err))

Send out funds to other wallet address on a particular cryptocurrency network.

  • Takes amount to send, currency code, duration and destination address
client.sendCoins("0.000536", "btc", "FASTEST", "XXXXXXXXXXXXXXXXXXXX")
    .then(res => console.log(res))
    .catch(err => console.log(err))