0

I use https://github.com/coinbase/coinbase-php with laravel to send Eth from my wallet to wallet on other service.

I use this method: $client->createAccountTransaction($account, $transaction);

In this way:

$transaction = Transaction::send([
    'to' => new EthrereumAddress($destination_address),
    'amount'           => new Money($amount, $currency),
    'description'      => $description,
    //'fee'              => '0.0001' // only required for transactions under BTC0.0001
]);
$this->client->createAccountTransaction($account, $transaction);

But when I try to do this, I get this error:

The Coinbase API only accepts transactions to an account, email, or bitcoin address

Can someone tell me how to send eth or what is wrong ?

Nimeshka Srimal
  • 8,012
  • 5
  • 42
  • 57
  • The message seems to originate from [this line](https://github.com/coinbase/coinbase-php/blob/0703d1827f786ba208de410b6b887037e1af9c4e/src/Mapper.php#L125). It checks that `to` is of type `Email`, `BitcoinAddress` or `Account`. Your `EthrereumAddress` (is that a typo?) might not derive from any of those. – Karsten Koop Jul 23 '18 at 11:12

1 Answers1

0

This was fixed in the latest 2.8.0 version.

https://github.com/coinbase/coinbase-php/releases/tag/2.8.0

You should use right $account for each cryptocurrency, but not just the $client->getPrimaryAccount();

For example:

$account = Account::reference('YOUR_ETH_ACCOUNT_ID'); 
KAMAEL
  • 175
  • 2
  • 16