All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
ListUniCurrencies | Get /earn/uni/currencies | List currencies for lending |
GetUniCurrency | Get /earn/uni/currencies/{currency} | Get currency detail for lending |
ListUserUniLends | Get /earn/uni/lends | List user's lending orders |
CreateUniLend | Post /earn/uni/lends | Lend or redeem |
ChangeUniLend | Patch /earn/uni/lends | Amend lending order |
ListUniLendRecords | Get /earn/uni/lend_records | List records of lending |
GetUniInterest | Get /earn/uni/interests/{currency} | Get the user's total interest income of specified currency |
ListUniInterestRecords | Get /earn/uni/interest_records | List interest records |
SwitchInterestReinvest | Put /earn/uni/interest_reinvest | Set interest reinvestment toggle |
GetUniInterestStatus | Get /earn/uni/interest_status/{currency} | query currency interest compounding status |
[]UniCurrency ListUniCurrencies(ctx, )
List currencies for lending
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.EarnUniApi.ListUniCurrencies(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]
UniCurrency GetUniCurrency(ctx, currency)
Get currency detail for lending
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
currency | string | Currency |
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()
currency := "btc" // string - Currency
result, _, err := client.EarnUniApi.GetUniCurrency(ctx, currency)
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]
[]UniLend ListUserUniLends(ctx, optional)
List user's lending orders
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListUserUniLendsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUserUniLendsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
currency | optional.String | Retrieve data of the specified currency | |
page | optional.Int32 | Page number | [default to 1] |
limit | optional.Int32 | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [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.EarnUniApi.ListUserUniLends(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]
CreateUniLend(ctx, createUniLend)
Lend or redeem
Lending
: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first Redemption
: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour Note
: Two minutes before and after the hour is the settlement time, lending and redemption are prohibited.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
createUniLend | CreateUniLend |
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",
}
)
createUniLend := gateapi.CreateUniLend{} // CreateUniLend -
result, _, err := client.EarnUniApi.CreateUniLend(ctx, createUniLend)
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]
ChangeUniLend(ctx, patchUniLend)
Amend lending order
Currently only supports amending the minimum interest rate (hour)
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
patchUniLend | PatchUniLend |
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",
}
)
patchUniLend := gateapi.PatchUniLend{} // PatchUniLend -
result, _, err := client.EarnUniApi.ChangeUniLend(ctx, patchUniLend)
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]
[]UniLendRecord ListUniLendRecords(ctx, optional)
List records of lending
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListUniLendRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUniLendRecordsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
currency | optional.String | Retrieve data of the specified currency | |
page | optional.Int32 | Page number | [default to 1] |
limit | optional.Int32 | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [default to 100] |
from | optional.Int64 | Start timestamp | |
to | optional.Int64 | End timestamp | |
type_ | optional.String | type: lend - lend, redeem - redeem |
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.EarnUniApi.ListUniLendRecords(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]
UniLendInterest GetUniInterest(ctx, currency)
Get the user's total interest income of specified currency
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
currency | string | Currency |
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",
}
)
currency := "btc" // string - Currency
result, _, err := client.EarnUniApi.GetUniInterest(ctx, currency)
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]
[]UniInterestRecord ListUniInterestRecords(ctx, optional)
List interest records
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListUniInterestRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUniInterestRecordsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
currency | optional.String | Retrieve data of the specified currency | |
page | optional.Int32 | Page number | [default to 1] |
limit | optional.Int32 | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [default to 100] |
from | optional.Int64 | Start timestamp | |
to | optional.Int64 | End timestamp |
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.EarnUniApi.ListUniInterestRecords(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]
SwitchInterestReinvest(ctx, uniInterestMode)
Set interest reinvestment toggle
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
uniInterestMode | UniInterestMode |
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",
}
)
uniInterestMode := gateapi.UniInterestMode{} // UniInterestMode -
result, _, err := client.EarnUniApi.SwitchInterestReinvest(ctx, uniInterestMode)
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]
UniCurrencyInterest GetUniInterestStatus(ctx, currency)
query currency interest compounding status
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
currency | string | Currency |
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",
}
)
currency := "btc" // string - Currency
result, _, err := client.EarnUniApi.GetUniInterestStatus(ctx, currency)
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]