Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePrice ¶
DecodePrice decodes a price from a ln payment request.
func ParseL402Challenge ¶
ParseL402Challenge parses an L402 challenge from an HTTP response.
func PayInvoice ¶
PayInvoice pays a lightning invoice.
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
HttpClient is an HTTP client for interacting with the Fewsats API.
func NewHTTPClient ¶
func NewHTTPClient() (*HttpClient, error)
NewHTTPClient creates a new HTTP client for interacting with the Fewsats API.
func (*HttpClient) ExecuteL402Request ¶
ExecuteL402Request executes an HTTP request with the given method, path, and body. If the response status code is 402, it will show the user the price of the request and ask if they would like to proceed.
func (*HttpClient) ExecuteRequest ¶
ExecuteRequest executes an HTTP request with the given method, path, and body.
type PaymentResponse ¶
type PaymentResponse struct { Amount int `json:"amount"` Description string `json:"description"` Destination string `json:"destination"` Fee int `json:"fee"` PaymentHash string `json:"payment_hash"` PaymentPreimage string `json:"payment_preimage"` PaymentRequest string `json:"payment_request"` }
PaymentResponse represents a payment response.
Click to show internal directories.
Click to hide internal directories.