Skip to content

Commit

Permalink
added get_paginated_addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
barakfireblocks committed Nov 14, 2023
1 parent e8470e6 commit 80477aa
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2042,19 +2042,28 @@ 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=None, asset_id=None, limit=500, before=None, after=None):
def get_paginated_addresses(self, vault_account_id, asset_id, limit=500, before=None, after=None):
"""get addresses for a vault account for asset with paging
Args:
vault_account_id (str, optional): The vault account Id
asset_id (str, optional): the asset Id
before (boolean, optional): get only permanent addresses (default False)
after (str, optional): id for the next paging
vault_account_id (str): The vault account Id
asset_id (str): the asset Id
limit(number, optional): limit of addresses per paging request
"""
url = f"/v1/address?accountId={vault_account_id}&assetId={asset_id}&limit={limit}&before={before}&after={after}"
before (str, optional): curser for the previus paging
after (str, optional): curser for the next paging
return self._get_request(url)
"""
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
Expand Down

0 comments on commit 80477aa

Please sign in to comment.