All URIs are relative to https://api.dev.cobo.com/v2
Method | HTTP request | Description |
---|---|---|
CheckAddressChainsValidity | Get /wallets/check_address_chains_validity | Check address validity across chains |
CheckAddressValidity | Get /wallets/check_address_validity | Check address validity |
CheckAddressesValidity | Get /wallets/check_addresses_validity | Check addresses validity |
CreateAddress | Post /wallets/{wallet_id}/addresses | Create addresses in wallet |
CreateWallet | Post /wallets | Create wallet |
DeleteWalletById | Post /wallets/{wallet_id}/delete | Delete wallet |
GetChainById | Get /wallets/chains/{chain_id} | Get chain information |
GetMaxTransferableValue | Get /wallets/{wallet_id}/max_transferable_value | Get maximum transferable value |
GetTokenById | Get /wallets/tokens/{token_id} | Get token information |
GetWalletById | Get /wallets/{wallet_id} | Get wallet information |
ListAddresses | Get /wallets/{wallet_id}/addresses | List wallet addresses |
ListEnabledChains | Get /wallets/enabled_chains | List enabled chains |
ListEnabledTokens | Get /wallets/enabled_tokens | List enabled tokens |
ListSupportedChains | Get /wallets/chains | List supported chains |
ListSupportedTokens | Get /wallets/tokens | List supported tokens |
ListTokenBalancesForAddress | Get /wallets/{wallet_id}/addresses/{address}/tokens | List token balances by address |
ListTokenBalancesForWallet | Get /wallets/{wallet_id}/tokens | List token balances by wallet |
ListUtxos | Get /wallets/{wallet_id}/utxos | List UTXOs |
ListWallets | Get /wallets | List all wallets |
LockUtxos | Post /wallets/{wallet_id}/utxos/lock | Lock UTXOs |
UnlockUtxos | Post /wallets/{wallet_id}/utxos/unlock | Unlock UTXOs |
UpdateWalletById | Put /wallets/{wallet_id} | Update wallet |
[]CheckAddressChainsValidity200ResponseInner CheckAddressChainsValidity(ctx).Address(address).ChainIds(chainIds).Execute()
Check address validity across 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() {
address := "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
chainIds := "BTC,ETH"
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.WalletsAPI.CheckAddressChainsValidity(ctx).Address(address).ChainIds(chainIds).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.CheckAddressChainsValidity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CheckAddressChainsValidity`: []CheckAddressChainsValidity200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.CheckAddressChainsValidity`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCheckAddressChainsValidityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
address | string | The wallet address. | |
chainIds | string | A list of chain IDs, separated by comma. The chain ID is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. |
[]CheckAddressChainsValidity200ResponseInner
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CheckAddressValidity200Response CheckAddressValidity(ctx).ChainId(chainId).Address(address).Execute()
Check address validity
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() {
chainId := "ETH"
address := "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
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.WalletsAPI.CheckAddressValidity(ctx).ChainId(chainId).Address(address).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.CheckAddressValidity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CheckAddressValidity`: CheckAddressValidity200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.CheckAddressValidity`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCheckAddressValidityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
chainId | string | The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. | |
address | string | The wallet address. |
CheckAddressValidity200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]CheckAddressesValidity200ResponseInner CheckAddressesValidity(ctx).ChainId(chainId).Addresses(addresses).Execute()
Check addresses validity
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() {
chainId := "ETH"
addresses := "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97"
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.WalletsAPI.CheckAddressesValidity(ctx).ChainId(chainId).Addresses(addresses).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.CheckAddressesValidity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CheckAddressesValidity`: []CheckAddressesValidity200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.CheckAddressesValidity`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCheckAddressesValidityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
chainId | string | The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. | |
addresses | string | A list of wallet addresses, separated by comma. You can specify a maximum of 100 addresses. |
[]CheckAddressesValidity200ResponseInner
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]AddressInfo CreateAddress(ctx, walletId).CreateAddressRequest(createAddressRequest).Execute()
Create addresses in wallet
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"
createAddressRequest := *coboWaas2.NewCreateAddressRequest("ETH", int32(1))
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.WalletsAPI.CreateAddress(ctx, walletId).CreateAddressRequest(createAddressRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.CreateAddress``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAddress`: []AddressInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.CreateAddress`: %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 apiCreateAddressRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
createAddressRequest | CreateAddressRequest | The request body to generates addresses within a specified wallet. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreatedWalletInfo CreateWallet(ctx).CreateWalletParams(createWalletParams).Execute()
Create wallet
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() {
createWalletParams := coboWaas2.CreateWalletParams{CreateCustodialWalletParams: coboWaas2.NewCreateCustodialWalletParams("My WaaS 2.0 Wallet", coboWaas2.WalletType("Custodial"), coboWaas2.WalletSubtype("Asset"))}
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.WalletsAPI.CreateWallet(ctx).CreateWalletParams(createWalletParams).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.CreateWallet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateWallet`: CreatedWalletInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.CreateWallet`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateWalletRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
createWalletParams | CreateWalletParams | The request body to create a wallet |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteWalletById201Response DeleteWalletById(ctx, walletId).Execute()
Delete wallet
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"
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.WalletsAPI.DeleteWalletById(ctx, walletId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.DeleteWalletById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteWalletById`: DeleteWalletById201Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.DeleteWalletById`: %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 apiDeleteWalletByIdRequest 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]
ChainInfo GetChainById(ctx, chainId).Execute()
Get chain information
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() {
chainId := "ETH"
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.WalletsAPI.GetChainById(ctx, chainId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.GetChainById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetChainById`: ChainInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.GetChainById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for ServerHost/Env, Signer, etc. | |
chainId | string | The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. |
Other parameters are passed through a pointer to a apiGetChainByIdRequest 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]
MaxTransferableValue GetMaxTransferableValue(ctx, walletId).TokenId(tokenId).FeeRate(feeRate).ToAddress(toAddress).FromAddress(fromAddress).Execute()
Get maximum transferable value
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"
tokenId := "ETH_USDT"
feeRate := "10"
toAddress := "2N2xFZtbCFB6Nb3Pj9Sxsx5mX2fxX3yEgkE"
fromAddress := "2N2xFZtbCFB6Nb3Pj9Sxsx5mX2fxX3yEgkE"
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.WalletsAPI.GetMaxTransferableValue(ctx, walletId).TokenId(tokenId).FeeRate(feeRate).ToAddress(toAddress).FromAddress(fromAddress).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.GetMaxTransferableValue``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMaxTransferableValue`: MaxTransferableValue
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.GetMaxTransferableValue`: %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 apiGetMaxTransferableValueRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
tokenId | string | The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens. | feeRate | string | The fee rate in sats/vByte or gas price in wei. | toAddress | string | The recipient's address. | fromAddress | string | The sender's address. For EVM addresses in MPC Wallets, this parameter is required. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExtendedTokenInfo GetTokenById(ctx, tokenId).Execute()
Get token information
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() {
tokenId := "ETH_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.WalletsAPI.GetTokenById(ctx, tokenId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.GetTokenById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTokenById`: ExtendedTokenInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.GetTokenById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for ServerHost/Env, Signer, etc. | |
tokenId | string | The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens. |
Other parameters are passed through a pointer to a apiGetTokenByIdRequest 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]
WalletInfo GetWalletById(ctx, walletId).Execute()
Get wallet information
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"
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.WalletsAPI.GetWalletById(ctx, walletId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.GetWalletById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetWalletById`: WalletInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.GetWalletById`: %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 apiGetWalletByIdRequest 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]
ListAddresses200Response ListAddresses(ctx, walletId).ChainIds(chainIds).Addresses(addresses).Limit(limit).Before(before).After(after).Execute()
List wallet addresses
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"
chainIds := "BTC,ETH"
addresses := "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97"
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.WalletsAPI.ListAddresses(ctx, walletId).ChainIds(chainIds).Addresses(addresses).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListAddresses``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAddresses`: ListAddresses200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListAddresses`: %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 apiListAddressesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
chainIds | string | A list of chain IDs, separated by comma. The chain ID is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. | addresses | string | A list of wallet addresses, separated by comma. For addresses requiring a memo, append the memo after the address using the '|' separator (e.g., "address|memo"). | 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. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSupportedChains200Response ListEnabledChains(ctx).WalletType(walletType).WalletSubtype(walletSubtype).Limit(limit).Before(before).After(after).Execute()
List enabled 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() {
walletType := coboWaas2.WalletType("Custodial")
walletSubtype := coboWaas2.WalletSubtype("Asset")
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.WalletsAPI.ListEnabledChains(ctx).WalletType(walletType).WalletSubtype(walletSubtype).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListEnabledChains``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListEnabledChains`: ListSupportedChains200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListEnabledChains`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListEnabledChainsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
walletType | WalletType | The wallet type. - `Custodial`: Custodial Wallets - `MPC`: MPC Wallets - `SmartContract`: Smart Contract Wallets - `Exchange`: Exchange Wallets | |
walletSubtype | WalletSubtype | The wallet subtype. - `Asset`: Custodial Wallets (Asset Wallets) - `Web3`: Custodial Wallets (Web3 Wallets) - `Main`: Exchange Wallets (Main Account) - `Sub`: Exchange Wallets (Sub Account) - `Org-Controlled`: MPC Wallets (Organization-Controlled Wallets) - `User-Controlled`: MPC Wallets (User-Controlled Wallets) - `Safe{Wallet}`: Smart Contract Wallets (Safe{Wallet}) | |
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. |
ListSupportedChains200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSupportedTokens200Response ListEnabledTokens(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ChainIds(chainIds).Limit(limit).Before(before).After(after).Execute()
List enabled tokens
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() {
walletType := coboWaas2.WalletType("Custodial")
walletSubtype := coboWaas2.WalletSubtype("Asset")
chainIds := "BTC,ETH"
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.WalletsAPI.ListEnabledTokens(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ChainIds(chainIds).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListEnabledTokens``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListEnabledTokens`: ListSupportedTokens200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListEnabledTokens`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListEnabledTokensRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
walletType | WalletType | The wallet type. - `Custodial`: Custodial Wallets - `MPC`: MPC Wallets - `SmartContract`: Smart Contract Wallets - `Exchange`: Exchange Wallets | |
walletSubtype | WalletSubtype | The wallet subtype. - `Asset`: Custodial Wallets (Asset Wallets) - `Web3`: Custodial Wallets (Web3 Wallets) - `Main`: Exchange Wallets (Main Account) - `Sub`: Exchange Wallets (Sub Account) - `Org-Controlled`: MPC Wallets (Organization-Controlled Wallets) - `User-Controlled`: MPC Wallets (User-Controlled Wallets) - `Safe{Wallet}`: Smart Contract Wallets (Safe{Wallet}) | |
chainIds | string | A list of chain IDs, separated by comma. The chain ID is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. | |
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. |
ListSupportedTokens200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSupportedChains200Response ListSupportedChains(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ChainIds(chainIds).Limit(limit).Before(before).After(after).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() {
walletType := coboWaas2.WalletType("Custodial")
walletSubtype := coboWaas2.WalletSubtype("Asset")
chainIds := "BTC,ETH"
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.WalletsAPI.ListSupportedChains(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ChainIds(chainIds).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListSupportedChains``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSupportedChains`: ListSupportedChains200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListSupportedChains`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListSupportedChainsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
walletType | WalletType | The wallet type. - `Custodial`: Custodial Wallets - `MPC`: MPC Wallets - `SmartContract`: Smart Contract Wallets - `Exchange`: Exchange Wallets | |
walletSubtype | WalletSubtype | The wallet subtype. - `Asset`: Custodial Wallets (Asset Wallets) - `Web3`: Custodial Wallets (Web3 Wallets) - `Main`: Exchange Wallets (Main Account) - `Sub`: Exchange Wallets (Sub Account) - `Org-Controlled`: MPC Wallets (Organization-Controlled Wallets) - `User-Controlled`: MPC Wallets (User-Controlled Wallets) - `Safe{Wallet}`: Smart Contract Wallets (Safe{Wallet}) | |
chainIds | string | A list of chain IDs, separated by comma. The chain ID is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. | |
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. |
ListSupportedChains200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSupportedTokens200Response ListSupportedTokens(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ChainIds(chainIds).TokenIds(tokenIds).Limit(limit).Before(before).After(after).Execute()
List supported tokens
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() {
walletType := coboWaas2.WalletType("Custodial")
walletSubtype := coboWaas2.WalletSubtype("Asset")
chainIds := "BTC,ETH"
tokenIds := "ETH_USDT,ETH_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.WalletsAPI.ListSupportedTokens(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ChainIds(chainIds).TokenIds(tokenIds).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListSupportedTokens``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSupportedTokens`: ListSupportedTokens200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListSupportedTokens`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListSupportedTokensRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
walletType | WalletType | The wallet type. - `Custodial`: Custodial Wallets - `MPC`: MPC Wallets - `SmartContract`: Smart Contract Wallets - `Exchange`: Exchange Wallets | |
walletSubtype | WalletSubtype | The wallet subtype. - `Asset`: Custodial Wallets (Asset Wallets) - `Web3`: Custodial Wallets (Web3 Wallets) - `Main`: Exchange Wallets (Main Account) - `Sub`: Exchange Wallets (Sub Account) - `Org-Controlled`: MPC Wallets (Organization-Controlled Wallets) - `User-Controlled`: MPC Wallets (User-Controlled Wallets) - `Safe{Wallet}`: Smart Contract Wallets (Safe{Wallet}) | |
chainIds | string | A list of chain IDs, separated by comma. The chain ID is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains. | |
tokenIds | string | A list of token IDs, separated by comma. The token ID is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens. | |
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. |
ListSupportedTokens200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListTokenBalancesForAddress200Response ListTokenBalancesForAddress(ctx, walletId, address).TokenIds(tokenIds).Limit(limit).Before(before).After(after).Execute()
List token balances by address
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"
address := "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
tokenIds := "ETH_USDT,ETH_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.WalletsAPI.ListTokenBalancesForAddress(ctx, walletId, address).TokenIds(tokenIds).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListTokenBalancesForAddress``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListTokenBalancesForAddress`: ListTokenBalancesForAddress200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListTokenBalancesForAddress`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for ServerHost/Env, Signer, etc. | |
walletId | string | The wallet ID. | |
address | string | The wallet address. |
Other parameters are passed through a pointer to a apiListTokenBalancesForAddressRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
tokenIds | string | A list of token IDs, separated by comma. The token ID is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens. | 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. |
ListTokenBalancesForAddress200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListTokenBalancesForAddress200Response ListTokenBalancesForWallet(ctx, walletId).TokenIds(tokenIds).Limit(limit).Before(before).After(after).Execute()
List token balances by wallet
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"
tokenIds := "ETH_USDT,ETH_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.WalletsAPI.ListTokenBalancesForWallet(ctx, walletId).TokenIds(tokenIds).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListTokenBalancesForWallet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListTokenBalancesForWallet`: ListTokenBalancesForAddress200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListTokenBalancesForWallet`: %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 apiListTokenBalancesForWalletRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
tokenIds | string | A list of token IDs, separated by comma. The token ID is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens. | 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. |
ListTokenBalancesForAddress200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUtxos200Response ListUtxos(ctx, walletId).TokenId(tokenId).Address(address).Limit(limit).Before(before).After(after).Execute()
List UTXOs
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"
tokenId := "ETH_USDT"
address := "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
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.WalletsAPI.ListUtxos(ctx, walletId).TokenId(tokenId).Address(address).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListUtxos``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListUtxos`: ListUtxos200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListUtxos`: %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 apiListUtxosRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
tokenId | string | The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens. | address | string | The wallet address. | 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. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListWallets200Response ListWallets(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ProjectId(projectId).VaultId(vaultId).Limit(limit).Before(before).After(after).Execute()
List all wallets
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() {
walletType := coboWaas2.WalletType("Custodial")
walletSubtype := coboWaas2.WalletSubtype("Asset")
projectId := "f47ac10b-58cc-4372-a567-0e02b2c3d479"
vaultId := "f47ac10b-58cc-4372-a567-0e02b2c3d479"
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.WalletsAPI.ListWallets(ctx).WalletType(walletType).WalletSubtype(walletSubtype).ProjectId(projectId).VaultId(vaultId).Limit(limit).Before(before).After(after).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.ListWallets``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListWallets`: ListWallets200Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.ListWallets`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListWalletsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
walletType | WalletType | The wallet type. - `Custodial`: Custodial Wallets - `MPC`: MPC Wallets - `SmartContract`: Smart Contract Wallets - `Exchange`: Exchange Wallets | |
walletSubtype | WalletSubtype | The wallet subtype. - `Asset`: Custodial Wallets (Asset Wallets) - `Web3`: Custodial Wallets (Web3 Wallets) - `Main`: Exchange Wallets (Main Account) - `Sub`: Exchange Wallets (Sub Account) - `Org-Controlled`: MPC Wallets (Organization-Controlled Wallets) - `User-Controlled`: MPC Wallets (User-Controlled Wallets) - `Safe{Wallet}`: Smart Contract Wallets (Safe{Wallet}) | |
projectId | string | The project ID, which you can retrieve by calling List all projects. | |
vaultId | string | The vault ID, which you can retrieve by calling List all vaults. | |
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. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LockUtxos201Response LockUtxos(ctx, walletId).LockUtxosRequest(lockUtxosRequest).Execute()
Lock UTXOs
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"
lockUtxosRequest := *coboWaas2.NewLockUtxosRequest([]coboWaas2.LockUtxosRequestUtxosInner{*coboWaas2.NewLockUtxosRequestUtxosInner("BTC", "9bdf8e7ae03c237e115f09543fbdb40f8efa600106e78b67ce4d5adfadda2dbb", int32(0))})
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.WalletsAPI.LockUtxos(ctx, walletId).LockUtxosRequest(lockUtxosRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.LockUtxos``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `LockUtxos`: LockUtxos201Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.LockUtxos`: %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 apiLockUtxosRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
lockUtxosRequest | LockUtxosRequest | The request body of the Lock/Unlock UTXOs operation. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LockUtxos201Response UnlockUtxos(ctx, walletId).LockUtxosRequest(lockUtxosRequest).Execute()
Unlock UTXOs
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"
lockUtxosRequest := *coboWaas2.NewLockUtxosRequest([]coboWaas2.LockUtxosRequestUtxosInner{*coboWaas2.NewLockUtxosRequestUtxosInner("BTC", "9bdf8e7ae03c237e115f09543fbdb40f8efa600106e78b67ce4d5adfadda2dbb", int32(0))})
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.WalletsAPI.UnlockUtxos(ctx, walletId).LockUtxosRequest(lockUtxosRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.UnlockUtxos``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UnlockUtxos`: LockUtxos201Response
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.UnlockUtxos`: %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 apiUnlockUtxosRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
lockUtxosRequest | LockUtxosRequest | The request body of the Lock/Unlock UTXOs operation. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WalletInfo UpdateWalletById(ctx, walletId).UpdateWalletParams(updateWalletParams).Execute()
Update wallet
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"
updateWalletParams := coboWaas2.UpdateWalletParams{UpdateCustodialWalletParams: coboWaas2.NewUpdateCustodialWalletParams(coboWaas2.WalletType("Custodial"))}
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.WalletsAPI.UpdateWalletById(ctx, walletId).UpdateWalletParams(updateWalletParams).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `WalletsAPI.UpdateWalletById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateWalletById`: WalletInfo
fmt.Fprintf(os.Stdout, "Response from `WalletsAPI.UpdateWalletById`: %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 apiUpdateWalletByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateWalletParams | UpdateWalletParams | The request body. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]