Library for work with currency.com exchange write on TypeScript.
# npm install currencylib
or
# yarn add currencylib
import { Currency } from "currencylib";
const currency = new Currency({
apiKey: "<API_KEY>",
secret: "<SECRET_KEY>",
});
let balances = await currency.balances(); // get account balances
let filledOrders = await currency.history("BTC/RUB"); // get filled orders
let openOrders = await currency.getOpenOrders(); // get open orders
let buyMarketResult = await currency.buy("BTC/USD", 0.01); // create market order: buy 0.01 BTC by market price
let buyLimitResult = await currency.buy("BTC/USD", 0.01, 40_000); // create limit order: buy 0.01 BTC for 40 000$
let sellMarketResult = await currency.sell("BTC/USD", 0.01); // create market order: sell 0.01 BTC by market price
let sellLimitResult = await currency.sell("BTC/USD", 0.01, 50_000); // create limit order: sell 0.01 BTC for 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();
Bug reports and pull requests are welcome on GitHub.
The package is available as open source under the terms of the MIT License.