D
D
Danil Sysoev2016-02-24 23:04:10
PHP
Danil Sysoev, 2016-02-24 23:04:10

Why does not create an account in the Coinbase API?

Hello guys.
In general, there was a need to implement the API in my project, I basically set everything up, except for one thing: There is a need to create new addresses (wallets) in your account using the API.
The problem is this:
The function in this form does not want to work:

$account = new Account([
    ['name'] => 'HelloWorld'
  ]);
  $client->createAccount($account);

However, such a remark, if I write the data of an existing one into the $account variable, then it duplicates the name, type, etc. (but with a different id, respectively) and a new one is created.
$account = $client->getPrimaryAccount();
$client->createAccount($account);

When I print print_r($account);I get this:
Coinbase\Wallet\Resource\Account Object
(
    [name:Coinbase\Wallet\Resource\Account:private] => New Account Name
    [primary:Coinbase\Wallet\Resource\Account:private] => 1
    [type:Coinbase\Wallet\Resource\Account:private] => wallet
    [currency:Coinbase\Wallet\Resource\Account:private] => BTC
    [createdAt:Coinbase\Wallet\Resource\Account:private] => DateTime Object
        (
            [date] => 2016-01-23 17:49:29.000000
            [timezone_type] => 2
            [timezone] => Z
        )
    [updatedAt:Coinbase\Wallet\Resource\Account:private] => DateTime Object
        (
            [date] => 2016-02-24 18:18:39.000000
            [timezone_type] => 2
            [timezone] => Z
        )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hefx, 2016-03-23
@hefx

When it comes to bitcoin, the people at /r/Bitcoin on reddit are best understood.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question