Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coboglobal/cobo-go-api
Cobo Custody Golang SDK
https://github.com/coboglobal/cobo-go-api
bitcoin blockchain cryptocurrency custody
Last synced: 3 days ago
JSON representation
Cobo Custody Golang SDK
- Host: GitHub
- URL: https://github.com/coboglobal/cobo-go-api
- Owner: CoboGlobal
- License: gpl-2.0
- Created: 2021-06-22T10:14:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-15T10:04:37.000Z (4 months ago)
- Last Synced: 2024-08-13T12:36:23.529Z (3 months ago)
- Topics: bitcoin, blockchain, cryptocurrency, custody
- Language: Go
- Homepage: https://cobo.com/custody
- Size: 306 KB
- Stars: 6
- Watchers: 1
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# The Official Go SDK for Cobo WaaS API
[![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[![GitHub Release](https://img.shields.io/github/release/CoboGlobal/cobo-go-api.svg?style=flat)]()## About
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.## Documentation
To access the API documentation, navigate to
the [API references](https://www.cobo.com/developers/api-references/overview/).For more information on Cobo's Go SDK, refer to
the [Go SDK Guide](https://www.cobo.com/developers/sdks-and-tools/sdks/waas/go).## Usage
### Before You Begin
Ensure that you have created an account and configured Cobo's Custodial and/or MPC services.
For detailed instructions, please refer to
the [Quickstart](https://www.cobo.com/developers/get-started/overview/quickstart) guide.### Requirements
Go 1.18 or newer.
### Installation
add dependency
```sh
go get github.com/CoboGlobal/[email protected]
```### Code Sample
#### Generate Key Pair
```go
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](https://www.cobo.com/developers/api-references/overview/authentication).
#### Initialize ApiSigner
`ApiSigner` can be instantiated through
```go
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
#### Initialize RestClient
```go
import "github.com/CoboGlobal/cobo-go-api/cobo_custody"
var client = cobo_custody.Client{
Signer: localSigner,
Env: cobo_custody.Dev(),
}
```#### Complete Code Sample
```Go
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)```