thor

package
Version: v0.0.0-...-d238806 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2019 License: GPL-2.0, GPL-3.0 Imports: 8 Imported by: 0

README

Thor

Thor is a service implemented by Bitrefill which allows users to purchase lightning channels with onchain btc, ltc eth, dash and doge. This is a package which implements the Thor API in go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKey = "" // send an email out to support@bitrefill.com for the API key
View Source
var APISecret = "" // send an email out to support@bitrefill.com for the API key

Functions

func GetRequest

func GetRequest(url string) ([]byte, error)

GetRequest is a handler that makes it easy to send out GET requests we don't set timeouts here because block times can be variable and a single request can sometimes take a long while to complete

func PostRequest

func PostRequest(body string, payload io.Reader) ([]byte, error)

PostRequest is a handler that makes it easy to send out POST requests

func PutRequest

func PutRequest(body string, payload io.Reader) ([]byte, error)

PutRequest is a handler that makes it easy to send out PUT requests

func SetAPIParams

func SetAPIParams(key string, secret string)

Types

type GetLnChannelInventoryReturn

type GetLnChannelInventoryReturn struct {
	Operator struct {
		Name     string `json:"name"`
		Slug     string `json:"slug"`
		Currency string `json:"currency"`
		Packages []struct {
			Value        string `json:"value"`
			EuroPrice    string `json:"eurprice"`
			SatoshiPrice string `json:"satoshiPrice"`
			USDPrice     string `json:"usdPrice"`
			UserPrice    string `json:"userPrice"`
		} `json:"packages"`
	} `json:"operator"`
}

func GetLnChannelInventory

func GetLnChannelInventory() (GetLnChannelInventoryReturn, error)

func GetTurboLnChannelInventory

func GetTurboLnChannelInventory() (GetLnChannelInventoryReturn, error)

type ThorOrderReturn

type ThorOrderReturn struct {
	Id             string `json:"id"`
	Email          string `json:"email"`
	Expired        bool   `json:"expired"`
	Value          string `json:"value"`
	Product        string `json:"product"`
	Price          int64  `json:"price"`
	PartialPayment bool   `json:"partialPayment"`
	UserRef        string `json:"userRef"`
	Status         string `json:"status"`
	Payment        struct {
		Address          string `json:"address"`
		LightningInvoice string `json:"lightningInvoice"`
		SatoshiPrice     string `json:"satoshiPrice"`
		AltcoinCode      string `json:"altcoinCode"`
	} `json:"payment"`
	ThorInfo struct {
		Link  string `json:"link"`
		K1    string `json:"k1"`
		LnURL string `json:"lnurl"`
		Other string `json:"other"`
	} `json:"thorInfo"`
}

func GetOrderId

func GetOrderId(orderId string) (ThorOrderReturn, error)

func PostOrder

func PostOrder(paymentMode string, sendEmail string, email string) (ThorOrderReturn, error)

func PostPurchase

func PostPurchase(paymentMode string, sendEmail string, email string) (ThorOrderReturn, error)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL