diff --git a/fireblocks_sdk/api_types.py b/fireblocks_sdk/api_types.py index dcfa1e6..a35f25e 100644 --- a/fireblocks_sdk/api_types.py +++ b/fireblocks_sdk/api_types.py @@ -257,6 +257,24 @@ def __init__(self, name_prefix=None, name_suffix=None, min_amount_threshold=None self.before = before self.after = after +class PagedExchangeAccountRequestFilters(object): + """ Optional filters to apply for request + + Args + + limit (number, optional): Results page size + before (string, optional): cursor string received from previous request + after (string, optional): cursor string received from previous request + + Constraints + - You should only insert 'before' or 'after' (or none of them), but not both + - For default and max 'limit' values please see: https://docs.fireblocks.com/api/swagger-ui/#/ + """ + + def __init__(self, limit=None, before=None, after=None): + self.limit = limit + self.before = before + self.after = after class GetAssetWalletsFilters(object): """ Optional filters to apply for request diff --git a/fireblocks_sdk/sdk.py b/fireblocks_sdk/sdk.py index 912757b..70fd2dd 100644 --- a/fireblocks_sdk/sdk.py +++ b/fireblocks_sdk/sdk.py @@ -33,6 +33,7 @@ GetSmartTransferFilters, NFTsWalletTypeValues, NFTOwnershipStatusUpdatedPayload, + PagedExchangeAccountRequestFilters, ) from .sdk_token_provider import SdkTokenProvider @@ -726,6 +727,35 @@ def get_exchange_accounts(self): return self._get_request("/v1/exchange_accounts") + def get_exchange_accounts_paged(self, paged_exchange_accounts_request_filters: PagedExchangeAccountRequestFilters): + """Gets a page of vault accounts for your tenant according to filters given + + Args: + paged_exchange_accounts_request_filters (object, optional): Possible filters to apply for request + """ + + url = f"/v1/exchange_accounts/paged" + limit, before, after = \ + attrgetter('limit', 'before', 'after')( + paged_exchange_accounts_request_filters) + + params = {} + + + if limit is not None: + params['limit'] = limit + + if before is not None: + params['before'] = before + + if after is not None: + params['after'] = after + + if params: + url = url + "?" + urllib.parse.urlencode(params) + + return self._get_request(url) + def get_exchange_account(self, exchange_account_id): """Gets an exchange account for your tenant Args: