PHP code example of cx / cobo_custody_temp0

1. Go to this page and download the library: Download cx/cobo_custody_temp0 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cx / cobo_custody_temp0 example snippets



Cobo\Custody\Config;
use Cobo\Custody\LocalSigner;
use Cobo\Custody\Client;
$key = LocalSigner::generateKeyPair();
echo "apiSecret:", $key['apiSecret'],"\n";
echo "apiKey:", $key['apiKey'];


Cobo\Custody\Config;
use Cobo\Custody\LocalSigner;
use Cobo\Custody\Client;

$client = new Client($signer, Config::SANDBOX, false);

$client->getAccountInfo();

$client->getCoinDetails("ETH");

$client->newDepositAddress("BTC");

$client->batchNewDepositAddress("ETH", 4);

$client->verifyDepositAddress("BTC", "3Qd8ZV4DWxMPK1HfitxccZXV2H8mCST3kM");

$addresses = [
            "0x05325e6f9d1f0437bd78a72c2ae084fbb8c039ee",
            "0xe105a42297428575086387de415900a08765a8af",
            "0x641733cde30e99fe0d6082c2ed96601c37a1718b",
            "0xf3a4a281e92631cb06b53895b6db25c6ffcf7c3d"
        ];

        $client->batchVerifyDepositAddress("ETH", join(",", $addresses));

$client->verifyValidAddress("BTC", "3Qd8ZV4DWxMPK1HfitxccZXV2H8mCST3kM");

$client->getAddressHistoryList("ETH", 0, 5);

$client->checkLoopAddressDetails("ETH", "0x05325e6f9d1f0437bd78a72c2ae084fbb8c039ee");

$client->verifyLoopAddressList("ETH", "0xe7ebdc5bbb6c99cc8f7f2c1c83ff38aa6647f38a,0xe7ebdc5bbb6c99cc8f7f2c1c83ff38aa6647f38a");

$client->getTransactionDetails("20210422193807000343569000002370");

$client->getTransactionsByTxid("0x5d5396c3992ed524bf68a22a7ab6ae503f0349354ad69bc5204d5214085d4e9f");

$client->getTransactionsById(["max_id"]=>"id*********")

$client->getTransactionsByTime();

$client->getPendingTransactions();

$client->getPendingDepositDetails("20200604171238000354106000006405");

$client->getTransactionHistory();

$client->withdraw("TETH",
            "request_id_" . time(),
            "0xb744adc8d75e115eec8e582eb5e8d60eb0972037",
            new BigInteger("1"));

$client->getWithdrawInfo("teth29374893624");

$client->getStakingProductDetails($prooductId);

$client->getStakingProductList(null, "zh");

$client->stake($product_id, new BigInteger("100000"));

$client->unstake($product_id, new BigInteger("100000"));

$client->getStakingData();

$client->getUnstakingData();

$client->getStakingHistory();

php phpunit.phar ClientTest.php