bobel/payeer-client
Composer 安装命令:
composer require bobel/payeer-client
包简介
Payeer Trade API Client.
README 文档
README
Installation
composer require bobel\payeer-client
Testing
composer init-pest
composer test
Init the client
$api = new PayeerClient( id: 'bd443f00-092c-4436-92a4-a704ef679e24', key: 'your_key');
Check connection
$result = $api->isOk();
Returns IsOkResponse object.
Throws IsOkException.
Run WebSocket Server
$webSocket = new WebSocketServer( id: 'bd443f00-092c-4436-92a4-a704ef679e24', key: 'your_key'); $webSocket->run();
WebSocket request/response format
Request
{
"method": "rates",
"params": {
"currencyPairs": [
["BTC", "USD"],
["BTC", "RUB"]
],
"action": "Action::Buy",
"dateFrom": 1630443600,
"dateTo": 1633035599,
"pageSize": 3
}
}
Response
{
"success": true,
"limits": {
"interval": "min",
"intervalNumber": 1,
"limit": 600
},
"data": [
{
"currencyPair": ["BTC", "USD"],
"pricePrecision": 2,
"minPrice": "4375.74",
"maxPrice": "83139.00",
"minAmount": 0.0001,
"minValue": 0.5,
"feeMakerPercent": 0.01,
"feeTakerPercent": 0.095
},
{
"currencyPair": ["BTC", "RUB"],
"pricePrecision": 2,
"minPrice": "326269.32",
"maxPrice": "6199117.08",
"minAmount": 0.0001,
"minValue": 20,
"feeMakerPercent": 0.01,
"feeTakerPercent": 0.095
}
]
}
Get rates
Get rates by criteria
// Get all rates $result = $api->rates(); // Get rates by criteria $result = $api->rates([ ["BTC", "USD"], ["BTC", "RUB"] ]);
Returns RatesResponse.
Throws ClientException.
Get stats
$result = $api->stats([ ["BTC", "USD"] ]);
Returns StatsResponse.
Get orders
$result = $api->orders([ ["BTC", "USD"], ["BTC", "RUB"] ]);
Returns OrdersResponse.
Get trades
$result = $api->trades([ ["BTC", "USD"], ["BTC", "RUB"] ]);
Returns TradesResponse.
Get my trades
// Get all trades $result = $api->myTrades(); // Get specific trades by criteria $result = $api->myTrades( currencyPairs: [ ["BTC", "USD"], ["BTC", "RUB"] ], action: Action::Buy, dateFrom: 1630443600, dateTo: 1633035599, pageSize: 3);
Returns MyTradesResponse.
Get balance
$result = $api->balance();
Returns BalanceResponse.
Order related operations
List orders
// Get all my orders $result = $api->order->list(status: Status::Opened); // Get my orders by criteria $result = $api->order->list( status: Status::Opened, currencyPairs: [ ["BTC", "USD"], ["BTC", "RUB"] ], action: Action::Buy); // Get all orders $result = $api->order->list(pageSize: 3); // Get all orders by criteria $result = $api->order->list( status: Status::Canceled, currencyPairs: [ ["BTC", "USD"], ["BTC", "RUB"] ], action: Action::Buy, dateFrom: 1630443600, dateTo: 1633035599, pageSize: 3);
Returns ListResponse.
Cancel orders
// Cancel all orders $result = $api->order->cancel(); // Cancel orders by criteria $result = $api->order->cancel( currencyPairs: [ ["TRX", "RUB"], ["DOGE", "RUB"] ], action: Action::Buy); // Cancel exact order by ID $result = $api->order->cancel(37054293);
Returns CancelResponse.
Get order status
$result = $api->order->status(37054293);
Returns StatusResponse.
Create an order
$result = $api->order->create( currencyPairs: [ ["TRX", "USD"] ], type: Type::Limit, action: Action::Buy, amount: 10, price: 0.08);
Returns CreateResponseResponse.
bobel/payeer-client 适用场景与选型建议
bobel/payeer-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 06 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「client」 「payeer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bobel/payeer-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bobel/payeer-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bobel/payeer-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 Payeer Component
Mock PSR-18 HTTP client
Asynchronous MQTT client built on React
Yii2 Payeer Component
Client for Google Directions API to add interpolated points to a route consisting of given coordinates.
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-15