我正在尝试使用 Coinbase 钱包 PHP 库(来自这里:https ://github.com/coinbase/coinbase-php )。
$client->createAccountAddress($account, $address);
- 当我使用它时 - 创建新地址。但我想打印给客户。
$address = $client->getAccountAddress($account, $addressId);
- 我尝试使用它,但我不知道在 $addressId 变量中放入什么。请你帮助我好吗。
我正在使用的代码示例:
<?php
require_once('vendor/autoload.php');
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
use Coinbase\Wallet\Resource\Address;
parse_str($_SERVER["QUERY_STRING"]);
$apiKey = 'myApi';
$apiSecret = 'apiSecret';
$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); //i don't know what to put in second variable
echo "network: ".json_encode($addresses->getAddress)."<br>";
?>