Skip to content

Commit 3e648ec

Browse files
author
gateio
committed
update to v6.93.0
1 parent 8ccc078 commit 3e648ec

18 files changed

+277
-17
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API
77
## Overview
88
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
99

10-
- API version: 4.92.2
11-
- Package version: 6.92.2
10+
- API version: 4.93.0
11+
- Package version: 6.93.0
1212
- Build package: org.openapitools.codegen.languages.GoClientCodegen
1313
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
1414

@@ -141,6 +141,7 @@ Class | Method | HTTP request | Description
141141
*DeliveryApi* | [**GetPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#getpricetriggereddeliveryorder) | **Get** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order
142142
*DeliveryApi* | [**CancelPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#cancelpricetriggereddeliveryorder) | **Delete** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order
143143
*EarnApi* | [**SwapETH2**](docs/EarnApi.md#swapeth2) | **Post** /earn/staking/eth2/swap | ETH2 swap
144+
*EarnApi* | [**RateListETH2**](docs/EarnApi.md#ratelisteth2) | **Get** /earn/staking/eth2/rate_records | ETH2 historical rate of return query
144145
*EarnApi* | [**ListDualInvestmentPlans**](docs/EarnApi.md#listdualinvestmentplans) | **Get** /earn/dual/investment_plan | Dual Investment product list
145146
*EarnApi* | [**ListDualOrders**](docs/EarnApi.md#listdualorders) | **Get** /earn/dual/orders | Dual Investment order list
146147
*EarnApi* | [**PlaceDualOrder**](docs/EarnApi.md#placedualorder) | **Post** /earn/dual/orders | Place Dual Investment order
@@ -436,6 +437,7 @@ Class | Method | HTTP request | Description
436437
- [DepositAddress](docs/DepositAddress.md)
437438
- [DualGetOrders](docs/DualGetOrders.md)
438439
- [DualGetPlans](docs/DualGetPlans.md)
440+
- [Eth2RateList](docs/Eth2RateList.md)
439441
- [Eth2Swap](docs/Eth2Swap.md)
440442
- [FlashSwapCurrencyPair](docs/FlashSwapCurrencyPair.md)
441443
- [FlashSwapOrder](docs/FlashSwapOrder.md)

api_earn.go

+128-2
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,111 @@ func (a *EarnApiService) SwapETH2(ctx context.Context, eth2Swap Eth2Swap) (*http
106106
return localVarHTTPResponse, nil
107107
}
108108

109+
/*
110+
RateListETH2 ETH2 historical rate of return query
111+
Check the ETH earnings rate record for the last 31 days
112+
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
113+
114+
@return []Eth2RateList
115+
*/
116+
func (a *EarnApiService) RateListETH2(ctx context.Context) ([]Eth2RateList, *http.Response, error) {
117+
var (
118+
localVarHTTPMethod = http.MethodGet
119+
localVarPostBody interface{}
120+
localVarFormFileName string
121+
localVarFileName string
122+
localVarFileBytes []byte
123+
localVarReturnValue []Eth2RateList
124+
)
125+
126+
// create path and map variables
127+
localVarPath := a.client.cfg.BasePath + "/earn/staking/eth2/rate_records"
128+
localVarHeaderParams := make(map[string]string)
129+
localVarQueryParams := url.Values{}
130+
localVarFormParams := url.Values{}
131+
132+
// to determine the Content-Type header
133+
localVarHTTPContentTypes := []string{}
134+
135+
// set Content-Type header
136+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
137+
if localVarHTTPContentType != "" {
138+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
139+
}
140+
141+
// to determine the Accept header
142+
localVarHTTPHeaderAccepts := []string{"application/json"}
143+
144+
// set Accept header
145+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
146+
if localVarHTTPHeaderAccept != "" {
147+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
148+
}
149+
if ctx == nil {
150+
ctx = context.Background()
151+
}
152+
if ctx.Value(ContextGateAPIV4) == nil {
153+
// for compatibility, set configuration key and secret to context if ContextGateAPIV4 value is not present
154+
ctx = context.WithValue(ctx, ContextGateAPIV4, GateAPIV4{
155+
Key: a.client.cfg.Key,
156+
Secret: a.client.cfg.Secret,
157+
})
158+
}
159+
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
160+
if err != nil {
161+
return localVarReturnValue, nil, err
162+
}
163+
164+
localVarHTTPResponse, err := a.client.callAPI(r)
165+
if err != nil || localVarHTTPResponse == nil {
166+
return localVarReturnValue, localVarHTTPResponse, err
167+
}
168+
169+
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
170+
localVarHTTPResponse.Body.Close()
171+
if err != nil {
172+
return localVarReturnValue, localVarHTTPResponse, err
173+
}
174+
175+
if localVarHTTPResponse.StatusCode >= 300 {
176+
newErr := GenericOpenAPIError{
177+
body: localVarBody,
178+
error: localVarHTTPResponse.Status + ", " + string(localVarBody),
179+
}
180+
var gateErr GateAPIError
181+
if e := a.client.decode(&gateErr, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")); e == nil && gateErr.Label != "" {
182+
gateErr.APIError = newErr
183+
return localVarReturnValue, localVarHTTPResponse, gateErr
184+
}
185+
return localVarReturnValue, localVarHTTPResponse, newErr
186+
}
187+
188+
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
189+
if err != nil {
190+
newErr := GenericOpenAPIError{
191+
body: localVarBody,
192+
error: err.Error(),
193+
}
194+
return localVarReturnValue, localVarHTTPResponse, newErr
195+
}
196+
197+
return localVarReturnValue, localVarHTTPResponse, nil
198+
}
199+
200+
// ListDualInvestmentPlansOpts Optional parameters for the method 'ListDualInvestmentPlans'
201+
type ListDualInvestmentPlansOpts struct {
202+
PlanId optional.Int64
203+
}
204+
109205
/*
110206
ListDualInvestmentPlans Dual Investment product list
111207
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
208+
- @param optional nil or *ListDualInvestmentPlansOpts - Optional Parameters:
209+
- @param "PlanId" (optional.Int64) - Financial project id
112210
113211
@return []DualGetPlans
114212
*/
115-
func (a *EarnApiService) ListDualInvestmentPlans(ctx context.Context) ([]DualGetPlans, *http.Response, error) {
213+
func (a *EarnApiService) ListDualInvestmentPlans(ctx context.Context, localVarOptionals *ListDualInvestmentPlansOpts) ([]DualGetPlans, *http.Response, error) {
116214
var (
117215
localVarHTTPMethod = http.MethodGet
118216
localVarPostBody interface{}
@@ -128,6 +226,9 @@ func (a *EarnApiService) ListDualInvestmentPlans(ctx context.Context) ([]DualGet
128226
localVarQueryParams := url.Values{}
129227
localVarFormParams := url.Values{}
130228

229+
if localVarOptionals != nil && localVarOptionals.PlanId.IsSet() {
230+
localVarQueryParams.Add("plan_id", parameterToString(localVarOptionals.PlanId.Value(), ""))
231+
}
131232
// to determine the Content-Type header
132233
localVarHTTPContentTypes := []string{}
133234

@@ -190,13 +291,26 @@ func (a *EarnApiService) ListDualInvestmentPlans(ctx context.Context) ([]DualGet
190291
return localVarReturnValue, localVarHTTPResponse, nil
191292
}
192293

294+
// ListDualOrdersOpts Optional parameters for the method 'ListDualOrders'
295+
type ListDualOrdersOpts struct {
296+
From optional.Int64
297+
To optional.Int64
298+
Page optional.Int32
299+
Limit optional.Int32
300+
}
301+
193302
/*
194303
ListDualOrders Dual Investment order list
195304
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
305+
- @param optional nil or *ListDualOrdersOpts - Optional Parameters:
306+
- @param "From" (optional.Int64) - Start checkout time
307+
- @param "To" (optional.Int64) - End settlement time
308+
- @param "Page" (optional.Int32) - Page number
309+
- @param "Limit" (optional.Int32) - Maximum number of records to be returned in a single list
196310
197311
@return []DualGetOrders
198312
*/
199-
func (a *EarnApiService) ListDualOrders(ctx context.Context) ([]DualGetOrders, *http.Response, error) {
313+
func (a *EarnApiService) ListDualOrders(ctx context.Context, localVarOptionals *ListDualOrdersOpts) ([]DualGetOrders, *http.Response, error) {
200314
var (
201315
localVarHTTPMethod = http.MethodGet
202316
localVarPostBody interface{}
@@ -212,6 +326,18 @@ func (a *EarnApiService) ListDualOrders(ctx context.Context) ([]DualGetOrders, *
212326
localVarQueryParams := url.Values{}
213327
localVarFormParams := url.Values{}
214328

329+
if localVarOptionals != nil && localVarOptionals.From.IsSet() {
330+
localVarQueryParams.Add("from", parameterToString(localVarOptionals.From.Value(), ""))
331+
}
332+
if localVarOptionals != nil && localVarOptionals.To.IsSet() {
333+
localVarQueryParams.Add("to", parameterToString(localVarOptionals.To.Value(), ""))
334+
}
335+
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
336+
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
337+
}
338+
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
339+
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
340+
}
215341
// to determine the Content-Type header
216342
localVarHTTPContentTypes := []string{}
217343

api_spot.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type SpotApiService service
2828

2929
/*
3030
ListCurrencies List all currencies' details
31-
Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `<currency>_<chain>`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `<currency>_`.
31+
When a currency corresponds to multiple chains, you can query the information of multiple chains through the `chains` field, such as the charging and recharge status, identification, etc. of the chain.
3232
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
3333
3434
@return []Currency

configuration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func NewConfiguration() *Configuration {
9090
cfg := &Configuration{
9191
BasePath: "https://api.gateio.ws/api/v4",
9292
DefaultHeader: make(map[string]string),
93-
UserAgent: "OpenAPI-Generator/6.92.2/go",
93+
UserAgent: "OpenAPI-Generator/6.93.0/go",
9494
Debug: false,
9595
Servers: []ServerConfiguration{
9696
{

docs/DualGetOrders.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Name | Type | Description | Notes
2020
**ApyDisplay** | **string** | APY | [optional]
2121
**ApySettlement** | **string** | Settlement APY | [optional]
2222
**DeliveryTime** | **int32** | Settlement time | [optional]
23+
**Text** | **string** | Custom order information | [optional]
2324

2425
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2526

docs/EarnApi.md

+98-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
55
Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**SwapETH2**](EarnApi.md#SwapETH2) | **Post** /earn/staking/eth2/swap | ETH2 swap
8+
[**RateListETH2**](EarnApi.md#RateListETH2) | **Get** /earn/staking/eth2/rate_records | ETH2 historical rate of return query
89
[**ListDualInvestmentPlans**](EarnApi.md#ListDualInvestmentPlans) | **Get** /earn/dual/investment_plan | Dual Investment product list
910
[**ListDualOrders**](EarnApi.md#ListDualOrders) | **Get** /earn/dual/orders | Dual Investment order list
1011
[**PlaceDualOrder**](EarnApi.md#PlaceDualOrder) | **Post** /earn/dual/orders | Place Dual Investment order
@@ -82,14 +83,92 @@ func main() {
8283
[[Back to Model list]](../README.md#documentation-for-models)
8384
[[Back to README]](../README.md)
8485

86+
## RateListETH2
87+
88+
> []Eth2RateList RateListETH2(ctx, )
89+
90+
ETH2 historical rate of return query
91+
92+
Check the ETH earnings rate record for the last 31 days
93+
94+
### Required Parameters
95+
96+
97+
### Example
98+
99+
```golang
100+
package main
101+
102+
import (
103+
"context"
104+
"fmt"
105+
106+
"github.com/gateio/gateapi-go/v6"
107+
)
108+
109+
func main() {
110+
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
111+
// uncomment the next line if your are testing against testnet
112+
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
113+
ctx := context.WithValue(context.Background(),
114+
gateapi.ContextGateAPIV4,
115+
gateapi.GateAPIV4{
116+
Key: "YOUR_API_KEY",
117+
Secret: "YOUR_API_SECRET",
118+
}
119+
)
120+
121+
result, _, err := client.EarnApi.RateListETH2(ctx)
122+
if err != nil {
123+
if e, ok := err.(gateapi.GateAPIError); ok {
124+
fmt.Printf("gate api error: %s\n", e.Error())
125+
} else {
126+
fmt.Printf("generic error: %s\n", err.Error())
127+
}
128+
} else {
129+
fmt.Println(result)
130+
}
131+
}
132+
```
133+
134+
135+
### Return type
136+
137+
[**[]Eth2RateList**](Eth2RateList.md)
138+
139+
### Authorization
140+
141+
[apiv4](../README.md#apiv4)
142+
143+
### HTTP request headers
144+
145+
- **Content-Type**: Not defined
146+
- **Accept**: application/json
147+
148+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
149+
[[Back to Model list]](../README.md#documentation-for-models)
150+
[[Back to README]](../README.md)
151+
85152
## ListDualInvestmentPlans
86153

87-
> []DualGetPlans ListDualInvestmentPlans(ctx, )
154+
> []DualGetPlans ListDualInvestmentPlans(ctx, optional)
88155
89156
Dual Investment product list
90157

91158
### Required Parameters
92159

160+
Name | Type | Description | Notes
161+
------------- | ------------- | ------------- | -------------
162+
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
163+
**optional** | **ListDualInvestmentPlansOpts** | optional parameters | nil if no parameters
164+
165+
### Optional Parameters
166+
167+
Optional parameters are passed through a pointer to a ListDualInvestmentPlansOpts struct
168+
169+
Name | Type | Description | Notes
170+
------------- | ------------- | ------------- | -------------
171+
**planId** | **optional.Int64**| Financial project id |
93172

94173
### Example
95174

@@ -109,7 +188,7 @@ func main() {
109188
// client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
110189
ctx := context.Background()
111190

112-
result, _, err := client.EarnApi.ListDualInvestmentPlans(ctx)
191+
result, _, err := client.EarnApi.ListDualInvestmentPlans(ctx, nil)
113192
if err != nil {
114193
if e, ok := err.(gateapi.GateAPIError); ok {
115194
fmt.Printf("gate api error: %s\n", e.Error())
@@ -142,12 +221,27 @@ No authorization required
142221

143222
## ListDualOrders
144223

145-
> []DualGetOrders ListDualOrders(ctx, )
224+
> []DualGetOrders ListDualOrders(ctx, optional)
146225
147226
Dual Investment order list
148227

149228
### Required Parameters
150229

230+
Name | Type | Description | Notes
231+
------------- | ------------- | ------------- | -------------
232+
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
233+
**optional** | **ListDualOrdersOpts** | optional parameters | nil if no parameters
234+
235+
### Optional Parameters
236+
237+
Optional parameters are passed through a pointer to a ListDualOrdersOpts struct
238+
239+
Name | Type | Description | Notes
240+
------------- | ------------- | ------------- | -------------
241+
**from** | **optional.Int64**| Start checkout time |
242+
**to** | **optional.Int64**| End settlement time |
243+
**page** | **optional.Int32**| Page number | [default to 1]
244+
**limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100]
151245

152246
### Example
153247

@@ -173,7 +267,7 @@ func main() {
173267
}
174268
)
175269

176-
result, _, err := client.EarnApi.ListDualOrders(ctx)
270+
result, _, err := client.EarnApi.ListDualOrders(ctx, nil)
177271
if err != nil {
178272
if e, ok := err.(gateapi.GateAPIError); ok {
179273
fmt.Printf("gate api error: %s\n", e.Error())

docs/Eth2RateList.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Eth2RateList
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**DateTime** | **int64** | Date and Time Stamp | [optional]
8+
**Date** | **string** | Date | [optional]
9+
**Rate** | **string** | percentage | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

docs/LedgerRecord.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
1212
**Currency** | **string** | Currency name |
1313
**Address** | **string** | Withdrawal address. Required for withdrawals | [optional]
1414
**Memo** | **string** | Additional remarks with regards to the withdrawal | [optional]
15-
**Status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount | [optional] [readonly]
15+
**Status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval | [optional] [readonly]
1616
**Chain** | **string** | Name of the chain used in withdrawals |
1717

1818
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

0 commit comments

Comments
 (0)