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 |
LedgerRecord Withdraw(ctx, ledgerRecord)
Withdraw
If the recipient's on-chain address is also Gate, no transaction fee will be charged
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ledgerRecord | LedgerRecord |
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",
}
)
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)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UidPushWithdrawalResp WithdrawPushOrder(ctx, uidPushWithdrawal)
UID transfer
Transfers between main spot accounts. Both parties cannot be sub-accounts
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| uidPushWithdrawal | UidPushWithdrawal |
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",
}
)
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)
}
}- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LedgerRecord CancelWithdrawal(ctx, withdrawalId)
Cancel withdrawal with specified ID
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| withdrawalId | string |
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",
}
)
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)
}
}- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]