chendujin/bitcoin
Composer 安装命令:
composer require chendujin/bitcoin
包简介
bitcoin is a plugin for a unified Bitcoin digital currency open API interface
README 文档
README
Bitcoin Package for Laravel
Introduction
This is a simple Laravel Service Provider providing for Generic JSON RPC
Installation
To install the PHP client library using Composer:
composer require chendujin/bitcoin
Laravel 5.5+
If you're using Laravel 5.5 or above, the package will automatically register the Bitcoin provider and facade.
Laravel 5.4 and below
Add Chendujin\Bitcoin\BitcoinServiceProvider to the providers array in your config/app.php:
'providers' => [ // Other service providers... Chendujin\Bitcoin\BitcoinServiceProvider::class, ],
If you want to use the facade interface, you can use the facade class when needed:
use Chendujin\Bitcoin\Facade\Bitcoin;
Or add an alias in your config/app.php:
'aliases' => [ ... 'Bitcoin' => Chendujin\Bitcoin\Facade\Bitcoin::class, ],
Configuration
You can use artisan vendor:publish to copy the distribution configuration file to your app's config directory:
php artisan vendor:publish --provider="Chendujin\Bitcoin\BitcoinServiceProvider"
Then update config/bitcoin.php with your credentials. Alternatively, you can update your .env file with the following:
BTC_USER=xyy BTC_SECRET=xyy BTC_HOST=http://localhost BTC_PORT=8332
Usage
To use the Bitcoin Client Library you can use the facade, or request the instance from the service container:
try{ $ret = \Chendujin\Bitcoin\Facade\Bitcoin::getnewaddress('123456'); print_r($ret); }catch (Exception $e){ echo $e->getMessage(); }
Or
$bitcoin = app('Bitcoin'); $result=$bitcoin->getnewaddress('123456');
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-24