Skip to content

Latest commit

 

History

History
221 lines (159 loc) · 6.01 KB

WithdrawalApi.md

File metadata and controls

221 lines (159 loc) · 6.01 KB

WithdrawalApi

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

Method HTTP request Description
Withdraw Post /withdrawals Withdraw
WithdrawPushOrder Post /withdrawals/push UID transfer
CancelWithdrawal Delete /withdrawals/{withdrawal_id} Cancel withdrawal with specified ID

Withdraw

LedgerRecord Withdraw(ctx, ledgerRecord)

Withdraw

Withdrawals to Gate addresses do not incur transaction fees.

Required Parameters

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

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",
                             }
                            )
    ledgerRecord := gateapi.LedgerRecord{} // LedgerRecord - 
    
    result, _, err := client.WithdrawalApi.Withdraw(ctx, ledgerRecord)
    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

LedgerRecord

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]

WithdrawPushOrder

UidPushWithdrawalResp WithdrawPushOrder(ctx, uidPushWithdrawal)

UID transfer

Transfers between main spot accounts are allowed; however, both parties cannot be sub-accounts

Required Parameters

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

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",
                             }
                            )
    uidPushWithdrawal := gateapi.UidPushWithdrawal{} // UidPushWithdrawal - 
    
    result, _, err := client.WithdrawalApi.WithdrawPushOrder(ctx, uidPushWithdrawal)
    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

UidPushWithdrawalResp

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]

CancelWithdrawal

LedgerRecord CancelWithdrawal(ctx, withdrawalId)

Cancel withdrawal with specified ID

Required Parameters

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

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",
                             }
                            )
    withdrawalId := "210496" // string - 
    
    result, _, err := client.WithdrawalApi.CancelWithdrawal(ctx, withdrawalId)
    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

LedgerRecord

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]