currencylib
Library for work with currency.com exchange write on TypeScript.
How to install
# npm install currencylib
or
# yarn add currencylib
How to use
import { Currency } from "currencylib";
const currency = new Currency({
apiKey: "<API_KEY>",
secret: "<SECRET_KEY>",
});
let balances = await currency.balances();
let filledOrders = await currency.history("BTC/RUB");
let openOrders = await currency.getOpenOrders();
let buyMarketResult = await currency.buy("BTC/USD", 0.01);
let buyLimitResult = await currency.buy("BTC/USD", 0.01, 40_000);
let sellMarketResult = await currency.sell("BTC/USD", 0.01);
let sellLimitResult = await currency.sell("BTC/USD", 0.01, 50_000);
This library based on official doc API. If you want to use API as is, use currency.api
:
let info = currency.api.exchangeInfo();
Contributing
Bug reports and pull requests are welcome on GitHub.
License
The package is available as open source under the terms of the MIT License.