withdrawToCryptoAddress method

Future<Transaction> withdrawToCryptoAddress({
  1. String? profileId,
  2. required double amount,
  3. required String currency,
  4. required String cryptoAddress,
  5. String? destinationTag,
  6. bool? noDestinationTag,
  7. String? twoFactorCode,
  8. int? nonce,
  9. String? fee,
})

Withdraw to crypto address

Withdraws funds from the specified profile_id to an external crypto address

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

Implementation

Future<Transaction> withdrawToCryptoAddress({
  String? profileId,
  required double amount,
  required String currency,
  required String cryptoAddress,
  String? destinationTag,
  bool? noDestinationTag,
  String? twoFactorCode,
  int? nonce,
  String? fee,
}) async {
  var response = await _transfersRestClient.withdrawToCryptoAddress(
    profileId: profileId,
    amount: amount,
    currency: currency,
    cryptoAddress: cryptoAddress,
    destinationTag: destinationTag,
    noDestinationTag: noDestinationTag,
    twoFactorCode: twoFactorCode,
    nonce: nonce,
    fee: fee,
  );

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

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