An open source sdk for Stocks.exchange written in Golang.
After you've configured your local Go package:
go get github.com/opencrypter/stocks-exchange-go
This SDK is based on the official stocks.exchange api docs
You only have to call the constructor function in order to use it:
package main
import "github.com/opencrypter/stocks-exchange-go"
func main() {
stocksExchange := stocks_exchange.New("Your-api-key", "Your secret api-key")
}
Get all available currencies with additional info.
package main
import "github.com/opencrypter/stocks-exchange-go"
func main() {
stocksExchange := stocks_exchange.New("Your-api-key", "Your secret api-key")
currencies, err := stocksExchange.GetCurrencies()
}
Get all available currency pairs with additional info.
package main
import "github.com/opencrypter/stocks-exchange-go"
func main() {
stocksExchange := stocks_exchange.New("Your-api-key", "Your secret api-key")
markets , err := stocksExchange.GetMarkets()
}
Get currency pair with additional info.
package main
import "github.com/opencrypter/stocks-exchange-go"
func main() {
stocksExchange := stocks_exchange.New("Your-api-key", "Your secret api-key")
query := stocks_exchange.NewGetMarketSummaryQuery("BSM", "BTC")
marketSummary , err := stocksExchange.GetMarketSummary(query)
}
Use it to get the recommended retail exchange rates for all currency pairs.
package main
import "github.com/opencrypter/stocks-exchange-go"
func main() {
stocksExchange := stocks_exchange.New("Your-api-key", "Your secret api-key")
tickers , err := stocksExchange.GetTickers()
}
Use it to get the new retail exchange rates for all currency pairs.
package main
import "github.com/opencrypter/stocks-exchange-go"
func main() {
stocksExchange := stocks_exchange.New("Your-api-key", "Your secret api-key")
prices, err := stocksExchange.GetPrices()
}
All is covered 100%. You can run all tests as normally you do it:
go test -test.v
MIT licensed. See the LICENSE file for details.