withdrawToPaymentMethod method
Withdraw to payment method
Withdraws funds from the specified profile_id to a linked external payment method
https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawpaymentmethod
Implementation
Future<Transaction> withdrawToPaymentMethod({
String? profileId,
required double amount,
required String paymentMethodId,
required String currency,
}) async {
var response = await _transfersRestClient.withdrawToPaymentMethod(
profileId: profileId,
amount: amount,
paymentMethodId: paymentMethodId,
currency: currency,
);
if (response.statusCode != 200) throw response;
return Transaction.fromJson(json.decode(response.body));
}