Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 2.13 KB

README.md

File metadata and controls

62 lines (44 loc) · 2.13 KB

GitHub license Language: Go Donate Bitcoin Donate Ethereum

API wrapper for the Gemini Exchange REST API

Gemini-api is a wrapper for the Gemini Exchange REST API https://docs.gemini.com/rest-api/ it can connect to the production site https://api.gemini.com or to the Sandbox site https://api.sandbox.gemini.com for testing purposes.

This package is based on the https://github.com/jsgoyette/gemini, I have rewritten many things, added some more functionalities, debug & trace logging but I haven't had time to fully test everything, it is working fine for me but use it at your own risk.

gemini_cli

This package is used by the gemini_cli https://github.com/claudiocandio/gemini_cli a cli command to facilitate the use of the Gemini Exchange via REST API.

Usage Example

$ go get github.com/claudiocandio/gemini-api

Simple example:

package main

import (
 "encoding/json"
 "fmt"

 "github.com/claudiocandio/gemini-api"
)

func main() {

 api := gemini.New(
  false, // if this is false, it will use Gemini Sandox site: <https://api.sandbox.gemini.com>
         // if this is true,  it will use Gemini Production site: <https://api.gemini.com>
  "MyGeminiApiKey",    // GEMINI_API_KEY
  "MyGeminiApiSecret", // GEMINI_API_SECRET
 )

 // check more api methods in private.go & public.go
 accountDetail, err := api.AccountDetail()
 if err != nil {
  fmt.Printf("Error AccountDetail: %s\n", err)
  return
 }
 j, err := json.MarshalIndent(&accountDetail, "", " ")
 if err != nil {
  fmt.Printf("Error MarshalIndent: %s\n", err)
 }

 fmt.Printf("%s", j)
}

Check more api methods in private.go & public.go

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.