glightning

package
v0.0.0-...-721c341 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 14 Imported by: 5

Documentation

Index

Constants

View Source
const FormatSimple string = "simple"

Variables

View Source
var Lightning_RpcMethods map[string](func() jrpc2.Method)

List of all non-dev RPC methods

Functions

This section is empty.

Types

type Address

type Address struct {
	// todo: map to enum (ipv4, ipv6, torv2, torv3)
	Type string `json:"type"`
	Addr string `json:"address"`
	Port int    `json:"port"`
}

type AddressInternal

type AddressInternal struct {
	Type    string  `json:"type"`
	Addr    string  `json:"address"`
	Port    int     `json:"port"`
	Socket  string  `json:"socket"`
	Service Address `json:"service"`
	Name    string  `json:"name"`
}

type AddressType

type AddressType int
const (
	Bech32 AddressType = iota
	P2SHSegwit
	All
)

func (AddressType) String

func (a AddressType) String() string

type Alias

type Alias struct {
	Local  string `json:"local"`
	Remote string `json:"remote"`
}

Additional types to represent the nested structures

type Amount

type Amount struct {
	// contains filtered or unexported fields
}

func AmountFromBtc

func AmountFromBtc(amt uint64) Amount

func AmountFromMSat

func AmountFromMSat(amt uint64) Amount

func AmountFromSat

func AmountFromSat(amt uint64) Amount

func (Amount) MSat

func (a Amount) MSat() uint64

func (Amount) MarshalJSON

func (a Amount) MarshalJSON() ([]byte, error)

func (Amount) String

func (a Amount) String() string

func (*Amount) UnmarshalJSON

func (a *Amount) UnmarshalJSON(b []byte) error

type AmountOrAny

type AmountOrAny struct {
	// contains filtered or unexported fields
}

func AmountAny

func AmountAny() AmountOrAny

func AmountOrAnyFromAmount

func AmountOrAnyFromAmount(msat uint64) AmountOrAny

func (AmountOrAny) MarshalJSON

func (a AmountOrAny) MarshalJSON() ([]byte, error)

type AutoCleanInvoiceRequest

type AutoCleanInvoiceRequest struct {
	CycleSeconds     uint32 `json:"cycle_seconds"`
	ExpiredBySeconds uint32 `json:"expired_by,omitempty"`
}

func (AutoCleanInvoiceRequest) Name

type AutoCleanResult

type AutoCleanResult struct{}

type BitcoinBackend

type BitcoinBackend struct {
	// contains filtered or unexported fields
}

func NewBitcoinBackend

func NewBitcoinBackend(p *Plugin) *BitcoinBackend

func (*BitcoinBackend) RegisterEstimateFees

func (bb *BitcoinBackend) RegisterEstimateFees(fn func() (*Btc_EstimatedFees, error))

func (*BitcoinBackend) RegisterGetChainInfo

func (bb *BitcoinBackend) RegisterGetChainInfo(fn func() (*Btc_ChainInfo, error))

func (*BitcoinBackend) RegisterGetFeeRate

func (bb *BitcoinBackend) RegisterGetFeeRate(fn func(uint32, string) (uint64, error))

func (*BitcoinBackend) RegisterGetRawBlockByHeight

func (bb *BitcoinBackend) RegisterGetRawBlockByHeight(fn func(uint32) (string, string, error))

func (*BitcoinBackend) RegisterGetUtxOut

func (bb *BitcoinBackend) RegisterGetUtxOut(fn func(string, uint32) (string, string, error))

func (*BitcoinBackend) RegisterSendRawTransaction

func (bb *BitcoinBackend) RegisterSendRawTransaction(fn func(string) error)

type BoltExtra

type BoltExtra struct {
	Tag  string `json:"tag"`
	Data string `json:"data"`
}

type BoltRoute

type BoltRoute struct {
	Pubkey                    string `json:"pubkey"`
	ShortChannelId            string `json:"short_channel_id"`
	FeeBaseMilliSatoshis      uint64 `json:"fee_base_msat"`
	FeeProportionalMillionths uint64 `json:"fee_proportional_millionths"`
	CltvExpiryDelta           uint   `json:"cltv_expiry_delta"`
}

type BoolOption

type BoolOption struct {
	Name string

	Default bool
	Val     bool
	// contains filtered or unexported fields
}

func NewBoolOption

func NewBoolOption(name, description string, defaultValue bool) *BoolOption

func (*BoolOption) GetDefault

func (o *BoolOption) GetDefault() interface{}

func (*BoolOption) GetDesc

func (o *BoolOption) GetDesc() string

func (*BoolOption) GetName

func (o *BoolOption) GetName() string

func (*BoolOption) GetValue

func (o *BoolOption) GetValue() interface{}

func (*BoolOption) MarshalJSON

func (o *BoolOption) MarshalJSON() ([]byte, error)

func (*BoolOption) Set

func (o *BoolOption) Set(value interface{}) error

func (*BoolOption) Type

func (o *BoolOption) Type() string

type BtcBackend_MethodName

type BtcBackend_MethodName string

type Btc_ChainInfo

type Btc_ChainInfo struct {
	Chain                string `json:"chain"`
	HeaderCount          uint32 `json:"headercount"`
	BlockCount           uint32 `json:"blockcount"`
	InitialBlockDownload bool   `json:"ibd"`
}

type Btc_EstimatedFees

type Btc_EstimatedFees struct {
	Opening         uint64 `json:"opening"`
	MutualClose     uint64 `json:"mutual_close"`
	UnilateralClose uint64 `json:"unilateral_close"`
	DelayedToUs     uint64 `json:"delayed_to_us"`
	HtlcResolution  uint64 `json:"htlc_resolution"`
	Penalty         uint64 `json:"penalty"`
	MinAcceptable   uint64 `json:"min_acceptable"`
	MaxAcceptable   uint64 `json:"max_acceptable"`
}

type Btc_GetFeeRate

type Btc_GetFeeRate struct {
	// to be denominated in satoshi per kilo-vbyte
	FeeRate uint64 `json:"feerate"`
}

type Btc_GetRawBlockByHeight

type Btc_GetRawBlockByHeight struct {
	BlockHash *string `json:"blockhash"`
	Block     *string `json:"block"`
}

type Btc_GetUtxOut

type Btc_GetUtxOut struct {
	Amount *string `json:"amount"`
	Script *string `json:"script"`
}

type Btc_SendRawTransaction

type Btc_SendRawTransaction struct {
	Success bool   `json:"success"`
	Error   string `json:"errmsg"`
}

type Channel

type Channel struct {
	Source                   string `json:"source"`
	Destination              string `json:"destination"`
	ShortChannelId           string `json:"short_channel_id"`
	IsPublic                 bool   `json:"public"`
	Satoshis                 uint64 `json:"satoshis"`
	AmountMsat               Amount `json:"amount_msat"`
	MessageFlags             uint   `json:"message_flags"`
	ChannelFlags             uint   `json:"channel_flags"`
	IsActive                 bool   `json:"active"`
	LastUpdate               uint   `json:"last_update"`
	BaseFeeMillisatoshi      uint64 `json:"base_fee_millisatoshi"`
	FeePerMillionth          uint64 `json:"fee_per_millionth"`
	Delay                    uint   `json:"delay"`
	HtlcMinimumMilliSatoshis Amount `json:"htlc_minimum_msat"`
	HtlcMaximumMilliSatoshis Amount `json:"htlc_maximum_msat"`
}

type ChannelFeeResult

type ChannelFeeResult struct {
	Base           uint64        `json:"base"`
	PartPerMillion uint64        `json:"ppm"`
	Channels       []ChannelInfo `json:"channels"`
}

type ChannelInfo

type ChannelInfo struct {
	PeerId         string `json:"peer_id"`
	ChannelId      string `json:"channel_id"`
	ShortChannelId string `json:"short_channel_id"`
}

type ChannelOpened

type ChannelOpened struct {
	PeerId          string `json:"id"`
	FundingSatoshis string `json:"amount"`
	FundingTxId     string `json:"funding_txid"`
	FundingLocked   bool   `json:"funding_locked"`
}

type ChannelOpenedEvent

type ChannelOpenedEvent struct {
	ChannelOpened ChannelOpened `json:"channel_opened"`
	// contains filtered or unexported fields
}

func (*ChannelOpenedEvent) Call

func (e *ChannelOpenedEvent) Call() (jrpc2.Result, error)

func (*ChannelOpenedEvent) Name

func (e *ChannelOpenedEvent) Name() string

func (*ChannelOpenedEvent) New

func (e *ChannelOpenedEvent) New() interface{}

type ChannelType

type ChannelType struct {
	Bits  []int    `json:"bits"`
	Names []string `json:"names"`
}

type CheckMessageRequest

type CheckMessageRequest struct {
	Message string `json:"message"`
	ZBase   string `json:"zbase"`
	Pubkey  string `json:"pubkey,omitempty"`
}

func (CheckMessageRequest) Name

func (r CheckMessageRequest) Name() string

type CheckedMessage

type CheckedMessage struct {
	Pubkey   string `json:"pubkey"`
	Verified bool   `json:"verified"`
}

type CloseRequest

type CloseRequest struct {
	PeerId             string `json:"id"`
	Timeout            uint   `json:"unilateraltimeout,omitempty"`
	Destination        string `json:"destination,omitempty"`
	FeeNegotiationStep string `json:"fee_negotiation_step,omitempty"`
}

func (CloseRequest) Name

func (r CloseRequest) Name() string

type CloseResult

type CloseResult struct {
	Tx   string `json:"tx"`
	TxId string `json:"txid"`
	// todo: enum (mutual, unilateral)
	Type string `json:"type"`
}

type Command

type Command struct {
	NameAndUsage string `json:"command"`
	Description  string `json:"description"`
	Verbose      string `json:"verbose"`
	Category     string `json:"category"`
}

type Config

type Config struct {
	LightningDir string       `json:"lightning-dir"`
	RpcFile      string       `json:"rpc-file"`
	Startup      bool         `json:"startup,omitempty"`
	Network      string       `json:"network,omitempty"`
	Features     *FeatureBits `json:"feature_set,omitempty"`
}

type Connect

type Connect struct {
	PeerId  string  `json:"id"`
	Address Address `json:"address"`
}

type ConnectEvent

type ConnectEvent struct {
	PeerId  string  `json:"id"`
	Address Address `json:"address"`
	Conn    Connect `json:"connect"`
	// contains filtered or unexported fields
}

ConnectEvent represents an event triggered when a peer connects. For versions prior to cln v24.11, the PeerId and Address members are used. For backward compatibility, these members are retained. From cln v24.11 onwards, all notifications wrap members in an object with the same name. https://github.com/ElementsProject/lightning/blob/84f30b12f789937f0b0653892f5ba6ca3480aca8/doc/developers-guide/deprecations.md

func (*ConnectEvent) Call

func (e *ConnectEvent) Call() (jrpc2.Result, error)

func (*ConnectEvent) Name

func (e *ConnectEvent) Name() string

func (*ConnectEvent) New

func (e *ConnectEvent) New() interface{}

type ConnectRequest

type ConnectRequest struct {
	PeerId string `json:"id"`
	Host   string `json:"host"`
	Port   uint   `json:"port"`
}

func (ConnectRequest) Name

func (r ConnectRequest) Name() string

type ConnectResult

type ConnectResult struct {
	Id       string `json:"id"`
	Features *Hexed `json:"features"`
}

type ConnectSuccess

type ConnectSuccess struct {
	PeerId string `json:"id"`
}

type CreateOnionRequest

type CreateOnionRequest struct {
	Hops []Hop `json:"hops"`
	// Data onion should commit to, must match `payment_hash`
	AssociatedData string `json:"assocdata"`
	// Optional, can be used to generate shared secrets
	SessionKey string `json:"session_key,omitempty"`
}

func (CreateOnionRequest) Name

func (r CreateOnionRequest) Name() string

type CreateOnionResponse

type CreateOnionResponse struct {
	Onion         string   `json:"onion"`
	SharedSecrets []string `json:"shared_secrets"`
}

type CustomMessageRequest

type CustomMessageRequest struct {
	NodeId  string `json:"node_id"`
	Message string `json:"msg"`
}

func (*CustomMessageRequest) Name

func (r *CustomMessageRequest) Name() string

type CustomMessageResult

type CustomMessageResult struct {
	Code    uint32 `json:"code"`
	Message string `json:"message"`
	Status  string `json:"Status"`
}

type CustomMsgReceivedEvent

type CustomMsgReceivedEvent struct {
	PeerId  string `json:"peer_id"`
	Payload string `json:"payload"`
	// contains filtered or unexported fields
}

The custommsg plugin hook is the receiving counterpart to the dev-sendcustommsg RPC method and allows plugins to handle messages that are not handled internally.

func (*CustomMsgReceivedEvent) Call

func (pc *CustomMsgReceivedEvent) Call() (jrpc2.Result, error)

func (*CustomMsgReceivedEvent) Continue

func (*CustomMsgReceivedEvent) Fail

func (*CustomMsgReceivedEvent) Name

func (pc *CustomMsgReceivedEvent) Name() string

func (*CustomMsgReceivedEvent) New

func (pc *CustomMsgReceivedEvent) New() interface{}

type CustomMsgReceivedResponse

type CustomMsgReceivedResponse struct {
	Result _CustomMsgReceivedResult `json:"result"`
}

type DbWriteEvent

type DbWriteEvent struct {
	Writes      []string `json:"writes"`
	DataVersion uint64   `json:"data_version"`
	// contains filtered or unexported fields
}

Note that this Hook is called before the plugin is initialized. A plugin that registers for this hook may not register for any other hooks.

func (*DbWriteEvent) Call

func (dbw *DbWriteEvent) Call() (jrpc2.Result, error)

func (*DbWriteEvent) Continue

func (dbw *DbWriteEvent) Continue() *DbWriteResponse

func (*DbWriteEvent) Fail

func (dbw *DbWriteEvent) Fail() *DbWriteResponse

func (*DbWriteEvent) Name

func (dbw *DbWriteEvent) Name() string

func (*DbWriteEvent) New

func (dbw *DbWriteEvent) New() interface{}

type DbWriteResponse

type DbWriteResponse struct {
	Result _DbWrite_Result `json:"result,omitempty"`
}

type DecodePayRequest deprecated

type DecodePayRequest struct {
	Bolt11      string `json:"bolt11"`
	Description string `json:"description,omitempty"`
}

Deprecated: DecodePayRequest is deprecated, use DecodeRequest instead

func (DecodePayRequest) Name

func (r DecodePayRequest) Name() string

type DecodeRequest

type DecodeRequest struct {
	String string `json:"string"`
}

DecodeRequest for the new 'decode' RPC command (replaces decodepay)

func (DecodeRequest) Name

func (r DecodeRequest) Name() string

type DecodeResult

type DecodeResult struct {
	Type  string `json:"type"`
	Valid bool   `json:"valid"`
	// BOLT11 specific fields (when type is "bolt11 invoice")
	Currency           string        `json:"currency,omitempty"`
	CreatedAt          uint64        `json:"created_at,omitempty"`
	Expiry             uint64        `json:"expiry,omitempty"`
	Payee              string        `json:"payee,omitempty"`
	MilliSatoshis      uint64        `json:"msatoshi,omitempty"`
	AmountMsat         *Amount       `json:"amount_msat,omitempty"`
	PaymentHash        string        `json:"payment_hash,omitempty"`
	Description        string        `json:"description,omitempty"`
	DescriptionHash    string        `json:"description_hash,omitempty"`
	MinFinalCltvExpiry uint          `json:"min_final_cltv_expiry,omitempty"`
	PaymentSecret      string        `json:"payment_secret,omitempty"`
	Features           *Hexed        `json:"features,omitempty"`
	Fallbacks          []Fallback    `json:"fallbacks,omitempty"`
	Routes             [][]BoltRoute `json:"routes,omitempty"`
	Extra              []BoltExtra   `json:"extra,omitempty"`
	Signature          string        `json:"signature,omitempty"`
}

DecodeResult represents the response from decode command

type DecodedBolt11

type DecodedBolt11 struct {
	Currency           string        `json:"currency"`
	CreatedAt          uint64        `json:"created_at"`
	Expiry             uint64        `json:"expiry"`
	Payee              string        `json:"payee"`
	MilliSatoshis      uint64        `json:"msatoshi,omitempty"`
	AmountMsat         Amount        `json:"amount_msat"`
	Description        string        `json:"description"`
	DescriptionHash    string        `json:"description_hash"`
	MinFinalCltvExpiry int           `json:"min_final_cltv_expiry"`
	Fallbacks          []Fallback    `json:"fallbacks"`
	Routes             [][]BoltRoute `json:"routes"`
	Extra              []BoltExtra   `json:"extra"`
	PaymentHash        string        `json:"payment_hash"`
	PaymentSecret      string        `json:"payment_secret"`
	Signature          string        `json:"signature"`
	Features           Hexed         `json:"features"`
}

type DeleteExpiredInvoiceReq

type DeleteExpiredInvoiceReq struct {
	MaxExpiryTime uint64 `json:"maxexpirytime,omitempty"`
}

func (DeleteExpiredInvoiceReq) Name

type DeleteInvoiceRequest

type DeleteInvoiceRequest struct {
	Label  string `json:"label"`
	Status string `json:"status"`
}

func (DeleteInvoiceRequest) Name

func (r DeleteInvoiceRequest) Name() string

type DevCrashRequest

type DevCrashRequest struct{}

func (DevCrashRequest) Name

func (r DevCrashRequest) Name() string

type DevFailRequest

type DevFailRequest struct {
	PeerId string `json:"id"`
}

func (DevFailRequest) Name

func (r DevFailRequest) Name() string

type DevForgetChannelRequest

type DevForgetChannelRequest struct {
	PeerId string `json:"id"`
	Force  bool   `json:"force"`
}

func (*DevForgetChannelRequest) Name

func (r *DevForgetChannelRequest) Name() string

type DevHashResult

type DevHashResult struct {
	RHash string `json:"rhash"`
}

type DevMemDumpRequest

type DevMemDumpRequest struct{}

func (DevMemDumpRequest) Name

func (r DevMemDumpRequest) Name() string

type DevMemLeakRequest

type DevMemLeakRequest struct{}

func (DevMemLeakRequest) Name

func (r DevMemLeakRequest) Name() string

type DevQueryShortChanIdsRequest

type DevQueryShortChanIdsRequest struct {
	PeerId       string   `json:"id"`
	ShortChanIds []string `json:"scids"`
}

func (DevQueryShortChanIdsRequest) Name

type DevRHashRequest

type DevRHashRequest struct {
	Secret string `json:"secret"`
}

func (DevRHashRequest) Name

func (r DevRHashRequest) Name() string

type DevReenableCommitRequest

type DevReenableCommitRequest struct {
	PeerId string `json:"id"`
}

func (DevReenableCommitRequest) Name

type DevRescanOutputsRequest

type DevRescanOutputsRequest struct{}

func (*DevRescanOutputsRequest) Name

func (r *DevRescanOutputsRequest) Name() string

type DevSignLastTxRequest

type DevSignLastTxRequest struct {
	PeerId string `json:"id"`
}

func (DevSignLastTxRequest) Name

func (r DevSignLastTxRequest) Name() string

type Disconnect

type Disconnect struct {
	PeerId string `json:"id"`
}

type DisconnectEvent

type DisconnectEvent struct {
	PeerId     string     `json:"id"`
	Disconnect Disconnect `json:"disconnect"`
	// contains filtered or unexported fields
}

DisconnectEvent represents an event triggered when a peer disconnects. For versions prior to cln v24.11, the PeerId is used. For backward compatibility, these members are retained. From cln v24.11 onwards, all notifications wrap members in an object with the same name. https://github.com/ElementsProject/lightning/blob/84f30b12f789937f0b0653892f5ba6ca3480aca8/doc/developers-guide/deprecations.md

func (*DisconnectEvent) Call

func (e *DisconnectEvent) Call() (jrpc2.Result, error)

func (*DisconnectEvent) Name

func (e *DisconnectEvent) Name() string

func (*DisconnectEvent) New

func (e *DisconnectEvent) New() interface{}

type DisconnectRequest

type DisconnectRequest struct {
	PeerId string `json:"id"`
	Force  bool   `json:"force"`
}

func (*DisconnectRequest) Name

func (r *DisconnectRequest) Name() string

type Fallback

type Fallback struct {
	// fixme: use enum (P2PKH,P2SH,P2WPKH,P2WSH)
	Type    string `json:"type"`
	Address string `json:"addr"`
	Hex     *Hexed `json:"hex"`
}

type FeatureBits

type FeatureBits struct {
	Node    *Hexed `json:"node,omitempty"`
	Init    *Hexed `json:"init,omitempty"`
	Invoice *Hexed `json:"invoice,omitempty"`
	Channel *Hexed `json:"channel,omitempty"`
}

func (*FeatureBits) AreSet

func (fb *FeatureBits) AreSet() bool

type FeeDirective

type FeeDirective int
const (
	Normal FeeDirective = iota
	Urgent
	Slow
)

func (FeeDirective) String

func (f FeeDirective) String() string

type FeeRate

type FeeRate struct {
	Rate      uint
	Style     FeeRateStyle
	Directive FeeDirective
}

func NewFeeRate

func NewFeeRate(style FeeRateStyle, rate uint) *FeeRate

func NewFeeRateByDirective

func NewFeeRateByDirective(style FeeRateStyle, directive FeeDirective) *FeeRate

func (*FeeRate) String

func (f *FeeRate) String() string

type FeeRateDetails

type FeeRateDetails struct {
	Urgent          int  `json:"urgent"`
	Normal          int  `json:"normal"`
	Slow            int  `json:"slow"`
	MinAcceptable   int  `json:"min_acceptable"`
	MaxAcceptable   int  `json:"max_acceptable"`
	Opening         uint `json:"opening"`
	MutualClose     uint `json:"mutual_close"`
	UnilateralClose uint `json:"unilateral_close"`
	DelayedToUs     uint `json:"delayed_to_us"`
	HtlcResolution  uint `json:"htlc_resolution"`
	Penalty         uint `json:"penalty"`
}

type FeeRateEstimate

type FeeRateEstimate struct {
	Style           FeeRateStyle
	Details         *FeeRateDetails
	OnchainEstimate *OnchainEstimate `json:"onchain_fee_estimates"`
	Warning         string           `json:"warning"`
}

type FeeRateStyle

type FeeRateStyle int
const (
	PerKb FeeRateStyle = iota
	PerKw
)

func (FeeRateStyle) String

func (r FeeRateStyle) String() string

type FeeRatesRequest

type FeeRatesRequest struct {
	Style string `json:"style"`
}

func (*FeeRatesRequest) Name

func (r *FeeRatesRequest) Name() string

type Feerate

type Feerate struct {
	PerKw uint64 `json:"perkw"`
	PerKb uint64 `json:"perkb"`
}

type FirstHop

type FirstHop struct {
	ShortChannelId string `json:"channel"`
	Direction      uint8  `json:"direction"`
	AmountMsat     Amount `json:"amount_msat"`
	Delay          uint   `json:"delay"`
}

type ForgetChannelResult

type ForgetChannelResult struct {
	WasForced        bool   `json:"forced"`
	IsFundingUnspent bool   `json:"funding_unspent"`
	FundingTxId      string `json:"funding_txid"`
}

type ForwardEvent

type ForwardEvent struct {
	Forward *Forwarding `json:"forward_event"`
	// contains filtered or unexported fields
}

func (*ForwardEvent) Call

func (e *ForwardEvent) Call() (jrpc2.Result, error)

func (*ForwardEvent) Name

func (e *ForwardEvent) Name() string

func (*ForwardEvent) New

func (e *ForwardEvent) New() interface{}

type Forwarding

type Forwarding struct {
	InChannel       string  `json:"in_channel"`
	OutChannel      string  `json:"out_channel"`
	MilliSatoshiIn  uint64  `json:"in_msatoshi,omitempty"`
	InMsat          Amount  `json:"in_msat"`
	MilliSatoshiOut uint64  `json:"out_msatoshi,omitempty"`
	OutMsat         Amount  `json:"out_msat"`
	Fee             uint64  `json:"fee"`
	FeeMsat         Amount  `json:"fee_msat"`
	Status          string  `json:"status"`
	PaymentHash     string  `json:"payment_hash"`
	FailCode        int     `json:"failcode"`
	FailReason      string  `json:"failreason"`
	ReceivedTime    float64 `json:"received_time"`
	ResolvedTime    float64 `json:"resolved_time"`
}

type FundChannelCancel

type FundChannelCancel struct {
	PeerId string `json:"id"`
}

func (FundChannelCancel) Name

func (r FundChannelCancel) Name() string

type FundChannelComplete

type FundChannelComplete struct {
	PeerId string `json:"id"`
	TxId   string `json:"txid"`
	TxOut  uint32 `json:"txout"`
}

func (FundChannelComplete) Name

func (r FundChannelComplete) Name() string

type FundChannelRequest

type FundChannelRequest struct {
	Id       string  `json:"id"`
	Amount   string  `json:"amount"`
	FeeRate  string  `json:"feerate,omitempty"`
	Announce bool    `json:"announce"`
	MinConf  *uint16 `json:"minconf,omitempty"`
	PushMsat Amount  `json:"push_msat,omitempty"`
}

func (FundChannelRequest) Name

func (r FundChannelRequest) Name() string

type FundChannelResult

type FundChannelResult struct {
	FundingTx   string `json:"tx"`
	FundingTxId string `json:"txid"`
	ChannelId   string `json:"channel_id"`
}

type FundChannelStart

type FundChannelStart struct {
	Id       string `json:"id"`
	Amount   uint64 `json:"amount"`
	Announce bool   `json:"announce"`
	FeeRate  string `json:"feerate,omitempty"`
	CloseTo  string `json:"close_to,omitempty"`
}

func (FundChannelStart) Name

func (r FundChannelStart) Name() string

type FundOutput

type FundOutput struct {
	TxId               string `json:"txid"`
	Output             int    `json:"output"`
	Value              uint64 `json:"value"`
	AmountMilliSatoshi Amount `json:"amount_msat"`
	Address            string `json:"address"`
	Status             string `json:"status"`
	Blockheight        int    `json:"blockheight,omitempty"`
}

type Funding

type Funding struct {
	LocalFundsMsat  Amount `json:"local_funds_msat"`
	RemoteFundsMsat Amount `json:"remote_funds_msat"`
	PushedMsat      Amount `json:"pushed_msat"`
}

type FundingChannel

type FundingChannel struct {
	Id                    string `json:"peer_id"`
	ShortChannelId        string `json:"short_channel_id"`
	OurAmountMilliSatoshi Amount `json:"our_amount_msat"`
	AmountMilliSatoshi    Amount `json:"amount_msat"`
	ChannelSatoshi        uint64 `json:"channel_sat"`
	ChannelTotalSatoshi   uint64 `json:"channel_total_sat"`
	FundingTxId           string `json:"funding_txid"`
	FundingOutput         int    `json:"funding_output"`
	Connected             bool   `json:"connected"`
	State                 string `json:"state"`
}

type FundsResult

type FundsResult struct {
	Outputs  []*FundOutput     `json:"outputs"`
	Channels []*FundingChannel `json:"channels"`
}

type GetInfoRequest

type GetInfoRequest struct{}

func (GetInfoRequest) Name

func (r GetInfoRequest) Name() string

type GetManifestMethod

type GetManifestMethod struct {
	// contains filtered or unexported fields
}

func (GetManifestMethod) Call

func (gm GetManifestMethod) Call() (jrpc2.Result, error)

Builds the manifest object that's returned from the `getmanifest` method.

func (GetManifestMethod) Name

func (gm GetManifestMethod) Name() string

func (*GetManifestMethod) New

func (gm *GetManifestMethod) New() interface{}

type HelpRequest

type HelpRequest struct {
	Command string `json:"command,omitempty"`
}

func (HelpRequest) Name

func (r HelpRequest) Name() string

type Hexed

type Hexed struct {
	Str string
	Raw []byte
}

func NewHex

func NewHex(hexstring string) (*Hexed, error)

func NewHexx

func NewHexx(hexb []byte) *Hexed

func (*Hexed) IsSet

func (h *Hexed) IsSet(bitpos int) bool

func (*Hexed) MarshalJSON

func (h *Hexed) MarshalJSON() ([]byte, error)

func (*Hexed) String

func (h *Hexed) String() string

func (*Hexed) UnmarshalJSON

func (h *Hexed) UnmarshalJSON(b []byte) error

type Hook

type Hook string

type Hooks

type Hooks struct {
	PeerConnected     func(*PeerConnectedEvent) (*PeerConnectedResponse, error)
	DbWrite           func(*DbWriteEvent) (*DbWriteResponse, error)
	InvoicePayment    func(*InvoicePaymentEvent) (*InvoicePaymentResponse, error)
	OpenChannel       func(*OpenChannelEvent) (*OpenChannelResponse, error)
	HtlcAccepted      func(*HtlcAcceptedEvent) (*HtlcAcceptedResponse, error)
	RpcCommand        func(*RpcCommandEvent) (*RpcCommandResponse, error)
	CustomMsgReceived func(*CustomMsgReceivedEvent) (*CustomMsgReceivedResponse, error)
}

Map for registering hooks. Not the *most* elegant but

it'll do for now.

type Hop

type Hop struct {
	Pubkey  string `json:"pubkey"`
	Payload string `json:"payload"`
}

type Htlc

type Htlc struct {
	Direction    string `json:"direction"`
	Id           uint64 `json:"id"`
	MilliSatoshi uint64 `json:"msatoshi"`
	AmountMsat   Amount `json:"amount_msat"`
	Expiry       uint64 `json:"expiry"`
	PaymentHash  string `json:"payment_hash"`
	State        string `json:"state"`
	LocalTrimmed bool   `json:"local_trimmed"`
}

type HtlcAcceptedEvent

type HtlcAcceptedEvent struct {
	Onion Onion     `json:"onion"`
	Htlc  HtlcOffer `json:"htlc"`
	// contains filtered or unexported fields
}

The `htlc_accepted` hook is called whenever an incoming HTLC is accepted, and its result determines how `lightningd` should treat that HTLC.

Warning: `lightningd` will replay the HTLCs for which it doesn't have a final

verdict during startup. This means that, if the plugin response wasn't
processed before the HTLC was forwarded, failed, or resolved, then the plugin
may see the same HTLC again during startup. It is therefore paramount that the
plugin is idempotent if it talks to an external system.

func (*HtlcAcceptedEvent) Call

func (ha *HtlcAcceptedEvent) Call() (jrpc2.Result, error)

func (*HtlcAcceptedEvent) Continue

func (ha *HtlcAcceptedEvent) Continue() *HtlcAcceptedResponse

func (*HtlcAcceptedEvent) ContinueWithPayload

func (ha *HtlcAcceptedEvent) ContinueWithPayload(payload string) *HtlcAcceptedResponse

func (*HtlcAcceptedEvent) Fail

func (ha *HtlcAcceptedEvent) Fail(failCode uint16) *HtlcAcceptedResponse

func (*HtlcAcceptedEvent) Name

func (ha *HtlcAcceptedEvent) Name() string

func (*HtlcAcceptedEvent) New

func (ha *HtlcAcceptedEvent) New() interface{}

func (*HtlcAcceptedEvent) Resolve

func (ha *HtlcAcceptedEvent) Resolve(paymentKey string) *HtlcAcceptedResponse

type HtlcAcceptedResponse

type HtlcAcceptedResponse struct {
	Result HtlcAcceptedResult `json:"result"`
	// Only allowed if result is 'fail', deprecated! check
	// FailureMessage
	FailureCode *uint16 `json:"failure_code,omitempty"`
	// Only allowed if result is 'resolve'
	PaymentKey string `json:"payment_key,omitempty"`
	// Replaces the onion's payload
	Payload string `json:"payload,omitempty"`
}

type HtlcAcceptedResult

type HtlcAcceptedResult string

type HtlcOffer

type HtlcOffer struct {
	AmountMilliSatoshi string `json:"amount"`
	CltvExpiry         int    `json:"cltv_expiry"`
	CltvExpiryRelative int    `json:"cltv_expiry_relative"`
	PaymentHash        string `json:"payment_hash"`
}

type InitMethod

type InitMethod struct {
	Options       json.RawMessage `json:"options"`
	Configuration *Config         `json:"configuration"`
	// contains filtered or unexported fields
}

func (InitMethod) Call

func (im InitMethod) Call() (jrpc2.Result, error)

func (InitMethod) Name

func (im InitMethod) Name() string

func (InitMethod) New

func (im InitMethod) New() interface{}

type IntOption

type IntOption struct {
	Name string

	Default int
	Val     int
	// contains filtered or unexported fields
}

func NewIntOption

func NewIntOption(name, description string, defaultValue int) *IntOption

func (*IntOption) GetDefault

func (o *IntOption) GetDefault() interface{}

func (*IntOption) GetDesc

func (o *IntOption) GetDesc() string

func (*IntOption) GetName

func (o *IntOption) GetName() string

func (*IntOption) GetValue

func (o *IntOption) GetValue() interface{}

func (*IntOption) MarshalJSON

func (o *IntOption) MarshalJSON() ([]byte, error)

func (*IntOption) Set

func (o *IntOption) Set(value interface{}) error

func (*IntOption) Type

func (o *IntOption) Type() string

type Invoice

type Invoice struct {
	Label                   string `json:"label"`
	Bolt11                  string `json:"bolt11"`
	PaymentHash             string `json:"payment_hash"`
	AmountMilliSatoshi      Amount `json:"amount_msat,omitempty"`
	AmountMilliSatoshiRaw   uint64 `json:"msatoshi,omitempty"`
	Status                  string `json:"status"`
	PayIndex                uint64 `json:"pay_index,omitempty"`
	MilliSatoshiReceivedRaw uint64 `json:"msatoshi_received,omitempty"`
	MilliSatoshiReceived    Amount `json:"amount_received_msat,omitempty"`
	PaidAt                  uint64 `json:"paid_at,omitempty"`
	PaymentPreImage         string `json:"payment_preimage,omitempty"`
	WarningOffline          string `json:"warning_offline,omitempty"`
	WarningCapacity         string `json:"warning_capacity,omitempty"`
	Description             string `json:"description"`
	ExpiresAt               uint64 `json:"expires_at"`
}

type InvoicePaidEvent

type InvoicePaidEvent struct {
	Payment Payment `json:"invoice_payment"`
	// contains filtered or unexported fields
}

func (*InvoicePaidEvent) Call

func (e *InvoicePaidEvent) Call() (jrpc2.Result, error)

func (*InvoicePaidEvent) Name

func (e *InvoicePaidEvent) Name() string

func (*InvoicePaidEvent) New

func (e *InvoicePaidEvent) New() interface{}

type InvoicePaymentEvent

type InvoicePaymentEvent struct {
	Payment Payment `json:"payment"`
	// contains filtered or unexported fields
}

func (*InvoicePaymentEvent) Call

func (ip *InvoicePaymentEvent) Call() (jrpc2.Result, error)

func (*InvoicePaymentEvent) Continue

func (*InvoicePaymentEvent) Fail

func (ip *InvoicePaymentEvent) Fail(failureCode uint16) *InvoicePaymentResponse

func (*InvoicePaymentEvent) Name

func (ip *InvoicePaymentEvent) Name() string

func (*InvoicePaymentEvent) New

func (ip *InvoicePaymentEvent) New() interface{}

type InvoicePaymentResponse

type InvoicePaymentResponse struct {
	Result      _InvoicePaymentResult `json:"result,omitempty"`
	FailureCode *uint16               `json:"failure_code,omitempty"`
	// Replaces failure code!
	FailureMessage string `json:"failure_message,omitempty"`
}

type InvoiceRequest

type InvoiceRequest struct {
	MilliSatoshis AmountOrAny `json:"amount_msat"`
	Label         string      `json:"label"`
	Description   string      `json:"description"`
	ExpirySeconds uint32      `json:"expiry,omitempty"`
	Fallbacks     []string    `json:"fallbacks,omitempty"`
	PreImage      string      `json:"preimage,omitempty"`
	Cltv          uint32      `json:"cltv,omitempty"`
	// Note that these both have the same json key. we use checks
	// to make sure that only one of them is filled in
	ExposePrivChansFlag *bool    `json:"exposeprivatechannels,omitempty"`
	ExposeTheseChannels []string `json:"exposeprivatechannels,omitempty"`
}

func (InvoiceRequest) Name

func (ir InvoiceRequest) Name() string

type Lightning

type Lightning struct {
	// contains filtered or unexported fields
}

This file's the one that holds all the objects for the c-lightning RPC commands

func NewLightning

func NewLightning() *Lightning

func (*Lightning) CancelFundChannel

func (l *Lightning) CancelFundChannel(peerId string) (bool, error)

func (*Lightning) CheckMessage

func (l *Lightning) CheckMessage(message, zbase string) (bool, string, error)

No pubkey provided, so we return the pubkey

func (*Lightning) CheckMessageVerify

func (l *Lightning) CheckMessageVerify(message, zbase, pubkey string) (bool, error)

Pubkey provided, so we return whether or not is verified

func (*Lightning) Close

func (l *Lightning) Close(id string, timeout uint, destination string) (*CloseResult, error)

Close the channel with peer {id}, timing out with {timeout} seconds, at whence a unilateral close is initiated.

If unspecified, forces a close (timesout) in 48hours

Can pass either peer id or channel id as {id} field.

Note that a successful result *may* be null.

func (*Lightning) CloseNormal

func (l *Lightning) CloseNormal(id string) (*CloseResult, error)

func (*Lightning) CloseTo

func (l *Lightning) CloseTo(id, destination string) (*CloseResult, error)

func (*Lightning) CloseToTimeoutWithStep

func (l *Lightning) CloseToTimeoutWithStep(id string, timeout uint, destination, step string) (*CloseResult, error)

func (*Lightning) CloseToWithStep

func (l *Lightning) CloseToWithStep(id, destination, step string) (*CloseResult, error)

func (*Lightning) CloseWithStep

func (l *Lightning) CloseWithStep(id, step string) (*CloseResult, error)

func (*Lightning) CompleteFundChannel

func (l *Lightning) CompleteFundChannel(peerId, txId string, txout uint32) (channelId string, err error)

func (*Lightning) Connect

func (l *Lightning) Connect(peerId, host string, port uint) (string, error)

Connect to {peerId} at {host}:{port}. Returns peer id on success Sort of deprecated, use ConnectPeer, as it gives you back the peer's init features as well

func (*Lightning) ConnectPeer

func (l *Lightning) ConnectPeer(peerId, host string, port uint) (*ConnectResult, error)

Connect to {peerId} at {host}:{port}. Returns result with peer id and peer's features

func (*Lightning) CreateInvoice

func (l *Lightning) CreateInvoice(msat uint64, label, description string, expirySeconds uint32, fallbacks []string, preimage string, willExposePrivateChans bool) (*Invoice, error)

Creates an invoice with a value of `msat`. Label and description must be set.

The 'label' is a unique string or number (which is treated as a string); it is never revealed to other nodes, but it can be used to query the status of this invoice.

The 'description' is a short description of purpose of payment. It is encoded into the invoice. Must be UTF-8, cannot use '\n' JSON escape codes.

The 'expiry' is optionally the number of seconds the invoice is valid for. Defaults to 3600 (1 hour).

'fallbacks' is one or more fallback addresses to include in the invoice. They should be ordered from most preferred to least. Noe that these are not currently tracked to fulfill the invoice.

The 'preimage' is a 64-digit hex string to be used as payment preimage for the created invoice. By default, c-lightning will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **NOTE**: if you specify the 'preimage', you are responsible for both ensuring that a suitable psuedorandom generator with sufficient entropy was used in its creation and keeping it secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed.

func (*Lightning) CreateInvoiceAny

func (l *Lightning) CreateInvoiceAny(label, description string, expirySeconds uint32, fallbacks []string, preimage string, exposePrivateChans bool) (*Invoice, error)

Creates an invoice with a value of "any", that can be paid with any amount

func (*Lightning) CreateInvoiceExposing

func (l *Lightning) CreateInvoiceExposing(msat uint64, label, description string, expirySeconds uint32, fallbacks []string, preimage string, exposePrivChans []string) (*Invoice, error)

func (*Lightning) CreateInvoiceWithCltvExpiry

func (l *Lightning) CreateInvoiceWithCltvExpiry(msat uint64, label, description string, expirySeconds uint32, fallbacks []string, preimage string, willExposePrivateChans bool, cltv uint32) (*Invoice, error)

func (*Lightning) CreateOnion

func (l *Lightning) CreateOnion(hops []Hop, paymentHash, sessionKey string) (*CreateOnionResponse, error)

func (*Lightning) Decode

func (l *Lightning) Decode(str string) (*DecodeResult, error)

Decode uses the new 'decode' command that can decode bolt11, bolt12, rune, etc.

func (*Lightning) DecodeBolt11

func (l *Lightning) DecodeBolt11(bolt11 string) (*DecodedBolt11, error)

DecodeBolt11 decodes a bolt11 invoice using the new decode command

func (*Lightning) DecodePay deprecated

func (l *Lightning) DecodePay(bolt11, desc string) (*DecodedBolt11, error)

Deprecated: DecodePay is deprecated, use Decode or DecodeBolt11 instead Decode the {bolt11}, using the provided 'description' if necessary.*

* This is only necessary if the bolt11 includes a description hash. The provided description must match the included hash.

func (*Lightning) DeleteExpiredInvoicesSince

func (l *Lightning) DeleteExpiredInvoicesSince(unixTime uint64) error

func (*Lightning) DeleteInvoice

func (l *Lightning) DeleteInvoice(label, status string) (*Invoice, error)

Delete unpaid invoice {label} with {status}

func (*Lightning) DevCrash

func (l *Lightning) DevCrash() (interface{}, error)

Crash lightningd by calling fatal(). Returns nothing.

func (*Lightning) DevFail

func (l *Lightning) DevFail(peerId string) error

Fail with peer {id}

func (*Lightning) DevForgetChannel

func (l *Lightning) DevForgetChannel(peerId string, force bool) (*ForgetChannelResult, error)

Forget channel with id {peerId}. Optionally {force} if has active channel. Caution, this might lose you funds.

func (*Lightning) DevHash

func (l *Lightning) DevHash(secret string) (string, error)

Show SHA256 of {secret}

func (*Lightning) DevMemDump

func (l *Lightning) DevMemDump() ([]*MemDumpEntry, error)

Show memory objects currently in use

func (*Lightning) DevMemLeak

func (l *Lightning) DevMemLeak() ([]*MemLeak, error)

Show unreferenced memory objects

func (*Lightning) DevQueryShortChanIds

func (l *Lightning) DevQueryShortChanIds(peerId string, shortChanIds []string) (*QueryShortChannelIdsResponse, error)

Ask a peer for a particular set of short channel ids

func (*Lightning) DevReenableCommit

func (l *Lightning) DevReenableCommit(id string) error

Re-enable the commit timer on peer {id}

func (*Lightning) DevRescanOutputs

func (l *Lightning) DevRescanOutputs() ([]Output, error)

Synchronize the state of our funds with bitcoind

func (*Lightning) DevSignLastTx

func (l *Lightning) DevSignLastTx(peerId string) (string, error)

Sign and show the last commitment transaction with peer {peerId} Returns the signed tx on success

func (*Lightning) DisableInvoiceAutoclean

func (l *Lightning) DisableInvoiceAutoclean() error

func (*Lightning) DiscardTx

func (l *Lightning) DiscardTx(txid string) (*TxResult, error)

Abandon a transaction created by PrepareTx

func (*Lightning) Disconnect

func (l *Lightning) Disconnect(peerId string, force bool) error

Disconnect from peer with {peerId}. Optionally {force} if has active channel. Returns a nil response on success

func (*Lightning) FeeRates

func (l *Lightning) FeeRates(style FeeRateStyle) (*FeeRateEstimate, error)

Return feerate estimates, either satoshi-per-kw or satoshi-per-kb {style}

func (*Lightning) FundChannel

func (l *Lightning) FundChannel(id string, amount *Sat) (*FundChannelResult, error)

Fund channel, defaults to public channel and default feerate.

func (*Lightning) FundChannelAtFee

func (l *Lightning) FundChannelAtFee(id string, amount *Sat, feerate *FeeRate) (*FundChannelResult, error)

func (*Lightning) FundChannelExt

func (l *Lightning) FundChannelExt(id string, amount *Sat, feerate *FeeRate, announce bool, minConf *uint16, pushMSat *MSat) (*FundChannelResult, error)

Fund channel with node {id} using {satoshi} satoshis, with feerate of {feerate}. Uses default feerate if unset. If announce is false, channel announcements will not be sent. can send an optional 'pushMsat', of millisatoshis to push to peer (from your funding amount) Any pushed msats are irrevocably gifted to the peer. (use only if you enjoy being a sats santa!)

func (*Lightning) FundPrivateChannel

func (l *Lightning) FundPrivateChannel(id string, amount *Sat) (*FundChannelResult, error)

func (*Lightning) FundPrivateChannelAtFee

func (l *Lightning) FundPrivateChannelAtFee(id string, amount *Sat, feerate *FeeRate) (*FundChannelResult, error)

func (*Lightning) GetChannel

func (l *Lightning) GetChannel(shortChanId string) ([]*Channel, error)

Get channel by {shortChanId}

func (*Lightning) GetConfig

func (l *Lightning) GetConfig(config string) (interface{}, error)

func (*Lightning) GetInfo

func (l *Lightning) GetInfo() (*NodeInfo, error)

func (*Lightning) GetInvoice

func (l *Lightning) GetInvoice(label string) (*Invoice, error)

Show invoice {label}.

func (*Lightning) GetLog

func (l *Lightning) GetLog(level LogLevel) (*LogResponse, error)

Show logs, with optional log {level} (info|unusual|debug|io)

func (*Lightning) GetNode

func (l *Lightning) GetNode(nodeId string) (*Node, error)

Get all nodes in our local network view, filter on node {id}, if provided

func (*Lightning) GetPayStatus

func (l *Lightning) GetPayStatus(bolt11 string) (*PayStatus, error)

Detailed information about a payment attempt to a given bolt11

func (*Lightning) GetPeer

func (l *Lightning) GetPeer(peerId string) (*Peer, error)

Show current peer {peerId}.

func (*Lightning) GetPeerWithLogs

func (l *Lightning) GetPeerWithLogs(peerId string, level LogLevel) (*Peer, error)

func (*Lightning) GetRoute

func (l *Lightning) GetRoute(peerId string, msats uint64, riskfactor float32, cltv uint, fromId string, fuzzpercent float32, exclude []string, maxHops int32) ([]RouteHop, error)

Show route to {id} for {msatoshis}, using a {riskfactor} and optional {cltv} value (defaults to 9). If specified, search from {fromId} otherwise use current node as the source. Randomize the route with up to {fuzzpercent} (0.0 -> 100.0, default 5.0).

If you wish to exclude a set of channels from the route, you can pass in an optional set of channel id's with a direction (scid/direction)

func (*Lightning) GetRouteSimple

func (l *Lightning) GetRouteSimple(peerId string, msats uint64, riskfactor float32) ([]RouteHop, error)

func (*Lightning) GetSharedSecret

func (l *Lightning) GetSharedSecret(point string) (string, error)

Returns the shared secret, a hexadecimal string of the 256-bit SHA-2 of the

compressed public key DER-encoding of the  SECP256K1  point  that  is  the
shared secret generated using the Elliptic Curve Diffie-Hellman algorithm.
This field is 32 bytes (64 hexadecimal characters in a string).

func (*Lightning) Help

func (l *Lightning) Help() ([]*Command, error)

Show available c-lightning RPC commands

func (*Lightning) HelpFor

func (l *Lightning) HelpFor(command string) (*Command, error)

func (*Lightning) Invoice

func (l *Lightning) Invoice(msat uint64, label, description string) (*Invoice, error)

func (*Lightning) IsUp

func (l *Lightning) IsUp() bool

func (*Lightning) ListChannels

func (l *Lightning) ListChannels() ([]*Channel, error)

func (*Lightning) ListChannelsBySource

func (l *Lightning) ListChannelsBySource(nodeId string) ([]*Channel, error)

func (*Lightning) ListConfigs

func (l *Lightning) ListConfigs() (map[string]interface{}, error)

func (*Lightning) ListForwards

func (l *Lightning) ListForwards() ([]Forwarding, error)

List all forwarded payments and their information

func (*Lightning) ListFunds

func (l *Lightning) ListFunds() (*FundsResult, error)

Funds in wallet.

func (*Lightning) ListInvoices

func (l *Lightning) ListInvoices() ([]*Invoice, error)

List all invoices

func (*Lightning) ListNodes

func (l *Lightning) ListNodes() ([]*Node, error)

List all nodes in our local network view

func (*Lightning) ListPayStatuses

func (l *Lightning) ListPayStatuses() ([]PayStatus, error)

List detailed information about all payment attempts

func (*Lightning) ListPays

func (l *Lightning) ListPays() ([]PaymentFields, error)

func (*Lightning) ListPaysToBolt11

func (l *Lightning) ListPaysToBolt11(bolt11 string) ([]PaymentFields, error)

func (*Lightning) ListPeerChannels

func (l *Lightning) ListPeerChannels(peerId string) (*ListPeerChannelsResponse, error)

List channels for an optional peerId

func (*Lightning) ListPeers

func (l *Lightning) ListPeers() ([]*Peer, error)

Show current peers

func (*Lightning) ListPeersWithLogs

func (l *Lightning) ListPeersWithLogs(level LogLevel) ([]*Peer, error)

Show current peers, if {level} is set, include logs.

func (*Lightning) ListPlugins

func (l *Lightning) ListPlugins() ([]PluginInfo, error)

func (*Lightning) ListSendPays

func (l *Lightning) ListSendPays(bolt11 string) ([]SendPayFields, error)

Show outgoing payments, regarding {bolt11}

func (*Lightning) ListSendPaysAll

func (l *Lightning) ListSendPaysAll() ([]SendPayFields, error)

func (*Lightning) ListSendPaysByHash

func (l *Lightning) ListSendPaysByHash(paymentHash string) ([]SendPayFields, error)

Show outgoing payments, regarding {paymentHash}

func (*Lightning) ListTransactions

func (l *Lightning) ListTransactions() ([]Transaction, error)

func (*Lightning) NewAddr

func (l *Lightning) NewAddr() (string, error)

Get new Bech32 address for the internal wallet.

func (*Lightning) NewAddress

func (l *Lightning) NewAddress(addrType AddressType) (*NewAddrResult, error)

Get new address of type {addrType} from the internal wallet.

func (*Lightning) Pay

func (l *Lightning) Pay(req *PayRequest) (*PaymentSuccess, error)

Send payment as specified by 'Bolt11' with 'MilliSatoshi' (Millisatoshis amount is ignored if the 'Bolt11' includes an amount).

'description' is required if the 'bolt11' includes a description hash.

'riskfactor' is optional, defaults to 1.0 Briefly, the 'riskfactor' is the estimated annual cost of your funds being stuck (as a percentage), multiplied by the percent change of each node failing. Ex: 1% chance of node failure and a 20% annual cost would give you a risk factor of 20. c-lightning defaults to 1.0

'MaxFeePercent' is the max percentage of a payment that can be paid in fees. c-lightning defaults to 0.5.

'ExemptFee' can be used for tiny paymetns which would otherwise be dominated by the fee leveraged by forwarding nodes. Setting 'ExemptFee' allows 'MaxFeePercent' check to be skipped on fees that are smaller than 'ExemptFee'. c-lightning default is 5000 millisatoshi.

c-lightning will keep finding routes and retrying payment until it succeeds or the given 'RetryFor' seconds have elapsed. Note that the command may stop retrying while payment is pending. You can continuing monitoring payment status with the ListSendPays or WaitSendPay. 'RetryFor' defaults to 60 seconds.

'MaxDelay' is used when determining whether a route incurs an acceptable delay. A route will not be used if the estimated delay is above this. Defaults to the configured locktime max (--max-locktime-blocks) Units is in blocks.

func (*Lightning) PayBolt

func (l *Lightning) PayBolt(bolt11 string) (*PaymentSuccess, error)

func (*Lightning) Ping

func (l *Lightning) Ping(peerId string) (*Pong, error)

Send {peerId} a ping of size 128, asking for 128 bytes in response

func (*Lightning) PingWithLen

func (l *Lightning) PingWithLen(peerId string, pingLen, pongByteLen uint) (*Pong, error)

Send {peerId} a ping of length {pingLen} asking for bytes {pongByteLen}

func (*Lightning) PrepareTx

func (l *Lightning) PrepareTx(outputs []*Outputs, feerate *FeeRate, minConf *uint16) (*TxResult, error)

func (*Lightning) PrepareTxWithUtxos

func (l *Lightning) PrepareTxWithUtxos(outputs []*Outputs, feerate *FeeRate, minConf *uint16, utxos []*Utxo) (*TxResult, error)

func (*Lightning) Request

func (l *Lightning) Request(m jrpc2.Method, resp interface{}) error

func (*Lightning) RescanPlugins

func (l *Lightning) RescanPlugins() ([]PluginInfo, error)

func (*Lightning) SendCustomMessage

func (l *Lightning) SendCustomMessage(nodeId, message string) (*CustomMessageResult, error)

func (*Lightning) SendOnion

func (l *Lightning) SendOnion(onion string, hop FirstHop, paymentHash string) (*SendPayFields, error)

func (*Lightning) SendOnionWithDetails

func (l *Lightning) SendOnionWithDetails(onion string, hop FirstHop, paymentHash string, label string, secrets []string, partId *uint64) (*SendPayFields, error)

func (*Lightning) SendPay

func (l *Lightning) SendPay(route []RouteHop, paymentHash, label string, msat uint64, bolt11 string, paymentSecret string, partId uint64) (*SendPayResult, error)

Send along {route} in return for preimage of {paymentHash}

Description and msat are optional.

Generally a client would call GetRoute to resolve a route, then use SendPay to send it. If it fails, it would call GetRoute again to retry.

Response will occur when payment is on its way to the destination. Does not wait for a definitive success or failure. Use 'waitsendpay' to poll or wait for definite success or failure.

'description', if provided, will be returned in 'waitsendpay' and 'listsendpays' results.

'msat', if provided, is the amount that will be recorded as the target payment value. If not specified, it will be the final amount to the destination (specified in route). If specified, then the final amount at the destination must be from the specified 'msat' to twice that value, inclusive. This is intended to obscure payments by overpaying slightly at the destination -- the actual target paymnt is what should be specified as the 'msat' argument.

Once a payment has succeeded, calls to 'SendPay' with the same 'paymentHash' but a different 'msat' or destination will fail; this prevents accidental multiple payments. Calls with the same 'paymentHash', 'msat' and destination as a previous successful payment will return immediately with a success, even if the route is different.

func (*Lightning) SendPayLite

func (l *Lightning) SendPayLite(route []RouteHop, paymentHash string) (*SendPayResult, error)

SendPay, but without description or millisatoshi value

func (*Lightning) SendTx

func (l *Lightning) SendTx(txid string) (*TxResult, error)

Sign and broadcast a transaction created by PrepareTx

func (*Lightning) SetChannelFee

func (l *Lightning) SetChannelFee(id string, baseMsat string, ppm uint32) (*ChannelFeeResult, error)

Set the channel fee for a given channel. 'id' can be a peer id, a channel id, a short channel id, or all, for all channels.

func (*Lightning) SetInvoiceAutoclean

func (l *Lightning) SetInvoiceAutoclean(intervalSeconds, expiredBySeconds uint32) error

Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. Clean up expired invoices that have expired for {expired_by} seconds (default 86400).

func (*Lightning) SetPSBTVersion

func (l *Lightning) SetPSBTVersion(psbt string, version int) (*SetPSBTVersionResponse, error)

func (*Lightning) SetPluginStartDir

func (l *Lightning) SetPluginStartDir(directory string) ([]PluginInfo, error)

func (*Lightning) SetTimeout

func (l *Lightning) SetTimeout(secs uint)

func (*Lightning) Shutdown

func (l *Lightning) Shutdown()

func (*Lightning) SignMessage

func (l *Lightning) SignMessage(message string) (*SignedMessage, error)

func (*Lightning) SignPSBT

func (l *Lightning) SignPSBT(psbt string) (*SignPSBTResponse, error)

func (*Lightning) StartFundChannel

func (l *Lightning) StartFundChannel(id string, amount uint64, announce bool, feerate *FeeRate, closeTo string) (*StartResponse, error)

Returns a string that's a bech32 address. this address is the funding output address.

func (*Lightning) StartPlugin

func (l *Lightning) StartPlugin(pluginName string) ([]PluginInfo, error)

func (*Lightning) StartUp

func (l *Lightning) StartUp(rpcfile, lightningDir string) error

func (*Lightning) Stop

func (l *Lightning) Stop() (string, error)

Shut down the c-lightning process. Will return a string of "Shutting down" on success.

func (*Lightning) StopPlugin

func (l *Lightning) StopPlugin(pluginName string) (string, error)

func (*Lightning) WaitAnyInvoice

func (l *Lightning) WaitAnyInvoice(lastPayIndex uint) (*Invoice, error)

Waits until an invoice is paid, then returns a single entry. Will not return or provide any invoices paid prior to or including the lastPayIndex.

The 'pay index' is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid 'pay index' is 1.

This blocks until it receives a response.

func (*Lightning) WaitAnyInvoiceTimeout

func (l *Lightning) WaitAnyInvoiceTimeout(lastPayIndex uint, timeout uint) (*Invoice, error)

Note that if timeout is zero, it won't be sent. which is fine, a zero timeout doesn't really make a lot of sense

func (*Lightning) WaitInvoice

func (l *Lightning) WaitInvoice(label string) (*Invoice, error)

Wait for invoice to be filled or for invoice to expire. This blocks until a result is returned from the server and by passes client timeout safeguards.

func (*Lightning) WaitSendPay

func (l *Lightning) WaitSendPay(paymentHash string, timeout uint) (*SendPayFields, error)

Polls or waits for the status of an outgoing payment that was initiated by a previous 'SendPay' invocation.

May provide a 'timeout, in seconds. When provided, will return a 200 error code (payment still in progress) if timeout elapses before the payment is definitively concluded (success or fail). If no 'timeout' is provided, the call waits indefinitely.

NB: Blocking. Bypasses the default client request timeout mechanism

func (*Lightning) WaitSendPayPart

func (l *Lightning) WaitSendPayPart(paymentHash string, timeout uint, partId uint64) (*SendPayFields, error)

func (*Lightning) Withdraw

func (l *Lightning) Withdraw(destination string, amount *Sat, feerate *FeeRate, minConf *uint16) (*WithdrawResult, error)

Withdraw sends funds from c-lightning's internal wallet to the address specified in {destination}. Address can be of any Bitcoin accepted type, including bech32.

{satoshi} is the amount to be withdrawn from the wallet.

{feerate} is an optional feerate to use. Can be either a directive (urgent, normal, or slow) or a number with an optional suffix. 'perkw' means the number is interpreted as satoshi-per-kilosipa (weight) and 'perkb' means it is interpreted bitcoind-style as satoshi-per-kilobyte. Omitting the suffix is equivalent to 'perkb' If not set, {feerate} defaults to 'normal'.

func (*Lightning) WithdrawWithUtxos

func (l *Lightning) WithdrawWithUtxos(destination string, amount *Sat, feerate *FeeRate, minConf *uint16, utxos []*Utxo) (*WithdrawResult, error)

type ListChannelRequest

type ListChannelRequest struct {
	ShortChannelId string `json:"short_channel_id,omitempty"`
	Source         string `json:"source,omitempty"`
}

func (ListChannelRequest) Name

func (lc ListChannelRequest) Name() string

type ListConfigsRequest

type ListConfigsRequest struct {
	Config string `json:"config,omitempty"`
}

func (ListConfigsRequest) Name

func (r ListConfigsRequest) Name() string

func (*ListConfigsRequest) New

func (r *ListConfigsRequest) New() interface{}

type ListForwardsRequest

type ListForwardsRequest struct{}

func (*ListForwardsRequest) Name

func (r *ListForwardsRequest) Name() string

type ListFundsRequest

type ListFundsRequest struct{}

func (*ListFundsRequest) Name

func (r *ListFundsRequest) Name() string

type ListInvoiceRequest

type ListInvoiceRequest struct {
	Label string `json:"label,omitempty"`
}

func (ListInvoiceRequest) Name

func (r ListInvoiceRequest) Name() string

type ListNodeRequest

type ListNodeRequest struct {
	NodeId string `json:"id,omitempty"`
}

func (ListNodeRequest) Name

func (ln ListNodeRequest) Name() string

type ListPaysRequest

type ListPaysRequest struct {
	Bolt11 string `json:"bolt11,omitempty"`
}

func (ListPaysRequest) Name

func (r ListPaysRequest) Name() string

type ListPeerChannelsRequest

type ListPeerChannelsRequest struct {
	PeerId string `json:"id,omitempty"`
}

func (ListPeerChannelsRequest) Name

type ListPeerChannelsResponse

type ListPeerChannelsResponse struct {
	Channels []*PeerChannel `json:"channels,omitempty"`
}

type ListPeersRequest

type ListPeersRequest struct {
	PeerId string `json:"id,omitempty"`
	Level  string `json:"level,omitempty"`
}

func (ListPeersRequest) Name

func (r ListPeersRequest) Name() string

type ListSendPaysRequest

type ListSendPaysRequest struct {
	Bolt11      string `json:"bolt11,omitempty"`
	PaymentHash string `json:"payment_hash,omitempty"`
}

func (ListSendPaysRequest) Name

func (r ListSendPaysRequest) Name() string

type Log

type Log struct {
	Type       string `json:"type"`
	Time       string `json:"time,omitempty"`
	Source     string `json:"source,omitempty"`
	Message    string `json:"log,omitempty"`
	NumSkipped uint   `json:"num_skipped,omitempty"`
}

type LogLevel

type LogLevel int
const (
	None LogLevel = iota
	Info
	Unusual
	Debug
	Io
)

func (LogLevel) String

func (l LogLevel) String() string

type LogNotification

type LogNotification struct {
	Level   string `json:"level"`
	Message string `json:"message"`
}

func (*LogNotification) Name

func (r *LogNotification) Name() string

type LogRequest

type LogRequest struct {
	Level string `json:"level,omitempty"`
}

func (LogRequest) Name

func (r LogRequest) Name() string

type LogResponse

type LogResponse struct {
	CreatedAt string `json:"created_at"`
	BytesUsed uint64 `json:"bytes_used"`
	BytesMax  uint64 `json:"bytes_max"`
	Logs      []Log  `json:"log"`
}

type MSat

type MSat struct {
	Value uint64
}

func NewMsat

func NewMsat(val uint64) *MSat

func (*MSat) ConvertSat

func (m *MSat) ConvertSat() *Sat

Always rounds up to nearest satoshi

func (*MSat) String

func (m *MSat) String() string

type Manifest

type Manifest struct {
	Options       []Option     `json:"options"`
	RpcMethods    []*RpcMethod `json:"rpcmethods"`
	Dynamic       bool         `json:"dynamic"`
	Subscriptions []string     `json:"subscriptions,omitempty"`
	Hooks         []Hook       `json:"hooks,omitempty"`
	FeatureBits   *FeatureBits `json:"featurebits,omitempty"`
}

type MemDumpEntry

type MemDumpEntry struct {
	ParentPtr string          `json:"parent"`
	ValuePtr  string          `json:"value"`
	Label     string          `json:"label"`
	Children  []*MemDumpEntry `json:"children"`
}

type MemLeak

type MemLeak struct {
	PointerValue string   `json:"value"`
	Label        string   `json:"label"`
	Backtrace    []string `json:"backtrace"`
	Parents      []string `json:"parents"`
}

type MemLeakResult

type MemLeakResult struct {
	Leaks []*MemLeak `json:"leaks"`
}

type Method_EstimateFees

type Method_EstimateFees struct {
	// contains filtered or unexported fields
}

func (Method_EstimateFees) Call

func (m Method_EstimateFees) Call() (jrpc2.Result, error)

func (Method_EstimateFees) Name

func (m Method_EstimateFees) Name() string

func (Method_EstimateFees) New

func (m Method_EstimateFees) New() interface{}

type Method_GetChainInfo

type Method_GetChainInfo struct {
	// contains filtered or unexported fields
}

func (Method_GetChainInfo) Call

func (m Method_GetChainInfo) Call() (jrpc2.Result, error)

func (Method_GetChainInfo) Name

func (m Method_GetChainInfo) Name() string

func (Method_GetChainInfo) New

func (m Method_GetChainInfo) New() interface{}

type Method_GetFeeRate

type Method_GetFeeRate struct {
	Blocks uint32 `json:"blocks"`
	// Will be either CONSERVATIVE or ECONOMICAL
	Mode string `json:"mode"`
	// contains filtered or unexported fields
}

func (Method_GetFeeRate) Call

func (m Method_GetFeeRate) Call() (jrpc2.Result, error)

func (Method_GetFeeRate) Name

func (m Method_GetFeeRate) Name() string

func (Method_GetFeeRate) New

func (m Method_GetFeeRate) New() interface{}

type Method_GetRawBlockByHeight

type Method_GetRawBlockByHeight struct {
	Height uint32 `json:"height"`
	// contains filtered or unexported fields
}

func (Method_GetRawBlockByHeight) Call

func (Method_GetRawBlockByHeight) Name

func (Method_GetRawBlockByHeight) New

func (m Method_GetRawBlockByHeight) New() interface{}

type Method_GetUtxOut

type Method_GetUtxOut struct {
	TxId string `json:"txid"`
	Vout uint32 `json:"vout"`
	// contains filtered or unexported fields
}

func (Method_GetUtxOut) Call

func (m Method_GetUtxOut) Call() (jrpc2.Result, error)

func (Method_GetUtxOut) Name

func (m Method_GetUtxOut) Name() string

func (Method_GetUtxOut) New

func (m Method_GetUtxOut) New() interface{}

type Method_SendRawTransaction

type Method_SendRawTransaction struct {
	TxString string `json:"tx"`
	// contains filtered or unexported fields
}

func (Method_SendRawTransaction) Call

func (Method_SendRawTransaction) Name

func (Method_SendRawTransaction) New

func (m Method_SendRawTransaction) New() interface{}

type NewAddrRequest

type NewAddrRequest struct {
	AddressType string `json:"addresstype,omitempty"`
}

func (NewAddrRequest) Name

func (r NewAddrRequest) Name() string

type NewAddrResult

type NewAddrResult struct {
	Bech32     string `json:"bech32"`
	P2SHSegwit string `json:"p2sh-segwit"`
}

type Node

type Node struct {
	Id            string    `json:"nodeid"`
	Alias         string    `json:"alias"`
	Color         string    `json:"color"`
	LastTimestamp uint      `json:"last_timestamp"`
	Features      *Hexed    `json:"features"`
	Addresses     []Address `json:"addresses"`
}

type NodeInfo

type NodeInfo struct {
	Id                         string            `json:"id"`
	Alias                      string            `json:"alias"`
	Color                      string            `json:"color"`
	PeerCount                  int               `json:"num_peers"`
	PendingChannelCount        int               `json:"num_pending_channels"`
	ActiveChannelCount         int               `json:"num_active_channels"`
	InactiveChannelCount       int               `json:"num_inactive_channels"`
	Addresses                  []Address         `json:"address"`
	Binding                    []AddressInternal `json:"binding"`
	Version                    string            `json:"version"`
	Blockheight                uint              `json:"blockheight"`
	Network                    string            `json:"network"`
	FeesCollectedMilliSatoshis uint64            `json:"msatoshi_fees_collected,omitempty"`
	FeesCollected              Amount            `json:"fees_collected_msat"`
	LightningDir               string            `json:"lightning-dir"`
	WarningBitcoinSync         string            `json:"warning_bitcoind_sync,omitempty"`
	WarningLightningSync       string            `json:"warning_lightningd_sync,omitempty"`
}

func (*NodeInfo) IsBitcoindSync

func (n *NodeInfo) IsBitcoindSync() bool

func (*NodeInfo) IsLightningdSync

func (n *NodeInfo) IsLightningdSync() bool

type OnchainEstimate

type OnchainEstimate struct {
	OpeningChannelSatoshis  uint64 `json:"opening_channel_satoshis"`
	MutualCloseSatoshis     uint64 `json:"mutual_close_satoshis"`
	UnilateralCloseSatoshis uint64 `json:"unilateral_close_satoshis"`
	HtlcTimeoutSatoshis     uint64 `json:"htlc_timeout_satoshis"`
	HtlcSuccessSatoshis     uint64 `json:"htlc_success_satoshis"`
}

type Onion

type Onion struct {
	Payload      string `json:"payload"`
	NextOnion    string `json:"next_onion"`
	SharedSecret string `json:"shared_secret"`
	// Note that 'PerHop' is deprecated
	PerHop *PerHop `json:"per_hop_v0"`
	// The two type options are: 'legacy' and 'tlv'
	Type string `json:"type"`
	// Only included if there's a next hop/'forward channel'
	ShortChannelId string `json:"short_channel_id"`
	OutgoingCltv   uint   `json:"outgoing_cltv_value"`
	ForwardAmount  string `json:"forward_amount"`
	PaymentSecret  string `json:"payment_secret"`
	// Only included if has payment secret
	TotalMilliSatoshi string `json:"total_msat"`
}

type OpenChannel

type OpenChannel struct {
	PeerId                            string `json:"id"`
	FundingSatoshis                   string `json:"funding_satoshis"`
	PushMilliSatoshis                 string `json:"push_msat"`
	DustLimitSatoshis                 string `json:"dust_limit_satoshis"`
	MaxHtlcValueInFlightMilliSatoshis string `json:"max_htlc_value_in_flight_msat"`
	ChannelReserveSatoshis            string `json:"channel_reserve_satoshis"`
	HtlcMinimumMillisatoshis          string `json:"htlc_minimum_msat"`
	FeeratePerKw                      int    `json:"feerate_per_kw"`
	ToSelfDelay                       int    `json:"to_self_delay"`
	MaxAcceptedHtlcs                  int    `json:"max_accepted_htlcs"`
	ChannelFlags                      int    `json:"channel_flags"`
	ShutdownScriptPubkey              string `json:"shutdown_scriptpubkey"`
}

type OpenChannelEvent

type OpenChannelEvent struct {
	OpenChannel OpenChannel `json:"openchannel"`
	// contains filtered or unexported fields
}

func (*OpenChannelEvent) Call

func (oc *OpenChannelEvent) Call() (jrpc2.Result, error)

func (*OpenChannelEvent) Continue

func (oc *OpenChannelEvent) Continue() *OpenChannelResponse

func (*OpenChannelEvent) ContinueWithCloseTo

func (oc *OpenChannelEvent) ContinueWithCloseTo(address string) *OpenChannelResponse

func (*OpenChannelEvent) Name

func (oc *OpenChannelEvent) Name() string

func (*OpenChannelEvent) New

func (oc *OpenChannelEvent) New() interface{}

func (*OpenChannelEvent) Reject

func (oc *OpenChannelEvent) Reject(errorMessage string) *OpenChannelResponse

type OpenChannelResponse

type OpenChannelResponse struct {
	Result OpenChannelResult `json:"result"`
	// Only allowed if result is "reject"
	// Sent back to peer.
	Message        string `json:"error_message,omitempty"`
	CloseToAddress string `json:"close_to,omitempty"`
}

type OpenChannelResult

type OpenChannelResult string
const OcContinue OpenChannelResult = "continue"
const OcReject OpenChannelResult = "reject"

type Option

type Option interface {
	GetName() string
	GetDesc() string
	GetDefault() interface{}
	GetValue() interface{}
	Set(interface{}) error
	Type() string
}

type OptionType

type OptionType string

type Output

type Output struct {
	TxId     string `json:"txid"`
	Output   uint   `json:"output"`
	OldState uint   `json:"oldstate"`
	NewState uint   `json:"newstate"`
}

type Outputs

type Outputs struct {
	Address string
	Satoshi uint64
}

func (*Outputs) Marshal

func (o *Outputs) Marshal() []byte

type PayAttempt

type PayAttempt struct {
	Strategy          string            `json:"strategy"`
	AgeInSeconds      uint64            `json:"age_in_seconds"`
	DurationInSeconds uint64            `json:"duration_in_seconds"`
	StartTime         string            `json:"start_time"`
	EndTime           string            `json:"end_time,omitempty"`
	ExcludedChannels  []string          `json:"excluded_channels,omitempty"`
	Route             []RouteHop        `json:"route,omitempty"`
	Failure           PayAttemptFailure `json:"failure,omitempty"`
}

type PayAttemptFailure

type PayAttemptFailure struct {
	Code    uint32           `json:"code"`
	Message string           `json:"message"`
	Data    PaymentErrorData `json:"data,omitempty"`
}

type PayFailure

type PayFailure struct {
	Message       string     `json:"message"`
	Type          string     `json:"type"`
	OnionReply    string     `json:"onionreply"`
	ErringIndex   int        `json:"erring_index"`
	FailCode      int        `json:"failcode"`
	ErringNode    string     `json:"erring_node"`
	ErringChannel string     `json:"erring_channel"`
	ChannelUpdate string     `json:"channel_update"`
	Route         []RouteHop `json:"route"`
}

type PayRequest

type PayRequest struct {
	Bolt11        string  `json:"bolt11"`
	MilliSatoshi  uint64  `json:"msatoshi,omitempty"`
	Desc          string  `json:"description,omitempty"`
	RiskFactor    float32 `json:"riskfactor,omitempty"`
	MaxFeePercent float32 `json:"maxfeeprecent,omitempty"`
	RetryFor      uint    `json:"retry_for,omitempty"`
	MaxDelay      uint    `json:"maxdelay,omitempty"`
	ExemptFee     bool    `json:"exemptfee,omitempty"`
	// MaxFee is pointer, because sometimes users want to set MaxFee=0
	MaxFee *uint64 `json:"maxfee,omitempty"`
}

func (PayRequest) Name

func (r PayRequest) Name() string

type PayStatus

type PayStatus struct {
	Bolt11       string       `json:"bolt11"`
	MilliSatoshi uint64       `json:"msatoshi,omitempty"`
	AmountMsat   Amount       `json:"amount_msat"`
	Destination  string       `json:"destination"`
	Attempts     []PayAttempt `json:"attempts"`
}

type PayStatusRequest

type PayStatusRequest struct {
	Bolt11 string `json:"bolt11,omitempty"`
}

func (PayStatusRequest) Name

func (r PayStatusRequest) Name() string

type Payment

type Payment struct {
	Label         string `json:"label"`
	PreImage      string `json:"preimage"`
	MilliSatoshis string `json:"msat"`
}

type PaymentError

type PaymentError struct {
	*jrpc2.RpcError
	Data *PaymentErrorData
}

type PaymentErrorData

type PaymentErrorData struct {
	*PaymentFields
	OnionReply      string `json:"onionreply,omitempty"`
	ErringIndex     uint64 `json:"erring_index"`
	FailCode        int    `json:"failcode"`
	ErringNode      string `json:"erring_node,omitempty"`
	ErringChannel   string `json:"erring_channel,omitempty"`
	ErringDirection int    `json:"erring_direction,omitempty"`
	FailCodeName    string `json:"failcodename,omitempty"`
	RawMessage      string `json:"raw_message,omitempty"`
}

type PaymentFields

type PaymentFields struct {
	Bolt11                 string `json:"bolt11"`
	Status                 string `json:"status"`
	PaymentPreImage        string `json:"payment_preimage"`
	AmountSentMilliSatoshi Amount `json:"amount_sent_msat"`
	Label                  string `json:"label,omitempty"`
}

type PaymentSuccess

type PaymentSuccess struct {
	SendPayFields
	GetRouteTries int          `json:"getroute_tries"`
	SendPayTries  int          `json:"sendpay_tries"`
	Route         []RouteHop   `json:"route"`
	Failures      []PayFailure `json:"failures"`
}

todo: there's lots of different data that comes back for payment failures, that for now we totally lose

type Peer

type Peer struct {
	Id           string         `json:"id"`
	Connected    bool           `json:"connected"`
	NetAddresses []string       `json:"netaddr"`
	Features     *Hexed         `json:"features"`
	Channels     []*PeerChannel `json:"channels"`
	Logs         []*Log         `json:"log,omitempty"`
}

type PeerChannel

type PeerChannel struct {
	PeerId                    string        `json:"peer_id"`
	PeerConnected             bool          `json:"peer_connected"`
	Reestablished             bool          `json:"reestablished"`
	ChannelType               ChannelType   `json:"channel_type"`
	IgnoreFeeLimits           bool          `json:"ignore_fee_limits"`
	Updates                   Updates       `json:"updates"`
	LastStableConnection      int64         `json:"last_stable_connection"`
	State                     string        `json:"state"`
	ScratchTxId               string        `json:"scratch_txid"`
	LastTxFeeMsat             Amount        `json:"last_tx_fee_msat"`
	LostState                 bool          `json:"lost_state"`
	Feerate                   Feerate       `json:"feerate"`
	Owner                     string        `json:"owner"`
	ShortChannelId            string        `json:"short_channel_id"`
	ChannelDirection          int           `json:"direction"`
	ChannelId                 string        `json:"channel_id"`
	FundingTxId               string        `json:"funding_txid"`
	FundingOutNum             int           `json:"funding_outnum"`
	CloseToAddress            string        `json:"close_to_addr,omitempty"`
	CloseToScript             string        `json:"close_to,omitempty"`
	Private                   bool          `json:"private"`
	Opener                    string        `json:"opener"`
	Alias                     Alias         `json:"alias"`
	Features                  []string      `json:"features"`
	Funding                   Funding       `json:"funding"`
	ToUsMsat                  Amount        `json:"to_us_msat"`
	MinToUsMsat               Amount        `json:"min_to_us_msat"`
	MilliSatoshiToUsMax       uint64        `json:"msatoshi_to_us_max,omitempty"`
	MaxToUsMsat               Amount        `json:"max_to_us_msat"`
	TotalMsat                 Amount        `json:"total_msat"`
	FeeBaseMsat               uint64        `json:"fee_base_msat"`
	FeeProportionalMillionths uint64        `json:"fee_proportional_millionths"`
	DustLimitMsat             Amount        `json:"dust_limit_msat"`
	MaxTotalHtlcInMsat        Amount        `json:"max_total_htlc_in_msat"`
	TheirReserveMsat          Amount        `json:"their_reserve_msat"`
	OurReserveMsat            Amount        `json:"our_reserve_msat"`
	SpendableMsat             Amount        `json:"spendable_msat"`
	ReceivableMsat            Amount        `json:"receivable_msat"`
	MinimumHtlcInMsat         Amount        `json:"minimum_htlc_in_msat"`
	MinimumHtlcOutMsat        Amount        `json:"minimum_htlc_out_msat"`
	MaximumHtlcOutMsat        Amount        `json:"maximum_htlc_out_msat"`
	TheirToSelfDelay          uint          `json:"their_to_self_delay"`
	OurToSelfDelay            uint          `json:"our_to_self_delay"`
	MaxAcceptedHtlcs          uint          `json:"max_accepted_htlcs"`
	StateChanges              []StateChange `json:"state_changes"`
	Status                    []string      `json:"status"`
	InPaymentsOffered         uint64        `json:"in_payments_offered"`
	IncomingOfferedMsat       Amount        `json:"in_offered_msat"`
	InPaymentsFulfilled       uint64        `json:"in_payments_fulfilled"`
	IncomingFulfilledMsat     Amount        `json:"in_fulfilled_msat"`
	OutPaymentsOffered        uint64        `json:"out_payments_offered"`
	OutgoingOfferedMsat       Amount        `json:"out_offered_msat"`
	OutPaymentsFulfilled      uint64        `json:"out_payments_fulfilled"`
	OutgoingFulfilledMsat     Amount        `json:"out_fulfilled_msat"`
	Htlcs                     []*Htlc       `json:"htlcs"`
}

type PeerConnectedEvent

type PeerConnectedEvent struct {
	Peer PeerEvent `json:"peer"`
	// contains filtered or unexported fields
}

This hook is called whenever a peer has connected and successfully completed

the cryptographic handshake. The parameters have the following structure if
there is a channel with the peer:

func (*PeerConnectedEvent) Call

func (pc *PeerConnectedEvent) Call() (jrpc2.Result, error)

func (*PeerConnectedEvent) Continue

func (pc *PeerConnectedEvent) Continue() *PeerConnectedResponse

func (*PeerConnectedEvent) Disconnect

func (pc *PeerConnectedEvent) Disconnect(errMsg string) *PeerConnectedResponse

func (*PeerConnectedEvent) Name

func (pc *PeerConnectedEvent) Name() string

func (*PeerConnectedEvent) New

func (pc *PeerConnectedEvent) New() interface{}

type PeerConnectedResponse

type PeerConnectedResponse struct {
	Result       _PeerConnectedResult `json:"result"`
	ErrorMessage string               `json:"error_message,omitempty"`
}

type PeerEvent

type PeerEvent struct {
	PeerId string `json:"id"`
	Addr   string `json:"addr"`
	// fixme: use Hexed
	Features string `json:"features"`
}

type PerHop

type PerHop struct {
	Realm                      string `json:"realm"`
	ShortChannelId             string `json:"short_channel_id"`
	ForwardAmountMilliSatoshis string `json:"forward_amount"`
	OutgoingCltvValue          int    `json:"outgoing_cltv_value"`
}

type PingRequest

type PingRequest struct {
	Id        string `json:"id"`
	Len       uint   `json:"len"`
	PongBytes uint   `json:"pongbytes"`
}

func (PingRequest) Name

func (r PingRequest) Name() string

type Plugin

type Plugin struct {
	Config *Config
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(initHandler func(p *Plugin, o map[string]Option, c *Config)) *Plugin

func (*Plugin) AddChannelFeatures

func (p *Plugin) AddChannelFeatures(bits []byte)

func (*Plugin) AddInitFeatures

func (p *Plugin) AddInitFeatures(bits []byte)

func (*Plugin) AddInvoiceFeatures

func (p *Plugin) AddInvoiceFeatures(bits []byte)

func (*Plugin) AddNodeFeatures

func (p *Plugin) AddNodeFeatures(bits []byte)

func (*Plugin) GetBoolOption

func (p *Plugin) GetBoolOption(name string) (bool, error)

func (*Plugin) GetIntOption

func (p *Plugin) GetIntOption(name string) (int, error)

func (*Plugin) GetOption

func (p *Plugin) GetOption(name string) (string, error)

this always returns a string option. left as is for legacy reasons

func (*Plugin) IsOptionFlagged

func (p *Plugin) IsOptionFlagged(name string) (bool, error)

func (*Plugin) Log

func (p *Plugin) Log(message string, level LogLevel)

func (*Plugin) RegisterHooks

func (p *Plugin) RegisterHooks(hooks *Hooks) error

func (*Plugin) RegisterMethod

func (p *Plugin) RegisterMethod(m *RpcMethod) error

func (*Plugin) RegisterNewBoolOption

func (p *Plugin) RegisterNewBoolOption(optionName, description string, defaultVal bool) error

func (*Plugin) RegisterNewFlagOption

func (p *Plugin) RegisterNewFlagOption(optionName, description string) error

func (*Plugin) RegisterNewIntOption

func (p *Plugin) RegisterNewIntOption(optionName, description string, defaultVal int) error

func (*Plugin) RegisterNewOption

func (p *Plugin) RegisterNewOption(optionName, description, defaultVal string) error

func (*Plugin) RegisterOption

func (p *Plugin) RegisterOption(o Option) error

func (*Plugin) SetDynamic

func (p *Plugin) SetDynamic(d bool)

func (*Plugin) Start

func (p *Plugin) Start(in, out *os.File) error

func (*Plugin) Stop

func (p *Plugin) Stop()

func (*Plugin) SubscribeChannelOpened

func (p *Plugin) SubscribeChannelOpened(cb func(c *ChannelOpened))

func (*Plugin) SubscribeConnect

func (p *Plugin) SubscribeConnect(cb func(c *ConnectEvent))

func (*Plugin) SubscribeDisconnect

func (p *Plugin) SubscribeDisconnect(cb func(c *DisconnectEvent))

func (*Plugin) SubscribeForwardings

func (p *Plugin) SubscribeForwardings(cb func(c *Forwarding))

func (*Plugin) SubscribeInvoicePaid

func (p *Plugin) SubscribeInvoicePaid(cb func(c *Payment))

func (*Plugin) SubscribeSendPayFailure

func (p *Plugin) SubscribeSendPayFailure(cb func(c *SendPayFailure))

func (*Plugin) SubscribeSendPaySuccess

func (p *Plugin) SubscribeSendPaySuccess(cb func(c *SendPaySuccess))

func (*Plugin) SubscribeShutdown

func (p *Plugin) SubscribeShutdown(cb func())

func (*Plugin) SubscribeWarnings

func (p *Plugin) SubscribeWarnings(cb func(c *Warning))

func (*Plugin) UnregisterMethod

func (p *Plugin) UnregisterMethod(rpc *RpcMethod) error

func (*Plugin) UnregisterOption

func (p *Plugin) UnregisterOption(o Option) error

type PluginInfo

type PluginInfo struct {
	Name   string `json:"name"`
	Active bool   `json:"active"`
}

type PluginRequest

type PluginRequest struct {
	Subcommand string `json:"subcommand"`
}

func (*PluginRequest) Name

func (r *PluginRequest) Name() string

type PluginRequestDir

type PluginRequestDir struct {
	Subcommand string `json:"subcommand"`
	Directory  string `json:"directory"`
}

func (*PluginRequestDir) Name

func (r *PluginRequestDir) Name() string

type PluginRequestPlugin

type PluginRequestPlugin struct {
	Subcommand string `json:"subcommand"`
	PluginName string `json:"plugin"`
}

func (*PluginRequestPlugin) Name

func (r *PluginRequestPlugin) Name() string

type Pong

type Pong struct {
	TotalLen int `json:"totlen"`
}

type QueryShortChannelIdsResponse

type QueryShortChannelIdsResponse struct {
	IsComplete bool `json:"complete"`
}

type Route

type Route struct {
	Hops []RouteHop `json:"route"`
}

type RouteHop

type RouteHop struct {
	Id             string `json:"id"`
	ShortChannelId string `json:"channel"`
	AmountMsat     Amount `json:"amount_msat,omitempty"`
	Delay          uint32 `json:"delay"`
	Direction      uint32 `json:"direction,omitempty"`
}

type RouteRequest

type RouteRequest struct {
	PeerId        string   `json:"id"`
	MilliSatoshis uint64   `json:"amount_msat,omitempty"`
	RiskFactor    float32  `json:"riskfactor"`
	Cltv          uint     `json:"cltv"`
	FromId        string   `json:"fromid,omitempty"`
	FuzzPercent   float32  `json:"fuzzpercent"`
	Seed          string   `json:"seed,omitempty"`
	Exclude       []string `json:"exclude,omitempty"`
	MaxHops       int32    `json:"maxhops,omitempty"`
}

func (RouteRequest) Name

func (rr RouteRequest) Name() string

type RpcCmd

type RpcCmd struct {
	ParsedId   json.RawMessage `json:"id"`
	MethodName string          `json:"method"`
	RawParams  json.RawMessage `json:"params"`
	// contains filtered or unexported fields
}

func (*RpcCmd) Get

func (r *RpcCmd) Get() (jrpc2.Method, error)

magic to get the method + params out

func (*RpcCmd) Id

func (r *RpcCmd) Id() (*jrpc2.Id, error)

type RpcCommandEvent

type RpcCommandEvent struct {
	Cmd RpcCmd `json:"rpc_command"`
	// contains filtered or unexported fields
}

func (*RpcCommandEvent) Call

func (rc *RpcCommandEvent) Call() (jrpc2.Result, error)

func (*RpcCommandEvent) Continue

func (rc *RpcCommandEvent) Continue() *RpcCommandResponse

func (*RpcCommandEvent) Name

func (rc *RpcCommandEvent) Name() string

func (*RpcCommandEvent) New

func (rc *RpcCommandEvent) New() interface{}

func (*RpcCommandEvent) ReplaceWith

func (rc *RpcCommandEvent) ReplaceWith(m jrpc2.Method) *RpcCommandResponse

Replace the existing command with a new command. for usability reasons, we unilaterally reuse the id of the original command

func (*RpcCommandEvent) ReturnError

func (rc *RpcCommandEvent) ReturnError(errMsg string, errCode int) (*RpcCommandResponse, error)

func (*RpcCommandEvent) ReturnResult

func (rc *RpcCommandEvent) ReturnResult(resp RpcCommand_Return) (*RpcCommandResponse, error)

type RpcCommandResponse

type RpcCommandResponse struct {
	// deprecated in v0.8.1
	Continue   *bool              `json:"continue,omitempty"`
	Result     _RpcCommand_Result `json:"result,omitempty"`
	ReplaceObj *jrpc2.Request     `json:"replace,omitempty"`
	ReturnObj  json.RawMessage    `json:"return,omitempty"`
}

the result can be any of the following. providing more than one's behavior is undefined. the API around this should protect you from that, however

type RpcCommand_Return

type RpcCommand_Return interface{}

type RpcMethod

type RpcMethod struct {
	Method   jrpc2.ServerMethod
	Desc     string
	LongDesc string
	Category string
}

func NewInitRpcMethod

func NewInitRpcMethod(p *Plugin) *RpcMethod

func NewManifestRpcMethod

func NewManifestRpcMethod(p *Plugin) *RpcMethod

func NewRpcMethod

func NewRpcMethod(method jrpc2.ServerMethod, desc string) *RpcMethod

func (*RpcMethod) Description

func (r *RpcMethod) Description() string

func (*RpcMethod) MarshalJSON

func (r *RpcMethod) MarshalJSON() ([]byte, error)

type Sat

type Sat struct {
	Value   uint64
	SendAll bool
}

func AllSats

func AllSats() *Sat

func ConvertBtc

func ConvertBtc(btc float64) *Sat

func NewSat

func NewSat(amount int) *Sat

func NewSat64

func NewSat64(amount uint64) *Sat

func (*Sat) ConvertMsat

func (s *Sat) ConvertMsat() *MSat

func (*Sat) RawString

func (s *Sat) RawString() string

func (*Sat) String

func (s *Sat) String() string

type SendOnionRequest

type SendOnionRequest struct {
	Onion         string   `json:"onion"`
	FirstHop      FirstHop `json:"first_hop"`
	PaymentHash   string   `json:"payment_hash"`
	Label         string   `json:"label,omitempty"`
	SharedSecrets []string `json:"shared_secrets,omitempty"`
	// For MPP payments!
	PartId uint64 `json:"partid,omitempty"`
}

func (SendOnionRequest) Name

func (r SendOnionRequest) Name() string

type SendPayFailure

type SendPayFailure struct {
	Code    int                `json:"code"`
	Message string             `json:"message"`
	Data    SendPayFailureData `json:"data"`
}

type SendPayFailureData

type SendPayFailureData struct {
	Id                     int    `json:"id"`
	PaymentHash            string `json:"payment_hash"`
	Destination            string `json:"destination"`
	MilliSatoshi           uint64 `json:"msatoshi"`
	AmountMilliSatoshi     string `json:"amount_msat"`
	AmountSent             uint64 `json:"msatoshi_sent"`
	AmountSentMilliSatoshi string `json:"amount_sent_msat"`
	Status                 string `json:"status"`
	CreatedAt              uint64 `json:"created_at"`
	ErringIndex            uint64 `json:"erring_index"`
	FailCode               int    `json:"failcode"`
	ErringNode             string `json:"erring_node"`
	ErringChannel          string `json:"erring_channel"`
	ErringDirection        int    `json:"erring_direction"`
	FailCodeName           string `json:"failcodename"`
}

type SendPayFailureEvent

type SendPayFailureEvent struct {
	SendPayFailure *SendPayFailure `json:"sendpay_failure"`
	// contains filtered or unexported fields
}

func (*SendPayFailureEvent) Call

func (e *SendPayFailureEvent) Call() (jrpc2.Result, error)

func (*SendPayFailureEvent) Name

func (e *SendPayFailureEvent) Name() string

func (*SendPayFailureEvent) New

func (e *SendPayFailureEvent) New() interface{}

type SendPayFields

type SendPayFields struct {
	Id                    uint64  `json:"id"`
	PaymentHash           string  `json:"payment_hash"`
	Destination           string  `json:"destination,omitempty"`
	AmountMilliSatoshiRaw uint64  `json:"msatoshi,omitempty"`
	AmountMilliSatoshi    Amount  `json:"amount_msat"`
	MilliSatoshiSentRaw   uint64  `json:"msatoshi_sent,omitempty"`
	MilliSatoshiSent      Amount  `json:"amount_sent_msat"`
	CreatedAt             float64 `json:"created_at"`
	Status                string  `json:"status"`
	PaymentPreimage       string  `json:"payment_preimage,omitempty"`
	Label                 string  `json:"label,omitempty"`
	Bolt11                string  `json:"bolt11,omitempty"`
	PartId                uint64  `json:"partid,omitempty"`
	ErrorOnion            string  `json:"erroronion,omitempty"`
}

type SendPayRequest

type SendPayRequest struct {
	Route         []RouteHop `json:"route"`
	PaymentHash   string     `json:"payment_hash"`
	Label         string     `json:"label,omitempty"`
	MilliSatoshis uint64     `json:"amount_msat,omitempty"`
	Bolt11        string     `json:"bolt11,omitempty"`
	PaymentSecret string     `json:"payment_secret,omitempty"`
	PartId        uint64     `json:"partid,omitempty"`
}

func (SendPayRequest) Name

func (r SendPayRequest) Name() string

type SendPayResult

type SendPayResult struct {
	Message string `json:"message"`
	SendPayFields
}

type SendPaySuccess

type SendPaySuccess struct {
	Id                     uint    `json:"id"`
	PaymentHash            string  `json:"payment_hash"`
	Destination            string  `json:"destination"`
	MilliSatoshi           uint64  `json:"msatoshi"`
	AmountMilliSatoshi     string  `json:"amount_msat"`
	AmountSent             uint64  `json:"msatoshi_sent"`
	AmountSentMilliSatoshi string  `json:"amount_sent_msat"`
	CreatedAt              float64 `json:"created_at"`
	Status                 string  `json:"status"`
	PaymentPreimage        string  `json:"payment_preimage"`
}

type SendPaySuccessEvent

type SendPaySuccessEvent struct {
	SendPaySuccess *SendPaySuccess `json:"sendpay_success"`
	// contains filtered or unexported fields
}

func (*SendPaySuccessEvent) Call

func (e *SendPaySuccessEvent) Call() (jrpc2.Result, error)

func (*SendPaySuccessEvent) Name

func (e *SendPaySuccessEvent) Name() string

func (*SendPaySuccessEvent) New

func (e *SendPaySuccessEvent) New() interface{}

type SetChannelFeeRequest

type SetChannelFeeRequest struct {
	Id                string `json:"id"`
	BaseMilliSatoshis string `json:"base,omitempty"`
	PartPerMillion    uint32 `json:"ppm,omitempty"`
}

func (*SetChannelFeeRequest) Name

func (r *SetChannelFeeRequest) Name() string

type SetPSBTVersionRequest

type SetPSBTVersionRequest struct {
	Psbt    string `json:"psbt"`
	Version int    `json:"version"`
}

func (SetPSBTVersionRequest) Name

func (r SetPSBTVersionRequest) Name() string

type SetPSBTVersionResponse

type SetPSBTVersionResponse struct {
	Psbt string `"json:"psbt"`
}

type SharedSecretRequest

type SharedSecretRequest struct {
	Point string `json:"point"`
}

func (*SharedSecretRequest) Name

func (r *SharedSecretRequest) Name() string

type SharedSecretResp

type SharedSecretResp struct {
	SharedSecret string `json:"shared_secret"`
}

type ShutdownEvent

type ShutdownEvent struct {
	// contains filtered or unexported fields
}

func (*ShutdownEvent) Call

func (e *ShutdownEvent) Call() (jrpc2.Result, error)

func (*ShutdownEvent) Name

func (e *ShutdownEvent) Name() string

func (*ShutdownEvent) New

func (e *ShutdownEvent) New() interface{}

type SignMessageRequest

type SignMessageRequest struct {
	Message string `json:"message"`
}

func (SignMessageRequest) Name

func (r SignMessageRequest) Name() string

type SignPSBTRequest

type SignPSBTRequest struct {
	Psbt string `json:"psbt"`
}

func (SignPSBTRequest) Name

func (r SignPSBTRequest) Name() string

type SignPSBTResponse

type SignPSBTResponse struct {
	SignedPSBT string `json:"signed_psbt"`
}

type SignedMessage

type SignedMessage struct {
	Signature string `json:"signature"`
	RecId     string `json:"recid"`
	ZBase     string `json:"zbase"`
}

type StartResponse

type StartResponse struct {
	Address      string `json:"funding_address"`
	ScriptPubkey string `json:"scriptpubkey"`
}

type StateChange

type StateChange struct {
	Timestamp string `json:"timestamp"`
	OldState  string `json:"old_state"`
	NewState  string `json:"new_state"`
	Cause     string `json:"cause"`
	Message   string `json:"message"`
}

type StopRequest

type StopRequest struct{}

func (StopRequest) Name

func (r StopRequest) Name() string

type StringOption

type StringOption struct {
	Name string

	Default string
	Val     string
	// contains filtered or unexported fields
}

func NewOption

func NewOption(name, desc, defaultValue string) *StringOption

func NewStringOption

func NewStringOption(name, description, defaultValue string) *StringOption

func (*StringOption) GetDefault

func (o *StringOption) GetDefault() interface{}

func (*StringOption) GetDesc

func (o *StringOption) GetDesc() string

func (*StringOption) GetName

func (o *StringOption) GetName() string

func (*StringOption) GetValue

func (o *StringOption) GetValue() interface{}

func (*StringOption) MarshalJSON

func (o *StringOption) MarshalJSON() ([]byte, error)

func (*StringOption) Set

func (o *StringOption) Set(value interface{}) error

func (*StringOption) Type

func (o *StringOption) Type() string

type Subscription

type Subscription string

type Transaction

type Transaction struct {
	Hash        string     `json:"hash"`
	RawTx       string     `json:"rawtx"`
	Blockheight uint       `json:"blockheight"`
	TxIndex     uint       `json:"txindex"`
	LockTime    uint64     `json:"locktime"`
	Version     uint       `json:"version"`
	Inputs      []TxInput  `json:"inputs"`
	Outputs     []TxOutput `json:"outputs"`
	Type        []string   `json:"type,omitempty"`
}

type TransactionsRequest

type TransactionsRequest struct {
}

func (TransactionsRequest) Name

func (r TransactionsRequest) Name() string

type TxDiscard

type TxDiscard struct {
	TxId string `json:"txid"`
}

func (*TxDiscard) Name

func (r *TxDiscard) Name() string

type TxInput

type TxInput struct {
	TxId     string `json:"txid"`
	Index    uint   `json:"index"`
	Sequence uint64 `json:"sequence"`
	Type     string `json:"type,omitempty"`
}

type TxOutput

type TxOutput struct {
	Index        uint   `json:"index"`
	Satoshis     string `json:"satoshis"`
	ScriptPubkey string `json:"scriptPubKey"`
	Type         string `json:"type,omitempty"`
}

type TxPrepare

type TxPrepare struct {
	Outputs []json.RawMessage `json:"outputs"`
	FeeRate string            `json:"feerate,omitempty"`
	MinConf uint16            `json:"minconf,omitempty"`
	Utxos   []string          `json:"utxos,omitempty"`
}

func (*TxPrepare) Name

func (r *TxPrepare) Name() string

type TxResult

type TxResult struct {
	UnsignedTx string `json:"unsigned_tx"`
	SignedTx   string `json:"tx,omitempty"`
	TxId       string `json:"txid"`
	Psbt       string `json:"psbt"`
}

type TxSend

type TxSend struct {
	TxId string `json:"txid"`
}

func (*TxSend) Name

func (r *TxSend) Name() string

type UpdateDetails

type UpdateDetails struct {
	HtlcMinimumMsat           Amount `json:"htlc_minimum_msat"`
	HtlcMaximumMsat           Amount `json:"htlc_maximum_msat"`
	CltvExpiryDelta           uint   `json:"cltv_expiry_delta"`
	FeeBaseMsat               Amount `json:"fee_base_msat"`
	FeeProportionalMillionths uint64 `json:"fee_proportional_millionths"`
}

type Updates

type Updates struct {
	Local  UpdateDetails `json:"local"`
	Remote UpdateDetails `json:"remote"`
}

type Utxo

type Utxo struct {
	TxId  string
	Index uint
}

func (*Utxo) String

func (u *Utxo) String() string

type WaitAnyInvoiceRequest

type WaitAnyInvoiceRequest struct {
	LastPayIndex uint  `json:"lastpay_index,omitempty"`
	Timeout      *uint `json:"timeout,omitempty"`
}

func (WaitAnyInvoiceRequest) Name

func (r WaitAnyInvoiceRequest) Name() string

type WaitInvoiceRequest

type WaitInvoiceRequest struct {
	Label string `json:"label"`
}

func (WaitInvoiceRequest) Name

func (r WaitInvoiceRequest) Name() string

type WaitSendPayRequest

type WaitSendPayRequest struct {
	PaymentHash string `json:"payment_hash"`
	Timeout     uint   `json:"timeout,omitempty"`
	PartId      uint64 `json:"partid,omitempty"`
}

func (WaitSendPayRequest) Name

func (r WaitSendPayRequest) Name() string

type WarnEvent

type WarnEvent struct {
	Warning Warning `json:"warning"`
	// contains filtered or unexported fields
}

func (*WarnEvent) Call

func (e *WarnEvent) Call() (jrpc2.Result, error)

func (*WarnEvent) Name

func (e *WarnEvent) Name() string

func (*WarnEvent) New

func (e *WarnEvent) New() interface{}

type Warning

type Warning struct {
	Level  string `json:"level"`
	Time   string `json:"time"`
	Source string `json:"source"`
	Log    string `json:"log"`
}

type WithdrawRequest

type WithdrawRequest struct {
	Destination string   `json:"destination"`
	Satoshi     string   `json:"satoshi"`
	FeeRate     string   `json:"feerate,omitempty"`
	MinConf     uint16   `json:"minconf,omitempty"`
	Utxos       []string `json:"utxos,omitempty"`
}

func (WithdrawRequest) Name

func (r WithdrawRequest) Name() string

type WithdrawResult

type WithdrawResult struct {
	Tx   string `json:"tx"`
	TxId string `json:"txid"`
}

Jump to

Keyboard shortcuts

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