lnd

package module
v0.0.0-...-3cb4d20 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Unlicense Imports: 10 Imported by: 0

README

Go-lnd

Just a simple library that calls LND API and returns a Json.

Donate Donate

package main

import (
  "github.com/lukedevj/go-lnd"
  "fmt"
)

func main() {
    client := lnd.Client{
      Host:     "127.0.0.1:8080",
      Cert:     "/home/dev/.lnd/tls.cert",
      Macaroon: "/home/dev/.lnd/chain/bitcoin/mainnet/invoices.macaroon",
    }
    invoice, _ := client.CreateInvoice(1, "Hello, word")
    fmt.Println(invoice)
    
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host     string `json:"Host"`
	Cert     string `json:"Cert"`
	Macaroon string `json:"Macaroon"`
}

func (Client) BaseURL

func (c Client) BaseURL() string

func (Client) Call

func (c Client) Call(method string, path string, body map[string]interface{}) (gjson.Result, error)

func (Client) CancelInvoice

func (c Client) CancelInvoice(hash []byte) (gjson.Result, error)

func (*Client) ConfigFile

func (c *Client) ConfigFile(path string)

func (Client) CreateHoldInvoice

func (c Client) CreateHoldInvoice(value int, hash []byte, memo string) (gjson.Result, error)

func (Client) CreateInvoice

func (c Client) CreateInvoice(value int, memo string) (gjson.Result, error)

func (Client) DecodeInvoice

func (c Client) DecodeInvoice(invoice string) (gjson.Result, error)

func (Client) GetMacaroon

func (c Client) GetMacaroon() string

func (Client) GetTlsCert

func (c Client) GetTlsCert() []byte

func (Client) ListInvoices

func (c Client) ListInvoices() (gjson.Result, error)

func (Client) LookupInvoice

func (c Client) LookupInvoice(hash string) (gjson.Result, error)

func (Client) PayInvoice

func (c Client) PayInvoice(invoice string, timeout int32) (gjson.Result, error)

func (Client) SettleInvoice

func (c Client) SettleInvoice(preimage []byte) (gjson.Result, error)

Jump to

Keyboard shortcuts

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