All URIs are relative to https://api.dev.cobo.com/v2
Method | HTTP request | Description |
---|---|---|
ListAssetBalancesForExchangeWallet | Get /wallets/{wallet_id}/exchanges/assets | List asset balances |
ListExchanges | Get /wallets/exchanges | List supported exchanges |
ListSupportedAssetsForExchange | Get /wallets/exchanges/{exchange_id}/assets | List supported assets |
ListSupportedChainsForExchange | Get /wallets/exchanges/{exchange_id}/assets/{asset_id}/chains | List supported chains |
ListAssetBalancesForExchangeWallet200Response ListAssetBalancesForExchangeWallet(ctx, walletId).TradingAccountTypes(tradingAccountTypes).AssetIds(assetIds).Limit(limit).Before(before).After(after).Execute()
List asset balances
package main
import (
"context"
"fmt"
"os"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
)
func main() {
walletId := "f47ac10b-58cc-4372-a567-0e02b2c3d479"
tradingAccountTypes := "Trading,Funding"
assetIds := "USDT,USDC"
limit := int32(10)
before := "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1"
after := "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.WalletsExchangeWalletAPI.ListAssetBalancesForExchangeWallet(ctx, walletId).TradingAccountTypes(tradingAccountTypes).AssetIds(assetIds).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsExchangeWalletAPI.ListAssetBalancesForExchangeWallet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAssetBalancesForExchangeWallet`: ListAssetBalancesForExchangeWallet200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsExchangeWalletAPI.ListAssetBalancesForExchangeWallet`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for ServerHost/Env, Signer, etc. | |
walletId | string | The wallet ID. |
Other parameters are passed through a pointer to a apiListAssetBalancesForExchangeWalletRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
tradingAccountTypes | string | A list of trading account types, separated by comma. You can get the the supported trading account types of an exchange by calling List supported exchanges. | assetIds | string | (This concept applies to Exchange Wallets only) A list of asset IDs, separated by comma. An asset ID is the unique identifier of the asset held within your linked exchange account. | limit | int32 | The maximum number of objects to return. For most operations, the value range is [1, 50]. | [default to 10] before | string | This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. Notes: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned. | after | string | This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. Notes: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. |
ListAssetBalancesForExchangeWallet200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ListExchanges200ResponseInner ListExchanges(ctx).Execute()
List supported exchanges
package main
import (
"context"
"fmt"
"os"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
)
func main() {
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.WalletsExchangeWalletAPI.ListExchanges(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsExchangeWalletAPI.ListExchanges``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListExchanges`: []ListExchanges200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `WalletsExchangeWalletAPI.ListExchanges`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListExchangesRequest struct via the builder pattern
[]ListExchanges200ResponseInner
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSupportedAssetsForExchange200Response ListSupportedAssetsForExchange(ctx, exchangeId).Limit(limit).Before(before).After(after).Execute()
List supported assets
package main
import (
"context"
"fmt"
"os"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
)
func main() {
exchangeId := coboWaas2.ExchangeId("binance")
limit := int32(10)
before := "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1"
after := "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.WalletsExchangeWalletAPI.ListSupportedAssetsForExchange(ctx, exchangeId).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsExchangeWalletAPI.ListSupportedAssetsForExchange``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSupportedAssetsForExchange`: ListSupportedAssetsForExchange200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsExchangeWalletAPI.ListSupportedAssetsForExchange`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for ServerHost/Env, Signer, etc. | |
exchangeId | ExchangeId | The ID of the exchange. Possible values include: - `binance`: Binance. - `okx`: OKX. - `deribit`: Deribit. - `bybit`: Bybit. - `gate`: Gate.io - `bitget`: Bitget - `bitmart`: BitMart - `bitfinex`: Bitfinex |
Other parameters are passed through a pointer to a apiListSupportedAssetsForExchangeRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | The maximum number of objects to return. For most operations, the value range is [1, 50]. | [default to 10] before | string | This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. Notes: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned. | after | string | This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. Notes: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. |
ListSupportedAssetsForExchange200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ChainInfo ListSupportedChainsForExchange(ctx, exchangeId, assetId).Execute()
List supported chains
package main
import (
"context"
"fmt"
"os"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
)
func main() {
exchangeId := coboWaas2.ExchangeId("binance")
assetId := "USDT"
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.WalletsExchangeWalletAPI.ListSupportedChainsForExchange(ctx, exchangeId, assetId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsExchangeWalletAPI.ListSupportedChainsForExchange``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSupportedChainsForExchange`: []ChainInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsExchangeWalletAPI.ListSupportedChainsForExchange`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for ServerHost/Env, Signer, etc. | |
exchangeId | ExchangeId | The ID of the exchange. Possible values include: - `binance`: Binance. - `okx`: OKX. - `deribit`: Deribit. - `bybit`: Bybit. - `gate`: Gate.io - `bitget`: Bitget - `bitmart`: BitMart - `bitfinex`: Bitfinex | |
assetId | string | (This concept applies to Exchange Wallets only) The asset ID. An asset ID is the unique identifier of the asset held within your linked exchange account. You can get the ID of the assets supported by an exchanges by calling List supported assets. |
Other parameters are passed through a pointer to a apiListSupportedChainsForExchangeRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]