Overview
This guide introduces how to get started with using the Cobo WaaS 2.0 Go SDK, which allows you to integrate the WaaS service into your existing application using the Go programming language. To learn more about the initial setup steps necessary for utilizing the WaaS API, see Send your first request. You can go to GitHub to access the source code of the SDK.Prerequisites
- You have installed Go 1.18 or newer.
- Follow the instructions in Set up your account and organization to set up your Cobo account and create your organization. If an organization has already been set up, ask your organization admin to invite you to join the organization.
- You have generated an API key and an API secret, and registered the API key on Cobo Portal.
Install the SDK
- Create a Go project if you haven’t.
-
In the
go.mod
file of your project, add the following line:Replace {VERSION} with the lastest version number, for example,v1.2.0
. Obtain the latest version number from the GitHub repository. -
Run the
go mod tidy
command in a terminal or in your IDE to install the dependencies. -
In your
main.go
file, import the WaaS SDK as follows:
Configure API key and HTTP host
In the main function in yourmain.go
file, configure the HTTP host by selecting the environment and provide your API secret.
The following code snippet shows the configuration for the development environment.
Sample code
For operation-specific documentation and sample code, see the docs folder in the WaaS SDK GitHub repository.List supported chains
Create a wallet
Feel free to share your feedback to improve our documentation!