Documentation ¶
Index ¶
- Constants
- Variables
- type Channel
- type Client
- func (ln *Client) Call(method string, params ...interface{}) (gjson.Result, error)
- func (ln *Client) CallMessage(timeout time.Duration, message JSONRPCMessage) (gjson.Result, error)
- func (ln *Client) CallMessageRaw(timeout time.Duration, message JSONRPCMessage) ([]byte, error)
- func (ln *Client) CallNamed(method string, params ...interface{}) (gjson.Result, error)
- func (ln *Client) CallNamedWithCustomTimeout(timeout time.Duration, method string, params ...interface{}) (res gjson.Result, err error)
- func (ln *Client) CallWithCustomTimeout(timeout time.Duration, method string, params ...interface{}) (gjson.Result, error)
- func (ln *Client) GetCustomBytes(index byte, label string) (b []byte, err error)
- func (ln *Client) GetCustomKey(index byte, label string) (sk *btcec.PrivateKey, err error)
- func (ln *Client) GetPath(id string, msatoshi int64, fromid string, exclude []string, maxhops int, ...) (path []*Channel, err error)
- func (ln *Client) GetPrivateKey() (sk *btcec.PrivateKey, err error)
- func (ln *Client) GetRoute(id string, msatoshi int64, riskfactor int64, cltv int64, fromid string, ...) (route []RouteHop, err error)
- func (ln *Client) InvoiceWithDescriptionHash(label string, msatoshi int64, descriptionHash []byte, ppreimage *[]byte, ...) (bolt11 string, err error)
- func (ln *Client) InvoiceWithShadowRoute(msatoshi int64, descriptionOrHash interface{}, ppreimage *[]byte, ...) (bolt11 string, paymentHash string, err error)
- func (ln *Client) ListenForInvoices()
- func (ln *Client) TranslateInvoiceWithDescriptionHash(bolt11 string) (string, error)
- type ErrorCommand
- type ErrorConnect
- type ErrorConnectionBroken
- type ErrorJSONDecode
- type ErrorNetwork
- type ErrorTimeout
- type Graph
- type JSONRPCError
- type JSONRPCMessage
- type JSONRPCResponse
- type RouteHop
Constants ¶
View Source
const DESCRIPTION_HASH_DESCRIPTION_PREFIX = "with description_hash: "
Variables ¶
View Source
var DefaultTimeout = time.Second * 5
View Source
var InvoiceListeningTimeout = time.Minute * 150
Functions ¶
This section is empty.
Types ¶
type Channel ¶ added in v1.0.0
type Channel struct { Source string `json:"source"` Destination string `json:"destination"` ShortChannelID string `json:"short_channel_id"` BaseFeeMillisatoshi int64 `json:"base_fee_millisatoshi"` FeePerMillionth int64 `json:"fee_per_millionth"` Delay int64 `json:"delay"` Direction int `json:"direction"` HtlcMinimumMsat int64 `json:"htlc_minimum_msat"` HtlcMaximumMsat int64 `json:"htlc_maximum_msat"` // contains filtered or unexported fields }
type Client ¶
type Client struct { PaymentHandler func(gjson.Result) LastInvoiceIndex int CallTimeout time.Duration // lightning-rpc socket Path string LightningDir string // spark/sparko server SparkURL string SparkToken string DontCheckCertificates bool }
func (*Client) CallMessage ¶
func (*Client) CallMessageRaw ¶
func (*Client) CallNamedWithCustomTimeout ¶
func (*Client) CallWithCustomTimeout ¶
func (*Client) GetCustomBytes ¶ added in v1.0.0
func (*Client) GetCustomKey ¶ added in v1.0.0
GetCustomKey reads the hsm_secret file in the same directory as the lightning-rpc socket (given by Client.Path) and derives the node private key from it.
func (*Client) GetPrivateKey ¶ added in v1.0.0
GetPrivateKey gets the custom key with the parameters that return the node's master key (0 and "nodeid")
func (*Client) InvoiceWithDescriptionHash ¶ added in v1.0.0
func (*Client) InvoiceWithShadowRoute ¶ added in v1.1.0
func (*Client) ListenForInvoices ¶
func (ln *Client) ListenForInvoices()
ListenForInvoices starts a goroutine that will repeatedly call waitanyinvoice. Each payment received will be fed into the client.PaymentHandler function. You can change that function in the meantime. Or you can set it to nil if you want to stop listening for invoices.
type ErrorCommand ¶
type ErrorCommand struct { Message string `json:"msg"` Code int `json:"code"` Data interface{} `json:"data"` }
func (ErrorCommand) Error ¶
func (l ErrorCommand) Error() string
type ErrorConnect ¶
func (ErrorConnect) Error ¶
func (c ErrorConnect) Error() string
type ErrorConnectionBroken ¶
type ErrorConnectionBroken struct{}
func (ErrorConnectionBroken) Error ¶
func (c ErrorConnectionBroken) Error() string
type ErrorJSONDecode ¶
type ErrorJSONDecode struct {
Message string `json:"message"`
}
func (ErrorJSONDecode) Error ¶
func (j ErrorJSONDecode) Error() string
type ErrorNetwork ¶ added in v1.0.0
type ErrorTimeout ¶
type ErrorTimeout struct {
Seconds int `json:"seconds"`
}
func (ErrorTimeout) Error ¶
func (t ErrorTimeout) Error() string
type Graph ¶ added in v1.0.0
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) SearchDualBFS ¶ added in v1.0.0
type JSONRPCError ¶
type JSONRPCMessage ¶
type JSONRPCResponse ¶
type JSONRPCResponse struct { Version string `json:"jsonrpc"` Id interface{} `json:"id"` Result json.RawMessage `json:"result,omitempty"` Error *JSONRPCError `json:"error,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.