[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
782 lines (560 loc) · 23.1 KB

MultiCollateralLoanApi.md

File metadata and controls

782 lines (560 loc) · 23.1 KB

MultiCollateralLoanApi

All URIs are relative to https://api.gateio.ws/api/v4

Method HTTP request Description
ListMultiCollateralOrders Get /loan/multi_collateral/orders List Multi-Collateral Orders
CreateMultiCollateral Post /loan/multi_collateral/orders Create Multi-Collateral Order
GetMultiCollateralOrderDetail Get /loan/multi_collateral/orders/{order_id} Get Multi-Collateral Order Detail
ListMultiRepayRecords Get /loan/multi_collateral/repay List Multi-Collateral Repay Records
RepayMultiCollateralLoan Post /loan/multi_collateral/repay Repay Multi-Collateral Loan
ListMultiCollateralRecords Get /loan/multi_collateral/mortgage Query collateral adjustment records
OperateMultiCollateral Post /loan/multi_collateral/mortgage Operate Multi-Collateral
ListUserCurrencyQuota Get /loan/multi_collateral/currency_quota List User Currency Quota
ListMultiCollateralCurrencies Get /loan/multi_collateral/currencies Query supported borrowing and collateral currencies in Multi-Collateral
GetMultiCollateralLtv Get /loan/multi_collateral/ltv Get Multi-Collateral ratio
GetMultiCollateralFixRate Get /loan/multi_collateral/fixed_rate Query fixed interest rates for the currency for 7 days and 30 days

ListMultiCollateralOrders

[]MultiCollateralOrder ListMultiCollateralOrders(ctx, optional)

List Multi-Collateral Orders

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional ListMultiCollateralOrdersOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ListMultiCollateralOrdersOpts struct

Name Type Description Notes
page optional.Int32 Page number [default to 1]
limit optional.Int32 Maximum number of records to be returned in a single list [default to 10]
sort optional.String Sort types: time_desc - default sorting by creation time in descending order, ltv_asc - ascending order of ltv, ltv_desc - descending order of ltv.
orderType optional.String Order type, current - query current orders, fixed - query fixed orders. If not specified, default to querying current orders

Example

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.MultiCollateralLoanApi.ListMultiCollateralOrders(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)
    }
}

Return type

[]MultiCollateralOrder

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateMultiCollateral

OrderResp CreateMultiCollateral(ctx, createMultiCollateralOrder)

Create Multi-Collateral Order

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
createMultiCollateralOrder CreateMultiCollateralOrder

Example

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",
                             }
                            )
    createMultiCollateralOrder := gateapi.CreateMultiCollateralOrder{} // CreateMultiCollateralOrder - 
    
    result, _, err := client.MultiCollateralLoanApi.CreateMultiCollateral(ctx, createMultiCollateralOrder)
    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)
    }
}

Return type

OrderResp

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMultiCollateralOrderDetail

MultiCollateralOrder GetMultiCollateralOrderDetail(ctx, orderId)

Get Multi-Collateral Order Detail

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orderId string Order ID returned on successful order creation

Example

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",
                             }
                            )
    orderId := "12345" // string - Order ID returned on successful order creation
    
    result, _, err := client.MultiCollateralLoanApi.GetMultiCollateralOrderDetail(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)
    }
}

Return type

MultiCollateralOrder

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListMultiRepayRecords

[]MultiRepayRecord ListMultiRepayRecords(ctx, type_, optional)

List Multi-Collateral Repay Records

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
type_ string Operation type: repay - Regular repayment, liquidate - Liquidation
optional ListMultiRepayRecordsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ListMultiRepayRecordsOpts struct

Name Type Description Notes
borrowCurrency optional.String Borrowed 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 10]
from optional.Int64 Start timestamp of the query
to optional.Int64 Time range ending, default to current time

Example

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",
                             }
                            )
    type_ := "repay" // string - Operation type: repay - Regular repayment, liquidate - Liquidation
    
    result, _, err := client.MultiCollateralLoanApi.ListMultiRepayRecords(ctx, type_, 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)
    }
}

Return type

[]MultiRepayRecord

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepayMultiCollateralLoan

MultiRepayResp RepayMultiCollateralLoan(ctx, repayMultiLoan)

Repay Multi-Collateral Loan

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repayMultiLoan RepayMultiLoan

Example

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",
                             }
                            )
    repayMultiLoan := gateapi.RepayMultiLoan{} // RepayMultiLoan - 
    
    result, _, err := client.MultiCollateralLoanApi.RepayMultiCollateralLoan(ctx, repayMultiLoan)
    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)
    }
}

Return type

MultiRepayResp

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListMultiCollateralRecords

[]MultiCollateralRecord ListMultiCollateralRecords(ctx, optional)

Query collateral adjustment records

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional ListMultiCollateralRecordsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ListMultiCollateralRecordsOpts struct

Name Type Description Notes
page optional.Int32 Page number [default to 1]
limit optional.Int32 Maximum number of records to be returned in a single list [default to 10]
from optional.Int64 Start timestamp of the query
to optional.Int64 Time range ending, default to current time
collateralCurrency optional.String Collateral

Example

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.MultiCollateralLoanApi.ListMultiCollateralRecords(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)
    }
}

Return type

[]MultiCollateralRecord

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

OperateMultiCollateral

CollateralAdjustRes OperateMultiCollateral(ctx, collateralAdjust)

Operate Multi-Collateral

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collateralAdjust CollateralAdjust

Example

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",
                             }
                            )
    collateralAdjust := gateapi.CollateralAdjust{} // CollateralAdjust - 
    
    result, _, err := client.MultiCollateralLoanApi.OperateMultiCollateral(ctx, collateralAdjust)
    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)
    }
}

Return type

CollateralAdjustRes

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListUserCurrencyQuota

[]CurrencyQuota ListUserCurrencyQuota(ctx, type_, currency)

List User Currency Quota

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
type_ string Currency types: collateral - collateral currency, borrow - borrowing currency.
currency string When specifying collateral currencies, you can use commas to separate multiple currencies; for borrowing currencies, only one currency can be provided.

Example

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",
                             }
                            )
    type_ := "collateral" // string - Currency types: collateral - collateral currency, borrow - borrowing currency.
    currency := "BTC" // string - When specifying collateral currencies, you can use commas to separate multiple currencies; for borrowing currencies, only one currency can be provided.
    
    result, _, err := client.MultiCollateralLoanApi.ListUserCurrencyQuota(ctx, type_, 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)
    }
}

Return type

[]CurrencyQuota

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListMultiCollateralCurrencies

MultiCollateralCurrency ListMultiCollateralCurrencies(ctx, )

Query supported borrowing and collateral currencies in Multi-Collateral

Required Parameters

Example

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.MultiCollateralLoanApi.ListMultiCollateralCurrencies(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)
    }
}

Return type

MultiCollateralCurrency

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMultiCollateralLtv

CollateralLtv GetMultiCollateralLtv(ctx, )

Get Multi-Collateral ratio

The Multi-Collateral ratio is fixed, irrespective of the currency.

Required Parameters

Example

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.MultiCollateralLoanApi.GetMultiCollateralLtv(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)
    }
}

Return type

CollateralLtv

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMultiCollateralFixRate

[]CollateralFixRate GetMultiCollateralFixRate(ctx, )

Query fixed interest rates for the currency for 7 days and 30 days

Required Parameters

Example

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.MultiCollateralLoanApi.GetMultiCollateralFixRate(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)
    }
}

Return type

[]CollateralFixRate

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]