Skip to content

Commit

Permalink
Merge pull request #5 from tiagosiebler/#4/urlsuffix
Browse files Browse the repository at this point in the history
fix(#4): url suffix
  • Loading branch information
tiagosiebler authored Apr 20, 2021
2 parents e5b4954 + 3e70b34 commit 6d57ba5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ftx-api",
"version": "1.0.2",
"version": "1.0.3",
"description": "Node.js connector for FTX's REST APIs and WebSockets",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
24 changes: 12 additions & 12 deletions src/rest-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export class RestClient {
marketName: string;
depth?: number;
}): GenericAPIResponse {
const suffix = params.depth ? `depth=${params.depth}` : '';
return this.requestWrapper.get(`markets/${params.marketName}/orderbook?${suffix}`);
const suffix = params.depth ? `?depth=${params.depth}` : '';
return this.requestWrapper.get(`markets/${params.marketName}/orderbook${suffix}`);
}

getTrades(params: {
Expand Down Expand Up @@ -168,8 +168,8 @@ export class RestClient {
}

getPositions(showAveragePrice?: boolean): GenericAPIResponse {
const suffix = showAveragePrice ? 'showAvgPrice=true' : '';
return this.requestWrapper.get(`positions?${suffix}`);
const suffix = showAveragePrice ? '?showAvgPrice=true' : '';
return this.requestWrapper.get(`positions${suffix}`);
}

setAccountLeverage(leverage: number): GenericAPIResponse {
Expand Down Expand Up @@ -199,8 +199,8 @@ export class RestClient {
coin: string;
method?: string;
}): GenericAPIResponse {
const suffix = params.method ? `method=${params.method}` : '';
return this.requestWrapper.get(`wallet/deposit_address/${params.coin}?${suffix}`);
const suffix = params.method ? `?method=${params.method}` : '';
return this.requestWrapper.get(`wallet/deposit_address/${params.coin}${suffix}`);
}

getDepositHistory(params?: {
Expand Down Expand Up @@ -264,8 +264,8 @@ export class RestClient {
**/

getOpenOrders(market?: string): GenericAPIResponse {
const suffix = market ? `market=${market}` : '';
return this.requestWrapper.get(`orders?${suffix}`);
const suffix = market ? `?market=${market}` : '';
return this.requestWrapper.get(`orders${suffix}`);
}

getOrderHistory(params?: {
Expand Down Expand Up @@ -406,8 +406,8 @@ export class RestClient {
}

getQuoteStatus(quoteId: string, market?: string): GenericAPIResponse {
const suffix = market ? `market=${market}` : '';
return this.requestWrapper.get(`otc/quotes/${quoteId}?${suffix}`);
const suffix = market ? `?market=${market}` : '';
return this.requestWrapper.get(`otc/quotes/${quoteId}${suffix}`);
}

acceptQuote(quoteId: string): GenericAPIResponse {
Expand All @@ -434,8 +434,8 @@ export class RestClient {
}

getMarketInfo(market?: string): GenericAPIResponse {
const suffix = market ? `market=${market}` : '';
return this.requestWrapper.get(`spot_margin/market_info?${suffix}`);
const suffix = market ? `?market=${market}` : '';
return this.requestWrapper.get(`spot_margin/market_info${suffix}`);
}

getBorrowHistory(): GenericAPIResponse {
Expand Down

0 comments on commit 6d57ba5

Please sign in to comment.