ewertondaniel/bitfinex-php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ewertondaniel/bitfinex-php-sdk

Composer 安装命令:

composer require ewertondaniel/bitfinex-php-sdk

包简介

The Bitfinex PHP SDK is a lightweight PHP library designed to interact with the Bitfinex REST API. This SDK simplifies the integration of Bitfinex cryptocurrency trading functionalities into your PHP applications.

README 文档

README

Packagist Version Packagist License

Installation

Install via Composer:

composer require ewertondaniel/bitfinex-php-sdk

Quick Start

Public example:

use EwertonDaniel\Bitfinex\Facades\Bitfinex;

$status = Bitfinex::public()->platformStatus();
echo $status->content->status; // "operative" or "maintenance"

Authenticated example (Laravel, via config/env):

use EwertonDaniel\Bitfinex\Facades\Bitfinex;

$auth = Bitfinex::authenticated()->generateToken();
$wallets = $auth->wallets()->get();
foreach ($wallets->content['wallets'] as $wallet) {
    // ...
}

More examples in the usage guide.

Overview

The Bitfinex PHP SDK is a lightweight PHP library designed to simplify interaction with the Bitfinex REST API. This SDK allows developers to easily integrate advanced cryptocurrency trading functionalities into PHP applications. Whether building automated trading bots, monitoring market trends, or developing custom trading platforms, this SDK makes the integration with Bitfinex straightforward and efficient.

Features

  • Comprehensive public endpoints: status, tickers (incl. history), trades, book, candles, stats, leaderboards, derivatives status (+history), liquidations, configs, funding stats; calc endpoints: market average price, FX rate.
  • Authenticated endpoints: wallets, orders, positions, funding, account actions, merchants (Bitfinex Pay).
  • Laravel integration (10–12): ServiceProvider, Facade and DI/container.
  • HTTP via Guzzle with builders for headers/query/body.

API Documentation

What is the Bitfinex API?

The Bitfinex API provides access to the full suite of features available on the Bitfinex platform. It allows users to retrieve market data, manage account details, place orders, and more. Designed for speed, the API is optimized to support high-frequency trading and low-latency data streaming, making it an essential tool for advanced trading strategies.

REST vs WebSocket

  • REST: Best for historical data and authenticated operations but subject to rate limits.
  • WebSocket: Ideal for real-time data streaming and high-speed market interactions. WebSocket connections allow for up to 5 authenticated connections per 15 seconds and up to 20 public connections per minute.

For detailed information on endpoints, methods, and usage guidelines, refer to the Bitfinex API Documentation.

Important Guidelines

  • Use numeric error codes to handle exceptions.
  • All timestamps are in UNIX format, expressed in milliseconds.
  • Trading pair symbols use a t prefix (e.g., tBTCUSD for Bitcoin to USD).

Legal Disclaimer

Any use of the Bitfinex API is subject to the API Terms of Service. All API keys and interactions are at your own risk and expense. iFinex Inc. is not responsible for any losses or damages resulting from the use of this SDK or the Bitfinex API.

Available Endpoints (Public)

Market Data

Reference / Meta

Risk / Monitoring

Calculations

Available Endpoints (Authenticated)

  • Wallets — https://docs.bitfinex.com/reference/rest-auth-wallets

    • Wallets (GET)
  • Orders — https://docs.bitfinex.com/reference/rest-auth-retrieve-orders

    • Retrieve Orders / Retrieve Orders by Symbol (POST)
    • Submit Order / Update Order / Cancel Order (POST)
    • Order Multi Op / Cancel Multiple (POST)
    • Orders History (POST)
    • Order Trades / Trades History (POST)
    • Ledgers (POST)
  • Positions — https://docs.bitfinex.com/reference/rest-auth-positions

    • Margin Info / Retrieve Positions (POST)
    • Claim Position / Increase Position / Increase Position Info (POST)
    • Positions History / Snapshot / Audit (POST)
    • Derivative Position Collateral / Collateral Limits (POST)
  • Funding — https://docs.bitfinex.com/reference/rest-auth-funding-offers

    • Active Funding Offers (POST)
    • Submit / Cancel / Cancel All Funding Offers (POST)
    • Funding Close / Auto Renew / Keep (POST)
    • Funding Offers / Loans / Credits / Trades (history) (POST)
    • Funding Info (POST)
  • Account Actions — https://docs.bitfinex.com/reference/rest-auth-info-user

    • User Info / Summary / Login History / Key Permissions (POST)
    • Generate Token / Changelog / Transfer Between Wallets (POST)
    • Deposit Address / Deposit Addresses / Generate Invoice (POST)
    • Withdrawal / Movement Info / Movements (POST)
    • Alert List / Set / Delete (POST)
    • Balance Available for Orders/Offers (POST)
    • User Settings Write / Read / Delete (POST)
  • Merchants (Bitfinex Pay) — https://docs.bitfinex.com/reference/rest-auth-ext-pay-invoice-create

    • Submit Invoice / Submit POS Invoice (POST)
    • Invoice List (+ paginated) (POST)
    • Invoice Count Stats / Earnings Stats (POST)
    • Complete / Expire Invoice (POST)
    • Currency Conversion: List / Add / Remove (POST)
    • Merchant Limit (POST)
    • Merchant Settings: Write / Write Batch / Read / List (POST)
    • Deposits List / Unlinked Deposits List (POST)

Architecture (High‑Level)

  • Transformers (Strategy + Factory):
    • PublicBitfinexResponse delegates mappings to classes in Http/Responses/Public/Transformers via TransformerFactory.
  • Configs (Strategy):
    • The conf endpoint uses ConfigsTransformer with strategies by mode (map/list/info:*).
  • Builders:
    • RequestBuilder offers a fluent API for headers/query/body; for GET methods, body is not sent.
  • Adapters (Template Method):
    • JsonAdapter::transform() is final; UrlAdapter/PathAdapter only define getFilePath().

These patterns keep low coupling, testability, and safe SDK evolution.

Contributing

Contributions are welcome. See the contribution guide for details.

Testing & Tooling

  • Run unit tests (Pest):

    • vendor/bin/pest
    • Public subset: vendor/bin/pest tests/Unit/Public
  • Lint & static analysis:

    • composer lint (Pint + PHPStan)
  • Format:

    • composer format (Pint)

License

This package is licensed under the MIT License.

Author

Ewerton Daniel - contact@ewertondaniel.work

Support

If this project helps you, consider sending some Monero:

89ynYeog7vt6san1FENHDQhn4RnG9sR2f2jj5DSpgY6q18sjQcyRoYYEpFEFQDaJ3ajjRXaMnikm1P2xKPK4jEwsMeK5o6Q

ewertondaniel/bitfinex-php-sdk 适用场景与选型建议

ewertondaniel/bitfinex-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.88k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「exchange」 「laravel-package」 「bitfinex」 「bitfinex-api」 「bitfinex-api-php」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ewertondaniel/bitfinex-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ewertondaniel/bitfinex-php-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 ewertondaniel/bitfinex-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-22