zkrat / gateapi-php
欢迎使用 Gate.io API。APIv4 提供了现货、保证金和期货交易操作。存在用于获取实时市场统计信息的公共 API,以及需要认证才能代表用户进行交易的私有 API。
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.17
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ~3.6
This package is auto-updated.
Last update: 2024-09-17 12:36:19 UTC
README
欢迎使用 Gate.io API
APIv4 提供了现货、保证金和期货交易操作。存在用于获取实时市场统计信息的公共 API,以及需要认证才能代表用户进行交易的私有 API。
此 PHP 包由 OpenAPI Generator 项目自动生成
- API 版本:4.26.0
- 包版本:5.26.0
- 构建包:org.openapitools.codegen.languages.PhpClientCodegen。更多信息请访问 https://www.gate.io/page/contacts
版本控制
我们尽力遵循 语义版本控制,同时享受编程语言和库提供的最新功能,从 4.15.2 版本开始,将引入一个主要版本控制差异。
当您升级 SDK 时,如果需要额外的代码重写,例如
- 某些过时的编程语言版本支持被取消
- API 方法签名有破坏性变化。
主版本号将增加,但次版本号和补丁版本号仍然遵循 REST API,而不是重置为 0,这样您就可以识别出有破坏性变化,但仍能了解到变化是从哪个 REST API 版本引入的。
例如,之前的 REST API 和 SDK 版本都是 4.14.0。但如果我们决定在 REST API 4.15.2 升级的同时在 SDK 中引入一些破坏性变化,那么下一个 SDK 发布版本的版本号将是 5.15.2(主版本号增加以表示破坏性变化,但次版本号和补丁版本号与 REST API 相同,而不是将它们重置为 0)
如果主版本号增加,请确保您阅读了 发布 页上的发布说明
要求
PHP 7.1 及以上
安装 & 使用
Composer
要使用 Composer 安装绑定,请将以下内容添加到 composer.json
{ "require": { "gateio/gateapi-php": "@stable" } }
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/GateApi/vendor/autoload.php');
入门
请遵循 安装过程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new GateApi\Api\DeliveryApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $settle = 'usdt'; // string | Settle currency try { $result = $apiInstance->listDeliveryContracts($settle); print_r($result); } catch (GateApi\GateApiException $e) { echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; } catch (Exception $e) { echo 'Exception when calling DeliveryApi->listDeliveryContracts: ', $e->getMessage(), PHP_EOL; } ?>
API 端点文档
所有 URI 都相对于 https://api.gateio.ws/api/v4
模型文档
- AccountBalance
- AutoRepaySetting
- BatchOrder
- CancelOrder
- CancelOrderResult
- Contract
- ContractStat
- CrossMarginAccount
- CrossMarginAccountBook
- CrossMarginBalance
- CrossMarginBorrowable
- CrossMarginCurrency
- CrossMarginLoan
- CrossMarginRepayRequest
- CrossMarginRepayment
- CrossMarginTransferable
- Currency
- CurrencyChain
- CurrencyPair
- DeliveryContract
- DeliverySettlement
- DepositAddress
- FlashSwapCurrency
- FlashSwapOrder
- FlashSwapOrderPreview
- FlashSwapOrderRequest
- FundingAccount
- FundingBookItem
- FundingRateRecord
- FuturesAccount
- FuturesAccountBook
- FuturesAccountHistory
- FuturesCandlestick
- FuturesIndexConstituents
- FuturesInitialOrder
- FuturesLiquidate
- FuturesOrder
- FuturesOrderAmendment
- FuturesOrderBook
- FuturesOrderBookItem
- FuturesPriceTrigger
- FuturesPriceTriggeredOrder
- FuturesTicker
- FuturesTrade
- IndexConstituent
- 保险记录
- 账簿记录
- 清算订单
- 贷款
- 贷款修补
- 贷款记录
- 保证金账户
- 保证金账户账簿
- 保证金账户货币
- 可借保证金
- 保证金货币对
- 可转让保证金
- 多链地址项
- 我的期货交易
- 开放订单
- 期权账户
- 期权账户账簿
- 期权合约
- 期权我的结算
- 期权我的交易
- 期权订单
- 期权持仓
- 期权持仓平仓
- 期权结算
- 期权行情
- 期权标的
- 期权标的行情
- 订单
- 订单簿
- 持仓
- 持仓平仓
- 持仓平仓订单
- 还款请求
- 还款
- 保存地址
- 现货账户
- 现货价格卖出订单
- 现货价格触发
- 现货价格触发订单
- 子账户余额
- 子账户交叉保证金余额
- 子账户期货余额
- 子账户保证金余额
- 子账户转账
- 子交叉保证金账户
- 系统时间
- 行情
- 总余额
- 交易
- 交易费用
- 交易ID
- 转账
- 触发订单响应
- 取款状态
授权文档
API定义的认证方案
apiv4
- 类型:Gate APIv4
https://www.gate.io/docs/apiv4/en/index.html#apiv4-signed-request-requirements