[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
402 lines (288 loc) · 12.5 KB

RebateApi.md

File metadata and controls

402 lines (288 loc) · 12.5 KB

RebateApi

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

Method HTTP request Description
AgencyTransactionHistory Get /rebate/agency/transaction_history The agency obtains the transaction history of the recommended user
AgencyCommissionsHistory Get /rebate/agency/commission_history The agency obtains the commission history of the recommended user
RebateBrokerCommissionHistory Get /rebate/broker/commission_history The broker obtains the user's commission rebate records
RebateBrokerTransactionHistory Get /rebate/broker/transaction_history The broker obtains the user's trading history
RebateUserInfo Get /api/v4/rebate/user/info User retrieves rebate information

AgencyTransactionHistory

[]AgencyTransactionHistory AgencyTransactionHistory(ctx, optional)

The agency obtains the transaction history of the recommended user

Record time range cannot exceed 30 days

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a AgencyTransactionHistoryOpts struct

Name Type Description Notes
currencyPair optional.String Specify the currency pair, if not specified, return all currency pairs
userId optional.Int64 User ID. If not specified, all user records will be returned
from optional.Int64 Time range beginning, default to 7 days before current time
to optional.Int64 Time range ending, default to current time
limit optional.Int32 Maximum number of records to be returned in a single list [default to 100]
offset optional.Int32 List offset, starting from 0 [default to 0]

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.RebateApi.AgencyTransactionHistory(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

[]AgencyTransactionHistory

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]

AgencyCommissionsHistory

[]AgencyCommissionHistory AgencyCommissionsHistory(ctx, optional)

The agency obtains the commission history of the recommended user

Record time range cannot exceed 30 days

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a AgencyCommissionsHistoryOpts struct

Name Type Description Notes
currency optional.String Filter by currency. Return all currency records if not specified
userId optional.Int64 User ID. If not specified, all user records will be returned
from optional.Int64 Time range beginning, default to 7 days before current time
to optional.Int64 Time range ending, default to current time
limit optional.Int32 Maximum number of records to be returned in a single list [default to 100]
offset optional.Int32 List offset, starting from 0 [default to 0]

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.RebateApi.AgencyCommissionsHistory(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

[]AgencyCommissionHistory

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]

RebateBrokerCommissionHistory

[]BrokerCommission RebateBrokerCommissionHistory(ctx, optional)

The broker obtains the user's commission rebate records

Record time range cannot exceed 30 days

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a RebateBrokerCommissionHistoryOpts struct

Name Type Description Notes
limit optional.Int32 Maximum number of records to be returned in a single list [default to 100]
offset optional.Int32 List offset, starting from 0 [default to 0]
userId optional.Int64 User ID. If not specified, all user records will be returned

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.RebateApi.RebateBrokerCommissionHistory(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

[]BrokerCommission

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]

RebateBrokerTransactionHistory

[]BrokerTransaction RebateBrokerTransactionHistory(ctx, optional)

The broker obtains the user's trading history

Record time range cannot exceed 30 days

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a RebateBrokerTransactionHistoryOpts struct

Name Type Description Notes
limit optional.Int32 Maximum number of records to be returned in a single list [default to 100]
offset optional.Int32 List offset, starting from 0 [default to 0]
userId optional.Int64 User ID. If not specified, all user records will be returned

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.RebateApi.RebateBrokerTransactionHistory(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

[]BrokerTransaction

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]

RebateUserInfo

[]RebateUserInfo RebateUserInfo(ctx, )

User retrieves rebate information

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.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.RebateUserInfo(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

[]RebateUserInfo

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]