All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| ListDeliveryContracts | Get /delivery/{settle}/contracts | Query all futures contracts |
| GetDeliveryContract | Get /delivery/{settle}/contracts/{contract} | Query single contract information |
| ListDeliveryOrderBook | Get /delivery/{settle}/order_book | Query futures market depth information |
| ListDeliveryTrades | Get /delivery/{settle}/trades | Futures market transaction records |
| ListDeliveryCandlesticks | Get /delivery/{settle}/candlesticks | Futures market K-line chart |
| ListDeliveryTickers | Get /delivery/{settle}/tickers | Get all futures trading statistics |
| ListDeliveryInsuranceLedger | Get /delivery/{settle}/insurance | Futures market insurance fund history |
| ListDeliveryAccounts | Get /delivery/{settle}/accounts | Get futures account |
| ListDeliveryAccountBook | Get /delivery/{settle}/account_book | Query futures account change history |
| ListDeliveryPositions | Get /delivery/{settle}/positions | Get user position list |
| GetDeliveryPosition | Get /delivery/{settle}/positions/{contract} | Get single position information |
| UpdateDeliveryPositionMargin | Post /delivery/{settle}/positions/{contract}/margin | Update position margin |
| UpdateDeliveryPositionLeverage | Post /delivery/{settle}/positions/{contract}/leverage | Update position leverage |
| UpdateDeliveryPositionRiskLimit | Post /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit |
| ListDeliveryOrders | Get /delivery/{settle}/orders | Query futures order list |
| CreateDeliveryOrder | Post /delivery/{settle}/orders | Place futures order |
| CancelDeliveryOrders | Delete /delivery/{settle}/orders | Cancel all orders with 'open' status |
| GetDeliveryOrder | Get /delivery/{settle}/orders/{order_id} | Query single order details |
| CancelDeliveryOrder | Delete /delivery/{settle}/orders/{order_id} | Cancel single order |
| GetMyDeliveryTrades | Get /delivery/{settle}/my_trades | Query personal trading records |
| ListDeliveryPositionClose | Get /delivery/{settle}/position_close | Query position close history |
| ListDeliveryLiquidates | Get /delivery/{settle}/liquidates | Query liquidation history |
| ListDeliverySettlements | Get /delivery/{settle}/settlements | Query settlement records |
| ListDeliveryRiskLimitTiers | Get /delivery/{settle}/risk_limit_tiers | Query risk limit tiers |
| ListPriceTriggeredDeliveryOrders | Get /delivery/{settle}/price_orders | Query auto order list |
| CreatePriceTriggeredDeliveryOrder | Post /delivery/{settle}/price_orders | Create price-triggered order |
| CancelPriceTriggeredDeliveryOrderList | Delete /delivery/{settle}/price_orders | Cancel all auto orders |
| GetPriceTriggeredDeliveryOrder | Get /delivery/{settle}/price_orders/{order_id} | Query single auto order details |
| CancelPriceTriggeredDeliveryOrder | Delete /delivery/{settle}/price_orders/{order_id} | Cancel single auto order |
[]DeliveryContract ListDeliveryContracts(ctx, settle)
Query all futures contracts
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryContracts(ctx, settle)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeliveryContract GetDeliveryContract(ctx, settle, contract)
Query single contract information
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
result, _, err := client.DeliveryApi.GetDeliveryContract(ctx, settle, contract)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrderBook ListDeliveryOrderBook(ctx, settle, contract, optional)
Query futures market depth information
Bids will be sorted by price from high to low, while asks sorted reversely
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| optional | ListDeliveryOrderBookOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryOrderBookOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| interval | optional.String | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [default to 0] |
| limit | optional.Int32 | Number of depth levels | [default to 10] |
| withId | optional.Bool | Whether to return depth update ID. This ID increments by 1 each time depth changes | [default to false] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
result, _, err := client.DeliveryApi.ListDeliveryOrderBook(ctx, settle, contract, nil)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesTrade ListDeliveryTrades(ctx, settle, contract, optional)
Futures market transaction records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| optional | ListDeliveryTradesOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryTradesOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| lastId | optional.String | Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang | |
| from | optional.Int64 | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | |
| to | optional.Int64 | Specify end time in Unix seconds, default to current time. |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
result, _, err := client.DeliveryApi.ListDeliveryTrades(ctx, settle, contract, nil)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]DeliveryCandlestick ListDeliveryCandlesticks(ctx, settle, contract, optional)
Futures market K-line chart
Return specified contract candlesticks. If prefix contract with mark_, the contract's mark price candlesticks are returned; if prefix with index_, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| optional | ListDeliveryCandlesticksOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryCandlesticksOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| from | optional.Int64 | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | |
| to | optional.Int64 | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | |
| limit | optional.Int32 | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [default to 100] |
| interval | optional.String | Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time | [default to 5m] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
result, _, err := client.DeliveryApi.ListDeliveryCandlesticks(ctx, settle, contract, nil)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]DeliveryTicker ListDeliveryTickers(ctx, settle, optional)
Get all futures trading statistics
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliveryTickersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryTickersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryTickers(ctx, settle, nil)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]InsuranceRecord ListDeliveryInsuranceLedger(ctx, settle, optional)
Futures market insurance fund history
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliveryInsuranceLedgerOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryInsuranceLedgerOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryInsuranceLedger(ctx, settle, nil)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesAccount ListDeliveryAccounts(ctx, settle)
Get futures account
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryAccounts(ctx, settle)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesAccountBook ListDeliveryAccountBook(ctx, settle, optional)
Query futures account change history
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliveryAccountBookOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryAccountBookOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| from | optional.Int64 | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | |
| to | optional.Int64 | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | |
| type_ | optional.String | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryAccountBook(ctx, settle, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Position ListDeliveryPositions(ctx, settle)
Get user position list
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryPositions(ctx, settle)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position GetDeliveryPosition(ctx, settle, contract)
Get single position information
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
result, _, err := client.DeliveryApi.GetDeliveryPosition(ctx, settle, contract)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position UpdateDeliveryPositionMargin(ctx, settle, contract, change)
Update position margin
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| change | string | Margin change amount, positive number increases, negative number decreases |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
change := "0.01" // string - Margin change amount, positive number increases, negative number decreases
result, _, err := client.DeliveryApi.UpdateDeliveryPositionMargin(ctx, settle, contract, change)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position UpdateDeliveryPositionLeverage(ctx, settle, contract, leverage)
Update position leverage
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| leverage | string | New position leverage |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
leverage := "10" // string - New position leverage
result, _, err := client.DeliveryApi.UpdateDeliveryPositionLeverage(ctx, settle, contract, leverage)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position UpdateDeliveryPositionRiskLimit(ctx, settle, contract, riskLimit)
Update position risk limit
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| riskLimit | string | New position risk limit |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
riskLimit := "10" // string - New position risk limit
result, _, err := client.DeliveryApi.UpdateDeliveryPositionRiskLimit(ctx, settle, contract, riskLimit)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesOrder ListDeliveryOrders(ctx, settle, status, optional)
Query futures order list
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| status | string | Query order list based on status | |
| optional | ListDeliveryOrdersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryOrdersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| offset | optional.Int32 | List offset, starting from 0 | [default to 0] |
| lastId | optional.String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | |
| countTotal | optional.Int32 | Whether to return total number matched, defaults to 0 (no return) | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
status := "open" // string - Query order list based on status
result, _, err := client.DeliveryApi.ListDeliveryOrders(ctx, settle, status, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrder CreateDeliveryOrder(ctx, settle, futuresOrder)
Place futures order
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| futuresOrder | FuturesOrder |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
futuresOrder := gateapi.FuturesOrder{} // FuturesOrder -
result, _, err := client.DeliveryApi.CreateDeliveryOrder(ctx, settle, futuresOrder)
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)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesOrder CancelDeliveryOrders(ctx, settle, contract, optional)
Cancel all orders with 'open' status
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract | |
| optional | CancelDeliveryOrdersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a CancelDeliveryOrdersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| side | optional.String | Specify all bids or all asks, both included if not specified |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
contract := "BTC_USDT_20200814" // string - Futures contract
result, _, err := client.DeliveryApi.CancelDeliveryOrders(ctx, settle, contract, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrder GetDeliveryOrder(ctx, settle, orderId)
Query single order details
Zero-fill orders cannot be retrieved 10 minutes after order cancellation
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| orderId | string | ID returned when order is successfully created |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
orderId := "12345" // string - ID returned when order is successfully created
result, _, err := client.DeliveryApi.GetDeliveryOrder(ctx, settle, orderId)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrder CancelDeliveryOrder(ctx, settle, orderId)
Cancel single order
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| orderId | string | ID returned when order is successfully created |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
orderId := "12345" // string - ID returned when order is successfully created
result, _, err := client.DeliveryApi.CancelDeliveryOrder(ctx, settle, orderId)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]MyFuturesTrade GetMyDeliveryTrades(ctx, settle, optional)
Query personal trading records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | GetMyDeliveryTradesOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a GetMyDeliveryTradesOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract | |
| order | optional.Int64 | Futures order ID, return related data only if specified | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| offset | optional.Int32 | List offset, starting from 0 | [default to 0] |
| lastId | optional.String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | |
| countTotal | optional.Int32 | Whether to return total number matched, defaults to 0 (no return) | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.GetMyDeliveryTrades(ctx, settle, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]PositionClose ListDeliveryPositionClose(ctx, settle, optional)
Query position close history
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliveryPositionCloseOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryPositionCloseOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryPositionClose(ctx, settle, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesLiquidate ListDeliveryLiquidates(ctx, settle, optional)
Query liquidation history
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliveryLiquidatesOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryLiquidatesOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| at | optional.Int32 | Specify liquidation timestamp | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryLiquidates(ctx, settle, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]DeliverySettlement ListDeliverySettlements(ctx, settle, optional)
Query settlement records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliverySettlementsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliverySettlementsOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| at | optional.Int32 | Specify settlement timestamp | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliverySettlements(ctx, settle, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesLimitRiskTiers ListDeliveryRiskLimitTiers(ctx, settle, optional)
Query risk limit tiers
When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty.
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| optional | ListDeliveryRiskLimitTiersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListDeliveryRiskLimitTiersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| offset | optional.Int32 | List offset, starting from 0 | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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.Background()
settle := "usdt" // string - Settle currency
result, _, err := client.DeliveryApi.ListDeliveryRiskLimitTiers(ctx, settle, nil)
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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesPriceTriggeredOrder ListPriceTriggeredDeliveryOrders(ctx, settle, status, optional)
Query auto order list
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| status | string | Query order list based on status | |
| optional | ListPriceTriggeredDeliveryOrdersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListPriceTriggeredDeliveryOrdersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| contract | optional.String | Futures contract, return related data only if specified | |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| offset | optional.Int32 | List offset, starting from 0 | [default to 0] |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
status := "status_example" // string - Query order list based on status
result, _, err := client.DeliveryApi.ListPriceTriggeredDeliveryOrders(ctx, settle, status, nil)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TriggerOrderResponse CreatePriceTriggeredDeliveryOrder(ctx, settle, futuresPriceTriggeredOrder)
Create price-triggered order
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| futuresPriceTriggeredOrder | FuturesPriceTriggeredOrder |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
futuresPriceTriggeredOrder := gateapi.FuturesPriceTriggeredOrder{} // FuturesPriceTriggeredOrder -
result, _, err := client.DeliveryApi.CreatePriceTriggeredDeliveryOrder(ctx, settle, futuresPriceTriggeredOrder)
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)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]FuturesPriceTriggeredOrder CancelPriceTriggeredDeliveryOrderList(ctx, settle, contract)
Cancel all auto orders
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| contract | string | Futures contract |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
contract := "BTC_USDT" // string - Futures contract
result, _, err := client.DeliveryApi.CancelPriceTriggeredDeliveryOrderList(ctx, settle, contract)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesPriceTriggeredOrder GetPriceTriggeredDeliveryOrder(ctx, settle, orderId)
Query single auto order details
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| orderId | string | ID returned when order is successfully created |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
orderId := "orderId_example" // string - ID returned when order is successfully created
result, _, err := client.DeliveryApi.GetPriceTriggeredDeliveryOrder(ctx, settle, orderId)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesPriceTriggeredOrder CancelPriceTriggeredDeliveryOrder(ctx, settle, orderId)
Cancel single auto order
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| settle | string | Settle currency | |
| orderId | string | ID returned when order is successfully created |
package main
import (
"context"
"fmt"
"github.com/gateio/gateapi-go/v7"
)
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",
}
)
settle := "usdt" // string - Settle currency
orderId := "orderId_example" // string - ID returned when order is successfully created
result, _, err := client.DeliveryApi.CancelPriceTriggeredDeliveryOrder(ctx, settle, orderId)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]