zkrat / gateapi-php
Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.
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-12-17 13:09:59 UTC
README
Welcome to Gate.io API
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 4.26.0
- Package version: 5.26.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit https://www.gate.io/page/contacts
Versioning
Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:
If extra code rewrite is required when you upgrade the SDK, such as:
- some outdated programming language version support is dropped
- API method signature has breaking changes.
the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.
For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)
If MAJOR version is incremented, make sure you read the release note on Releases page
Requirements
PHP 7.1 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{ "require": { "gateio/gateapi-php": "@stable" } }
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/GateApi/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?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; } ?>
Documentation for API Endpoints
All URIs are relative to https://api.gateio.ws/api/v4
Documentation For Models
- 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
- InsuranceRecord
- LedgerRecord
- LiquidateOrder
- Loan
- LoanPatch
- LoanRecord
- MarginAccount
- MarginAccountBook
- MarginAccountCurrency
- MarginBorrowable
- MarginCurrencyPair
- MarginTransferable
- MultiChainAddressItem
- MyFuturesTrade
- OpenOrders
- OptionsAccount
- OptionsAccountBook
- OptionsContract
- OptionsMySettlements
- OptionsMyTrade
- OptionsOrder
- OptionsPosition
- OptionsPositionClose
- OptionsSettlement
- OptionsTicker
- OptionsUnderlying
- OptionsUnderlyingTicker
- Order
- OrderBook
- Position
- PositionClose
- PositionCloseOrder
- RepayRequest
- Repayment
- SavedAddress
- SpotAccount
- SpotPricePutOrder
- SpotPriceTrigger
- SpotPriceTriggeredOrder
- SubAccountBalance
- SubAccountCrossMarginBalance
- SubAccountFuturesBalance
- SubAccountMarginBalance
- SubAccountTransfer
- SubCrossMarginAccount
- SystemTime
- Ticker
- TotalBalance
- Trade
- TradeFee
- TransactionID
- Transfer
- TriggerOrderResponse
- WithdrawStatus
Documentation For Authorization
Authentication schemes defined for the API:
apiv4
- Type: Gate APIv4
https://www.gate.io/docs/apiv4/en/index.html#apiv4-signed-request-requirements