Golang wrapper to access Tauros REST API endpoints
- Create an account at https://tauros.io (or https://staging.tauros.io for sandbox environment), verify email and phone
- Go to Perfil de Usuario>General
- Activate "Modo desarollador" with the toggle. It will ask for your account password
- The API option will appear on the left side bar, click on it.
- Click "Crear API key"
- Enter any name for "Nombre del Token", click all the checkboxes except "Verificar IPs"
- Click "Crear API key", a modal will appear showing the API Key and API secret. This is what you will copy and paste in the json file as explained below.
To run create a json file tokens.json
like this
{
"email" : "[email of account]",
"api_key" : "[api key from tauros]",
"api_secret" : "[api secret from tauros]",
"URL": "[https://api.staging.tauros.io] (sandbox) OR [https://api.tauros.io] (live)"
}
import (
"encoding/json"
"io/ioutil"
"log"
"github.com/99Percent/gotauros"
)
// declare tauros object
var tauros TauApi
// get API credentials from token json file
in, err := ioutil.ReadFile("tokens.json")
if err != nil {
log.Fatalf("Unable to load tokens file tokens.json: %v", err)
}
if err := json.Unmarshal(in, &tauros); err != nil {
log.Fatalf("Unable to unmarshall tokens file: %v", err)
}
// use tauros object
coins, _ := tauros.Getcoins()
log.Printf("Available coins: %v",coins)