Merge pull request #316 from guggero/user-agent-initiator

Add initiator field to user agent string
pull/318/head
Oliver Gugger 4 years ago committed by GitHub
commit 6552bf4529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,7 +10,7 @@ GOINSTALL := GO111MODULE=on go install -v
GOMOD := GO111MODULE=on go mod
COMMIT := $(shell git describe --abbrev=40 --dirty)
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT)"
LDFLAGS := -ldflags "-X $(PKG).Commit=$(COMMIT)"
DEV_TAGS = dev
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
@ -72,3 +72,7 @@ install:
@$(call print, "Installing loop and loopd.")
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/loop
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/loopd
rpc:
@$(call print, "Compiling RPC protos.")
cd looprpc; ./gen_protos.sh

@ -34,6 +34,7 @@ var (
MaxPrepayAmount: 100,
MaxPrepayRoutingFee: 75000,
MaxSwapRoutingFee: 70000,
Initiator: "test",
}
swapInvoiceDesc = "swap"

@ -150,6 +150,7 @@ func loopIn(ctx *cli.Context) error {
ExternalHtlc: external,
HtlcConfTarget: htlcConfTarget,
Label: label,
Initiator: defaultInitiator,
}
if ctx.IsSet(lastHopFlag.Name) {

@ -195,6 +195,7 @@ func loopOut(ctx *cli.Context) error {
HtlcConfirmations: htlcConfs,
SwapPublicationDeadline: uint64(swapDeadline.Unix()),
Label: label,
Initiator: defaultInitiator,
})
if err != nil {
return err

@ -48,6 +48,10 @@ var (
// that we set when sending it over the line.
defaultMacaroonTimeout int64 = 60
// defaultInitiator is the default value for the "initiator" part of the
// user agent string we send when using the command line utility.
defaultInitiator = "loop-cli"
loopDirFlag = cli.StringFlag{
Name: "loopdir",
Value: loopd.LoopDirBase,

@ -81,6 +81,11 @@ type OutRequest struct {
// Label contains an optional label for the swap.
Label string
// Initiator is an optional string that identifies what software
// initiated the swap (loop CLI, autolooper, LiT UI and so on) and is
// appended to the user agent string.
Initiator string
}
// Out contains the full details of a loop out request. This includes things
@ -196,6 +201,11 @@ type LoopInRequest struct {
// Label contains an optional label for the swap.
Label string
// Initiator is an optional string that identifies what software
// initiated the swap (loop CLI, autolooper, LiT UI and so on) and is
// appended to the user agent string.
Initiator string
}
// LoopInTerms are the server terms on which it executes loop in swaps.

@ -146,6 +146,7 @@ func TestAutoLoopEnabled(t *testing.T) {
SweepConfTarget: params.SweepConfTarget,
OutgoingChanSet: loopdb.ChannelSet{chanID1.ToUint64()},
Label: labels.AutoOutLabel(),
Initiator: autoloopSwapInitiator,
}
chan2Swap = &loop.OutRequest{
@ -161,6 +162,7 @@ func TestAutoLoopEnabled(t *testing.T) {
SweepConfTarget: params.SweepConfTarget,
OutgoingChanSet: loopdb.ChannelSet{chanID2.ToUint64()},
Label: labels.AutoOutLabel(),
Initiator: autoloopSwapInitiator,
}
loopOuts = []loopOutRequestResp{

@ -99,6 +99,10 @@ const (
// DefaultAutoOutTicker is the default amount of time between automated
// loop out checks.
DefaultAutoOutTicker = time.Minute * 10
// autoloopSwapInitiator is the value we send in the initiator field of
// a swap request when issuing an automatic swap.
autoloopSwapInitiator = "autoloop"
)
var (
@ -704,6 +708,7 @@ func (m *Manager) makeLoopOutRequest(ctx context.Context,
MaxSwapFee: quote.SwapFee,
MaxPrepayAmount: quote.PrepayAmount,
SweepConfTarget: m.params.SweepConfTarget,
Initiator: autoloopSwapInitiator,
}
if autoOut {

@ -68,6 +68,7 @@ var (
MaxSwapFee: testQuote.SwapFee,
MaxPrepayAmount: testQuote.PrepayAmount,
SweepConfTarget: loop.DefaultSweepConfTarget,
Initiator: autoloopSwapInitiator,
}
// chan2Rec is the suggested swap for channel 2 when we use chanRule.
@ -80,6 +81,7 @@ var (
MaxPrepayAmount: testQuote.PrepayAmount,
MaxSwapFee: testQuote.SwapFee,
SweepConfTarget: loop.DefaultSweepConfTarget,
Initiator: autoloopSwapInitiator,
}
// chan1Out is a contract that uses channel 1, used to represent on

@ -99,7 +99,8 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
SwapPublicationDeadline: time.Unix(
int64(in.SwapPublicationDeadline), 0,
),
Label: in.Label,
Label: in.Label,
Initiator: in.Initiator,
}
switch {
@ -496,6 +497,7 @@ func (s *swapClientServer) LoopIn(ctx context.Context,
HtlcConfTarget: htlcConfTarget,
ExternalHtlc: in.ExternalHtlc,
Label: in.Label,
Initiator: in.Initiator,
}
if in.LastHop != nil {
lastHop, err := route.NewVertexFromBytes(in.LastHop)

@ -166,7 +166,7 @@ func newLoopInSwap(globalCtx context.Context, cfg *swapConfig,
log.Infof("Initiating swap request at height %v", currentHeight)
swapResp, err := cfg.server.NewLoopInSwap(globalCtx, swapHash,
request.Amount, senderKey, swapInvoice, probeInvoice,
request.LastHop,
request.LastHop, request.Initiator,
)
probeWaitCancel()
if err != nil {

@ -21,6 +21,7 @@ var (
Amount: btcutil.Amount(50000),
MaxSwapFee: btcutil.Amount(1000),
HtlcConfTarget: 2,
Initiator: "test",
}
)

@ -114,7 +114,7 @@ func newLoopOutSwap(globalCtx context.Context, cfg *swapConfig,
// latest swap publication time.
swapResp, err := cfg.server.NewLoopOutSwap(
globalCtx, swapHash, request.Amount, request.Expiry,
receiverKey, request.SwapPublicationDeadline,
receiverKey, request.SwapPublicationDeadline, request.Initiator,
)
if err != nil {
return nil, fmt.Errorf("cannot initiate swap: %v", err)

@ -55,31 +55,31 @@ func (SwapType) EnumDescriptor() ([]byte, []int) {
type SwapState int32
const (
//*
//
//INITIATED is the initial state of a swap. At that point, the initiation
//call to the server has been made and the payment process has been started
//for the swap and prepayment invoices.
SwapState_INITIATED SwapState = 0
//*
//
//PREIMAGE_REVEALED is reached when the sweep tx publication is first
//attempted. From that point on, we should consider the preimage to no
//longer be secret and we need to do all we can to get the sweep confirmed.
//This state will mostly coalesce with StateHtlcConfirmed, except in the
//case where we wait for fees to come down before we sweep.
SwapState_PREIMAGE_REVEALED SwapState = 1
//*
//
//HTLC_PUBLISHED is reached when the htlc tx has been published in a loop in
//swap.
SwapState_HTLC_PUBLISHED SwapState = 2
//*
//
//SUCCESS is the final swap state that is reached when the sweep tx has
//the required confirmation depth.
SwapState_SUCCESS SwapState = 3
//*
//
//FAILED is the final swap state for a failed swap with or without loss of
//the swap amount.
SwapState_FAILED SwapState = 4
//*
//
//INVOICE_SETTLED is reached when the swap invoice in a loop in swap has been
//paid, but we are still waiting for the htlc spend to confirm.
SwapState_INVOICE_SETTLED SwapState = 5
@ -201,32 +201,32 @@ func (LiquidityRuleType) EnumDescriptor() ([]byte, []int) {
}
type LoopOutRequest struct {
//*
//
//Requested swap amount in sat. This does not include the swap and miner fee.
Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"`
//*
//
//Base58 encoded destination address for the swap.
Dest string `protobuf:"bytes,2,opt,name=dest,proto3" json:"dest,omitempty"`
//*
//
//Maximum off-chain fee in sat that may be paid for swap payment to the server.
//This limit is applied during path finding. Typically this value is taken
//from the response of the GetQuote call.
MaxSwapRoutingFee int64 `protobuf:"varint,3,opt,name=max_swap_routing_fee,json=maxSwapRoutingFee,proto3" json:"max_swap_routing_fee,omitempty"`
//*
//
//Maximum off-chain fee in sat that may be paid for the prepay to the server.
//This limit is applied during path finding. Typically this value is taken
//from the response of the GetQuote call.
MaxPrepayRoutingFee int64 `protobuf:"varint,4,opt,name=max_prepay_routing_fee,json=maxPrepayRoutingFee,proto3" json:"max_prepay_routing_fee,omitempty"`
//*
//
//Maximum we are willing to pay the server for the swap. This value is not
//disclosed in the swap initiation call, but if the server asks for a
//higher fee, we abort the swap. Typically this value is taken from the
//response of the GetQuote call. It includes the prepay amount.
MaxSwapFee int64 `protobuf:"varint,5,opt,name=max_swap_fee,json=maxSwapFee,proto3" json:"max_swap_fee,omitempty"`
//*
//
//Maximum amount of the swap fee that may be charged as a prepayment.
MaxPrepayAmt int64 `protobuf:"varint,6,opt,name=max_prepay_amt,json=maxPrepayAmt,proto3" json:"max_prepay_amt,omitempty"`
//*
//
//Maximum in on-chain fees that we are willing to spend. If we want to
//sweep the on-chain htlc and the fee estimate turns out higher than this
//value, we cancel the swap. If the fee estimate is lower, we publish the
@ -242,17 +242,17 @@ type LoopOutRequest struct {
//
//max_miner_fee is typically taken from the response of the GetQuote call.
MaxMinerFee int64 `protobuf:"varint,7,opt,name=max_miner_fee,json=maxMinerFee,proto3" json:"max_miner_fee,omitempty"`
//*
//
//Deprecated, use outgoing_chan_set. The channel to loop out, the channel
//to loop out is selected based on the lowest routing fee for the swap
//payment to the server.
LoopOutChannel uint64 `protobuf:"varint,8,opt,name=loop_out_channel,json=loopOutChannel,proto3" json:"loop_out_channel,omitempty"` // Deprecated: Do not use.
//*
//
//A restriction on the channel set that may be used to loop out. The actual
//channel(s) that will be used are selected based on the lowest routing fee
//for the swap payment to the server.
OutgoingChanSet []uint64 `protobuf:"varint,11,rep,packed,name=outgoing_chan_set,json=outgoingChanSet,proto3" json:"outgoing_chan_set,omitempty"`
//*
//
//The number of blocks from the on-chain HTLC's confirmation height that it
//should be swept within.
SweepConfTarget int32 `protobuf:"varint,9,opt,name=sweep_conf_target,json=sweepConfTarget,proto3" json:"sweep_conf_target,omitempty"`
@ -260,7 +260,7 @@ type LoopOutRequest struct {
//The number of confirmations that we require for the on chain htlc that will
//be published by the server before we reveal the preimage.
HtlcConfirmations int32 `protobuf:"varint,13,opt,name=htlc_confirmations,json=htlcConfirmations,proto3" json:"htlc_confirmations,omitempty"`
//*
//
//The latest time (in unix seconds) we allow the server to wait before
//publishing the HTLC on chain. Setting this to a larger value will give the
//server the opportunity to batch multiple swaps together, and wait for
@ -271,7 +271,14 @@ type LoopOutRequest struct {
//An optional label for this swap. This field is limited to 500 characters
//and may not start with the prefix [reserved], which is used to tag labels
//produced by the daemon.
Label string `protobuf:"bytes,12,opt,name=label,proto3" json:"label,omitempty"`
Label string `protobuf:"bytes,12,opt,name=label,proto3" json:"label,omitempty"`
//
//An optional identification string that will be appended to the user agent
//string sent to the server to give information about the usage of loop. This
//initiator part is meant for user interfaces to add their name to give the
//full picture of the binary used (loopd, LiT) and the method used for
//triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
Initiator string `protobuf:"bytes,14,opt,name=initiator,proto3" json:"initiator,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -394,39 +401,53 @@ func (m *LoopOutRequest) GetLabel() string {
return ""
}
func (m *LoopOutRequest) GetInitiator() string {
if m != nil {
return m.Initiator
}
return ""
}
type LoopInRequest struct {
//*
//
//Requested swap amount in sat. This does not include the swap and miner
//fee.
Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"`
//*
//
//Maximum we are willing to pay the server for the swap. This value is not
//disclosed in the swap initiation call, but if the server asks for a
//higher fee, we abort the swap. Typically this value is taken from the
//response of the GetQuote call.
MaxSwapFee int64 `protobuf:"varint,2,opt,name=max_swap_fee,json=maxSwapFee,proto3" json:"max_swap_fee,omitempty"`
//*
//
//Maximum in on-chain fees that we are willing to spend. If we want to
//publish the on-chain htlc and the fee estimate turns out higher than this
//value, we cancel the swap.
//
//max_miner_fee is typically taken from the response of the GetQuote call.
MaxMinerFee int64 `protobuf:"varint,3,opt,name=max_miner_fee,json=maxMinerFee,proto3" json:"max_miner_fee,omitempty"`
//*
//
//The last hop to use for the loop in swap. If empty, the last hop is selected
//based on the lowest routing fee for the swap payment from the server.
LastHop []byte `protobuf:"bytes,4,opt,name=last_hop,json=lastHop,proto3" json:"last_hop,omitempty"`
//*
//
//If external_htlc is true, we expect the htlc to be published by an external
//actor.
ExternalHtlc bool `protobuf:"varint,5,opt,name=external_htlc,json=externalHtlc,proto3" json:"external_htlc,omitempty"`
//*
//
//The number of blocks that the on chain htlc should confirm within.
HtlcConfTarget int32 `protobuf:"varint,6,opt,name=htlc_conf_target,json=htlcConfTarget,proto3" json:"htlc_conf_target,omitempty"`
//
//An optional label for this swap. This field is limited to 500 characters
//and may not be one of the reserved values in loop/labels Reserved list.
Label string `protobuf:"bytes,7,opt,name=label,proto3" json:"label,omitempty"`
Label string `protobuf:"bytes,7,opt,name=label,proto3" json:"label,omitempty"`
//
//An optional identification string that will be appended to the user agent
//string sent to the server to give information about the usage of loop. This
//initiator part is meant for user interfaces to add their name to give the
//full picture of the binary used (loopd, LiT) and the method used for
//triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
Initiator string `protobuf:"bytes,8,opt,name=initiator,proto3" json:"initiator,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -506,18 +527,25 @@ func (m *LoopInRequest) GetLabel() string {
return ""
}
func (m *LoopInRequest) GetInitiator() string {
if m != nil {
return m.Initiator
}
return ""
}
type SwapResponse struct {
//*
//
//Swap identifier to track status in the update stream that is returned from
//the Start() call. Currently this is the hash that locks the htlcs.
//DEPRECATED: To make the API more consistent, this field is deprecated in
//favor of id_bytes and will be removed in a future release.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Deprecated: Do not use.
//*
//
//Swap identifier to track status in the update stream that is returned from
//the Start() call. Currently this is the hash that locks the htlcs.
IdBytes []byte `protobuf:"bytes,3,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"`
//*
//
//DEPRECATED. This field stores the address of the onchain htlc, but
//depending on the request, the semantics are different.
//- For internal loop-in htlc_address contains the address of the
@ -527,11 +555,11 @@ type SwapResponse struct {
//- For loop-out htlc_address always contains the native segwit (P2WSH)
//htlc address.
HtlcAddress string `protobuf:"bytes,2,opt,name=htlc_address,json=htlcAddress,proto3" json:"htlc_address,omitempty"` // Deprecated: Do not use.
//*
//
//The nested segwit address of the on-chain htlc.
//This field remains empty for loop-out.
HtlcAddressNp2Wsh string `protobuf:"bytes,4,opt,name=htlc_address_np2wsh,json=htlcAddressNp2wsh,proto3" json:"htlc_address_np2wsh,omitempty"`
//*
//
//The native segwit address of the on-chain htlc.
//Used for both loop-in and loop-out.
HtlcAddressP2Wsh string `protobuf:"bytes,5,opt,name=htlc_address_p2wsh,json=htlcAddressP2wsh,proto3" json:"htlc_address_p2wsh,omitempty"`
@ -643,36 +671,36 @@ func (m *MonitorRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_MonitorRequest proto.InternalMessageInfo
type SwapStatus struct {
//*
//
//Requested swap amount in sat. This does not include the swap and miner
//fee.
Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"`
//*
//
//Swap identifier to track status in the update stream that is returned from
//the Start() call. Currently this is the hash that locks the htlcs.
//DEPRECATED: To make the API more consistent, this field is deprecated in
//favor of id_bytes and will be removed in a future release.
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Deprecated: Do not use.
//*
//
//Swap identifier to track status in the update stream that is returned from
//the Start() call. Currently this is the hash that locks the htlcs.
IdBytes []byte `protobuf:"bytes,11,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"`
//*
//Swap type
//
//The type of the swap.
Type SwapType `protobuf:"varint,3,opt,name=type,proto3,enum=looprpc.SwapType" json:"type,omitempty"`
//*
//
//State the swap is currently in, see State enum.
State SwapState `protobuf:"varint,4,opt,name=state,proto3,enum=looprpc.SwapState" json:"state,omitempty"`
//
//A failure reason for the swap, only set if the swap has failed.
FailureReason FailureReason `protobuf:"varint,14,opt,name=failure_reason,json=failureReason,proto3,enum=looprpc.FailureReason" json:"failure_reason,omitempty"`
//*
//
//Initiation time of the swap.
InitiationTime int64 `protobuf:"varint,5,opt,name=initiation_time,json=initiationTime,proto3" json:"initiation_time,omitempty"`
//*
//
//Initiation time of the swap.
LastUpdateTime int64 `protobuf:"varint,6,opt,name=last_update_time,json=lastUpdateTime,proto3" json:"last_update_time,omitempty"`
//*
//
//DEPRECATED: This field stores the address of the onchain htlc.
//- For internal loop-in htlc_address contains the address of the
//native segwit (P2WSH) htlc.
@ -685,7 +713,7 @@ type SwapStatus struct {
HtlcAddressP2Wsh string `protobuf:"bytes,12,opt,name=htlc_address_p2wsh,json=htlcAddressP2wsh,proto3" json:"htlc_address_p2wsh,omitempty"`
// HTLC address (nested segwit), used in loop-in swaps only.
HtlcAddressNp2Wsh string `protobuf:"bytes,13,opt,name=htlc_address_np2wsh,json=htlcAddressNp2wsh,proto3" json:"htlc_address_np2wsh,omitempty"`
/// Swap server cost
// Swap server cost
CostServer int64 `protobuf:"varint,8,opt,name=cost_server,json=costServer,proto3" json:"cost_server,omitempty"`
// On-chain transaction cost
CostOnchain int64 `protobuf:"varint,9,opt,name=cost_onchain,json=costOnchain,proto3" json:"cost_onchain,omitempty"`
@ -862,7 +890,7 @@ func (m *ListSwapsRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_ListSwapsRequest proto.InternalMessageInfo
type ListSwapsResponse struct {
//*
//
//The list of all currently known swaps and their status.
Swaps []*SwapStatus `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -903,7 +931,7 @@ func (m *ListSwapsResponse) GetSwaps() []*SwapStatus {
}
type SwapInfoRequest struct {
//*
//
//The swap identifier which currently is the hash that locks the HTLCs. When
//using REST, this field must be encoded as URL safe base64.
Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
@ -976,10 +1004,10 @@ func (m *TermsRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_TermsRequest proto.InternalMessageInfo
type InTermsResponse struct {
//*
//
//Minimum swap amount (sat)
MinSwapAmount int64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"`
//*
//
//Maximum swap amount (sat)
MaxSwapAmount int64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -1027,10 +1055,10 @@ func (m *InTermsResponse) GetMaxSwapAmount() int64 {
}
type OutTermsResponse struct {
//*
//
//Minimum swap amount (sat)
MinSwapAmount int64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"`
//*
//
//Maximum swap amount (sat)
MaxSwapAmount int64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"`
// The minimally accepted cltv delta of the on-chain htlc.
@ -1096,20 +1124,20 @@ func (m *OutTermsResponse) GetMaxCltvDelta() int32 {
}
type QuoteRequest struct {
//*
//
//The amount to swap in satoshis.
Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"`
//*
//
//The confirmation target that should be used either for the sweep of the
//on-chain HTLC broadcast by the swap server in the case of a Loop Out, or for
//the confirmation of the on-chain HTLC broadcast by the swap client in the
//case of a Loop In.
ConfTarget int32 `protobuf:"varint,2,opt,name=conf_target,json=confTarget,proto3" json:"conf_target,omitempty"`
//*
//
//If external_htlc is true, we expect the htlc to be published by an external
//actor.
ExternalHtlc bool `protobuf:"varint,3,opt,name=external_htlc,json=externalHtlc,proto3" json:"external_htlc,omitempty"`
//*
//
//The latest time (in unix seconds) we allow the server to wait before
//publishing the HTLC on chain. Setting this to a larger value will give the
//server the opportunity to batch multiple swaps together, and wait for
@ -1175,7 +1203,7 @@ func (m *QuoteRequest) GetSwapPublicationDeadline() uint64 {
}
type InQuoteResponse struct {
//*
//
//The fee that the swap server is charging for the swap.
SwapFeeSat int64 `protobuf:"varint,1,opt,name=swap_fee_sat,json=swapFeeSat,proto3" json:"swap_fee_sat,omitempty"`
//
@ -1186,7 +1214,7 @@ type InQuoteResponse struct {
//create a sample estimation transaction because not enough funds are
//available. An information message should be shown to the user in this case.
HtlcPublishFeeSat int64 `protobuf:"varint,3,opt,name=htlc_publish_fee_sat,json=htlcPublishFeeSat,proto3" json:"htlc_publish_fee_sat,omitempty"`
//*
//
//On-chain cltv expiry delta
CltvDelta int32 `protobuf:"varint,5,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -1241,21 +1269,21 @@ func (m *InQuoteResponse) GetCltvDelta() int32 {
}
type OutQuoteResponse struct {
//*
//
//The fee that the swap server is charging for the swap.
SwapFeeSat int64 `protobuf:"varint,1,opt,name=swap_fee_sat,json=swapFeeSat,proto3" json:"swap_fee_sat,omitempty"`
//*
//
//The part of the swap fee that is requested as a prepayment.
PrepayAmtSat int64 `protobuf:"varint,2,opt,name=prepay_amt_sat,json=prepayAmtSat,proto3" json:"prepay_amt_sat,omitempty"`
//*
//
//An estimate of the on-chain fee that needs to be paid to sweep the HTLC for
//a loop out.
HtlcSweepFeeSat int64 `protobuf:"varint,3,opt,name=htlc_sweep_fee_sat,json=htlcSweepFeeSat,proto3" json:"htlc_sweep_fee_sat,omitempty"`
//*
//
//The node pubkey where the swap payment needs to be paid
//to. This can be used to test connectivity before initiating the swap.
SwapPaymentDest []byte `protobuf:"bytes,4,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"`
//*
//
//On-chain cltv expiry delta
CltvDelta int32 `protobuf:"varint,5,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -1355,7 +1383,7 @@ func (m *TokensRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_TokensRequest proto.InternalMessageInfo
type TokensResponse struct {
//*
//
//List of all tokens the daemon knows of, including old/expired tokens.
Tokens []*LsatToken `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -1396,30 +1424,30 @@ func (m *TokensResponse) GetTokens() []*LsatToken {
}
type LsatToken struct {
//*
//
//The base macaroon that was baked by the auth server.
BaseMacaroon []byte `protobuf:"bytes,1,opt,name=base_macaroon,json=baseMacaroon,proto3" json:"base_macaroon,omitempty"`
//*
//
//The payment hash of the payment that was paid to obtain the token.
PaymentHash []byte `protobuf:"bytes,2,opt,name=payment_hash,json=paymentHash,proto3" json:"payment_hash,omitempty"`
//*
//
//The preimage of the payment hash, knowledge of this is proof that the
//payment has been paid. If the preimage is set to all zeros, this means the
//payment is still pending and the token is not yet fully valid.
PaymentPreimage []byte `protobuf:"bytes,3,opt,name=payment_preimage,json=paymentPreimage,proto3" json:"payment_preimage,omitempty"`
//*
//
//The amount of millisatoshis that was paid to get the token.
AmountPaidMsat int64 `protobuf:"varint,4,opt,name=amount_paid_msat,json=amountPaidMsat,proto3" json:"amount_paid_msat,omitempty"`
//*
//
//The amount of millisatoshis paid in routing fee to pay for the token.
RoutingFeePaidMsat int64 `protobuf:"varint,5,opt,name=routing_fee_paid_msat,json=routingFeePaidMsat,proto3" json:"routing_fee_paid_msat,omitempty"`
//*
//
//The creation time of the token as UNIX timestamp in seconds.
TimeCreated int64 `protobuf:"varint,6,opt,name=time_created,json=timeCreated,proto3" json:"time_created,omitempty"`
//*
//
//Indicates whether the token is expired or still valid.
Expired bool `protobuf:"varint,7,opt,name=expired,proto3" json:"expired,omitempty"`
//*
//
//Identifying attribute of this token in the store. Currently represents the
//file name of the token where it's stored on the file system.
StorageName string `protobuf:"bytes,8,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
@ -1977,155 +2005,157 @@ func init() {
func init() { proto.RegisterFile("client.proto", fileDescriptor_014de31d7ac8c57c) }
var fileDescriptor_014de31d7ac8c57c = []byte{
// 2365 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6e, 0x23, 0xc7,
0xf1, 0x5f, 0x7e, 0x89, 0x64, 0xf1, 0x6b, 0xd4, 0xda, 0x95, 0x28, 0x5a, 0x86, 0xb5, 0x63, 0xef,
0xdf, 0xb2, 0x6c, 0x2f, 0xff, 0x96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x47, 0x34, 0x5a, 0x06, 0x89, 0x48, 0x4e, 0xcd, 0xaf, 0xad, 0xad, 0x3b,
0xf4, 0x74, 0x76, 0xb0, 0x06, 0x5d, 0x11, 0x70, 0xd9, 0x56, 0x33, 0x2b, 0x93, 0xc0, 0xee, 0x4e,
0x5d, 0x4c, 0x8f, 0xe5, 0xdc, 0x3b, 0x92, 0xb5, 0x1e, 0x6c, 0x11, 0xfa, 0x0e, 0x5d, 0xb8, 0xc9,
0x1e, 0xd3, 0x85, 0x11, 0xa0, 0xed, 0x29, 0xf9, 0xbf, 0x02, 0x36, 0x7a, 0xe8, 0xd6, 0x7b, 0x9b,
0x55, 0xeb, 0xfd, 0x07, 0x31, 0x69, 0x83, 0xea, 0x2b, 0x2f, 0xc7, 0x14, 0x16, 0x50, 0x4d, 0xf6,
0x1f, 0xb6, 0xd0, 0x65, 0x45, 0xb7, 0x6a, 0xbd, 0x7b, 0x0f, 0x37, 0xbc, 0xad, 0x49, 0xb7, 0x31,
0xa6, 0xe1, 0x6d, 0x38, 0x38, 0xb4, 0x03, 0x05, 0xbb, 0x58, 0xa3, 0xbf, 0x9e, 0x3f, 0xff, 0x77,
0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x97, 0x5c, 0x27, 0xb1, 0x16, 0x00, 0x00,
// 2385 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0xe3, 0xc6,
0xf5, 0x5f, 0x49, 0x94, 0x25, 0x3d, 0x51, 0x12, 0x3d, 0xde, 0xb5, 0x65, 0xc5, 0x41, 0xbc, 0x4c,
0xf6, 0x1b, 0xc7, 0x49, 0xac, 0x6f, 0x9c, 0x4b, 0x1b, 0x24, 0x05, 0xb4, 0xb2, 0x1c, 0xcb, 0xb5,
0x25, 0x95, 0x92, 0x37, 0x48, 0x51, 0x80, 0x18, 0x4b, 0x63, 0x8b, 0x88, 0x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d, 0x80, 0x9b, 0xd2, 0xbf, 0x18, 0xd5, 0x39, 0x03, 0x04, 0x69, 0x88, 0x14, 0xf2, 0x1c, 0x54,
0x04, 0xb8, 0xce, 0x78, 0x4a, 0x2d, 0x07, 0x8b, 0x54, 0xce, 0xc0, 0x43, 0x7d, 0x49, 0x12, 0xc9,
0x27, 0x21, 0x37, 0x37, 0x12, 0x03, 0xb2, 0xde, 0x22, 0x26, 0xa4, 0x2d, 0x52, 0xaa, 0x96, 0x48,
0x29, 0x9d, 0x80, 0x76, 0x61, 0x05, 0x5c, 0x78, 0x2b, 0x88, 0x42, 0xe9, 0x47, 0xb0, 0x99, 0xa0,
0x85, 0xc9, 0xf4, 0x11, 0xe4, 0x45, 0xf5, 0x08, 0xea, 0x99, 0xfd, 0xdc, 0x41, 0xf9, 0x78, 0xeb,
0x81, 0xa3, 0xe7, 0x81, 0x21, 0x11, 0xfa, 0x73, 0xa8, 0x09, 0x62, 0xd7, 0xb9, 0x71, 0xa3, 0x8a,
0x54, 0x8d, 0x53, 0x51, 0x15, 0x81, 0xa7, 0x57, 0x41, 0x1d, 0x31, 0xdf, 0x8e, 0xaf, 0xfc, 0x25,
0xd4, 0xba, 0x4e, 0x48, 0x09, 0x2f, 0xfc, 0x3f, 0xa8, 0xd9, 0x96, 0x23, 0x4b, 0x16, 0xb5, 0xdd,
0xb9, 0xc3, 0x43, 0x87, 0x57, 0x6c, 0xcb, 0x11, 0xf2, 0x5b, 0x48, 0x44, 0x5c, 0x54, 0xda, 0x42,
0xdc, 0x46, 0x88, 0x93, 0xd5, 0x4d, 0xe2, 0xce, 0x95, 0x62, 0x46, 0xcb, 0x9e, 0x2b, 0xc5, 0xac,
0x96, 0x3b, 0x57, 0x8a, 0x39, 0x4d, 0x39, 0x57, 0x8a, 0x8a, 0x96, 0x3f, 0x57, 0x8a, 0x05, 0xad,
0xa8, 0xff, 0x39, 0x03, 0x5a, 0x7f, 0xce, 0xff, 0xa7, 0x2a, 0x60, 0x63, 0xb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0x20, 0x35, 0xbc, 0x22, 0xa0, 0xbc, 0x29, 0x67, 0x56,
0xc2, 0x81, 0x3c, 0x9c, 0xba, 0x88, 0x1e, 0xcb, 0x59, 0x3b, 0x92, 0x35, 0x1e, 0x6d, 0x11, 0xfa,
0x1e, 0x5e, 0xb8, 0x4d, 0x9e, 0xe2, 0x85, 0x11, 0xa0, 0xe9, 0x49, 0xf9, 0xbf, 0x00, 0x32, 0x7c,
0xec, 0xd6, 0xb5, 0xcd, 0xaa, 0xf1, 0xfe, 0xa3, 0x98, 0xb4, 0x41, 0xf5, 0x95, 0x97, 0x8b, 0x14,
0x66, 0xa0, 0x26, 0xfb, 0x0f, 0x59, 0xbc, 0x65, 0x45, 0xb7, 0x6a, 0xbc, 0xbb, 0x86, 0x1b, 0xde,
0x56, 0xc7, 0xdb, 0x08, 0xd1, 0xc4, 0x6d, 0x62, 0x70, 0x68, 0x06, 0x12, 0x76, 0xbd, 0x81, 0x7f,
0x5b, 0x7f, 0xfe, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x45, 0xeb, 0x2a, 0xdc, 0xed, 0x16, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -2140,42 +2170,42 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SwapClientClient interface {
//* loop: `out`
// loop: `out`
//LoopOut initiates an loop out swap with the given parameters. The call
//returns after the swap has been set up with the swap server. From that
//point onwards, progress can be tracked via the SwapStatus stream that is
//returned from Monitor().
LoopOut(ctx context.Context, in *LoopOutRequest, opts ...grpc.CallOption) (*SwapResponse, error)
//* loop: `in`
// loop: `in`
//LoopIn initiates a loop in swap with the given parameters. The call
//returns after the swap has been set up with the swap server. From that
//point onwards, progress can be tracked via the SwapStatus stream
//that is returned from Monitor().
LoopIn(ctx context.Context, in *LoopInRequest, opts ...grpc.CallOption) (*SwapResponse, error)
//* loop: `monitor`
// loop: `monitor`
//Monitor will return a stream of swap updates for currently active swaps.
Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (SwapClient_MonitorClient, error)
//* loop: `listswaps`
// loop: `listswaps`
//ListSwaps returns a list of all currently known swaps and their current
//status.
ListSwaps(ctx context.Context, in *ListSwapsRequest, opts ...grpc.CallOption) (*ListSwapsResponse, error)
//* loop: `swapinfo`
// loop: `swapinfo`
//SwapInfo returns all known details about a single swap.
SwapInfo(ctx context.Context, in *SwapInfoRequest, opts ...grpc.CallOption) (*SwapStatus, error)
//* loop: `terms`
// loop: `terms`
//LoopOutTerms returns the terms that the server enforces for a loop out swap.
LoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*OutTermsResponse, error)
//* loop: `quote`
// loop: `quote`
//LoopOutQuote returns a quote for a loop out swap with the provided
//parameters.
LoopOutQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*OutQuoteResponse, error)
//* loop: `terms`
// loop: `terms`
//GetTerms returns the terms that the server enforces for swaps.
GetLoopInTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*InTermsResponse, error)
//* loop: `quote`
// loop: `quote`
//GetQuote returns a quote for a swap with the provided parameters.
GetLoopInQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*InQuoteResponse, error)
//* loop: `listauth`
// loop: `listauth`
//GetLsatTokens returns all LSAT tokens the daemon ever paid for.
GetLsatTokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error)
//
@ -2347,42 +2377,42 @@ func (c *swapClientClient) SuggestSwaps(ctx context.Context, in *SuggestSwapsReq
// SwapClientServer is the server API for SwapClient service.
type SwapClientServer interface {
//* loop: `out`
// loop: `out`
//LoopOut initiates an loop out swap with the given parameters. The call
//returns after the swap has been set up with the swap server. From that
//point onwards, progress can be tracked via the SwapStatus stream that is
//returned from Monitor().
LoopOut(context.Context, *LoopOutRequest) (*SwapResponse, error)
//* loop: `in`
// loop: `in`
//LoopIn initiates a loop in swap with the given parameters. The call
//returns after the swap has been set up with the swap server. From that
//point onwards, progress can be tracked via the SwapStatus stream
//that is returned from Monitor().
LoopIn(context.Context, *LoopInRequest) (*SwapResponse, error)
//* loop: `monitor`
// loop: `monitor`
//Monitor will return a stream of swap updates for currently active swaps.
Monitor(*MonitorRequest, SwapClient_MonitorServer) error
//* loop: `listswaps`
// loop: `listswaps`
//ListSwaps returns a list of all currently known swaps and their current
//status.
ListSwaps(context.Context, *ListSwapsRequest) (*ListSwapsResponse, error)
//* loop: `swapinfo`
// loop: `swapinfo`
//SwapInfo returns all known details about a single swap.
SwapInfo(context.Context, *SwapInfoRequest) (*SwapStatus, error)
//* loop: `terms`
// loop: `terms`
//LoopOutTerms returns the terms that the server enforces for a loop out swap.
LoopOutTerms(context.Context, *TermsRequest) (*OutTermsResponse, error)
//* loop: `quote`
// loop: `quote`
//LoopOutQuote returns a quote for a loop out swap with the provided
//parameters.
LoopOutQuote(context.Context, *QuoteRequest) (*OutQuoteResponse, error)
//* loop: `terms`
// loop: `terms`
//GetTerms returns the terms that the server enforces for swaps.
GetLoopInTerms(context.Context, *TermsRequest) (*InTermsResponse, error)
//* loop: `quote`
// loop: `quote`
//GetQuote returns a quote for a swap with the provided parameters.
GetLoopInQuote(context.Context, *QuoteRequest) (*InQuoteResponse, error)
//* loop: `listauth`
// loop: `listauth`
//GetLsatTokens returns all LSAT tokens the daemon ever paid for.
GetLsatTokens(context.Context, *TokensRequest) (*TokensResponse, error)
//

@ -4,12 +4,12 @@ import "google/api/annotations.proto";
package looprpc;
/**
/*
SwapClient is a service that handles the client side process of onchain/offchain
swaps. The service is designed for a single client.
*/
service SwapClient {
/** loop: `out`
/* loop: `out`
LoopOut initiates an loop out swap with the given parameters. The call
returns after the swap has been set up with the swap server. From that
point onwards, progress can be tracked via the SwapStatus stream that is
@ -22,7 +22,7 @@ service SwapClient {
};
}
/** loop: `in`
/* loop: `in`
LoopIn initiates a loop in swap with the given parameters. The call
returns after the swap has been set up with the swap server. From that
point onwards, progress can be tracked via the SwapStatus stream
@ -35,12 +35,12 @@ service SwapClient {
};
}
/** loop: `monitor`
/* loop: `monitor`
Monitor will return a stream of swap updates for currently active swaps.
*/
rpc Monitor (MonitorRequest) returns (stream SwapStatus);
/** loop: `listswaps`
/* loop: `listswaps`
ListSwaps returns a list of all currently known swaps and their current
status.
*/
@ -50,7 +50,7 @@ service SwapClient {
};
}
/** loop: `swapinfo`
/* loop: `swapinfo`
SwapInfo returns all known details about a single swap.
*/
rpc SwapInfo (SwapInfoRequest) returns (SwapStatus) {
@ -59,7 +59,7 @@ service SwapClient {
};
}
/** loop: `terms`
/* loop: `terms`
LoopOutTerms returns the terms that the server enforces for a loop out swap.
*/
rpc LoopOutTerms (TermsRequest) returns (OutTermsResponse) {
@ -68,7 +68,7 @@ service SwapClient {
};
}
/** loop: `quote`
/* loop: `quote`
LoopOutQuote returns a quote for a loop out swap with the provided
parameters.
*/
@ -78,7 +78,7 @@ service SwapClient {
};
}
/** loop: `terms`
/* loop: `terms`
GetTerms returns the terms that the server enforces for swaps.
*/
rpc GetLoopInTerms (TermsRequest) returns (InTermsResponse) {
@ -87,7 +87,7 @@ service SwapClient {
};
}
/** loop: `quote`
/* loop: `quote`
GetQuote returns a quote for a swap with the provided parameters.
*/
rpc GetLoopInQuote (QuoteRequest) returns (InQuoteResponse) {
@ -96,7 +96,7 @@ service SwapClient {
};
}
/** loop: `listauth`
/* loop: `listauth`
GetLsatTokens returns all LSAT tokens the daemon ever paid for.
*/
rpc GetLsatTokens (TokensRequest) returns (TokensResponse) {
@ -110,7 +110,7 @@ service SwapClient {
is currently configured with. This may be nil if nothing is configured.
[EXPERIMENTAL]: endpoint is subject to change.
*/
rpc GetLiquidityParams(GetLiquidityParamsRequest) returns (LiquidityParameters){
rpc GetLiquidityParams (GetLiquidityParamsRequest) returns (LiquidityParameters) {
option (google.api.http) = {
get: "/v1/liquidity/params"
};
@ -122,7 +122,7 @@ service SwapClient {
this call fully overwrites our existing parameters.
[EXPERIMENTAL]: endpoint is subject to change.
*/
rpc SetLiquidityParams(SetLiquidityParamsRequest) returns (SetLiquidityParamsResponse){
rpc SetLiquidityParams (SetLiquidityParamsRequest) returns (SetLiquidityParamsResponse) {
option (google.api.http) = {
post: "/v1/liquidity/params"
body: "*"
@ -135,7 +135,7 @@ service SwapClient {
Note that only loop out suggestions are currently supported.
[EXPERIMENTAL]: endpoint is subject to change.
*/
rpc SuggestSwaps(SuggestSwapsRequest) returns (SuggestSwapsResponse){
rpc SuggestSwaps (SuggestSwapsRequest) returns (SuggestSwapsResponse) {
option (google.api.http) = {
get: "/v1/auto/suggest"
};
@ -143,31 +143,31 @@ service SwapClient {
}
message LoopOutRequest {
/**
/*
Requested swap amount in sat. This does not include the swap and miner fee.
*/
int64 amt = 1;
/**
/*
Base58 encoded destination address for the swap.
*/
string dest = 2;
/**
/*
Maximum off-chain fee in sat that may be paid for swap payment to the server.
This limit is applied during path finding. Typically this value is taken
from the response of the GetQuote call.
*/
int64 max_swap_routing_fee = 3;
/**
/*
Maximum off-chain fee in sat that may be paid for the prepay to the server.
This limit is applied during path finding. Typically this value is taken
from the response of the GetQuote call.
*/
int64 max_prepay_routing_fee = 4;
/**
/*
Maximum we are willing to pay the server for the swap. This value is not
disclosed in the swap initiation call, but if the server asks for a
higher fee, we abort the swap. Typically this value is taken from the
@ -175,12 +175,12 @@ message LoopOutRequest {
*/
int64 max_swap_fee = 5;
/**
/*
Maximum amount of the swap fee that may be charged as a prepayment.
*/
int64 max_prepay_amt = 6;
/**
/*
Maximum in on-chain fees that we are willing to spend. If we want to
sweep the on-chain htlc and the fee estimate turns out higher than this
value, we cancel the swap. If the fee estimate is lower, we publish the
@ -198,21 +198,21 @@ message LoopOutRequest {
*/
int64 max_miner_fee = 7;
/**
/*
Deprecated, use outgoing_chan_set. The channel to loop out, the channel
to loop out is selected based on the lowest routing fee for the swap
payment to the server.
*/
uint64 loop_out_channel = 8 [deprecated = true];
/**
/*
A restriction on the channel set that may be used to loop out. The actual
channel(s) that will be used are selected based on the lowest routing fee
for the swap payment to the server.
*/
repeated uint64 outgoing_chan_set = 11;
/**
/*
The number of blocks from the on-chain HTLC's confirmation height that it
should be swept within.
*/
@ -224,7 +224,7 @@ message LoopOutRequest {
*/
int32 htlc_confirmations = 13;
/**
/*
The latest time (in unix seconds) we allow the server to wait before
publishing the HTLC on chain. Setting this to a larger value will give the
server the opportunity to batch multiple swaps together, and wait for
@ -239,16 +239,25 @@ message LoopOutRequest {
produced by the daemon.
*/
string label = 12;
/*
An optional identification string that will be appended to the user agent
string sent to the server to give information about the usage of loop. This
initiator part is meant for user interfaces to add their name to give the
full picture of the binary used (loopd, LiT) and the method used for
triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
*/
string initiator = 14;
}
message LoopInRequest {
/**
/*
Requested swap amount in sat. This does not include the swap and miner
fee.
*/
int64 amt = 1;
/**
/*
Maximum we are willing to pay the server for the swap. This value is not
disclosed in the swap initiation call, but if the server asks for a
higher fee, we abort the swap. Typically this value is taken from the
@ -256,7 +265,7 @@ message LoopInRequest {
*/
int64 max_swap_fee = 2;
/**
/*
Maximum in on-chain fees that we are willing to spend. If we want to
publish the on-chain htlc and the fee estimate turns out higher than this
value, we cancel the swap.
@ -265,19 +274,19 @@ message LoopInRequest {
*/
int64 max_miner_fee = 3;
/**
/*
The last hop to use for the loop in swap. If empty, the last hop is selected
based on the lowest routing fee for the swap payment from the server.
*/
bytes last_hop = 4;
/**
/*
If external_htlc is true, we expect the htlc to be published by an external
actor.
*/
bool external_htlc = 5;
/**
/*
The number of blocks that the on chain htlc should confirm within.
*/
int32 htlc_conf_target = 6;
@ -287,10 +296,19 @@ message LoopInRequest {
and may not be one of the reserved values in loop/labels Reserved list.
*/
string label = 7;
/*
An optional identification string that will be appended to the user agent
string sent to the server to give information about the usage of loop. This
initiator part is meant for user interfaces to add their name to give the
full picture of the binary used (loopd, LiT) and the method used for
triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
*/
string initiator = 8;
}
message SwapResponse {
/**
/*
Swap identifier to track status in the update stream that is returned from
the Start() call. Currently this is the hash that locks the htlcs.
DEPRECATED: To make the API more consistent, this field is deprecated in
@ -298,13 +316,13 @@ message SwapResponse {
*/
string id = 1 [deprecated = true];
/**
/*
Swap identifier to track status in the update stream that is returned from
the Start() call. Currently this is the hash that locks the htlcs.
*/
bytes id_bytes = 3;
/**
/*
DEPRECATED. This field stores the address of the onchain htlc, but
depending on the request, the semantics are different.
- For internal loop-in htlc_address contains the address of the
@ -316,13 +334,13 @@ message SwapResponse {
*/
string htlc_address = 2 [deprecated = true];
/**
/*
The nested segwit address of the on-chain htlc.
This field remains empty for loop-out.
*/
string htlc_address_np2wsh = 4;
/**
/*
The native segwit address of the on-chain htlc.
Used for both loop-in and loop-out.
*/
@ -336,13 +354,13 @@ message MonitorRequest {
}
message SwapStatus {
/**
/*
Requested swap amount in sat. This does not include the swap and miner
fee.
*/
int64 amt = 1;
/**
/*
Swap identifier to track status in the update stream that is returned from
the Start() call. Currently this is the hash that locks the htlcs.
DEPRECATED: To make the API more consistent, this field is deprecated in
@ -350,18 +368,18 @@ message SwapStatus {
*/
string id = 2 [deprecated = true];
/**
/*
Swap identifier to track status in the update stream that is returned from
the Start() call. Currently this is the hash that locks the htlcs.
*/
bytes id_bytes = 11;
/**
Swap type
/*
The type of the swap.
*/
SwapType type = 3;
/**
/*
State the swap is currently in, see State enum.
*/
SwapState state = 4;
@ -371,17 +389,17 @@ message SwapStatus {
*/
FailureReason failure_reason = 14;
/**
/*
Initiation time of the swap.
*/
int64 initiation_time = 5;
/**
/*
Initiation time of the swap.
*/
int64 last_update_time = 6;
/**
/*
DEPRECATED: This field stores the address of the onchain htlc.
- For internal loop-in htlc_address contains the address of the
native segwit (P2WSH) htlc.
@ -398,7 +416,7 @@ message SwapStatus {
// HTLC address (nested segwit), used in loop-in swaps only.
string htlc_address_np2wsh = 13;
/// Swap server cost
// Swap server cost
int64 cost_server = 8;
// On-chain transaction cost
@ -420,14 +438,14 @@ enum SwapType {
}
enum SwapState {
/**
/*
INITIATED is the initial state of a swap. At that point, the initiation
call to the server has been made and the payment process has been started
for the swap and prepayment invoices.
*/
INITIATED = 0;
/**
/*
PREIMAGE_REVEALED is reached when the sweep tx publication is first
attempted. From that point on, we should consider the preimage to no
longer be secret and we need to do all we can to get the sweep confirmed.
@ -436,32 +454,32 @@ enum SwapState {
*/
PREIMAGE_REVEALED = 1;
/**
/*
HTLC_PUBLISHED is reached when the htlc tx has been published in a loop in
swap.
*/
HTLC_PUBLISHED = 2;
/**
/*
SUCCESS is the final swap state that is reached when the sweep tx has
the required confirmation depth.
*/
SUCCESS = 3;
/**
/*
FAILED is the final swap state for a failed swap with or without loss of
the swap amount.
*/
FAILED = 4;
/**
/*
INVOICE_SETTLED is reached when the swap invoice in a loop in swap has been
paid, but we are still waiting for the htlc spend to confirm.
*/
INVOICE_SETTLED = 5;
}
enum FailureReason{
enum FailureReason {
/*
FAILURE_REASON_NONE is set when the swap did not fail, it is either in
progress or succeeded.
@ -512,14 +530,14 @@ message ListSwapsRequest {
}
message ListSwapsResponse {
/**
/*
The list of all currently known swaps and their status.
*/
repeated SwapStatus swaps = 1;
}
message SwapInfoRequest {
/**
/*
The swap identifier which currently is the hash that locks the HTLCs. When
using REST, this field must be encoded as URL safe base64.
*/
@ -533,12 +551,12 @@ message InTermsResponse {
reserved 1, 2, 3, 4, 7;
/**
/*
Minimum swap amount (sat)
*/
int64 min_swap_amount = 5;
/**
/*
Maximum swap amount (sat)
*/
int64 max_swap_amount = 6;
@ -548,12 +566,12 @@ message OutTermsResponse {
reserved 1, 2, 3, 4, 7;
/**
/*
Minimum swap amount (sat)
*/
int64 min_swap_amount = 5;
/**
/*
Maximum swap amount (sat)
*/
int64 max_swap_amount = 6;
@ -566,12 +584,12 @@ message OutTermsResponse {
}
message QuoteRequest {
/**
/*
The amount to swap in satoshis.
*/
int64 amt = 1;
/**
/*
The confirmation target that should be used either for the sweep of the
on-chain HTLC broadcast by the swap server in the case of a Loop Out, or for
the confirmation of the on-chain HTLC broadcast by the swap client in the
@ -579,13 +597,13 @@ message QuoteRequest {
*/
int32 conf_target = 2;
/**
/*
If external_htlc is true, we expect the htlc to be published by an external
actor.
*/
bool external_htlc = 3;
/**
/*
The latest time (in unix seconds) we allow the server to wait before
publishing the HTLC on chain. Setting this to a larger value will give the
server the opportunity to batch multiple swaps together, and wait for
@ -598,7 +616,7 @@ message QuoteRequest {
message InQuoteResponse {
reserved 2, 4;
/**
/*
The fee that the swap server is charging for the swap.
*/
int64 swap_fee_sat = 1;
@ -613,36 +631,36 @@ message InQuoteResponse {
*/
int64 htlc_publish_fee_sat = 3;
/**
/*
On-chain cltv expiry delta
*/
int32 cltv_delta = 5;
}
message OutQuoteResponse {
/**
/*
The fee that the swap server is charging for the swap.
*/
int64 swap_fee_sat = 1;
/**
/*
The part of the swap fee that is requested as a prepayment.
*/
int64 prepay_amt_sat = 2;
/**
/*
An estimate of the on-chain fee that needs to be paid to sweep the HTLC for
a loop out.
*/
int64 htlc_sweep_fee_sat = 3;
/**
/*
The node pubkey where the swap payment needs to be paid
to. This can be used to test connectivity before initiating the swap.
*/
bytes swap_payment_dest = 4;
/**
/*
On-chain cltv expiry delta
*/
int32 cltv_delta = 5;
@ -652,60 +670,61 @@ message TokensRequest {
}
message TokensResponse {
/**
/*
List of all tokens the daemon knows of, including old/expired tokens.
*/
repeated LsatToken tokens = 1;
}
message LsatToken {
/**
/*
The base macaroon that was baked by the auth server.
*/
bytes base_macaroon = 1;
/**
/*
The payment hash of the payment that was paid to obtain the token.
*/
bytes payment_hash = 2;
/**
/*
The preimage of the payment hash, knowledge of this is proof that the
payment has been paid. If the preimage is set to all zeros, this means the
payment is still pending and the token is not yet fully valid.
*/
bytes payment_preimage = 3;
/**
/*
The amount of millisatoshis that was paid to get the token.
*/
int64 amount_paid_msat = 4;
/**
/*
The amount of millisatoshis paid in routing fee to pay for the token.
*/
int64 routing_fee_paid_msat = 5;
/**
/*
The creation time of the token as UNIX timestamp in seconds.
*/
int64 time_created = 6;
/**
/*
Indicates whether the token is expired or still valid.
*/
bool expired = 7;
/**
/*
Identifying attribute of this token in the store. Currently represents the
file name of the token where it's stored on the file system.
*/
string storage_name = 8;
}
message GetLiquidityParamsRequest{}
message GetLiquidityParamsRequest {
}
message LiquidityParameters{
message LiquidityParameters {
/*
A set of liquidity rules that describe the desired liquidity balance.
*/
@ -791,12 +810,12 @@ message LiquidityParameters{
uint64 auto_max_in_flight = 13;
}
enum LiquidityRuleType{
enum LiquidityRuleType {
UNKNOWN = 0;
THRESHOLD = 1;
}
message LiquidityRule{
message LiquidityRule {
/*
The short channel ID of the channel that this rule should be applied to.
*/
@ -823,7 +842,7 @@ message LiquidityRule{
uint32 outgoing_threshold = 4;
}
message SetLiquidityParamsRequest{
message SetLiquidityParamsRequest {
/*
Parameters is the desired new set of parameters for the liquidity management
subsystem. Note that the current set of parameters will be completely
@ -833,15 +852,15 @@ message SetLiquidityParamsRequest{
LiquidityParameters parameters = 1;
}
message SetLiquidityParamsResponse{}
message SetLiquidityParamsResponse {
}
message SuggestSwapsRequest{
message SuggestSwapsRequest {
}
message SuggestSwapsResponse{
message SuggestSwapsResponse {
/*
The set of recommended loop outs.
*/
repeated LoopOutRequest loop_out= 1;
repeated LoopOutRequest loop_out = 1;
}

@ -90,7 +90,7 @@
},
"/v1/loop/in": {
"post": {
"summary": "* loop: `in`\nLoopIn initiates a loop in swap with the given parameters. The call\nreturns after the swap has been set up with the swap server. From that\npoint onwards, progress can be tracked via the SwapStatus stream\nthat is returned from Monitor().",
"summary": "loop: `in`\nLoopIn initiates a loop in swap with the given parameters. The call\nreturns after the swap has been set up with the swap server. From that\npoint onwards, progress can be tracked via the SwapStatus stream\nthat is returned from Monitor().",
"operationId": "LoopIn",
"responses": {
"200": {
@ -123,7 +123,7 @@
},
"/v1/loop/in/quote/{amt}": {
"get": {
"summary": "* loop: `quote`\nGetQuote returns a quote for a swap with the provided parameters.",
"summary": "loop: `quote`\nGetQuote returns a quote for a swap with the provided parameters.",
"operationId": "GetLoopInQuote",
"responses": {
"200": {
@ -142,7 +142,7 @@
"parameters": [
{
"name": "amt",
"description": "*\nThe amount to swap in satoshis.",
"description": "The amount to swap in satoshis.",
"in": "path",
"required": true,
"type": "string",
@ -150,7 +150,7 @@
},
{
"name": "conf_target",
"description": "*\nThe confirmation target that should be used either for the sweep of the\non-chain HTLC broadcast by the swap server in the case of a Loop Out, or for\nthe confirmation of the on-chain HTLC broadcast by the swap client in the\ncase of a Loop In.",
"description": "The confirmation target that should be used either for the sweep of the\non-chain HTLC broadcast by the swap server in the case of a Loop Out, or for\nthe confirmation of the on-chain HTLC broadcast by the swap client in the\ncase of a Loop In.",
"in": "query",
"required": false,
"type": "integer",
@ -158,7 +158,7 @@
},
{
"name": "external_htlc",
"description": "*\nIf external_htlc is true, we expect the htlc to be published by an external\nactor.",
"description": "If external_htlc is true, we expect the htlc to be published by an external\nactor.",
"in": "query",
"required": false,
"type": "boolean",
@ -166,7 +166,7 @@
},
{
"name": "swap_publication_deadline",
"description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee. This only has an effect on loop out quotes.",
"description": "The latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee. This only has an effect on loop out quotes.",
"in": "query",
"required": false,
"type": "string",
@ -180,7 +180,7 @@
},
"/v1/loop/in/terms": {
"get": {
"summary": "* loop: `terms`\nGetTerms returns the terms that the server enforces for swaps.",
"summary": "loop: `terms`\nGetTerms returns the terms that the server enforces for swaps.",
"operationId": "GetLoopInTerms",
"responses": {
"200": {
@ -203,7 +203,7 @@
},
"/v1/loop/out": {
"post": {
"summary": "* loop: `out`\nLoopOut initiates an loop out swap with the given parameters. The call\nreturns after the swap has been set up with the swap server. From that\npoint onwards, progress can be tracked via the SwapStatus stream that is\nreturned from Monitor().",
"summary": "loop: `out`\nLoopOut initiates an loop out swap with the given parameters. The call\nreturns after the swap has been set up with the swap server. From that\npoint onwards, progress can be tracked via the SwapStatus stream that is\nreturned from Monitor().",
"operationId": "LoopOut",
"responses": {
"200": {
@ -236,7 +236,7 @@
},
"/v1/loop/out/quote/{amt}": {
"get": {
"summary": "* loop: `quote`\nLoopOutQuote returns a quote for a loop out swap with the provided\nparameters.",
"summary": "loop: `quote`\nLoopOutQuote returns a quote for a loop out swap with the provided\nparameters.",
"operationId": "LoopOutQuote",
"responses": {
"200": {
@ -255,7 +255,7 @@
"parameters": [
{
"name": "amt",
"description": "*\nThe amount to swap in satoshis.",
"description": "The amount to swap in satoshis.",
"in": "path",
"required": true,
"type": "string",
@ -263,7 +263,7 @@
},
{
"name": "conf_target",
"description": "*\nThe confirmation target that should be used either for the sweep of the\non-chain HTLC broadcast by the swap server in the case of a Loop Out, or for\nthe confirmation of the on-chain HTLC broadcast by the swap client in the\ncase of a Loop In.",
"description": "The confirmation target that should be used either for the sweep of the\non-chain HTLC broadcast by the swap server in the case of a Loop Out, or for\nthe confirmation of the on-chain HTLC broadcast by the swap client in the\ncase of a Loop In.",
"in": "query",
"required": false,
"type": "integer",
@ -271,7 +271,7 @@
},
{
"name": "external_htlc",
"description": "*\nIf external_htlc is true, we expect the htlc to be published by an external\nactor.",
"description": "If external_htlc is true, we expect the htlc to be published by an external\nactor.",
"in": "query",
"required": false,
"type": "boolean",
@ -279,7 +279,7 @@
},
{
"name": "swap_publication_deadline",
"description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee. This only has an effect on loop out quotes.",
"description": "The latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee. This only has an effect on loop out quotes.",
"in": "query",
"required": false,
"type": "string",
@ -293,7 +293,7 @@
},
"/v1/loop/out/terms": {
"get": {
"summary": "* loop: `terms`\nLoopOutTerms returns the terms that the server enforces for a loop out swap.",
"summary": "loop: `terms`\nLoopOutTerms returns the terms that the server enforces for a loop out swap.",
"operationId": "LoopOutTerms",
"responses": {
"200": {
@ -316,7 +316,7 @@
},
"/v1/loop/swap/{id}": {
"get": {
"summary": "* loop: `swapinfo`\nSwapInfo returns all known details about a single swap.",
"summary": "loop: `swapinfo`\nSwapInfo returns all known details about a single swap.",
"operationId": "SwapInfo",
"responses": {
"200": {
@ -335,7 +335,7 @@
"parameters": [
{
"name": "id",
"description": "*\nThe swap identifier which currently is the hash that locks the HTLCs. When\nusing REST, this field must be encoded as URL safe base64.",
"description": "The swap identifier which currently is the hash that locks the HTLCs. When\nusing REST, this field must be encoded as URL safe base64.",
"in": "path",
"required": true,
"type": "string",
@ -349,7 +349,7 @@
},
"/v1/loop/swaps": {
"get": {
"summary": "* loop: `listswaps`\nListSwaps returns a list of all currently known swaps and their current\nstatus.",
"summary": "loop: `listswaps`\nListSwaps returns a list of all currently known swaps and their current\nstatus.",
"operationId": "ListSwaps",
"responses": {
"200": {
@ -372,7 +372,7 @@
},
"/v1/lsat/tokens": {
"get": {
"summary": "* loop: `listauth`\nGetLsatTokens returns all LSAT tokens the daemon ever paid for.",
"summary": "loop: `listauth`\nGetLsatTokens returns all LSAT tokens the daemon ever paid for.",
"operationId": "GetLsatTokens",
"responses": {
"200": {
@ -415,7 +415,7 @@
"swap_fee_sat": {
"type": "string",
"format": "int64",
"description": "*\nThe fee that the swap server is charging for the swap."
"description": "The fee that the swap server is charging for the swap."
},
"htlc_publish_fee_sat": {
"type": "string",
@ -425,7 +425,7 @@
"cltv_delta": {
"type": "integer",
"format": "int32",
"title": "*\nOn-chain cltv expiry delta"
"title": "On-chain cltv expiry delta"
}
}
},
@ -435,12 +435,12 @@
"min_swap_amount": {
"type": "string",
"format": "int64",
"title": "*\nMinimum swap amount (sat)"
"title": "Minimum swap amount (sat)"
},
"max_swap_amount": {
"type": "string",
"format": "int64",
"title": "*\nMaximum swap amount (sat)"
"title": "Maximum swap amount (sat)"
}
}
},
@ -556,7 +556,7 @@
"items": {
"$ref": "#/definitions/looprpcSwapStatus"
},
"description": "*\nThe list of all currently known swaps and their status."
"description": "The list of all currently known swaps and their status."
}
}
},
@ -566,36 +566,40 @@
"amt": {
"type": "string",
"format": "int64",
"description": "*\nRequested swap amount in sat. This does not include the swap and miner \nfee."
"description": "Requested swap amount in sat. This does not include the swap and miner \nfee."
},
"max_swap_fee": {
"type": "string",
"format": "int64",
"description": "*\nMaximum we are willing to pay the server for the swap. This value is not\ndisclosed in the swap initiation call, but if the server asks for a\nhigher fee, we abort the swap. Typically this value is taken from the\nresponse of the GetQuote call."
"description": "Maximum we are willing to pay the server for the swap. This value is not\ndisclosed in the swap initiation call, but if the server asks for a\nhigher fee, we abort the swap. Typically this value is taken from the\nresponse of the GetQuote call."
},
"max_miner_fee": {
"type": "string",
"format": "int64",
"description": "*\nMaximum in on-chain fees that we are willing to spend. If we want to\npublish the on-chain htlc and the fee estimate turns out higher than this\nvalue, we cancel the swap. \n\nmax_miner_fee is typically taken from the response of the GetQuote call."
"description": "Maximum in on-chain fees that we are willing to spend. If we want to\npublish the on-chain htlc and the fee estimate turns out higher than this\nvalue, we cancel the swap. \n\nmax_miner_fee is typically taken from the response of the GetQuote call."
},
"last_hop": {
"type": "string",
"format": "byte",
"description": "*\nThe last hop to use for the loop in swap. If empty, the last hop is selected\nbased on the lowest routing fee for the swap payment from the server."
"description": "The last hop to use for the loop in swap. If empty, the last hop is selected\nbased on the lowest routing fee for the swap payment from the server."
},
"external_htlc": {
"type": "boolean",
"format": "boolean",
"description": "*\nIf external_htlc is true, we expect the htlc to be published by an external\nactor."
"description": "If external_htlc is true, we expect the htlc to be published by an external\nactor."
},
"htlc_conf_target": {
"type": "integer",
"format": "int32",
"description": "*\nThe number of blocks that the on chain htlc should confirm within."
"description": "The number of blocks that the on chain htlc should confirm within."
},
"label": {
"type": "string",
"description": "An optional label for this swap. This field is limited to 500 characters\nand may not be one of the reserved values in loop/labels Reserved list."
},
"initiator": {
"type": "string",
"description": "An optional identification string that will be appended to the user agent\nstring sent to the server to give information about the usage of loop. This\ninitiator part is meant for user interfaces to add their name to give the\nfull picture of the binary used (loopd, LiT) and the method used for\ntriggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI)."
}
}
},
@ -605,41 +609,41 @@
"amt": {
"type": "string",
"format": "int64",
"description": "*\nRequested swap amount in sat. This does not include the swap and miner fee."
"description": "Requested swap amount in sat. This does not include the swap and miner fee."
},
"dest": {
"type": "string",
"description": "*\nBase58 encoded destination address for the swap."
"description": "Base58 encoded destination address for the swap."
},
"max_swap_routing_fee": {
"type": "string",
"format": "int64",
"description": "*\nMaximum off-chain fee in sat that may be paid for swap payment to the server.\nThis limit is applied during path finding. Typically this value is taken\nfrom the response of the GetQuote call."
"description": "Maximum off-chain fee in sat that may be paid for swap payment to the server.\nThis limit is applied during path finding. Typically this value is taken\nfrom the response of the GetQuote call."
},
"max_prepay_routing_fee": {
"type": "string",
"format": "int64",
"description": "*\nMaximum off-chain fee in sat that may be paid for the prepay to the server.\nThis limit is applied during path finding. Typically this value is taken\nfrom the response of the GetQuote call."
"description": "Maximum off-chain fee in sat that may be paid for the prepay to the server.\nThis limit is applied during path finding. Typically this value is taken\nfrom the response of the GetQuote call."
},
"max_swap_fee": {
"type": "string",
"format": "int64",
"description": "*\nMaximum we are willing to pay the server for the swap. This value is not\ndisclosed in the swap initiation call, but if the server asks for a\nhigher fee, we abort the swap. Typically this value is taken from the\nresponse of the GetQuote call. It includes the prepay amount."
"description": "Maximum we are willing to pay the server for the swap. This value is not\ndisclosed in the swap initiation call, but if the server asks for a\nhigher fee, we abort the swap. Typically this value is taken from the\nresponse of the GetQuote call. It includes the prepay amount."
},
"max_prepay_amt": {
"type": "string",
"format": "int64",
"description": "*\nMaximum amount of the swap fee that may be charged as a prepayment."
"description": "Maximum amount of the swap fee that may be charged as a prepayment."
},
"max_miner_fee": {
"type": "string",
"format": "int64",
"description": "*\nMaximum in on-chain fees that we are willing to spend. If we want to\nsweep the on-chain htlc and the fee estimate turns out higher than this\nvalue, we cancel the swap. If the fee estimate is lower, we publish the\nsweep tx.\n\nIf the sweep tx is not confirmed, we are forced to ratchet up fees until it\nis swept. Possibly even exceeding max_miner_fee if we get close to the htlc\ntimeout. Because the initial publication revealed the preimage, we have no\nother choice. The server may already have pulled the off-chain htlc. Only\nwhen the fee becomes higher than the swap amount, we can only wait for fees\nto come down and hope - if we are past the timeout - that the server is not\npublishing the revocation.\n\nmax_miner_fee is typically taken from the response of the GetQuote call."
"description": "Maximum in on-chain fees that we are willing to spend. If we want to\nsweep the on-chain htlc and the fee estimate turns out higher than this\nvalue, we cancel the swap. If the fee estimate is lower, we publish the\nsweep tx.\n\nIf the sweep tx is not confirmed, we are forced to ratchet up fees until it\nis swept. Possibly even exceeding max_miner_fee if we get close to the htlc\ntimeout. Because the initial publication revealed the preimage, we have no\nother choice. The server may already have pulled the off-chain htlc. Only\nwhen the fee becomes higher than the swap amount, we can only wait for fees\nto come down and hope - if we are past the timeout - that the server is not\npublishing the revocation.\n\nmax_miner_fee is typically taken from the response of the GetQuote call."
},
"loop_out_channel": {
"type": "string",
"format": "uint64",
"description": "*\nDeprecated, use outgoing_chan_set. The channel to loop out, the channel\nto loop out is selected based on the lowest routing fee for the swap\npayment to the server."
"description": "Deprecated, use outgoing_chan_set. The channel to loop out, the channel\nto loop out is selected based on the lowest routing fee for the swap\npayment to the server."
},
"outgoing_chan_set": {
"type": "array",
@ -647,12 +651,12 @@
"type": "string",
"format": "uint64"
},
"description": "*\nA restriction on the channel set that may be used to loop out. The actual\nchannel(s) that will be used are selected based on the lowest routing fee\nfor the swap payment to the server."
"description": "A restriction on the channel set that may be used to loop out. The actual\nchannel(s) that will be used are selected based on the lowest routing fee\nfor the swap payment to the server."
},
"sweep_conf_target": {
"type": "integer",
"format": "int32",
"description": "*\nThe number of blocks from the on-chain HTLC's confirmation height that it\nshould be swept within."
"description": "The number of blocks from the on-chain HTLC's confirmation height that it\nshould be swept within."
},
"htlc_confirmations": {
"type": "integer",
@ -662,11 +666,15 @@
"swap_publication_deadline": {
"type": "string",
"format": "uint64",
"description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee."
"description": "The latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee."
},
"label": {
"type": "string",
"description": "An optional label for this swap. This field is limited to 500 characters\nand may not start with the prefix [reserved], which is used to tag labels\nproduced by the daemon."
},
"initiator": {
"type": "string",
"description": "An optional identification string that will be appended to the user agent\nstring sent to the server to give information about the usage of loop. This\ninitiator part is meant for user interfaces to add their name to give the\nfull picture of the binary used (loopd, LiT) and the method used for\ntriggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI)."
}
}
},
@ -676,41 +684,41 @@
"base_macaroon": {
"type": "string",
"format": "byte",
"description": "*\nThe base macaroon that was baked by the auth server."
"description": "The base macaroon that was baked by the auth server."
},
"payment_hash": {
"type": "string",
"format": "byte",
"description": "*\nThe payment hash of the payment that was paid to obtain the token."
"description": "The payment hash of the payment that was paid to obtain the token."
},
"payment_preimage": {
"type": "string",
"format": "byte",
"description": "*\nThe preimage of the payment hash, knowledge of this is proof that the\npayment has been paid. If the preimage is set to all zeros, this means the\npayment is still pending and the token is not yet fully valid."
"description": "The preimage of the payment hash, knowledge of this is proof that the\npayment has been paid. If the preimage is set to all zeros, this means the\npayment is still pending and the token is not yet fully valid."
},
"amount_paid_msat": {
"type": "string",
"format": "int64",
"description": "*\nThe amount of millisatoshis that was paid to get the token."
"description": "The amount of millisatoshis that was paid to get the token."
},
"routing_fee_paid_msat": {
"type": "string",
"format": "int64",
"description": "*\nThe amount of millisatoshis paid in routing fee to pay for the token."
"description": "The amount of millisatoshis paid in routing fee to pay for the token."
},
"time_created": {
"type": "string",
"format": "int64",
"description": "*\nThe creation time of the token as UNIX timestamp in seconds."
"description": "The creation time of the token as UNIX timestamp in seconds."
},
"expired": {
"type": "boolean",
"format": "boolean",
"description": "*\nIndicates whether the token is expired or still valid."
"description": "Indicates whether the token is expired or still valid."
},
"storage_name": {
"type": "string",
"description": "*\nIdentifying attribute of this token in the store. Currently represents the\nfile name of the token where it's stored on the file system."
"description": "Identifying attribute of this token in the store. Currently represents the\nfile name of the token where it's stored on the file system."
}
}
},
@ -720,27 +728,27 @@
"swap_fee_sat": {
"type": "string",
"format": "int64",
"description": "*\nThe fee that the swap server is charging for the swap."
"description": "The fee that the swap server is charging for the swap."
},
"prepay_amt_sat": {
"type": "string",
"format": "int64",
"description": "*\nThe part of the swap fee that is requested as a prepayment."
"description": "The part of the swap fee that is requested as a prepayment."
},
"htlc_sweep_fee_sat": {
"type": "string",
"format": "int64",
"description": "*\nAn estimate of the on-chain fee that needs to be paid to sweep the HTLC for\na loop out."
"description": "An estimate of the on-chain fee that needs to be paid to sweep the HTLC for\na loop out."
},
"swap_payment_dest": {
"type": "string",
"format": "byte",
"description": "*\nThe node pubkey where the swap payment needs to be paid\nto. This can be used to test connectivity before initiating the swap."
"description": "The node pubkey where the swap payment needs to be paid\nto. This can be used to test connectivity before initiating the swap."
},
"cltv_delta": {
"type": "integer",
"format": "int32",
"title": "*\nOn-chain cltv expiry delta"
"title": "On-chain cltv expiry delta"
}
}
},
@ -750,12 +758,12 @@
"min_swap_amount": {
"type": "string",
"format": "int64",
"title": "*\nMinimum swap amount (sat)"
"title": "Minimum swap amount (sat)"
},
"max_swap_amount": {
"type": "string",
"format": "int64",
"title": "*\nMaximum swap amount (sat)"
"title": "Maximum swap amount (sat)"
},
"min_cltv_delta": {
"type": "integer",
@ -798,24 +806,24 @@
"properties": {
"id": {
"type": "string",
"description": "*\nSwap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs.\nDEPRECATED: To make the API more consistent, this field is deprecated in\nfavor of id_bytes and will be removed in a future release."
"description": "Swap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs.\nDEPRECATED: To make the API more consistent, this field is deprecated in\nfavor of id_bytes and will be removed in a future release."
},
"id_bytes": {
"type": "string",
"format": "byte",
"description": "*\nSwap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs."
"description": "Swap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs."
},
"htlc_address": {
"type": "string",
"description": "*\nDEPRECATED. This field stores the address of the onchain htlc, but\ndepending on the request, the semantics are different.\n- For internal loop-in htlc_address contains the address of the\nnative segwit (P2WSH) htlc.\n- For external loop-in htlc_address contains the address of the\nnested segwit (NP2WSH) htlc.\n- For loop-out htlc_address always contains the native segwit (P2WSH)\nhtlc address."
"description": "DEPRECATED. This field stores the address of the onchain htlc, but\ndepending on the request, the semantics are different.\n- For internal loop-in htlc_address contains the address of the\nnative segwit (P2WSH) htlc.\n- For external loop-in htlc_address contains the address of the\nnested segwit (NP2WSH) htlc.\n- For loop-out htlc_address always contains the native segwit (P2WSH)\nhtlc address."
},
"htlc_address_np2wsh": {
"type": "string",
"description": "*\nThe nested segwit address of the on-chain htlc.\nThis field remains empty for loop-out."
"description": "The nested segwit address of the on-chain htlc.\nThis field remains empty for loop-out."
},
"htlc_address_p2wsh": {
"type": "string",
"description": "*\nThe native segwit address of the on-chain htlc.\nUsed for both loop-in and loop-out."
"description": "The native segwit address of the on-chain htlc.\nUsed for both loop-in and loop-out."
},
"server_message": {
"type": "string",
@ -834,7 +842,7 @@
"INVOICE_SETTLED"
],
"default": "INITIATED",
"description": " - INITIATED: *\nINITIATED is the initial state of a swap. At that point, the initiation\ncall to the server has been made and the payment process has been started\nfor the swap and prepayment invoices.\n - PREIMAGE_REVEALED: *\nPREIMAGE_REVEALED is reached when the sweep tx publication is first\nattempted. From that point on, we should consider the preimage to no\nlonger be secret and we need to do all we can to get the sweep confirmed.\nThis state will mostly coalesce with StateHtlcConfirmed, except in the\ncase where we wait for fees to come down before we sweep.\n - HTLC_PUBLISHED: *\nHTLC_PUBLISHED is reached when the htlc tx has been published in a loop in\nswap.\n - SUCCESS: *\nSUCCESS is the final swap state that is reached when the sweep tx has\nthe required confirmation depth.\n - FAILED: *\nFAILED is the final swap state for a failed swap with or without loss of\nthe swap amount.\n - INVOICE_SETTLED: *\nINVOICE_SETTLED is reached when the swap invoice in a loop in swap has been\npaid, but we are still waiting for the htlc spend to confirm."
"description": " - INITIATED: INITIATED is the initial state of a swap. At that point, the initiation\ncall to the server has been made and the payment process has been started\nfor the swap and prepayment invoices.\n - PREIMAGE_REVEALED: PREIMAGE_REVEALED is reached when the sweep tx publication is first\nattempted. From that point on, we should consider the preimage to no\nlonger be secret and we need to do all we can to get the sweep confirmed.\nThis state will mostly coalesce with StateHtlcConfirmed, except in the\ncase where we wait for fees to come down before we sweep.\n - HTLC_PUBLISHED: HTLC_PUBLISHED is reached when the htlc tx has been published in a loop in\nswap.\n - SUCCESS: SUCCESS is the final swap state that is reached when the sweep tx has\nthe required confirmation depth.\n - FAILED: FAILED is the final swap state for a failed swap with or without loss of\nthe swap amount.\n - INVOICE_SETTLED: INVOICE_SETTLED is reached when the swap invoice in a loop in swap has been\npaid, but we are still waiting for the htlc spend to confirm."
},
"looprpcSwapStatus": {
"type": "object",
@ -842,24 +850,24 @@
"amt": {
"type": "string",
"format": "int64",
"description": "*\nRequested swap amount in sat. This does not include the swap and miner\nfee."
"description": "Requested swap amount in sat. This does not include the swap and miner\nfee."
},
"id": {
"type": "string",
"description": "*\nSwap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs.\nDEPRECATED: To make the API more consistent, this field is deprecated in\nfavor of id_bytes and will be removed in a future release."
"description": "Swap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs.\nDEPRECATED: To make the API more consistent, this field is deprecated in\nfavor of id_bytes and will be removed in a future release."
},
"id_bytes": {
"type": "string",
"format": "byte",
"description": "*\nSwap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs."
"description": "Swap identifier to track status in the update stream that is returned from\nthe Start() call. Currently this is the hash that locks the htlcs."
},
"type": {
"$ref": "#/definitions/looprpcSwapType",
"title": "*\nSwap type"
"description": "The type of the swap."
},
"state": {
"$ref": "#/definitions/looprpcSwapState",
"description": "*\nState the swap is currently in, see State enum."
"description": "State the swap is currently in, see State enum."
},
"failure_reason": {
"$ref": "#/definitions/looprpcFailureReason",
@ -868,16 +876,16 @@
"initiation_time": {
"type": "string",
"format": "int64",
"description": "*\nInitiation time of the swap."
"description": "Initiation time of the swap."
},
"last_update_time": {
"type": "string",
"format": "int64",
"description": "*\nInitiation time of the swap."
"description": "Initiation time of the swap."
},
"htlc_address": {
"type": "string",
"description": "*\nDEPRECATED: This field stores the address of the onchain htlc.\n- For internal loop-in htlc_address contains the address of the\nnative segwit (P2WSH) htlc.\n- For external loop-in htlc_address contains the nested segwit (NP2WSH)\naddress.\n- For loop-out htlc_address always contains the native segwit (P2WSH)\nhtlc address."
"description": "DEPRECATED: This field stores the address of the onchain htlc.\n- For internal loop-in htlc_address contains the address of the\nnative segwit (P2WSH) htlc.\n- For external loop-in htlc_address contains the nested segwit (NP2WSH)\naddress.\n- For loop-out htlc_address always contains the native segwit (P2WSH)\nhtlc address."
},
"htlc_address_p2wsh": {
"type": "string",
@ -890,7 +898,7 @@
"cost_server": {
"type": "string",
"format": "int64",
"title": "/ Swap server cost"
"title": "Swap server cost"
},
"cost_onchain": {
"type": "string",
@ -925,7 +933,7 @@
"items": {
"$ref": "#/definitions/looprpcLsatToken"
},
"description": "*\nList of all tokens the daemon knows of, including old/expired tokens."
"description": "List of all tokens the daemon knows of, including old/expired tokens."
}
}
},

@ -16,6 +16,13 @@ This file tracks release notes for the loop client.
#### NewFeatures
* When requesting a swap, a new `initiator` field can be set on the gRPC/REST
interface that is appended to the user agent string that is sent to the server
to give information about Loop usage. The initiator field is meant for user
interfaces to add their name to give the full picture of the binary used
(`loopd`, LiT) and the method/interface used for triggering the swap (`loop`
CLI, autolooper, LiT UI, other 3rd party UI).
#### Breaking Changes
#### Bug Fixes

@ -64,10 +64,9 @@ func newServerMock(lnd *test.LndMockServices) *serverMock {
}
}
func (s *serverMock) NewLoopOutSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount, expiry int32,
receiverKey [33]byte, _ time.Time) (
*newLoopOutResponse, error) {
func (s *serverMock) NewLoopOutSwap(_ context.Context, swapHash lntypes.Hash,
amount btcutil.Amount, _ int32, _ [33]byte, _ time.Time,
_ string) (*newLoopOutResponse, error) {
_, senderKey := test.CreateKey(100)
@ -138,10 +137,9 @@ func getInvoice(hash lntypes.Hash, amt btcutil.Amount, memo string) (string, err
return reqString, nil
}
func (s *serverMock) NewLoopInSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount,
senderKey [33]byte, swapInvoice, probeInvoice string,
lastHop *route.Vertex) (*newLoopInResponse, error) {
func (s *serverMock) NewLoopInSwap(_ context.Context, swapHash lntypes.Hash,
amount btcutil.Amount, _ [33]byte, swapInvoice, _ string,
_ *route.Vertex, _ string) (*newLoopInResponse, error) {
_, receiverKey := test.CreateKey(101)

@ -55,9 +55,8 @@ type swapServerClient interface {
NewLoopOutSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount, expiry int32,
receiverKey [33]byte,
swapPublicationDeadline time.Time) (
*newLoopOutResponse, error)
receiverKey [33]byte, swapPublicationDeadline time.Time,
initiator string) (*newLoopOutResponse, error)
PushLoopOutPreimage(ctx context.Context,
preimage lntypes.Preimage) error
@ -65,7 +64,8 @@ type swapServerClient interface {
NewLoopInSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount,
senderKey [33]byte, swapInvoice, probeInvoice string,
lastHop *route.Vertex) (*newLoopInResponse, error)
lastHop *route.Vertex, initiator string) (*newLoopInResponse,
error)
// SubscribeLoopOutUpdates subscribes to loop out server state.
SubscribeLoopOutUpdates(ctx context.Context,
@ -220,8 +220,8 @@ func (s *grpcSwapServerClient) GetLoopInQuote(ctx context.Context,
func (s *grpcSwapServerClient) NewLoopOutSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount, expiry int32,
receiverKey [33]byte, swapPublicationDeadline time.Time) (
*newLoopOutResponse, error) {
receiverKey [33]byte, swapPublicationDeadline time.Time,
initiator string) (*newLoopOutResponse, error) {
rpcCtx, rpcCancel := context.WithTimeout(ctx, globalCallTimeout)
defer rpcCancel()
@ -233,7 +233,7 @@ func (s *grpcSwapServerClient) NewLoopOutSwap(ctx context.Context,
SwapPublicationDeadline: swapPublicationDeadline.Unix(),
ProtocolVersion: loopdb.CurrentRPCProtocolVersion,
Expiry: expiry,
UserAgent: UserAgent(),
UserAgent: UserAgent(initiator),
},
)
if err != nil {
@ -276,7 +276,8 @@ func (s *grpcSwapServerClient) PushLoopOutPreimage(ctx context.Context,
func (s *grpcSwapServerClient) NewLoopInSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount, senderKey [33]byte,
swapInvoice, probeInvoice string, lastHop *route.Vertex) (*newLoopInResponse, error) {
swapInvoice, probeInvoice string, lastHop *route.Vertex,
initiator string) (*newLoopInResponse, error) {
rpcCtx, rpcCancel := context.WithTimeout(ctx, globalCallTimeout)
defer rpcCancel()
@ -288,7 +289,7 @@ func (s *grpcSwapServerClient) NewLoopInSwap(ctx context.Context,
SwapInvoice: swapInvoice,
ProtocolVersion: loopdb.CurrentRPCProtocolVersion,
ProbeInvoice: probeInvoice,
UserAgent: UserAgent(),
UserAgent: UserAgent(initiator),
}
if lastHop != nil {
req.LastHop = lastHop[:]

@ -8,6 +8,7 @@ package loop
import (
"bytes"
"fmt"
"math"
"strings"
)
@ -15,7 +16,9 @@ import (
// using the -ldflags during compilation.
var Commit string
// semanticAlphabet
// semanticAlphabet is the allowed characters from the semantic versioning
// guidelines for pre-release version and build metadata strings. In particular
// they MUST only contain characters in semanticAlphabet.
const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"
// These constants define the application version and follow the semantic
@ -51,10 +54,28 @@ func Version() string {
// UserAgent returns the full user agent string that identifies the software
// that is submitting swaps to the loop server.
func UserAgent() string {
func UserAgent(initiator string) string {
// We'll only allow "safe" characters in the initiator portion of the
// user agent string and spaces only if surrounded by other characters.
initiatorAlphabet := semanticAlphabet + ". "
cleanInitiator := normalizeVerString(
strings.TrimSpace(initiator), initiatorAlphabet,
)
if len(cleanInitiator) > 0 {
cleanInitiator = fmt.Sprintf(",initiator=%s", cleanInitiator)
}
// The whole user agent string is limited to 255 characters server side
// and also consists of the agent name, version and commit. So we only
// want to take up at most 150 characters for the initiator. Anything
// more will just be dropped.
strLen := len(cleanInitiator)
cleanInitiator = cleanInitiator[:int(math.Min(float64(strLen), 150))]
// Assemble full string, including the commit hash of current build.
return fmt.Sprintf(
"%s/v%s/commit=%s", AgentName, semanticVersion(), Commit,
"%s/v%s/commit=%s%s", AgentName, semanticVersion(), Commit,
cleanInitiator,
)
}
@ -63,11 +84,11 @@ func semanticVersion() string {
// Start with the major, minor, and patch versions.
version := fmt.Sprintf("%d.%d.%d", appMajor, appMinor, appPatch)
// Append pre-release version if there is one. The hyphen called for
// Append pre-release version if there is one. The hyphen called for
// by the semantic versioning spec is automatically appended and should
// not be contained in the pre-release string. The pre-release version
// not be contained in the pre-release string. The pre-release version
// is not appended if it contains invalid characters.
preRelease := normalizeVerString(appPreRelease)
preRelease := normalizeVerString(appPreRelease, semanticAlphabet)
if preRelease != "" {
version = fmt.Sprintf("%s-%s", version, preRelease)
}
@ -76,13 +97,11 @@ func semanticVersion() string {
}
// normalizeVerString returns the passed string stripped of all characters
// which are not valid according to the semantic versioning guidelines for
// pre-release version and build metadata strings. In particular they MUST
// only contain characters in semanticAlphabet.
func normalizeVerString(str string) string {
// which are not valid according to the given alphabet.
func normalizeVerString(str, alphabet string) string {
var result bytes.Buffer
for _, r := range str {
if strings.ContainsRune(semanticAlphabet, r) {
if strings.ContainsRune(alphabet, r) {
result.WriteRune(r)
}
}

Loading…
Cancel
Save