All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
ListUniCurrencyPairs | Get /margin/uni/currency_pairs | List lending markets |
GetUniCurrencyPair | Get /margin/uni/currency_pairs/{currency_pair} | Get detail of lending market |
GetMarginUniEstimateRate | Get /margin/uni/estimate_rate | Estimate interest Rate |
ListUniLoans | Get /margin/uni/loans | List loans |
CreateUniLoan | Post /margin/uni/loans | Borrow or repay |
ListUniLoanRecords | Get /margin/uni/loan_records | Get load records |
ListUniLoanInterestRecords | Get /margin/uni/interest_records | List interest records |
GetUniBorrowable | Get /margin/uni/borrowable | Get maximum borrowable |
[]UniCurrencyPair ListUniCurrencyPairs(ctx, )
List lending markets
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.MarginUniApi.ListUniCurrencyPairs(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]
UniCurrencyPair GetUniCurrencyPair(ctx, currencyPair)
Get detail of lending market
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
currencyPair | string | Currency pair |
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()
currencyPair := "AE_USDT" // string - Currency pair
result, _, err := client.MarginUniApi.GetUniCurrencyPair(ctx, currencyPair)
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]
map[string]string GetMarginUniEstimateRate(ctx, currencies)
Estimate interest Rate
Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
currencies | []string | An array of up to 10 specifying the currency name |
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",
}
)
currencies := []string{"[\"BTC\",\"GT\"]"} // []string - An array of up to 10 specifying the currency name
result, _, err := client.MarginUniApi.GetMarginUniEstimateRate(ctx, currencies)
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)
}
}
map[string]string
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]UniLoan ListUniLoans(ctx, optional)
List loans
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListUniLoansOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUniLoansOpts struct
Name | Type | Description | Notes |
---|---|---|---|
currencyPair | optional.String | Currency pair | |
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.MarginUniApi.ListUniLoans(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]
CreateUniLoan(ctx, createUniLoan)
Borrow or repay
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
createUniLoan | CreateUniLoan |
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",
}
)
createUniLoan := gateapi.CreateUniLoan{} // CreateUniLoan -
result, _, err := client.MarginUniApi.CreateUniLoan(ctx, createUniLoan)
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]
[]UniLoanRecord ListUniLoanRecords(ctx, optional)
Get load records
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListUniLoanRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUniLoanRecordsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
type_ | optional.String | type: borrow - borrow, repay - repay | |
currency | optional.String | Retrieve data of the specified currency | |
currencyPair | optional.String | Currency pair | |
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.MarginUniApi.ListUniLoanRecords(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]
[]UniLoanInterestRecord ListUniLoanInterestRecords(ctx, optional)
List interest records
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | ListUniLoanInterestRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUniLoanInterestRecordsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
currencyPair | optional.String | Currency pair | |
currency | optional.String | Retrieve data of the specified currency | |
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] |
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.MarginUniApi.ListUniLoanInterestRecords(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]
MaxUniBorrowable GetUniBorrowable(ctx, currency, currencyPair)
Get maximum borrowable
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
currency | string | Retrieve data of the specified currency | |
currencyPair | string | Currency pair |
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 - Retrieve data of the specified currency
currencyPair := "BTC_USDT" // string - Currency pair
result, _, err := client.MarginUniApi.GetUniBorrowable(ctx, currency, currencyPair)
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]