Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 1.63 KB

README.md

File metadata and controls

67 lines (47 loc) · 1.63 KB

enclave-go

This is an unofficial Go SDK for Enclave Markets and the interface is subject to change.

It provides a simple interface for interacting with the spot market Enclave API.

Installation

go get github.com/Enclave-Markets/enclave-go

Usage

package main

import (
	"github.com/Enclave-Markets/enclave-go/apiclient"
)

func main() {

	client, err := apiclient.NewApiClientFromEnv("sandbox")
	if err != nil {
		return
	}

	client.WithApiKey(
		os.Getenv("ENCLAVE_KEY"),
		os.Getenv("ENCLAVE_SECRET"),
	)

	client.WaitForEndpoint()
	_, err = client.Hello()
	if err != nil {
		return
	}
}

Examples

An example of interacting with a spot market on Enclave's sandbox environment can be found in main.go and can be run using:

export ENCLAVE_KEY="YOUR_API_KEY"
export ENCLAVE_SECRET="YOUR_API_SECRET"
go run ./...

API keys for Enclave's sandbox environment can be found here by first connecting a wallet and then accessing account settings.

Support

Supports Go 1.22+