Skip to content

Commit

Permalink
COR-31331: Add support paged exchange account endpoint (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitShe authored Oct 17, 2023
1 parent fdc76e6 commit 6f3f1d0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ import {
ContractDeployRequest,
PendingTokenLinkDto,
TAP,
ExchangeAccountsPageFilter,
PagedExchangeResponse,
} from "./types";
import { AxiosProxyConfig, AxiosResponse } from "axios";
import { PIIEncryption } from "./pii-client";
Expand Down Expand Up @@ -411,6 +413,13 @@ export class FireblocksSDK {
return await this.apiClient.issueGetRequest("/v1/exchange_accounts");
}

/**
* Gets all exchange accounts for your tenant
* @param filter Get exchange accounts matching pageFilter params
*/
public async getExchangeAccountsPaged(filter: ExchangeAccountsPageFilter): Promise<PagedExchangeResponse> {
return await this.apiClient.issueGetRequest(`/v1/exchange_accounts/paged?${queryString.stringify(filter)}`);
}

/**
* Gets a single exchange account by ID
Expand Down
16 changes: 16 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,16 @@ export interface ExchangeResponse {
status: string;
}

export interface PagedExchangeResponse {
exchanges: ExchangeResponse[];
paging?: {
before?: string;
after?: string;
};
prevUrl?: string;
nextUrl?: string;
}

export interface ConvertExchangeAssetResponse {
status: boolean;
}
Expand Down Expand Up @@ -943,6 +953,12 @@ export interface TransactionPageFilter {
sort?: "ASC" | "DESC";
}

export interface ExchangeAccountsPageFilter {
limit: number;
before?: string;
after?: string;
}

export enum TransactionOrder {
CREATED_AT = "createdAt",
LAST_UPDATED = "lastUpdated"
Expand Down

0 comments on commit 6f3f1d0

Please sign in to comment.