depositFromCoinbaseAccount method

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

Deposit from Coinbase account

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

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

Implementation

Future<Transaction> depositFromCoinbaseAccount({
  String? profileId,
  required double amount,
  required String coinbaseAccountId,
  required String currency,
}) async {
  var response = await _transfersRestClient.depositFromCoinbaseAccount(
    profileId: profileId,
    amount: amount,
    coinbaseAccountId: coinbaseAccountId,
    currency: currency,
  );

  if (response.statusCode != 200) throw response;

  return Transaction.fromJson(json.decode(response.body));
}