1.0.0 • Published 7 months ago
fixedfloat v1.0.0
Installation
With NPM
npm i fixedfloat
With Yarn
yarn add fixedfloat
Usage
const FixedFloat = require("fixedfloat");
const ff = new FixedFloat('API_KEY', 'API_SECRET');
Methods
- constructor(settings)
- .getCurrencies()
- .getPrice(fromCcy, toCcy, amount, direction, type)
- .getOrder(id, token)
- .setEmergency(id, token, choice, address, tag)
- .createOrder(fromCcy, toCcy, toAddress, amount, direction, type, tag)
constructor(settings)
Create instance.
const ff = new FixedFloat('API_KEY', 'API_SECRET');
.getCurrencies()
Getting a list of currencies supported by the FixedFloat service. Official docs
const response = await ff.getCurrencies();
.getPrice(fromCcy, toCcy, amount, direction, type)
Getting the exchange rate of a pair of currencies in the selected direction and type of rate. Official docs
// Simple float
const response = await ff.getPrice('ETH', 'BTC', 0.1, 'from', 'float');
// Reversive fixed
const response = await ff.getPrice('ETH', 'BTC', 0.1, 'to', 'fixed');
.getOrder(id, token)
The method receives the updated order data. Official docs
const response = await ff.getOrder('ORDER_ID', 'ORDER_TOKEN');
.setEmergency(id, token, choice, address, tag)
Emergency Action Choice. Official docs
await ff.setEmergency('ORDER_ID', 'ORDER_TOKEN', 'EXCHANGE or REFUND', 'ADDRESS for refund', 'TAG');
.createOrder(fromCcy, toCcy, toAddress, amount, direction, type, tag)
Creating an order for the exchange of selected currencies with a specified amount and address. Official docs
const response = await ff.createOrder('ETH', 'BTC', 'BTC address', 10, 'from', 'float');
License
fixedfloat is Licensed under the ISC License. Simple and clear about ISC License is written here
1.0.0
7 months ago