Skip to content

go-sideshiftai-client is a client written in go for the service at https://sideshift.ai.

License

Notifications You must be signed in to change notification settings

omani/go-sideshiftai-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO SIDESHIFT.AI Client

GoDoc

Logo

A client implementation for the sideshift.ai service written in go.

Installation

go get -u github.com/omani/go-sideshiftai-client

Example code:

package main

import (
	"log"

	"github.com/davecgh/go-spew/spew"
	"github.com/omani/go-sideshiftai-client"
)

func main() {
	client := sideshiftai.New(sideshiftai.Config{})

	pair, err := client.GetFetchPairs("btc/xmr")
	if err != nil {
		panic(err)
	}

	log.Printf("Min: %s - Max: %s - Rate: %s\n", pair.Min, pair.Max, pair.Rate)

	// Now create a variable (variable rate) order with that pair
	order, err := client.PostCreateVariableOrders(&sideshiftai.RequestVariableOrders{
		Type:            "variable",
		DepositMethodId: "btc",
		SettleMethodId:  "xmr",
		SettleAddress:   "89woiq9b5byQ89SsUL4Bd66MNfReBrTwNEDk9GoacgESjfiGnLSZjTD5x7CcUZba4PBbE3gUJRQyLWD4Akz8554DR4Lcyoj", // random monero address for testing purposes.
		RefundAddress:   "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX",                                                              // random BTC address from blockexplorer for testing purposes.
	})
	if err != nil {
		panic(err)
	}
	spew.Dump(order)

	// check our order if filled (after we paid to the DepositAddress in the response or order)
	spew.Dump(client.GetFetchOrders(order.ID))
}

Run the example code

cd cmd
go run main.go

Contribution

  • You can fork this, extend it and contribute back.
  • You can contribute with pull requests.

Donations

I love Monero (XMR) and building applications for and on top of Monero.

You can make me happy by donating Monero to the following address:

89woiq9b5byQ89SsUL4Bd66MNfReBrTwNEDk9GoacgESjfiGnLSZjTD5x7CcUZba4PBbE3gUJRQyLWD4Akz8554DR4Lcyoj

LICENSE

MIT License

About

go-sideshiftai-client is a client written in go for the service at https://sideshift.ai.

Topics

Resources

License

Stars

Watchers

Forks

Languages