convertCurrency method
Convert a currency
Converts funds from from currency to to currency. Funds are converted on the from account in the profile_id profile.
https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postconversion
Implementation
Future<http.Response> convertCurrency({
String? profileId,
required String from,
required String to,
required double amount,
String? nonce,
}) async {
Map<String, String> body = {
'from': from,
'to': to,
'amount': amount.toString(),
};
if (profileId != null) body['profile_id'] = profileId;
if (nonce != null) body['nonce'] = nonce;
return post(
path: '/conversions',
body: body,
);
}