我正在制作这个帖子,因为我没有找到任何对我有帮助的正确解决方案,任何人都可以告诉我,我在我的代码中犯了错误。 我在我的php网站上测试了coinbase API v2,并且能够运行所有这些代码 喜欢
$client = Client::create($configuration);
$auth = $client->getCurrentAuthorization();
$user = $client->getCurrentUser();
但是当我试图运行时
$address = $client->getAccountAddress($account,$accountId);
它抛出以下错误,我在这里截图了.. GuzzleHttp -exception error
最后这是我正在使用的示例代码。
require_once'coinbase/vendor/autoload.php';
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
use Coinbase\Wallet\Coinbase;
use Coinbase\Wallet\Resource\Account;
use Coinbase\Wallet\Enum\Param;
use Coinbase\Wallet\Exception;
use \GuzzleHttp\Exception\ClientException;
$apiKey ="xxxxxxx";
$apiSecret ="xxxxxxxxxxxxxxxxxx";
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$auth = $client->getCurrentAuthorization();
$user = $client->getCurrentUser();
$user = $client->getUser("xxxxxxxxx");
$user = $client->decodeLastResponse();
$accounts = $client->getAccounts(['name'=>'BTC Wallet']);
$accounts = $client->decodeLastResponse();
echo"USERS<br>";
var_dump($user);
echo"ACCOUNTS<br>";
var_dump($accounts);
$account = new Account([
'name' => 'SoddisFare'
]);
$address = new Address([
'name' => 'New Address19'
]);
$addresses = $client->getAccountAddresses($account);
//$account =$client->decodeLastResponse();
//$account =$client->decodeLastResponse();
echo "ACCOUNT ADDRESS<br>";
$address = $client->getAccountAddress($account,"xxxxxxxx");
var_dump($account);
我认为问题实际上是传递给$client->getAccountAddress($account,"xxxxxxxx");
的参数,但我做的与文档说的完全一样。
请真的需要帮助...
感谢