Go Language

ShapeShift API in Golang


Using Shapeshift, you can convert your cryptocurrencies into a different crypto with ease.

First download the Shapeshift package.

1
go get -u github.com/hunterlong/shapeshift

Converting ETHEREUM to BITCOIN is pretty simple, the response includes everything you need to send ethereum.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
 
import (
	"github.com/hunterlong/shapeshift"
	"fmt"
)
 
func main() {
 
	new := shapeshift.New{
		Pair: "eth_btc",
		ToAddress: "16FdfRFVPUwiKAceRSqgEfn1tmB4sVUmLh",
	}
 
	response, err := new.Shift()
 
	if err != nil {
		panic(err)
	}
 
	sendToAddress := response.SendTo
	// i will send Ether to this address
 
	fmt.Println("Send To Address: ", sendToAddress)
	fmt.Println("Send Type: ", response.SendType)
	fmt.Println("Receiving at Address: ", response.ReturnTo)
	fmt.Println("Receiving Type: ", response.ReturnType)
	fmt.Println("Send Type: ", response.SendType)
	fmt.Println("API Key: ", response.ApiKey)
	fmt.Println("Public Data: ", response.Public)
	fmt.Println("XrpDestTag: ", response.XrpDestTag)
 
}

View Comments
There are currently no comments.