Skip to content

Commit

Permalink
Added generated type definitions for BTCMarkets class
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Addison committed Jan 17, 2018
1 parent ab899f9 commit a808993
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.vscode
node_modules
29 changes: 24 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,33 @@ export = BTCMarkets;

declare class BTCMarkets
{
constructor(key: string,
secret: string,
server: string,
timeout: number);
key: string;
secret: string;
server: string;
timeout: number;

static numberConverter: number;

getTick(instrument: string, currency: string, callback: (err: Error, data: BTCMarkets.Tick)=>void): void;
constructor(key: string, secret: string, server?: string, timeout?: number);

protected privateRequest(path: string, params?: object): Promise<object>;
protected publicRequest(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies, action: string, params?: object): Promise<object>;
protected executeRequest(options: request.OptionsWithUrl, requestDesc: string): Promise<object>;

getTick(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies): Promise<BTCMarkets.Tick>;
getOrderBook(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies): Promise<BTCMarkets.OrderBook>;
getTrades(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies, since?: number): Promise<BTCMarkets.Trade[]>;
createOrder(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies, price: number | void, volume: number, orderSide: BTCMarkets.OrderSide, ordertype: BTCMarkets.OrderType, clientRequestId?: string | void): Promise<BTCMarkets.NewOrder>;
cancelOrders(orderIds: number[]): Promise<BTCMarkets.CancelledOrders>;
getOrderDetail(orderIds: number[]): Promise<BTCMarkets.Orders>;
getOpenOrders(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies, limit?: number | void, since?: number | null): Promise<BTCMarkets.Orders>;
getOrderHistory(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies, limit?: number | void, since?: number | null): Promise<BTCMarkets.Orders>;
getTradeHistory(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies, limit?: number | void, since?: number | null): Promise<BTCMarkets.Trades>;
getAccountBalances(): Promise<BTCMarkets.Balance[]>;
getTradingFee(instrument: BTCMarkets.instruments, currency: BTCMarkets.currencies): Promise<BTCMarkets.TradingFee>;
withdrawCrypto(amount: number, address: string, crypto: string): Promise<BTCMarkets.CryptoWithdrawal>;
withdrawEFT(accountName: string, accountNumber: string, bankName: string, bsbNumber: string, amount: number): Promise<BTCMarkets.BankWithdrawal>;
withdrawHistory(limit: number | void, since: number | void, indexForward: boolean | void): Promise<BTCMarkets.FundWithdrawals>;
}

declare namespace BTCMarkets
Expand Down

0 comments on commit a808993

Please sign in to comment.