tokenly / xcpd-client
Counterparty API的客户端库
v1.0.0
2018-03-14 17:02 UTC
Requires
- php: >=5.4.0
- rmccue/requests: ^1.7|dev-master
Requires (Dev)
- phpunit/phpunit: ~5
This package is not auto-updated.
Last update: 2024-09-14 15:37:30 UTC
README
Tokenly的Counterparty客户端组件。
Counterparty API的简单PHP客户端。
通过composer添加Laravel包
composer require tokenly/xcpd-client
在Laravel中使用
服务提供者将自动在Laravel 5.5+应用程序中注册。
设置环境变量
XCPD_CONNECTION_STRING="http://127.0.0.1:4000"
XCPD_RPC_USER="rpcusername"
XCPD_RPC_PASSWORD="rpcpassword"
Laravel中的使用示例
$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 } */