From 3ebe992e928921c6a53500aa3dbdeb6c01ce6d2f Mon Sep 17 00:00:00 2001 From: bpayne Date: Thu, 16 Nov 2023 10:54:22 +0200 Subject: [PATCH] added a method that returns a paginated response of the addresses for a given vault account and asset --- fireblocks_sdk/sdk.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fireblocks_sdk/sdk.py b/fireblocks_sdk/sdk.py index d6d167f..cedd508 100644 --- a/fireblocks_sdk/sdk.py +++ b/fireblocks_sdk/sdk.py @@ -2080,6 +2080,27 @@ def get_max_bip44_index_used(self, vault_account_id, asset_id): return self._get_request(url) + def get_paginated_addresses(self, vault_account_id, asset_id, limit=500, before=None, after=None): + """Gets a paginated response of the addresses for a given vault account and asset + Args: + vault_account_id (str): The vault account Id + asset_id (str): the asset Id + limit(number, optional): limit of addresses per paging request + before (str, optional): curser for the previous paging + after (str, optional): curser for the next paging + """ + path = f"/v1/vault/accounts/{vault_account_id}/{asset_id}/addresses_paginated" + params = {} + if limit: + params["limit"] = limit + if before: + params["before"] = before + if after: + params["after"] = after + if params: + path = path + "?" + urllib.parse.urlencode(params) + return self._get_request(path) + def set_auto_fuel(self, vault_account_id, auto_fuel, idempotency_key=None): """Sets autoFuel to true/false for a vault account