This repository contains the official Go SDK for Cobo WaaS API, enabling developers to integrate with Cobo's Custodial and/or MPC services seamlessly using the Go programming language.
To access the API documentation, navigate to the API references.
For more information on Cobo's Go SDK, refer to the Go SDK Guide.
Ensure that you have created an account and configured Cobo's Custodial and/or MPC services. For detailed instructions, please refer to the Quickstart guide.
Go 1.18 or newer.
add dependency
go get github.com/CoboGlobal/cobo-go-api@v0.62.0
import "github.com/CoboGlobal/cobo-go-api/cobo_custody"
apiSecret, apiKey := cobo_custody.GenerateKeyPair()
println("API_SECRET:", apiSecret)
println("API_KEY:", apiKey)
For more information on the API key, please click here.
ApiSigner
can be instantiated through
import "github.com/CoboGlobal/cobo-go-api/cobo_custody"
var localSigner = cobo_custody.LocalSigner{
PrivateKey: "apiSecret",
}
In some cases, your private key cannot be exported, for example, your private key is in aws kms, you should pass in your own implementation by implements ApiSigner
interface
import "github.com/CoboGlobal/cobo-go-api/cobo_custody"
var client = cobo_custody.Client{
Signer: localSigner,
Env: cobo_custody.Dev(),
}
import (
"fmt"
"github.com/CoboGlobal/cobo-go-api/cobo_custody"
)
apiSecret, apiKey := cobo_custody.GenerateKeyPair()
fmt.Println("API_SECRET:", apiSecret)
fmt.Println("API_KEY:", apiKey)
var localSigner = cobo_custody.LocalSigner{
PrivateKey: apiSecret,
}
var client = cobo_custody.Client{
Signer: localSigner,
Env: cobo_custody.Dev(),
}
var res, error_msg = client.GetAccountInfo()
fmt.Println(res)
fmt.Println(error_msg)