Skip to content

Commit

Permalink
chore(): refactor body to query mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed May 20, 2024
1 parent b2e8b2f commit d894caf
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ export class RestClient extends BaseRestClient {
* @param params Withdrawal parameters
* @returns Promise<APIResponse<Withdraw>>
*/
submitWithdraw(body: {
submitWithdraw(params: {
withdraw_order_id?: string;
amount: string;
currency: string;
address?: string;
memo?: string;
chain: string;
}): Promise<APIResponse<Withdraw>> {
return this.postPrivate('/withdrawals', { body });
return this.postPrivate('/withdrawals', { query: params });
}

/**
Expand Down Expand Up @@ -1029,7 +1029,7 @@ export class RestClient extends BaseRestClient {
account?: 'spot' | 'margin' | 'cross_margin' | 'unified';
action_mode?: 'ACK' | 'RESULT' | 'FULL';
}): Promise<APIResponse<Order[]>> {
return this.deletePrivate('/spot/orders', { body: params });
return this.deletePrivate('/spot/orders', { query: params });
}

/**
Expand Down Expand Up @@ -1104,7 +1104,7 @@ export class RestClient extends BaseRestClient {
*/
deleteSpotOrder(params: DeleteSpotOrderReq): Promise<APIResponse<Order>> {
return this.deletePrivate(`/spot/orders/${params.order_id}`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -1212,7 +1212,7 @@ export class RestClient extends BaseRestClient {
market?: string;
account?: 'normal' | 'margin' | 'cross_margin';
}): Promise<APIResponse<SpotPriceTriggeredOrder[]>> {
return this.deletePrivate('/spot/price_orders', { body: params });
return this.deletePrivate('/spot/price_orders', { query: params });
}

/**
Expand All @@ -1237,7 +1237,7 @@ export class RestClient extends BaseRestClient {
order_id: string;
}): Promise<APIResponse<SpotPriceTriggeredOrder>> {
return this.deletePrivate(`/spot/price_orders/${params.order_id}`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -2497,7 +2497,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position>> {
return this.postPrivate(
`/futures/${params.settle}/positions/${params.contract}/margin`,
{ body: params },
{ query: params },
);
}

Expand Down Expand Up @@ -2533,7 +2533,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position>> {
return this.postPrivate(
`/futures/${params.settle}/positions/${params.contract}/risk_limit`,
{ body: params },
{ query: params },
);
}

Expand Down Expand Up @@ -2604,7 +2604,7 @@ export class RestClient extends BaseRestClient {
}>
> {
return this.postPrivate(`/futures/${params.settle}/dual_mode`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -2638,7 +2638,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position[]>> {
return this.postPrivate(
`/futures/${params.settle}/dual_comp/positions/${params.contract}/margin`,
{ body: params },
{ query: params },
);
}

Expand All @@ -2656,7 +2656,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position[]>> {
return this.postPrivate(
`/futures/${params.settle}/dual_comp/positions/${params.contract}/leverage`,
{ body: params },
{ query: params },
);
}

Expand All @@ -2673,7 +2673,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position[]>> {
return this.postPrivate(
`/futures/${params.settle}/dual_comp/positions/${params.contract}/risk_limit`,
{ body: params },
{ query: params },
);
}

Expand Down Expand Up @@ -2733,7 +2733,7 @@ export class RestClient extends BaseRestClient {
side?: string;
}): Promise<APIResponse<FuturesOrder[]>> {
return this.deletePrivate(`/futures/${params.settle}/orders`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -3190,7 +3190,7 @@ export class RestClient extends BaseRestClient {
contract: string;
}): Promise<APIResponse<FuturesPriceTriggeredOrder[]>> {
return this.deletePrivate(`/futures/${params.settle}/price_orders`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -3222,7 +3222,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<FuturesPriceTriggeredOrder>> {
return this.deletePrivate(
`/futures/${params.settle}/price_orders/${params.order_id}`,
{ body: params },
{ query: params },
);
}
/**==========================================================================================================================
Expand Down Expand Up @@ -3621,7 +3621,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position>> {
return this.postPrivate(
`/delivery/${params.settle}/positions/${params.contract}/margin`,
{ body: params },
{ query: params },
);
}

Expand All @@ -3638,7 +3638,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position>> {
return this.postPrivate(
`/delivery/${params.settle}/positions/${params.contract}/leverage`,
{ body: params },
{ query: params },
);
}

Expand All @@ -3655,7 +3655,7 @@ export class RestClient extends BaseRestClient {
}): Promise<APIResponse<Position>> {
return this.postPrivate(
`/delivery/${params.settle}/positions/${params.contract}/risk_limit`,
{ body: params },
{ query: params },
);
}

Expand Down Expand Up @@ -3710,7 +3710,7 @@ export class RestClient extends BaseRestClient {
side?: 'ask' | 'bid';
}): Promise<APIResponse<FuturesOrder[]>> {
return this.deletePrivate(`/delivery/${params.settle}/orders`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -3963,7 +3963,7 @@ export class RestClient extends BaseRestClient {
contract: string;
}): Promise<APIResponse<FuturesPriceTriggeredOrder[]>> {
return this.deletePrivate(`/delivery/${params.settle}/price_orders`, {
body: params,
query: params,
});
}

Expand Down Expand Up @@ -4895,7 +4895,7 @@ export class RestClient extends BaseRestClient {
}[]
>
> {
return this.deletePrivate(`/options/orders`, { body: params });
return this.deletePrivate(`/options/orders`, { query: params });
}

/**
Expand Down Expand Up @@ -5184,7 +5184,7 @@ export class RestClient extends BaseRestClient {
currency?: string;
min_rate?: string;
}): Promise<APIResponse<void>> {
return this.patchPrivate(`/earn/uni/lends`, { body: params });
return this.patchPrivate(`/earn/uni/lends`, { query: params });
}

/**
Expand Down Expand Up @@ -6517,7 +6517,7 @@ export class RestClient extends BaseRestClient {
>
> {
return this.deletePrivate(`/account/stp_groups/${params.stp_id}/users`, {
body: params,
query: params,
});
}

Expand Down

0 comments on commit d894caf

Please sign in to comment.