diff --git a/client.go b/client.go index 526c2a6..ae45e9d 100644 --- a/client.go +++ b/client.go @@ -12,7 +12,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/btcsuite/btcd/btcutil" - "github.com/lightninglabs/aperture/lsat" + "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/loopdb" "github.com/lightninglabs/loop/swap" @@ -56,8 +56,8 @@ var ( // globalCallTimeout is the maximum time any call of the client to the // server is allowed to take, including the time it may take to get - // and pay for an LSAT token. - globalCallTimeout = serverRPCTimeout + lsat.PaymentTimeout + // and pay for an L402 token. + globalCallTimeout = serverRPCTimeout + l402.PaymentTimeout // probeTimeout is the maximum time until a probe is allowed to take. probeTimeout = 3 * time.Minute @@ -111,13 +111,13 @@ type ClientConfig struct { // Lnd is an instance of the lnd proxy. Lnd *lndclient.LndServices - // MaxLsatCost is the maximum price we are willing to pay to the server + // MaxL402Cost is the maximum price we are willing to pay to the server // for the token. - MaxLsatCost btcutil.Amount + MaxL402Cost btcutil.Amount - // MaxLsatFee is the maximum that we are willing to pay in routing fees + // MaxL402Fee is the maximum that we are willing to pay in routing fees // to obtain the token. - MaxLsatFee btcutil.Amount + MaxL402Fee btcutil.Amount // LoopOutMaxParts defines the maximum number of parts that may be used // for a loop out swap. When greater than one, a multi-part payment may @@ -138,12 +138,12 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore, sweeperDb sweepbatcher.BatcherStore, cfg *ClientConfig) ( *Client, func(), error) { - lsatStore, err := lsat.NewFileStore(dbDir) + l402Store, err := l402.NewFileStore(dbDir) if err != nil { return nil, nil, err } - swapServerClient, err := newSwapServerClient(cfg, lsatStore) + swapServerClient, err := newSwapServerClient(cfg, l402Store) if err != nil { return nil, nil, err } @@ -153,7 +153,7 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore, Server: swapServerClient, Store: loopDB, Conn: swapServerClient.conn, - LsatStore: lsatStore, + L402Store: l402Store, CreateExpiryTimer: func(d time.Duration) <-chan time.Time { return time.NewTimer(d).C }, diff --git a/cmd/loop/lsat.go b/cmd/loop/l402.go similarity index 92% rename from cmd/loop/lsat.go rename to cmd/loop/l402.go index 8342b3d..fa7428f 100644 --- a/cmd/loop/lsat.go +++ b/cmd/loop/l402.go @@ -26,8 +26,8 @@ type printableToken struct { var listAuthCommand = cli.Command{ Name: "listauth", - Usage: "list all LSAT tokens", - Description: "Shows a list of all LSAT tokens that loopd has paid for", + Usage: "list all L402 tokens", + Description: "Shows a list of all L402 tokens that loopd has paid for", Action: listAuth, } @@ -38,7 +38,7 @@ func listAuth(ctx *cli.Context) error { } defer cleanup() - resp, err := client.GetLsatTokens( + resp, err := client.GetL402Tokens( context.Background(), &looprpc.TokensRequest{}, ) if err != nil { diff --git a/config.go b/config.go index 0e2a7b5..6cf47c1 100644 --- a/config.go +++ b/config.go @@ -3,7 +3,7 @@ package loop import ( "time" - "github.com/lightninglabs/aperture/lsat" + "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/loopdb" "google.golang.org/grpc" @@ -15,7 +15,7 @@ type clientConfig struct { Server swapServerClient Conn *grpc.ClientConn Store loopdb.SwapStore - LsatStore lsat.Store + L402Store l402.Store CreateExpiryTimer func(expiry time.Duration) <-chan time.Time LoopOutMaxParts uint32 } diff --git a/go.mod b/go.mod index 67d59fd..fcef783 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/urfave/cli v1.22.9 golang.org/x/net v0.23.0 google.golang.org/grpc v1.59.0 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.33.0 gopkg.in/macaroon-bakery.v2 v2.1.0 gopkg.in/macaroon.v2 v2.1.0 modernc.org/sqlite v1.29.5 @@ -78,7 +78,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.1 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -161,14 +161,14 @@ require ( go.etcd.io/etcd/pkg/v3 v3.5.7 // indirect go.etcd.io/etcd/raft/v3 v3.5.7 // indirect go.etcd.io/etcd/server/v3 v3.5.7 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect - go.opentelemetry.io/otel v1.20.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 // indirect - go.opentelemetry.io/otel/metric v1.20.0 // indirect - go.opentelemetry.io/otel/sdk v1.3.0 // indirect - go.opentelemetry.io/otel/trace v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect @@ -200,8 +200,11 @@ require ( // We want to format raw bytes as hex instead of base64. The forked version // allows us to specify that as an option. -replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display +replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display replace github.com/lightninglabs/loop/swapserverrpc => ./swapserverrpc +// Temporary added until https://github.com/lightninglabs/aperture/pull/135 is merged. +replace github.com/lightninglabs/aperture => github.com/starius/aperture v0.3.2-rc1-beta + go 1.19 diff --git a/go.sum b/go.sum index 3f0d182..0942ab2 100644 --- a/go.sum +++ b/go.sum @@ -873,8 +873,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -1094,8 +1095,6 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightninglabs/aperture v0.1.21-beta.0.20230705004936-87bb996a4030 h1:q/BBO2awQdy/dCILXXZbBsstQ+1DpSQ/c8B8EgKqg+g= -github.com/lightninglabs/aperture v0.1.21-beta.0.20230705004936-87bb996a4030/go.mod h1:Jvoen+fgoaGQZIHdchiGigu0Lwuwz8S5u5wad9IhVDU= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= github.com/lightninglabs/lndclient v0.17.4-1 h1:uCLBYf1f1nOoagHuiPK9anERA86dNSlYK9/QGb410RQ= @@ -1104,8 +1103,8 @@ github.com/lightninglabs/neutrino v0.16.0 h1:YNTQG32fPR/Zg0vvJVI65OBH8l3U18LSXXt github.com/lightninglabs/neutrino v0.16.0/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk= github.com/lightninglabs/neutrino/cache v1.1.1 h1:TllWOSlkABhpgbWJfzsrdUaDH2fBy/54VSIB4vVqV8M= github.com/lightninglabs/neutrino/cache v1.1.1/go.mod h1:XJNcgdOw1LQnanGjw8Vj44CvguYA25IMKjWFZczwZuo= -github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display h1:pRdza2wleRN1L2fJXd6ZoQ9ZegVFTAb2bOQfruJPKcY= -github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS/00EiEg0qp0FhehxnQfk3vv8U6Xt3nN+rTY= +github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f h1:Pua7+5TcFEJXIIZ1I2YAUapmbcttmLj4TTi786bIi3s= github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI= github.com/lightningnetwork/lnd v0.17.4-beta h1:BXYbETYZWtcNrYcAosGGXnWsq4Nr5R9PRqlRuEA9AUs= @@ -1269,6 +1268,8 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/starius/aperture v0.3.2-rc1-beta h1:5YSvjSf+VRQOzOwNwSYoDYhqpY2kVyg6CdpSNFL141o= +github.com/starius/aperture v0.3.2-rc1-beta/go.mod h1:M/5dPzHjHvuYXQuxzicqaGiCclHUvKW6N0ay1t/HGiM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -1347,24 +1348,25 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 h1:R/OBkMoGgfy2fLhs2QhkCI1w4HLEQX92GCcJB6SSdNk= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 h1:giGm8w67Ja7amYNfYMdme7xSp2pIxThWopw8+QP51Yk= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 h1:VQbUHoJqytHHSJ1OZodPH9tvZZSVzUHjPHpkO85sT6k= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= -go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= -go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= diff --git a/instantout/reservation/manager.go b/instantout/reservation/manager.go index 120ed1c..35f80ec 100644 --- a/instantout/reservation/manager.go +++ b/instantout/reservation/manager.go @@ -9,7 +9,6 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcutil" - "github.com/lightninglabs/loop/fsm" reservationrpc "github.com/lightninglabs/loop/swapserverrpc" ) @@ -186,7 +185,7 @@ func (m *Manager) fetchL402(ctx context.Context) { func (m *Manager) RegisterReservationNotifications( reservationChan chan *reservationrpc.ServerReservationNotification) error { - // In order to create a valid lsat we first are going to call + // In order to create a valid l402 we first are going to call // the FetchL402 method. As a client might not have outbound capacity // yet, we'll retry until we get a valid response. if !m.hasL402 { diff --git a/liquidity/liquidity.go b/liquidity/liquidity.go index acf01ef..c50f7ea 100644 --- a/liquidity/liquidity.go +++ b/liquidity/liquidity.go @@ -46,6 +46,7 @@ import ( "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/labels" "github.com/lightninglabs/loop/loopdb" + clientrpc "github.com/lightninglabs/loop/looprpc" "github.com/lightninglabs/loop/swap" "github.com/lightningnetwork/lnd/clock" "github.com/lightningnetwork/lnd/funding" @@ -55,8 +56,6 @@ import ( "github.com/lightningnetwork/lnd/routing/route" "github.com/lightningnetwork/lnd/ticker" "google.golang.org/protobuf/proto" - - clientrpc "github.com/lightninglabs/loop/looprpc" ) const ( diff --git a/liquidity/parameters.go b/liquidity/parameters.go index ec4e3d1..f324d47 100644 --- a/liquidity/parameters.go +++ b/liquidity/parameters.go @@ -8,13 +8,12 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/lightninglabs/lndclient" + clientrpc "github.com/lightninglabs/loop/looprpc" "github.com/lightninglabs/loop/swap" "github.com/lightningnetwork/lnd/lnrpc/walletrpc" "github.com/lightningnetwork/lnd/lnwallet/chainfee" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/routing/route" - - clientrpc "github.com/lightninglabs/loop/looprpc" ) var ( diff --git a/loopd/config.go b/loopd/config.go index 3fd5663..24def35 100644 --- a/loopd/config.go +++ b/loopd/config.go @@ -10,7 +10,7 @@ import ( "time" "github.com/btcsuite/btcd/btcutil" - "github.com/lightninglabs/aperture/lsat" + "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/loop/loopdb" "github.com/lightningnetwork/lnd/cert" "github.com/lightningnetwork/lnd/lncfg" @@ -160,8 +160,8 @@ type Config struct { MaxLogFileSize int `long:"maxlogfilesize" description:"Maximum logfile size in MB."` DebugLevel string `long:"debuglevel" description:"Logging level for all subsystems {trace, debug, info, warn, error, critical} -- You may also specify =,=,... to set the log level for individual subsystems -- Use show to list available subsystems"` - MaxLSATCost uint32 `long:"maxlsatcost" description:"Maximum cost in satoshis that loopd is going to pay for an LSAT token automatically. Does not include routing fees."` - MaxLSATFee uint32 `long:"maxlsatfee" description:"Maximum routing fee in satoshis that we are willing to pay while paying for an LSAT token."` + MaxL402Cost uint32 `long:"maxl402cost" description:"Maximum cost in satoshis that loopd is going to pay for an L402 token automatically. Does not include routing fees."` + MaxL402Fee uint32 `long:"maxl402fee" description:"Maximum routing fee in satoshis that we are willing to pay while paying for an L402 token."` LoopOutMaxParts uint32 `long:"loopoutmaxparts" description:"The maximum number of payment parts that may be used for a loop out swap."` @@ -206,8 +206,8 @@ func DefaultConfig() Config { TLSKeyPath: DefaultTLSKeyPath, TLSValidity: DefaultAutogenValidity, MacaroonPath: DefaultMacaroonPath, - MaxLSATCost: lsat.DefaultMaxCostSats, - MaxLSATFee: lsat.DefaultMaxRoutingFeeSats, + MaxL402Cost: l402.DefaultMaxCostSats, + MaxL402Fee: l402.DefaultMaxRoutingFeeSats, LoopOutMaxParts: defaultLoopOutMaxParts, TotalPaymentTimeout: defaultTotalPaymentTimeout, MaxPaymentRetries: defaultMaxPaymentRetries, diff --git a/loopd/daemon.go b/loopd/daemon.go index fa30b11..dde79b5 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -17,14 +17,12 @@ import ( "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/instantout" + "github.com/lightninglabs/loop/instantout/reservation" "github.com/lightninglabs/loop/loopd/perms" "github.com/lightninglabs/loop/loopdb" - "github.com/lightninglabs/loop/sweepbatcher" - - "github.com/lightninglabs/loop/instantout/reservation" loop_looprpc "github.com/lightninglabs/loop/looprpc" - loop_swaprpc "github.com/lightninglabs/loop/swapserverrpc" + "github.com/lightninglabs/loop/sweepbatcher" "github.com/lightningnetwork/lnd/clock" "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/macaroons" diff --git a/loopd/log.go b/loopd/log.go index 489fa98..970bd80 100644 --- a/loopd/log.go +++ b/loopd/log.go @@ -2,7 +2,7 @@ package loopd import ( "github.com/btcsuite/btclog" - "github.com/lightninglabs/aperture/lsat" + "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/fsm" @@ -37,7 +37,7 @@ func SetupLoggers(root *build.RotatingLogWriter, intercept signal.Interceptor) { lnd.AddSubLogger(root, "SWEEP", intercept, sweepbatcher.UseLogger) lnd.AddSubLogger(root, "LNDC", intercept, lndclient.UseLogger) lnd.AddSubLogger(root, "STORE", intercept, loopdb.UseLogger) - lnd.AddSubLogger(root, lsat.Subsystem, intercept, lsat.UseLogger) + lnd.AddSubLogger(root, l402.Subsystem, intercept, l402.UseLogger) lnd.AddSubLogger( root, liquidity.Subsystem, intercept, liquidity.UseLogger, ) diff --git a/loopd/perms/perms.go b/loopd/perms/perms.go index 138ed79..b33d55f 100644 --- a/loopd/perms/perms.go +++ b/loopd/perms/perms.go @@ -69,7 +69,7 @@ var RequiredPermissions = map[string][]bakery.Op{ Entity: "loop", Action: "in", }}, - "/looprpc.SwapClient/GetLsatTokens": {{ + "/looprpc.SwapClient/GetL402Tokens": {{ Entity: "auth", Action: "read", }}, diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index f42e8d5..924bd37 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -15,7 +15,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg" - "github.com/lightninglabs/aperture/lsat" + "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/instantout" @@ -920,18 +920,18 @@ func (s *swapClientServer) LoopIn(ctx context.Context, return response, nil } -// GetLsatTokens returns all tokens that are contained in the LSAT token store. -func (s *swapClientServer) GetLsatTokens(ctx context.Context, +// GetL402Tokens returns all tokens that are contained in the L402 token store. +func (s *swapClientServer) GetL402Tokens(ctx context.Context, _ *clientrpc.TokensRequest) (*clientrpc.TokensResponse, error) { - log.Infof("Get LSAT tokens request received") + log.Infof("Get L402 tokens request received") - tokens, err := s.impl.LsatStore.AllTokens() + tokens, err := s.impl.L402Store.AllTokens() if err != nil { return nil, err } - rpcTokens := make([]*clientrpc.LsatToken, len(tokens)) + rpcTokens := make([]*clientrpc.L402Token, len(tokens)) idx := 0 for key, token := range tokens { macBytes, err := token.BaseMacaroon().MarshalBinary() @@ -939,13 +939,13 @@ func (s *swapClientServer) GetLsatTokens(ctx context.Context, return nil, err } - id, err := lsat.DecodeIdentifier( + id, err := l402.DecodeIdentifier( bytes.NewReader(token.BaseMacaroon().Id()), ) if err != nil { return nil, err } - rpcTokens[idx] = &clientrpc.LsatToken{ + rpcTokens[idx] = &clientrpc.L402Token{ BaseMacaroon: macBytes, PaymentHash: token.PaymentHash[:], PaymentPreimage: token.Preimage[:], diff --git a/loopd/utils.go b/loopd/utils.go index 9388a23..b8b9119 100644 --- a/loopd/utils.go +++ b/loopd/utils.go @@ -27,8 +27,8 @@ func getClient(cfg *Config, swapDb loopdb.SwapStore, SwapServerNoTLS: cfg.Server.NoTLS, TLSPathServer: cfg.Server.TLSPath, Lnd: lnd, - MaxLsatCost: btcutil.Amount(cfg.MaxLSATCost), - MaxLsatFee: btcutil.Amount(cfg.MaxLSATFee), + MaxL402Cost: btcutil.Amount(cfg.MaxL402Cost), + MaxL402Fee: btcutil.Amount(cfg.MaxL402Fee), LoopOutMaxParts: cfg.LoopOutMaxParts, TotalPaymentTimeout: cfg.TotalPaymentTimeout, MaxPaymentRetries: cfg.MaxPaymentRetries, diff --git a/loopdb/sqlite.go b/loopdb/sqlite.go index 068fb9a..8493ed6 100644 --- a/loopdb/sqlite.go +++ b/loopdb/sqlite.go @@ -15,7 +15,6 @@ import ( sqlite_migrate "github.com/golang-migrate/migrate/v4/database/sqlite" "github.com/lightninglabs/loop/loopdb/sqlc" "github.com/lightningnetwork/lnd/zpay32" - "github.com/stretchr/testify/require" _ "modernc.org/sqlite" // Register relevant drivers. ) diff --git a/looprpc/Dockerfile b/looprpc/Dockerfile index a79af71..9e84242 100644 --- a/looprpc/Dockerfile +++ b/looprpc/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16.3-buster +FROM golang:1.19.10-buster RUN apt-get update && apt-get install -y \ git \ @@ -16,11 +16,11 @@ ENV FALAFEL_VERSION="v0.9.1" RUN cd /tmp \ && export GO111MODULE=on \ - && go get google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOBUF_VERSION} \ - && go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} \ - && go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \ - && go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION} \ - && go get github.com/lightninglabs/falafel@${FALAFEL_VERSION} + && go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOBUF_VERSION} \ + && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} \ + && go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \ + && go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION} \ + && go install github.com/lightninglabs/falafel@${FALAFEL_VERSION} WORKDIR /build diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index 042b1b4..ef0f14f 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v3.6.1 // source: client.proto @@ -21,11 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// `AddressType` has to be one of: // -//`AddressType` has to be one of: -// -//- `unknown`: Unknown address type -//- `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 1) +// - `unknown`: Unknown address type +// - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 1) type AddressType int32 const ( @@ -123,33 +122,27 @@ 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. + // 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. + // 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. + // 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. + // 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. + // 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. + // 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 ) @@ -203,48 +196,38 @@ func (SwapState) EnumDescriptor() ([]byte, []int) { type FailureReason int32 const ( - // - //FAILURE_REASON_NONE is set when the swap did not fail, it is either in - //progress or succeeded. + // FAILURE_REASON_NONE is set when the swap did not fail, it is either in + // progress or succeeded. FailureReason_FAILURE_REASON_NONE FailureReason = 0 - // - //FAILURE_REASON_OFFCHAIN indicates that a loop out failed because it wasn't - //possible to find a route for one or both off chain payments that met the fee - //and timelock limits required. + // FAILURE_REASON_OFFCHAIN indicates that a loop out failed because it wasn't + // possible to find a route for one or both off chain payments that met the fee + // and timelock limits required. FailureReason_FAILURE_REASON_OFFCHAIN FailureReason = 1 - // - //FAILURE_REASON_TIMEOUT indicates that the swap failed because on chain htlc - //did not confirm before its expiry, or it confirmed too late for us to reveal - //our preimage and claim. + // FAILURE_REASON_TIMEOUT indicates that the swap failed because on chain htlc + // did not confirm before its expiry, or it confirmed too late for us to reveal + // our preimage and claim. FailureReason_FAILURE_REASON_TIMEOUT FailureReason = 2 - // - //FAILURE_REASON_SWEEP_TIMEOUT indicates that a loop out permanently failed - //because the on chain htlc wasn't swept before the server revoked the - //htlc. + // FAILURE_REASON_SWEEP_TIMEOUT indicates that a loop out permanently failed + // because the on chain htlc wasn't swept before the server revoked the + // htlc. FailureReason_FAILURE_REASON_SWEEP_TIMEOUT FailureReason = 3 - // - //FAILURE_REASON_INSUFFICIENT_VALUE indicates that a loop out has failed - //because the on chain htlc had a lower value than requested. + // FAILURE_REASON_INSUFFICIENT_VALUE indicates that a loop out has failed + // because the on chain htlc had a lower value than requested. FailureReason_FAILURE_REASON_INSUFFICIENT_VALUE FailureReason = 4 - // - //FAILURE_REASON_TEMPORARY indicates that a swap cannot continue due to an - //internal error. Manual intervention such as a restart is required. + // FAILURE_REASON_TEMPORARY indicates that a swap cannot continue due to an + // internal error. Manual intervention such as a restart is required. FailureReason_FAILURE_REASON_TEMPORARY FailureReason = 5 - // - //FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed - //because the amount extended by an external loop in htlc is insufficient. + // FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed + // because the amount extended by an external loop in htlc is insufficient. FailureReason_FAILURE_REASON_INCORRECT_AMOUNT FailureReason = 6 - // - //FAILURE_REASON_ABANDONED indicates that a swap permanently failed because - //the client manually abandoned the swap. + // FAILURE_REASON_ABANDONED indicates that a swap permanently failed because + // the client manually abandoned the swap. FailureReason_FAILURE_REASON_ABANDONED FailureReason = 7 - // - //FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE indicates that a swap - //wasn't published due to insufficient confirmed balance. + // FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE indicates that a swap + // wasn't published due to insufficient confirmed balance. FailureReason_FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE FailureReason = 8 - // - //FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT indicates that a swap - //wasn't published due to insufficient confirmed balance. + // FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT indicates that a swap + // wasn't published due to insufficient confirmed balance. FailureReason_FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT FailureReason = 9 ) @@ -353,56 +336,43 @@ type AutoReason int32 const ( AutoReason_AUTO_REASON_UNKNOWN AutoReason = 0 - // - //Budget not started indicates that we do not recommend any swaps because - //the start time for our budget has not arrived yet. + // Budget not started indicates that we do not recommend any swaps because + // the start time for our budget has not arrived yet. AutoReason_AUTO_REASON_BUDGET_NOT_STARTED AutoReason = 1 - // - //Sweep fees indicates that the estimated fees to sweep swaps are too high - //right now. + // Sweep fees indicates that the estimated fees to sweep swaps are too high + // right now. AutoReason_AUTO_REASON_SWEEP_FEES AutoReason = 2 - // - //Budget elapsed indicates that the autoloop budget for the period has been - //elapsed. + // Budget elapsed indicates that the autoloop budget for the period has been + // elapsed. AutoReason_AUTO_REASON_BUDGET_ELAPSED AutoReason = 3 - // - //In flight indicates that the limit on in-flight automatically dispatched - //swaps has already been reached. + // In flight indicates that the limit on in-flight automatically dispatched + // swaps has already been reached. AutoReason_AUTO_REASON_IN_FLIGHT AutoReason = 4 - // - //Swap fee indicates that the server fee for a specific swap is too high. + // Swap fee indicates that the server fee for a specific swap is too high. AutoReason_AUTO_REASON_SWAP_FEE AutoReason = 5 - // - //Miner fee indicates that the miner fee for a specific swap is to high. + // Miner fee indicates that the miner fee for a specific swap is to high. AutoReason_AUTO_REASON_MINER_FEE AutoReason = 6 - // - //Prepay indicates that the prepay fee for a specific swap is too high. + // Prepay indicates that the prepay fee for a specific swap is too high. AutoReason_AUTO_REASON_PREPAY AutoReason = 7 - // - //Failure backoff indicates that a swap has recently failed for this target, - //and the backoff period has not yet passed. + // Failure backoff indicates that a swap has recently failed for this target, + // and the backoff period has not yet passed. AutoReason_AUTO_REASON_FAILURE_BACKOFF AutoReason = 8 - // - //Loop out indicates that a loop out swap is currently utilizing the channel, - //so it is not eligible. + // Loop out indicates that a loop out swap is currently utilizing the channel, + // so it is not eligible. AutoReason_AUTO_REASON_LOOP_OUT AutoReason = 9 - // - //Loop In indicates that a loop in swap is currently in flight for the peer, - //so it is not eligible. + // Loop In indicates that a loop in swap is currently in flight for the peer, + // so it is not eligible. AutoReason_AUTO_REASON_LOOP_IN AutoReason = 10 - // - //Liquidity ok indicates that a target meets the liquidity balance expressed - //in its rule, so no swap is needed. + // Liquidity ok indicates that a target meets the liquidity balance expressed + // in its rule, so no swap is needed. AutoReason_AUTO_REASON_LIQUIDITY_OK AutoReason = 11 - // - //Budget insufficient indicates that we cannot perform a swap because we do - //not have enough pending budget available. This differs from budget elapsed, - //because we still have some budget available, but we have allocated it to - //other swaps. + // Budget insufficient indicates that we cannot perform a swap because we do + // not have enough pending budget available. This differs from budget elapsed, + // because we still have some budget available, but we have allocated it to + // other swaps. AutoReason_AUTO_REASON_BUDGET_INSUFFICIENT AutoReason = 12 - // - //Fee insufficient indicates that the fee estimate for a swap is higher than - //the portion of total swap amount that we allow fees to consume. + // Fee insufficient indicates that the fee estimate for a swap is higher than + // the portion of total swap amount that we allow fees to consume. AutoReason_AUTO_REASON_FEE_INSUFFICIENT AutoReason = 13 ) @@ -526,104 +496,86 @@ type LoopOutRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Requested swap amount in sat. This does not include the swap and miner fee. + // 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. + // 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. + // 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. + // 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. + // 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. + // 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 - //sweep tx. - // - //If the sweep tx is not confirmed, we are forced to ratchet up fees until it - //is swept. Possibly even exceeding max_miner_fee if we get close to the htlc - //timeout. Because the initial publication revealed the preimage, we have no - //other choice. The server may already have pulled the off-chain htlc. Only - //when the fee becomes higher than the swap amount, we can only wait for fees - //to come down and hope - if we are past the timeout - that the server is not - //publishing the revocation. - // - //max_miner_fee is typically taken from the response of the GetQuote call. + // 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 + // sweep tx. + // + // If the sweep tx is not confirmed, we are forced to ratchet up fees until it + // is swept. Possibly even exceeding max_miner_fee if we get close to the htlc + // timeout. Because the initial publication revealed the preimage, we have no + // other choice. The server may already have pulled the off-chain htlc. Only + // when the fee becomes higher than the swap amount, we can only wait for fees + // to come down and hope - if we are past the timeout - that the server is not + // publishing the revocation. + // + // 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. + // 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. // // Deprecated: Marked as deprecated in client.proto. LoopOutChannel uint64 `protobuf:"varint,8,opt,name=loop_out_channel,json=loopOutChannel,proto3" json:"loop_out_channel,omitempty"` - // - //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. + // 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. + // 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"` - // - //The number of confirmations that we require for the on chain htlc that will - //be published by the server before we reveal the preimage. + // 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 - //low-fee periods before publishing the HTLC, potentially resulting in a - //lower total swap fee. + // 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 + // low-fee periods before publishing the HTLC, potentially resulting in a + // lower total swap fee. SwapPublicationDeadline uint64 `protobuf:"varint,10,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` - // - //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. + // 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"` - // - //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). + // 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"` - // - //An alternative destination address source for the swap. This field - //represents the name of the account in the backing lnd instance. - //Refer to lnd's wallet import functions for reference. + // An alternative destination address source for the swap. This field + // represents the name of the account in the backing lnd instance. + // Refer to lnd's wallet import functions for reference. Account string `protobuf:"bytes,15,opt,name=account,proto3" json:"account,omitempty"` - // - //The address type of the account specified in the account field. + // The address type of the account specified in the account field. AccountAddrType AddressType `protobuf:"varint,16,opt,name=account_addr_type,json=accountAddrType,proto3,enum=looprpc.AddressType" json:"account_addr_type,omitempty"` - // - //A flag indicating whether the defined destination address does not belong to - //the wallet. This is used to flag whether this loop out swap could have its - //associated sweep batched. + // A flag indicating whether the defined destination address does not belong to + // the wallet. This is used to flag whether this loop out swap could have its + // associated sweep batched. IsExternalAddr bool `protobuf:"varint,17,opt,name=is_external_addr,json=isExternalAddr,proto3" json:"is_external_addr,omitempty"` - // - //The reservations to use for the swap. If this field is set, loop will try - //to use the instant out flow using the given reservations. If the - //reservations are not sufficient, the swap will fail. The swap amount must - //be equal to the sum of the amounts of the reservations. + // The reservations to use for the swap. If this field is set, loop will try + // to use the instant out flow using the given reservations. If the + // reservations are not sufficient, the swap will fail. The swap amount must + // be equal to the sum of the amounts of the reservations. ReservationIds [][]byte `protobuf:"bytes,18,rep,name=reservation_ids,json=reservationIds,proto3" json:"reservation_ids,omitempty"` } @@ -791,52 +743,42 @@ type LoopInRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Requested swap amount in sat. This does not include the swap and miner - //fee. + // 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. + // 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. // - //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. + // 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. + // 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. + // 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. + // 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. + // 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"` - // - //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). + // 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"` - // - //Optional route hints to reach the destination through private channels. + // Optional route hints to reach the destination through private channels. RouteHints []*swapserverrpc.RouteHint `protobuf:"bytes,9,rep,name=route_hints,json=routeHints,proto3" json:"route_hints,omitempty"` - // - //Private indicates whether the destination node should be considered - //private. In which case, loop will generate hophints to assist with - //probing and payment. + // Private indicates whether the destination node should be considered + // private. In which case, loop will generate hophints to assist with + // probing and payment. Private bool `protobuf:"varint,10,opt,name=private,proto3" json:"private,omitempty"` } @@ -947,31 +889,27 @@ type SwapResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //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. + // 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. // // Deprecated: Marked as deprecated in client.proto. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,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. + // 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 - //native segwit (P2WSH) htlc. - /// - For loop-out htlc_address always contains the native segwit (P2WSH) - //htlc address. + // 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 + // native segwit (P2WSH) htlc. + // / - For loop-out htlc_address always contains the native segwit (P2WSH) + // htlc address. // // Deprecated: Marked as deprecated in client.proto. HtlcAddress string `protobuf:"bytes,2,opt,name=htlc_address,json=htlcAddress,proto3" json:"htlc_address,omitempty"` - // - //The native segwit address of the on-chain htlc. - //Used for both loop-in and loop-out. + // 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"` // The address of the v3 (taproot) htlc. Used for both loop-in and loop-out. HtlcAddressP2Tr string `protobuf:"bytes,7,opt,name=htlc_address_p2tr,json=htlcAddressP2tr,proto3" json:"htlc_address_p2tr,omitempty"` @@ -1098,43 +1036,34 @@ type SwapStatus struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Requested swap amount in sat. This does not include the swap and miner - //fee. + // 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. + // 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. // // Deprecated: Marked as deprecated in client.proto. Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,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. + // 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"` - // - //The type of the swap. + // 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 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. + // 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. + // 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. + // 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. - //- For loop-out htlc_address always contains the native segwit (P2WSH) - //htlc address. + // 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. + // - For loop-out htlc_address always contains the native segwit (P2WSH) + // htlc address. // // Deprecated: Marked as deprecated in client.proto. HtlcAddress string `protobuf:"bytes,7,opt,name=htlc_address,json=htlcAddress,proto3" json:"htlc_address,omitempty"` @@ -1446,8 +1375,7 @@ type ListSwapsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The list of all currently known swaps and their status. + // The list of all currently known swaps and their status. Swaps []*SwapStatus `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"` } @@ -1495,9 +1423,8 @@ type SwapInfoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The swap identifier which currently is the hash that locks the HTLCs. When - //using REST, this field must be encoded as URL safe base64. + // 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"` } @@ -1583,11 +1510,9 @@ type InTermsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Minimum swap amount (sat) + // 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) + // Maximum swap amount (sat) MaxSwapAmount int64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` } @@ -1642,11 +1567,9 @@ type OutTermsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Minimum swap amount (sat) + // 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) + // 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. MinCltvDelta int32 `protobuf:"varint,8,opt,name=min_cltv_delta,json=minCltvDelta,proto3" json:"min_cltv_delta,omitempty"` @@ -1719,38 +1642,31 @@ type QuoteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The amount to swap in satoshis. + // 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. + // 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. + // 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 - //low-fee periods before publishing the HTLC, potentially resulting in a - //lower total swap fee. This only has an effect on loop out quotes. + // 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 + // low-fee periods before publishing the HTLC, potentially resulting in a + // lower total swap fee. This only has an effect on loop out quotes. SwapPublicationDeadline uint64 `protobuf:"varint,4,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` - // - //Optionally the client can specify the last hop pubkey when requesting a - //loop-in quote. This is useful to get better off-chain routing fee from the - //server. + // Optionally the client can specify the last hop pubkey when requesting a + // loop-in quote. This is useful to get better off-chain routing fee from the + // server. LoopInLastHop []byte `protobuf:"bytes,5,opt,name=loop_in_last_hop,json=loopInLastHop,proto3" json:"loop_in_last_hop,omitempty"` - // - //Optional route hints to reach the destination through private channels. + // Optional route hints to reach the destination through private channels. LoopInRouteHints []*swapserverrpc.RouteHint `protobuf:"bytes,6,rep,name=loop_in_route_hints,json=loopInRouteHints,proto3" json:"loop_in_route_hints,omitempty"` - // - //Private indicates whether the destination node should be considered - //private. In which case, loop will generate hophints to assist with - //probing and payment. + // Private indicates whether the destination node should be considered + // private. In which case, loop will generate hophints to assist with + // probing and payment. Private bool `protobuf:"varint,7,opt,name=private,proto3" json:"private,omitempty"` } @@ -1840,22 +1756,18 @@ type InQuoteResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The fee that the swap server is charging for the swap. + // 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"` - // - //An estimate of the on-chain fee that needs to be paid to publish the HTLC - //If a miner fee of 0 is returned, it means the external_htlc flag was set for - //a loop in and the fee estimation was skipped. If a miner fee of -1 is - //returned, it means lnd's wallet tried to estimate the fee but was unable to - //create a sample estimation transaction because not enough funds are - //available. An information message should be shown to the user in this case. + // An estimate of the on-chain fee that needs to be paid to publish the HTLC + // If a miner fee of 0 is returned, it means the external_htlc flag was set for + // a loop in and the fee estimation was skipped. If a miner fee of -1 is + // returned, it means lnd's wallet tried to estimate the fee but was unable to + // 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 + // On-chain cltv expiry delta CltvDelta int32 `protobuf:"varint,5,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"` - // - //The confirmation target to be used to publish the on-chain HTLC. + // The confirmation target to be used to publish the on-chain HTLC. ConfTarget int32 `protobuf:"varint,6,opt,name=conf_target,json=confTarget,proto3" json:"conf_target,omitempty"` } @@ -1924,25 +1836,19 @@ type OutQuoteResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The fee that the swap server is charging for the swap. + // 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. + // 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. + // 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. + // 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 + // On-chain cltv expiry delta CltvDelta int32 `protobuf:"varint,5,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"` - // - //The confirmation target to be used for the sweep of the on-chain HTLC. + // The confirmation target to be used for the sweep of the on-chain HTLC. ConfTarget int32 `protobuf:"varint,6,opt,name=conf_target,json=confTarget,proto3" json:"conf_target,omitempty"` } @@ -2025,14 +1931,11 @@ type ProbeRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The amount to probe. + // The amount to probe. Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` - // - //Optional last hop of the route to probe. + // Optional last hop of the route to probe. LastHop []byte `protobuf:"bytes,2,opt,name=last_hop,json=lastHop,proto3" json:"last_hop,omitempty"` - // - //Optional route hints to reach the destination through private channels. + // Optional route hints to reach the destination through private channels. RouteHints []*swapserverrpc.RouteHint `protobuf:"bytes,3,rep,name=route_hints,json=routeHints,proto3" json:"route_hints,omitempty"` } @@ -2170,9 +2073,8 @@ type TokensResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //List of all tokens the daemon knows of, including old/expired tokens. - Tokens []*LsatToken `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` + // List of all tokens the daemon knows of, including old/expired tokens. + Tokens []*L402Token `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` } func (x *TokensResponse) Reset() { @@ -2207,52 +2109,43 @@ func (*TokensResponse) Descriptor() ([]byte, []int) { return file_client_proto_rawDescGZIP(), []int{18} } -func (x *TokensResponse) GetTokens() []*LsatToken { +func (x *TokensResponse) GetTokens() []*L402Token { if x != nil { return x.Tokens } return nil } -type LsatToken struct { +type L402Token struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The base macaroon that was baked by the auth server. + // 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. + // 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. + // 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. + // 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. + // 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. + // 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. + // 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. + // 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"` - // - //The l402 ID of the token. + // The l402 ID of the token. Id string `protobuf:"bytes,9,opt,name=id,proto3" json:"id,omitempty"` } -func (x *LsatToken) Reset() { - *x = LsatToken{} +func (x *L402Token) Reset() { + *x = L402Token{} if protoimpl.UnsafeEnabled { mi := &file_client_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2260,13 +2153,13 @@ func (x *LsatToken) Reset() { } } -func (x *LsatToken) String() string { +func (x *L402Token) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LsatToken) ProtoMessage() {} +func (*L402Token) ProtoMessage() {} -func (x *LsatToken) ProtoReflect() protoreflect.Message { +func (x *L402Token) ProtoReflect() protoreflect.Message { mi := &file_client_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2278,68 +2171,68 @@ func (x *LsatToken) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LsatToken.ProtoReflect.Descriptor instead. -func (*LsatToken) Descriptor() ([]byte, []int) { +// Deprecated: Use L402Token.ProtoReflect.Descriptor instead. +func (*L402Token) Descriptor() ([]byte, []int) { return file_client_proto_rawDescGZIP(), []int{19} } -func (x *LsatToken) GetBaseMacaroon() []byte { +func (x *L402Token) GetBaseMacaroon() []byte { if x != nil { return x.BaseMacaroon } return nil } -func (x *LsatToken) GetPaymentHash() []byte { +func (x *L402Token) GetPaymentHash() []byte { if x != nil { return x.PaymentHash } return nil } -func (x *LsatToken) GetPaymentPreimage() []byte { +func (x *L402Token) GetPaymentPreimage() []byte { if x != nil { return x.PaymentPreimage } return nil } -func (x *LsatToken) GetAmountPaidMsat() int64 { +func (x *L402Token) GetAmountPaidMsat() int64 { if x != nil { return x.AmountPaidMsat } return 0 } -func (x *LsatToken) GetRoutingFeePaidMsat() int64 { +func (x *L402Token) GetRoutingFeePaidMsat() int64 { if x != nil { return x.RoutingFeePaidMsat } return 0 } -func (x *LsatToken) GetTimeCreated() int64 { +func (x *L402Token) GetTimeCreated() int64 { if x != nil { return x.TimeCreated } return 0 } -func (x *LsatToken) GetExpired() bool { +func (x *L402Token) GetExpired() bool { if x != nil { return x.Expired } return false } -func (x *LsatToken) GetStorageName() string { +func (x *L402Token) GetStorageName() string { if x != nil { return x.StorageName } return "" } -func (x *LsatToken) GetId() string { +func (x *L402Token) GetId() string { if x != nil { return x.Id } @@ -2351,20 +2244,15 @@ type LoopStats struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Number of currently pending swaps. + // Number of currently pending swaps. PendingCount uint64 `protobuf:"varint,1,opt,name=pending_count,json=pendingCount,proto3" json:"pending_count,omitempty"` - // - //Number of succeeded swaps. + // Number of succeeded swaps. SuccessCount uint64 `protobuf:"varint,2,opt,name=success_count,json=successCount,proto3" json:"success_count,omitempty"` - // - //Number failed swaps. + // Number failed swaps. FailCount uint64 `protobuf:"varint,3,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` - // - //The sum of all pending swap amounts. + // The sum of all pending swap amounts. SumPendingAmt int64 `protobuf:"varint,4,opt,name=sum_pending_amt,json=sumPendingAmt,proto3" json:"sum_pending_amt,omitempty"` - // - //The sum of all succeeded swap amounts. + // The sum of all succeeded swap amounts. SumSucceededAmt int64 `protobuf:"varint,5,opt,name=sum_succeeded_amt,json=sumSucceededAmt,proto3" json:"sum_succeeded_amt,omitempty"` } @@ -2478,29 +2366,21 @@ type GetInfoResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The current daemon version. + // The current daemon version. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // - //The network the daemon is running on. + // The network the daemon is running on. Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"` - // - //Host and port of the loopd grpc server. + // Host and port of the loopd grpc server. RpcListen string `protobuf:"bytes,3,opt,name=rpc_listen,json=rpcListen,proto3" json:"rpc_listen,omitempty"` - // - //Host and port of the loopd rest server. + // Host and port of the loopd rest server. RestListen string `protobuf:"bytes,4,opt,name=rest_listen,json=restListen,proto3" json:"rest_listen,omitempty"` - // - //Loop's macaroon path that clients use to talk to the daemon. + // Loop's macaroon path that clients use to talk to the daemon. MacaroonPath string `protobuf:"bytes,5,opt,name=macaroon_path,json=macaroonPath,proto3" json:"macaroon_path,omitempty"` - // - //Loop's tls cert path + // Loop's tls cert path TlsCertPath string `protobuf:"bytes,6,opt,name=tls_cert_path,json=tlsCertPath,proto3" json:"tls_cert_path,omitempty"` - // - //Statistics about loop outs. + // Statistics about loop outs. LoopOutStats *LoopStats `protobuf:"bytes,7,opt,name=loop_out_stats,json=loopOutStats,proto3" json:"loop_out_stats,omitempty"` - // - //Statistics about loop ins. + // Statistics about loop ins. LoopInStats *LoopStats `protobuf:"bytes,8,opt,name=loop_in_stats,json=loopInStats,proto3" json:"loop_in_stats,omitempty"` } @@ -2635,116 +2515,92 @@ type LiquidityParameters struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //A set of liquidity rules that describe the desired liquidity balance. + // A set of liquidity rules that describe the desired liquidity balance. Rules []*LiquidityRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - // - //The parts per million of swap amount that is allowed to be allocated to swap - //fees. This value is applied across swap categories and may not be set in - //conjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay - //routing, max prepay and max miner fee. + // The parts per million of swap amount that is allowed to be allocated to swap + // fees. This value is applied across swap categories and may not be set in + // conjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay + // routing, max prepay and max miner fee. FeePpm uint64 `protobuf:"varint,16,opt,name=fee_ppm,json=feePpm,proto3" json:"fee_ppm,omitempty"` - // - //The limit we place on our estimated sweep cost for a swap in sat/vByte. If - //the estimated fee for our sweep transaction within the specified - //confirmation target is above this value, we will not suggest any swaps. + // The limit we place on our estimated sweep cost for a swap in sat/vByte. If + // the estimated fee for our sweep transaction within the specified + // confirmation target is above this value, we will not suggest any swaps. SweepFeeRateSatPerVbyte uint64 `protobuf:"varint,2,opt,name=sweep_fee_rate_sat_per_vbyte,json=sweepFeeRateSatPerVbyte,proto3" json:"sweep_fee_rate_sat_per_vbyte,omitempty"` - // - //The maximum fee paid to the server for facilitating the swap, expressed - //as parts per million of the swap volume. + // The maximum fee paid to the server for facilitating the swap, expressed + // as parts per million of the swap volume. MaxSwapFeePpm uint64 `protobuf:"varint,3,opt,name=max_swap_fee_ppm,json=maxSwapFeePpm,proto3" json:"max_swap_fee_ppm,omitempty"` - // - //The maximum fee paid to route the swap invoice off chain, expressed as - //parts per million of the volume being routed. + // The maximum fee paid to route the swap invoice off chain, expressed as + // parts per million of the volume being routed. MaxRoutingFeePpm uint64 `protobuf:"varint,4,opt,name=max_routing_fee_ppm,json=maxRoutingFeePpm,proto3" json:"max_routing_fee_ppm,omitempty"` - // - //The maximum fee paid to route the prepay invoice off chain, expressed as - //parts per million of the volume being routed. + // The maximum fee paid to route the prepay invoice off chain, expressed as + // parts per million of the volume being routed. MaxPrepayRoutingFeePpm uint64 `protobuf:"varint,5,opt,name=max_prepay_routing_fee_ppm,json=maxPrepayRoutingFeePpm,proto3" json:"max_prepay_routing_fee_ppm,omitempty"` - // - //The maximum no-show penalty in satoshis paid for a swap. + // The maximum no-show penalty in satoshis paid for a swap. MaxPrepaySat uint64 `protobuf:"varint,6,opt,name=max_prepay_sat,json=maxPrepaySat,proto3" json:"max_prepay_sat,omitempty"` - // - //The maximum miner fee we will pay to sweep the swap on chain. Note that we - //will not suggest a swap if the estimate is above the sweep limit set by - //these parameters, and we use the current fee estimate to sweep on chain so - //this value is only a cap placed on the amount we spend on fees in the case - //where the swap needs to be claimed on chain, but fees have suddenly spiked. + // The maximum miner fee we will pay to sweep the swap on chain. Note that we + // will not suggest a swap if the estimate is above the sweep limit set by + // these parameters, and we use the current fee estimate to sweep on chain so + // this value is only a cap placed on the amount we spend on fees in the case + // where the swap needs to be claimed on chain, but fees have suddenly spiked. MaxMinerFeeSat uint64 `protobuf:"varint,7,opt,name=max_miner_fee_sat,json=maxMinerFeeSat,proto3" json:"max_miner_fee_sat,omitempty"` - // - //The number of blocks from the on-chain HTLC's confirmation height that it - //should be swept within. + // The number of blocks from the on-chain HTLC's confirmation height that it + // should be swept within. SweepConfTarget int32 `protobuf:"varint,8,opt,name=sweep_conf_target,json=sweepConfTarget,proto3" json:"sweep_conf_target,omitempty"` - // - //The amount of time we require pass since a channel was part of a failed - //swap due to off chain payment failure until it will be considered for swap - //suggestions again, expressed in seconds. + // The amount of time we require pass since a channel was part of a failed + // swap due to off chain payment failure until it will be considered for swap + // suggestions again, expressed in seconds. FailureBackoffSec uint64 `protobuf:"varint,9,opt,name=failure_backoff_sec,json=failureBackoffSec,proto3" json:"failure_backoff_sec,omitempty"` - // - //Set to true to enable automatic dispatch of swaps. All swaps will be limited - //to the fee categories set by these parameters, and total expenditure will - //be limited to the autoloop budget. + // Set to true to enable automatic dispatch of swaps. All swaps will be limited + // to the fee categories set by these parameters, and total expenditure will + // be limited to the autoloop budget. Autoloop bool `protobuf:"varint,10,opt,name=autoloop,proto3" json:"autoloop,omitempty"` - // - //The total budget for automatically dispatched swaps since the budget start - //time, expressed in satoshis. + // The total budget for automatically dispatched swaps since the budget start + // time, expressed in satoshis. AutoloopBudgetSat uint64 `protobuf:"varint,11,opt,name=autoloop_budget_sat,json=autoloopBudgetSat,proto3" json:"autoloop_budget_sat,omitempty"` - // - //Deprecated, use autoloop_budget_refresh_period_sec. The start time for - //autoloop budget, expressed as a unix timestamp in seconds. If this value is - //0, the budget will be applied for all automatically dispatched swaps. Swaps - //that were completed before this date will not be included in budget - //calculations. + // Deprecated, use autoloop_budget_refresh_period_sec. The start time for + // autoloop budget, expressed as a unix timestamp in seconds. If this value is + // 0, the budget will be applied for all automatically dispatched swaps. Swaps + // that were completed before this date will not be included in budget + // calculations. // // Deprecated: Marked as deprecated in client.proto. AutoloopBudgetStartSec uint64 `protobuf:"varint,12,opt,name=autoloop_budget_start_sec,json=autoloopBudgetStartSec,proto3" json:"autoloop_budget_start_sec,omitempty"` - // - //The maximum number of automatically dispatched swaps that we allow to be in - //flight at any point in time. + // The maximum number of automatically dispatched swaps that we allow to be in + // flight at any point in time. AutoMaxInFlight uint64 `protobuf:"varint,13,opt,name=auto_max_in_flight,json=autoMaxInFlight,proto3" json:"auto_max_in_flight,omitempty"` - // - //The minimum amount, expressed in satoshis, that the autoloop client will - //dispatch a swap for. This value is subject to the server-side limits - //specified by the LoopOutTerms endpoint. + // The minimum amount, expressed in satoshis, that the autoloop client will + // dispatch a swap for. This value is subject to the server-side limits + // specified by the LoopOutTerms endpoint. MinSwapAmount uint64 `protobuf:"varint,14,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` - // - //The maximum amount, expressed in satoshis, that the autoloop client will - //dispatch a swap for. This value is subject to the server-side limits - //specified by the LoopOutTerms endpoint. + // The maximum amount, expressed in satoshis, that the autoloop client will + // dispatch a swap for. This value is subject to the server-side limits + // specified by the LoopOutTerms endpoint. MaxSwapAmount uint64 `protobuf:"varint,15,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` - // - //The confirmation target for loop in on-chain htlcs. + // The confirmation target for loop in on-chain htlcs. HtlcConfTarget int32 `protobuf:"varint,17,opt,name=htlc_conf_target,json=htlcConfTarget,proto3" json:"htlc_conf_target,omitempty"` - // - //The destination address to use for autoloop loop outs. Set to "default" in - //order to revert to default behavior. + // The destination address to use for autoloop loop outs. Set to "default" in + // order to revert to default behavior. AutoloopDestAddress string `protobuf:"bytes,18,opt,name=autoloop_dest_address,json=autoloopDestAddress,proto3" json:"autoloop_dest_address,omitempty"` - // - //The period over which the autoloop budget is refreshed, expressed in - //seconds. + // The period over which the autoloop budget is refreshed, expressed in + // seconds. AutoloopBudgetRefreshPeriodSec uint64 `protobuf:"varint,19,opt,name=autoloop_budget_refresh_period_sec,json=autoloopBudgetRefreshPeriodSec,proto3" json:"autoloop_budget_refresh_period_sec,omitempty"` - // - //The time at which the autoloop budget was last refreshed, expressed as a - //UNIX timestamp in seconds. + // The time at which the autoloop budget was last refreshed, expressed as a + // UNIX timestamp in seconds. AutoloopBudgetLastRefresh uint64 `protobuf:"varint,20,opt,name=autoloop_budget_last_refresh,json=autoloopBudgetLastRefresh,proto3" json:"autoloop_budget_last_refresh,omitempty"` - // - //Set to true to enable easy autoloop. If set, all channel/peer rules will be - //overridden and the client will automatically dispatch swaps in order to meet - //the configured local balance target size. Currently only loop out is - //supported, meaning that easy autoloop can only reduce the funds that are - //held as balance in channels. + // Set to true to enable easy autoloop. If set, all channel/peer rules will be + // overridden and the client will automatically dispatch swaps in order to meet + // the configured local balance target size. Currently only loop out is + // supported, meaning that easy autoloop can only reduce the funds that are + // held as balance in channels. EasyAutoloop bool `protobuf:"varint,21,opt,name=easy_autoloop,json=easyAutoloop,proto3" json:"easy_autoloop,omitempty"` - // - //The local balance target size, expressed in satoshis. This is used by easy - //autoloop to determine how much liquidity should be maintained in channels. + // The local balance target size, expressed in satoshis. This is used by easy + // autoloop to determine how much liquidity should be maintained in channels. EasyAutoloopLocalTargetSat uint64 `protobuf:"varint,22,opt,name=easy_autoloop_local_target_sat,json=easyAutoloopLocalTargetSat,proto3" json:"easy_autoloop_local_target_sat,omitempty"` - // - //An alternative destination address source for the swap. This field - //represents the name of the account in the backing lnd instance. - //Refer to lnd's wallet import functions for reference. + // An alternative destination address source for the swap. This field + // represents the name of the account in the backing lnd instance. + // Refer to lnd's wallet import functions for reference. Account string `protobuf:"bytes,23,opt,name=account,proto3" json:"account,omitempty"` - // - //The address type of the account specified in the account field. + // The address type of the account specified in the account field. AccountAddrType AddressType `protobuf:"varint,24,opt,name=account_addr_type,json=accountAddrType,proto3,enum=looprpc.AddressType" json:"account_addr_type,omitempty"` } @@ -2954,29 +2810,24 @@ type LiquidityRule struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The short channel ID of the channel that this rule should be applied to. - //This field may not be set when the pubkey field is set. + // The short channel ID of the channel that this rule should be applied to. + // This field may not be set when the pubkey field is set. ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` // The type of swap that will be dispatched for this rule. SwapType SwapType `protobuf:"varint,6,opt,name=swap_type,json=swapType,proto3,enum=looprpc.SwapType" json:"swap_type,omitempty"` - // - //The public key of the peer that this rule should be applied to. This field - //may not be set when the channel id field is set. + // The public key of the peer that this rule should be applied to. This field + // may not be set when the channel id field is set. Pubkey []byte `protobuf:"bytes,5,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - // - //Type indicates the type of rule that this message rule represents. Setting - //this value will determine which fields are used in the message. The comments - //on each field in this message will be prefixed with the LiquidityRuleType - //they belong to. + // Type indicates the type of rule that this message rule represents. Setting + // this value will determine which fields are used in the message. The comments + // on each field in this message will be prefixed with the LiquidityRuleType + // they belong to. Type LiquidityRuleType `protobuf:"varint,2,opt,name=type,proto3,enum=looprpc.LiquidityRuleType" json:"type,omitempty"` - // - //THRESHOLD: The percentage of total capacity that incoming capacity should - //not drop beneath. + // THRESHOLD: The percentage of total capacity that incoming capacity should + // not drop beneath. IncomingThreshold uint32 `protobuf:"varint,3,opt,name=incoming_threshold,json=incomingThreshold,proto3" json:"incoming_threshold,omitempty"` - // - //THRESHOLD: The percentage of total capacity that outgoing capacity should - //not drop beneath. + // THRESHOLD: The percentage of total capacity that outgoing capacity should + // not drop beneath. OutgoingThreshold uint32 `protobuf:"varint,4,opt,name=outgoing_threshold,json=outgoingThreshold,proto3" json:"outgoing_threshold,omitempty"` } @@ -3059,11 +2910,10 @@ type SetLiquidityParamsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //Parameters is the desired new set of parameters for the liquidity management - //subsystem. Note that the current set of parameters will be completely - //overwritten by the parameters provided (if they are valid), so the full set - //of parameters should be provided for each call. + // Parameters is the desired new set of parameters for the liquidity management + // subsystem. Note that the current set of parameters will be completely + // overwritten by the parameters provided (if they are valid), so the full set + // of parameters should be provided for each call. Parameters *LiquidityParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters,omitempty"` } @@ -3187,14 +3037,11 @@ type Disqualified struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The short channel ID of the channel that was excluded from our suggestions. + // The short channel ID of the channel that was excluded from our suggestions. ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // - //The public key of the peer that was excluded from our suggestions. + // The public key of the peer that was excluded from our suggestions. Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - // - //The reason that we excluded the channel from the our suggestions. + // The reason that we excluded the channel from the our suggestions. Reason AutoReason `protobuf:"varint,2,opt,name=reason,proto3,enum=looprpc.AutoReason" json:"reason,omitempty"` } @@ -3256,15 +3103,12 @@ type SuggestSwapsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The set of recommended loop outs. + // The set of recommended loop outs. LoopOut []*LoopOutRequest `protobuf:"bytes,1,rep,name=loop_out,json=loopOut,proto3" json:"loop_out,omitempty"` - // - //The set of recommended loop in swaps + // The set of recommended loop in swaps LoopIn []*LoopInRequest `protobuf:"bytes,3,rep,name=loop_in,json=loopIn,proto3" json:"loop_in,omitempty"` - // - //Disqualified contains the set of channels that swaps are not recommended - //for. + // Disqualified contains the set of channels that swaps are not recommended + // for. Disqualified []*Disqualified `protobuf:"bytes,2,rep,name=disqualified,proto3" json:"disqualified,omitempty"` } @@ -3326,14 +3170,12 @@ type AbandonSwapRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The swap identifier which currently is the hash that locks the HTLCs. When - //using REST, this field must be encoded as URL safe base64. + // 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"` - // - //A flag that tries to ensure that the client understands that they are - //risking loss of funds by abandoning a swap. This could happen if an - //abandoned swap would wait on a timeout sweep by the client. + // A flag that tries to ensure that the client understands that they are + // risking loss of funds by abandoning a swap. This could happen if an + // abandoned swap would wait on a timeout sweep by the client. IKnowWhatIAmDoing bool `protobuf:"varint,2,opt,name=i_know_what_i_am_doing,json=iKnowWhatIAmDoing,proto3" json:"i_know_what_i_am_doing,omitempty"` } @@ -3464,8 +3306,7 @@ type ListReservationsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The list of all currently known reservations and their status. + // The list of all currently known reservations and their status. Reservations []*ClientReservation `protobuf:"bytes,1,rep,name=reservations,proto3" json:"reservations,omitempty"` } @@ -3513,23 +3354,17 @@ type ClientReservation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The reservation id that identifies this reservation. + // The reservation id that identifies this reservation. ReservationId []byte `protobuf:"bytes,1,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` - // - //The state the reservation is in. + // The state the reservation is in. State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` - // - //The amount that the reservation is for. + // The amount that the reservation is for. Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` - // - //The transaction id of the reservation. + // The transaction id of the reservation. TxId string `protobuf:"bytes,4,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - // - //The vout of the reservation. + // The vout of the reservation. Vout uint32 `protobuf:"varint,5,opt,name=vout,proto3" json:"vout,omitempty"` - // - //The expiry of the reservation. + // The expiry of the reservation. Expiry uint32 `protobuf:"varint,6,opt,name=expiry,proto3" json:"expiry,omitempty"` } @@ -3612,17 +3447,14 @@ type InstantOutRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The reservations to use for the swap. + // The reservations to use for the swap. ReservationIds [][]byte `protobuf:"bytes,1,rep,name=reservation_ids,json=reservationIds,proto3" json:"reservation_ids,omitempty"` - // - //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. + // 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,2,rep,packed,name=outgoing_chan_set,json=outgoingChanSet,proto3" json:"outgoing_chan_set,omitempty"` - // - //An optional address to sweep the onchain funds to. If not set, the funds - //will be swept to the wallet's internal address. + // An optional address to sweep the onchain funds to. If not set, the funds + // will be swept to the wallet's internal address. DestAddr string `protobuf:"bytes,3,opt,name=dest_addr,json=destAddr,proto3" json:"dest_addr,omitempty"` } @@ -3684,14 +3516,11 @@ type InstantOutResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The hash of the swap preimage. + // The hash of the swap preimage. InstantOutHash []byte `protobuf:"bytes,1,opt,name=instant_out_hash,json=instantOutHash,proto3" json:"instant_out_hash,omitempty"` - // - //The transaction id of the sweep transaction. + // The transaction id of the sweep transaction. SweepTxId string `protobuf:"bytes,2,opt,name=sweep_tx_id,json=sweepTxId,proto3" json:"sweep_tx_id,omitempty"` - // - //The state of the swap. + // The state of the swap. State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` } @@ -3753,11 +3582,9 @@ type InstantOutQuoteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The amount to swap in satoshis. + // The amount to swap in satoshis. Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` - // - //The amount of reservations to use for the swap. + // The amount of reservations to use for the swap. NumReservations int32 `protobuf:"varint,2,opt,name=num_reservations,json=numReservations,proto3" json:"num_reservations,omitempty"` } @@ -3812,12 +3639,10 @@ type InstantOutQuoteResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The fee that the swap service is charging for the swap. + // The fee that the swap service is charging for the swap. ServiceFeeSat int64 `protobuf:"varint,1,opt,name=service_fee_sat,json=serviceFeeSat,proto3" json:"service_fee_sat,omitempty"` - // - //The estimated on-chain fee that needs to be paid to publish the Sweepless - //Sweep. + // The estimated on-chain fee that needs to be paid to publish the Sweepless + // Sweep. SweepFeeSat int64 `protobuf:"varint,2,opt,name=sweep_fee_sat,json=sweepFeeSat,proto3" json:"sweep_fee_sat,omitempty"` } @@ -3910,8 +3735,7 @@ type ListInstantOutsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The list of all currently known instant out swaps and their status. + // The list of all currently known instant out swaps and their status. Swaps []*InstantOut `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"` } @@ -3959,20 +3783,15 @@ type InstantOut struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //The swap hash that identifies this swap. + // The swap hash that identifies this swap. SwapHash []byte `protobuf:"bytes,1,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` - // - //The state the swap is in. + // The state the swap is in. State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` - // - //The amount of the swap. + // The amount of the swap. Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` - // - //The used reservations for the swap. + // The used reservations for the swap. ReservationIds [][]byte `protobuf:"bytes,4,rep,name=reservation_ids,json=reservationIds,proto3" json:"reservation_ids,omitempty"` - // - //The sweep transaction id of the swap. + // The sweep transaction id of the swap. SweepTxId string `protobuf:"bytes,5,opt,name=sweep_tx_id,json=sweepTxId,proto3" json:"sweep_tx_id,omitempty"` } @@ -4281,8 +4100,8 @@ var file_client_proto_rawDesc = []byte{ 0x75, 0x65, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x0e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, - 0x2e, 0x4c, 0x73, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x22, 0xcb, 0x02, 0x0a, 0x09, 0x4c, 0x73, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x2e, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x22, 0xcb, 0x02, 0x0a, 0x09, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, @@ -4636,7 +4455,7 @@ var file_client_proto_rawDesc = []byte{ 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x73, 0x61, 0x74, 0x54, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, @@ -4728,7 +4547,7 @@ var file_client_proto_goTypes = []interface{}{ (*ProbeResponse)(nil), // 23: looprpc.ProbeResponse (*TokensRequest)(nil), // 24: looprpc.TokensRequest (*TokensResponse)(nil), // 25: looprpc.TokensResponse - (*LsatToken)(nil), // 26: looprpc.LsatToken + (*L402Token)(nil), // 26: looprpc.L402Token (*LoopStats)(nil), // 27: looprpc.LoopStats (*GetInfoRequest)(nil), // 28: looprpc.GetInfoRequest (*GetInfoResponse)(nil), // 29: looprpc.GetInfoResponse @@ -4765,7 +4584,7 @@ var file_client_proto_depIdxs = []int32{ 11, // 7: looprpc.ListSwapsResponse.swaps:type_name -> looprpc.SwapStatus 50, // 8: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint 50, // 9: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint - 26, // 10: looprpc.TokensResponse.tokens:type_name -> looprpc.LsatToken + 26, // 10: looprpc.TokensResponse.tokens:type_name -> looprpc.L402Token 27, // 11: looprpc.GetInfoResponse.loop_out_stats:type_name -> looprpc.LoopStats 27, // 12: looprpc.GetInfoResponse.loop_in_stats:type_name -> looprpc.LoopStats 32, // 13: looprpc.LiquidityParameters.rules:type_name -> looprpc.LiquidityRule @@ -4790,7 +4609,7 @@ var file_client_proto_depIdxs = []int32{ 16, // 32: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest 19, // 33: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest 22, // 34: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest - 24, // 35: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest + 24, // 35: looprpc.SwapClient.GetL402Tokens:input_type -> looprpc.TokensRequest 28, // 36: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest 30, // 37: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest 33, // 38: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest @@ -4810,7 +4629,7 @@ var file_client_proto_depIdxs = []int32{ 17, // 52: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse 20, // 53: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse 23, // 54: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse - 25, // 55: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse + 25, // 55: looprpc.SwapClient.GetL402Tokens:output_type -> looprpc.TokensResponse 29, // 56: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse 31, // 57: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters 34, // 58: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse @@ -5061,7 +4880,7 @@ func file_client_proto_init() { } } file_client_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LsatToken); i { + switch v := v.(*L402Token); i { case 0: return &v.state case 1: diff --git a/looprpc/client.pb.gw.go b/looprpc/client.pb.gw.go index 4ec7a66..f6f9e5f 100644 --- a/looprpc/client.pb.gw.go +++ b/looprpc/client.pb.gw.go @@ -433,20 +433,20 @@ func local_request_SwapClient_Probe_0(ctx context.Context, marshaler runtime.Mar } -func request_SwapClient_GetLsatTokens_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_SwapClient_GetL402Tokens_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq TokensRequest var metadata runtime.ServerMetadata - msg, err := client.GetLsatTokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetL402Tokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_SwapClient_GetLsatTokens_0(ctx context.Context, marshaler runtime.Marshaler, server SwapClientServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_SwapClient_GetL402Tokens_0(ctx context.Context, marshaler runtime.Marshaler, server SwapClientServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq TokensRequest var metadata runtime.ServerMetadata - msg, err := server.GetLsatTokens(ctx, &protoReq) + msg, err := server.GetL402Tokens(ctx, &protoReq) return msg, metadata, err } @@ -770,7 +770,7 @@ func RegisterSwapClientHandlerServer(ctx context.Context, mux *runtime.ServeMux, }) - mux.Handle("GET", pattern_SwapClient_GetLsatTokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_SwapClient_GetL402Tokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -778,12 +778,12 @@ func RegisterSwapClientHandlerServer(ctx context.Context, mux *runtime.ServeMux, inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/looprpc.SwapClient/GetLsatTokens", runtime.WithHTTPPathPattern("/v1/lsat/tokens")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/looprpc.SwapClient/GetL402Tokens", runtime.WithHTTPPathPattern("/v1/l402/tokens")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_SwapClient_GetLsatTokens_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_SwapClient_GetL402Tokens_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -791,7 +791,7 @@ func RegisterSwapClientHandlerServer(ctx context.Context, mux *runtime.ServeMux, return } - forward_SwapClient_GetLsatTokens_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_SwapClient_GetL402Tokens_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1134,25 +1134,25 @@ func RegisterSwapClientHandlerClient(ctx context.Context, mux *runtime.ServeMux, }) - mux.Handle("GET", pattern_SwapClient_GetLsatTokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_SwapClient_GetL402Tokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/looprpc.SwapClient/GetLsatTokens", runtime.WithHTTPPathPattern("/v1/lsat/tokens")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/looprpc.SwapClient/GetL402Tokens", runtime.WithHTTPPathPattern("/v1/l402/tokens")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_SwapClient_GetLsatTokens_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_SwapClient_GetL402Tokens_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_SwapClient_GetLsatTokens_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_SwapClient_GetL402Tokens_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1266,7 +1266,7 @@ var ( pattern_SwapClient_Probe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "loop", "in", "probe", "amt"}, "")) - pattern_SwapClient_GetLsatTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "lsat", "tokens"}, "")) + pattern_SwapClient_GetL402Tokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "l402", "tokens"}, "")) pattern_SwapClient_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "loop", "info"}, "")) @@ -1296,7 +1296,7 @@ var ( forward_SwapClient_Probe_0 = runtime.ForwardResponseMessage - forward_SwapClient_GetLsatTokens_0 = runtime.ForwardResponseMessage + forward_SwapClient_GetL402Tokens_0 = runtime.ForwardResponseMessage forward_SwapClient_GetInfo_0 = runtime.ForwardResponseMessage diff --git a/looprpc/client.proto b/looprpc/client.proto index 8687b93..d70094c 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -76,9 +76,9 @@ service SwapClient { rpc Probe (ProbeRequest) returns (ProbeResponse); /* loop: `listauth` - GetLsatTokens returns all LSAT tokens the daemon ever paid for. + GetL402Tokens returns all L402 tokens the daemon ever paid for. */ - rpc GetLsatTokens (TokensRequest) returns (TokensResponse); + rpc GetL402Tokens (TokensRequest) returns (TokensResponse); /* loop: `getinfo` GetInfo gets basic information about the loop daemon. @@ -811,10 +811,10 @@ message TokensResponse { /* List of all tokens the daemon knows of, including old/expired tokens. */ - repeated LsatToken tokens = 1; + repeated L402Token tokens = 1; } -message LsatToken { +message L402Token { /* The base macaroon that was baked by the auth server. */ diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index d058957..2cc3b85 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -39,6 +39,29 @@ ] } }, + "/v1/l402/tokens": { + "get": { + "summary": "loop: `listauth`\nGetL402Tokens returns all L402 tokens the daemon ever paid for.", + "operationId": "SwapClient_GetL402Tokens", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/looprpcTokensResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "SwapClient" + ] + } + }, "/v1/liquidity/params": { "get": { "summary": "loop: `getparams`\nGetLiquidityParams gets the parameters that the daemon's liquidity manager\nis currently configured with. This may be nil if nothing is configured.\n[EXPERIMENTAL]: endpoint is subject to change.", @@ -515,29 +538,6 @@ "SwapClient" ] } - }, - "/v1/lsat/tokens": { - "get": { - "summary": "loop: `listauth`\nGetLsatTokens returns all LSAT tokens the daemon ever paid for.", - "operationId": "SwapClient_GetLsatTokens", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/looprpcTokensResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "SwapClient" - ] - } } }, "definitions": { @@ -824,6 +824,53 @@ } } }, + "looprpcL402Token": { + "type": "object", + "properties": { + "base_macaroon": { + "type": "string", + "format": "byte", + "description": "The base macaroon that was baked by the auth server." + }, + "payment_hash": { + "type": "string", + "format": "byte", + "description": "The payment hash of the payment that was paid to obtain the token." + }, + "payment_preimage": { + "type": "string", + "format": "byte", + "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": "The amount of millisatoshis that was paid to get the token." + }, + "routing_fee_paid_msat": { + "type": "string", + "format": "int64", + "description": "The amount of millisatoshis paid in routing fee to pay for the token." + }, + "time_created": { + "type": "string", + "format": "int64", + "description": "The creation time of the token as UNIX timestamp in seconds." + }, + "expired": { + "type": "boolean", + "description": "Indicates whether the token is expired or still valid." + }, + "storage_name": { + "type": "string", + "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." + }, + "id": { + "type": "string", + "description": "The l402 ID of the token." + } + } + }, "looprpcLiquidityParameters": { "type": "object", "properties": { @@ -1231,53 +1278,6 @@ } } }, - "looprpcLsatToken": { - "type": "object", - "properties": { - "base_macaroon": { - "type": "string", - "format": "byte", - "description": "The base macaroon that was baked by the auth server." - }, - "payment_hash": { - "type": "string", - "format": "byte", - "description": "The payment hash of the payment that was paid to obtain the token." - }, - "payment_preimage": { - "type": "string", - "format": "byte", - "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": "The amount of millisatoshis that was paid to get the token." - }, - "routing_fee_paid_msat": { - "type": "string", - "format": "int64", - "description": "The amount of millisatoshis paid in routing fee to pay for the token." - }, - "time_created": { - "type": "string", - "format": "int64", - "description": "The creation time of the token as UNIX timestamp in seconds." - }, - "expired": { - "type": "boolean", - "description": "Indicates whether the token is expired or still valid." - }, - "storage_name": { - "type": "string", - "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." - }, - "id": { - "type": "string", - "description": "The l402 ID of the token." - } - } - }, "looprpcOutQuoteResponse": { "type": "object", "properties": { @@ -1534,7 +1534,7 @@ "tokens": { "type": "array", "items": { - "$ref": "#/definitions/looprpcLsatToken" + "$ref": "#/definitions/looprpcL402Token" }, "description": "List of all tokens the daemon knows of, including old/expired tokens." } diff --git a/looprpc/client.yaml b/looprpc/client.yaml index 188a6a2..3eb09ec 100644 --- a/looprpc/client.yaml +++ b/looprpc/client.yaml @@ -26,8 +26,8 @@ http: get: "/v1/loop/in/probe/{amt}" - selector: looprpc.SwapClient.GetInfo get: "/v1/loop/info" - - selector: looprpc.SwapClient.GetLsatTokens - get: "/v1/lsat/tokens" + - selector: looprpc.SwapClient.GetL402Tokens + get: "/v1/l402/tokens" - selector: looprpc.SwapClient.GetLiquidityParams get: "/v1/liquidity/params" - selector: looprpc.SwapClient.SetLiquidityParams diff --git a/looprpc/client_grpc.pb.go b/looprpc/client_grpc.pb.go index 8f4f519..34aafe1 100644 --- a/looprpc/client_grpc.pb.go +++ b/looprpc/client_grpc.pb.go @@ -19,83 +19,82 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SwapClientClient interface { // 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 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` - //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 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` - //Monitor will return a stream of swap updates for currently active swaps. + // 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` - //ListSwaps returns a list of all currently known swaps and their current - //status. + // 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` - //SwapInfo returns all known details about a single swap. + // SwapInfo returns all known details about a single swap. SwapInfo(ctx context.Context, in *SwapInfoRequest, opts ...grpc.CallOption) (*SwapStatus, error) // loop: `abandonswap` - //AbandonSwap allows the client to abandon a swap. + // AbandonSwap allows the client to abandon a swap. AbandonSwap(ctx context.Context, in *AbandonSwapRequest, opts ...grpc.CallOption) (*AbandonSwapResponse, error) // loop: `terms` - //LoopOutTerms returns the terms that the server enforces for a loop out swap. + // 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` - //LoopOutQuote returns a quote for a loop out swap with the provided - //parameters. + // 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` - //GetTerms returns the terms that the server enforces for swaps. + // GetTerms returns the terms that the server enforces for swaps. GetLoopInTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*InTermsResponse, error) // loop: `quote` - //GetQuote returns a quote for a swap with the provided parameters. + // GetQuote returns a quote for a swap with the provided parameters. GetLoopInQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*InQuoteResponse, error) - // - //Probe asks he sever to probe the route to us to have a better upfront - //estimate about routing fees when loopin-in. + // Probe asks he sever to probe the route to us to have a better upfront + // estimate about routing fees when loopin-in. Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) // loop: `listauth` - //GetLsatTokens returns all LSAT tokens the daemon ever paid for. - GetLsatTokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error) + // GetL402Tokens returns all L402 tokens the daemon ever paid for. + GetL402Tokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error) // loop: `getinfo` - //GetInfo gets basic information about the loop daemon. + // GetInfo gets basic information about the loop daemon. GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) // loop: `getparams` - //GetLiquidityParams gets the parameters that the daemon's liquidity manager - //is currently configured with. This may be nil if nothing is configured. - //[EXPERIMENTAL]: endpoint is subject to change. + // GetLiquidityParams gets the parameters that the daemon's liquidity manager + // is currently configured with. This may be nil if nothing is configured. + // [EXPERIMENTAL]: endpoint is subject to change. GetLiquidityParams(ctx context.Context, in *GetLiquidityParamsRequest, opts ...grpc.CallOption) (*LiquidityParameters, error) // loop: `setparams` - //SetLiquidityParams sets a new set of parameters for the daemon's liquidity - //manager. Note that the full set of parameters must be provided, because - //this call fully overwrites our existing parameters. - //[EXPERIMENTAL]: endpoint is subject to change. + // SetLiquidityParams sets a new set of parameters for the daemon's liquidity + // manager. Note that the full set of parameters must be provided, because + // this call fully overwrites our existing parameters. + // [EXPERIMENTAL]: endpoint is subject to change. SetLiquidityParams(ctx context.Context, in *SetLiquidityParamsRequest, opts ...grpc.CallOption) (*SetLiquidityParamsResponse, error) // loop: `suggestswaps` - //SuggestSwaps returns a list of recommended swaps based on the current - //state of your node's channels and it's liquidity manager parameters. - //Note that only loop out suggestions are currently supported. - //[EXPERIMENTAL]: endpoint is subject to change. + // SuggestSwaps returns a list of recommended swaps based on the current + // state of your node's channels and it's liquidity manager parameters. + // Note that only loop out suggestions are currently supported. + // [EXPERIMENTAL]: endpoint is subject to change. SuggestSwaps(ctx context.Context, in *SuggestSwapsRequest, opts ...grpc.CallOption) (*SuggestSwapsResponse, error) // loop: `listreservations` - //ListReservations returns a list of all reservations the server opened to us. + // ListReservations returns a list of all reservations the server opened to us. ListReservations(ctx context.Context, in *ListReservationsRequest, opts ...grpc.CallOption) (*ListReservationsResponse, error) // loop: `instantout` - //InstantOut initiates an instant out swap with the given parameters. + // InstantOut initiates an instant out swap with the given parameters. InstantOut(ctx context.Context, in *InstantOutRequest, opts ...grpc.CallOption) (*InstantOutResponse, error) // loop: `instantoutquote` - //InstantOutQuote returns a quote for an instant out swap with the provided - //parameters. + // InstantOutQuote returns a quote for an instant out swap with the provided + // parameters. InstantOutQuote(ctx context.Context, in *InstantOutQuoteRequest, opts ...grpc.CallOption) (*InstantOutQuoteResponse, error) // loop: `listinstantouts` - //ListInstantOuts returns a list of all currently known instant out swaps and - //their current status. + // ListInstantOuts returns a list of all currently known instant out swaps and + // their current status. ListInstantOuts(ctx context.Context, in *ListInstantOutsRequest, opts ...grpc.CallOption) (*ListInstantOutsResponse, error) } @@ -229,9 +228,9 @@ func (c *swapClientClient) Probe(ctx context.Context, in *ProbeRequest, opts ... return out, nil } -func (c *swapClientClient) GetLsatTokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error) { +func (c *swapClientClient) GetL402Tokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error) { out := new(TokensResponse) - err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLsatTokens", in, out, opts...) + err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetL402Tokens", in, out, opts...) if err != nil { return nil, err } @@ -315,83 +314,82 @@ func (c *swapClientClient) ListInstantOuts(ctx context.Context, in *ListInstantO // for forward compatibility type SwapClientServer interface { // 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 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` - //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 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` - //Monitor will return a stream of swap updates for currently active swaps. + // Monitor will return a stream of swap updates for currently active swaps. Monitor(*MonitorRequest, SwapClient_MonitorServer) error // loop: `listswaps` - //ListSwaps returns a list of all currently known swaps and their current - //status. + // ListSwaps returns a list of all currently known swaps and their current + // status. ListSwaps(context.Context, *ListSwapsRequest) (*ListSwapsResponse, error) // loop: `swapinfo` - //SwapInfo returns all known details about a single swap. + // SwapInfo returns all known details about a single swap. SwapInfo(context.Context, *SwapInfoRequest) (*SwapStatus, error) // loop: `abandonswap` - //AbandonSwap allows the client to abandon a swap. + // AbandonSwap allows the client to abandon a swap. AbandonSwap(context.Context, *AbandonSwapRequest) (*AbandonSwapResponse, error) // loop: `terms` - //LoopOutTerms returns the terms that the server enforces for a loop out swap. + // LoopOutTerms returns the terms that the server enforces for a loop out swap. LoopOutTerms(context.Context, *TermsRequest) (*OutTermsResponse, error) // loop: `quote` - //LoopOutQuote returns a quote for a loop out swap with the provided - //parameters. + // LoopOutQuote returns a quote for a loop out swap with the provided + // parameters. LoopOutQuote(context.Context, *QuoteRequest) (*OutQuoteResponse, error) // loop: `terms` - //GetTerms returns the terms that the server enforces for swaps. + // GetTerms returns the terms that the server enforces for swaps. GetLoopInTerms(context.Context, *TermsRequest) (*InTermsResponse, error) // loop: `quote` - //GetQuote returns a quote for a swap with the provided parameters. + // GetQuote returns a quote for a swap with the provided parameters. GetLoopInQuote(context.Context, *QuoteRequest) (*InQuoteResponse, error) - // - //Probe asks he sever to probe the route to us to have a better upfront - //estimate about routing fees when loopin-in. + // Probe asks he sever to probe the route to us to have a better upfront + // estimate about routing fees when loopin-in. Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) // loop: `listauth` - //GetLsatTokens returns all LSAT tokens the daemon ever paid for. - GetLsatTokens(context.Context, *TokensRequest) (*TokensResponse, error) + // GetL402Tokens returns all L402 tokens the daemon ever paid for. + GetL402Tokens(context.Context, *TokensRequest) (*TokensResponse, error) // loop: `getinfo` - //GetInfo gets basic information about the loop daemon. + // GetInfo gets basic information about the loop daemon. GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) // loop: `getparams` - //GetLiquidityParams gets the parameters that the daemon's liquidity manager - //is currently configured with. This may be nil if nothing is configured. - //[EXPERIMENTAL]: endpoint is subject to change. + // GetLiquidityParams gets the parameters that the daemon's liquidity manager + // is currently configured with. This may be nil if nothing is configured. + // [EXPERIMENTAL]: endpoint is subject to change. GetLiquidityParams(context.Context, *GetLiquidityParamsRequest) (*LiquidityParameters, error) // loop: `setparams` - //SetLiquidityParams sets a new set of parameters for the daemon's liquidity - //manager. Note that the full set of parameters must be provided, because - //this call fully overwrites our existing parameters. - //[EXPERIMENTAL]: endpoint is subject to change. + // SetLiquidityParams sets a new set of parameters for the daemon's liquidity + // manager. Note that the full set of parameters must be provided, because + // this call fully overwrites our existing parameters. + // [EXPERIMENTAL]: endpoint is subject to change. SetLiquidityParams(context.Context, *SetLiquidityParamsRequest) (*SetLiquidityParamsResponse, error) // loop: `suggestswaps` - //SuggestSwaps returns a list of recommended swaps based on the current - //state of your node's channels and it's liquidity manager parameters. - //Note that only loop out suggestions are currently supported. - //[EXPERIMENTAL]: endpoint is subject to change. + // SuggestSwaps returns a list of recommended swaps based on the current + // state of your node's channels and it's liquidity manager parameters. + // Note that only loop out suggestions are currently supported. + // [EXPERIMENTAL]: endpoint is subject to change. SuggestSwaps(context.Context, *SuggestSwapsRequest) (*SuggestSwapsResponse, error) // loop: `listreservations` - //ListReservations returns a list of all reservations the server opened to us. + // ListReservations returns a list of all reservations the server opened to us. ListReservations(context.Context, *ListReservationsRequest) (*ListReservationsResponse, error) // loop: `instantout` - //InstantOut initiates an instant out swap with the given parameters. + // InstantOut initiates an instant out swap with the given parameters. InstantOut(context.Context, *InstantOutRequest) (*InstantOutResponse, error) // loop: `instantoutquote` - //InstantOutQuote returns a quote for an instant out swap with the provided - //parameters. + // InstantOutQuote returns a quote for an instant out swap with the provided + // parameters. InstantOutQuote(context.Context, *InstantOutQuoteRequest) (*InstantOutQuoteResponse, error) // loop: `listinstantouts` - //ListInstantOuts returns a list of all currently known instant out swaps and - //their current status. + // ListInstantOuts returns a list of all currently known instant out swaps and + // their current status. ListInstantOuts(context.Context, *ListInstantOutsRequest) (*ListInstantOutsResponse, error) mustEmbedUnimplementedSwapClientServer() } @@ -433,8 +431,8 @@ func (UnimplementedSwapClientServer) GetLoopInQuote(context.Context, *QuoteReque func (UnimplementedSwapClientServer) Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Probe not implemented") } -func (UnimplementedSwapClientServer) GetLsatTokens(context.Context, *TokensRequest) (*TokensResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLsatTokens not implemented") +func (UnimplementedSwapClientServer) GetL402Tokens(context.Context, *TokensRequest) (*TokensResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetL402Tokens not implemented") } func (UnimplementedSwapClientServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") @@ -674,20 +672,20 @@ func _SwapClient_Probe_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _SwapClient_GetLsatTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _SwapClient_GetL402Tokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TokensRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(SwapClientServer).GetLsatTokens(ctx, in) + return srv.(SwapClientServer).GetL402Tokens(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/looprpc.SwapClient/GetLsatTokens", + FullMethod: "/looprpc.SwapClient/GetL402Tokens", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SwapClientServer).GetLsatTokens(ctx, req.(*TokensRequest)) + return srv.(SwapClientServer).GetL402Tokens(ctx, req.(*TokensRequest)) } return interceptor(ctx, in, info, handler) } @@ -884,8 +882,8 @@ var SwapClient_ServiceDesc = grpc.ServiceDesc{ Handler: _SwapClient_Probe_Handler, }, { - MethodName: "GetLsatTokens", - Handler: _SwapClient_GetLsatTokens_Handler, + MethodName: "GetL402Tokens", + Handler: _SwapClient_GetL402Tokens_Handler, }, { MethodName: "GetInfo", diff --git a/looprpc/debug.pb.go b/looprpc/debug.pb.go index fa69da2..53fef6d 100644 --- a/looprpc/debug.pb.go +++ b/looprpc/debug.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v3.6.1 // source: debug.proto diff --git a/looprpc/debug_grpc.pb.go b/looprpc/debug_grpc.pb.go index 99d3758..3d7613a 100644 --- a/looprpc/debug_grpc.pb.go +++ b/looprpc/debug_grpc.pb.go @@ -18,10 +18,9 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DebugClient interface { - // - //ForceAutoLoop is intended for *testing purposes only* and will not work on - //mainnet. This endpoint ticks our autoloop timer, triggering automated - //dispatch of a swap if one is suggested. + // ForceAutoLoop is intended for *testing purposes only* and will not work on + // mainnet. This endpoint ticks our autoloop timer, triggering automated + // dispatch of a swap if one is suggested. ForceAutoLoop(ctx context.Context, in *ForceAutoLoopRequest, opts ...grpc.CallOption) (*ForceAutoLoopResponse, error) } @@ -46,10 +45,9 @@ func (c *debugClient) ForceAutoLoop(ctx context.Context, in *ForceAutoLoopReques // All implementations must embed UnimplementedDebugServer // for forward compatibility type DebugServer interface { - // - //ForceAutoLoop is intended for *testing purposes only* and will not work on - //mainnet. This endpoint ticks our autoloop timer, triggering automated - //dispatch of a swap if one is suggested. + // ForceAutoLoop is intended for *testing purposes only* and will not work on + // mainnet. This endpoint ticks our autoloop timer, triggering automated + // dispatch of a swap if one is suggested. ForceAutoLoop(context.Context, *ForceAutoLoopRequest) (*ForceAutoLoopResponse, error) mustEmbedUnimplementedDebugServer() } diff --git a/looprpc/swapclient.pb.json.go b/looprpc/swapclient.pb.json.go index a715cdd..cece43e 100644 --- a/looprpc/swapclient.pb.json.go +++ b/looprpc/swapclient.pb.json.go @@ -313,7 +313,7 @@ func RegisterSwapClientJSONCallbacks(registry map[string]func(ctx context.Contex callback(string(respBytes), nil) } - registry["looprpc.SwapClient.GetLsatTokens"] = func(ctx context.Context, + registry["looprpc.SwapClient.GetL402Tokens"] = func(ctx context.Context, conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { req := &TokensRequest{} @@ -324,7 +324,7 @@ func RegisterSwapClientJSONCallbacks(registry map[string]func(ctx context.Contex } client := NewSwapClientClient(conn) - resp, err := client.GetLsatTokens(ctx, req) + resp, err := client.GetL402Tokens(ctx, req) if err != nil { callback("", err) return diff --git a/release_notes.md b/release_notes.md index 38afc60..056aa18 100644 --- a/release_notes.md +++ b/release_notes.md @@ -18,6 +18,14 @@ This file tracks release notes for the loop client. #### Breaking Changes +In loopd.conf file `maxlsatcost` and `maxlsatfee` were renamed to `maxl402cost` +and `maxl402fee` accordingly. If they have been changed locally, the file has +to be updated for loopd to recognize the options. + +The path in looprpc "/v1/lsat/tokens" was renamed to "/v1/l402/tokens" and +the corresponding method was renamed from `GetLsatTokens` to `GetL402Tokens`. +Update `loop` and `loopd` simultaneously otherwise this RPC won't work. + #### Bug Fixes #### Maintenance diff --git a/sample-loopd.conf b/sample-loopd.conf index ae1e165..a0ca7b9 100644 --- a/sample-loopd.conf +++ b/sample-loopd.conf @@ -86,11 +86,11 @@ ; Maximum cost in satoshis that loopd is going to pay for an L402 token ; automatically. Does not include routing fees. -; maxlsatcost=1000 +; maxl402cost=1000 ; Maximum routing fee in satoshis that we are willing to pay while paying for an ; L402 token. -; maxlsatfee=10 +; maxl402fee=10 ; The maximum number of payment parts that may be used for a loop out swap. ; loopoutmaxparts=5 diff --git a/swap_server_client.go b/swap_server_client.go index 87760f3..60150ca 100644 --- a/swap_server_client.go +++ b/swap_server_client.go @@ -15,7 +15,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/wire" - "github.com/lightninglabs/aperture/lsat" + "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/loop/loopdb" looprpc "github.com/lightninglabs/loop/swapserverrpc" "github.com/lightningnetwork/lnd/lnrpc" @@ -161,14 +161,14 @@ func (s *grpcSwapServerClient) stop() { var _ swapServerClient = (*grpcSwapServerClient)(nil) -func newSwapServerClient(cfg *ClientConfig, lsatStore lsat.Store) ( +func newSwapServerClient(cfg *ClientConfig, l402Store l402.Store) ( *grpcSwapServerClient, error) { // Create the server connection with the interceptor that will handle - // the LSAT protocol for us. - clientInterceptor := lsat.NewInterceptor( - cfg.Lnd, lsatStore, serverRPCTimeout, cfg.MaxLsatCost, - cfg.MaxLsatFee, false, + // the L402 protocol for us. + clientInterceptor := l402.NewInterceptor( + cfg.Lnd, l402Store, serverRPCTimeout, cfg.MaxL402Cost, + cfg.MaxL402Fee, false, ) serverConn, err := getSwapServerConn( cfg.ServerAddress, cfg.ProxyAddress, cfg.SwapServerNoTLS, @@ -895,7 +895,7 @@ func rpcRouteCancel(details *outCancelDetails) ( // proxyAddr indicates that a SOCKS proxy found at the address should be used to // establish the connection. func getSwapServerConn(address, proxyAddress string, insecure bool, - tlsPath string, interceptor *lsat.ClientInterceptor) (*grpc.ClientConn, + tlsPath string, interceptor *l402.ClientInterceptor) (*grpc.ClientConn, error) { // Create a dial options array. diff --git a/swapserverrpc/Dockerfile b/swapserverrpc/Dockerfile index 1c96778..614da86 100644 --- a/swapserverrpc/Dockerfile +++ b/swapserverrpc/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16.3-buster +FROM golang:1.19.10-buster RUN apt-get update && apt-get install -y \ git \ @@ -14,8 +14,8 @@ ENV PROTOC_GEN_GO_GRPC_VERSION="v1.1.0" RUN cd /tmp \ && export GO111MODULE=on \ - && go get google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOBUF_VERSION} \ - && go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} + && go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOBUF_VERSION} \ + && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} WORKDIR /build diff --git a/swapserverrpc/common.pb.go b/swapserverrpc/common.pb.go index a5452d2..8d166c3 100644 --- a/swapserverrpc/common.pb.go +++ b/swapserverrpc/common.pb.go @@ -36,9 +36,8 @@ type HopHint struct { ChanId uint64 `protobuf:"varint,2,opt,name=chan_id,json=chanId,proto3" json:"chan_id,omitempty"` // The base fee of the channel denominated in millisatoshis. FeeBaseMsat uint32 `protobuf:"varint,3,opt,name=fee_base_msat,json=feeBaseMsat,proto3" json:"fee_base_msat,omitempty"` - // - //The fee rate of the channel for sending one satoshi across it denominated in - //millionths of a satoshi. + // The fee rate of the channel for sending one satoshi across it denominated in + // millionths of a satoshi. FeeProportionalMillionths uint32 `protobuf:"varint,4,opt,name=fee_proportional_millionths,json=feeProportionalMillionths,proto3" json:"fee_proportional_millionths,omitempty"` // The time-lock delta of the channel. CltvExpiryDelta uint32 `protobuf:"varint,5,opt,name=cltv_expiry_delta,json=cltvExpiryDelta,proto3" json:"cltv_expiry_delta,omitempty"` @@ -116,9 +115,8 @@ type RouteHint struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // - //A list of hop hints that when chained together can assist in reaching a - //specific destination. + // A list of hop hints that when chained together can assist in reaching a + // specific destination. HopHints []*HopHint `protobuf:"bytes,1,rep,name=hop_hints,json=hopHints,proto3" json:"hop_hints,omitempty"` } diff --git a/swapserverrpc/server.pb.go b/swapserverrpc/server.pb.go index 649aee9..45cdffe 100644 --- a/swapserverrpc/server.pb.go +++ b/swapserverrpc/server.pb.go @@ -25,27 +25,26 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//* -//This enum defines the protocol versions that clients may adhere to. Note that -//this is not a flagged enum. If a particular protocol version adds a feature, -//then in general all the preceding features are also supported. Exception to this -//is when features get deprecated. +// * +// This enum defines the protocol versions that clients may adhere to. Note that +// this is not a flagged enum. If a particular protocol version adds a feature, +// then in general all the preceding features are also supported. Exception to this +// is when features get deprecated. type ProtocolVersion int32 const ( - /// No protocol version reported at all. + // / No protocol version reported at all. ProtocolVersion_LEGACY ProtocolVersion = 0 - /// Client may attempt to send the loop out payment in multiple parts. + // / Client may attempt to send the loop out payment in multiple parts. ProtocolVersion_MULTI_LOOP_OUT ProtocolVersion = 1 - //* - //Loop will use native segwit (P2WSH) htlcs by default, while externally - //published htlcs may use native (P2WSH) or nested (NP2WSH) segwit as well. + // * + // Loop will use native segwit (P2WSH) htlcs by default, while externally + // published htlcs may use native (P2WSH) or nested (NP2WSH) segwit as well. ProtocolVersion_NATIVE_SEGWIT_LOOP_IN ProtocolVersion = 2 - // - //Once the on chain loop out htlc is confirmed, the client can push the swap - //preimage to the server to speed up claim of their off chain htlc (acquiring - //incoming liquidity more quickly than if the server waited for the on chain - //claim tx). + // Once the on chain loop out htlc is confirmed, the client can push the swap + // preimage to the server to speed up claim of their off chain htlc (acquiring + // incoming liquidity more quickly than if the server waited for the on chain + // claim tx). ProtocolVersion_PREIMAGE_PUSH_LOOP_OUT ProtocolVersion = 3 // The client will propose a cltv expiry height for loop out. ProtocolVersion_USER_EXPIRY_LOOP_OUT ProtocolVersion = 4 @@ -138,23 +137,20 @@ const ( ServerSwapState_SERVER_HTLC_PUBLISHED ServerSwapState = 1 // The swap completed successfully. ServerSwapState_SERVER_SUCCESS ServerSwapState = 2 - // - //The swap failed for a reason that is unknown to the server, this is only - //set for older swaps. + // The swap failed for a reason that is unknown to the server, this is only + // set for older swaps. ServerSwapState_SERVER_FAILED_UNKNOWN ServerSwapState = 3 // No htlc was confirmed in time for the loop in swap to complete. ServerSwapState_SERVER_FAILED_NO_HTLC ServerSwapState = 4 // A loop in htlc confirmed on chain, but it did not have the correct value. ServerSwapState_SERVER_FAILED_INVALID_HTLC_AMOUNT ServerSwapState = 5 - // - //We did not succeed in completing the loop in off chain payment before the - //timeout. + // We did not succeed in completing the loop in off chain payment before the + // timeout. ServerSwapState_SERVER_FAILED_OFF_CHAIN_TIMEOUT ServerSwapState = 6 // The on chain timeout was claimed. ServerSwapState_SERVER_FAILED_TIMEOUT ServerSwapState = 7 - // - //The server could not publish the loop out on chain htlc before the deadline - //provided. + // The server could not publish the loop out on chain htlc before the deadline + // provided. ServerSwapState_SERVER_FAILED_SWAP_DEADLINE ServerSwapState = 8 // The server could not publish the loop out on chain htlc. ServerSwapState_SERVER_FAILED_HTLC_PUBLICATION ServerSwapState = 9 @@ -169,12 +165,10 @@ const ( // The client canceled the swap because they could not route the swap // payment. ServerSwapState_SERVER_CLIENT_INVOICE_CANCEL ServerSwapState = 14 - // - //A loop in swap was rejected because it contained multiple outputs for a - //single swap. + // A loop in swap was rejected because it contained multiple outputs for a + // single swap. ServerSwapState_SERVER_FAILED_MULTIPLE_SWAP_SCRIPTS ServerSwapState = 15 - // - //The swap failed during creation. + // The swap failed during creation. ServerSwapState_SERVER_FAILED_INITIALIZATION ServerSwapState = 16 ) @@ -306,25 +300,19 @@ func (RoutePaymentType) EnumDescriptor() ([]byte, []int) { type PaymentFailureReason int32 const ( - // - //Payment isn't failed (yet). + // Payment isn't failed (yet). PaymentFailureReason_LND_FAILURE_REASON_NONE PaymentFailureReason = 0 - // - //There are more routes to try, but the payment timeout was exceeded. + // There are more routes to try, but the payment timeout was exceeded. PaymentFailureReason_LND_FAILURE_REASON_TIMEOUT PaymentFailureReason = 1 - // - //All possible routes were tried and failed permanently. Or were no - //routes to the destination at all. + // All possible routes were tried and failed permanently. Or were no + // routes to the destination at all. PaymentFailureReason_LND_FAILURE_REASON_NO_ROUTE PaymentFailureReason = 2 - // - //A non-recoverable error has occured. + // A non-recoverable error has occured. PaymentFailureReason_LND_FAILURE_REASON_ERROR PaymentFailureReason = 3 - // - //Payment details incorrect (unknown hash, invalid amt or - //invalid final cltv delta) + // Payment details incorrect (unknown hash, invalid amt or + // invalid final cltv delta) PaymentFailureReason_LND_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS PaymentFailureReason = 4 - // - //Insufficient local balance. + // Insufficient local balance. PaymentFailureReason_LND_FAILURE_REASON_INSUFFICIENT_BALANCE PaymentFailureReason = 5 ) @@ -477,9 +465,9 @@ type ServerLoopOutRequest struct { ReceiverKey []byte `protobuf:"bytes,1,opt,name=receiver_key,json=receiverKey,proto3" json:"receiver_key,omitempty"` SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` Amt uint64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"` - /// The unix time in seconds we want the on-chain swap to be published by. + // / The unix time in seconds we want the on-chain swap to be published by. SwapPublicationDeadline int64 `protobuf:"varint,4,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` - /// The protocol version that the client adheres to. + // / The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,5,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` // The requested absolute block height of the on-chain htlc. This is // subjected to min and max constraints as reported in the LoopOutTerms @@ -488,10 +476,13 @@ type ServerLoopOutRequest struct { // The user agent string that identifies the software running on the user's // side. This can be changed in the user's client software but it _SHOULD_ // conform to the following pattern: - // Agent-Name/semver-version(/additional-info) + // + // Agent-Name/semver-version(/additional-info) + // // Examples: - // loopd/v0.10.0-beta/commit=3b635821 - // litd/v0.2.0-alpha/commit=326d754 + // + // loopd/v0.10.0-beta/commit=3b635821 + // litd/v0.2.0-alpha/commit=326d754 UserAgent string `protobuf:"bytes,7,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` } @@ -666,11 +657,11 @@ type ServerLoopOutQuoteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - /// The swap amount. If zero, a quote for a maximum amt swap will be given. + // / The swap amount. If zero, a quote for a maximum amt swap will be given. Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` - /// The unix time in seconds we want the on-chain swap to be published by. + // / The unix time in seconds we want the on-chain swap to be published by. SwapPublicationDeadline int64 `protobuf:"varint,2,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` - /// The protocol version that the client adheres to. + // / The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,3,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` // The requested absolute block height of the on-chain htlc. This is // subjected to min and max constraints as reported in the LoopOutTerms @@ -679,10 +670,13 @@ type ServerLoopOutQuoteRequest struct { // The user agent string that identifies the software running on the user's // side. This can be changed in the user's client software but it _SHOULD_ // conform to the following pattern: - // Agent-Name/semver-version(/additional-info) + // + // Agent-Name/semver-version(/additional-info) + // // Examples: - // loopd/v0.10.0-beta/commit=3b635821 - // litd/v0.2.0-alpha/commit=326d754 + // + // loopd/v0.10.0-beta/commit=3b635821 + // litd/v0.2.0-alpha/commit=326d754 UserAgent string `protobuf:"bytes,5,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` } @@ -759,9 +753,9 @@ type ServerLoopOutQuote struct { unknownFields protoimpl.UnknownFields SwapPaymentDest string `protobuf:"bytes,1,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"` - /// The total estimated swap fee given the quote amt. + // / The total estimated swap fee given the quote amt. SwapFee int64 `protobuf:"varint,2,opt,name=swap_fee,json=swapFee,proto3" json:"swap_fee,omitempty"` - /// Deprecated, total swap fee given quote amt is calculated in swap_fee. + // / Deprecated, total swap fee given quote amt is calculated in swap_fee. // // Deprecated: Marked as deprecated in server.proto. SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` @@ -867,15 +861,18 @@ type ServerLoopOutTermsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - /// The protocol version that the client adheres to. + // / The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` // The user agent string that identifies the software running on the user's // side. This can be changed in the user's client software but it _SHOULD_ // conform to the following pattern: - // Agent-Name/semver-version(/additional-info) + // + // Agent-Name/semver-version(/additional-info) + // // Examples: - // loopd/v0.10.0-beta/commit=3b635821 - // litd/v0.2.0-alpha/commit=326d754 + // + // loopd/v0.10.0-beta/commit=3b635821 + // litd/v0.2.0-alpha/commit=326d754 UserAgent string `protobuf:"bytes,2,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` } @@ -1009,17 +1006,20 @@ type ServerLoopInRequest struct { Amt uint64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"` SwapInvoice string `protobuf:"bytes,4,opt,name=swap_invoice,json=swapInvoice,proto3" json:"swap_invoice,omitempty"` LastHop []byte `protobuf:"bytes,5,opt,name=last_hop,json=lastHop,proto3" json:"last_hop,omitempty"` - /// The protocol version that the client adheres to. + // / The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,6,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` // An invoice that can be used for the purpose of probing. ProbeInvoice string `protobuf:"bytes,7,opt,name=probe_invoice,json=probeInvoice,proto3" json:"probe_invoice,omitempty"` // The user agent string that identifies the software running on the user's // side. This can be changed in the user's client software but it _SHOULD_ // conform to the following pattern: - // Agent-Name/semver-version(/additional-info) + // + // Agent-Name/semver-version(/additional-info) + // // Examples: - // loopd/v0.10.0-beta/commit=3b635821 - // litd/v0.2.0-alpha/commit=326d754 + // + // loopd/v0.10.0-beta/commit=3b635821 + // litd/v0.2.0-alpha/commit=326d754 UserAgent string `protobuf:"bytes,8,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` } @@ -1195,7 +1195,7 @@ type ServerLoopInQuoteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - /// The swap amount. If zero, a quote for a maximum amt swap will be given. + // / The swap amount. If zero, a quote for a maximum amt swap will be given. Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` // The destination pubkey. Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` @@ -1203,15 +1203,18 @@ type ServerLoopInQuoteRequest struct { LastHop []byte `protobuf:"bytes,4,opt,name=last_hop,json=lastHop,proto3" json:"last_hop,omitempty"` // Optional route hints to reach the destination through private channels. RouteHints []*RouteHint `protobuf:"bytes,5,rep,name=route_hints,json=routeHints,proto3" json:"route_hints,omitempty"` - /// The protocol version that the client adheres to. + // / The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,2,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` // The user agent string that identifies the software running on the user's // side. This can be changed in the user's client software but it _SHOULD_ // conform to the following pattern: - // Agent-Name/semver-version(/additional-info) + // + // Agent-Name/semver-version(/additional-info) + // // Examples: - // loopd/v0.10.0-beta/commit=3b635821 - // litd/v0.2.0-alpha/commit=326d754 + // + // loopd/v0.10.0-beta/commit=3b635821 + // litd/v0.2.0-alpha/commit=326d754 UserAgent string `protobuf:"bytes,6,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` } @@ -1379,15 +1382,18 @@ type ServerLoopInTermsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - /// The protocol version that the client adheres to. + // / The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` // The user agent string that identifies the software running on the user's // side. This can be changed in the user's client software but it _SHOULD_ // conform to the following pattern: - // Agent-Name/semver-version(/additional-info) + // + // Agent-Name/semver-version(/additional-info) + // // Examples: - // loopd/v0.10.0-beta/commit=3b635821 - // litd/v0.2.0-alpha/commit=326d754 + // + // loopd/v0.10.0-beta/commit=3b635821 + // litd/v0.2.0-alpha/commit=326d754 UserAgent string `protobuf:"bytes,2,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` } @@ -1502,9 +1508,8 @@ type ServerLoopOutPushPreimageRequest struct { // The protocol version that the client adheres to. ProtocolVersion ProtocolVersion `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.ProtocolVersion" json:"protocol_version,omitempty"` - // - //Preimage is the preimage of the loop out swap that we wish to push to the - //server to speed up off-chain claim once the on-chain htlc has confirmed. + // Preimage is the preimage of the loop out swap that we wish to push to the + // server to speed up off-chain claim once the on-chain htlc has confirmed. Preimage []byte `protobuf:"bytes,2,opt,name=preimage,proto3" json:"preimage,omitempty"` } @@ -1893,6 +1898,7 @@ type CancelLoopOutSwapRequest struct { // Additional information about the swap cancelation. // // Types that are assignable to CancelInfo: + // // *CancelLoopOutSwapRequest_RouteCancel CancelInfo isCancelLoopOutSwapRequest_CancelInfo `protobuf_oneof:"cancel_info"` }