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
42 changes: 42 additions & 0 deletions cbpro/authenticated_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,3 +995,45 @@ def get_trailing_volume(self):

"""
return self._send_message('get', '/users/self/trailing-volume')

def get_fees(self):
""" Get current fees.

This request will return your current maker & taker fee rates, as well as your 30-day trailing volume.

Returns:
dict: Current fees. Example::
{
"maker_fee_rate": "0.0000",
"taker_fee_rate: "0.0030",
"usd_colume": "20591.77"
}

"""
return self._send_message('get', '/fees')

def create_conversion(self, from_id, to_id, amount):
""" Create a stablecoin conversion.

Args:
from_id (str): A valid currency ID to convert 'from'.
to_id (str): A valid currency ID to convert 'to'.
amount (Decimal): Amount of 'from' to convert 'to'.

Returns:
dict: Information about the conversion. Example::
{
"id": "8942caee-f9d5-4600-a894-4811268545db",
"amount": "10000.00",
"from_account_id": "7849cc79-8b01-4793-9345-bc6b5f08acce",
"to_account_id": "105c3e58-0898-4106-8283-dc5781cda07b",
"from": "USD",
"to": "USDC"
}

"""
params = {'from': from_id,
'to': to_id,
'amount': amount}
return self._send_message('post', '/conversions',
data=json.dumps(params))