Skip to content

alimogh/go-southxchange

 
 

Repository files navigation

go-southxchange

go-southxchange is an implementation of the SouthXchange API (public and private) in Golang.

Import

import "github.com/bitbandi/go-southxchange"

Usage

In order to use the client with go's default http client settings you can do:

package main

import (
	"fmt"
	"github.com/bitbandi/go-southxchange"
)

const (
	API_KEY    = "YOUR_API_KEY"
	API_SECRET = "YOUR_API_SECRET"
)

func main() {
	// southxchange client
	southxchange := southxchange.New(API_KEY, API_SECRET, "user-agent")

	// Get balances
	balances, err := southxchange.GetBalances()
	fmt.Println(err, balances)
}

In order to use custom settings for the http client do:

package main

import (
	"fmt"
	"net/http"
	"time"
	"github.com/bitbandi/go-southxchange"
)

const (
	API_KEY    = "YOUR_API_KEY"
	API_SECRET = "YOUR_API_SECRET"
)

func main() {
	httpClient := &http.Client{
		Timeout: time.Second * 10,
	}

	// southxchange client
	bc := southxchange.NewWithCustomHttpClient(API_KEY, API_SECRET, "user-agent", httpClient)

	// Get balances
	balances, err := southxchange.GetBalances()
	fmt.Println(err, balances)
}

See "Examples" folder for more... examples

About

SouthXchange API in Golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%