All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
SwapETH2 | Post /earn/staking/eth2/swap | ETH2 swap |
ListDualInvestmentPlans | Get /earn/dual/investment_plan | Dual Investment product list |
ListDualOrders | Get /earn/dual/orders | Dual Investment order list |
PlaceDualOrder | Post /earn/dual/orders | Place Dual Investment order |
ListStructuredProducts | Get /earn/structured/products | Structured Product List |
ListStructuredOrders | Get /earn/structured/orders | Structured Product Order List |
PlaceStructuredOrder | Post /earn/structured/orders | Place Structured Product Order |
SwapETH2(ctx, eth2Swap)
ETH2 swap
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
eth2Swap | Eth2Swap |
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",
}
)
eth2Swap := gateapi.Eth2Swap{} // Eth2Swap -
result, _, err := client.EarnApi.SwapETH2(ctx, eth2Swap)
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)
}
}
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]DualGetPlans ListDualInvestmentPlans(ctx, )
Dual Investment product list
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.Background()
result, _, err := client.EarnApi.ListDualInvestmentPlans(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)
}
}
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]DualGetOrders ListDualOrders(ctx, )
Dual Investment order list
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.EarnApi.ListDualOrders(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)
}
}
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PlaceDualOrder(ctx, placeDualInvestmentOrder)
Place Dual Investment order
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
placeDualInvestmentOrder | PlaceDualInvestmentOrder |
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",
}
)
placeDualInvestmentOrder := gateapi.PlaceDualInvestmentOrder{} // PlaceDualInvestmentOrder -
result, _, err := client.EarnApi.PlaceDualOrder(ctx, placeDualInvestmentOrder)
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)
}
}
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]StructuredGetProjectList ListStructuredProducts(ctx, status, optional)
Structured Product List
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
status | string | Status (default: all) `in_process`-processing `will_begin`-unstarted `wait_settlement`-unsettled `done`-finish | |
optional | ListStructuredProductsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListStructuredProductsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
type_ | optional.String | Product Type (default all) `SharkFin2.0`-SharkFin `BullishSharkFin`-BullishSharkFin `BearishSharkFin`-BearishSharkFin `DoubleNoTouch`-DoubleNoTouch `RangeAccrual`-RangeAccrual `SnowBall`-SnowBall | |
page | optional.Int32 | Page number | [default to 1] |
limit | optional.Int32 | Maximum number of records to be returned in a single list | [default to 100] |
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.Background()
status := "in_process" // string - Status (default: all) `in_process`-processing `will_begin`-unstarted `wait_settlement`-unsettled `done`-finish
result, _, err := client.EarnApi.ListStructuredProducts(ctx, 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)
}
}
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]StructuredOrderList ListStructuredOrders(ctx, optional)
Structured Product Order List
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListStructuredOrdersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListStructuredOrdersOpts struct
Name | Type | Description | Notes |
---|---|---|---|
from | optional.Int64 | Start timestamp | |
to | optional.Int64 | End timestamp | |
page | optional.Int32 | Page number | [default to 1] |
limit | optional.Int32 | Maximum number of records to be returned in a single list | [default to 100] |
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.EarnApi.ListStructuredOrders(ctx, 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]
PlaceStructuredOrder(ctx, structuredBuy)
Place Structured Product Order
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
structuredBuy | StructuredBuy |
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",
}
)
structuredBuy := gateapi.StructuredBuy{} // StructuredBuy -
result, _, err := client.EarnApi.PlaceStructuredOrder(ctx, structuredBuy)
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)
}
}
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]