Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,24 @@ def get_exchange_account_asset(self, exchange_account_id, asset_id):

return self._get_request(f"/v1/exchange_accounts/{exchange_account_id}/{asset_id}")

def convert_exchange_account_asset(self, exchange_account_id, src_asset, dest_asset, amount, idempotency_key=None):
"""Convert an asset at an Exchange Account

Args:
exchange_account_id (string): The exchange ID in Fireblocks
src_asset (string): The source asset to convert from
dest_asset (string): The destination asset to convert to
amount (double): The amount to transfer
idempotency_key (str, optional)
"""
body = {
"srcAsset": src_asset,
"destAsset": dest_asset,
"amount": amount
}

return self._post_request(f"/v1/exchange_accounts/{exchange_account_id}/convert", body, idempotency_key)

def transfer_to_subaccount(self, exchange_account_id, subaccount_id, asset_id, amount, idempotency_key=None):
"""Transfer to a subaccount from a main exchange account

Expand Down