PHP code example of tokenly / xcpd-client

1. Go to this page and download the library: Download tokenly/xcpd-client 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/ */

    

tokenly / xcpd-client example snippets


$xcpd_client = app('Tokenly\CounterpartyClient\CounterpartyClient');
$response_data = $xcpd_client->get_block_info(['block_index' => 312600]);
/*
{
    "messages_hash": "72573bd491fe99a1ec5dfbd6b50d90184c242685bcee840557c5c2dc3f43da5b",
    "difficulty": 18736441558.310238,
    "block_hash": "00000000000000001af96dce9fb5d8e095257955c79d0b41ca64a2d69e664858",
    "previous_block_hash": "000000000000000010498d6e36255306e82ff9d7602bde867cb1226cceffa8aa",
    "txlist_hash": "cd868428581392142fdaef896ece4ea338d4fa286db1b873ea192789ccfb3f91",
    "block_time": 1406404765,
    "ledger_hash": "f0dfb4db2151bc2c427cace36f921dd992d5f640b654acb44709f3d44820c014",
    "block_index": 312600
}
*/