Skip to content

Commit

Permalink
chore: optional params and cleaner type
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianBoehler committed Apr 3, 2024
1 parent dffb6f0 commit 9cb88ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
15 changes: 6 additions & 9 deletions src/main-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1165,13 +1165,13 @@ export class MainClient extends BaseRestClient {
**/

getFlexibleSavingProducts(
params: SimpleEarnProductListParams,
params?: SimpleEarnProductListParams,
): Promise<SimpleEarnFlexibleProductListResponse> {
return this.getPrivate(`/sapi/v1/simple-earn/flexible/list`, params);
}

getSimpleEarnLockedProductList(
params: SimpleEarnProductListParams,
params?: SimpleEarnProductListParams,
): Promise<SimpleEarnLockedProductListResponse> {
return this.getPrivate(`/sapi/v1/simple-earn/locked/list`, params);
}
Expand Down Expand Up @@ -1201,22 +1201,19 @@ export class MainClient extends BaseRestClient {
}

getFlexibleProductPosition(
params: SimpleEarnFlexibleProductPositionParams,
params?: SimpleEarnFlexibleProductPositionParams,
): Promise<SimpleEarnFlexibleProductListResponse> {
return this.getPrivate(`/sapi/v1/simple-earn/flexible/position`, params);
}

getLockedProductPosition(
params: SimpleEarnLockedProductPositionParams,
params?: SimpleEarnLockedProductPositionParams,
): Promise<SimpleEarnLockedProductPositionResponse> {
return this.getPrivate(`/sapi/v1/simple-earn/locked/position`, params);
}

getSimpleEarnAccount(params: {
recvWindow?: number;
timestamp: number;
}): Promise<SimpleEarnAccountResponse> {
return this.getPrivate(`/sapi/v1/simple-earn/account`, params);
getSimpleEarnAccount(): Promise<SimpleEarnAccountResponse> {
return this.getPrivate(`/sapi/v1/simple-earn/account`);
}

/**
Expand Down
7 changes: 5 additions & 2 deletions src/types/simpleEarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ export interface SimpleEarnFlexibleProductPositionParams {
size?: number;
}

export interface SimpleEarnLockedProductPositionParams
extends SimpleEarnFlexibleProductPositionParams {
export interface SimpleEarnLockedProductPositionParams {
asset?: string;
productId?: string;
current?: number;
size?: number;
positionId?: string;
}

Expand Down

0 comments on commit 9cb88ba

Please sign in to comment.