withdrawToCoinbaseAccount method

Future<Response> withdrawToCoinbaseAccount({
  1. String? profileId,
  2. required double amount,
  3. required String coinbaseAccountId,
  4. required String currency,
})

Withdraw to Coinbase account

Withdraws funds from the specified profile_id to a www.coinbase.com wallet.

https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawcoinbaseaccount

Implementation

Future<http.Response> withdrawToCoinbaseAccount({
  String? profileId,
  required double amount,
  required String coinbaseAccountId,
  required String currency,
}) async {
  Map<String, String> body = {
    'amount': amount.toString(),
    'coinbase_account_id': coinbaseAccountId,
    'currency': currency,
  };
  if (profileId != null) body['profile_id'] = profileId;

  return post(
    path: '/withdrawals/coinbase-account',
    body: body,
  );
}