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 API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 4.60.1
- Package version: 6.60.1
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.gate.io/page/contacts
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
go get github.com/gateio/gateapi-go/v6
Please follow the installation instruction and execute the following Go code:
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v6"
)
func main() {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
// uncomment the next line if your are testing against testnet
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
}
)
result, _, err := client.AccountApi.GetAccountDetail(ctx)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
fmt.Printf("gate api error: %s\n", e.Error())
} else {
fmt.Printf("generic error: %s\n", err.Error())
}
} else {
fmt.Println(result)
}
}
For a more complete API usage example, refer to the demo application in example directory
All URIs are relative to https://api.gateio.ws/api/v4
Class | Method | HTTP request | Description |
---|---|---|---|
AccountApi | GetAccountDetail | Get /account/detail | Get account detail |
AccountApi | ListSTPGroups | Get /account/stp_groups | List STP Groups |
AccountApi | CreateSTPGroup | Post /account/stp_groups | Create STP Group |
AccountApi | ListSTPGroupsUsers | Get /account/stp_groups/{stp_id}/users | List users of the STP group |
AccountApi | AddSTPGroupUsers | Post /account/stp_groups/{stp_id}/users | Add users to the STP group |
AccountApi | DeleteSTPGroupUsers | Delete /account/stp_groups/{stp_id}/users | Delete the user in the STP group |
CollateralLoanApi | ListCollateralLoanOrders | Get /loan/collateral/orders | List Orders |
CollateralLoanApi | CreateCollateralLoan | Post /loan/collateral/orders | Place order |
CollateralLoanApi | GetCollateralLoanOrderDetail | Get /loan/collateral/orders/{order_id} | Get a single order |
CollateralLoanApi | RepayCollateralLoan | Post /loan/collateral/repay | Repayment |
CollateralLoanApi | ListRepayRecords | Get /loan/collateral/repay_records | Repayment history |
CollateralLoanApi | ListCollateralRecords | Get /loan/collateral/collaterals | Query collateral adjustment records |
CollateralLoanApi | OperateCollateral | Post /loan/collateral/collaterals | Increase or redeem collateral |
CollateralLoanApi | GetUserTotalAmount | Get /loan/collateral/total_amount | Query the total borrowing and collateral amount for the user |
CollateralLoanApi | GetUserLtvInfo | Get /loan/collateral/ltv | Query user's collateralization ratio |
CollateralLoanApi | ListCollateralCurrencies | Get /loan/collateral/currencies | Query supported borrowing and collateral currencies |
DeliveryApi | ListDeliveryContracts | Get /delivery/{settle}/contracts | List all futures contracts |
DeliveryApi | GetDeliveryContract | Get /delivery/{settle}/contracts/{contract} | Get a single contract |
DeliveryApi | ListDeliveryOrderBook | Get /delivery/{settle}/order_book | Futures order book |
DeliveryApi | ListDeliveryTrades | Get /delivery/{settle}/trades | Futures trading history |
DeliveryApi | ListDeliveryCandlesticks | Get /delivery/{settle}/candlesticks | Get futures candlesticks |
DeliveryApi | ListDeliveryTickers | Get /delivery/{settle}/tickers | List futures tickers |
DeliveryApi | ListDeliveryInsuranceLedger | Get /delivery/{settle}/insurance | Futures insurance balance history |
DeliveryApi | ListDeliveryAccounts | Get /delivery/{settle}/accounts | Query futures account |
DeliveryApi | ListDeliveryAccountBook | Get /delivery/{settle}/account_book | Query account book |
DeliveryApi | ListDeliveryPositions | Get /delivery/{settle}/positions | List all positions of a user |
DeliveryApi | GetDeliveryPosition | Get /delivery/{settle}/positions/{contract} | Get single position |
DeliveryApi | UpdateDeliveryPositionMargin | Post /delivery/{settle}/positions/{contract}/margin | Update position margin |
DeliveryApi | UpdateDeliveryPositionLeverage | Post /delivery/{settle}/positions/{contract}/leverage | Update position leverage |
DeliveryApi | UpdateDeliveryPositionRiskLimit | Post /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit |
DeliveryApi | ListDeliveryOrders | Get /delivery/{settle}/orders | List futures orders |
DeliveryApi | CreateDeliveryOrder | Post /delivery/{settle}/orders | Create a futures order |
DeliveryApi | CancelDeliveryOrders | Delete /delivery/{settle}/orders | Cancel all `open` orders matched |
DeliveryApi | GetDeliveryOrder | Get /delivery/{settle}/orders/{order_id} | Get a single order |
DeliveryApi | CancelDeliveryOrder | Delete /delivery/{settle}/orders/{order_id} | Cancel a single order |
DeliveryApi | GetMyDeliveryTrades | Get /delivery/{settle}/my_trades | List personal trading history |
DeliveryApi | ListDeliveryPositionClose | Get /delivery/{settle}/position_close | List position close history |
DeliveryApi | ListDeliveryLiquidates | Get /delivery/{settle}/liquidates | List liquidation history |
DeliveryApi | ListDeliverySettlements | Get /delivery/{settle}/settlements | List settlement history |
DeliveryApi | ListPriceTriggeredDeliveryOrders | Get /delivery/{settle}/price_orders | List all auto orders |
DeliveryApi | CreatePriceTriggeredDeliveryOrder | Post /delivery/{settle}/price_orders | Create a price-triggered order |
DeliveryApi | CancelPriceTriggeredDeliveryOrderList | Delete /delivery/{settle}/price_orders | Cancel all open orders |
DeliveryApi | GetPriceTriggeredDeliveryOrder | Get /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order |
DeliveryApi | CancelPriceTriggeredDeliveryOrder | Delete /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order |
EarnApi | SwapETH2 | Post /earn/staking/eth2/swap | ETH2 swap |
EarnApi | ListDualInvestmentPlans | Get /earn/dual/investment_plan | Dual Investment product list |
EarnApi | ListDualOrders | Get /earn/dual/orders | Dual Investment order list |
EarnApi | PlaceDualOrder | Post /earn/dual/orders | Place Dual Investment order |
EarnApi | CancelDualOrder | Delete /earn/dual/orders/{order_id} | Cancel Dual Investment order |
EarnApi | ListStructuredProducts | Get /earn/structured/products | Structured Product List |
EarnApi | ListStructuredOrders | Get /earn/structured/orders | Structured Product Order List |
EarnApi | PlaceStructuredOrder | Post /earn/structured/orders | Place Structured Product Order |
EarnUniApi | ListUniCurrencies | Get /earn/uni/currencies | List currencies for lending |
EarnUniApi | GetUniCurrency | Get /earn/uni/currencies/{currency} | Get currency detail for lending |
EarnUniApi | ListUserUniLends | Get /earn/uni/lends | List user's lending orders |
EarnUniApi | CreateUniLend | Post /earn/uni/lends | Lend or redeem |
EarnUniApi | ChangeUniLend | Patch /earn/uni/lends | Amend lending order |
EarnUniApi | ListUniLendRecords | Get /earn/uni/lend_records | List records of lending |
EarnUniApi | GetUniInterest | Get /earn/uni/interests/{currency} | Get the user's total interest income of specified currency |
EarnUniApi | ListUniInterestRecords | Get /earn/uni/interest_records | List interest records |
EarnUniApi | SwitchInterestReinvest | Put /earn/uni/interest_reinvest | Set interest reinvestment toggle |
EarnUniApi | GetUniInterestStatus | Get /earn/uni/interest_status/{currency} | query currency interest compounding status |
FlashSwapApi | ListFlashSwapCurrencies | Get /flash_swap/currencies | List All Supported Currencies In Flash Swap (deprecated) |
FlashSwapApi | ListFlashSwapCurrencyPair | Get /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap |
FlashSwapApi | ListFlashSwapOrders | Get /flash_swap/orders | List all flash swap orders |
FlashSwapApi | CreateFlashSwapOrder | Post /flash_swap/orders | Create a flash swap order |
FlashSwapApi | GetFlashSwapOrder | Get /flash_swap/orders/{order_id} | Get a single flash swap order's detail |
FlashSwapApi | PreviewFlashSwapOrder | Post /flash_swap/orders/preview | Initiate a flash swap order preview |
FuturesApi | ListFuturesContracts | Get /futures/{settle}/contracts | List all futures contracts |
FuturesApi | GetFuturesContract | Get /futures/{settle}/contracts/{contract} | Get a single contract |
FuturesApi | ListFuturesOrderBook | Get /futures/{settle}/order_book | Futures order book |
FuturesApi | ListFuturesTrades | Get /futures/{settle}/trades | Futures trading history |
FuturesApi | ListFuturesCandlesticks | Get /futures/{settle}/candlesticks | Get futures candlesticks |
FuturesApi | ListFuturesPremiumIndex | Get /futures/{settle}/premium_index | Premium Index K-Line |
FuturesApi | ListFuturesTickers | Get /futures/{settle}/tickers | List futures tickers |
FuturesApi | ListFuturesFundingRateHistory | Get /futures/{settle}/funding_rate | Funding rate history |
FuturesApi | ListFuturesInsuranceLedger | Get /futures/{settle}/insurance | Futures insurance balance history |
FuturesApi | ListContractStats | Get /futures/{settle}/contract_stats | Futures stats |
FuturesApi | GetIndexConstituents | Get /futures/{settle}/index_constituents/{index} | Get index constituents |
FuturesApi | ListLiquidatedOrders | Get /futures/{settle}/liq_orders | Retrieve liquidation history |
FuturesApi | ListFuturesAccounts | Get /futures/{settle}/accounts | Query futures account |
FuturesApi | ListFuturesAccountBook | Get /futures/{settle}/account_book | Query account book |
FuturesApi | ListPositions | Get /futures/{settle}/positions | List all positions of a user |
FuturesApi | GetPosition | Get /futures/{settle}/positions/{contract} | Get single position |
FuturesApi | UpdatePositionMargin | Post /futures/{settle}/positions/{contract}/margin | Update position margin |
FuturesApi | UpdatePositionLeverage | Post /futures/{settle}/positions/{contract}/leverage | Update position leverage |
FuturesApi | UpdatePositionRiskLimit | Post /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit |
FuturesApi | SetDualMode | Post /futures/{settle}/dual_mode | Enable or disable dual mode |
FuturesApi | GetDualModePosition | Get /futures/{settle}/dual_comp/positions/{contract} | Retrieve position detail in dual mode |
FuturesApi | UpdateDualModePositionMargin | Post /futures/{settle}/dual_comp/positions/{contract}/margin | Update position margin in dual mode |
FuturesApi | UpdateDualModePositionLeverage | Post /futures/{settle}/dual_comp/positions/{contract}/leverage | Update position leverage in dual mode |
FuturesApi | UpdateDualModePositionRiskLimit | Post /futures/{settle}/dual_comp/positions/{contract}/risk_limit | Update position risk limit in dual mode |
FuturesApi | ListFuturesOrders | Get /futures/{settle}/orders | List futures orders |
FuturesApi | CreateFuturesOrder | Post /futures/{settle}/orders | Create a futures order |
FuturesApi | CancelFuturesOrders | Delete /futures/{settle}/orders | Cancel all `open` orders matched |
FuturesApi | GetOrdersWithTimeRange | Get /futures/{settle}/orders_timerange | List Futures Orders By Time Range |
FuturesApi | CreateBatchFuturesOrder | Post /futures/{settle}/batch_orders | Create a batch of futures orders |
FuturesApi | GetFuturesOrder | Get /futures/{settle}/orders/{order_id} | Get a single order |
FuturesApi | AmendFuturesOrder | Put /futures/{settle}/orders/{order_id} | Amend an order |
FuturesApi | CancelFuturesOrder | Delete /futures/{settle}/orders/{order_id} | Cancel a single order |
FuturesApi | GetMyTrades | Get /futures/{settle}/my_trades | List personal trading history |
FuturesApi | GetMyTradesWithTimeRange | Get /futures/{settle}/my_trades_timerange | List personal trading history by time range |
FuturesApi | ListPositionClose | Get /futures/{settle}/position_close | List position close history |
FuturesApi | ListLiquidates | Get /futures/{settle}/liquidates | List liquidation history |
FuturesApi | ListAutoDeleverages | Get /futures/{settle}/auto_deleverages | List Auto-Deleveraging History |
FuturesApi | CountdownCancelAllFutures | Post /futures/{settle}/countdown_cancel_all | Countdown cancel orders |
FuturesApi | GetFuturesFee | Get /futures/{settle}/fee | Query user trading fee rates |
FuturesApi | ListPriceTriggeredOrders | Get /futures/{settle}/price_orders | List all auto orders |
FuturesApi | CreatePriceTriggeredOrder | Post /futures/{settle}/price_orders | Create a price-triggered order |
FuturesApi | CancelPriceTriggeredOrderList | Delete /futures/{settle}/price_orders | Cancel all open orders |
FuturesApi | GetPriceTriggeredOrder | Get /futures/{settle}/price_orders/{order_id} | Get a price-triggered order |
FuturesApi | CancelPriceTriggeredOrder | Delete /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order |
MarginApi | ListMarginAccounts | Get /margin/accounts | Margin account list |
MarginApi | ListMarginAccountBook | Get /margin/account_book | List margin account balance change history |
MarginApi | ListFundingAccounts | Get /margin/funding_accounts | Funding account list |
MarginApi | GetAutoRepayStatus | Get /margin/auto_repay | Retrieve user auto repayment setting |
MarginApi | SetAutoRepay | Post /margin/auto_repay | Update user's auto repayment setting |
MarginApi | GetMarginTransferable | Get /margin/transferable | Get the max transferable amount for a specific margin currency |
MarginApi | ListMarginCurrencyPairs | Get /margin/currency_pairs | List all supported currency pairs supported in margin trading(Deprecated) |
MarginApi | GetMarginCurrencyPair | Get /margin/currency_pairs/{currency_pair} | Query one single margin currency pair(Deprecated) |
MarginApi | ListFundingBook | Get /margin/funding_book | Order book of lending loans(Deprecated) |
MarginApi | ListLoans | Get /margin/loans | List all loans(Deprecated) |
MarginApi | CreateLoan | Post /margin/loans | Lend or borrow(Deprecated) |
MarginApi | MergeLoans | Post /margin/merged_loans | Merge multiple lending loans(Deprecated) |
MarginApi | GetLoan | Get /margin/loans/{loan_id} | Retrieve one single loan detail(Deprecated) |
MarginApi | CancelLoan | Delete /margin/loans/{loan_id} | Cancel lending loan(Deprecated) |
MarginApi | UpdateLoan | Patch /margin/loans/{loan_id} | Modify a loan(Deprecated) |
MarginApi | ListLoanRepayments | Get /margin/loans/{loan_id}/repayment | List loan repayment records(Deprecated) |
MarginApi | RepayLoan | Post /margin/loans/{loan_id}/repayment | Repay a loan(Deprecated) |
MarginApi | ListLoanRecords | Get /margin/loan_records | List repayment records of a specific loan(Deprecated) |
MarginApi | GetLoanRecord | Get /margin/loan_records/{loan_record_id} | Get one single loan record(Deprecated) |
MarginApi | UpdateLoanRecord | Patch /margin/loan_records/{loan_record_id} | Modify a loan record(Deprecated) |
MarginApi | GetMarginBorrowable | Get /margin/borrowable | Get the max borrowable amount for a specific margin currency(Deprecated) |
MarginApi | ListCrossMarginCurrencies | Get /margin/cross/currencies | Currencies supported by cross margin. |
MarginApi | GetCrossMarginCurrency | Get /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin |
MarginApi | GetCrossMarginAccount | Get /margin/cross/accounts | Retrieve cross margin account |
MarginApi | ListCrossMarginAccountBook | Get /margin/cross/account_book | Retrieve cross margin account change history |
MarginApi | ListCrossMarginLoans | Get /margin/cross/loans | List cross margin borrow history |
MarginApi | CreateCrossMarginLoan | Post /margin/cross/loans | Create a cross margin borrow loan |
MarginApi | GetCrossMarginLoan | Get /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail |
MarginApi | ListCrossMarginRepayments | Get /margin/cross/repayments | Retrieve cross margin repayments |
MarginApi | RepayCrossMarginLoan | Post /margin/cross/repayments | Cross margin repayments |
MarginApi | GetCrossMarginInterestRecords | Get /margin/cross/interest_records | Interest records for the cross margin account |
MarginApi | GetCrossMarginTransferable | Get /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency |
MarginApi | GetCrossMarginEstimateRate | Get /margin/cross/estimate_rate | Estimated interest rates |
MarginApi | GetCrossMarginBorrowable | Get /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency |
MarginUniApi | ListUniCurrencyPairs | Get /margin/uni/currency_pairs | List lending markets |
MarginUniApi | GetUniCurrencyPair | Get /margin/uni/currency_pairs/{currency_pair} | Get detail of lending market |
MarginUniApi | GetMarginUniEstimateRate | Get /margin/uni/estimate_rate | Estimate interest Rate |
MarginUniApi | ListUniLoans | Get /margin/uni/loans | List loans |
MarginUniApi | CreateUniLoan | Post /margin/uni/loans | Borrow or repay |
MarginUniApi | ListUniLoanRecords | Get /margin/uni/loan_records | Get load records |
MarginUniApi | ListUniLoanInterestRecords | Get /margin/uni/interest_records | List interest records |
MarginUniApi | GetUniBorrowable | Get /margin/uni/borrowable | Get maximum borrowable |
OptionsApi | ListOptionsUnderlyings | Get /options/underlyings | List all underlyings |
OptionsApi | ListOptionsExpirations | Get /options/expirations | List all expiration times |
OptionsApi | ListOptionsContracts | Get /options/contracts | List all the contracts with specified underlying and expiration time |
OptionsApi | GetOptionsContract | Get /options/contracts/{contract} | Query specified contract detail |
OptionsApi | ListOptionsSettlements | Get /options/settlements | List settlement history |
OptionsApi | GetOptionsSettlement | Get /options/settlements/{contract} | Get specified contract's settlement |
OptionsApi | ListMyOptionsSettlements | Get /options/my_settlements | List my options settlements |
OptionsApi | ListOptionsOrderBook | Get /options/order_book | Options order book |
OptionsApi | ListOptionsTickers | Get /options/tickers | List tickers of options contracts |
OptionsApi | ListOptionsUnderlyingTickers | Get /options/underlying/tickers/{underlying} | Get underlying ticker |
OptionsApi | ListOptionsCandlesticks | Get /options/candlesticks | Get options candlesticks |
OptionsApi | ListOptionsUnderlyingCandlesticks | Get /options/underlying/candlesticks | Mark price candlesticks of an underlying |
OptionsApi | ListOptionsTrades | Get /options/trades | Options trade history |
OptionsApi | ListOptionsAccount | Get /options/accounts | List options account |
OptionsApi | ListOptionsAccountBook | Get /options/account_book | List account changing history |
OptionsApi | ListOptionsPositions | Get /options/positions | List user's positions of specified underlying |
OptionsApi | GetOptionsPosition | Get /options/positions/{contract} | Get specified contract position |
OptionsApi | ListOptionsPositionClose | Get /options/position_close | List user's liquidation history of specified underlying |
OptionsApi | ListOptionsOrders | Get /options/orders | List options orders |
OptionsApi | CreateOptionsOrder | Post /options/orders | Create an options order |
OptionsApi | CancelOptionsOrders | Delete /options/orders | Cancel all `open` orders matched |
OptionsApi | GetOptionsOrder | Get /options/orders/{order_id} | Get a single order |
OptionsApi | CancelOptionsOrder | Delete /options/orders/{order_id} | Cancel a single order |
OptionsApi | ListMyOptionsTrades | Get /options/my_trades | List personal trading history |
RebateApi | AgencyTransactionHistory | Get /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user |
RebateApi | AgencyCommissionsHistory | Get /rebate/agency/commission_history | The broker obtains the commission history of the recommended user |
SpotApi | ListCurrencies | Get /spot/currencies | List all currencies' details |
SpotApi | GetCurrency | Get /spot/currencies/{currency} | Get details of a specific currency |
SpotApi | ListCurrencyPairs | Get /spot/currency_pairs | List all currency pairs supported |
SpotApi | GetCurrencyPair | Get /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair |
SpotApi | ListTickers | Get /spot/tickers | Retrieve ticker information |
SpotApi | ListOrderBook | Get /spot/order_book | Retrieve order book |
SpotApi | ListTrades | Get /spot/trades | Retrieve market trades |
SpotApi | ListCandlesticks | Get /spot/candlesticks | Market candlesticks |
SpotApi | GetFee | Get /spot/fee | Query user trading fee rates |
SpotApi | GetBatchSpotFee | Get /spot/batch_fee | Query a batch of user trading fee rates |
SpotApi | ListSpotAccounts | Get /spot/accounts | List spot accounts |
SpotApi | ListSpotAccountBook | Get /spot/account_book | Query account book |
SpotApi | CreateBatchOrders | Post /spot/batch_orders | Create a batch of orders |
SpotApi | ListAllOpenOrders | Get /spot/open_orders | List all open orders |
SpotApi | CreateCrossLiquidateOrder | Post /spot/cross_liquidate_orders | close position when cross-currency is disabled |
SpotApi | ListOrders | Get /spot/orders | List orders |
SpotApi | CreateOrder | Post /spot/orders | Create an order |
SpotApi | CancelOrders | Delete /spot/orders | Cancel all `open` orders in specified currency pair |
SpotApi | CancelBatchOrders | Post /spot/cancel_batch_orders | Cancel a batch of orders with an ID list |
SpotApi | GetOrder | Get /spot/orders/{order_id} | Get a single order |
SpotApi | CancelOrder | Delete /spot/orders/{order_id} | Cancel a single order |
SpotApi | AmendOrder | Patch /spot/orders/{order_id} | Amend an order |
SpotApi | ListMyTrades | Get /spot/my_trades | List personal trading history |
SpotApi | GetSystemTime | Get /spot/time | Get server current time |
SpotApi | CountdownCancelAllSpot | Post /spot/countdown_cancel_all | Countdown cancel orders |
SpotApi | AmendBatchOrders | Post /spot/amend_batch_orders | Batch modification of orders |
SpotApi | ListSpotPriceTriggeredOrders | Get /spot/price_orders | Retrieve running auto order list |
SpotApi | CreateSpotPriceTriggeredOrder | Post /spot/price_orders | Create a price-triggered order |
SpotApi | CancelSpotPriceTriggeredOrderList | Delete /spot/price_orders | Cancel all open orders |
SpotApi | GetSpotPriceTriggeredOrder | Get /spot/price_orders/{order_id} | Get a price-triggered order |
SpotApi | CancelSpotPriceTriggeredOrder | Delete /spot/price_orders/{order_id} | cancel a price-triggered order |
SubAccountApi | ListSubAccounts | Get /sub_accounts | List sub-accounts |
SubAccountApi | CreateSubAccounts | Post /sub_accounts | Create a new sub-account |
SubAccountApi | GetSubAccount | Get /sub_accounts/{user_id} | Get the sub-account |
SubAccountApi | ListSubAccountKeys | Get /sub_accounts/{user_id}/keys | List all API Key of the sub-account |
SubAccountApi | CreateSubAccountKeys | Post /sub_accounts/{user_id}/keys | Create API Key of the sub-account |
SubAccountApi | GetSubAccountKey | Get /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account |
SubAccountApi | UpdateSubAccountKeys | Put /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account |
SubAccountApi | DeleteSubAccountKeys | Delete /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account |
SubAccountApi | LockSubAccount | Post /sub_accounts/{user_id}/lock | Lock the sub-account |
SubAccountApi | UnlockSubAccount | Post /sub_accounts/{user_id}/unlock | Unlock the sub-account |
UnifiedApi | ListUnifiedAccounts | Get /unified/accounts | Get unified account information |
UnifiedApi | ListUnifiedAccountMode | Get /unified/account_mode | Query mode of the unified account |
UnifiedApi | SetUnifiedAccountMode | Post /unified/account_mode | Set mode of the unified account |
UnifiedApi | GetUnifiedBorrowable | Get /unified/borrowable | Query about the maximum borrowing for the unified account |
UnifiedApi | GetUnifiedTransferable | Get /unified/transferable | Query about the maximum transferable for the unified account |
UnifiedApi | ListUnifiedLoans | Get /unified/loans | List loans |
UnifiedApi | CreateUnifiedLoan | Post /unified/loans | Borrow or repay |
UnifiedApi | ListUnifiedLoanRecords | Get /unified/loan_records | Get load records |
UnifiedApi | ListUnifiedLoanInterestRecords | Get /unified/interest_records | List interest records |
WalletApi | ListCurrencyChains | Get /wallet/currency_chains | List chains supported for specified currency |
WalletApi | GetDepositAddress | Get /wallet/deposit_address | Generate currency deposit address |
WalletApi | ListWithdrawals | Get /wallet/withdrawals | Retrieve withdrawal records |
WalletApi | ListDeposits | Get /wallet/deposits | Retrieve deposit records |
WalletApi | Transfer | Post /wallet/transfers | Transfer between trading accounts |
WalletApi | ListSubAccountTransfers | Get /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts |
WalletApi | TransferWithSubAccount | Post /wallet/sub_account_transfers | Transfer between main and sub accounts |
WalletApi | SubAccountToSubAccount | Post /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account |
WalletApi | ListWithdrawStatus | Get /wallet/withdraw_status | Retrieve withdrawal status |
WalletApi | ListSubAccountBalances | Get /wallet/sub_account_balances | Retrieve sub account balances |
WalletApi | ListSubAccountMarginBalances | Get /wallet/sub_account_margin_balances | Query sub accounts' margin balances |
WalletApi | ListSubAccountFuturesBalances | Get /wallet/sub_account_futures_balances | Query sub accounts' futures account balances |
WalletApi | ListSubAccountCrossMarginBalances | Get /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info |
WalletApi | ListSavedAddress | Get /wallet/saved_address | Query saved address |
WalletApi | GetTradeFee | Get /wallet/fee | Retrieve personal trading fee |
WalletApi | GetTotalBalance | Get /wallet/total_balance | Retrieve user's total balances |
WithdrawalApi | Withdraw | Post /withdrawals | Withdraw |
WithdrawalApi | CancelWithdrawal | Delete /withdrawals/{withdrawal_id} | Cancel withdrawal with specified ID |
- AccountBalance
- AccountDetail
- AccountDetailKey
- AgencyCommission
- AgencyCommissionHistory
- AgencyTransaction
- AgencyTransactionHistory
- AmendOrderResult
- ApiV4KeyPerm
- AutoRepaySetting
- BatchAmendItem
- BatchFuturesOrder
- BatchOrder
- CancelBatchOrder
- CancelOrderResult
- CollateralAlign
- CollateralLoanCurrency
- CollateralOrder
- CollateralRecord
- Contract
- ContractStat
- CountdownCancelAllFuturesTask
- CountdownCancelAllSpotTask
- CreateCollateralOrder
- CreateUniLend
- CreateUniLoan
- CrossMarginAccount
- CrossMarginAccountBook
- CrossMarginBalance
- CrossMarginBalance1
- CrossMarginCurrency
- CrossMarginLoan
- CrossMarginRepayRequest
- CrossMarginRepayment
- CrossMarginTransferable
- Currency
- CurrencyChain
- CurrencyPair
- DeliveryCandlestick
- DeliveryContract
- DeliverySettlement
- DepositAddress
- DualGetOrders
- DualGetPlans
- Eth2Swap
- FlashSwapCurrency
- FlashSwapCurrencyPair
- FlashSwapOrder
- FlashSwapOrderPreview
- FlashSwapOrderRequest
- FlashSwapPreviewRequest
- FundingAccount
- FundingBookItem
- FundingRateRecord
- FuturesAccount
- FuturesAccountBook
- FuturesAccountHistory
- FuturesAutoDeleverage
- FuturesCandlestick
- FuturesFee
- FuturesIndexConstituents
- FuturesInitialOrder
- FuturesLiqOrder
- FuturesLiquidate
- FuturesOrder
- FuturesOrderAmendment
- FuturesOrderBook
- FuturesOrderBookItem
- FuturesPremiumIndex
- FuturesPriceTrigger
- FuturesPriceTriggeredOrder
- FuturesTicker
- FuturesTrade
- IndexConstituent
- InsuranceRecord
- LedgerRecord
- LiquidateOrder
- Loan
- LoanPatch
- LoanRecord
- MarginAccount
- MarginAccountBook
- MarginAccountCurrency
- MarginBorrowable
- MarginCurrencyPair
- MarginTransferable
- MaxUniBorrowable
- MultiChainAddressItem
- MyFuturesTrade
- MyFuturesTradeTimeRange
- OpenOrders
- OptionsAccount
- OptionsAccountBook
- OptionsCandlestick
- OptionsContract
- OptionsMySettlements
- OptionsMyTrade
- OptionsOrder
- OptionsPosition
- OptionsPositionClose
- OptionsPositionCloseOrder
- OptionsSettlement
- OptionsTicker
- OptionsUnderlying
- OptionsUnderlyingTicker
- Order
- OrderBook
- OrderPatch
- OrderResp
- PatchUniLend
- PlaceDualInvestmentOrder
- Position
- PositionClose
- PositionCloseOrder
- RepayLoan
- RepayRecord
- RepayRequest
- RepayResp
- Repayment
- SavedAddress
- SpotAccount
- SpotAccountBook
- SpotFee
- SpotPricePutOrder
- SpotPriceTrigger
- SpotPriceTriggeredOrder
- StpGroup
- StpGroupUser
- StructuredBuy
- StructuredGetProjectList
- StructuredGetProjectListRequest
- StructuredOrderList
- StructuredOrderListRequest
- SubAccount
- SubAccountBalance
- SubAccountCrossMarginBalance
- SubAccountFuturesBalance
- SubAccountKey
- SubAccountMarginBalance
- SubAccountToSubAccount
- SubAccountTransfer
- SubCrossMarginAccount
- SystemTime
- Ticker
- TotalBalance
- Trade
- TradeFee
- TransactionId
- Transfer
- TriggerOrderResponse
- TriggerTime
- UniCurrency
- UniCurrencyInterest
- UniCurrencyPair
- UniInterestMode
- UniInterestRecord
- UniLend
- UniLendInterest
- UniLendRecord
- UniLoan
- UniLoanInterestRecord
- UniLoanRecord
- UnifiedAccount
- UnifiedBalance
- UnifiedBorrowable
- UnifiedLoan
- UnifiedLoanRecord
- UnifiedMode
- UnifiedTransferable
- UserLtvInfo
- UserTotalAmount
- WithdrawStatus
- WithdrawalRecord
- Type: Gate APIv4
Example
ctx := context.WithValue(context.Background(), gateapi.ContextAPIKey, gateapi.GateAPIV4{
Key: "YOUR_API_KEY",
Secret: "YOUR_API_SECRET",
})
r, err := client.Service.Operation(ctx, args)