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<Conversion> convertCurrency({
String? profileId,
required String from,
required String to,
required double amount,
String? nonce,
}) async {
var response = await _conversionsRestClient.convertCurrency(
profileId: profileId,
from: from,
to: to,
amount: amount,
nonce: nonce,
);
if (response.statusCode != 200) throw response;
return Conversion.fromJson(mapDecode(response.body));
}