# WalletApi All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**ListCurrencyChains**](WalletApi.md#ListCurrencyChains) | **Get** /wallet/currency_chains | List chains supported for specified currency [**GetDepositAddress**](WalletApi.md#GetDepositAddress) | **Get** /wallet/deposit_address | Generate currency deposit address [**ListWithdrawals**](WalletApi.md#ListWithdrawals) | **Get** /wallet/withdrawals | Retrieve withdrawal records [**ListDeposits**](WalletApi.md#ListDeposits) | **Get** /wallet/deposits | Retrieve deposit records [**Transfer**](WalletApi.md#Transfer) | **Post** /wallet/transfers | Transfer between trading accounts [**ListSubAccountTransfers**](WalletApi.md#ListSubAccountTransfers) | **Get** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts [**TransferWithSubAccount**](WalletApi.md#TransferWithSubAccount) | **Post** /wallet/sub_account_transfers | Transfer between main and sub accounts [**SubAccountToSubAccount**](WalletApi.md#SubAccountToSubAccount) | **Post** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account [**ListWithdrawStatus**](WalletApi.md#ListWithdrawStatus) | **Get** /wallet/withdraw_status | Retrieve withdrawal status [**ListSubAccountBalances**](WalletApi.md#ListSubAccountBalances) | **Get** /wallet/sub_account_balances | Retrieve sub account balances [**ListSubAccountMarginBalances**](WalletApi.md#ListSubAccountMarginBalances) | **Get** /wallet/sub_account_margin_balances | Query sub accounts' margin balances [**ListSubAccountFuturesBalances**](WalletApi.md#ListSubAccountFuturesBalances) | **Get** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances [**ListSubAccountCrossMarginBalances**](WalletApi.md#ListSubAccountCrossMarginBalances) | **Get** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info [**ListSavedAddress**](WalletApi.md#ListSavedAddress) | **Get** /wallet/saved_address | Query saved address [**GetTradeFee**](WalletApi.md#GetTradeFee) | **Get** /wallet/fee | Retrieve personal trading fee [**GetTotalBalance**](WalletApi.md#GetTotalBalance) | **Get** /wallet/total_balance | Retrieve user's total balances [**ListSmallBalance**](WalletApi.md#ListSmallBalance) | **Get** /wallet/small_balance | List small balance [**ConvertSmallBalance**](WalletApi.md#ConvertSmallBalance) | **Post** /wallet/small_balance | Convert small balance [**ListSmallBalanceHistory**](WalletApi.md#ListSmallBalanceHistory) | **Get** /wallet/small_balance_history | List small balance history ## ListCurrencyChains > []CurrencyChain ListCurrencyChains(ctx, currency) List chains supported for specified currency ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **currency** | **string**| Currency name | ### Example ```golang 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() currency := "GT" // string - Currency name result, _, err := client.WalletApi.ListCurrencyChains(ctx, 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 [**[]CurrencyChain**](CurrencyChain.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetDepositAddress > DepositAddress GetDepositAddress(ctx, currency) Generate currency deposit address ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **currency** | **string**| Currency name | ### Example ```golang 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", } ) currency := "USDT" // string - Currency name result, _, err := client.WalletApi.GetDepositAddress(ctx, 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 [**DepositAddress**](DepositAddress.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListWithdrawals > []WithdrawalRecord ListWithdrawals(ctx, optional) Retrieve withdrawal 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** | **ListWithdrawalsOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListWithdrawalsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **optional.String**| Filter by currency. Return all currency records if not specified | **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 ```golang 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.WalletApi.ListWithdrawals(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 [**[]WithdrawalRecord**](WithdrawalRecord.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeposits > []LedgerRecord ListDeposits(ctx, optional) Retrieve deposit 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** | **ListDepositsOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDepositsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **optional.String**| Filter by currency. Return all currency records if not specified | **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**| The maximum number of entries returned in the list is limited to 500 transactions. | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] ### Example ```golang 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.WalletApi.ListDeposits(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 [**[]LedgerRecord**](LedgerRecord.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## Transfer > TransactionId Transfer(ctx, transfer) Transfer between trading accounts Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin 5. spot - options ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **transfer** | [**Transfer**](Transfer.md)| | ### Example ```golang 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", } ) transfer := gateapi.Transfer{} // Transfer - result, _, err := client.WalletApi.Transfer(ctx, transfer) 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 [**TransactionId**](TransactionID.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSubAccountTransfers > []SubAccountTransfer ListSubAccountTransfers(ctx, optional) Retrieve transfer records between main and sub accounts Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListSubAccountTransfersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSubAccountTransfersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **subUid** | **optional.String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | **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 ```golang 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.WalletApi.ListSubAccountTransfers(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 [**[]SubAccountTransfer**](SubAccountTransfer.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## TransferWithSubAccount > TransferWithSubAccount(ctx, subAccountTransfer) Transfer between main and sub accounts Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **subAccountTransfer** | [**SubAccountTransfer**](SubAccountTransfer.md)| | ### Example ```golang 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", } ) subAccountTransfer := gateapi.SubAccountTransfer{} // SubAccountTransfer - result, _, err := client.WalletApi.TransferWithSubAccount(ctx, subAccountTransfer) 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 (empty response body) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## SubAccountToSubAccount > SubAccountToSubAccount(ctx, subAccountToSubAccount) Sub-account transfers to sub-account It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **subAccountToSubAccount** | [**SubAccountToSubAccount**](SubAccountToSubAccount.md)| | ### Example ```golang 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", } ) subAccountToSubAccount := gateapi.SubAccountToSubAccount{} // SubAccountToSubAccount - result, _, err := client.WalletApi.SubAccountToSubAccount(ctx, subAccountToSubAccount) 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 (empty response body) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListWithdrawStatus > []WithdrawStatus ListWithdrawStatus(ctx, optional) Retrieve withdrawal status ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListWithdrawStatusOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListWithdrawStatusOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **optional.String**| Retrieve data of the specified currency | ### Example ```golang 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.WalletApi.ListWithdrawStatus(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 [**[]WithdrawStatus**](WithdrawStatus.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSubAccountBalances > []SubAccountBalance ListSubAccountBalances(ctx, optional) Retrieve sub account balances ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListSubAccountBalancesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSubAccountBalancesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **subUid** | **optional.String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | ### Example ```golang 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.WalletApi.ListSubAccountBalances(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 [**[]SubAccountBalance**](SubAccountBalance.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSubAccountMarginBalances > []SubAccountMarginBalance ListSubAccountMarginBalances(ctx, optional) Query sub accounts' margin balances ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListSubAccountMarginBalancesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSubAccountMarginBalancesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **subUid** | **optional.String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | ### Example ```golang 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.WalletApi.ListSubAccountMarginBalances(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 [**[]SubAccountMarginBalance**](SubAccountMarginBalance.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSubAccountFuturesBalances > []SubAccountFuturesBalance ListSubAccountFuturesBalances(ctx, optional) Query sub accounts' futures account balances ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListSubAccountFuturesBalancesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSubAccountFuturesBalancesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **subUid** | **optional.String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | **settle** | **optional.String**| Query only balances of specified settle currency | ### Example ```golang 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.WalletApi.ListSubAccountFuturesBalances(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 [**[]SubAccountFuturesBalance**](SubAccountFuturesBalance.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSubAccountCrossMarginBalances > []SubAccountCrossMarginBalance ListSubAccountCrossMarginBalances(ctx, optional) Query subaccount's cross_margin account info ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListSubAccountCrossMarginBalancesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSubAccountCrossMarginBalancesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **subUid** | **optional.String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | ### Example ```golang 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.WalletApi.ListSubAccountCrossMarginBalances(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 [**[]SubAccountCrossMarginBalance**](SubAccountCrossMarginBalance.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSavedAddress > []SavedAddress ListSavedAddress(ctx, currency, optional) Query saved address ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **currency** | **string**| Currency | **optional** | **ListSavedAddressOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSavedAddressOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **chain** | **optional.String**| Chain name | [default to ] **limit** | **optional.String**| Maximum number returned, 100 at most | [default to 50] **page** | **optional.Int32**| Page number | [default to 1] ### Example ```golang 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", } ) currency := "USDT" // string - Currency result, _, err := client.WalletApi.ListSavedAddress(ctx, currency, 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 [**[]SavedAddress**](SavedAddress.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetTradeFee > TradeFee GetTradeFee(ctx, optional) Retrieve personal trading fee ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **GetTradeFeeOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetTradeFeeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **optional.String**| Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs | **settle** | **optional.String**| Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. | ### Example ```golang 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.WalletApi.GetTradeFee(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 [**TradeFee**](TradeFee.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetTotalBalance > TotalBalance GetTotalBalance(ctx, optional) Retrieve user's total balances This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation. For trading calculation, use the corresponding account query endpoint for each account type. For example: - `GET /spot/accounts` to query spot account balance - `GET /margin/accounts` to query margin account balance - `GET /futures/{settle}/accounts` to query futures account balance ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **GetTotalBalanceOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetTotalBalanceOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **optional.String**| Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. | [default to USDT] ### Example ```golang 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.WalletApi.GetTotalBalance(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 [**TotalBalance**](TotalBalance.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSmallBalance > SmallBalance ListSmallBalance(ctx, ) List small balance ### Required Parameters ### Example ```golang 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.WalletApi.ListSmallBalance(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 [**SmallBalance**](SmallBalance.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ConvertSmallBalance > ConvertSmallBalance(ctx, convertSmallBalance) Convert small balance ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **convertSmallBalance** | [**ConvertSmallBalance**](ConvertSmallBalance.md)| | ### Example ```golang 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", } ) convertSmallBalance := gateapi.ConvertSmallBalance{} // ConvertSmallBalance - result, _, err := client.WalletApi.ConvertSmallBalance(ctx, convertSmallBalance) 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 (empty response body) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListSmallBalanceHistory > SmallBalanceHistory ListSmallBalanceHistory(ctx, optional) List small balance history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **optional** | **ListSmallBalanceHistoryOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListSmallBalanceHistoryOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **optional.String**| Currency | **page** | **optional.Int32**| Page number | [default to 1] **limit** | **optional.Int32**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [default to 100] ### Example ```golang 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.WalletApi.ListSmallBalanceHistory(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 [**SmallBalanceHistory**](SmallBalanceHistory.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)