lox / localbtc-php
该包最新版本(v0.1.1)没有可用的许可证信息。
Localbitcoins.com 的 PHP 客户端
v0.1.1
2013-11-02 08:09 UTC
Requires
- php: >=5.3
- guzzle/guzzle: >=v3.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
- seld/jsonlint: 1.1.*
This package is not auto-updated.
Last update: 2024-09-10 00:51:20 UTC
README
这是一个 LocalBitcoins.com API 的(工作进度)客户端
https://localbitcoins.com/api-docs/
待办事项
API 方法
- 认证
- AccountInfo
- 我自己
- Escrows
- EscrowRelease
- 广告
- AdUpdate
其他功能
- 自定义错误
- AccountInfo
安装
使用 composer 安装
git clone https://github.com/lox/localbtc-php.git composer install
认证
API 使用 OAuth2,对于控制台应用程序来说,认证有些麻烦。首先,您需要在 API 控制台中注册一个应用程序,并生成一个客户端 ID 和客户端密钥
https://localbitcoins.com/accounts/api/
然后使用以下命令生成 access_token
export LOCALBITCOINS_CLIENT_ID=1234567
export LOCALBITCOINS_CLIENT_SECRET=123456
php oauth.php --authorize
点击生成的链接,在您的 localbitcoins.com 账户中授权该应用程序。
复制 access_token 以用于以下示例。
使用方法
<?php $client = \LocalBtc\Client::factory(array( 'client_identifier' => '1234567', 'access_token' => 'generated access token goes here', )); // get data about yourself $myself = $client->myself()->get('data'); // get data about someone $someone = $client->accountInfo(array('username'=>'someone'))->get('data'); // get your escrows $escrows = $client->escrows()->get('data'); // release an escrow $client->releaseEscrow(array('escrow_id'=>123456));