This repository is originally forked from repository is https://codecov.io/gh/matn/go-nowpayments This is an unofficial Go library for the crypto NOWPayments API
$ go get github.com/CIDgravity/[email protected]
Just load the config with all the credentials from a file or using a Reader
then display the NOWPayments' API status and the last 2 payments
made with:
package main
import (
"fmt"
"log"
"strings"
"github.com/CIDgravity/go-nowpayments/config"
"github.com/CIDgravity/go-nowpayments/core"
"github.com/CIDgravity/go-nowpayments/payments"
)
func main() {
err := config.Load(strings.NewReader(`
{
"server": "https://api-sandbox.nowpayments.io/v1",
"login": "[email protected]",
"password": "some_password",
"apiKey": "some_api_key"
}
`))
if err != nil {
log.Fatal(err)
}
core.UseBaseURL(core.BaseURL(config.Server()))
core.UseClient(core.NewHTTPClient())
ps, err := payments.List(&payments.ListOption{
Limit: 2,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Last %d payments: %v\n", limit, ps)
}
The CLI tool has not been updated and is not maintained in this repository To use it, you can do it from the original repository https://codecov.io/gh/matn/go-nowpayments