node-bithumb
Version:
NodeJS wrapped for Bithumb API
126 lines (125 loc) • 5.09 kB
TypeScript
import { currencyType, tradeType, IGetTicker, IGetOrderBook, IGetTransactionHistory, IGetAssetsStatus, IGetBtci, IPostAccount, IPostBalance, IPostWalletAddress, IPostTickerUser, IPostOrdersParams, IPostOrders, IPostOrderDetail, IPostUserTransactions, IPostPlace, IPostCancel, IPostMarketBuy, IPostMarketSell, IPostWithdrawalCoin, IPostWithDrawalKrw, Time, IGetCandlestickData } from './types';
export default class ApiBithumb {
private apiKey;
private secretKey;
private paymentCurrency;
constructor(apiKey: string, secretKey: string, paymentCurrency: currencyType);
/**
* Bithumb hosts
*/
private hosts;
/**
* Provides the current price of the asset in the bithumb
* https://apidocs.bithumb.com/docs/ticker
*/
getTicker(coinCode: string): Promise<IGetTicker>;
/**
* Provides current sales information for assets in the bithumb
* https://apidocs.bithumb.com/docs/order_book
*/
getOrderBook(coinCode: string): Promise<IGetOrderBook>;
/**
* Provides details of the completion of the transaction in the bithumb
* https://apidocs.bithumb.com/docs/transaction_history
*/
getTransactionHistory(coinCode: string): Promise<IGetTransactionHistory>;
/**
* Provides information about the status of an asset's deposits and withdrawals in the bithumb
* https://apidocs.bithumb.com/docs/assets_status
*/
getAssetsStatus(orderCurrency: string): Promise<IGetAssetsStatus>;
/**
* Provides Bithumb Index (BTMI, BTAI) information.
* https://apidocs.bithumb.com/docs/btci
*/
getBtci(): Promise<IGetBtci>;
/**
* provides a Candlestick data.
* https://apidocs.bithumb.com/docs/candlestick
*/
GetCandlestick(orderCurrency: string, paymentCurrency: string, chartIntervals: Time): Promise<IGetCandlestickData[]>;
/**
* Provide information on membership and coin transaction fees.
* https://apidocs.bithumb.com/docs/account
*/
postAccount(coinCode: string): Promise<IPostAccount>;
/**
* Provide information on assets held by members.
* This API Response could be change the name on the key.
* https://apidocs.bithumb.com/docs/balance
*/
postBalance(coinCode?: string): Promise<IPostBalance>;
/**
* Provide the address of the member's coin deposit wallet.
* https://apidocs.bithumb.com/docs/wallet_address
*/
postWalletAddress(coinCode?: string): Promise<IPostWalletAddress>;
/**
* provides members' virtual asset transaction information.
* https://apidocs.bithumb.com/docs/ticker_user
*/
postTickerUser(orderCurrency: string): Promise<IPostTickerUser>;
/**
* Provide details of the member's purchase/sale registration waiting or transaction.
* https://apidocs.bithumb.com/docs/orders
*/
postOrders(params: IPostOrdersParams): Promise<IPostOrders>;
/**
* Provide details of the member's purchase/sale details.
* https://apidocs.bithumb.com/docs/orders_detail
*/
postOrderDetail(orderId: string, orderCurrency: string): Promise<IPostOrderDetail>;
/**
* Provide information on the member's transaction completion history.
* https://apidocs.bithumb.com/docs/transactions
*/
postUserTransctions(searchGb: number, orderCurrency: string, offset?: number, count?: number): Promise<IPostUserTransactions>;
/**
* provides a designated price purchase/sale registration function.
* https://apidocs.bithumb.com/docs/place
*/
postPlace(orderCurrency: string, units: number, price: number, type: tradeType): Promise<IPostPlace>;
/**
* provides a registered purchase/sale order cancellation function.
* https://apidocs.bithumb.com/docs/cancel
*/
postCancel(type: tradeType, orderId: string, orderCurrency: string): Promise<IPostCancel>;
/**
* provides market price buying.
* https://apidocs.bithumb.com/docs/market_buy
*/
postMarketBuy(units: number, orderCurrency: string): Promise<IPostMarketBuy>;
/**
* provides market price selling function.
* https://apidocs.bithumb.com/docs/market_sell
*/
postMarketSell(units: number, orderCurrency: string): Promise<IPostMarketSell>;
/**
* provides a virtual asset withdrawal application function.
* https://apidocs.bithumb.com/docs/withdrawal_coin
*/
postWithdrawalCoin(units: number, address: string, currency?: string, desination?: string): Promise<IPostWithdrawalCoin>;
/**
* provides a KRW withdrawal application function.
* https://apidocs.bithumb.com/docs/withdrawal_krw
*/
postWithdrawalKrw(bank: string, account: string, price: number): Promise<IPostWithDrawalKrw>;
/**
* request Public API
*/
private requestPublic;
/**
* request Info API
*/
private requestInfo;
/**
* request Trade API
*/
private requestTrade;
/**
* Check the status and throw
*/
private checkStatus;
private getBithumbHeaders;
private refineBalance;
}