我是 CoinBase 的新手。
我正在使用 getAccounts() 方法来获取所有帐户。
$this->client->getAccounts();
这将返回一个对象类型的对象(Coinbase\Wallet\Resource\ResourceCollection)
object(Coinbase\Wallet\Resource\ResourceCollection)[37]
private 'previousUri' => null
private 'nextUri' => null
private 'resources' =>
array (size=1)
0 =>
object(Coinbase\Wallet\Resource\Account)[35]
private 'name' => string 'BTC Wallet' (length=10)
private 'primary' => boolean true
private 'type' => string 'wallet' (length=6)
private 'currency' => string 'BTC' (length=3)
private 'balance' =>
object(Coinbase\Wallet\Value\Money)[43]
...
private 'nativeBalance' =>
object(Coinbase\Wallet\Value\Money)[47]
...
private 'createdAt' =>
object(DateTime)[48]
...
private 'updatedAt' =>
object(DateTime)[49]
...
private 'id' (Coinbase\Wallet\Resource\Resource) => string 'b12d3892-1228-5da1-a779-c5104bcbd749' (length=36)
private 'resource' (Coinbase\Wallet\Resource\Resource) => string 'account' (length=7)
private 'resourcePath' (Coinbase\Wallet\Resource\Resource) => string '/v2/accounts/b12d3892-1228-5da1-a779-c5104bcbd749' (length=49)
private 'rawData' (Coinbase\Wallet\Resource\Resource) =>
array (size=11)
...
使用 (array) 转换响应会在响应中提供无效字符。
array (size=3)
'�Coinbase\Wallet\Resource\ResourceCollection�previousUri' => null
'�Coinbase\Wallet\Resource\ResourceCollection�nextUri' => null
'�Coinbase\Wallet\Resource\ResourceCollection�resources' =>
array (size=1)
0 =>
object(Coinbase\Wallet\Resource\Account)[35]
private 'name' => string 'BTC Wallet' (length=10)
private 'primary' => boolean true
private 'type' => string 'wallet' (length=6)
private 'currency' => string 'BTC' (length=3)
private 'balance' =>
object(Coinbase\Wallet\Value\Money)[43]
...
private 'nativeBalance' =>
object(Coinbase\Wallet\Value\Money)[47]
...
private 'createdAt' =>
object(DateTime)[48]
...
private 'updatedAt' =>
object(DateTime)[49]
...
private 'id' (Coinbase\Wallet\Resource\Resource) => string 'b12d3892-1228-5da1-a779-c5104bcbd749' (length=36)
private 'resource' (Coinbase\Wallet\Resource\Resource) => string 'account' (length=7)
private 'resourcePath' (Coinbase\Wallet\Resource\Resource) => string '/v2/accounts/b12d3892-1228-5da1-a779-c5104bcbd749' (length=49)
private 'rawData' (Coinbase\Wallet\Resource\Resource) =>
array (size=11)
...
任何帮助将不胜感激。
阿努普