以下是我的测试代码
<?php
require_once('vendor/autoload.php');
use Coinbase\Wallet\Resource\Account;
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
use Coinbase\Wallet\Enum\CurrencyCode;
use Coinbase\Wallet\Resource\Transaction;
use Coinbase\Wallet\Value\Money;
use Coinbase\Wallet\Resource\Address;
$apiKey='xxxx';
$apiSecret='xxxxxxxx';
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$account = $client->getPrimaryAccount();
$address = new Address([
'name' => 'New Address16'
]);
$client->createAccountAddress($account, $address);
$addresses = $client->getAccountAddress($account, $address);
echo $addresses;
?>
如何将$ addresses转换为字符串?提及回声产生错误,因为无法将其转换为字符串
我尝试了parse_str(),但不起作用
我也尝试了echo json_encode($addresses);
并仍然遇到相同的错误
错误是
Recoverable fatal error: Object of class Coinbase\Wallet\Resource\Address could not be converted to string in /home/exhakduz/api/vendor/coinbase/coinbase/src/Client.php on line 285