All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| ListCollateralLoanOrders | Get /loan/collateral/orders | Query collateral loan order list |
| CreateCollateralLoan | Post /loan/collateral/orders | Place collateral loan order |
| GetCollateralLoanOrderDetail | Get /loan/collateral/orders/{order_id} | Query single order details |
| RepayCollateralLoan | Post /loan/collateral/repay | Collateral loan repayment |
| ListRepayRecords | Get /loan/collateral/repay_records | Query collateral loan repayment records |
| ListCollateralRecords | Get /loan/collateral/collaterals | Query collateral adjustment records |
| OperateCollateral | Post /loan/collateral/collaterals | Increase or redeem collateral |
| GetUserTotalAmount | Get /loan/collateral/total_amount | Query user's total borrowing and collateral amount |
| GetUserLtvInfo | Get /loan/collateral/ltv | Query user's collateralization ratio and remaining borrowable currencies |
| ListCollateralCurrencies | Get /loan/collateral/currencies | Query supported borrowing and collateral currencies |
[]CollateralOrder ListCollateralLoanOrders(ctx, optional)
Query collateral loan order list
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| optional | ListCollateralLoanOrdersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListCollateralLoanOrdersOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| page | optional.Int32 | Page number | [default to 1] |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| collateralCurrency | optional.String | Collateral currency | |
| borrowCurrency | optional.String | Borrowed 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",
}
)
result, _, err := client.CollateralLoanApi.ListCollateralLoanOrders(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]
OrderResp CreateCollateralLoan(ctx, createCollateralOrder)
Place collateral loan order
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| createCollateralOrder | CreateCollateralOrder |
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",
}
)
createCollateralOrder := gateapi.CreateCollateralOrder{} // CreateCollateralOrder -
result, _, err := client.CollateralLoanApi.CreateCollateralLoan(ctx, createCollateralOrder)
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]
CollateralOrder GetCollateralLoanOrderDetail(ctx, orderId)
Query single order details
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| orderId | int64 | Order 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",
}
)
orderId := 100001 // int64 - Order ID returned when order is successfully created
result, _, err := client.CollateralLoanApi.GetCollateralLoanOrderDetail(ctx, 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]
RepayResp RepayCollateralLoan(ctx, repayLoan)
Collateral loan repayment
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| repayLoan | RepayLoan |
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",
}
)
repayLoan := gateapi.RepayLoan{} // RepayLoan -
result, _, err := client.CollateralLoanApi.RepayCollateralLoan(ctx, repayLoan)
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]
[]RepayRecord ListRepayRecords(ctx, source, optional)
Query collateral loan repayment records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| source | string | Operation type: repay - Regular repayment, liquidate - Liquidation | |
| optional | ListRepayRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListRepayRecordsOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| borrowCurrency | optional.String | Borrowed currency | |
| collateralCurrency | optional.String | Collateral currency | |
| page | optional.Int32 | Page number | [default to 1] |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| from | optional.Int64 | Start timestamp for the query | |
| to | optional.Int64 | End timestamp for the query, defaults to current time 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",
}
)
source := "repay" // string - Operation type: repay - Regular repayment, liquidate - Liquidation
result, _, err := client.CollateralLoanApi.ListRepayRecords(ctx, source, 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]
[]CollateralRecord ListCollateralRecords(ctx, optional)
Query collateral adjustment records
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| optional | ListCollateralRecordsOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListCollateralRecordsOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| page | optional.Int32 | Page number | [default to 1] |
| limit | optional.Int32 | Maximum number of records returned in a single list | [default to 100] |
| from | optional.Int64 | Start timestamp for the query | |
| to | optional.Int64 | End timestamp for the query, defaults to current time if not specified | |
| borrowCurrency | optional.String | Borrowed currency | |
| collateralCurrency | optional.String | Collateral 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",
}
)
result, _, err := client.CollateralLoanApi.ListCollateralRecords(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]
OperateCollateral(ctx, collateralAlign)
Increase or redeem collateral
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| collateralAlign | CollateralAlign |
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",
}
)
collateralAlign := gateapi.CollateralAlign{} // CollateralAlign -
result, _, err := client.CollateralLoanApi.OperateCollateral(ctx, collateralAlign)
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]
UserTotalAmount GetUserTotalAmount(ctx, )
Query user's total borrowing and collateral amount
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",
}
)
result, _, err := client.CollateralLoanApi.GetUserTotalAmount(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]
UserLtvInfo GetUserLtvInfo(ctx, collateralCurrency, borrowCurrency)
Query user's collateralization ratio and remaining borrowable currencies
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| collateralCurrency | string | Collateral currency | |
| borrowCurrency | string | Borrowed 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",
}
)
collateralCurrency := "BTC" // string - Collateral currency
borrowCurrency := "USDT" // string - Borrowed currency
result, _, err := client.CollateralLoanApi.GetUserLtvInfo(ctx, collateralCurrency, borrowCurrency)
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]
[]CollateralLoanCurrency ListCollateralCurrencies(ctx, optional)
Query supported borrowing and collateral currencies
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| optional | ListCollateralCurrenciesOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListCollateralCurrenciesOpts struct
| Name | Type | Description | Notes |
|---|---|---|---|
| loanCurrency | optional.String | Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing 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()
result, _, err := client.CollateralLoanApi.ListCollateralCurrencies(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)
}
}No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]