diff --git a/docs/code_contribution_guidelines.md b/docs/code_contribution_guidelines.md index d9065f944..a9542dbb3 100644 --- a/docs/code_contribution_guidelines.md +++ b/docs/code_contribution_guidelines.md @@ -433,12 +433,6 @@ _exact same_ version of `protoc`. As of the writing of this article, the `lnd` project uses [v3.4.0](https://github.com/google/protobuf/releases/tag/v3.4.0) of `protoc`. -The following two libraries must be installed with the exact commit hash as -described in [lnrpc README](https://github.com/lightningnetwork/lnd/blob/master/lnrpc/README.md) -otherwise the CI pipeline on Travis will fail: -- grpc-ecosystem/grpc-gateway -- golang/protobuf - For detailed instructions on how to compile modifications to `lnd`'s `protobuf` definitions, check out the [lnrpc README](https://github.com/lightningnetwork/lnd/blob/master/lnrpc/README.md). diff --git a/go.mod b/go.mod index 636f6b3fc..63ffd1991 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 github.com/jackpal/gateway v1.0.5 github.com/jackpal/go-nat-pmp v0.0.0-20170405195558-28a68d0c24ad github.com/jedib0t/go-pretty v4.3.0+incompatible diff --git a/go.sum b/go.sum index c1f1848dd..043937f91 100644 --- a/go.sum +++ b/go.sum @@ -4,13 +4,34 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -102,6 +123,9 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -153,6 +177,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -172,16 +198,27 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v0.0.0-20210429001901-424d2337a529 h1:2voWjNECnrZRbfwXxHB1/j8wa6xdKn85B5NzgVL/pTU= +github.com/golang/glog v0.0.0-20210429001901-424d2337a529/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -203,14 +240,23 @@ github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzr github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= @@ -228,6 +274,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 h1:ajue7SzQMywqRjg2fK7dcpc0QhFGpTR2plWfV4EZWR4= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0/go.mod h1:r1hZAcvfFXuYmcKyCJI9wlyOPIZUJl6FCB8Cpca/NLE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -250,6 +298,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackpal/gateway v1.0.5 h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= @@ -271,6 +320,7 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c h1:3UvYABOQRhJAApj9MdCN+Ydv841ETSoy6xLzdmmr/9A= github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= @@ -432,7 +482,9 @@ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -457,6 +509,9 @@ go.mongodb.org/mongo-driver v1.0.3 h1:GKoji1ld3tw2aC+GX1wbr/J2fX13yNacEYoJ8Nhr0y go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 h1:sO4WKdPAudZGKPcpZT4MJn6JaDmpyLrMPDGGyA1SttE= @@ -509,6 +564,11 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -519,6 +579,9 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -526,6 +589,7 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= @@ -550,9 +614,22 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -561,14 +638,18 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns= +golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= @@ -589,16 +670,31 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -610,6 +706,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -619,6 +716,7 @@ golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -643,12 +741,36 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -659,11 +781,24 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -674,11 +809,31 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced h1:c5geK1iMU3cDKtFrCVQIcjR3W+JOZMuhIyICMCTbtus= +google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -686,8 +841,13 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= @@ -701,6 +861,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= @@ -746,6 +907,10 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/lnd.go b/lnd.go index bd0f2839d..873104b01 100644 --- a/lnd.go +++ b/lnd.go @@ -25,12 +25,13 @@ import ( "github.com/btcsuite/btcutil" "github.com/btcsuite/btcwallet/wallet" "github.com/btcsuite/btcwallet/walletdb" - proxy "github.com/grpc-ecosystem/grpc-gateway/runtime" + proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightninglabs/neutrino" "github.com/lightninglabs/neutrino/headerfs" "golang.org/x/crypto/acme/autocert" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/encoding/protojson" "gopkg.in/macaroon-bakery.v2/bakery" "gopkg.in/macaroon.v2" @@ -1412,8 +1413,10 @@ func startRestProxy(cfg *Config, rpcServer *rpcServer, restDialOpts []grpc.DialO // that the marshaler prints all values, even if they are falsey. customMarshalerOption := proxy.WithMarshalerOption( proxy.MIMEWildcard, &proxy.JSONPb{ - OrigName: true, - EmitDefaults: true, + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + EmitUnpopulated: true, + }, }, ) mux := proxy.NewServeMux(customMarshalerOption) diff --git a/lnrpc/Dockerfile b/lnrpc/Dockerfile index 5af758bc8..3ab233af7 100644 --- a/lnrpc/Dockerfile +++ b/lnrpc/Dockerfile @@ -8,9 +8,10 @@ RUN apt-get update && apt-get install -y \ # We don't want any default values for these variables to make sure they're # explicitly provided by parsing the go.mod file. Otherwise we might forget to # update them here if we bump the versions. -ARG PROTOC_GEN_VERSION +ARG PROTOBUF_VERSION ARG GRPC_GATEWAY_VERSION +ENV PROTOC_GEN_GO_GRPC_VERSION="v1.1.0" ENV FALAFEL_VERSION="v0.9.0" ENV GOCACHE=/tmp/build/.cache ENV GOMODCACHE=/tmp/build/.modcache @@ -19,9 +20,10 @@ RUN cd /tmp \ && mkdir -p /tmp/build/.cache \ && mkdir -p /tmp/build/.modcache \ && export GO111MODULE=on \ - && go get github.com/golang/protobuf/protoc-gen-go@${PROTOC_GEN_VERSION} \ - && go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \ - && go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@${GRPC_GATEWAY_VERSION} \ + && 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 get golang.org/x/tools/cmd/goimports \ && chmod -R 777 /tmp/build/ diff --git a/lnrpc/autopilotrpc/autopilot.pb.go b/lnrpc/autopilotrpc/autopilot.pb.go index fc15d2378..65faad4a1 100644 --- a/lnrpc/autopilotrpc/autopilot.pb.go +++ b/lnrpc/autopilotrpc/autopilot.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: autopilotrpc/autopilot.proto package autopilotrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type StatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -713,215 +704,3 @@ func file_autopilotrpc_autopilot_proto_init() { file_autopilotrpc_autopilot_proto_goTypes = nil file_autopilotrpc_autopilot_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AutopilotClient is the client API for Autopilot service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AutopilotClient interface { - // - //Status returns whether the daemon's autopilot agent is active. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // - //ModifyStatus is used to modify the status of the autopilot agent, like - //enabling or disabling it. - ModifyStatus(ctx context.Context, in *ModifyStatusRequest, opts ...grpc.CallOption) (*ModifyStatusResponse, error) - // - //QueryScores queries all available autopilot heuristics, in addition to any - //active combination of these heruristics, for the scores they would give to - //the given nodes. - QueryScores(ctx context.Context, in *QueryScoresRequest, opts ...grpc.CallOption) (*QueryScoresResponse, error) - // - //SetScores attempts to set the scores used by the running autopilot agent, - //if the external scoring heuristic is enabled. - SetScores(ctx context.Context, in *SetScoresRequest, opts ...grpc.CallOption) (*SetScoresResponse, error) -} - -type autopilotClient struct { - cc grpc.ClientConnInterface -} - -func NewAutopilotClient(cc grpc.ClientConnInterface) AutopilotClient { - return &autopilotClient{cc} -} - -func (c *autopilotClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/Status", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autopilotClient) ModifyStatus(ctx context.Context, in *ModifyStatusRequest, opts ...grpc.CallOption) (*ModifyStatusResponse, error) { - out := new(ModifyStatusResponse) - err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/ModifyStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autopilotClient) QueryScores(ctx context.Context, in *QueryScoresRequest, opts ...grpc.CallOption) (*QueryScoresResponse, error) { - out := new(QueryScoresResponse) - err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/QueryScores", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autopilotClient) SetScores(ctx context.Context, in *SetScoresRequest, opts ...grpc.CallOption) (*SetScoresResponse, error) { - out := new(SetScoresResponse) - err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/SetScores", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AutopilotServer is the server API for Autopilot service. -type AutopilotServer interface { - // - //Status returns whether the daemon's autopilot agent is active. - Status(context.Context, *StatusRequest) (*StatusResponse, error) - // - //ModifyStatus is used to modify the status of the autopilot agent, like - //enabling or disabling it. - ModifyStatus(context.Context, *ModifyStatusRequest) (*ModifyStatusResponse, error) - // - //QueryScores queries all available autopilot heuristics, in addition to any - //active combination of these heruristics, for the scores they would give to - //the given nodes. - QueryScores(context.Context, *QueryScoresRequest) (*QueryScoresResponse, error) - // - //SetScores attempts to set the scores used by the running autopilot agent, - //if the external scoring heuristic is enabled. - SetScores(context.Context, *SetScoresRequest) (*SetScoresResponse, error) -} - -// UnimplementedAutopilotServer can be embedded to have forward compatible implementations. -type UnimplementedAutopilotServer struct { -} - -func (*UnimplementedAutopilotServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} -func (*UnimplementedAutopilotServer) ModifyStatus(context.Context, *ModifyStatusRequest) (*ModifyStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyStatus not implemented") -} -func (*UnimplementedAutopilotServer) QueryScores(context.Context, *QueryScoresRequest) (*QueryScoresResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryScores not implemented") -} -func (*UnimplementedAutopilotServer) SetScores(context.Context, *SetScoresRequest) (*SetScoresResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetScores not implemented") -} - -func RegisterAutopilotServer(s *grpc.Server, srv AutopilotServer) { - s.RegisterService(&_Autopilot_serviceDesc, srv) -} - -func _Autopilot_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutopilotServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/autopilotrpc.Autopilot/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutopilotServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autopilot_ModifyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutopilotServer).ModifyStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/autopilotrpc.Autopilot/ModifyStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutopilotServer).ModifyStatus(ctx, req.(*ModifyStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autopilot_QueryScores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryScoresRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutopilotServer).QueryScores(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/autopilotrpc.Autopilot/QueryScores", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutopilotServer).QueryScores(ctx, req.(*QueryScoresRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autopilot_SetScores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetScoresRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutopilotServer).SetScores(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/autopilotrpc.Autopilot/SetScores", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutopilotServer).SetScores(ctx, req.(*SetScoresRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Autopilot_serviceDesc = grpc.ServiceDesc{ - ServiceName: "autopilotrpc.Autopilot", - HandlerType: (*AutopilotServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Status", - Handler: _Autopilot_Status_Handler, - }, - { - MethodName: "ModifyStatus", - Handler: _Autopilot_ModifyStatus_Handler, - }, - { - MethodName: "QueryScores", - Handler: _Autopilot_QueryScores_Handler, - }, - { - MethodName: "SetScores", - Handler: _Autopilot_SetScores_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "autopilotrpc/autopilot.proto", -} diff --git a/lnrpc/autopilotrpc/autopilot.pb.gw.go b/lnrpc/autopilotrpc/autopilot.pb.gw.go index 8ec688a46..1c69c7931 100644 --- a/lnrpc/autopilotrpc/autopilot.pb.gw.go +++ b/lnrpc/autopilotrpc/autopilot.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Autopilot_Status_0(ctx context.Context, marshaler runtime.Marshaler, client AutopilotClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq StatusRequest @@ -107,7 +107,10 @@ func local_request_Autopilot_QueryScores_0(ctx context.Context, marshaler runtim var protoReq QueryScoresRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Autopilot_QueryScores_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Autopilot_QueryScores_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -153,18 +156,22 @@ func local_request_Autopilot_SetScores_0(ctx context.Context, marshaler runtime. // RegisterAutopilotHandlerServer registers the http handlers for service Autopilot to "mux". // UnaryRPC :call AutopilotServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAutopilotHandlerFromEndpoint instead. func RegisterAutopilotHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AutopilotServer) error { mux.Handle("GET", pattern_Autopilot_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/autopilotrpc.Autopilot/Status", runtime.WithHTTPPathPattern("/v2/autopilot/status")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Autopilot_Status_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -178,13 +185,16 @@ func RegisterAutopilotHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Autopilot_ModifyStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/autopilotrpc.Autopilot/ModifyStatus", runtime.WithHTTPPathPattern("/v2/autopilot/modify")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Autopilot_ModifyStatus_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -198,13 +208,16 @@ func RegisterAutopilotHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Autopilot_QueryScores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/autopilotrpc.Autopilot/QueryScores", runtime.WithHTTPPathPattern("/v2/autopilot/scores")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Autopilot_QueryScores_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -218,13 +231,16 @@ func RegisterAutopilotHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Autopilot_SetScores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/autopilotrpc.Autopilot/SetScores", runtime.WithHTTPPathPattern("/v2/autopilot/scores")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Autopilot_SetScores_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -280,7 +296,7 @@ func RegisterAutopilotHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/autopilotrpc.Autopilot/Status", runtime.WithHTTPPathPattern("/v2/autopilot/status")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -300,7 +316,7 @@ func RegisterAutopilotHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/autopilotrpc.Autopilot/ModifyStatus", runtime.WithHTTPPathPattern("/v2/autopilot/modify")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -320,7 +336,7 @@ func RegisterAutopilotHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/autopilotrpc.Autopilot/QueryScores", runtime.WithHTTPPathPattern("/v2/autopilot/scores")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -340,7 +356,7 @@ func RegisterAutopilotHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/autopilotrpc.Autopilot/SetScores", runtime.WithHTTPPathPattern("/v2/autopilot/scores")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -360,13 +376,13 @@ func RegisterAutopilotHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_Autopilot_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "status"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Autopilot_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "status"}, "")) - pattern_Autopilot_ModifyStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "modify"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Autopilot_ModifyStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "modify"}, "")) - pattern_Autopilot_QueryScores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "scores"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Autopilot_QueryScores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "scores"}, "")) - pattern_Autopilot_SetScores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "scores"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Autopilot_SetScores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "autopilot", "scores"}, "")) ) var ( diff --git a/lnrpc/autopilotrpc/autopilot.swagger.json b/lnrpc/autopilotrpc/autopilot.swagger.json index 0149810ce..5462f9dfc 100644 --- a/lnrpc/autopilotrpc/autopilot.swagger.json +++ b/lnrpc/autopilotrpc/autopilot.swagger.json @@ -4,6 +4,11 @@ "title": "autopilotrpc/autopilot.proto", "version": "version not set" }, + "tags": [ + { + "name": "Autopilot" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/autopilot/modify": { "post": { "summary": "ModifyStatus is used to modify the status of the autopilot agent, like\nenabling or disabling it.", - "operationId": "ModifyStatus", + "operationId": "Autopilot_ModifyStatus", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -47,7 +52,7 @@ "/v2/autopilot/scores": { "get": { "summary": "QueryScores queries all available autopilot heuristics, in addition to any\nactive combination of these heruristics, for the scores they would give to\nthe given nodes.", - "operationId": "QueryScores", + "operationId": "Autopilot_QueryScores", "responses": { "200": { "description": "A successful response.", @@ -56,9 +61,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -78,8 +83,7 @@ "description": "If set, we will ignore the local channel state when calculating scores.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -88,7 +92,7 @@ }, "post": { "summary": "SetScores attempts to set the scores used by the running autopilot agent,\nif the external scoring heuristic is enabled.", - "operationId": "SetScores", + "operationId": "Autopilot_SetScores", "responses": { "200": { "description": "A successful response.", @@ -97,9 +101,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -121,7 +125,7 @@ "/v2/autopilot/status": { "get": { "summary": "Status returns whether the daemon's autopilot agent is active.", - "operationId": "Status", + "operationId": "Autopilot_Status", "responses": { "200": { "description": "A successful response.", @@ -130,9 +134,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -163,7 +167,6 @@ "properties": { "enable": { "type": "boolean", - "format": "boolean", "description": "Whether the autopilot agent should be enabled or not." } } @@ -207,7 +210,6 @@ "properties": { "active": { "type": "boolean", - "format": "boolean", "description": "Indicates whether the autopilot is active or not." } } @@ -224,12 +226,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" diff --git a/lnrpc/autopilotrpc/autopilot_grpc.pb.go b/lnrpc/autopilotrpc/autopilot_grpc.pb.go new file mode 100644 index 000000000..20d8113a6 --- /dev/null +++ b/lnrpc/autopilotrpc/autopilot_grpc.pb.go @@ -0,0 +1,233 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package autopilotrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AutopilotClient is the client API for Autopilot service. +// +// 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 AutopilotClient interface { + // + //Status returns whether the daemon's autopilot agent is active. + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) + // + //ModifyStatus is used to modify the status of the autopilot agent, like + //enabling or disabling it. + ModifyStatus(ctx context.Context, in *ModifyStatusRequest, opts ...grpc.CallOption) (*ModifyStatusResponse, error) + // + //QueryScores queries all available autopilot heuristics, in addition to any + //active combination of these heruristics, for the scores they would give to + //the given nodes. + QueryScores(ctx context.Context, in *QueryScoresRequest, opts ...grpc.CallOption) (*QueryScoresResponse, error) + // + //SetScores attempts to set the scores used by the running autopilot agent, + //if the external scoring heuristic is enabled. + SetScores(ctx context.Context, in *SetScoresRequest, opts ...grpc.CallOption) (*SetScoresResponse, error) +} + +type autopilotClient struct { + cc grpc.ClientConnInterface +} + +func NewAutopilotClient(cc grpc.ClientConnInterface) AutopilotClient { + return &autopilotClient{cc} +} + +func (c *autopilotClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autopilotClient) ModifyStatus(ctx context.Context, in *ModifyStatusRequest, opts ...grpc.CallOption) (*ModifyStatusResponse, error) { + out := new(ModifyStatusResponse) + err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/ModifyStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autopilotClient) QueryScores(ctx context.Context, in *QueryScoresRequest, opts ...grpc.CallOption) (*QueryScoresResponse, error) { + out := new(QueryScoresResponse) + err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/QueryScores", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autopilotClient) SetScores(ctx context.Context, in *SetScoresRequest, opts ...grpc.CallOption) (*SetScoresResponse, error) { + out := new(SetScoresResponse) + err := c.cc.Invoke(ctx, "/autopilotrpc.Autopilot/SetScores", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AutopilotServer is the server API for Autopilot service. +// All implementations must embed UnimplementedAutopilotServer +// for forward compatibility +type AutopilotServer interface { + // + //Status returns whether the daemon's autopilot agent is active. + Status(context.Context, *StatusRequest) (*StatusResponse, error) + // + //ModifyStatus is used to modify the status of the autopilot agent, like + //enabling or disabling it. + ModifyStatus(context.Context, *ModifyStatusRequest) (*ModifyStatusResponse, error) + // + //QueryScores queries all available autopilot heuristics, in addition to any + //active combination of these heruristics, for the scores they would give to + //the given nodes. + QueryScores(context.Context, *QueryScoresRequest) (*QueryScoresResponse, error) + // + //SetScores attempts to set the scores used by the running autopilot agent, + //if the external scoring heuristic is enabled. + SetScores(context.Context, *SetScoresRequest) (*SetScoresResponse, error) + mustEmbedUnimplementedAutopilotServer() +} + +// UnimplementedAutopilotServer must be embedded to have forward compatible implementations. +type UnimplementedAutopilotServer struct { +} + +func (UnimplementedAutopilotServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (UnimplementedAutopilotServer) ModifyStatus(context.Context, *ModifyStatusRequest) (*ModifyStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModifyStatus not implemented") +} +func (UnimplementedAutopilotServer) QueryScores(context.Context, *QueryScoresRequest) (*QueryScoresResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryScores not implemented") +} +func (UnimplementedAutopilotServer) SetScores(context.Context, *SetScoresRequest) (*SetScoresResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetScores not implemented") +} +func (UnimplementedAutopilotServer) mustEmbedUnimplementedAutopilotServer() {} + +// UnsafeAutopilotServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AutopilotServer will +// result in compilation errors. +type UnsafeAutopilotServer interface { + mustEmbedUnimplementedAutopilotServer() +} + +func RegisterAutopilotServer(s grpc.ServiceRegistrar, srv AutopilotServer) { + s.RegisterService(&Autopilot_ServiceDesc, srv) +} + +func _Autopilot_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/autopilotrpc.Autopilot/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autopilot_ModifyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).ModifyStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/autopilotrpc.Autopilot/ModifyStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).ModifyStatus(ctx, req.(*ModifyStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autopilot_QueryScores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryScoresRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).QueryScores(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/autopilotrpc.Autopilot/QueryScores", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).QueryScores(ctx, req.(*QueryScoresRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autopilot_SetScores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetScoresRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).SetScores(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/autopilotrpc.Autopilot/SetScores", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).SetScores(ctx, req.(*SetScoresRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Autopilot_ServiceDesc is the grpc.ServiceDesc for Autopilot service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Autopilot_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "autopilotrpc.Autopilot", + HandlerType: (*AutopilotServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Status", + Handler: _Autopilot_Status_Handler, + }, + { + MethodName: "ModifyStatus", + Handler: _Autopilot_ModifyStatus_Handler, + }, + { + MethodName: "QueryScores", + Handler: _Autopilot_QueryScores_Handler, + }, + { + MethodName: "SetScores", + Handler: _Autopilot_SetScores_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "autopilotrpc/autopilot.proto", +} diff --git a/lnrpc/autopilotrpc/autopilot_server.go b/lnrpc/autopilotrpc/autopilot_server.go index b3ece6cbf..215f14f8d 100644 --- a/lnrpc/autopilotrpc/autopilot_server.go +++ b/lnrpc/autopilotrpc/autopilot_server.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "github.com/btcsuite/btcd/btcec" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/autopilot" "github.com/lightningnetwork/lnd/lnrpc" "google.golang.org/grpc" @@ -65,6 +65,11 @@ type Server struct { started int32 // To be used atomically. shutdown int32 // To be used atomically. + // Required by the grpc-gateway/v2 library for forward compatibility. + // Must be after the atomically used variables to not break struct + // alignment. + UnimplementedAutopilotServer + cfg *Config manager *autopilot.Manager diff --git a/lnrpc/chainrpc/chainnotifier.pb.go b/lnrpc/chainrpc/chainnotifier.pb.go index 953c5211a..46416767e 100644 --- a/lnrpc/chainrpc/chainnotifier.pb.go +++ b/lnrpc/chainrpc/chainnotifier.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: chainrpc/chainnotifier.proto package chainrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type ConfRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -948,286 +939,3 @@ func file_chainrpc_chainnotifier_proto_init() { file_chainrpc_chainnotifier_proto_goTypes = nil file_chainrpc_chainnotifier_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ChainNotifierClient is the client API for ChainNotifier service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ChainNotifierClient interface { - // - //RegisterConfirmationsNtfn is a synchronous response-streaming RPC that - //registers an intent for a client to be notified once a confirmation request - //has reached its required number of confirmations on-chain. - // - //A client can specify whether the confirmation request should be for a - //particular transaction by its hash or for an output script by specifying a - //zero hash. - RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error) - // - //RegisterSpendNtfn is a synchronous response-streaming RPC that registers an - //intent for a client to be notification once a spend request has been spent - //by a transaction that has confirmed on-chain. - // - //A client can specify whether the spend request should be for a particular - //outpoint or for an output script by specifying a zero outpoint. - RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error) - // - //RegisterBlockEpochNtfn is a synchronous response-streaming RPC that - //registers an intent for a client to be notified of blocks in the chain. The - //stream will return a hash and height tuple of a block for each new/stale - //block in the chain. It is the client's responsibility to determine whether - //the tuple returned is for a new or stale block in the chain. - // - //A client can also request a historical backlog of blocks from a particular - //point. This allows clients to be idempotent by ensuring that they do not - //missing processing a single block within the chain. - RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error) -} - -type chainNotifierClient struct { - cc grpc.ClientConnInterface -} - -func NewChainNotifierClient(cc grpc.ClientConnInterface) ChainNotifierClient { - return &chainNotifierClient{cc} -} - -func (c *chainNotifierClient) RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error) { - stream, err := c.cc.NewStream(ctx, &_ChainNotifier_serviceDesc.Streams[0], "/chainrpc.ChainNotifier/RegisterConfirmationsNtfn", opts...) - if err != nil { - return nil, err - } - x := &chainNotifierRegisterConfirmationsNtfnClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type ChainNotifier_RegisterConfirmationsNtfnClient interface { - Recv() (*ConfEvent, error) - grpc.ClientStream -} - -type chainNotifierRegisterConfirmationsNtfnClient struct { - grpc.ClientStream -} - -func (x *chainNotifierRegisterConfirmationsNtfnClient) Recv() (*ConfEvent, error) { - m := new(ConfEvent) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *chainNotifierClient) RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error) { - stream, err := c.cc.NewStream(ctx, &_ChainNotifier_serviceDesc.Streams[1], "/chainrpc.ChainNotifier/RegisterSpendNtfn", opts...) - if err != nil { - return nil, err - } - x := &chainNotifierRegisterSpendNtfnClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type ChainNotifier_RegisterSpendNtfnClient interface { - Recv() (*SpendEvent, error) - grpc.ClientStream -} - -type chainNotifierRegisterSpendNtfnClient struct { - grpc.ClientStream -} - -func (x *chainNotifierRegisterSpendNtfnClient) Recv() (*SpendEvent, error) { - m := new(SpendEvent) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *chainNotifierClient) RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error) { - stream, err := c.cc.NewStream(ctx, &_ChainNotifier_serviceDesc.Streams[2], "/chainrpc.ChainNotifier/RegisterBlockEpochNtfn", opts...) - if err != nil { - return nil, err - } - x := &chainNotifierRegisterBlockEpochNtfnClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type ChainNotifier_RegisterBlockEpochNtfnClient interface { - Recv() (*BlockEpoch, error) - grpc.ClientStream -} - -type chainNotifierRegisterBlockEpochNtfnClient struct { - grpc.ClientStream -} - -func (x *chainNotifierRegisterBlockEpochNtfnClient) Recv() (*BlockEpoch, error) { - m := new(BlockEpoch) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ChainNotifierServer is the server API for ChainNotifier service. -type ChainNotifierServer interface { - // - //RegisterConfirmationsNtfn is a synchronous response-streaming RPC that - //registers an intent for a client to be notified once a confirmation request - //has reached its required number of confirmations on-chain. - // - //A client can specify whether the confirmation request should be for a - //particular transaction by its hash or for an output script by specifying a - //zero hash. - RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error - // - //RegisterSpendNtfn is a synchronous response-streaming RPC that registers an - //intent for a client to be notification once a spend request has been spent - //by a transaction that has confirmed on-chain. - // - //A client can specify whether the spend request should be for a particular - //outpoint or for an output script by specifying a zero outpoint. - RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error - // - //RegisterBlockEpochNtfn is a synchronous response-streaming RPC that - //registers an intent for a client to be notified of blocks in the chain. The - //stream will return a hash and height tuple of a block for each new/stale - //block in the chain. It is the client's responsibility to determine whether - //the tuple returned is for a new or stale block in the chain. - // - //A client can also request a historical backlog of blocks from a particular - //point. This allows clients to be idempotent by ensuring that they do not - //missing processing a single block within the chain. - RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error -} - -// UnimplementedChainNotifierServer can be embedded to have forward compatible implementations. -type UnimplementedChainNotifierServer struct { -} - -func (*UnimplementedChainNotifierServer) RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error { - return status.Errorf(codes.Unimplemented, "method RegisterConfirmationsNtfn not implemented") -} -func (*UnimplementedChainNotifierServer) RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error { - return status.Errorf(codes.Unimplemented, "method RegisterSpendNtfn not implemented") -} -func (*UnimplementedChainNotifierServer) RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error { - return status.Errorf(codes.Unimplemented, "method RegisterBlockEpochNtfn not implemented") -} - -func RegisterChainNotifierServer(s *grpc.Server, srv ChainNotifierServer) { - s.RegisterService(&_ChainNotifier_serviceDesc, srv) -} - -func _ChainNotifier_RegisterConfirmationsNtfn_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ConfRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ChainNotifierServer).RegisterConfirmationsNtfn(m, &chainNotifierRegisterConfirmationsNtfnServer{stream}) -} - -type ChainNotifier_RegisterConfirmationsNtfnServer interface { - Send(*ConfEvent) error - grpc.ServerStream -} - -type chainNotifierRegisterConfirmationsNtfnServer struct { - grpc.ServerStream -} - -func (x *chainNotifierRegisterConfirmationsNtfnServer) Send(m *ConfEvent) error { - return x.ServerStream.SendMsg(m) -} - -func _ChainNotifier_RegisterSpendNtfn_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SpendRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ChainNotifierServer).RegisterSpendNtfn(m, &chainNotifierRegisterSpendNtfnServer{stream}) -} - -type ChainNotifier_RegisterSpendNtfnServer interface { - Send(*SpendEvent) error - grpc.ServerStream -} - -type chainNotifierRegisterSpendNtfnServer struct { - grpc.ServerStream -} - -func (x *chainNotifierRegisterSpendNtfnServer) Send(m *SpendEvent) error { - return x.ServerStream.SendMsg(m) -} - -func _ChainNotifier_RegisterBlockEpochNtfn_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(BlockEpoch) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ChainNotifierServer).RegisterBlockEpochNtfn(m, &chainNotifierRegisterBlockEpochNtfnServer{stream}) -} - -type ChainNotifier_RegisterBlockEpochNtfnServer interface { - Send(*BlockEpoch) error - grpc.ServerStream -} - -type chainNotifierRegisterBlockEpochNtfnServer struct { - grpc.ServerStream -} - -func (x *chainNotifierRegisterBlockEpochNtfnServer) Send(m *BlockEpoch) error { - return x.ServerStream.SendMsg(m) -} - -var _ChainNotifier_serviceDesc = grpc.ServiceDesc{ - ServiceName: "chainrpc.ChainNotifier", - HandlerType: (*ChainNotifierServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "RegisterConfirmationsNtfn", - Handler: _ChainNotifier_RegisterConfirmationsNtfn_Handler, - ServerStreams: true, - }, - { - StreamName: "RegisterSpendNtfn", - Handler: _ChainNotifier_RegisterSpendNtfn_Handler, - ServerStreams: true, - }, - { - StreamName: "RegisterBlockEpochNtfn", - Handler: _ChainNotifier_RegisterBlockEpochNtfn_Handler, - ServerStreams: true, - }, - }, - Metadata: "chainrpc/chainnotifier.proto", -} diff --git a/lnrpc/chainrpc/chainnotifier.pb.gw.go b/lnrpc/chainrpc/chainnotifier.pb.gw.go index 1d6e496a2..cd2de4227 100644 --- a/lnrpc/chainrpc/chainnotifier.pb.gw.go +++ b/lnrpc/chainrpc/chainnotifier.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_ChainNotifier_RegisterConfirmationsNtfn_0(ctx context.Context, marshaler runtime.Marshaler, client ChainNotifierClient, req *http.Request, pathParams map[string]string) (ChainNotifier_RegisterConfirmationsNtfnClient, runtime.ServerMetadata, error) { var protoReq ConfRequest @@ -109,6 +109,7 @@ func request_ChainNotifier_RegisterBlockEpochNtfn_0(ctx context.Context, marshal // RegisterChainNotifierHandlerServer registers the http handlers for service ChainNotifier to "mux". // UnaryRPC :call ChainNotifierServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChainNotifierHandlerFromEndpoint instead. func RegisterChainNotifierHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChainNotifierServer) error { mux.Handle("POST", pattern_ChainNotifier_RegisterConfirmationsNtfn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -177,7 +178,7 @@ func RegisterChainNotifierHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/chainrpc.ChainNotifier/RegisterConfirmationsNtfn", runtime.WithHTTPPathPattern("/v2/chainnotifier/register/confirmations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -197,7 +198,7 @@ func RegisterChainNotifierHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/chainrpc.ChainNotifier/RegisterSpendNtfn", runtime.WithHTTPPathPattern("/v2/chainnotifier/register/spends")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -217,7 +218,7 @@ func RegisterChainNotifierHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/chainrpc.ChainNotifier/RegisterBlockEpochNtfn", runtime.WithHTTPPathPattern("/v2/chainnotifier/register/blocks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -237,11 +238,11 @@ func RegisterChainNotifierHandlerClient(ctx context.Context, mux *runtime.ServeM } var ( - pattern_ChainNotifier_RegisterConfirmationsNtfn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "chainnotifier", "register", "confirmations"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ChainNotifier_RegisterConfirmationsNtfn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "chainnotifier", "register", "confirmations"}, "")) - pattern_ChainNotifier_RegisterSpendNtfn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "chainnotifier", "register", "spends"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ChainNotifier_RegisterSpendNtfn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "chainnotifier", "register", "spends"}, "")) - pattern_ChainNotifier_RegisterBlockEpochNtfn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "chainnotifier", "register", "blocks"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ChainNotifier_RegisterBlockEpochNtfn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "chainnotifier", "register", "blocks"}, "")) ) var ( diff --git a/lnrpc/chainrpc/chainnotifier.swagger.json b/lnrpc/chainrpc/chainnotifier.swagger.json index c6999b94d..ee684f169 100644 --- a/lnrpc/chainrpc/chainnotifier.swagger.json +++ b/lnrpc/chainrpc/chainnotifier.swagger.json @@ -4,6 +4,11 @@ "title": "chainrpc/chainnotifier.proto", "version": "version not set" }, + "tags": [ + { + "name": "ChainNotifier" + } + ], "consumes": [ "application/json" ], @@ -15,7 +20,7 @@ "post": { "summary": "RegisterBlockEpochNtfn is a synchronous response-streaming RPC that\nregisters an intent for a client to be notified of blocks in the chain. The\nstream will return a hash and height tuple of a block for each new/stale\nblock in the chain. It is the client's responsibility to determine whether\nthe tuple returned is for a new or stale block in the chain.", "description": "A client can also request a historical backlog of blocks from a particular\npoint. This allows clients to be idempotent by ensuring that they do not\nmissing processing a single block within the chain.", - "operationId": "RegisterBlockEpochNtfn", + "operationId": "ChainNotifier_RegisterBlockEpochNtfn", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -26,16 +31,16 @@ "$ref": "#/definitions/chainrpcBlockEpoch" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of chainrpcBlockEpoch" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -58,7 +63,7 @@ "post": { "summary": "RegisterConfirmationsNtfn is a synchronous response-streaming RPC that\nregisters an intent for a client to be notified once a confirmation request\nhas reached its required number of confirmations on-chain.", "description": "A client can specify whether the confirmation request should be for a\nparticular transaction by its hash or for an output script by specifying a\nzero hash.", - "operationId": "RegisterConfirmationsNtfn", + "operationId": "ChainNotifier_RegisterConfirmationsNtfn", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -69,16 +74,16 @@ "$ref": "#/definitions/chainrpcConfEvent" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of chainrpcConfEvent" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -101,7 +106,7 @@ "post": { "summary": "RegisterSpendNtfn is a synchronous response-streaming RPC that registers an\nintent for a client to be notification once a spend request has been spent\nby a transaction that has confirmed on-chain.", "description": "A client can specify whether the spend request should be for a particular\noutpoint or for an output script by specifying a zero outpoint.", - "operationId": "RegisterSpendNtfn", + "operationId": "ChainNotifier_RegisterSpendNtfn", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -112,16 +117,16 @@ "$ref": "#/definitions/chainrpcSpendEvent" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of chainrpcSpendEvent" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -311,12 +316,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -331,31 +333,6 @@ } } } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpc_code": { - "type": "integer", - "format": "int32" - }, - "http_code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "http_status": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } } } } diff --git a/lnrpc/chainrpc/chainnotifier_grpc.pb.go b/lnrpc/chainrpc/chainnotifier_grpc.pb.go new file mode 100644 index 000000000..c04140d1b --- /dev/null +++ b/lnrpc/chainrpc/chainnotifier_grpc.pb.go @@ -0,0 +1,304 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package chainrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ChainNotifierClient is the client API for ChainNotifier service. +// +// 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 ChainNotifierClient interface { + // + //RegisterConfirmationsNtfn is a synchronous response-streaming RPC that + //registers an intent for a client to be notified once a confirmation request + //has reached its required number of confirmations on-chain. + // + //A client can specify whether the confirmation request should be for a + //particular transaction by its hash or for an output script by specifying a + //zero hash. + RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error) + // + //RegisterSpendNtfn is a synchronous response-streaming RPC that registers an + //intent for a client to be notification once a spend request has been spent + //by a transaction that has confirmed on-chain. + // + //A client can specify whether the spend request should be for a particular + //outpoint or for an output script by specifying a zero outpoint. + RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error) + // + //RegisterBlockEpochNtfn is a synchronous response-streaming RPC that + //registers an intent for a client to be notified of blocks in the chain. The + //stream will return a hash and height tuple of a block for each new/stale + //block in the chain. It is the client's responsibility to determine whether + //the tuple returned is for a new or stale block in the chain. + // + //A client can also request a historical backlog of blocks from a particular + //point. This allows clients to be idempotent by ensuring that they do not + //missing processing a single block within the chain. + RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error) +} + +type chainNotifierClient struct { + cc grpc.ClientConnInterface +} + +func NewChainNotifierClient(cc grpc.ClientConnInterface) ChainNotifierClient { + return &chainNotifierClient{cc} +} + +func (c *chainNotifierClient) RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error) { + stream, err := c.cc.NewStream(ctx, &ChainNotifier_ServiceDesc.Streams[0], "/chainrpc.ChainNotifier/RegisterConfirmationsNtfn", opts...) + if err != nil { + return nil, err + } + x := &chainNotifierRegisterConfirmationsNtfnClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ChainNotifier_RegisterConfirmationsNtfnClient interface { + Recv() (*ConfEvent, error) + grpc.ClientStream +} + +type chainNotifierRegisterConfirmationsNtfnClient struct { + grpc.ClientStream +} + +func (x *chainNotifierRegisterConfirmationsNtfnClient) Recv() (*ConfEvent, error) { + m := new(ConfEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *chainNotifierClient) RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error) { + stream, err := c.cc.NewStream(ctx, &ChainNotifier_ServiceDesc.Streams[1], "/chainrpc.ChainNotifier/RegisterSpendNtfn", opts...) + if err != nil { + return nil, err + } + x := &chainNotifierRegisterSpendNtfnClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ChainNotifier_RegisterSpendNtfnClient interface { + Recv() (*SpendEvent, error) + grpc.ClientStream +} + +type chainNotifierRegisterSpendNtfnClient struct { + grpc.ClientStream +} + +func (x *chainNotifierRegisterSpendNtfnClient) Recv() (*SpendEvent, error) { + m := new(SpendEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *chainNotifierClient) RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error) { + stream, err := c.cc.NewStream(ctx, &ChainNotifier_ServiceDesc.Streams[2], "/chainrpc.ChainNotifier/RegisterBlockEpochNtfn", opts...) + if err != nil { + return nil, err + } + x := &chainNotifierRegisterBlockEpochNtfnClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ChainNotifier_RegisterBlockEpochNtfnClient interface { + Recv() (*BlockEpoch, error) + grpc.ClientStream +} + +type chainNotifierRegisterBlockEpochNtfnClient struct { + grpc.ClientStream +} + +func (x *chainNotifierRegisterBlockEpochNtfnClient) Recv() (*BlockEpoch, error) { + m := new(BlockEpoch) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ChainNotifierServer is the server API for ChainNotifier service. +// All implementations must embed UnimplementedChainNotifierServer +// for forward compatibility +type ChainNotifierServer interface { + // + //RegisterConfirmationsNtfn is a synchronous response-streaming RPC that + //registers an intent for a client to be notified once a confirmation request + //has reached its required number of confirmations on-chain. + // + //A client can specify whether the confirmation request should be for a + //particular transaction by its hash or for an output script by specifying a + //zero hash. + RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error + // + //RegisterSpendNtfn is a synchronous response-streaming RPC that registers an + //intent for a client to be notification once a spend request has been spent + //by a transaction that has confirmed on-chain. + // + //A client can specify whether the spend request should be for a particular + //outpoint or for an output script by specifying a zero outpoint. + RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error + // + //RegisterBlockEpochNtfn is a synchronous response-streaming RPC that + //registers an intent for a client to be notified of blocks in the chain. The + //stream will return a hash and height tuple of a block for each new/stale + //block in the chain. It is the client's responsibility to determine whether + //the tuple returned is for a new or stale block in the chain. + // + //A client can also request a historical backlog of blocks from a particular + //point. This allows clients to be idempotent by ensuring that they do not + //missing processing a single block within the chain. + RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error + mustEmbedUnimplementedChainNotifierServer() +} + +// UnimplementedChainNotifierServer must be embedded to have forward compatible implementations. +type UnimplementedChainNotifierServer struct { +} + +func (UnimplementedChainNotifierServer) RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error { + return status.Errorf(codes.Unimplemented, "method RegisterConfirmationsNtfn not implemented") +} +func (UnimplementedChainNotifierServer) RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error { + return status.Errorf(codes.Unimplemented, "method RegisterSpendNtfn not implemented") +} +func (UnimplementedChainNotifierServer) RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error { + return status.Errorf(codes.Unimplemented, "method RegisterBlockEpochNtfn not implemented") +} +func (UnimplementedChainNotifierServer) mustEmbedUnimplementedChainNotifierServer() {} + +// UnsafeChainNotifierServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChainNotifierServer will +// result in compilation errors. +type UnsafeChainNotifierServer interface { + mustEmbedUnimplementedChainNotifierServer() +} + +func RegisterChainNotifierServer(s grpc.ServiceRegistrar, srv ChainNotifierServer) { + s.RegisterService(&ChainNotifier_ServiceDesc, srv) +} + +func _ChainNotifier_RegisterConfirmationsNtfn_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ConfRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ChainNotifierServer).RegisterConfirmationsNtfn(m, &chainNotifierRegisterConfirmationsNtfnServer{stream}) +} + +type ChainNotifier_RegisterConfirmationsNtfnServer interface { + Send(*ConfEvent) error + grpc.ServerStream +} + +type chainNotifierRegisterConfirmationsNtfnServer struct { + grpc.ServerStream +} + +func (x *chainNotifierRegisterConfirmationsNtfnServer) Send(m *ConfEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _ChainNotifier_RegisterSpendNtfn_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SpendRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ChainNotifierServer).RegisterSpendNtfn(m, &chainNotifierRegisterSpendNtfnServer{stream}) +} + +type ChainNotifier_RegisterSpendNtfnServer interface { + Send(*SpendEvent) error + grpc.ServerStream +} + +type chainNotifierRegisterSpendNtfnServer struct { + grpc.ServerStream +} + +func (x *chainNotifierRegisterSpendNtfnServer) Send(m *SpendEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _ChainNotifier_RegisterBlockEpochNtfn_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BlockEpoch) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ChainNotifierServer).RegisterBlockEpochNtfn(m, &chainNotifierRegisterBlockEpochNtfnServer{stream}) +} + +type ChainNotifier_RegisterBlockEpochNtfnServer interface { + Send(*BlockEpoch) error + grpc.ServerStream +} + +type chainNotifierRegisterBlockEpochNtfnServer struct { + grpc.ServerStream +} + +func (x *chainNotifierRegisterBlockEpochNtfnServer) Send(m *BlockEpoch) error { + return x.ServerStream.SendMsg(m) +} + +// ChainNotifier_ServiceDesc is the grpc.ServiceDesc for ChainNotifier service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ChainNotifier_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "chainrpc.ChainNotifier", + HandlerType: (*ChainNotifierServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "RegisterConfirmationsNtfn", + Handler: _ChainNotifier_RegisterConfirmationsNtfn_Handler, + ServerStreams: true, + }, + { + StreamName: "RegisterSpendNtfn", + Handler: _ChainNotifier_RegisterSpendNtfn_Handler, + ServerStreams: true, + }, + { + StreamName: "RegisterBlockEpochNtfn", + Handler: _ChainNotifier_RegisterBlockEpochNtfn_Handler, + ServerStreams: true, + }, + }, + Metadata: "chainrpc/chainnotifier.proto", +} diff --git a/lnrpc/chainrpc/chainnotifier_server.go b/lnrpc/chainrpc/chainnotifier_server.go index 80f3c0ea9..a819a5d50 100644 --- a/lnrpc/chainrpc/chainnotifier_server.go +++ b/lnrpc/chainrpc/chainnotifier_server.go @@ -13,7 +13,7 @@ import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/macaroons" @@ -85,6 +85,9 @@ type ServerShell struct { // to lnd, even backed by multiple distinct lnd across independent failure // domains. type Server struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedChainNotifierServer + started sync.Once stopped sync.Once diff --git a/lnrpc/gen_protos.sh b/lnrpc/gen_protos.sh index af8b65532..d6e0e837a 100755 --- a/lnrpc/gen_protos.sh +++ b/lnrpc/gen_protos.sh @@ -5,30 +5,36 @@ set -e # generate compiles the *.pb.go stubs from the *.proto files. function generate() { echo "Generating root gRPC server protos" - + PROTOS="lightning.proto walletunlocker.proto stateservice.proto **/*.proto" - + # For each of the sub-servers, we then generate their protos, but a restricted # set as they don't yet require REST proxies, or swagger docs. for file in $PROTOS; do DIRECTORY=$(dirname "${file}") echo "Generating protos from ${file}, into ${DIRECTORY}" - + # Generate the protos. protoc -I/usr/local/include -I. \ - --go_out=plugins=grpc,paths=source_relative:. \ + --go_out . --go_opt paths=source_relative \ + --go-grpc_out . --go-grpc_opt paths=source_relative \ "${file}" - + # Generate the REST reverse proxy. annotationsFile=${file//proto/yaml} protoc -I/usr/local/include -I. \ - --grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=${annotationsFile}:. \ + --grpc-gateway_out . \ + --grpc-gateway_opt logtostderr=true \ + --grpc-gateway_opt paths=source_relative \ + --grpc-gateway_opt grpc_api_configuration=${annotationsFile} \ "${file}" - - + # Finally, generate the swagger file which describes the REST API in detail. protoc -I/usr/local/include -I. \ - --swagger_out=logtostderr=true,grpc_api_configuration=${annotationsFile}:. \ + --openapiv2_out . \ + --openapiv2_opt logtostderr=true \ + --openapiv2_opt grpc_api_configuration=${annotationsFile} \ + --openapiv2_opt json_names_for_fields=false \ "${file}" done } diff --git a/lnrpc/gen_protos_docker.sh b/lnrpc/gen_protos_docker.sh index adad5de3e..0e06bb9da 100755 --- a/lnrpc/gen_protos_docker.sh +++ b/lnrpc/gen_protos_docker.sh @@ -5,12 +5,12 @@ set -e # Directory of the script file, independent of where it's called from. DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" -PROTOC_GEN_VERSION=$(go list -f '{{.Version}}' -m github.com/golang/protobuf) -GRPC_GATEWAY_VERSION=$(go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway) +PROTOBUF_VERSION=$(go list -f '{{.Version}}' -m google.golang.org/protobuf) +GRPC_GATEWAY_VERSION=$(go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway/v2) echo "Building protobuf compiler docker image..." docker build -t lnd-protobuf-builder \ - --build-arg PROTOC_GEN_VERSION="$PROTOC_GEN_VERSION" \ + --build-arg PROTOBUF_VERSION="$PROTOBUF_VERSION" \ --build-arg GRPC_GATEWAY_VERSION="$GRPC_GATEWAY_VERSION" \ . diff --git a/lnrpc/invoicesrpc/invoices.pb.go b/lnrpc/invoicesrpc/invoices.pb.go index 2cac2a071..a2e804a98 100644 --- a/lnrpc/invoicesrpc/invoices.pb.go +++ b/lnrpc/invoicesrpc/invoices.pb.go @@ -1,18 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: invoicesrpc/invoices.proto package invoicesrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" lnrpc "github.com/lightningnetwork/lnd/lnrpc" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -26,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type CancelInvoiceMsg struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -698,247 +689,3 @@ func file_invoicesrpc_invoices_proto_init() { file_invoicesrpc_invoices_proto_goTypes = nil file_invoicesrpc_invoices_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// InvoicesClient is the client API for Invoices service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type InvoicesClient interface { - // - //SubscribeSingleInvoice returns a uni-directional stream (server -> client) - //to notify the client of state transitions of the specified invoice. - //Initially the current invoice state is always sent out. - SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) - // - //CancelInvoice cancels a currently open invoice. If the invoice is already - //canceled, this call will succeed. If the invoice is already settled, it will - //fail. - CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error) - // - //AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - //supplied in the request. - AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error) - // - //SettleInvoice settles an accepted invoice. If the invoice is already - //settled, this call will succeed. - SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error) -} - -type invoicesClient struct { - cc grpc.ClientConnInterface -} - -func NewInvoicesClient(cc grpc.ClientConnInterface) InvoicesClient { - return &invoicesClient{cc} -} - -func (c *invoicesClient) SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) { - stream, err := c.cc.NewStream(ctx, &_Invoices_serviceDesc.Streams[0], "/invoicesrpc.Invoices/SubscribeSingleInvoice", opts...) - if err != nil { - return nil, err - } - x := &invoicesSubscribeSingleInvoiceClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Invoices_SubscribeSingleInvoiceClient interface { - Recv() (*lnrpc.Invoice, error) - grpc.ClientStream -} - -type invoicesSubscribeSingleInvoiceClient struct { - grpc.ClientStream -} - -func (x *invoicesSubscribeSingleInvoiceClient) Recv() (*lnrpc.Invoice, error) { - m := new(lnrpc.Invoice) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *invoicesClient) CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error) { - out := new(CancelInvoiceResp) - err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/CancelInvoice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *invoicesClient) AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error) { - out := new(AddHoldInvoiceResp) - err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/AddHoldInvoice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *invoicesClient) SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error) { - out := new(SettleInvoiceResp) - err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/SettleInvoice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// InvoicesServer is the server API for Invoices service. -type InvoicesServer interface { - // - //SubscribeSingleInvoice returns a uni-directional stream (server -> client) - //to notify the client of state transitions of the specified invoice. - //Initially the current invoice state is always sent out. - SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error - // - //CancelInvoice cancels a currently open invoice. If the invoice is already - //canceled, this call will succeed. If the invoice is already settled, it will - //fail. - CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error) - // - //AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - //supplied in the request. - AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error) - // - //SettleInvoice settles an accepted invoice. If the invoice is already - //settled, this call will succeed. - SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error) -} - -// UnimplementedInvoicesServer can be embedded to have forward compatible implementations. -type UnimplementedInvoicesServer struct { -} - -func (*UnimplementedInvoicesServer) SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeSingleInvoice not implemented") -} -func (*UnimplementedInvoicesServer) CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CancelInvoice not implemented") -} -func (*UnimplementedInvoicesServer) AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddHoldInvoice not implemented") -} -func (*UnimplementedInvoicesServer) SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SettleInvoice not implemented") -} - -func RegisterInvoicesServer(s *grpc.Server, srv InvoicesServer) { - s.RegisterService(&_Invoices_serviceDesc, srv) -} - -func _Invoices_SubscribeSingleInvoice_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeSingleInvoiceRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(InvoicesServer).SubscribeSingleInvoice(m, &invoicesSubscribeSingleInvoiceServer{stream}) -} - -type Invoices_SubscribeSingleInvoiceServer interface { - Send(*lnrpc.Invoice) error - grpc.ServerStream -} - -type invoicesSubscribeSingleInvoiceServer struct { - grpc.ServerStream -} - -func (x *invoicesSubscribeSingleInvoiceServer) Send(m *lnrpc.Invoice) error { - return x.ServerStream.SendMsg(m) -} - -func _Invoices_CancelInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelInvoiceMsg) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InvoicesServer).CancelInvoice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/invoicesrpc.Invoices/CancelInvoice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InvoicesServer).CancelInvoice(ctx, req.(*CancelInvoiceMsg)) - } - return interceptor(ctx, in, info, handler) -} - -func _Invoices_AddHoldInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddHoldInvoiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InvoicesServer).AddHoldInvoice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/invoicesrpc.Invoices/AddHoldInvoice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InvoicesServer).AddHoldInvoice(ctx, req.(*AddHoldInvoiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Invoices_SettleInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SettleInvoiceMsg) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InvoicesServer).SettleInvoice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/invoicesrpc.Invoices/SettleInvoice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InvoicesServer).SettleInvoice(ctx, req.(*SettleInvoiceMsg)) - } - return interceptor(ctx, in, info, handler) -} - -var _Invoices_serviceDesc = grpc.ServiceDesc{ - ServiceName: "invoicesrpc.Invoices", - HandlerType: (*InvoicesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CancelInvoice", - Handler: _Invoices_CancelInvoice_Handler, - }, - { - MethodName: "AddHoldInvoice", - Handler: _Invoices_AddHoldInvoice_Handler, - }, - { - MethodName: "SettleInvoice", - Handler: _Invoices_SettleInvoice_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SubscribeSingleInvoice", - Handler: _Invoices_SubscribeSingleInvoice_Handler, - ServerStreams: true, - }, - }, - Metadata: "invoicesrpc/invoices.proto", -} diff --git a/lnrpc/invoicesrpc/invoices.pb.gw.go b/lnrpc/invoicesrpc/invoices.pb.gw.go index 139882654..4cd995969 100644 --- a/lnrpc/invoicesrpc/invoices.pb.gw.go +++ b/lnrpc/invoicesrpc/invoices.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Invoices_SubscribeSingleInvoice_0(ctx context.Context, marshaler runtime.Marshaler, client InvoicesClient, req *http.Request, pathParams map[string]string) (Invoices_SubscribeSingleInvoiceClient, runtime.ServerMetadata, error) { var protoReq SubscribeSingleInvoiceRequest @@ -48,7 +48,6 @@ func request_Invoices_SubscribeSingleInvoice_0(ctx context.Context, marshaler ru } protoReq.RHash, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "r_hash", err) } @@ -171,6 +170,7 @@ func local_request_Invoices_SettleInvoice_0(ctx context.Context, marshaler runti // RegisterInvoicesHandlerServer registers the http handlers for service Invoices to "mux". // UnaryRPC :call InvoicesServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInvoicesHandlerFromEndpoint instead. func RegisterInvoicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InvoicesServer) error { mux.Handle("GET", pattern_Invoices_SubscribeSingleInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -183,13 +183,16 @@ func RegisterInvoicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, s mux.Handle("POST", pattern_Invoices_CancelInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/invoicesrpc.Invoices/CancelInvoice", runtime.WithHTTPPathPattern("/v2/invoices/cancel")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Invoices_CancelInvoice_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -203,13 +206,16 @@ func RegisterInvoicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, s mux.Handle("POST", pattern_Invoices_AddHoldInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/invoicesrpc.Invoices/AddHoldInvoice", runtime.WithHTTPPathPattern("/v2/invoices/hodl")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Invoices_AddHoldInvoice_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -223,13 +229,16 @@ func RegisterInvoicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, s mux.Handle("POST", pattern_Invoices_SettleInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/invoicesrpc.Invoices/SettleInvoice", runtime.WithHTTPPathPattern("/v2/invoices/settle")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Invoices_SettleInvoice_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -285,7 +294,7 @@ func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/invoicesrpc.Invoices/SubscribeSingleInvoice", runtime.WithHTTPPathPattern("/v2/invoices/subscribe/{r_hash}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -305,7 +314,7 @@ func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/invoicesrpc.Invoices/CancelInvoice", runtime.WithHTTPPathPattern("/v2/invoices/cancel")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -325,7 +334,7 @@ func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/invoicesrpc.Invoices/AddHoldInvoice", runtime.WithHTTPPathPattern("/v2/invoices/hodl")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -345,7 +354,7 @@ func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/invoicesrpc.Invoices/SettleInvoice", runtime.WithHTTPPathPattern("/v2/invoices/settle")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -365,13 +374,13 @@ func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c } var ( - pattern_Invoices_SubscribeSingleInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "invoices", "subscribe", "r_hash"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Invoices_SubscribeSingleInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "invoices", "subscribe", "r_hash"}, "")) - pattern_Invoices_CancelInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "invoices", "cancel"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Invoices_CancelInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "invoices", "cancel"}, "")) - pattern_Invoices_AddHoldInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "invoices", "hodl"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Invoices_AddHoldInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "invoices", "hodl"}, "")) - pattern_Invoices_SettleInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "invoices", "settle"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Invoices_SettleInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "invoices", "settle"}, "")) ) var ( diff --git a/lnrpc/invoicesrpc/invoices.swagger.json b/lnrpc/invoicesrpc/invoices.swagger.json index 4548eed71..7a7d0b3f3 100644 --- a/lnrpc/invoicesrpc/invoices.swagger.json +++ b/lnrpc/invoicesrpc/invoices.swagger.json @@ -4,6 +4,11 @@ "title": "invoicesrpc/invoices.proto", "version": "version not set" }, + "tags": [ + { + "name": "Invoices" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/invoices/cancel": { "post": { "summary": "CancelInvoice cancels a currently open invoice. If the invoice is already\ncanceled, this call will succeed. If the invoice is already settled, it will\nfail.", - "operationId": "CancelInvoice", + "operationId": "Invoices_CancelInvoice", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -47,7 +52,7 @@ "/v2/invoices/hodl": { "post": { "summary": "AddHoldInvoice creates a hold invoice. It ties the invoice to the hash\nsupplied in the request.", - "operationId": "AddHoldInvoice", + "operationId": "Invoices_AddHoldInvoice", "responses": { "200": { "description": "A successful response.", @@ -56,9 +61,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -80,7 +85,7 @@ "/v2/invoices/settle": { "post": { "summary": "SettleInvoice settles an accepted invoice. If the invoice is already\nsettled, this call will succeed.", - "operationId": "SettleInvoice", + "operationId": "Invoices_SettleInvoice", "responses": { "200": { "description": "A successful response.", @@ -89,9 +94,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -113,7 +118,7 @@ "/v2/invoices/subscribe/{r_hash}": { "get": { "summary": "SubscribeSingleInvoice returns a uni-directional stream (server -\u003e client)\nto notify the client of state transitions of the specified invoice.\nInitially the current invoice state is always sent out.", - "operationId": "SubscribeSingleInvoice", + "operationId": "Invoices_SubscribeSingleInvoice", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -124,16 +129,16 @@ "$ref": "#/definitions/lnrpcInvoice" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcInvoice" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -216,7 +221,6 @@ }, "private": { "type": "boolean", - "format": "boolean", "description": "Whether this invoice should include routing hints for private channels." } } @@ -304,12 +308,10 @@ "type": "string" }, "is_required": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "is_known": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -373,7 +375,6 @@ }, "settled": { "type": "boolean", - "format": "boolean", "title": "Whether this invoice has been fulfilled" }, "creation_date": { @@ -418,7 +419,6 @@ }, "private": { "type": "boolean", - "format": "boolean", "description": "Whether this invoice should include routing hints for private channels." }, "add_index": { @@ -466,7 +466,6 @@ }, "is_keysend": { "type": "boolean", - "format": "boolean", "description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]." }, "payment_addr": { @@ -476,7 +475,6 @@ }, "is_amp": { "type": "boolean", - "format": "boolean", "description": "Signals whether or not this is an AMP invoice." } } @@ -576,12 +574,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -596,31 +591,6 @@ } } } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpc_code": { - "type": "integer", - "format": "int32" - }, - "http_code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "http_status": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } } } } diff --git a/lnrpc/invoicesrpc/invoices_grpc.pb.go b/lnrpc/invoicesrpc/invoices_grpc.pb.go new file mode 100644 index 000000000..cd2bf8dde --- /dev/null +++ b/lnrpc/invoicesrpc/invoices_grpc.pb.go @@ -0,0 +1,266 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package invoicesrpc + +import ( + context "context" + lnrpc "github.com/lightningnetwork/lnd/lnrpc" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// InvoicesClient is the client API for Invoices service. +// +// 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 InvoicesClient interface { + // + //SubscribeSingleInvoice returns a uni-directional stream (server -> client) + //to notify the client of state transitions of the specified invoice. + //Initially the current invoice state is always sent out. + SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) + // + //CancelInvoice cancels a currently open invoice. If the invoice is already + //canceled, this call will succeed. If the invoice is already settled, it will + //fail. + CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error) + // + //AddHoldInvoice creates a hold invoice. It ties the invoice to the hash + //supplied in the request. + AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error) + // + //SettleInvoice settles an accepted invoice. If the invoice is already + //settled, this call will succeed. + SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error) +} + +type invoicesClient struct { + cc grpc.ClientConnInterface +} + +func NewInvoicesClient(cc grpc.ClientConnInterface) InvoicesClient { + return &invoicesClient{cc} +} + +func (c *invoicesClient) SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) { + stream, err := c.cc.NewStream(ctx, &Invoices_ServiceDesc.Streams[0], "/invoicesrpc.Invoices/SubscribeSingleInvoice", opts...) + if err != nil { + return nil, err + } + x := &invoicesSubscribeSingleInvoiceClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Invoices_SubscribeSingleInvoiceClient interface { + Recv() (*lnrpc.Invoice, error) + grpc.ClientStream +} + +type invoicesSubscribeSingleInvoiceClient struct { + grpc.ClientStream +} + +func (x *invoicesSubscribeSingleInvoiceClient) Recv() (*lnrpc.Invoice, error) { + m := new(lnrpc.Invoice) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *invoicesClient) CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error) { + out := new(CancelInvoiceResp) + err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/CancelInvoice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invoicesClient) AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error) { + out := new(AddHoldInvoiceResp) + err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/AddHoldInvoice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invoicesClient) SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error) { + out := new(SettleInvoiceResp) + err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/SettleInvoice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InvoicesServer is the server API for Invoices service. +// All implementations must embed UnimplementedInvoicesServer +// for forward compatibility +type InvoicesServer interface { + // + //SubscribeSingleInvoice returns a uni-directional stream (server -> client) + //to notify the client of state transitions of the specified invoice. + //Initially the current invoice state is always sent out. + SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error + // + //CancelInvoice cancels a currently open invoice. If the invoice is already + //canceled, this call will succeed. If the invoice is already settled, it will + //fail. + CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error) + // + //AddHoldInvoice creates a hold invoice. It ties the invoice to the hash + //supplied in the request. + AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error) + // + //SettleInvoice settles an accepted invoice. If the invoice is already + //settled, this call will succeed. + SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error) + mustEmbedUnimplementedInvoicesServer() +} + +// UnimplementedInvoicesServer must be embedded to have forward compatible implementations. +type UnimplementedInvoicesServer struct { +} + +func (UnimplementedInvoicesServer) SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeSingleInvoice not implemented") +} +func (UnimplementedInvoicesServer) CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelInvoice not implemented") +} +func (UnimplementedInvoicesServer) AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddHoldInvoice not implemented") +} +func (UnimplementedInvoicesServer) SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SettleInvoice not implemented") +} +func (UnimplementedInvoicesServer) mustEmbedUnimplementedInvoicesServer() {} + +// UnsafeInvoicesServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InvoicesServer will +// result in compilation errors. +type UnsafeInvoicesServer interface { + mustEmbedUnimplementedInvoicesServer() +} + +func RegisterInvoicesServer(s grpc.ServiceRegistrar, srv InvoicesServer) { + s.RegisterService(&Invoices_ServiceDesc, srv) +} + +func _Invoices_SubscribeSingleInvoice_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeSingleInvoiceRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(InvoicesServer).SubscribeSingleInvoice(m, &invoicesSubscribeSingleInvoiceServer{stream}) +} + +type Invoices_SubscribeSingleInvoiceServer interface { + Send(*lnrpc.Invoice) error + grpc.ServerStream +} + +type invoicesSubscribeSingleInvoiceServer struct { + grpc.ServerStream +} + +func (x *invoicesSubscribeSingleInvoiceServer) Send(m *lnrpc.Invoice) error { + return x.ServerStream.SendMsg(m) +} + +func _Invoices_CancelInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelInvoiceMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvoicesServer).CancelInvoice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/invoicesrpc.Invoices/CancelInvoice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvoicesServer).CancelInvoice(ctx, req.(*CancelInvoiceMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _Invoices_AddHoldInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddHoldInvoiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvoicesServer).AddHoldInvoice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/invoicesrpc.Invoices/AddHoldInvoice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvoicesServer).AddHoldInvoice(ctx, req.(*AddHoldInvoiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Invoices_SettleInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SettleInvoiceMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvoicesServer).SettleInvoice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/invoicesrpc.Invoices/SettleInvoice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvoicesServer).SettleInvoice(ctx, req.(*SettleInvoiceMsg)) + } + return interceptor(ctx, in, info, handler) +} + +// Invoices_ServiceDesc is the grpc.ServiceDesc for Invoices service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Invoices_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "invoicesrpc.Invoices", + HandlerType: (*InvoicesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CancelInvoice", + Handler: _Invoices_CancelInvoice_Handler, + }, + { + MethodName: "AddHoldInvoice", + Handler: _Invoices_AddHoldInvoice_Handler, + }, + { + MethodName: "SettleInvoice", + Handler: _Invoices_SettleInvoice_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeSingleInvoice", + Handler: _Invoices_SubscribeSingleInvoice_Handler, + ServerStreams: true, + }, + }, + Metadata: "invoicesrpc/invoices.proto", +} diff --git a/lnrpc/invoicesrpc/invoices_server.go b/lnrpc/invoicesrpc/invoices_server.go index 83228a64a..5b883310d 100644 --- a/lnrpc/invoicesrpc/invoices_server.go +++ b/lnrpc/invoicesrpc/invoices_server.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc" "gopkg.in/macaroon-bakery.v2/bakery" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lntypes" @@ -77,6 +77,9 @@ type ServerShell struct { // RPC server allows external callers to access the status of the invoices // currently active within lnd, as well as configuring it at runtime. type Server struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedInvoicesServer + quit chan struct{} cfg *Config diff --git a/lnrpc/lightning.pb.go b/lnrpc/lightning.pb.go index 9ce909299..d4be95e54 100644 --- a/lnrpc/lightning.pb.go +++ b/lnrpc/lightning.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: lightning.proto package lnrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // //`AddressType` has to be one of: // @@ -19832,3076 +19823,3 @@ func file_lightning_proto_init() { file_lightning_proto_goTypes = nil file_lightning_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// LightningClient is the client API for Lightning service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type LightningClient interface { - // lncli: `walletbalance` - //WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - //confirmed unspent outputs and all unconfirmed unspent outputs under control - //of the wallet. - WalletBalance(ctx context.Context, in *WalletBalanceRequest, opts ...grpc.CallOption) (*WalletBalanceResponse, error) - // lncli: `channelbalance` - //ChannelBalance returns a report on the total funds across all open channels, - //categorized in local/remote, pending local/remote and unsettled local/remote - //balances. - ChannelBalance(ctx context.Context, in *ChannelBalanceRequest, opts ...grpc.CallOption) (*ChannelBalanceResponse, error) - // lncli: `listchaintxns` - //GetTransactions returns a list describing all the known transactions - //relevant to the wallet. - GetTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (*TransactionDetails, error) - // lncli: `estimatefee` - //EstimateFee asks the chain backend to estimate the fee rate and total fees - //for a transaction that pays to multiple specified outputs. - // - //When using REST, the `AddrToAmount` map type can be set by appending - //`&AddrToAmount[
]=` to the URL. Unfortunately this - //map type doesn't appear in the REST API documentation because of a bug in - //the grpc-gateway library. - EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) - // lncli: `sendcoins` - //SendCoins executes a request to send coins to a particular address. Unlike - //SendMany, this RPC call only allows creating a single output at a time. If - //neither target_conf, or sat_per_vbyte are set, then the internal wallet will - //consult its fee model to determine a fee for the default confirmation - //target. - SendCoins(ctx context.Context, in *SendCoinsRequest, opts ...grpc.CallOption) (*SendCoinsResponse, error) - // lncli: `listunspent` - //Deprecated, use walletrpc.ListUnspent instead. - // - //ListUnspent returns a list of all utxos spendable by the wallet with a - //number of confirmations between the specified minimum and maximum. - ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) - // - //SubscribeTransactions creates a uni-directional stream from the server to - //the client in which any newly discovered transactions relevant to the - //wallet are sent over. - SubscribeTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (Lightning_SubscribeTransactionsClient, error) - // lncli: `sendmany` - //SendMany handles a request for a transaction that creates multiple specified - //outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - //the internal wallet will consult its fee model to determine a fee for the - //default confirmation target. - SendMany(ctx context.Context, in *SendManyRequest, opts ...grpc.CallOption) (*SendManyResponse, error) - // lncli: `newaddress` - //NewAddress creates a new address under control of the local wallet. - NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error) - // lncli: `signmessage` - //SignMessage signs a message with this node's private key. The returned - //signature string is `zbase32` encoded and pubkey recoverable, meaning that - //only the message digest and signature are needed for verification. - SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) - // lncli: `verifymessage` - //VerifyMessage verifies a signature over a msg. The signature must be - //zbase32 encoded and signed by an active node in the resident node's - //channel database. In addition to returning the validity of the signature, - //VerifyMessage also returns the recovered pubkey from the signature. - VerifyMessage(ctx context.Context, in *VerifyMessageRequest, opts ...grpc.CallOption) (*VerifyMessageResponse, error) - // lncli: `connect` - //ConnectPeer attempts to establish a connection to a remote peer. This is at - //the networking level, and is used for communication between nodes. This is - //distinct from establishing a channel with a peer. - ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error) - // lncli: `disconnect` - //DisconnectPeer attempts to disconnect one peer from another identified by a - //given pubKey. In the case that we currently have a pending or active channel - //with the target peer, then this action will be not be allowed. - DisconnectPeer(ctx context.Context, in *DisconnectPeerRequest, opts ...grpc.CallOption) (*DisconnectPeerResponse, error) - // lncli: `listpeers` - //ListPeers returns a verbose listing of all currently active peers. - ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) - // - //SubscribePeerEvents creates a uni-directional stream from the server to - //the client in which any events relevant to the state of peers are sent - //over. Events include peers going online and offline. - SubscribePeerEvents(ctx context.Context, in *PeerEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribePeerEventsClient, error) - // lncli: `getinfo` - //GetInfo returns general information concerning the lightning node including - //it's identity pubkey, alias, the chains it is connected to, and information - //concerning the number of open+pending channels. - GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) - //* lncli: `getrecoveryinfo` - //GetRecoveryInfo returns information concerning the recovery mode including - //whether it's in a recovery mode, whether the recovery is finished, and the - //progress made so far. - GetRecoveryInfo(ctx context.Context, in *GetRecoveryInfoRequest, opts ...grpc.CallOption) (*GetRecoveryInfoResponse, error) - // lncli: `pendingchannels` - //PendingChannels returns a list of all the channels that are currently - //considered "pending". A channel is pending if it has finished the funding - //workflow and is waiting for confirmations for the funding txn, or is in the - //process of closure, either initiated cooperatively or non-cooperatively. - PendingChannels(ctx context.Context, in *PendingChannelsRequest, opts ...grpc.CallOption) (*PendingChannelsResponse, error) - // lncli: `listchannels` - //ListChannels returns a description of all the open channels that this node - //is a participant in. - ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) - // - //SubscribeChannelEvents creates a uni-directional stream from the server to - //the client in which any updates relevant to the state of the channels are - //sent over. Events include new active channels, inactive channels, and closed - //channels. - SubscribeChannelEvents(ctx context.Context, in *ChannelEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelEventsClient, error) - // lncli: `closedchannels` - //ClosedChannels returns a description of all the closed channels that - //this node was a participant in. - ClosedChannels(ctx context.Context, in *ClosedChannelsRequest, opts ...grpc.CallOption) (*ClosedChannelsResponse, error) - // - //OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - //call is meant to be consumed by clients to the REST proxy. As with all - //other sync calls, all byte slices are intended to be populated as hex - //encoded strings. - OpenChannelSync(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*ChannelPoint, error) - // lncli: `openchannel` - //OpenChannel attempts to open a singly funded channel specified in the - //request to a remote peer. Users are able to specify a target number of - //blocks that the funding transaction should be confirmed in, or a manual fee - //rate to us for the funding transaction. If neither are specified, then a - //lax block confirmation target is used. Each OpenStatusUpdate will return - //the pending channel ID of the in-progress channel. Depending on the - //arguments specified in the OpenChannelRequest, this pending channel ID can - //then be used to manually progress the channel funding flow. - OpenChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (Lightning_OpenChannelClient, error) - // - //FundingStateStep is an advanced funding related call that allows the caller - //to either execute some preparatory steps for a funding workflow, or - //manually progress a funding workflow. The primary way a funding flow is - //identified is via its pending channel ID. As an example, this method can be - //used to specify that we're expecting a funding flow for a particular - //pending channel ID, for which we need to use specific parameters. - //Alternatively, this can be used to interactively drive PSBT signing for - //funding for partially complete funding transactions. - FundingStateStep(ctx context.Context, in *FundingTransitionMsg, opts ...grpc.CallOption) (*FundingStateStepResp, error) - // - //ChannelAcceptor dispatches a bi-directional streaming RPC in which - //OpenChannel requests are sent to the client and the client responds with - //a boolean that tells LND whether or not to accept the channel. This allows - //node operators to specify their own criteria for accepting inbound channels - //through a single persistent connection. - ChannelAcceptor(ctx context.Context, opts ...grpc.CallOption) (Lightning_ChannelAcceptorClient, error) - // lncli: `closechannel` - //CloseChannel attempts to close an active channel identified by its channel - //outpoint (ChannelPoint). The actions of this method can additionally be - //augmented to attempt a force close after a timeout period in the case of an - //inactive peer. If a non-force close (cooperative closure) is requested, - //then the user can specify either a target number of blocks until the - //closure transaction is confirmed, or a manual fee rate. If neither are - //specified, then a default lax, block confirmation target is used. - CloseChannel(ctx context.Context, in *CloseChannelRequest, opts ...grpc.CallOption) (Lightning_CloseChannelClient, error) - // lncli: `abandonchannel` - //AbandonChannel removes all channel state from the database except for a - //close summary. This method can be used to get rid of permanently unusable - //channels due to bugs fixed in newer versions of lnd. This method can also be - //used to remove externally funded channels where the funding transaction was - //never broadcast. Only available for non-externally funded channels in dev - //build. - AbandonChannel(ctx context.Context, in *AbandonChannelRequest, opts ...grpc.CallOption) (*AbandonChannelResponse, error) - // Deprecated: Do not use. - // lncli: `sendpayment` - //Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - //bi-directional streaming RPC for sending payments through the Lightning - //Network. A single RPC invocation creates a persistent bi-directional - //stream allowing clients to rapidly send payments through the Lightning - //Network with a single persistent connection. - SendPayment(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendPaymentClient, error) - // - //SendPaymentSync is the synchronous non-streaming version of SendPayment. - //This RPC is intended to be consumed by clients of the REST proxy. - //Additionally, this RPC expects the destination's public key and the payment - //hash (if any) to be encoded as hex strings. - SendPaymentSync(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) - // Deprecated: Do not use. - // lncli: `sendtoroute` - //Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - //streaming RPC for sending payment through the Lightning Network. This - //method differs from SendPayment in that it allows users to specify a full - //route manually. This can be used for things like rebalancing, and atomic - //swaps. - SendToRoute(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendToRouteClient, error) - // - //SendToRouteSync is a synchronous version of SendToRoute. It Will block - //until the payment either fails or succeeds. - SendToRouteSync(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendResponse, error) - // lncli: `addinvoice` - //AddInvoice attempts to add a new invoice to the invoice database. Any - //duplicated invoices are rejected, therefore all invoices *must* have a - //unique payment preimage. - AddInvoice(ctx context.Context, in *Invoice, opts ...grpc.CallOption) (*AddInvoiceResponse, error) - // lncli: `listinvoices` - //ListInvoices returns a list of all the invoices currently stored within the - //database. Any active debug invoices are ignored. It has full support for - //paginated responses, allowing users to query for specific invoices through - //their add_index. This can be done by using either the first_index_offset or - //last_index_offset fields included in the response as the index_offset of the - //next request. By default, the first 100 invoices created will be returned. - //Backwards pagination is also supported through the Reversed flag. - ListInvoices(ctx context.Context, in *ListInvoiceRequest, opts ...grpc.CallOption) (*ListInvoiceResponse, error) - // lncli: `lookupinvoice` - //LookupInvoice attempts to look up an invoice according to its payment hash. - //The passed payment hash *must* be exactly 32 bytes, if not, an error is - //returned. - LookupInvoice(ctx context.Context, in *PaymentHash, opts ...grpc.CallOption) (*Invoice, error) - // - //SubscribeInvoices returns a uni-directional stream (server -> client) for - //notifying the client of newly added/settled invoices. The caller can - //optionally specify the add_index and/or the settle_index. If the add_index - //is specified, then we'll first start by sending add invoice events for all - //invoices with an add_index greater than the specified value. If the - //settle_index is specified, the next, we'll send out all settle events for - //invoices with a settle_index greater than the specified value. One or both - //of these fields can be set. If no fields are set, then we'll only send out - //the latest add/settle events. - SubscribeInvoices(ctx context.Context, in *InvoiceSubscription, opts ...grpc.CallOption) (Lightning_SubscribeInvoicesClient, error) - // lncli: `decodepayreq` - //DecodePayReq takes an encoded payment request string and attempts to decode - //it, returning a full description of the conditions encoded within the - //payment request. - DecodePayReq(ctx context.Context, in *PayReqString, opts ...grpc.CallOption) (*PayReq, error) - // lncli: `listpayments` - //ListPayments returns a list of all outgoing payments. - ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) - // - //DeleteAllPayments deletes all outgoing payments from DB. - DeleteAllPayments(ctx context.Context, in *DeleteAllPaymentsRequest, opts ...grpc.CallOption) (*DeleteAllPaymentsResponse, error) - // lncli: `describegraph` - //DescribeGraph returns a description of the latest graph state from the - //point of view of the node. The graph information is partitioned into two - //components: all the nodes/vertexes, and all the edges that connect the - //vertexes themselves. As this is a directed graph, the edges also contain - //the node directional specific routing policy which includes: the time lock - //delta, fee information, etc. - DescribeGraph(ctx context.Context, in *ChannelGraphRequest, opts ...grpc.CallOption) (*ChannelGraph, error) - // lncli: `getnodemetrics` - //GetNodeMetrics returns node metrics calculated from the graph. Currently - //the only supported metric is betweenness centrality of individual nodes. - GetNodeMetrics(ctx context.Context, in *NodeMetricsRequest, opts ...grpc.CallOption) (*NodeMetricsResponse, error) - // lncli: `getchaninfo` - //GetChanInfo returns the latest authenticated network announcement for the - //given channel identified by its channel ID: an 8-byte integer which - //uniquely identifies the location of transaction's funding output within the - //blockchain. - GetChanInfo(ctx context.Context, in *ChanInfoRequest, opts ...grpc.CallOption) (*ChannelEdge, error) - // lncli: `getnodeinfo` - //GetNodeInfo returns the latest advertised, aggregated, and authenticated - //channel information for the specified node identified by its public key. - GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfo, error) - // lncli: `queryroutes` - //QueryRoutes attempts to query the daemon's Channel Router for a possible - //route to a target destination capable of carrying a specific amount of - //satoshis. The returned route contains the full details required to craft and - //send an HTLC, also including the necessary information that should be - //present within the Sphinx packet encapsulated within the HTLC. - // - //When using REST, the `dest_custom_records` map type can be set by appending - //`&dest_custom_records[]=` - //to the URL. Unfortunately this map type doesn't appear in the REST API - //documentation because of a bug in the grpc-gateway library. - QueryRoutes(ctx context.Context, in *QueryRoutesRequest, opts ...grpc.CallOption) (*QueryRoutesResponse, error) - // lncli: `getnetworkinfo` - //GetNetworkInfo returns some basic stats about the known channel graph from - //the point of view of the node. - GetNetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfo, error) - // lncli: `stop` - //StopDaemon will send a shutdown request to the interrupt handler, triggering - //a graceful shutdown of the daemon. - StopDaemon(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) - // - //SubscribeChannelGraph launches a streaming RPC that allows the caller to - //receive notifications upon any changes to the channel graph topology from - //the point of view of the responding node. Events notified include: new - //nodes coming online, nodes updating their authenticated attributes, new - //channels being advertised, updates in the routing policy for a directional - //channel edge, and when channels are closed on-chain. - SubscribeChannelGraph(ctx context.Context, in *GraphTopologySubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelGraphClient, error) - // lncli: `debuglevel` - //DebugLevel allows a caller to programmatically set the logging verbosity of - //lnd. The logging can be targeted according to a coarse daemon-wide logging - //level, or in a granular fashion to specify the logging for a target - //sub-system. - DebugLevel(ctx context.Context, in *DebugLevelRequest, opts ...grpc.CallOption) (*DebugLevelResponse, error) - // lncli: `feereport` - //FeeReport allows the caller to obtain a report detailing the current fee - //schedule enforced by the node globally for each channel. - FeeReport(ctx context.Context, in *FeeReportRequest, opts ...grpc.CallOption) (*FeeReportResponse, error) - // lncli: `updatechanpolicy` - //UpdateChannelPolicy allows the caller to update the fee schedule and - //channel policies for all channels globally, or a particular channel. - UpdateChannelPolicy(ctx context.Context, in *PolicyUpdateRequest, opts ...grpc.CallOption) (*PolicyUpdateResponse, error) - // lncli: `fwdinghistory` - //ForwardingHistory allows the caller to query the htlcswitch for a record of - //all HTLCs forwarded within the target time range, and integer offset - //within that time range, for a maximum number of events. If no maximum number - //of events is specified, up to 100 events will be returned. If no time-range - //is specified, then events will be returned in the order that they occured. - // - //A list of forwarding events are returned. The size of each forwarding event - //is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - //As a result each message can only contain 50k entries. Each response has - //the index offset of the last entry. The index offset can be provided to the - //request to allow the caller to skip a series of records. - ForwardingHistory(ctx context.Context, in *ForwardingHistoryRequest, opts ...grpc.CallOption) (*ForwardingHistoryResponse, error) - // lncli: `exportchanbackup` - //ExportChannelBackup attempts to return an encrypted static channel backup - //for the target channel identified by it channel point. The backup is - //encrypted with a key generated from the aezeed seed of the user. The - //returned backup can either be restored using the RestoreChannelBackup - //method once lnd is running, or via the InitWallet and UnlockWallet methods - //from the WalletUnlocker service. - ExportChannelBackup(ctx context.Context, in *ExportChannelBackupRequest, opts ...grpc.CallOption) (*ChannelBackup, error) - // - //ExportAllChannelBackups returns static channel backups for all existing - //channels known to lnd. A set of regular singular static channel backups for - //each channel are returned. Additionally, a multi-channel backup is returned - //as well, which contains a single encrypted blob containing the backups of - //each channel. - ExportAllChannelBackups(ctx context.Context, in *ChanBackupExportRequest, opts ...grpc.CallOption) (*ChanBackupSnapshot, error) - // - //VerifyChanBackup allows a caller to verify the integrity of a channel backup - //snapshot. This method will accept either a packed Single or a packed Multi. - //Specifying both will result in an error. - VerifyChanBackup(ctx context.Context, in *ChanBackupSnapshot, opts ...grpc.CallOption) (*VerifyChanBackupResponse, error) - // lncli: `restorechanbackup` - //RestoreChannelBackups accepts a set of singular channel backups, or a - //single encrypted multi-chan backup and attempts to recover any funds - //remaining within the channel. If we are able to unpack the backup, then the - //new channel will be shown under listchannels, as well as pending channels. - RestoreChannelBackups(ctx context.Context, in *RestoreChanBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) - // - //SubscribeChannelBackups allows a client to sub-subscribe to the most up to - //date information concerning the state of all channel backups. Each time a - //new channel is added, we return the new set of channels, along with a - //multi-chan backup containing the backup info for all channels. Each time a - //channel is closed, we send a new update, which contains new new chan back - //ups, but the updated set of encrypted multi-chan backups with the closed - //channel(s) removed. - SubscribeChannelBackups(ctx context.Context, in *ChannelBackupSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelBackupsClient, error) - // lncli: `bakemacaroon` - //BakeMacaroon allows the creation of a new macaroon with custom read and - //write permissions. No first-party caveats are added since this can be done - //offline. - BakeMacaroon(ctx context.Context, in *BakeMacaroonRequest, opts ...grpc.CallOption) (*BakeMacaroonResponse, error) - // lncli: `listmacaroonids` - //ListMacaroonIDs returns all root key IDs that are in use. - ListMacaroonIDs(ctx context.Context, in *ListMacaroonIDsRequest, opts ...grpc.CallOption) (*ListMacaroonIDsResponse, error) - // lncli: `deletemacaroonid` - //DeleteMacaroonID deletes the specified macaroon ID and invalidates all - //macaroons derived from that ID. - DeleteMacaroonID(ctx context.Context, in *DeleteMacaroonIDRequest, opts ...grpc.CallOption) (*DeleteMacaroonIDResponse, error) - // lncli: `listpermissions` - //ListPermissions lists all RPC method URIs and their required macaroon - //permissions to access them. - ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error) -} - -type lightningClient struct { - cc grpc.ClientConnInterface -} - -func NewLightningClient(cc grpc.ClientConnInterface) LightningClient { - return &lightningClient{cc} -} - -func (c *lightningClient) WalletBalance(ctx context.Context, in *WalletBalanceRequest, opts ...grpc.CallOption) (*WalletBalanceResponse, error) { - out := new(WalletBalanceResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/WalletBalance", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ChannelBalance(ctx context.Context, in *ChannelBalanceRequest, opts ...grpc.CallOption) (*ChannelBalanceResponse, error) { - out := new(ChannelBalanceResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ChannelBalance", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) GetTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (*TransactionDetails, error) { - out := new(TransactionDetails) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetTransactions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) { - out := new(EstimateFeeResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/EstimateFee", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SendCoins(ctx context.Context, in *SendCoinsRequest, opts ...grpc.CallOption) (*SendCoinsResponse, error) { - out := new(SendCoinsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendCoins", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) { - out := new(ListUnspentResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListUnspent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SubscribeTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (Lightning_SubscribeTransactionsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[0], "/lnrpc.Lightning/SubscribeTransactions", opts...) - if err != nil { - return nil, err - } - x := &lightningSubscribeTransactionsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_SubscribeTransactionsClient interface { - Recv() (*Transaction, error) - grpc.ClientStream -} - -type lightningSubscribeTransactionsClient struct { - grpc.ClientStream -} - -func (x *lightningSubscribeTransactionsClient) Recv() (*Transaction, error) { - m := new(Transaction) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) SendMany(ctx context.Context, in *SendManyRequest, opts ...grpc.CallOption) (*SendManyResponse, error) { - out := new(SendManyResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendMany", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error) { - out := new(NewAddressResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/NewAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) { - out := new(SignMessageResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SignMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) VerifyMessage(ctx context.Context, in *VerifyMessageRequest, opts ...grpc.CallOption) (*VerifyMessageResponse, error) { - out := new(VerifyMessageResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/VerifyMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error) { - out := new(ConnectPeerResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ConnectPeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) DisconnectPeer(ctx context.Context, in *DisconnectPeerRequest, opts ...grpc.CallOption) (*DisconnectPeerResponse, error) { - out := new(DisconnectPeerResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DisconnectPeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) { - out := new(ListPeersResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListPeers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SubscribePeerEvents(ctx context.Context, in *PeerEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribePeerEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[1], "/lnrpc.Lightning/SubscribePeerEvents", opts...) - if err != nil { - return nil, err - } - x := &lightningSubscribePeerEventsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_SubscribePeerEventsClient interface { - Recv() (*PeerEvent, error) - grpc.ClientStream -} - -type lightningSubscribePeerEventsClient struct { - grpc.ClientStream -} - -func (x *lightningSubscribePeerEventsClient) Recv() (*PeerEvent, error) { - m := new(PeerEvent) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { - out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) GetRecoveryInfo(ctx context.Context, in *GetRecoveryInfoRequest, opts ...grpc.CallOption) (*GetRecoveryInfoResponse, error) { - out := new(GetRecoveryInfoResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetRecoveryInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) PendingChannels(ctx context.Context, in *PendingChannelsRequest, opts ...grpc.CallOption) (*PendingChannelsResponse, error) { - out := new(PendingChannelsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/PendingChannels", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) { - out := new(ListChannelsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListChannels", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SubscribeChannelEvents(ctx context.Context, in *ChannelEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[2], "/lnrpc.Lightning/SubscribeChannelEvents", opts...) - if err != nil { - return nil, err - } - x := &lightningSubscribeChannelEventsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_SubscribeChannelEventsClient interface { - Recv() (*ChannelEventUpdate, error) - grpc.ClientStream -} - -type lightningSubscribeChannelEventsClient struct { - grpc.ClientStream -} - -func (x *lightningSubscribeChannelEventsClient) Recv() (*ChannelEventUpdate, error) { - m := new(ChannelEventUpdate) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) ClosedChannels(ctx context.Context, in *ClosedChannelsRequest, opts ...grpc.CallOption) (*ClosedChannelsResponse, error) { - out := new(ClosedChannelsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ClosedChannels", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) OpenChannelSync(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*ChannelPoint, error) { - out := new(ChannelPoint) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/OpenChannelSync", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) OpenChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (Lightning_OpenChannelClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[3], "/lnrpc.Lightning/OpenChannel", opts...) - if err != nil { - return nil, err - } - x := &lightningOpenChannelClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_OpenChannelClient interface { - Recv() (*OpenStatusUpdate, error) - grpc.ClientStream -} - -type lightningOpenChannelClient struct { - grpc.ClientStream -} - -func (x *lightningOpenChannelClient) Recv() (*OpenStatusUpdate, error) { - m := new(OpenStatusUpdate) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) FundingStateStep(ctx context.Context, in *FundingTransitionMsg, opts ...grpc.CallOption) (*FundingStateStepResp, error) { - out := new(FundingStateStepResp) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/FundingStateStep", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ChannelAcceptor(ctx context.Context, opts ...grpc.CallOption) (Lightning_ChannelAcceptorClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[4], "/lnrpc.Lightning/ChannelAcceptor", opts...) - if err != nil { - return nil, err - } - x := &lightningChannelAcceptorClient{stream} - return x, nil -} - -type Lightning_ChannelAcceptorClient interface { - Send(*ChannelAcceptResponse) error - Recv() (*ChannelAcceptRequest, error) - grpc.ClientStream -} - -type lightningChannelAcceptorClient struct { - grpc.ClientStream -} - -func (x *lightningChannelAcceptorClient) Send(m *ChannelAcceptResponse) error { - return x.ClientStream.SendMsg(m) -} - -func (x *lightningChannelAcceptorClient) Recv() (*ChannelAcceptRequest, error) { - m := new(ChannelAcceptRequest) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) CloseChannel(ctx context.Context, in *CloseChannelRequest, opts ...grpc.CallOption) (Lightning_CloseChannelClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[5], "/lnrpc.Lightning/CloseChannel", opts...) - if err != nil { - return nil, err - } - x := &lightningCloseChannelClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_CloseChannelClient interface { - Recv() (*CloseStatusUpdate, error) - grpc.ClientStream -} - -type lightningCloseChannelClient struct { - grpc.ClientStream -} - -func (x *lightningCloseChannelClient) Recv() (*CloseStatusUpdate, error) { - m := new(CloseStatusUpdate) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) AbandonChannel(ctx context.Context, in *AbandonChannelRequest, opts ...grpc.CallOption) (*AbandonChannelResponse, error) { - out := new(AbandonChannelResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/AbandonChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *lightningClient) SendPayment(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendPaymentClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[6], "/lnrpc.Lightning/SendPayment", opts...) - if err != nil { - return nil, err - } - x := &lightningSendPaymentClient{stream} - return x, nil -} - -type Lightning_SendPaymentClient interface { - Send(*SendRequest) error - Recv() (*SendResponse, error) - grpc.ClientStream -} - -type lightningSendPaymentClient struct { - grpc.ClientStream -} - -func (x *lightningSendPaymentClient) Send(m *SendRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *lightningSendPaymentClient) Recv() (*SendResponse, error) { - m := new(SendResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) SendPaymentSync(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) { - out := new(SendResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendPaymentSync", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *lightningClient) SendToRoute(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendToRouteClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[7], "/lnrpc.Lightning/SendToRoute", opts...) - if err != nil { - return nil, err - } - x := &lightningSendToRouteClient{stream} - return x, nil -} - -type Lightning_SendToRouteClient interface { - Send(*SendToRouteRequest) error - Recv() (*SendResponse, error) - grpc.ClientStream -} - -type lightningSendToRouteClient struct { - grpc.ClientStream -} - -func (x *lightningSendToRouteClient) Send(m *SendToRouteRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *lightningSendToRouteClient) Recv() (*SendResponse, error) { - m := new(SendResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) SendToRouteSync(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendResponse, error) { - out := new(SendResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendToRouteSync", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) AddInvoice(ctx context.Context, in *Invoice, opts ...grpc.CallOption) (*AddInvoiceResponse, error) { - out := new(AddInvoiceResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/AddInvoice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListInvoices(ctx context.Context, in *ListInvoiceRequest, opts ...grpc.CallOption) (*ListInvoiceResponse, error) { - out := new(ListInvoiceResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListInvoices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) LookupInvoice(ctx context.Context, in *PaymentHash, opts ...grpc.CallOption) (*Invoice, error) { - out := new(Invoice) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/LookupInvoice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SubscribeInvoices(ctx context.Context, in *InvoiceSubscription, opts ...grpc.CallOption) (Lightning_SubscribeInvoicesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[8], "/lnrpc.Lightning/SubscribeInvoices", opts...) - if err != nil { - return nil, err - } - x := &lightningSubscribeInvoicesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_SubscribeInvoicesClient interface { - Recv() (*Invoice, error) - grpc.ClientStream -} - -type lightningSubscribeInvoicesClient struct { - grpc.ClientStream -} - -func (x *lightningSubscribeInvoicesClient) Recv() (*Invoice, error) { - m := new(Invoice) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) DecodePayReq(ctx context.Context, in *PayReqString, opts ...grpc.CallOption) (*PayReq, error) { - out := new(PayReq) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DecodePayReq", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) { - out := new(ListPaymentsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListPayments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) DeleteAllPayments(ctx context.Context, in *DeleteAllPaymentsRequest, opts ...grpc.CallOption) (*DeleteAllPaymentsResponse, error) { - out := new(DeleteAllPaymentsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DeleteAllPayments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) DescribeGraph(ctx context.Context, in *ChannelGraphRequest, opts ...grpc.CallOption) (*ChannelGraph, error) { - out := new(ChannelGraph) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DescribeGraph", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) GetNodeMetrics(ctx context.Context, in *NodeMetricsRequest, opts ...grpc.CallOption) (*NodeMetricsResponse, error) { - out := new(NodeMetricsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetNodeMetrics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) GetChanInfo(ctx context.Context, in *ChanInfoRequest, opts ...grpc.CallOption) (*ChannelEdge, error) { - out := new(ChannelEdge) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetChanInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfo, error) { - out := new(NodeInfo) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetNodeInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) QueryRoutes(ctx context.Context, in *QueryRoutesRequest, opts ...grpc.CallOption) (*QueryRoutesResponse, error) { - out := new(QueryRoutesResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/QueryRoutes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) GetNetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfo, error) { - out := new(NetworkInfo) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetNetworkInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) StopDaemon(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) { - out := new(StopResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/StopDaemon", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SubscribeChannelGraph(ctx context.Context, in *GraphTopologySubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelGraphClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[9], "/lnrpc.Lightning/SubscribeChannelGraph", opts...) - if err != nil { - return nil, err - } - x := &lightningSubscribeChannelGraphClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_SubscribeChannelGraphClient interface { - Recv() (*GraphTopologyUpdate, error) - grpc.ClientStream -} - -type lightningSubscribeChannelGraphClient struct { - grpc.ClientStream -} - -func (x *lightningSubscribeChannelGraphClient) Recv() (*GraphTopologyUpdate, error) { - m := new(GraphTopologyUpdate) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) DebugLevel(ctx context.Context, in *DebugLevelRequest, opts ...grpc.CallOption) (*DebugLevelResponse, error) { - out := new(DebugLevelResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DebugLevel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) FeeReport(ctx context.Context, in *FeeReportRequest, opts ...grpc.CallOption) (*FeeReportResponse, error) { - out := new(FeeReportResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/FeeReport", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) UpdateChannelPolicy(ctx context.Context, in *PolicyUpdateRequest, opts ...grpc.CallOption) (*PolicyUpdateResponse, error) { - out := new(PolicyUpdateResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/UpdateChannelPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ForwardingHistory(ctx context.Context, in *ForwardingHistoryRequest, opts ...grpc.CallOption) (*ForwardingHistoryResponse, error) { - out := new(ForwardingHistoryResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ForwardingHistory", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ExportChannelBackup(ctx context.Context, in *ExportChannelBackupRequest, opts ...grpc.CallOption) (*ChannelBackup, error) { - out := new(ChannelBackup) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ExportChannelBackup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ExportAllChannelBackups(ctx context.Context, in *ChanBackupExportRequest, opts ...grpc.CallOption) (*ChanBackupSnapshot, error) { - out := new(ChanBackupSnapshot) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ExportAllChannelBackups", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) VerifyChanBackup(ctx context.Context, in *ChanBackupSnapshot, opts ...grpc.CallOption) (*VerifyChanBackupResponse, error) { - out := new(VerifyChanBackupResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/VerifyChanBackup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) RestoreChannelBackups(ctx context.Context, in *RestoreChanBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) { - out := new(RestoreBackupResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/RestoreChannelBackups", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) SubscribeChannelBackups(ctx context.Context, in *ChannelBackupSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelBackupsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lightning_serviceDesc.Streams[10], "/lnrpc.Lightning/SubscribeChannelBackups", opts...) - if err != nil { - return nil, err - } - x := &lightningSubscribeChannelBackupsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Lightning_SubscribeChannelBackupsClient interface { - Recv() (*ChanBackupSnapshot, error) - grpc.ClientStream -} - -type lightningSubscribeChannelBackupsClient struct { - grpc.ClientStream -} - -func (x *lightningSubscribeChannelBackupsClient) Recv() (*ChanBackupSnapshot, error) { - m := new(ChanBackupSnapshot) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *lightningClient) BakeMacaroon(ctx context.Context, in *BakeMacaroonRequest, opts ...grpc.CallOption) (*BakeMacaroonResponse, error) { - out := new(BakeMacaroonResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/BakeMacaroon", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListMacaroonIDs(ctx context.Context, in *ListMacaroonIDsRequest, opts ...grpc.CallOption) (*ListMacaroonIDsResponse, error) { - out := new(ListMacaroonIDsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListMacaroonIDs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) DeleteMacaroonID(ctx context.Context, in *DeleteMacaroonIDRequest, opts ...grpc.CallOption) (*DeleteMacaroonIDResponse, error) { - out := new(DeleteMacaroonIDResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DeleteMacaroonID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightningClient) ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error) { - out := new(ListPermissionsResponse) - err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListPermissions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LightningServer is the server API for Lightning service. -type LightningServer interface { - // lncli: `walletbalance` - //WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - //confirmed unspent outputs and all unconfirmed unspent outputs under control - //of the wallet. - WalletBalance(context.Context, *WalletBalanceRequest) (*WalletBalanceResponse, error) - // lncli: `channelbalance` - //ChannelBalance returns a report on the total funds across all open channels, - //categorized in local/remote, pending local/remote and unsettled local/remote - //balances. - ChannelBalance(context.Context, *ChannelBalanceRequest) (*ChannelBalanceResponse, error) - // lncli: `listchaintxns` - //GetTransactions returns a list describing all the known transactions - //relevant to the wallet. - GetTransactions(context.Context, *GetTransactionsRequest) (*TransactionDetails, error) - // lncli: `estimatefee` - //EstimateFee asks the chain backend to estimate the fee rate and total fees - //for a transaction that pays to multiple specified outputs. - // - //When using REST, the `AddrToAmount` map type can be set by appending - //`&AddrToAmount[
]=` to the URL. Unfortunately this - //map type doesn't appear in the REST API documentation because of a bug in - //the grpc-gateway library. - EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) - // lncli: `sendcoins` - //SendCoins executes a request to send coins to a particular address. Unlike - //SendMany, this RPC call only allows creating a single output at a time. If - //neither target_conf, or sat_per_vbyte are set, then the internal wallet will - //consult its fee model to determine a fee for the default confirmation - //target. - SendCoins(context.Context, *SendCoinsRequest) (*SendCoinsResponse, error) - // lncli: `listunspent` - //Deprecated, use walletrpc.ListUnspent instead. - // - //ListUnspent returns a list of all utxos spendable by the wallet with a - //number of confirmations between the specified minimum and maximum. - ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) - // - //SubscribeTransactions creates a uni-directional stream from the server to - //the client in which any newly discovered transactions relevant to the - //wallet are sent over. - SubscribeTransactions(*GetTransactionsRequest, Lightning_SubscribeTransactionsServer) error - // lncli: `sendmany` - //SendMany handles a request for a transaction that creates multiple specified - //outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - //the internal wallet will consult its fee model to determine a fee for the - //default confirmation target. - SendMany(context.Context, *SendManyRequest) (*SendManyResponse, error) - // lncli: `newaddress` - //NewAddress creates a new address under control of the local wallet. - NewAddress(context.Context, *NewAddressRequest) (*NewAddressResponse, error) - // lncli: `signmessage` - //SignMessage signs a message with this node's private key. The returned - //signature string is `zbase32` encoded and pubkey recoverable, meaning that - //only the message digest and signature are needed for verification. - SignMessage(context.Context, *SignMessageRequest) (*SignMessageResponse, error) - // lncli: `verifymessage` - //VerifyMessage verifies a signature over a msg. The signature must be - //zbase32 encoded and signed by an active node in the resident node's - //channel database. In addition to returning the validity of the signature, - //VerifyMessage also returns the recovered pubkey from the signature. - VerifyMessage(context.Context, *VerifyMessageRequest) (*VerifyMessageResponse, error) - // lncli: `connect` - //ConnectPeer attempts to establish a connection to a remote peer. This is at - //the networking level, and is used for communication between nodes. This is - //distinct from establishing a channel with a peer. - ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error) - // lncli: `disconnect` - //DisconnectPeer attempts to disconnect one peer from another identified by a - //given pubKey. In the case that we currently have a pending or active channel - //with the target peer, then this action will be not be allowed. - DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error) - // lncli: `listpeers` - //ListPeers returns a verbose listing of all currently active peers. - ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) - // - //SubscribePeerEvents creates a uni-directional stream from the server to - //the client in which any events relevant to the state of peers are sent - //over. Events include peers going online and offline. - SubscribePeerEvents(*PeerEventSubscription, Lightning_SubscribePeerEventsServer) error - // lncli: `getinfo` - //GetInfo returns general information concerning the lightning node including - //it's identity pubkey, alias, the chains it is connected to, and information - //concerning the number of open+pending channels. - GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) - //* lncli: `getrecoveryinfo` - //GetRecoveryInfo returns information concerning the recovery mode including - //whether it's in a recovery mode, whether the recovery is finished, and the - //progress made so far. - GetRecoveryInfo(context.Context, *GetRecoveryInfoRequest) (*GetRecoveryInfoResponse, error) - // lncli: `pendingchannels` - //PendingChannels returns a list of all the channels that are currently - //considered "pending". A channel is pending if it has finished the funding - //workflow and is waiting for confirmations for the funding txn, or is in the - //process of closure, either initiated cooperatively or non-cooperatively. - PendingChannels(context.Context, *PendingChannelsRequest) (*PendingChannelsResponse, error) - // lncli: `listchannels` - //ListChannels returns a description of all the open channels that this node - //is a participant in. - ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) - // - //SubscribeChannelEvents creates a uni-directional stream from the server to - //the client in which any updates relevant to the state of the channels are - //sent over. Events include new active channels, inactive channels, and closed - //channels. - SubscribeChannelEvents(*ChannelEventSubscription, Lightning_SubscribeChannelEventsServer) error - // lncli: `closedchannels` - //ClosedChannels returns a description of all the closed channels that - //this node was a participant in. - ClosedChannels(context.Context, *ClosedChannelsRequest) (*ClosedChannelsResponse, error) - // - //OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - //call is meant to be consumed by clients to the REST proxy. As with all - //other sync calls, all byte slices are intended to be populated as hex - //encoded strings. - OpenChannelSync(context.Context, *OpenChannelRequest) (*ChannelPoint, error) - // lncli: `openchannel` - //OpenChannel attempts to open a singly funded channel specified in the - //request to a remote peer. Users are able to specify a target number of - //blocks that the funding transaction should be confirmed in, or a manual fee - //rate to us for the funding transaction. If neither are specified, then a - //lax block confirmation target is used. Each OpenStatusUpdate will return - //the pending channel ID of the in-progress channel. Depending on the - //arguments specified in the OpenChannelRequest, this pending channel ID can - //then be used to manually progress the channel funding flow. - OpenChannel(*OpenChannelRequest, Lightning_OpenChannelServer) error - // - //FundingStateStep is an advanced funding related call that allows the caller - //to either execute some preparatory steps for a funding workflow, or - //manually progress a funding workflow. The primary way a funding flow is - //identified is via its pending channel ID. As an example, this method can be - //used to specify that we're expecting a funding flow for a particular - //pending channel ID, for which we need to use specific parameters. - //Alternatively, this can be used to interactively drive PSBT signing for - //funding for partially complete funding transactions. - FundingStateStep(context.Context, *FundingTransitionMsg) (*FundingStateStepResp, error) - // - //ChannelAcceptor dispatches a bi-directional streaming RPC in which - //OpenChannel requests are sent to the client and the client responds with - //a boolean that tells LND whether or not to accept the channel. This allows - //node operators to specify their own criteria for accepting inbound channels - //through a single persistent connection. - ChannelAcceptor(Lightning_ChannelAcceptorServer) error - // lncli: `closechannel` - //CloseChannel attempts to close an active channel identified by its channel - //outpoint (ChannelPoint). The actions of this method can additionally be - //augmented to attempt a force close after a timeout period in the case of an - //inactive peer. If a non-force close (cooperative closure) is requested, - //then the user can specify either a target number of blocks until the - //closure transaction is confirmed, or a manual fee rate. If neither are - //specified, then a default lax, block confirmation target is used. - CloseChannel(*CloseChannelRequest, Lightning_CloseChannelServer) error - // lncli: `abandonchannel` - //AbandonChannel removes all channel state from the database except for a - //close summary. This method can be used to get rid of permanently unusable - //channels due to bugs fixed in newer versions of lnd. This method can also be - //used to remove externally funded channels where the funding transaction was - //never broadcast. Only available for non-externally funded channels in dev - //build. - AbandonChannel(context.Context, *AbandonChannelRequest) (*AbandonChannelResponse, error) - // Deprecated: Do not use. - // lncli: `sendpayment` - //Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - //bi-directional streaming RPC for sending payments through the Lightning - //Network. A single RPC invocation creates a persistent bi-directional - //stream allowing clients to rapidly send payments through the Lightning - //Network with a single persistent connection. - SendPayment(Lightning_SendPaymentServer) error - // - //SendPaymentSync is the synchronous non-streaming version of SendPayment. - //This RPC is intended to be consumed by clients of the REST proxy. - //Additionally, this RPC expects the destination's public key and the payment - //hash (if any) to be encoded as hex strings. - SendPaymentSync(context.Context, *SendRequest) (*SendResponse, error) - // Deprecated: Do not use. - // lncli: `sendtoroute` - //Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - //streaming RPC for sending payment through the Lightning Network. This - //method differs from SendPayment in that it allows users to specify a full - //route manually. This can be used for things like rebalancing, and atomic - //swaps. - SendToRoute(Lightning_SendToRouteServer) error - // - //SendToRouteSync is a synchronous version of SendToRoute. It Will block - //until the payment either fails or succeeds. - SendToRouteSync(context.Context, *SendToRouteRequest) (*SendResponse, error) - // lncli: `addinvoice` - //AddInvoice attempts to add a new invoice to the invoice database. Any - //duplicated invoices are rejected, therefore all invoices *must* have a - //unique payment preimage. - AddInvoice(context.Context, *Invoice) (*AddInvoiceResponse, error) - // lncli: `listinvoices` - //ListInvoices returns a list of all the invoices currently stored within the - //database. Any active debug invoices are ignored. It has full support for - //paginated responses, allowing users to query for specific invoices through - //their add_index. This can be done by using either the first_index_offset or - //last_index_offset fields included in the response as the index_offset of the - //next request. By default, the first 100 invoices created will be returned. - //Backwards pagination is also supported through the Reversed flag. - ListInvoices(context.Context, *ListInvoiceRequest) (*ListInvoiceResponse, error) - // lncli: `lookupinvoice` - //LookupInvoice attempts to look up an invoice according to its payment hash. - //The passed payment hash *must* be exactly 32 bytes, if not, an error is - //returned. - LookupInvoice(context.Context, *PaymentHash) (*Invoice, error) - // - //SubscribeInvoices returns a uni-directional stream (server -> client) for - //notifying the client of newly added/settled invoices. The caller can - //optionally specify the add_index and/or the settle_index. If the add_index - //is specified, then we'll first start by sending add invoice events for all - //invoices with an add_index greater than the specified value. If the - //settle_index is specified, the next, we'll send out all settle events for - //invoices with a settle_index greater than the specified value. One or both - //of these fields can be set. If no fields are set, then we'll only send out - //the latest add/settle events. - SubscribeInvoices(*InvoiceSubscription, Lightning_SubscribeInvoicesServer) error - // lncli: `decodepayreq` - //DecodePayReq takes an encoded payment request string and attempts to decode - //it, returning a full description of the conditions encoded within the - //payment request. - DecodePayReq(context.Context, *PayReqString) (*PayReq, error) - // lncli: `listpayments` - //ListPayments returns a list of all outgoing payments. - ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) - // - //DeleteAllPayments deletes all outgoing payments from DB. - DeleteAllPayments(context.Context, *DeleteAllPaymentsRequest) (*DeleteAllPaymentsResponse, error) - // lncli: `describegraph` - //DescribeGraph returns a description of the latest graph state from the - //point of view of the node. The graph information is partitioned into two - //components: all the nodes/vertexes, and all the edges that connect the - //vertexes themselves. As this is a directed graph, the edges also contain - //the node directional specific routing policy which includes: the time lock - //delta, fee information, etc. - DescribeGraph(context.Context, *ChannelGraphRequest) (*ChannelGraph, error) - // lncli: `getnodemetrics` - //GetNodeMetrics returns node metrics calculated from the graph. Currently - //the only supported metric is betweenness centrality of individual nodes. - GetNodeMetrics(context.Context, *NodeMetricsRequest) (*NodeMetricsResponse, error) - // lncli: `getchaninfo` - //GetChanInfo returns the latest authenticated network announcement for the - //given channel identified by its channel ID: an 8-byte integer which - //uniquely identifies the location of transaction's funding output within the - //blockchain. - GetChanInfo(context.Context, *ChanInfoRequest) (*ChannelEdge, error) - // lncli: `getnodeinfo` - //GetNodeInfo returns the latest advertised, aggregated, and authenticated - //channel information for the specified node identified by its public key. - GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfo, error) - // lncli: `queryroutes` - //QueryRoutes attempts to query the daemon's Channel Router for a possible - //route to a target destination capable of carrying a specific amount of - //satoshis. The returned route contains the full details required to craft and - //send an HTLC, also including the necessary information that should be - //present within the Sphinx packet encapsulated within the HTLC. - // - //When using REST, the `dest_custom_records` map type can be set by appending - //`&dest_custom_records[]=` - //to the URL. Unfortunately this map type doesn't appear in the REST API - //documentation because of a bug in the grpc-gateway library. - QueryRoutes(context.Context, *QueryRoutesRequest) (*QueryRoutesResponse, error) - // lncli: `getnetworkinfo` - //GetNetworkInfo returns some basic stats about the known channel graph from - //the point of view of the node. - GetNetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfo, error) - // lncli: `stop` - //StopDaemon will send a shutdown request to the interrupt handler, triggering - //a graceful shutdown of the daemon. - StopDaemon(context.Context, *StopRequest) (*StopResponse, error) - // - //SubscribeChannelGraph launches a streaming RPC that allows the caller to - //receive notifications upon any changes to the channel graph topology from - //the point of view of the responding node. Events notified include: new - //nodes coming online, nodes updating their authenticated attributes, new - //channels being advertised, updates in the routing policy for a directional - //channel edge, and when channels are closed on-chain. - SubscribeChannelGraph(*GraphTopologySubscription, Lightning_SubscribeChannelGraphServer) error - // lncli: `debuglevel` - //DebugLevel allows a caller to programmatically set the logging verbosity of - //lnd. The logging can be targeted according to a coarse daemon-wide logging - //level, or in a granular fashion to specify the logging for a target - //sub-system. - DebugLevel(context.Context, *DebugLevelRequest) (*DebugLevelResponse, error) - // lncli: `feereport` - //FeeReport allows the caller to obtain a report detailing the current fee - //schedule enforced by the node globally for each channel. - FeeReport(context.Context, *FeeReportRequest) (*FeeReportResponse, error) - // lncli: `updatechanpolicy` - //UpdateChannelPolicy allows the caller to update the fee schedule and - //channel policies for all channels globally, or a particular channel. - UpdateChannelPolicy(context.Context, *PolicyUpdateRequest) (*PolicyUpdateResponse, error) - // lncli: `fwdinghistory` - //ForwardingHistory allows the caller to query the htlcswitch for a record of - //all HTLCs forwarded within the target time range, and integer offset - //within that time range, for a maximum number of events. If no maximum number - //of events is specified, up to 100 events will be returned. If no time-range - //is specified, then events will be returned in the order that they occured. - // - //A list of forwarding events are returned. The size of each forwarding event - //is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - //As a result each message can only contain 50k entries. Each response has - //the index offset of the last entry. The index offset can be provided to the - //request to allow the caller to skip a series of records. - ForwardingHistory(context.Context, *ForwardingHistoryRequest) (*ForwardingHistoryResponse, error) - // lncli: `exportchanbackup` - //ExportChannelBackup attempts to return an encrypted static channel backup - //for the target channel identified by it channel point. The backup is - //encrypted with a key generated from the aezeed seed of the user. The - //returned backup can either be restored using the RestoreChannelBackup - //method once lnd is running, or via the InitWallet and UnlockWallet methods - //from the WalletUnlocker service. - ExportChannelBackup(context.Context, *ExportChannelBackupRequest) (*ChannelBackup, error) - // - //ExportAllChannelBackups returns static channel backups for all existing - //channels known to lnd. A set of regular singular static channel backups for - //each channel are returned. Additionally, a multi-channel backup is returned - //as well, which contains a single encrypted blob containing the backups of - //each channel. - ExportAllChannelBackups(context.Context, *ChanBackupExportRequest) (*ChanBackupSnapshot, error) - // - //VerifyChanBackup allows a caller to verify the integrity of a channel backup - //snapshot. This method will accept either a packed Single or a packed Multi. - //Specifying both will result in an error. - VerifyChanBackup(context.Context, *ChanBackupSnapshot) (*VerifyChanBackupResponse, error) - // lncli: `restorechanbackup` - //RestoreChannelBackups accepts a set of singular channel backups, or a - //single encrypted multi-chan backup and attempts to recover any funds - //remaining within the channel. If we are able to unpack the backup, then the - //new channel will be shown under listchannels, as well as pending channels. - RestoreChannelBackups(context.Context, *RestoreChanBackupRequest) (*RestoreBackupResponse, error) - // - //SubscribeChannelBackups allows a client to sub-subscribe to the most up to - //date information concerning the state of all channel backups. Each time a - //new channel is added, we return the new set of channels, along with a - //multi-chan backup containing the backup info for all channels. Each time a - //channel is closed, we send a new update, which contains new new chan back - //ups, but the updated set of encrypted multi-chan backups with the closed - //channel(s) removed. - SubscribeChannelBackups(*ChannelBackupSubscription, Lightning_SubscribeChannelBackupsServer) error - // lncli: `bakemacaroon` - //BakeMacaroon allows the creation of a new macaroon with custom read and - //write permissions. No first-party caveats are added since this can be done - //offline. - BakeMacaroon(context.Context, *BakeMacaroonRequest) (*BakeMacaroonResponse, error) - // lncli: `listmacaroonids` - //ListMacaroonIDs returns all root key IDs that are in use. - ListMacaroonIDs(context.Context, *ListMacaroonIDsRequest) (*ListMacaroonIDsResponse, error) - // lncli: `deletemacaroonid` - //DeleteMacaroonID deletes the specified macaroon ID and invalidates all - //macaroons derived from that ID. - DeleteMacaroonID(context.Context, *DeleteMacaroonIDRequest) (*DeleteMacaroonIDResponse, error) - // lncli: `listpermissions` - //ListPermissions lists all RPC method URIs and their required macaroon - //permissions to access them. - ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error) -} - -// UnimplementedLightningServer can be embedded to have forward compatible implementations. -type UnimplementedLightningServer struct { -} - -func (*UnimplementedLightningServer) WalletBalance(context.Context, *WalletBalanceRequest) (*WalletBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WalletBalance not implemented") -} -func (*UnimplementedLightningServer) ChannelBalance(context.Context, *ChannelBalanceRequest) (*ChannelBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelBalance not implemented") -} -func (*UnimplementedLightningServer) GetTransactions(context.Context, *GetTransactionsRequest) (*TransactionDetails, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTransactions not implemented") -} -func (*UnimplementedLightningServer) EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimateFee not implemented") -} -func (*UnimplementedLightningServer) SendCoins(context.Context, *SendCoinsRequest) (*SendCoinsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendCoins not implemented") -} -func (*UnimplementedLightningServer) ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUnspent not implemented") -} -func (*UnimplementedLightningServer) SubscribeTransactions(*GetTransactionsRequest, Lightning_SubscribeTransactionsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeTransactions not implemented") -} -func (*UnimplementedLightningServer) SendMany(context.Context, *SendManyRequest) (*SendManyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendMany not implemented") -} -func (*UnimplementedLightningServer) NewAddress(context.Context, *NewAddressRequest) (*NewAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NewAddress not implemented") -} -func (*UnimplementedLightningServer) SignMessage(context.Context, *SignMessageRequest) (*SignMessageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SignMessage not implemented") -} -func (*UnimplementedLightningServer) VerifyMessage(context.Context, *VerifyMessageRequest) (*VerifyMessageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyMessage not implemented") -} -func (*UnimplementedLightningServer) ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConnectPeer not implemented") -} -func (*UnimplementedLightningServer) DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisconnectPeer not implemented") -} -func (*UnimplementedLightningServer) ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") -} -func (*UnimplementedLightningServer) SubscribePeerEvents(*PeerEventSubscription, Lightning_SubscribePeerEventsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribePeerEvents not implemented") -} -func (*UnimplementedLightningServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") -} -func (*UnimplementedLightningServer) GetRecoveryInfo(context.Context, *GetRecoveryInfoRequest) (*GetRecoveryInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRecoveryInfo not implemented") -} -func (*UnimplementedLightningServer) PendingChannels(context.Context, *PendingChannelsRequest) (*PendingChannelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PendingChannels not implemented") -} -func (*UnimplementedLightningServer) ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListChannels not implemented") -} -func (*UnimplementedLightningServer) SubscribeChannelEvents(*ChannelEventSubscription, Lightning_SubscribeChannelEventsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeChannelEvents not implemented") -} -func (*UnimplementedLightningServer) ClosedChannels(context.Context, *ClosedChannelsRequest) (*ClosedChannelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClosedChannels not implemented") -} -func (*UnimplementedLightningServer) OpenChannelSync(context.Context, *OpenChannelRequest) (*ChannelPoint, error) { - return nil, status.Errorf(codes.Unimplemented, "method OpenChannelSync not implemented") -} -func (*UnimplementedLightningServer) OpenChannel(*OpenChannelRequest, Lightning_OpenChannelServer) error { - return status.Errorf(codes.Unimplemented, "method OpenChannel not implemented") -} -func (*UnimplementedLightningServer) FundingStateStep(context.Context, *FundingTransitionMsg) (*FundingStateStepResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method FundingStateStep not implemented") -} -func (*UnimplementedLightningServer) ChannelAcceptor(Lightning_ChannelAcceptorServer) error { - return status.Errorf(codes.Unimplemented, "method ChannelAcceptor not implemented") -} -func (*UnimplementedLightningServer) CloseChannel(*CloseChannelRequest, Lightning_CloseChannelServer) error { - return status.Errorf(codes.Unimplemented, "method CloseChannel not implemented") -} -func (*UnimplementedLightningServer) AbandonChannel(context.Context, *AbandonChannelRequest) (*AbandonChannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AbandonChannel not implemented") -} -func (*UnimplementedLightningServer) SendPayment(Lightning_SendPaymentServer) error { - return status.Errorf(codes.Unimplemented, "method SendPayment not implemented") -} -func (*UnimplementedLightningServer) SendPaymentSync(context.Context, *SendRequest) (*SendResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendPaymentSync not implemented") -} -func (*UnimplementedLightningServer) SendToRoute(Lightning_SendToRouteServer) error { - return status.Errorf(codes.Unimplemented, "method SendToRoute not implemented") -} -func (*UnimplementedLightningServer) SendToRouteSync(context.Context, *SendToRouteRequest) (*SendResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendToRouteSync not implemented") -} -func (*UnimplementedLightningServer) AddInvoice(context.Context, *Invoice) (*AddInvoiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddInvoice not implemented") -} -func (*UnimplementedLightningServer) ListInvoices(context.Context, *ListInvoiceRequest) (*ListInvoiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListInvoices not implemented") -} -func (*UnimplementedLightningServer) LookupInvoice(context.Context, *PaymentHash) (*Invoice, error) { - return nil, status.Errorf(codes.Unimplemented, "method LookupInvoice not implemented") -} -func (*UnimplementedLightningServer) SubscribeInvoices(*InvoiceSubscription, Lightning_SubscribeInvoicesServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeInvoices not implemented") -} -func (*UnimplementedLightningServer) DecodePayReq(context.Context, *PayReqString) (*PayReq, error) { - return nil, status.Errorf(codes.Unimplemented, "method DecodePayReq not implemented") -} -func (*UnimplementedLightningServer) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPayments not implemented") -} -func (*UnimplementedLightningServer) DeleteAllPayments(context.Context, *DeleteAllPaymentsRequest) (*DeleteAllPaymentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAllPayments not implemented") -} -func (*UnimplementedLightningServer) DescribeGraph(context.Context, *ChannelGraphRequest) (*ChannelGraph, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeGraph not implemented") -} -func (*UnimplementedLightningServer) GetNodeMetrics(context.Context, *NodeMetricsRequest) (*NodeMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNodeMetrics not implemented") -} -func (*UnimplementedLightningServer) GetChanInfo(context.Context, *ChanInfoRequest) (*ChannelEdge, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetChanInfo not implemented") -} -func (*UnimplementedLightningServer) GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfo, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") -} -func (*UnimplementedLightningServer) QueryRoutes(context.Context, *QueryRoutesRequest) (*QueryRoutesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryRoutes not implemented") -} -func (*UnimplementedLightningServer) GetNetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfo, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNetworkInfo not implemented") -} -func (*UnimplementedLightningServer) StopDaemon(context.Context, *StopRequest) (*StopResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StopDaemon not implemented") -} -func (*UnimplementedLightningServer) SubscribeChannelGraph(*GraphTopologySubscription, Lightning_SubscribeChannelGraphServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeChannelGraph not implemented") -} -func (*UnimplementedLightningServer) DebugLevel(context.Context, *DebugLevelRequest) (*DebugLevelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DebugLevel not implemented") -} -func (*UnimplementedLightningServer) FeeReport(context.Context, *FeeReportRequest) (*FeeReportResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FeeReport not implemented") -} -func (*UnimplementedLightningServer) UpdateChannelPolicy(context.Context, *PolicyUpdateRequest) (*PolicyUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateChannelPolicy not implemented") -} -func (*UnimplementedLightningServer) ForwardingHistory(context.Context, *ForwardingHistoryRequest) (*ForwardingHistoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ForwardingHistory not implemented") -} -func (*UnimplementedLightningServer) ExportChannelBackup(context.Context, *ExportChannelBackupRequest) (*ChannelBackup, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExportChannelBackup not implemented") -} -func (*UnimplementedLightningServer) ExportAllChannelBackups(context.Context, *ChanBackupExportRequest) (*ChanBackupSnapshot, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExportAllChannelBackups not implemented") -} -func (*UnimplementedLightningServer) VerifyChanBackup(context.Context, *ChanBackupSnapshot) (*VerifyChanBackupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyChanBackup not implemented") -} -func (*UnimplementedLightningServer) RestoreChannelBackups(context.Context, *RestoreChanBackupRequest) (*RestoreBackupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RestoreChannelBackups not implemented") -} -func (*UnimplementedLightningServer) SubscribeChannelBackups(*ChannelBackupSubscription, Lightning_SubscribeChannelBackupsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeChannelBackups not implemented") -} -func (*UnimplementedLightningServer) BakeMacaroon(context.Context, *BakeMacaroonRequest) (*BakeMacaroonResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BakeMacaroon not implemented") -} -func (*UnimplementedLightningServer) ListMacaroonIDs(context.Context, *ListMacaroonIDsRequest) (*ListMacaroonIDsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListMacaroonIDs not implemented") -} -func (*UnimplementedLightningServer) DeleteMacaroonID(context.Context, *DeleteMacaroonIDRequest) (*DeleteMacaroonIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteMacaroonID not implemented") -} -func (*UnimplementedLightningServer) ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPermissions not implemented") -} - -func RegisterLightningServer(s *grpc.Server, srv LightningServer) { - s.RegisterService(&_Lightning_serviceDesc, srv) -} - -func _Lightning_WalletBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WalletBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).WalletBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/WalletBalance", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).WalletBalance(ctx, req.(*WalletBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ChannelBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChannelBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ChannelBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ChannelBalance", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ChannelBalance(ctx, req.(*ChannelBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_GetTransactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTransactionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetTransactions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetTransactions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetTransactions(ctx, req.(*GetTransactionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_EstimateFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EstimateFeeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).EstimateFee(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/EstimateFee", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).EstimateFee(ctx, req.(*EstimateFeeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SendCoins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendCoinsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).SendCoins(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/SendCoins", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).SendCoins(ctx, req.(*SendCoinsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListUnspent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUnspentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListUnspent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListUnspent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListUnspent(ctx, req.(*ListUnspentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SubscribeTransactions_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetTransactionsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).SubscribeTransactions(m, &lightningSubscribeTransactionsServer{stream}) -} - -type Lightning_SubscribeTransactionsServer interface { - Send(*Transaction) error - grpc.ServerStream -} - -type lightningSubscribeTransactionsServer struct { - grpc.ServerStream -} - -func (x *lightningSubscribeTransactionsServer) Send(m *Transaction) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_SendMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendManyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).SendMany(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/SendMany", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).SendMany(ctx, req.(*SendManyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_NewAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NewAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).NewAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/NewAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).NewAddress(ctx, req.(*NewAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SignMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).SignMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/SignMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).SignMessage(ctx, req.(*SignMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_VerifyMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).VerifyMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/VerifyMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).VerifyMessage(ctx, req.(*VerifyMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ConnectPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConnectPeerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ConnectPeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ConnectPeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ConnectPeer(ctx, req.(*ConnectPeerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_DisconnectPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisconnectPeerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).DisconnectPeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/DisconnectPeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).DisconnectPeer(ctx, req.(*DisconnectPeerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPeersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListPeers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListPeers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListPeers(ctx, req.(*ListPeersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SubscribePeerEvents_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(PeerEventSubscription) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).SubscribePeerEvents(m, &lightningSubscribePeerEventsServer{stream}) -} - -type Lightning_SubscribePeerEventsServer interface { - Send(*PeerEvent) error - grpc.ServerStream -} - -type lightningSubscribePeerEventsServer struct { - grpc.ServerStream -} - -func (x *lightningSubscribePeerEventsServer) Send(m *PeerEvent) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetInfo(ctx, req.(*GetInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_GetRecoveryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRecoveryInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetRecoveryInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetRecoveryInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetRecoveryInfo(ctx, req.(*GetRecoveryInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_PendingChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PendingChannelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).PendingChannels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/PendingChannels", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).PendingChannels(ctx, req.(*PendingChannelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListChannelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListChannels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListChannels", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListChannels(ctx, req.(*ListChannelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SubscribeChannelEvents_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ChannelEventSubscription) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).SubscribeChannelEvents(m, &lightningSubscribeChannelEventsServer{stream}) -} - -type Lightning_SubscribeChannelEventsServer interface { - Send(*ChannelEventUpdate) error - grpc.ServerStream -} - -type lightningSubscribeChannelEventsServer struct { - grpc.ServerStream -} - -func (x *lightningSubscribeChannelEventsServer) Send(m *ChannelEventUpdate) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_ClosedChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ClosedChannelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ClosedChannels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ClosedChannels", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ClosedChannels(ctx, req.(*ClosedChannelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_OpenChannelSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(OpenChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).OpenChannelSync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/OpenChannelSync", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).OpenChannelSync(ctx, req.(*OpenChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_OpenChannel_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(OpenChannelRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).OpenChannel(m, &lightningOpenChannelServer{stream}) -} - -type Lightning_OpenChannelServer interface { - Send(*OpenStatusUpdate) error - grpc.ServerStream -} - -type lightningOpenChannelServer struct { - grpc.ServerStream -} - -func (x *lightningOpenChannelServer) Send(m *OpenStatusUpdate) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_FundingStateStep_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FundingTransitionMsg) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).FundingStateStep(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/FundingStateStep", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).FundingStateStep(ctx, req.(*FundingTransitionMsg)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ChannelAcceptor_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LightningServer).ChannelAcceptor(&lightningChannelAcceptorServer{stream}) -} - -type Lightning_ChannelAcceptorServer interface { - Send(*ChannelAcceptRequest) error - Recv() (*ChannelAcceptResponse, error) - grpc.ServerStream -} - -type lightningChannelAcceptorServer struct { - grpc.ServerStream -} - -func (x *lightningChannelAcceptorServer) Send(m *ChannelAcceptRequest) error { - return x.ServerStream.SendMsg(m) -} - -func (x *lightningChannelAcceptorServer) Recv() (*ChannelAcceptResponse, error) { - m := new(ChannelAcceptResponse) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Lightning_CloseChannel_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(CloseChannelRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).CloseChannel(m, &lightningCloseChannelServer{stream}) -} - -type Lightning_CloseChannelServer interface { - Send(*CloseStatusUpdate) error - grpc.ServerStream -} - -type lightningCloseChannelServer struct { - grpc.ServerStream -} - -func (x *lightningCloseChannelServer) Send(m *CloseStatusUpdate) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_AbandonChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AbandonChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).AbandonChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/AbandonChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).AbandonChannel(ctx, req.(*AbandonChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SendPayment_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LightningServer).SendPayment(&lightningSendPaymentServer{stream}) -} - -type Lightning_SendPaymentServer interface { - Send(*SendResponse) error - Recv() (*SendRequest, error) - grpc.ServerStream -} - -type lightningSendPaymentServer struct { - grpc.ServerStream -} - -func (x *lightningSendPaymentServer) Send(m *SendResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *lightningSendPaymentServer) Recv() (*SendRequest, error) { - m := new(SendRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Lightning_SendPaymentSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).SendPaymentSync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/SendPaymentSync", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).SendPaymentSync(ctx, req.(*SendRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SendToRoute_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LightningServer).SendToRoute(&lightningSendToRouteServer{stream}) -} - -type Lightning_SendToRouteServer interface { - Send(*SendResponse) error - Recv() (*SendToRouteRequest, error) - grpc.ServerStream -} - -type lightningSendToRouteServer struct { - grpc.ServerStream -} - -func (x *lightningSendToRouteServer) Send(m *SendResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *lightningSendToRouteServer) Recv() (*SendToRouteRequest, error) { - m := new(SendToRouteRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Lightning_SendToRouteSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendToRouteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).SendToRouteSync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/SendToRouteSync", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).SendToRouteSync(ctx, req.(*SendToRouteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_AddInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Invoice) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).AddInvoice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/AddInvoice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).AddInvoice(ctx, req.(*Invoice)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListInvoices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListInvoiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListInvoices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListInvoices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListInvoices(ctx, req.(*ListInvoiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_LookupInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PaymentHash) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).LookupInvoice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/LookupInvoice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).LookupInvoice(ctx, req.(*PaymentHash)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SubscribeInvoices_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(InvoiceSubscription) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).SubscribeInvoices(m, &lightningSubscribeInvoicesServer{stream}) -} - -type Lightning_SubscribeInvoicesServer interface { - Send(*Invoice) error - grpc.ServerStream -} - -type lightningSubscribeInvoicesServer struct { - grpc.ServerStream -} - -func (x *lightningSubscribeInvoicesServer) Send(m *Invoice) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_DecodePayReq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PayReqString) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).DecodePayReq(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/DecodePayReq", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).DecodePayReq(ctx, req.(*PayReqString)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPaymentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListPayments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListPayments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListPayments(ctx, req.(*ListPaymentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_DeleteAllPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAllPaymentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).DeleteAllPayments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/DeleteAllPayments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).DeleteAllPayments(ctx, req.(*DeleteAllPaymentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_DescribeGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChannelGraphRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).DescribeGraph(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/DescribeGraph", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).DescribeGraph(ctx, req.(*ChannelGraphRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_GetNodeMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeMetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetNodeMetrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetNodeMetrics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetNodeMetrics(ctx, req.(*NodeMetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_GetChanInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChanInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetChanInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetChanInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetChanInfo(ctx, req.(*ChanInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetNodeInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetNodeInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetNodeInfo(ctx, req.(*NodeInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_QueryRoutes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRoutesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).QueryRoutes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/QueryRoutes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).QueryRoutes(ctx, req.(*QueryRoutesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_GetNetworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NetworkInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).GetNetworkInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/GetNetworkInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).GetNetworkInfo(ctx, req.(*NetworkInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_StopDaemon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StopRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).StopDaemon(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/StopDaemon", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).StopDaemon(ctx, req.(*StopRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SubscribeChannelGraph_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GraphTopologySubscription) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).SubscribeChannelGraph(m, &lightningSubscribeChannelGraphServer{stream}) -} - -type Lightning_SubscribeChannelGraphServer interface { - Send(*GraphTopologyUpdate) error - grpc.ServerStream -} - -type lightningSubscribeChannelGraphServer struct { - grpc.ServerStream -} - -func (x *lightningSubscribeChannelGraphServer) Send(m *GraphTopologyUpdate) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_DebugLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DebugLevelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).DebugLevel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/DebugLevel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).DebugLevel(ctx, req.(*DebugLevelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_FeeReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FeeReportRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).FeeReport(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/FeeReport", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).FeeReport(ctx, req.(*FeeReportRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_UpdateChannelPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PolicyUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).UpdateChannelPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/UpdateChannelPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).UpdateChannelPolicy(ctx, req.(*PolicyUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ForwardingHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ForwardingHistoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ForwardingHistory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ForwardingHistory", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ForwardingHistory(ctx, req.(*ForwardingHistoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ExportChannelBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExportChannelBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ExportChannelBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ExportChannelBackup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ExportChannelBackup(ctx, req.(*ExportChannelBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ExportAllChannelBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChanBackupExportRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ExportAllChannelBackups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ExportAllChannelBackups", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ExportAllChannelBackups(ctx, req.(*ChanBackupExportRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_VerifyChanBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChanBackupSnapshot) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).VerifyChanBackup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/VerifyChanBackup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).VerifyChanBackup(ctx, req.(*ChanBackupSnapshot)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_RestoreChannelBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestoreChanBackupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).RestoreChannelBackups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/RestoreChannelBackups", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).RestoreChannelBackups(ctx, req.(*RestoreChanBackupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_SubscribeChannelBackups_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ChannelBackupSubscription) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LightningServer).SubscribeChannelBackups(m, &lightningSubscribeChannelBackupsServer{stream}) -} - -type Lightning_SubscribeChannelBackupsServer interface { - Send(*ChanBackupSnapshot) error - grpc.ServerStream -} - -type lightningSubscribeChannelBackupsServer struct { - grpc.ServerStream -} - -func (x *lightningSubscribeChannelBackupsServer) Send(m *ChanBackupSnapshot) error { - return x.ServerStream.SendMsg(m) -} - -func _Lightning_BakeMacaroon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BakeMacaroonRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).BakeMacaroon(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/BakeMacaroon", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).BakeMacaroon(ctx, req.(*BakeMacaroonRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListMacaroonIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListMacaroonIDsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListMacaroonIDs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListMacaroonIDs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListMacaroonIDs(ctx, req.(*ListMacaroonIDsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_DeleteMacaroonID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteMacaroonIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).DeleteMacaroonID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/DeleteMacaroonID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).DeleteMacaroonID(ctx, req.(*DeleteMacaroonIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lightning_ListPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPermissionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightningServer).ListPermissions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.Lightning/ListPermissions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightningServer).ListPermissions(ctx, req.(*ListPermissionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Lightning_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lnrpc.Lightning", - HandlerType: (*LightningServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "WalletBalance", - Handler: _Lightning_WalletBalance_Handler, - }, - { - MethodName: "ChannelBalance", - Handler: _Lightning_ChannelBalance_Handler, - }, - { - MethodName: "GetTransactions", - Handler: _Lightning_GetTransactions_Handler, - }, - { - MethodName: "EstimateFee", - Handler: _Lightning_EstimateFee_Handler, - }, - { - MethodName: "SendCoins", - Handler: _Lightning_SendCoins_Handler, - }, - { - MethodName: "ListUnspent", - Handler: _Lightning_ListUnspent_Handler, - }, - { - MethodName: "SendMany", - Handler: _Lightning_SendMany_Handler, - }, - { - MethodName: "NewAddress", - Handler: _Lightning_NewAddress_Handler, - }, - { - MethodName: "SignMessage", - Handler: _Lightning_SignMessage_Handler, - }, - { - MethodName: "VerifyMessage", - Handler: _Lightning_VerifyMessage_Handler, - }, - { - MethodName: "ConnectPeer", - Handler: _Lightning_ConnectPeer_Handler, - }, - { - MethodName: "DisconnectPeer", - Handler: _Lightning_DisconnectPeer_Handler, - }, - { - MethodName: "ListPeers", - Handler: _Lightning_ListPeers_Handler, - }, - { - MethodName: "GetInfo", - Handler: _Lightning_GetInfo_Handler, - }, - { - MethodName: "GetRecoveryInfo", - Handler: _Lightning_GetRecoveryInfo_Handler, - }, - { - MethodName: "PendingChannels", - Handler: _Lightning_PendingChannels_Handler, - }, - { - MethodName: "ListChannels", - Handler: _Lightning_ListChannels_Handler, - }, - { - MethodName: "ClosedChannels", - Handler: _Lightning_ClosedChannels_Handler, - }, - { - MethodName: "OpenChannelSync", - Handler: _Lightning_OpenChannelSync_Handler, - }, - { - MethodName: "FundingStateStep", - Handler: _Lightning_FundingStateStep_Handler, - }, - { - MethodName: "AbandonChannel", - Handler: _Lightning_AbandonChannel_Handler, - }, - { - MethodName: "SendPaymentSync", - Handler: _Lightning_SendPaymentSync_Handler, - }, - { - MethodName: "SendToRouteSync", - Handler: _Lightning_SendToRouteSync_Handler, - }, - { - MethodName: "AddInvoice", - Handler: _Lightning_AddInvoice_Handler, - }, - { - MethodName: "ListInvoices", - Handler: _Lightning_ListInvoices_Handler, - }, - { - MethodName: "LookupInvoice", - Handler: _Lightning_LookupInvoice_Handler, - }, - { - MethodName: "DecodePayReq", - Handler: _Lightning_DecodePayReq_Handler, - }, - { - MethodName: "ListPayments", - Handler: _Lightning_ListPayments_Handler, - }, - { - MethodName: "DeleteAllPayments", - Handler: _Lightning_DeleteAllPayments_Handler, - }, - { - MethodName: "DescribeGraph", - Handler: _Lightning_DescribeGraph_Handler, - }, - { - MethodName: "GetNodeMetrics", - Handler: _Lightning_GetNodeMetrics_Handler, - }, - { - MethodName: "GetChanInfo", - Handler: _Lightning_GetChanInfo_Handler, - }, - { - MethodName: "GetNodeInfo", - Handler: _Lightning_GetNodeInfo_Handler, - }, - { - MethodName: "QueryRoutes", - Handler: _Lightning_QueryRoutes_Handler, - }, - { - MethodName: "GetNetworkInfo", - Handler: _Lightning_GetNetworkInfo_Handler, - }, - { - MethodName: "StopDaemon", - Handler: _Lightning_StopDaemon_Handler, - }, - { - MethodName: "DebugLevel", - Handler: _Lightning_DebugLevel_Handler, - }, - { - MethodName: "FeeReport", - Handler: _Lightning_FeeReport_Handler, - }, - { - MethodName: "UpdateChannelPolicy", - Handler: _Lightning_UpdateChannelPolicy_Handler, - }, - { - MethodName: "ForwardingHistory", - Handler: _Lightning_ForwardingHistory_Handler, - }, - { - MethodName: "ExportChannelBackup", - Handler: _Lightning_ExportChannelBackup_Handler, - }, - { - MethodName: "ExportAllChannelBackups", - Handler: _Lightning_ExportAllChannelBackups_Handler, - }, - { - MethodName: "VerifyChanBackup", - Handler: _Lightning_VerifyChanBackup_Handler, - }, - { - MethodName: "RestoreChannelBackups", - Handler: _Lightning_RestoreChannelBackups_Handler, - }, - { - MethodName: "BakeMacaroon", - Handler: _Lightning_BakeMacaroon_Handler, - }, - { - MethodName: "ListMacaroonIDs", - Handler: _Lightning_ListMacaroonIDs_Handler, - }, - { - MethodName: "DeleteMacaroonID", - Handler: _Lightning_DeleteMacaroonID_Handler, - }, - { - MethodName: "ListPermissions", - Handler: _Lightning_ListPermissions_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SubscribeTransactions", - Handler: _Lightning_SubscribeTransactions_Handler, - ServerStreams: true, - }, - { - StreamName: "SubscribePeerEvents", - Handler: _Lightning_SubscribePeerEvents_Handler, - ServerStreams: true, - }, - { - StreamName: "SubscribeChannelEvents", - Handler: _Lightning_SubscribeChannelEvents_Handler, - ServerStreams: true, - }, - { - StreamName: "OpenChannel", - Handler: _Lightning_OpenChannel_Handler, - ServerStreams: true, - }, - { - StreamName: "ChannelAcceptor", - Handler: _Lightning_ChannelAcceptor_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "CloseChannel", - Handler: _Lightning_CloseChannel_Handler, - ServerStreams: true, - }, - { - StreamName: "SendPayment", - Handler: _Lightning_SendPayment_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "SendToRoute", - Handler: _Lightning_SendToRoute_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "SubscribeInvoices", - Handler: _Lightning_SubscribeInvoices_Handler, - ServerStreams: true, - }, - { - StreamName: "SubscribeChannelGraph", - Handler: _Lightning_SubscribeChannelGraph_Handler, - ServerStreams: true, - }, - { - StreamName: "SubscribeChannelBackups", - Handler: _Lightning_SubscribeChannelBackups_Handler, - ServerStreams: true, - }, - }, - Metadata: "lightning.proto", -} diff --git a/lnrpc/lightning.pb.gw.go b/lnrpc/lightning.pb.gw.go index 4f9848cd2..b15b72813 100644 --- a/lnrpc/lightning.pb.gw.go +++ b/lnrpc/lightning.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Lightning_WalletBalance_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq WalletBalanceRequest @@ -91,7 +91,10 @@ func local_request_Lightning_GetTransactions_0(ctx context.Context, marshaler ru var protoReq GetTransactionsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_GetTransactions_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_GetTransactions_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -124,7 +127,10 @@ func local_request_Lightning_EstimateFee_0(ctx context.Context, marshaler runtim var protoReq EstimateFeeRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_EstimateFee_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_EstimateFee_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -191,7 +197,10 @@ func local_request_Lightning_ListUnspent_0(ctx context.Context, marshaler runtim var protoReq ListUnspentRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ListUnspent_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ListUnspent_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -286,7 +295,10 @@ func local_request_Lightning_NewAddress_0(ctx context.Context, marshaler runtime var protoReq NewAddressRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_NewAddress_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_NewAddress_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -414,7 +426,6 @@ func request_Lightning_DisconnectPeer_0(ctx context.Context, marshaler runtime.M } protoReq.PubKey, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) } @@ -441,7 +452,6 @@ func local_request_Lightning_DisconnectPeer_0(ctx context.Context, marshaler run } protoReq.PubKey, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) } @@ -475,7 +485,10 @@ func local_request_Lightning_ListPeers_0(ctx context.Context, marshaler runtime. var protoReq ListPeersRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ListPeers_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ListPeers_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -579,7 +592,10 @@ func local_request_Lightning_ListChannels_0(ctx context.Context, marshaler runti var protoReq ListChannelsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ListChannels_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ListChannels_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -629,7 +645,10 @@ func local_request_Lightning_ClosedChannels_0(ctx context.Context, marshaler run var protoReq ClosedChannelsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ClosedChannels_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ClosedChannels_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -804,7 +823,6 @@ func request_Lightning_CloseChannel_0(ctx context.Context, marshaler runtime.Mar } err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.funding_txid_str", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_point.funding_txid_str", err) } @@ -815,7 +833,6 @@ func request_Lightning_CloseChannel_0(ctx context.Context, marshaler runtime.Mar } err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.output_index", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_point.output_index", err) } @@ -861,7 +878,6 @@ func request_Lightning_AbandonChannel_0(ctx context.Context, marshaler runtime.M } err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.funding_txid_str", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_point.funding_txid_str", err) } @@ -872,7 +888,6 @@ func request_Lightning_AbandonChannel_0(ctx context.Context, marshaler runtime.M } err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.output_index", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_point.output_index", err) } @@ -906,7 +921,6 @@ func local_request_Lightning_AbandonChannel_0(ctx context.Context, marshaler run } err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.funding_txid_str", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_point.funding_txid_str", err) } @@ -917,12 +931,14 @@ func local_request_Lightning_AbandonChannel_0(ctx context.Context, marshaler run } err = runtime.PopulateFieldFromPath(&protoReq, "channel_point.output_index", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_point.output_index", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_AbandonChannel_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_AbandonChannel_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1109,7 +1125,10 @@ func local_request_Lightning_ListInvoices_0(ctx context.Context, marshaler runti var protoReq ListInvoiceRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ListInvoices_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ListInvoices_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1139,7 +1158,6 @@ func request_Lightning_LookupInvoice_0(ctx context.Context, marshaler runtime.Ma } protoReq.RHashStr, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "r_hash_str", err) } @@ -1173,12 +1191,14 @@ func local_request_Lightning_LookupInvoice_0(ctx context.Context, marshaler runt } protoReq.RHashStr, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "r_hash_str", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_LookupInvoice_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_LookupInvoice_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1232,7 +1252,6 @@ func request_Lightning_DecodePayReq_0(ctx context.Context, marshaler runtime.Mar } protoReq.PayReq, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pay_req", err) } @@ -1259,7 +1278,6 @@ func local_request_Lightning_DecodePayReq_0(ctx context.Context, marshaler runti } protoReq.PayReq, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pay_req", err) } @@ -1293,7 +1311,10 @@ func local_request_Lightning_ListPayments_0(ctx context.Context, marshaler runti var protoReq ListPaymentsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ListPayments_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ListPayments_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1326,7 +1347,10 @@ func local_request_Lightning_DeleteAllPayments_0(ctx context.Context, marshaler var protoReq DeleteAllPaymentsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_DeleteAllPayments_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_DeleteAllPayments_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1359,7 +1383,10 @@ func local_request_Lightning_DescribeGraph_0(ctx context.Context, marshaler runt var protoReq ChannelGraphRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_DescribeGraph_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_DescribeGraph_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1392,7 +1419,10 @@ func local_request_Lightning_GetNodeMetrics_0(ctx context.Context, marshaler run var protoReq NodeMetricsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_GetNodeMetrics_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_GetNodeMetrics_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1418,7 +1448,6 @@ func request_Lightning_GetChanInfo_0(ctx context.Context, marshaler runtime.Mars } protoReq.ChanId, err = runtime.Uint64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chan_id", err) } @@ -1445,7 +1474,6 @@ func local_request_Lightning_GetChanInfo_0(ctx context.Context, marshaler runtim } protoReq.ChanId, err = runtime.Uint64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chan_id", err) } @@ -1476,7 +1504,6 @@ func request_Lightning_GetNodeInfo_0(ctx context.Context, marshaler runtime.Mars } protoReq.PubKey, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) } @@ -1510,12 +1537,14 @@ func local_request_Lightning_GetNodeInfo_0(ctx context.Context, marshaler runtim } protoReq.PubKey, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_GetNodeInfo_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_GetNodeInfo_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1545,7 +1574,6 @@ func request_Lightning_QueryRoutes_0(ctx context.Context, marshaler runtime.Mars } protoReq.PubKey, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) } @@ -1556,7 +1584,6 @@ func request_Lightning_QueryRoutes_0(ctx context.Context, marshaler runtime.Mars } protoReq.Amt, err = runtime.Int64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amt", err) } @@ -1590,7 +1617,6 @@ func local_request_Lightning_QueryRoutes_0(ctx context.Context, marshaler runtim } protoReq.PubKey, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) } @@ -1601,12 +1627,14 @@ func local_request_Lightning_QueryRoutes_0(ctx context.Context, marshaler runtim } protoReq.Amt, err = runtime.Int64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amt", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_QueryRoutes_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_QueryRoutes_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -1825,7 +1853,6 @@ func request_Lightning_ExportChannelBackup_0(ctx context.Context, marshaler runt } err = runtime.PopulateFieldFromPath(&protoReq, "chan_point.funding_txid_str", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chan_point.funding_txid_str", err) } @@ -1836,7 +1863,6 @@ func request_Lightning_ExportChannelBackup_0(ctx context.Context, marshaler runt } err = runtime.PopulateFieldFromPath(&protoReq, "chan_point.output_index", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chan_point.output_index", err) } @@ -1870,7 +1896,6 @@ func local_request_Lightning_ExportChannelBackup_0(ctx context.Context, marshale } err = runtime.PopulateFieldFromPath(&protoReq, "chan_point.funding_txid_str", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chan_point.funding_txid_str", err) } @@ -1881,12 +1906,14 @@ func local_request_Lightning_ExportChannelBackup_0(ctx context.Context, marshale } err = runtime.PopulateFieldFromPath(&protoReq, "chan_point.output_index", val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chan_point.output_index", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ExportChannelBackup_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Lightning_ExportChannelBackup_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -2067,7 +2094,6 @@ func request_Lightning_DeleteMacaroonID_0(ctx context.Context, marshaler runtime } protoReq.RootKeyId, err = runtime.Uint64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "root_key_id", err) } @@ -2094,7 +2120,6 @@ func local_request_Lightning_DeleteMacaroonID_0(ctx context.Context, marshaler r } protoReq.RootKeyId, err = runtime.Uint64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "root_key_id", err) } @@ -2125,18 +2150,22 @@ func local_request_Lightning_ListPermissions_0(ctx context.Context, marshaler ru // RegisterLightningHandlerServer registers the http handlers for service Lightning to "mux". // UnaryRPC :call LightningServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLightningHandlerFromEndpoint instead. func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LightningServer) error { mux.Handle("GET", pattern_Lightning_WalletBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/WalletBalance", runtime.WithHTTPPathPattern("/v1/balance/blockchain")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_WalletBalance_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2150,13 +2179,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ChannelBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ChannelBalance", runtime.WithHTTPPathPattern("/v1/balance/channels")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ChannelBalance_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2170,13 +2202,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetTransactions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetTransactions", runtime.WithHTTPPathPattern("/v1/transactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetTransactions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2190,13 +2225,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_EstimateFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/EstimateFee", runtime.WithHTTPPathPattern("/v1/transactions/fee")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_EstimateFee_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2210,13 +2248,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_SendCoins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/SendCoins", runtime.WithHTTPPathPattern("/v1/transactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_SendCoins_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2230,13 +2271,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListUnspent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListUnspent", runtime.WithHTTPPathPattern("/v1/utxos")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListUnspent_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2257,13 +2301,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_SendMany_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/SendMany", runtime.WithHTTPPathPattern("/v1/transactions/many")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_SendMany_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2277,13 +2324,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_NewAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/NewAddress", runtime.WithHTTPPathPattern("/v1/newaddress")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_NewAddress_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2297,13 +2347,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_SignMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/SignMessage", runtime.WithHTTPPathPattern("/v1/signmessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_SignMessage_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2317,13 +2370,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_VerifyMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/VerifyMessage", runtime.WithHTTPPathPattern("/v1/verifymessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_VerifyMessage_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2337,13 +2393,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_ConnectPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ConnectPeer", runtime.WithHTTPPathPattern("/v1/peers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ConnectPeer_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2357,13 +2416,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("DELETE", pattern_Lightning_DisconnectPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/DisconnectPeer", runtime.WithHTTPPathPattern("/v1/peers/{pub_key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_DisconnectPeer_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2377,13 +2439,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListPeers", runtime.WithHTTPPathPattern("/v1/peers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListPeers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2404,13 +2469,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetInfo", runtime.WithHTTPPathPattern("/v1/getinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2424,13 +2492,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetRecoveryInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetRecoveryInfo", runtime.WithHTTPPathPattern("/v1/getrecoveryinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetRecoveryInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2444,13 +2515,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_PendingChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/PendingChannels", runtime.WithHTTPPathPattern("/v1/channels/pending")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_PendingChannels_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2464,13 +2538,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListChannels", runtime.WithHTTPPathPattern("/v1/channels")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListChannels_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2491,13 +2568,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ClosedChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ClosedChannels", runtime.WithHTTPPathPattern("/v1/channels/closed")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ClosedChannels_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2511,13 +2591,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_OpenChannelSync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/OpenChannelSync", runtime.WithHTTPPathPattern("/v1/channels")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_OpenChannelSync_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2538,13 +2621,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_FundingStateStep_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/FundingStateStep", runtime.WithHTTPPathPattern("/v1/funding/step")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_FundingStateStep_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2572,13 +2658,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("DELETE", pattern_Lightning_AbandonChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/AbandonChannel", runtime.WithHTTPPathPattern("/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_AbandonChannel_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2599,13 +2688,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_SendPaymentSync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/SendPaymentSync", runtime.WithHTTPPathPattern("/v1/channels/transactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_SendPaymentSync_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2619,13 +2711,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_SendToRouteSync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/SendToRouteSync", runtime.WithHTTPPathPattern("/v1/channels/transactions/route")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_SendToRouteSync_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2639,13 +2734,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_AddInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/AddInvoice", runtime.WithHTTPPathPattern("/v1/invoices")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_AddInvoice_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2659,13 +2757,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListInvoices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListInvoices", runtime.WithHTTPPathPattern("/v1/invoices")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListInvoices_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2679,13 +2780,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_LookupInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/LookupInvoice", runtime.WithHTTPPathPattern("/v1/invoice/{r_hash_str}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_LookupInvoice_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2706,13 +2810,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_DecodePayReq_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/DecodePayReq", runtime.WithHTTPPathPattern("/v1/payreq/{pay_req}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_DecodePayReq_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2726,13 +2833,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListPayments", runtime.WithHTTPPathPattern("/v1/payments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListPayments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2746,13 +2856,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("DELETE", pattern_Lightning_DeleteAllPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/DeleteAllPayments", runtime.WithHTTPPathPattern("/v1/payments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_DeleteAllPayments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2766,13 +2879,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_DescribeGraph_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/DescribeGraph", runtime.WithHTTPPathPattern("/v1/graph")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_DescribeGraph_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2786,13 +2902,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetNodeMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetNodeMetrics", runtime.WithHTTPPathPattern("/v1/graph/nodemetrics")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetNodeMetrics_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2806,13 +2925,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetChanInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetChanInfo", runtime.WithHTTPPathPattern("/v1/graph/edge/{chan_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetChanInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2826,13 +2948,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetNodeInfo", runtime.WithHTTPPathPattern("/v1/graph/node/{pub_key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetNodeInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2846,13 +2971,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_QueryRoutes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/QueryRoutes", runtime.WithHTTPPathPattern("/v1/graph/routes/{pub_key}/{amt}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_QueryRoutes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2866,13 +2994,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_GetNetworkInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/GetNetworkInfo", runtime.WithHTTPPathPattern("/v1/graph/info")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_GetNetworkInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2886,13 +3017,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_StopDaemon_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/StopDaemon", runtime.WithHTTPPathPattern("/v1/stop")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_StopDaemon_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2913,13 +3047,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_DebugLevel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/DebugLevel", runtime.WithHTTPPathPattern("/v1/debuglevel")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_DebugLevel_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2933,13 +3070,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_FeeReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/FeeReport", runtime.WithHTTPPathPattern("/v1/fees")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_FeeReport_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2953,13 +3093,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_UpdateChannelPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/UpdateChannelPolicy", runtime.WithHTTPPathPattern("/v1/chanpolicy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_UpdateChannelPolicy_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2973,13 +3116,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_ForwardingHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ForwardingHistory", runtime.WithHTTPPathPattern("/v1/switch")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ForwardingHistory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2993,13 +3139,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ExportChannelBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ExportChannelBackup", runtime.WithHTTPPathPattern("/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ExportChannelBackup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3013,13 +3162,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ExportAllChannelBackups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ExportAllChannelBackups", runtime.WithHTTPPathPattern("/v1/channels/backup")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ExportAllChannelBackups_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3033,13 +3185,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_VerifyChanBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/VerifyChanBackup", runtime.WithHTTPPathPattern("/v1/channels/backup/verify")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_VerifyChanBackup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3053,13 +3208,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_RestoreChannelBackups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/RestoreChannelBackups", runtime.WithHTTPPathPattern("/v1/channels/backup/restore")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_RestoreChannelBackups_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3080,13 +3238,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_Lightning_BakeMacaroon_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/BakeMacaroon", runtime.WithHTTPPathPattern("/v1/macaroon")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_BakeMacaroon_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3100,13 +3261,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListMacaroonIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListMacaroonIDs", runtime.WithHTTPPathPattern("/v1/macaroon/ids")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListMacaroonIDs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3120,13 +3284,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("DELETE", pattern_Lightning_DeleteMacaroonID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/DeleteMacaroonID", runtime.WithHTTPPathPattern("/v1/macaroon/{root_key_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_DeleteMacaroonID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3140,13 +3307,16 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_Lightning_ListPermissions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/ListPermissions", runtime.WithHTTPPathPattern("/v1/macaroon/permissions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Lightning_ListPermissions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -3202,7 +3372,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/WalletBalance", runtime.WithHTTPPathPattern("/v1/balance/blockchain")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3222,7 +3392,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ChannelBalance", runtime.WithHTTPPathPattern("/v1/balance/channels")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3242,7 +3412,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetTransactions", runtime.WithHTTPPathPattern("/v1/transactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3262,7 +3432,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/EstimateFee", runtime.WithHTTPPathPattern("/v1/transactions/fee")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3282,7 +3452,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SendCoins", runtime.WithHTTPPathPattern("/v1/transactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3302,7 +3472,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListUnspent", runtime.WithHTTPPathPattern("/v1/utxos")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3322,7 +3492,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SubscribeTransactions", runtime.WithHTTPPathPattern("/v1/transactions/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3342,7 +3512,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SendMany", runtime.WithHTTPPathPattern("/v1/transactions/many")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3362,7 +3532,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/NewAddress", runtime.WithHTTPPathPattern("/v1/newaddress")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3382,7 +3552,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SignMessage", runtime.WithHTTPPathPattern("/v1/signmessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3402,7 +3572,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/VerifyMessage", runtime.WithHTTPPathPattern("/v1/verifymessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3422,7 +3592,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ConnectPeer", runtime.WithHTTPPathPattern("/v1/peers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3442,7 +3612,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/DisconnectPeer", runtime.WithHTTPPathPattern("/v1/peers/{pub_key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3462,7 +3632,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListPeers", runtime.WithHTTPPathPattern("/v1/peers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3482,7 +3652,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SubscribePeerEvents", runtime.WithHTTPPathPattern("/v1/peers/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3502,7 +3672,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetInfo", runtime.WithHTTPPathPattern("/v1/getinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3522,7 +3692,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetRecoveryInfo", runtime.WithHTTPPathPattern("/v1/getrecoveryinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3542,7 +3712,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/PendingChannels", runtime.WithHTTPPathPattern("/v1/channels/pending")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3562,7 +3732,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListChannels", runtime.WithHTTPPathPattern("/v1/channels")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3582,7 +3752,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SubscribeChannelEvents", runtime.WithHTTPPathPattern("/v1/channels/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3602,7 +3772,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ClosedChannels", runtime.WithHTTPPathPattern("/v1/channels/closed")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3622,7 +3792,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/OpenChannelSync", runtime.WithHTTPPathPattern("/v1/channels")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3642,7 +3812,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/OpenChannel", runtime.WithHTTPPathPattern("/v1/channels/stream")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3662,7 +3832,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/FundingStateStep", runtime.WithHTTPPathPattern("/v1/funding/step")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3682,7 +3852,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ChannelAcceptor", runtime.WithHTTPPathPattern("/v1/channels/acceptor")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3702,7 +3872,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/CloseChannel", runtime.WithHTTPPathPattern("/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3722,7 +3892,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/AbandonChannel", runtime.WithHTTPPathPattern("/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3742,7 +3912,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SendPayment", runtime.WithHTTPPathPattern("/v1/channels/transaction-stream")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3762,7 +3932,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SendPaymentSync", runtime.WithHTTPPathPattern("/v1/channels/transactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3782,7 +3952,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SendToRouteSync", runtime.WithHTTPPathPattern("/v1/channels/transactions/route")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3802,7 +3972,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/AddInvoice", runtime.WithHTTPPathPattern("/v1/invoices")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3822,7 +3992,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListInvoices", runtime.WithHTTPPathPattern("/v1/invoices")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3842,7 +4012,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/LookupInvoice", runtime.WithHTTPPathPattern("/v1/invoice/{r_hash_str}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3862,7 +4032,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SubscribeInvoices", runtime.WithHTTPPathPattern("/v1/invoices/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3882,7 +4052,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/DecodePayReq", runtime.WithHTTPPathPattern("/v1/payreq/{pay_req}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3902,7 +4072,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListPayments", runtime.WithHTTPPathPattern("/v1/payments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3922,7 +4092,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/DeleteAllPayments", runtime.WithHTTPPathPattern("/v1/payments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3942,7 +4112,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/DescribeGraph", runtime.WithHTTPPathPattern("/v1/graph")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3962,7 +4132,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetNodeMetrics", runtime.WithHTTPPathPattern("/v1/graph/nodemetrics")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3982,7 +4152,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetChanInfo", runtime.WithHTTPPathPattern("/v1/graph/edge/{chan_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4002,7 +4172,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetNodeInfo", runtime.WithHTTPPathPattern("/v1/graph/node/{pub_key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4022,7 +4192,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/QueryRoutes", runtime.WithHTTPPathPattern("/v1/graph/routes/{pub_key}/{amt}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4042,7 +4212,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/GetNetworkInfo", runtime.WithHTTPPathPattern("/v1/graph/info")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4062,7 +4232,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/StopDaemon", runtime.WithHTTPPathPattern("/v1/stop")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4082,7 +4252,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SubscribeChannelGraph", runtime.WithHTTPPathPattern("/v1/graph/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4102,7 +4272,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/DebugLevel", runtime.WithHTTPPathPattern("/v1/debuglevel")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4122,7 +4292,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/FeeReport", runtime.WithHTTPPathPattern("/v1/fees")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4142,7 +4312,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/UpdateChannelPolicy", runtime.WithHTTPPathPattern("/v1/chanpolicy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4162,7 +4332,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ForwardingHistory", runtime.WithHTTPPathPattern("/v1/switch")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4182,7 +4352,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ExportChannelBackup", runtime.WithHTTPPathPattern("/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4202,7 +4372,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ExportAllChannelBackups", runtime.WithHTTPPathPattern("/v1/channels/backup")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4222,7 +4392,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/VerifyChanBackup", runtime.WithHTTPPathPattern("/v1/channels/backup/verify")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4242,7 +4412,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/RestoreChannelBackups", runtime.WithHTTPPathPattern("/v1/channels/backup/restore")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4262,7 +4432,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/SubscribeChannelBackups", runtime.WithHTTPPathPattern("/v1/channels/backup/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4282,7 +4452,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/BakeMacaroon", runtime.WithHTTPPathPattern("/v1/macaroon")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4302,7 +4472,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListMacaroonIDs", runtime.WithHTTPPathPattern("/v1/macaroon/ids")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4322,7 +4492,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/DeleteMacaroonID", runtime.WithHTTPPathPattern("/v1/macaroon/{root_key_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4342,7 +4512,7 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/ListPermissions", runtime.WithHTTPPathPattern("/v1/macaroon/permissions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4362,121 +4532,121 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_Lightning_WalletBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "balance", "blockchain"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_WalletBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "balance", "blockchain"}, "")) - pattern_Lightning_ChannelBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "balance", "channels"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ChannelBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "balance", "channels"}, "")) - pattern_Lightning_GetTransactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "transactions"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetTransactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "transactions"}, "")) - pattern_Lightning_EstimateFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "transactions", "fee"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_EstimateFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "transactions", "fee"}, "")) - pattern_Lightning_SendCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "transactions"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SendCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "transactions"}, "")) - pattern_Lightning_ListUnspent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "utxos"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListUnspent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "utxos"}, "")) - pattern_Lightning_SubscribeTransactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "transactions", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SubscribeTransactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "transactions", "subscribe"}, "")) - pattern_Lightning_SendMany_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "transactions", "many"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SendMany_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "transactions", "many"}, "")) - pattern_Lightning_NewAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "newaddress"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_NewAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "newaddress"}, "")) - pattern_Lightning_SignMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "signmessage"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SignMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "signmessage"}, "")) - pattern_Lightning_VerifyMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "verifymessage"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_VerifyMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "verifymessage"}, "")) - pattern_Lightning_ConnectPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ConnectPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, "")) - pattern_Lightning_DisconnectPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "peers", "pub_key"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_DisconnectPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "peers", "pub_key"}, "")) - pattern_Lightning_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, "")) - pattern_Lightning_SubscribePeerEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "peers", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SubscribePeerEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "peers", "subscribe"}, "")) - pattern_Lightning_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getinfo"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getinfo"}, "")) - pattern_Lightning_GetRecoveryInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getrecoveryinfo"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetRecoveryInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getrecoveryinfo"}, "")) - pattern_Lightning_PendingChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "pending"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_PendingChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "pending"}, "")) - pattern_Lightning_ListChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "channels"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "channels"}, "")) - pattern_Lightning_SubscribeChannelEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SubscribeChannelEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "subscribe"}, "")) - pattern_Lightning_ClosedChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "closed"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ClosedChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "closed"}, "")) - pattern_Lightning_OpenChannelSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "channels"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_OpenChannelSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "channels"}, "")) - pattern_Lightning_OpenChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "stream"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_OpenChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "stream"}, "")) - pattern_Lightning_FundingStateStep_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "funding", "step"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_FundingStateStep_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "funding", "step"}, "")) - pattern_Lightning_ChannelAcceptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "acceptor"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ChannelAcceptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "acceptor"}, "")) - pattern_Lightning_CloseChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "channels", "channel_point.funding_txid_str", "channel_point.output_index"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_CloseChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "channels", "channel_point.funding_txid_str", "channel_point.output_index"}, "")) - pattern_Lightning_AbandonChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "channels", "abandon", "channel_point.funding_txid_str", "channel_point.output_index"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_AbandonChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "channels", "abandon", "channel_point.funding_txid_str", "channel_point.output_index"}, "")) - pattern_Lightning_SendPayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "transaction-stream"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SendPayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "transaction-stream"}, "")) - pattern_Lightning_SendPaymentSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "transactions"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SendPaymentSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "transactions"}, "")) - pattern_Lightning_SendToRouteSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "transactions", "route"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SendToRouteSync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "transactions", "route"}, "")) - pattern_Lightning_AddInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "invoices"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_AddInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "invoices"}, "")) - pattern_Lightning_ListInvoices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "invoices"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListInvoices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "invoices"}, "")) - pattern_Lightning_LookupInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "invoice", "r_hash_str"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_LookupInvoice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "invoice", "r_hash_str"}, "")) - pattern_Lightning_SubscribeInvoices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "invoices", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SubscribeInvoices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "invoices", "subscribe"}, "")) - pattern_Lightning_DecodePayReq_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "payreq", "pay_req"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_DecodePayReq_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "payreq", "pay_req"}, "")) - pattern_Lightning_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, "")) - pattern_Lightning_DeleteAllPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_DeleteAllPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "payments"}, "")) - pattern_Lightning_DescribeGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "graph"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_DescribeGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "graph"}, "")) - pattern_Lightning_GetNodeMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "nodemetrics"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetNodeMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "nodemetrics"}, "")) - pattern_Lightning_GetChanInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "graph", "edge", "chan_id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetChanInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "graph", "edge", "chan_id"}, "")) - pattern_Lightning_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "graph", "node", "pub_key"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "graph", "node", "pub_key"}, "")) - pattern_Lightning_QueryRoutes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "graph", "routes", "pub_key", "amt"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_QueryRoutes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "graph", "routes", "pub_key", "amt"}, "")) - pattern_Lightning_GetNetworkInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "info"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_GetNetworkInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "info"}, "")) - pattern_Lightning_StopDaemon_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "stop"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_StopDaemon_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "stop"}, "")) - pattern_Lightning_SubscribeChannelGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SubscribeChannelGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "graph", "subscribe"}, "")) - pattern_Lightning_DebugLevel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "debuglevel"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_DebugLevel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "debuglevel"}, "")) - pattern_Lightning_FeeReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "fees"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_FeeReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "fees"}, "")) - pattern_Lightning_UpdateChannelPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "chanpolicy"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_UpdateChannelPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "chanpolicy"}, "")) - pattern_Lightning_ForwardingHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "switch"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ForwardingHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "switch"}, "")) - pattern_Lightning_ExportChannelBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "channels", "backup", "chan_point.funding_txid_str", "chan_point.output_index"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ExportChannelBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "channels", "backup", "chan_point.funding_txid_str", "chan_point.output_index"}, "")) - pattern_Lightning_ExportAllChannelBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "backup"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ExportAllChannelBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "channels", "backup"}, "")) - pattern_Lightning_VerifyChanBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "backup", "verify"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_VerifyChanBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "backup", "verify"}, "")) - pattern_Lightning_RestoreChannelBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "backup", "restore"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_RestoreChannelBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "backup", "restore"}, "")) - pattern_Lightning_SubscribeChannelBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "backup", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_SubscribeChannelBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "channels", "backup", "subscribe"}, "")) - pattern_Lightning_BakeMacaroon_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "macaroon"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_BakeMacaroon_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "macaroon"}, "")) - pattern_Lightning_ListMacaroonIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "macaroon", "ids"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListMacaroonIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "macaroon", "ids"}, "")) - pattern_Lightning_DeleteMacaroonID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "macaroon", "root_key_id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_DeleteMacaroonID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "macaroon", "root_key_id"}, "")) - pattern_Lightning_ListPermissions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "macaroon", "permissions"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Lightning_ListPermissions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "macaroon", "permissions"}, "")) ) var ( diff --git a/lnrpc/lightning.swagger.json b/lnrpc/lightning.swagger.json index 0980458a1..5dcb04bd7 100644 --- a/lnrpc/lightning.swagger.json +++ b/lnrpc/lightning.swagger.json @@ -4,6 +4,11 @@ "title": "lightning.proto", "version": "version not set" }, + "tags": [ + { + "name": "Lightning" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v1/balance/blockchain": { "get": { "summary": "lncli: `walletbalance`\nWalletBalance returns total unspent outputs(confirmed and unconfirmed), all\nconfirmed unspent outputs and all unconfirmed unspent outputs under control\nof the wallet.", - "operationId": "WalletBalance", + "operationId": "Lightning_WalletBalance", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -37,7 +42,7 @@ "/v1/balance/channels": { "get": { "summary": "lncli: `channelbalance`\nChannelBalance returns a report on the total funds across all open channels,\ncategorized in local/remote, pending local/remote and unsettled local/remote\nbalances.", - "operationId": "ChannelBalance", + "operationId": "Lightning_ChannelBalance", "responses": { "200": { "description": "A successful response.", @@ -46,9 +51,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -60,7 +65,7 @@ "/v1/channels": { "get": { "summary": "lncli: `listchannels`\nListChannels returns a description of all the open channels that this node\nis a participant in.", - "operationId": "ListChannels", + "operationId": "Lightning_ListChannels", "responses": { "200": { "description": "A successful response.", @@ -69,9 +74,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -80,29 +85,25 @@ "name": "active_only", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "inactive_only", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "public_only", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "private_only", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "peer", @@ -119,7 +120,7 @@ }, "post": { "summary": "OpenChannelSync is a synchronous version of the OpenChannel RPC call. This\ncall is meant to be consumed by clients to the REST proxy. As with all\nother sync calls, all byte slices are intended to be populated as hex\nencoded strings.", - "operationId": "OpenChannelSync", + "operationId": "Lightning_OpenChannelSync", "responses": { "200": { "description": "A successful response.", @@ -128,9 +129,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -152,7 +153,7 @@ "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}": { "delete": { "summary": "lncli: `abandonchannel`\nAbandonChannel removes all channel state from the database except for a\nclose summary. This method can be used to get rid of permanently unusable\nchannels due to bugs fixed in newer versions of lnd. This method can also be\nused to remove externally funded channels where the funding transaction was\nnever broadcast. Only available for non-externally funded channels in dev\nbuild.", - "operationId": "AbandonChannel", + "operationId": "Lightning_AbandonChannel", "responses": { "200": { "description": "A successful response.", @@ -161,9 +162,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -195,16 +196,14 @@ "name": "pending_funding_shim_only", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "i_know_what_i_am_doing", "description": "Override the requirement for being in dev mode by setting this to true and\nconfirming the user knows what they are doing and this is a potential foot\ngun to lose funds if used on active channels.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -215,7 +214,7 @@ "/v1/channels/acceptor": { "post": { "summary": "ChannelAcceptor dispatches a bi-directional streaming RPC in which\nOpenChannel requests are sent to the client and the client responds with\na boolean that tells LND whether or not to accept the channel. This allows\nnode operators to specify their own criteria for accepting inbound channels\nthrough a single persistent connection.", - "operationId": "ChannelAcceptor", + "operationId": "Lightning_ChannelAcceptor", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -226,16 +225,16 @@ "$ref": "#/definitions/lnrpcChannelAcceptRequest" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcChannelAcceptRequest" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -258,7 +257,7 @@ "/v1/channels/backup": { "get": { "summary": "ExportAllChannelBackups returns static channel backups for all existing\nchannels known to lnd. A set of regular singular static channel backups for\neach channel are returned. Additionally, a multi-channel backup is returned\nas well, which contains a single encrypted blob containing the backups of\neach channel.", - "operationId": "ExportAllChannelBackups", + "operationId": "Lightning_ExportAllChannelBackups", "responses": { "200": { "description": "A successful response.", @@ -267,9 +266,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -281,7 +280,7 @@ "/v1/channels/backup/restore": { "post": { "summary": "lncli: `restorechanbackup`\nRestoreChannelBackups accepts a set of singular channel backups, or a\nsingle encrypted multi-chan backup and attempts to recover any funds\nremaining within the channel. If we are able to unpack the backup, then the\nnew channel will be shown under listchannels, as well as pending channels.", - "operationId": "RestoreChannelBackups", + "operationId": "Lightning_RestoreChannelBackups", "responses": { "200": { "description": "A successful response.", @@ -290,9 +289,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -314,7 +313,7 @@ "/v1/channels/backup/subscribe": { "get": { "summary": "SubscribeChannelBackups allows a client to sub-subscribe to the most up to\ndate information concerning the state of all channel backups. Each time a\nnew channel is added, we return the new set of channels, along with a\nmulti-chan backup containing the backup info for all channels. Each time a\nchannel is closed, we send a new update, which contains new new chan back\nups, but the updated set of encrypted multi-chan backups with the closed\nchannel(s) removed.", - "operationId": "SubscribeChannelBackups", + "operationId": "Lightning_SubscribeChannelBackups", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -325,16 +324,16 @@ "$ref": "#/definitions/lnrpcChanBackupSnapshot" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcChanBackupSnapshot" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -346,7 +345,7 @@ "/v1/channels/backup/verify": { "post": { "summary": "VerifyChanBackup allows a caller to verify the integrity of a channel backup\nsnapshot. This method will accept either a packed Single or a packed Multi.\nSpecifying both will result in an error.", - "operationId": "VerifyChanBackup", + "operationId": "Lightning_VerifyChanBackup", "responses": { "200": { "description": "A successful response.", @@ -355,9 +354,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -379,7 +378,7 @@ "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}": { "get": { "summary": "lncli: `exportchanbackup`\nExportChannelBackup attempts to return an encrypted static channel backup\nfor the target channel identified by it channel point. The backup is\nencrypted with a key generated from the aezeed seed of the user. The\nreturned backup can either be restored using the RestoreChannelBackup\nmethod once lnd is running, or via the InitWallet and UnlockWallet methods\nfrom the WalletUnlocker service.", - "operationId": "ExportChannelBackup", + "operationId": "Lightning_ExportChannelBackup", "responses": { "200": { "description": "A successful response.", @@ -388,9 +387,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -427,7 +426,7 @@ "/v1/channels/closed": { "get": { "summary": "lncli: `closedchannels`\nClosedChannels returns a description of all the closed channels that\nthis node was a participant in.", - "operationId": "ClosedChannels", + "operationId": "Lightning_ClosedChannels", "responses": { "200": { "description": "A successful response.", @@ -436,9 +435,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -447,43 +446,37 @@ "name": "cooperative", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "local_force", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "remote_force", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "breach", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "funding_canceled", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "abandoned", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -494,7 +487,7 @@ "/v1/channels/pending": { "get": { "summary": "lncli: `pendingchannels`\nPendingChannels returns a list of all the channels that are currently\nconsidered \"pending\". A channel is pending if it has finished the funding\nworkflow and is waiting for confirmations for the funding txn, or is in the\nprocess of closure, either initiated cooperatively or non-cooperatively.", - "operationId": "PendingChannels", + "operationId": "Lightning_PendingChannels", "responses": { "200": { "description": "A successful response.", @@ -503,9 +496,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -517,7 +510,7 @@ "/v1/channels/stream": { "post": { "summary": "lncli: `openchannel`\nOpenChannel attempts to open a singly funded channel specified in the\nrequest to a remote peer. Users are able to specify a target number of\nblocks that the funding transaction should be confirmed in, or a manual fee\nrate to us for the funding transaction. If neither are specified, then a\nlax block confirmation target is used. Each OpenStatusUpdate will return\nthe pending channel ID of the in-progress channel. Depending on the\narguments specified in the OpenChannelRequest, this pending channel ID can\nthen be used to manually progress the channel funding flow.", - "operationId": "OpenChannel", + "operationId": "Lightning_OpenChannel", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -528,16 +521,16 @@ "$ref": "#/definitions/lnrpcOpenStatusUpdate" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcOpenStatusUpdate" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -559,7 +552,7 @@ "/v1/channels/subscribe": { "get": { "summary": "SubscribeChannelEvents creates a uni-directional stream from the server to\nthe client in which any updates relevant to the state of the channels are\nsent over. Events include new active channels, inactive channels, and closed\nchannels.", - "operationId": "SubscribeChannelEvents", + "operationId": "Lightning_SubscribeChannelEvents", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -570,16 +563,16 @@ "$ref": "#/definitions/lnrpcChannelEventUpdate" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcChannelEventUpdate" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -591,7 +584,7 @@ "/v1/channels/transaction-stream": { "post": { "summary": "lncli: `sendpayment`\nDeprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a\nbi-directional streaming RPC for sending payments through the Lightning\nNetwork. A single RPC invocation creates a persistent bi-directional\nstream allowing clients to rapidly send payments through the Lightning\nNetwork with a single persistent connection.", - "operationId": "SendPayment", + "operationId": "Lightning_SendPayment", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -602,16 +595,16 @@ "$ref": "#/definitions/lnrpcSendResponse" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcSendResponse" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -634,7 +627,7 @@ "/v1/channels/transactions": { "post": { "summary": "SendPaymentSync is the synchronous non-streaming version of SendPayment.\nThis RPC is intended to be consumed by clients of the REST proxy.\nAdditionally, this RPC expects the destination's public key and the payment\nhash (if any) to be encoded as hex strings.", - "operationId": "SendPaymentSync", + "operationId": "Lightning_SendPaymentSync", "responses": { "200": { "description": "A successful response.", @@ -643,9 +636,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -667,7 +660,7 @@ "/v1/channels/transactions/route": { "post": { "summary": "SendToRouteSync is a synchronous version of SendToRoute. It Will block\nuntil the payment either fails or succeeds.", - "operationId": "SendToRouteSync", + "operationId": "Lightning_SendToRouteSync", "responses": { "200": { "description": "A successful response.", @@ -676,9 +669,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -700,7 +693,7 @@ "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}": { "delete": { "summary": "lncli: `closechannel`\nCloseChannel attempts to close an active channel identified by its channel\noutpoint (ChannelPoint). The actions of this method can additionally be\naugmented to attempt a force close after a timeout period in the case of an\ninactive peer. If a non-force close (cooperative closure) is requested,\nthen the user can specify either a target number of blocks until the\nclosure transaction is confirmed, or a manual fee rate. If neither are\nspecified, then a default lax, block confirmation target is used.", - "operationId": "CloseChannel", + "operationId": "Lightning_CloseChannel", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -711,16 +704,16 @@ "$ref": "#/definitions/lnrpcCloseStatusUpdate" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcCloseStatusUpdate" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -753,8 +746,7 @@ "description": "If true, then the channel will be closed forcibly. This means the\ncurrent commitment transaction will be signed and broadcast.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "target_conf", @@ -796,7 +788,7 @@ "/v1/chanpolicy": { "post": { "summary": "lncli: `updatechanpolicy`\nUpdateChannelPolicy allows the caller to update the fee schedule and\nchannel policies for all channels globally, or a particular channel.", - "operationId": "UpdateChannelPolicy", + "operationId": "Lightning_UpdateChannelPolicy", "responses": { "200": { "description": "A successful response.", @@ -805,9 +797,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -829,7 +821,7 @@ "/v1/debuglevel": { "post": { "summary": "lncli: `debuglevel`\nDebugLevel allows a caller to programmatically set the logging verbosity of\nlnd. The logging can be targeted according to a coarse daemon-wide logging\nlevel, or in a granular fashion to specify the logging for a target\nsub-system.", - "operationId": "DebugLevel", + "operationId": "Lightning_DebugLevel", "responses": { "200": { "description": "A successful response.", @@ -838,9 +830,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -862,7 +854,7 @@ "/v1/fees": { "get": { "summary": "lncli: `feereport`\nFeeReport allows the caller to obtain a report detailing the current fee\nschedule enforced by the node globally for each channel.", - "operationId": "FeeReport", + "operationId": "Lightning_FeeReport", "responses": { "200": { "description": "A successful response.", @@ -871,9 +863,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -885,7 +877,7 @@ "/v1/funding/step": { "post": { "summary": "FundingStateStep is an advanced funding related call that allows the caller\nto either execute some preparatory steps for a funding workflow, or\nmanually progress a funding workflow. The primary way a funding flow is\nidentified is via its pending channel ID. As an example, this method can be\nused to specify that we're expecting a funding flow for a particular\npending channel ID, for which we need to use specific parameters.\nAlternatively, this can be used to interactively drive PSBT signing for\nfunding for partially complete funding transactions.", - "operationId": "FundingStateStep", + "operationId": "Lightning_FundingStateStep", "responses": { "200": { "description": "A successful response.", @@ -894,9 +886,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -918,7 +910,7 @@ "/v1/getinfo": { "get": { "summary": "lncli: `getinfo`\nGetInfo returns general information concerning the lightning node including\nit's identity pubkey, alias, the chains it is connected to, and information\nconcerning the number of open+pending channels.", - "operationId": "GetInfo", + "operationId": "Lightning_GetInfo", "responses": { "200": { "description": "A successful response.", @@ -927,9 +919,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -941,7 +933,7 @@ "/v1/getrecoveryinfo": { "get": { "summary": "* lncli: `getrecoveryinfo`\nGetRecoveryInfo returns information concerning the recovery mode including\nwhether it's in a recovery mode, whether the recovery is finished, and the\nprogress made so far.", - "operationId": "GetRecoveryInfo", + "operationId": "Lightning_GetRecoveryInfo", "responses": { "200": { "description": "A successful response.", @@ -950,9 +942,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -964,7 +956,7 @@ "/v1/graph": { "get": { "summary": "lncli: `describegraph`\nDescribeGraph returns a description of the latest graph state from the\npoint of view of the node. The graph information is partitioned into two\ncomponents: all the nodes/vertexes, and all the edges that connect the\nvertexes themselves. As this is a directed graph, the edges also contain\nthe node directional specific routing policy which includes: the time lock\ndelta, fee information, etc.", - "operationId": "DescribeGraph", + "operationId": "Lightning_DescribeGraph", "responses": { "200": { "description": "A successful response.", @@ -973,9 +965,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -985,8 +977,7 @@ "description": "Whether unannounced channels are included in the response or not. If set,\nunannounced channels are included. Unannounced channels are both private\nchannels, and public channels that are not yet announced to the network.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -997,7 +988,7 @@ "/v1/graph/edge/{chan_id}": { "get": { "summary": "lncli: `getchaninfo`\nGetChanInfo returns the latest authenticated network announcement for the\ngiven channel identified by its channel ID: an 8-byte integer which\nuniquely identifies the location of transaction's funding output within the\nblockchain.", - "operationId": "GetChanInfo", + "operationId": "Lightning_GetChanInfo", "responses": { "200": { "description": "A successful response.", @@ -1006,9 +997,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1030,7 +1021,7 @@ "/v1/graph/info": { "get": { "summary": "lncli: `getnetworkinfo`\nGetNetworkInfo returns some basic stats about the known channel graph from\nthe point of view of the node.", - "operationId": "GetNetworkInfo", + "operationId": "Lightning_GetNetworkInfo", "responses": { "200": { "description": "A successful response.", @@ -1039,9 +1030,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1053,7 +1044,7 @@ "/v1/graph/node/{pub_key}": { "get": { "summary": "lncli: `getnodeinfo`\nGetNodeInfo returns the latest advertised, aggregated, and authenticated\nchannel information for the specified node identified by its public key.", - "operationId": "GetNodeInfo", + "operationId": "Lightning_GetNodeInfo", "responses": { "200": { "description": "A successful response.", @@ -1062,9 +1053,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1081,8 +1072,7 @@ "description": "If true, will include all known channels associated with the node.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -1093,7 +1083,7 @@ "/v1/graph/nodemetrics": { "get": { "summary": "lncli: `getnodemetrics`\nGetNodeMetrics returns node metrics calculated from the graph. Currently\nthe only supported metric is betweenness centrality of individual nodes.", - "operationId": "GetNodeMetrics", + "operationId": "Lightning_GetNodeMetrics", "responses": { "200": { "description": "A successful response.", @@ -1102,9 +1092,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1134,7 +1124,7 @@ "get": { "summary": "lncli: `queryroutes`\nQueryRoutes attempts to query the daemon's Channel Router for a possible\nroute to a target destination capable of carrying a specific amount of\nsatoshis. The returned route contains the full details required to craft and\nsend an HTLC, also including the necessary information that should be\npresent within the Sphinx packet encapsulated within the HTLC.", "description": "When using REST, the `dest_custom_records` map type can be set by appending\n`\u0026dest_custom_records[\u003crecord_number\u003e]=\u003crecord_data_base64_url_encoded\u003e`\nto the URL. Unfortunately this map type doesn't appear in the REST API\ndocumentation because of a bug in the grpc-gateway library.", - "operationId": "QueryRoutes", + "operationId": "Lightning_QueryRoutes", "responses": { "200": { "description": "A successful response.", @@ -1143,9 +1133,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1229,8 +1219,7 @@ "description": "If set to true, edge probabilities from mission control will be used to get\nthe optimal route.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "cltv_limit", @@ -1303,7 +1292,7 @@ "/v1/graph/subscribe": { "get": { "summary": "SubscribeChannelGraph launches a streaming RPC that allows the caller to\nreceive notifications upon any changes to the channel graph topology from\nthe point of view of the responding node. Events notified include: new\nnodes coming online, nodes updating their authenticated attributes, new\nchannels being advertised, updates in the routing policy for a directional\nchannel edge, and when channels are closed on-chain.", - "operationId": "SubscribeChannelGraph", + "operationId": "Lightning_SubscribeChannelGraph", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -1314,16 +1303,16 @@ "$ref": "#/definitions/lnrpcGraphTopologyUpdate" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcGraphTopologyUpdate" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1335,7 +1324,7 @@ "/v1/invoice/{r_hash_str}": { "get": { "summary": "lncli: `lookupinvoice`\nLookupInvoice attempts to look up an invoice according to its payment hash.\nThe passed payment hash *must* be exactly 32 bytes, if not, an error is\nreturned.", - "operationId": "LookupInvoice", + "operationId": "Lightning_LookupInvoice", "responses": { "200": { "description": "A successful response.", @@ -1344,9 +1333,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1375,7 +1364,7 @@ "/v1/invoices": { "get": { "summary": "lncli: `listinvoices`\nListInvoices returns a list of all the invoices currently stored within the\ndatabase. Any active debug invoices are ignored. It has full support for\npaginated responses, allowing users to query for specific invoices through\ntheir add_index. This can be done by using either the first_index_offset or\nlast_index_offset fields included in the response as the index_offset of the\nnext request. By default, the first 100 invoices created will be returned.\nBackwards pagination is also supported through the Reversed flag.", - "operationId": "ListInvoices", + "operationId": "Lightning_ListInvoices", "responses": { "200": { "description": "A successful response.", @@ -1384,9 +1373,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1396,8 +1385,7 @@ "description": "If set, only invoices that are not settled and not canceled will be returned\nin the response.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "index_offset", @@ -1420,8 +1408,7 @@ "description": "If set, the invoices returned will result from seeking backwards from the\nspecified index offset. This can be used to paginate backwards.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -1430,7 +1417,7 @@ }, "post": { "summary": "lncli: `addinvoice`\nAddInvoice attempts to add a new invoice to the invoice database. Any\nduplicated invoices are rejected, therefore all invoices *must* have a\nunique payment preimage.", - "operationId": "AddInvoice", + "operationId": "Lightning_AddInvoice", "responses": { "200": { "description": "A successful response.", @@ -1439,9 +1426,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1463,7 +1450,7 @@ "/v1/invoices/subscribe": { "get": { "summary": "SubscribeInvoices returns a uni-directional stream (server -\u003e client) for\nnotifying the client of newly added/settled invoices. The caller can\noptionally specify the add_index and/or the settle_index. If the add_index\nis specified, then we'll first start by sending add invoice events for all\ninvoices with an add_index greater than the specified value. If the\nsettle_index is specified, the next, we'll send out all settle events for\ninvoices with a settle_index greater than the specified value. One or both\nof these fields can be set. If no fields are set, then we'll only send out\nthe latest add/settle events.", - "operationId": "SubscribeInvoices", + "operationId": "Lightning_SubscribeInvoices", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -1474,16 +1461,16 @@ "$ref": "#/definitions/lnrpcInvoice" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcInvoice" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1513,7 +1500,7 @@ "/v1/macaroon": { "post": { "summary": "lncli: `bakemacaroon`\nBakeMacaroon allows the creation of a new macaroon with custom read and\nwrite permissions. No first-party caveats are added since this can be done\noffline.", - "operationId": "BakeMacaroon", + "operationId": "Lightning_BakeMacaroon", "responses": { "200": { "description": "A successful response.", @@ -1522,9 +1509,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1546,7 +1533,7 @@ "/v1/macaroon/ids": { "get": { "summary": "lncli: `listmacaroonids`\nListMacaroonIDs returns all root key IDs that are in use.", - "operationId": "ListMacaroonIDs", + "operationId": "Lightning_ListMacaroonIDs", "responses": { "200": { "description": "A successful response.", @@ -1555,9 +1542,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1569,7 +1556,7 @@ "/v1/macaroon/permissions": { "get": { "summary": "lncli: `listpermissions`\nListPermissions lists all RPC method URIs and their required macaroon\npermissions to access them.", - "operationId": "ListPermissions", + "operationId": "Lightning_ListPermissions", "responses": { "200": { "description": "A successful response.", @@ -1578,9 +1565,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1592,7 +1579,7 @@ "/v1/macaroon/{root_key_id}": { "delete": { "summary": "lncli: `deletemacaroonid`\nDeleteMacaroonID deletes the specified macaroon ID and invalidates all\nmacaroons derived from that ID.", - "operationId": "DeleteMacaroonID", + "operationId": "Lightning_DeleteMacaroonID", "responses": { "200": { "description": "A successful response.", @@ -1601,9 +1588,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1625,7 +1612,7 @@ "/v1/newaddress": { "get": { "summary": "lncli: `newaddress`\nNewAddress creates a new address under control of the local wallet.", - "operationId": "NewAddress", + "operationId": "Lightning_NewAddress", "responses": { "200": { "description": "A successful response.", @@ -1634,9 +1621,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1671,7 +1658,7 @@ "/v1/payments": { "get": { "summary": "lncli: `listpayments`\nListPayments returns a list of all outgoing payments.", - "operationId": "ListPayments", + "operationId": "Lightning_ListPayments", "responses": { "200": { "description": "A successful response.", @@ -1680,9 +1667,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1692,8 +1679,7 @@ "description": "If true, then return payments that have not yet fully completed. This means\nthat pending payments, as well as failed payments will show up if this\nfield is set to true. This flag doesn't change the meaning of the indices,\nwhich are tied to individual payments.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "index_offset", @@ -1716,8 +1702,7 @@ "description": "If set, the payments returned will result from seeking backwards from the\nspecified index offset. This can be used to paginate backwards. The order\nof the returned payments is always oldest first (ascending index order).", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -1726,7 +1711,7 @@ }, "delete": { "summary": "DeleteAllPayments deletes all outgoing payments from DB.", - "operationId": "DeleteAllPayments", + "operationId": "Lightning_DeleteAllPayments", "responses": { "200": { "description": "A successful response.", @@ -1735,9 +1720,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1747,16 +1732,14 @@ "description": "Only delete failed payments.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" }, { "name": "failed_htlcs_only", "description": "Only delete failed HTLCs from payments, not the payment itself.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -1767,7 +1750,7 @@ "/v1/payreq/{pay_req}": { "get": { "summary": "lncli: `decodepayreq`\nDecodePayReq takes an encoded payment request string and attempts to decode\nit, returning a full description of the conditions encoded within the\npayment request.", - "operationId": "DecodePayReq", + "operationId": "Lightning_DecodePayReq", "responses": { "200": { "description": "A successful response.", @@ -1776,9 +1759,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1799,7 +1782,7 @@ "/v1/peers": { "get": { "summary": "lncli: `listpeers`\nListPeers returns a verbose listing of all currently active peers.", - "operationId": "ListPeers", + "operationId": "Lightning_ListPeers", "responses": { "200": { "description": "A successful response.", @@ -1808,9 +1791,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1820,8 +1803,7 @@ "description": "If true, only the last error that our peer sent us will be returned with\nthe peer's information, rather than the full set of historic errors we have\nstored.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -1830,7 +1812,7 @@ }, "post": { "summary": "lncli: `connect`\nConnectPeer attempts to establish a connection to a remote peer. This is at\nthe networking level, and is used for communication between nodes. This is\ndistinct from establishing a channel with a peer.", - "operationId": "ConnectPeer", + "operationId": "Lightning_ConnectPeer", "responses": { "200": { "description": "A successful response.", @@ -1839,9 +1821,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1863,7 +1845,7 @@ "/v1/peers/subscribe": { "get": { "summary": "SubscribePeerEvents creates a uni-directional stream from the server to\nthe client in which any events relevant to the state of peers are sent\nover. Events include peers going online and offline.", - "operationId": "SubscribePeerEvents", + "operationId": "Lightning_SubscribePeerEvents", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -1874,16 +1856,16 @@ "$ref": "#/definitions/lnrpcPeerEvent" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcPeerEvent" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1895,7 +1877,7 @@ "/v1/peers/{pub_key}": { "delete": { "summary": "lncli: `disconnect`\nDisconnectPeer attempts to disconnect one peer from another identified by a\ngiven pubKey. In the case that we currently have a pending or active channel\nwith the target peer, then this action will be not be allowed.", - "operationId": "DisconnectPeer", + "operationId": "Lightning_DisconnectPeer", "responses": { "200": { "description": "A successful response.", @@ -1904,9 +1886,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1927,7 +1909,7 @@ "/v1/signmessage": { "post": { "summary": "lncli: `signmessage`\nSignMessage signs a message with this node's private key. The returned\nsignature string is `zbase32` encoded and pubkey recoverable, meaning that\nonly the message digest and signature are needed for verification.", - "operationId": "SignMessage", + "operationId": "Lightning_SignMessage", "responses": { "200": { "description": "A successful response.", @@ -1936,9 +1918,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1960,7 +1942,7 @@ "/v1/stop": { "post": { "summary": "lncli: `stop`\nStopDaemon will send a shutdown request to the interrupt handler, triggering\na graceful shutdown of the daemon.", - "operationId": "StopDaemon", + "operationId": "Lightning_StopDaemon", "responses": { "200": { "description": "A successful response.", @@ -1969,9 +1951,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -1994,7 +1976,7 @@ "post": { "summary": "lncli: `fwdinghistory`\nForwardingHistory allows the caller to query the htlcswitch for a record of\nall HTLCs forwarded within the target time range, and integer offset\nwithin that time range, for a maximum number of events. If no maximum number\nof events is specified, up to 100 events will be returned. If no time-range\nis specified, then events will be returned in the order that they occured.", "description": "A list of forwarding events are returned. The size of each forwarding event\nis 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.\nAs a result each message can only contain 50k entries. Each response has\nthe index offset of the last entry. The index offset can be provided to the\nrequest to allow the caller to skip a series of records.", - "operationId": "ForwardingHistory", + "operationId": "Lightning_ForwardingHistory", "responses": { "200": { "description": "A successful response.", @@ -2003,9 +1985,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2027,7 +2009,7 @@ "/v1/transactions": { "get": { "summary": "lncli: `listchaintxns`\nGetTransactions returns a list describing all the known transactions\nrelevant to the wallet.", - "operationId": "GetTransactions", + "operationId": "Lightning_GetTransactions", "responses": { "200": { "description": "A successful response.", @@ -2036,9 +2018,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2073,7 +2055,7 @@ }, "post": { "summary": "lncli: `sendcoins`\nSendCoins executes a request to send coins to a particular address. Unlike\nSendMany, this RPC call only allows creating a single output at a time. If\nneither target_conf, or sat_per_vbyte are set, then the internal wallet will\nconsult its fee model to determine a fee for the default confirmation\ntarget.", - "operationId": "SendCoins", + "operationId": "Lightning_SendCoins", "responses": { "200": { "description": "A successful response.", @@ -2082,9 +2064,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2107,7 +2089,7 @@ "get": { "summary": "lncli: `estimatefee`\nEstimateFee asks the chain backend to estimate the fee rate and total fees\nfor a transaction that pays to multiple specified outputs.", "description": "When using REST, the `AddrToAmount` map type can be set by appending\n`\u0026AddrToAmount[\u003caddress\u003e]=\u003camount_to_send\u003e` to the URL. Unfortunately this\nmap type doesn't appear in the REST API documentation because of a bug in\nthe grpc-gateway library.", - "operationId": "EstimateFee", + "operationId": "Lightning_EstimateFee", "responses": { "200": { "description": "A successful response.", @@ -2116,9 +2098,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2144,8 +2126,7 @@ "description": "Whether unconfirmed outputs should be used as inputs for the transaction.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -2156,7 +2137,7 @@ "/v1/transactions/many": { "post": { "summary": "lncli: `sendmany`\nSendMany handles a request for a transaction that creates multiple specified\noutputs in parallel. If neither target_conf, or sat_per_vbyte are set, then\nthe internal wallet will consult its fee model to determine a fee for the\ndefault confirmation target.", - "operationId": "SendMany", + "operationId": "Lightning_SendMany", "responses": { "200": { "description": "A successful response.", @@ -2165,9 +2146,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2189,7 +2170,7 @@ "/v1/transactions/subscribe": { "get": { "summary": "SubscribeTransactions creates a uni-directional stream from the server to\nthe client in which any newly discovered transactions relevant to the\nwallet are sent over.", - "operationId": "SubscribeTransactions", + "operationId": "Lightning_SubscribeTransactions", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -2200,16 +2181,16 @@ "$ref": "#/definitions/lnrpcTransaction" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcTransaction" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2247,7 +2228,7 @@ "get": { "summary": "lncli: `listunspent`\nDeprecated, use walletrpc.ListUnspent instead.", "description": "ListUnspent returns a list of all utxos spendable by the wallet with a\nnumber of confirmations between the specified minimum and maximum.", - "operationId": "ListUnspent", + "operationId": "Lightning_ListUnspent", "responses": { "200": { "description": "A successful response.", @@ -2256,9 +2237,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2295,7 +2276,7 @@ "/v1/verifymessage": { "post": { "summary": "lncli: `verifymessage`\nVerifyMessage verifies a signature over a msg. The signature must be\nzbase32 encoded and signed by an active node in the resident node's\nchannel database. In addition to returning the validity of the signature,\nVerifyMessage also returns the recovered pubkey from the signature.", - "operationId": "VerifyMessage", + "operationId": "Lightning_VerifyMessage", "responses": { "200": { "description": "A successful response.", @@ -2304,9 +2285,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -2808,7 +2789,6 @@ "properties": { "active": { "type": "boolean", - "format": "boolean", "title": "Whether this channel is active or not" }, "remote_pubkey": { @@ -2888,12 +2868,10 @@ }, "private": { "type": "boolean", - "format": "boolean", "description": "Whether this channel is advertised to the network or not." }, "initiator": { "type": "boolean", - "format": "boolean", "description": "True if we were the ones that created the channel." }, "chan_status_flags": { @@ -2912,7 +2890,6 @@ }, "static_remote_key": { "type": "boolean", - "format": "boolean", "description": "Deprecated. Use commitment_type." }, "commitment_type": { @@ -3028,7 +3005,6 @@ "properties": { "accept": { "type": "boolean", - "format": "boolean", "description": "Whether or not the client accepts the channel." }, "pending_chan_id": { @@ -3213,8 +3189,7 @@ "format": "byte" }, "success": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -3540,7 +3515,6 @@ }, "perm": { "type": "boolean", - "format": "boolean", "description": "If set, the daemon will attempt to persistently connect to the target\npeer. Otherwise, the call will be synchronous." }, "timeout": { @@ -3557,8 +3531,7 @@ "type": "object", "properties": { "show": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "level_spec": { "type": "string" @@ -3581,7 +3554,6 @@ "properties": { "deleted": { "type": "boolean", - "format": "boolean", "description": "A boolean indicates that the deletion is successful." } } @@ -3599,7 +3571,6 @@ }, "direction_reverse": { "type": "boolean", - "format": "boolean", "description": "The direction of this edge. If direction_reverse is false, the direction\nof this edge is from the channel endpoint with the lexicographically smaller\npub key to the endpoint with the larger pub key. If direction_reverse is\nis true, the edge goes the other way." } } @@ -3674,12 +3645,10 @@ "type": "string" }, "is_required": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "is_known": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -4014,17 +3983,14 @@ }, "synced_to_chain": { "type": "boolean", - "format": "boolean", "title": "Whether the wallet's view is synced to the main chain" }, "synced_to_graph": { "type": "boolean", - "format": "boolean", "description": "Whether we consider ourselves synced with the public channel graph." }, "testnet": { "type": "boolean", - "format": "boolean", "title": "Whether the current node is connected to testnet. This field is\ndeprecated and the network field should be used instead" }, "chains": { @@ -4055,12 +4021,10 @@ "properties": { "recovery_mode": { "type": "boolean", - "format": "boolean", "title": "Whether the wallet is in recovery mode" }, "recovery_finished": { "type": "boolean", - "format": "boolean", "title": "Whether the wallet recovery progress is finished" }, "progress": { @@ -4097,8 +4061,7 @@ "type": "object", "properties": { "incoming": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "amount": { "type": "string", @@ -4204,7 +4167,6 @@ }, "tlv_payload": { "type": "boolean", - "format": "boolean", "description": "If set to true, then this hop will be encoded using the new variable length\nTLV format. Note that if any custom tlv_records below are specified, then\nthis field MUST be set to true for them to be encoded properly." }, "mpp_record": { @@ -4295,7 +4257,6 @@ }, "settled": { "type": "boolean", - "format": "boolean", "title": "Whether this invoice has been fulfilled" }, "creation_date": { @@ -4340,7 +4301,6 @@ }, "private": { "type": "boolean", - "format": "boolean", "description": "Whether this invoice should include routing hints for private channels." }, "add_index": { @@ -4388,7 +4348,6 @@ }, "is_keysend": { "type": "boolean", - "format": "boolean", "description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]." }, "payment_addr": { @@ -4398,7 +4357,6 @@ }, "is_amp": { "type": "boolean", - "format": "boolean", "description": "Signals whether or not this is an AMP invoice." } } @@ -4918,7 +4876,6 @@ }, "private": { "type": "boolean", - "format": "boolean", "description": "Whether this channel should be private, not announced to the greater\nnetwork." }, "min_htlc_msat": { @@ -4938,7 +4895,6 @@ }, "spend_unconfirmed": { "type": "boolean", - "format": "boolean", "description": "Whether unconfirmed outputs should be used as inputs for the funding\ntransaction." }, "close_address": { @@ -5185,7 +5141,6 @@ }, "inbound": { "type": "boolean", - "format": "boolean", "title": "A channel is inbound if the counterparty initiated the channel" }, "ping_time": { @@ -5278,7 +5233,6 @@ "properties": { "incoming": { "type": "boolean", - "format": "boolean", "title": "The direction within the channel that the htlc was sent" }, "amount": { @@ -5325,7 +5279,6 @@ "properties": { "global": { "type": "boolean", - "format": "boolean", "description": "If set, then this update applies to all currently active channels." }, "chan_point": { @@ -5359,7 +5312,6 @@ }, "min_htlc_msat_specified": { "type": "boolean", - "format": "boolean", "description": "If true, min_htlc_msat is applied." } } @@ -5382,7 +5334,6 @@ }, "no_publish": { "type": "boolean", - "format": "boolean", "description": "If a channel should be part of a batch (multiple channel openings in one\ntransaction), it can be dangerous if the whole batch transaction is\npublished too early before all channel opening negotiations are completed.\nThis flag prevents this particular channel from broadcasting the transaction\nafter the negotiation with the remote peer. In a batch of channel openings\nthis flag should be set to true for every channel but the very last." } } @@ -5561,8 +5512,7 @@ "format": "int64" }, "disabled": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "max_htlc_msat": { "type": "string", @@ -5603,7 +5553,6 @@ }, "send_all": { "type": "boolean", - "format": "boolean", "description": "If set, then the amount field will be ignored, and lnd will attempt to\nsend all the coins under control of the internal wallet to the specified\naddress." }, "label": { @@ -5617,7 +5566,6 @@ }, "spend_unconfirmed": { "type": "boolean", - "format": "boolean", "description": "Whether unconfirmed outputs should be used as inputs for the transaction." } } @@ -5668,7 +5616,6 @@ }, "spend_unconfirmed": { "type": "boolean", - "format": "boolean", "description": "Whether unconfirmed outputs should be used as inputs for the transaction." } } @@ -5751,7 +5698,6 @@ }, "allow_self_payment": { "type": "boolean", - "format": "boolean", "description": "If set, circular payments to self are permitted." }, "dest_features": { @@ -5962,7 +5908,6 @@ "properties": { "valid": { "type": "boolean", - "format": "boolean", "title": "Whether the signature was valid over the given message" }, "pubkey": { @@ -6025,12 +5970,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -6045,31 +5987,6 @@ } } } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpc_code": { - "type": "integer", - "format": "int32" - }, - "http_code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "http_status": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } } } } diff --git a/lnrpc/lightning_grpc.pb.go b/lnrpc/lightning_grpc.pb.go new file mode 100644 index 000000000..bfc4d33d5 --- /dev/null +++ b/lnrpc/lightning_grpc.pb.go @@ -0,0 +1,3094 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package lnrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LightningClient is the client API for Lightning service. +// +// 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 LightningClient interface { + // lncli: `walletbalance` + //WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + //confirmed unspent outputs and all unconfirmed unspent outputs under control + //of the wallet. + WalletBalance(ctx context.Context, in *WalletBalanceRequest, opts ...grpc.CallOption) (*WalletBalanceResponse, error) + // lncli: `channelbalance` + //ChannelBalance returns a report on the total funds across all open channels, + //categorized in local/remote, pending local/remote and unsettled local/remote + //balances. + ChannelBalance(ctx context.Context, in *ChannelBalanceRequest, opts ...grpc.CallOption) (*ChannelBalanceResponse, error) + // lncli: `listchaintxns` + //GetTransactions returns a list describing all the known transactions + //relevant to the wallet. + GetTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (*TransactionDetails, error) + // lncli: `estimatefee` + //EstimateFee asks the chain backend to estimate the fee rate and total fees + //for a transaction that pays to multiple specified outputs. + // + //When using REST, the `AddrToAmount` map type can be set by appending + //`&AddrToAmount[
]=` to the URL. Unfortunately this + //map type doesn't appear in the REST API documentation because of a bug in + //the grpc-gateway library. + EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) + // lncli: `sendcoins` + //SendCoins executes a request to send coins to a particular address. Unlike + //SendMany, this RPC call only allows creating a single output at a time. If + //neither target_conf, or sat_per_vbyte are set, then the internal wallet will + //consult its fee model to determine a fee for the default confirmation + //target. + SendCoins(ctx context.Context, in *SendCoinsRequest, opts ...grpc.CallOption) (*SendCoinsResponse, error) + // lncli: `listunspent` + //Deprecated, use walletrpc.ListUnspent instead. + // + //ListUnspent returns a list of all utxos spendable by the wallet with a + //number of confirmations between the specified minimum and maximum. + ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) + // + //SubscribeTransactions creates a uni-directional stream from the server to + //the client in which any newly discovered transactions relevant to the + //wallet are sent over. + SubscribeTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (Lightning_SubscribeTransactionsClient, error) + // lncli: `sendmany` + //SendMany handles a request for a transaction that creates multiple specified + //outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then + //the internal wallet will consult its fee model to determine a fee for the + //default confirmation target. + SendMany(ctx context.Context, in *SendManyRequest, opts ...grpc.CallOption) (*SendManyResponse, error) + // lncli: `newaddress` + //NewAddress creates a new address under control of the local wallet. + NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error) + // lncli: `signmessage` + //SignMessage signs a message with this node's private key. The returned + //signature string is `zbase32` encoded and pubkey recoverable, meaning that + //only the message digest and signature are needed for verification. + SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) + // lncli: `verifymessage` + //VerifyMessage verifies a signature over a msg. The signature must be + //zbase32 encoded and signed by an active node in the resident node's + //channel database. In addition to returning the validity of the signature, + //VerifyMessage also returns the recovered pubkey from the signature. + VerifyMessage(ctx context.Context, in *VerifyMessageRequest, opts ...grpc.CallOption) (*VerifyMessageResponse, error) + // lncli: `connect` + //ConnectPeer attempts to establish a connection to a remote peer. This is at + //the networking level, and is used for communication between nodes. This is + //distinct from establishing a channel with a peer. + ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error) + // lncli: `disconnect` + //DisconnectPeer attempts to disconnect one peer from another identified by a + //given pubKey. In the case that we currently have a pending or active channel + //with the target peer, then this action will be not be allowed. + DisconnectPeer(ctx context.Context, in *DisconnectPeerRequest, opts ...grpc.CallOption) (*DisconnectPeerResponse, error) + // lncli: `listpeers` + //ListPeers returns a verbose listing of all currently active peers. + ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) + // + //SubscribePeerEvents creates a uni-directional stream from the server to + //the client in which any events relevant to the state of peers are sent + //over. Events include peers going online and offline. + SubscribePeerEvents(ctx context.Context, in *PeerEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribePeerEventsClient, error) + // lncli: `getinfo` + //GetInfo returns general information concerning the lightning node including + //it's identity pubkey, alias, the chains it is connected to, and information + //concerning the number of open+pending channels. + GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) + //* lncli: `getrecoveryinfo` + //GetRecoveryInfo returns information concerning the recovery mode including + //whether it's in a recovery mode, whether the recovery is finished, and the + //progress made so far. + GetRecoveryInfo(ctx context.Context, in *GetRecoveryInfoRequest, opts ...grpc.CallOption) (*GetRecoveryInfoResponse, error) + // lncli: `pendingchannels` + //PendingChannels returns a list of all the channels that are currently + //considered "pending". A channel is pending if it has finished the funding + //workflow and is waiting for confirmations for the funding txn, or is in the + //process of closure, either initiated cooperatively or non-cooperatively. + PendingChannels(ctx context.Context, in *PendingChannelsRequest, opts ...grpc.CallOption) (*PendingChannelsResponse, error) + // lncli: `listchannels` + //ListChannels returns a description of all the open channels that this node + //is a participant in. + ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) + // + //SubscribeChannelEvents creates a uni-directional stream from the server to + //the client in which any updates relevant to the state of the channels are + //sent over. Events include new active channels, inactive channels, and closed + //channels. + SubscribeChannelEvents(ctx context.Context, in *ChannelEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelEventsClient, error) + // lncli: `closedchannels` + //ClosedChannels returns a description of all the closed channels that + //this node was a participant in. + ClosedChannels(ctx context.Context, in *ClosedChannelsRequest, opts ...grpc.CallOption) (*ClosedChannelsResponse, error) + // + //OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + //call is meant to be consumed by clients to the REST proxy. As with all + //other sync calls, all byte slices are intended to be populated as hex + //encoded strings. + OpenChannelSync(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*ChannelPoint, error) + // lncli: `openchannel` + //OpenChannel attempts to open a singly funded channel specified in the + //request to a remote peer. Users are able to specify a target number of + //blocks that the funding transaction should be confirmed in, or a manual fee + //rate to us for the funding transaction. If neither are specified, then a + //lax block confirmation target is used. Each OpenStatusUpdate will return + //the pending channel ID of the in-progress channel. Depending on the + //arguments specified in the OpenChannelRequest, this pending channel ID can + //then be used to manually progress the channel funding flow. + OpenChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (Lightning_OpenChannelClient, error) + // + //FundingStateStep is an advanced funding related call that allows the caller + //to either execute some preparatory steps for a funding workflow, or + //manually progress a funding workflow. The primary way a funding flow is + //identified is via its pending channel ID. As an example, this method can be + //used to specify that we're expecting a funding flow for a particular + //pending channel ID, for which we need to use specific parameters. + //Alternatively, this can be used to interactively drive PSBT signing for + //funding for partially complete funding transactions. + FundingStateStep(ctx context.Context, in *FundingTransitionMsg, opts ...grpc.CallOption) (*FundingStateStepResp, error) + // + //ChannelAcceptor dispatches a bi-directional streaming RPC in which + //OpenChannel requests are sent to the client and the client responds with + //a boolean that tells LND whether or not to accept the channel. This allows + //node operators to specify their own criteria for accepting inbound channels + //through a single persistent connection. + ChannelAcceptor(ctx context.Context, opts ...grpc.CallOption) (Lightning_ChannelAcceptorClient, error) + // lncli: `closechannel` + //CloseChannel attempts to close an active channel identified by its channel + //outpoint (ChannelPoint). The actions of this method can additionally be + //augmented to attempt a force close after a timeout period in the case of an + //inactive peer. If a non-force close (cooperative closure) is requested, + //then the user can specify either a target number of blocks until the + //closure transaction is confirmed, or a manual fee rate. If neither are + //specified, then a default lax, block confirmation target is used. + CloseChannel(ctx context.Context, in *CloseChannelRequest, opts ...grpc.CallOption) (Lightning_CloseChannelClient, error) + // lncli: `abandonchannel` + //AbandonChannel removes all channel state from the database except for a + //close summary. This method can be used to get rid of permanently unusable + //channels due to bugs fixed in newer versions of lnd. This method can also be + //used to remove externally funded channels where the funding transaction was + //never broadcast. Only available for non-externally funded channels in dev + //build. + AbandonChannel(ctx context.Context, in *AbandonChannelRequest, opts ...grpc.CallOption) (*AbandonChannelResponse, error) + // Deprecated: Do not use. + // lncli: `sendpayment` + //Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a + //bi-directional streaming RPC for sending payments through the Lightning + //Network. A single RPC invocation creates a persistent bi-directional + //stream allowing clients to rapidly send payments through the Lightning + //Network with a single persistent connection. + SendPayment(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendPaymentClient, error) + // + //SendPaymentSync is the synchronous non-streaming version of SendPayment. + //This RPC is intended to be consumed by clients of the REST proxy. + //Additionally, this RPC expects the destination's public key and the payment + //hash (if any) to be encoded as hex strings. + SendPaymentSync(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) + // Deprecated: Do not use. + // lncli: `sendtoroute` + //Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + //streaming RPC for sending payment through the Lightning Network. This + //method differs from SendPayment in that it allows users to specify a full + //route manually. This can be used for things like rebalancing, and atomic + //swaps. + SendToRoute(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendToRouteClient, error) + // + //SendToRouteSync is a synchronous version of SendToRoute. It Will block + //until the payment either fails or succeeds. + SendToRouteSync(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendResponse, error) + // lncli: `addinvoice` + //AddInvoice attempts to add a new invoice to the invoice database. Any + //duplicated invoices are rejected, therefore all invoices *must* have a + //unique payment preimage. + AddInvoice(ctx context.Context, in *Invoice, opts ...grpc.CallOption) (*AddInvoiceResponse, error) + // lncli: `listinvoices` + //ListInvoices returns a list of all the invoices currently stored within the + //database. Any active debug invoices are ignored. It has full support for + //paginated responses, allowing users to query for specific invoices through + //their add_index. This can be done by using either the first_index_offset or + //last_index_offset fields included in the response as the index_offset of the + //next request. By default, the first 100 invoices created will be returned. + //Backwards pagination is also supported through the Reversed flag. + ListInvoices(ctx context.Context, in *ListInvoiceRequest, opts ...grpc.CallOption) (*ListInvoiceResponse, error) + // lncli: `lookupinvoice` + //LookupInvoice attempts to look up an invoice according to its payment hash. + //The passed payment hash *must* be exactly 32 bytes, if not, an error is + //returned. + LookupInvoice(ctx context.Context, in *PaymentHash, opts ...grpc.CallOption) (*Invoice, error) + // + //SubscribeInvoices returns a uni-directional stream (server -> client) for + //notifying the client of newly added/settled invoices. The caller can + //optionally specify the add_index and/or the settle_index. If the add_index + //is specified, then we'll first start by sending add invoice events for all + //invoices with an add_index greater than the specified value. If the + //settle_index is specified, the next, we'll send out all settle events for + //invoices with a settle_index greater than the specified value. One or both + //of these fields can be set. If no fields are set, then we'll only send out + //the latest add/settle events. + SubscribeInvoices(ctx context.Context, in *InvoiceSubscription, opts ...grpc.CallOption) (Lightning_SubscribeInvoicesClient, error) + // lncli: `decodepayreq` + //DecodePayReq takes an encoded payment request string and attempts to decode + //it, returning a full description of the conditions encoded within the + //payment request. + DecodePayReq(ctx context.Context, in *PayReqString, opts ...grpc.CallOption) (*PayReq, error) + // lncli: `listpayments` + //ListPayments returns a list of all outgoing payments. + ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) + // + //DeleteAllPayments deletes all outgoing payments from DB. + DeleteAllPayments(ctx context.Context, in *DeleteAllPaymentsRequest, opts ...grpc.CallOption) (*DeleteAllPaymentsResponse, error) + // lncli: `describegraph` + //DescribeGraph returns a description of the latest graph state from the + //point of view of the node. The graph information is partitioned into two + //components: all the nodes/vertexes, and all the edges that connect the + //vertexes themselves. As this is a directed graph, the edges also contain + //the node directional specific routing policy which includes: the time lock + //delta, fee information, etc. + DescribeGraph(ctx context.Context, in *ChannelGraphRequest, opts ...grpc.CallOption) (*ChannelGraph, error) + // lncli: `getnodemetrics` + //GetNodeMetrics returns node metrics calculated from the graph. Currently + //the only supported metric is betweenness centrality of individual nodes. + GetNodeMetrics(ctx context.Context, in *NodeMetricsRequest, opts ...grpc.CallOption) (*NodeMetricsResponse, error) + // lncli: `getchaninfo` + //GetChanInfo returns the latest authenticated network announcement for the + //given channel identified by its channel ID: an 8-byte integer which + //uniquely identifies the location of transaction's funding output within the + //blockchain. + GetChanInfo(ctx context.Context, in *ChanInfoRequest, opts ...grpc.CallOption) (*ChannelEdge, error) + // lncli: `getnodeinfo` + //GetNodeInfo returns the latest advertised, aggregated, and authenticated + //channel information for the specified node identified by its public key. + GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfo, error) + // lncli: `queryroutes` + //QueryRoutes attempts to query the daemon's Channel Router for a possible + //route to a target destination capable of carrying a specific amount of + //satoshis. The returned route contains the full details required to craft and + //send an HTLC, also including the necessary information that should be + //present within the Sphinx packet encapsulated within the HTLC. + // + //When using REST, the `dest_custom_records` map type can be set by appending + //`&dest_custom_records[]=` + //to the URL. Unfortunately this map type doesn't appear in the REST API + //documentation because of a bug in the grpc-gateway library. + QueryRoutes(ctx context.Context, in *QueryRoutesRequest, opts ...grpc.CallOption) (*QueryRoutesResponse, error) + // lncli: `getnetworkinfo` + //GetNetworkInfo returns some basic stats about the known channel graph from + //the point of view of the node. + GetNetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfo, error) + // lncli: `stop` + //StopDaemon will send a shutdown request to the interrupt handler, triggering + //a graceful shutdown of the daemon. + StopDaemon(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) + // + //SubscribeChannelGraph launches a streaming RPC that allows the caller to + //receive notifications upon any changes to the channel graph topology from + //the point of view of the responding node. Events notified include: new + //nodes coming online, nodes updating their authenticated attributes, new + //channels being advertised, updates in the routing policy for a directional + //channel edge, and when channels are closed on-chain. + SubscribeChannelGraph(ctx context.Context, in *GraphTopologySubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelGraphClient, error) + // lncli: `debuglevel` + //DebugLevel allows a caller to programmatically set the logging verbosity of + //lnd. The logging can be targeted according to a coarse daemon-wide logging + //level, or in a granular fashion to specify the logging for a target + //sub-system. + DebugLevel(ctx context.Context, in *DebugLevelRequest, opts ...grpc.CallOption) (*DebugLevelResponse, error) + // lncli: `feereport` + //FeeReport allows the caller to obtain a report detailing the current fee + //schedule enforced by the node globally for each channel. + FeeReport(ctx context.Context, in *FeeReportRequest, opts ...grpc.CallOption) (*FeeReportResponse, error) + // lncli: `updatechanpolicy` + //UpdateChannelPolicy allows the caller to update the fee schedule and + //channel policies for all channels globally, or a particular channel. + UpdateChannelPolicy(ctx context.Context, in *PolicyUpdateRequest, opts ...grpc.CallOption) (*PolicyUpdateResponse, error) + // lncli: `fwdinghistory` + //ForwardingHistory allows the caller to query the htlcswitch for a record of + //all HTLCs forwarded within the target time range, and integer offset + //within that time range, for a maximum number of events. If no maximum number + //of events is specified, up to 100 events will be returned. If no time-range + //is specified, then events will be returned in the order that they occured. + // + //A list of forwarding events are returned. The size of each forwarding event + //is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. + //As a result each message can only contain 50k entries. Each response has + //the index offset of the last entry. The index offset can be provided to the + //request to allow the caller to skip a series of records. + ForwardingHistory(ctx context.Context, in *ForwardingHistoryRequest, opts ...grpc.CallOption) (*ForwardingHistoryResponse, error) + // lncli: `exportchanbackup` + //ExportChannelBackup attempts to return an encrypted static channel backup + //for the target channel identified by it channel point. The backup is + //encrypted with a key generated from the aezeed seed of the user. The + //returned backup can either be restored using the RestoreChannelBackup + //method once lnd is running, or via the InitWallet and UnlockWallet methods + //from the WalletUnlocker service. + ExportChannelBackup(ctx context.Context, in *ExportChannelBackupRequest, opts ...grpc.CallOption) (*ChannelBackup, error) + // + //ExportAllChannelBackups returns static channel backups for all existing + //channels known to lnd. A set of regular singular static channel backups for + //each channel are returned. Additionally, a multi-channel backup is returned + //as well, which contains a single encrypted blob containing the backups of + //each channel. + ExportAllChannelBackups(ctx context.Context, in *ChanBackupExportRequest, opts ...grpc.CallOption) (*ChanBackupSnapshot, error) + // + //VerifyChanBackup allows a caller to verify the integrity of a channel backup + //snapshot. This method will accept either a packed Single or a packed Multi. + //Specifying both will result in an error. + VerifyChanBackup(ctx context.Context, in *ChanBackupSnapshot, opts ...grpc.CallOption) (*VerifyChanBackupResponse, error) + // lncli: `restorechanbackup` + //RestoreChannelBackups accepts a set of singular channel backups, or a + //single encrypted multi-chan backup and attempts to recover any funds + //remaining within the channel. If we are able to unpack the backup, then the + //new channel will be shown under listchannels, as well as pending channels. + RestoreChannelBackups(ctx context.Context, in *RestoreChanBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) + // + //SubscribeChannelBackups allows a client to sub-subscribe to the most up to + //date information concerning the state of all channel backups. Each time a + //new channel is added, we return the new set of channels, along with a + //multi-chan backup containing the backup info for all channels. Each time a + //channel is closed, we send a new update, which contains new new chan back + //ups, but the updated set of encrypted multi-chan backups with the closed + //channel(s) removed. + SubscribeChannelBackups(ctx context.Context, in *ChannelBackupSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelBackupsClient, error) + // lncli: `bakemacaroon` + //BakeMacaroon allows the creation of a new macaroon with custom read and + //write permissions. No first-party caveats are added since this can be done + //offline. + BakeMacaroon(ctx context.Context, in *BakeMacaroonRequest, opts ...grpc.CallOption) (*BakeMacaroonResponse, error) + // lncli: `listmacaroonids` + //ListMacaroonIDs returns all root key IDs that are in use. + ListMacaroonIDs(ctx context.Context, in *ListMacaroonIDsRequest, opts ...grpc.CallOption) (*ListMacaroonIDsResponse, error) + // lncli: `deletemacaroonid` + //DeleteMacaroonID deletes the specified macaroon ID and invalidates all + //macaroons derived from that ID. + DeleteMacaroonID(ctx context.Context, in *DeleteMacaroonIDRequest, opts ...grpc.CallOption) (*DeleteMacaroonIDResponse, error) + // lncli: `listpermissions` + //ListPermissions lists all RPC method URIs and their required macaroon + //permissions to access them. + ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error) +} + +type lightningClient struct { + cc grpc.ClientConnInterface +} + +func NewLightningClient(cc grpc.ClientConnInterface) LightningClient { + return &lightningClient{cc} +} + +func (c *lightningClient) WalletBalance(ctx context.Context, in *WalletBalanceRequest, opts ...grpc.CallOption) (*WalletBalanceResponse, error) { + out := new(WalletBalanceResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/WalletBalance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ChannelBalance(ctx context.Context, in *ChannelBalanceRequest, opts ...grpc.CallOption) (*ChannelBalanceResponse, error) { + out := new(ChannelBalanceResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ChannelBalance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) GetTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (*TransactionDetails, error) { + out := new(TransactionDetails) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetTransactions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) { + out := new(EstimateFeeResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/EstimateFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SendCoins(ctx context.Context, in *SendCoinsRequest, opts ...grpc.CallOption) (*SendCoinsResponse, error) { + out := new(SendCoinsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendCoins", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) { + out := new(ListUnspentResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListUnspent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SubscribeTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (Lightning_SubscribeTransactionsClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[0], "/lnrpc.Lightning/SubscribeTransactions", opts...) + if err != nil { + return nil, err + } + x := &lightningSubscribeTransactionsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_SubscribeTransactionsClient interface { + Recv() (*Transaction, error) + grpc.ClientStream +} + +type lightningSubscribeTransactionsClient struct { + grpc.ClientStream +} + +func (x *lightningSubscribeTransactionsClient) Recv() (*Transaction, error) { + m := new(Transaction) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) SendMany(ctx context.Context, in *SendManyRequest, opts ...grpc.CallOption) (*SendManyResponse, error) { + out := new(SendManyResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendMany", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error) { + out := new(NewAddressResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/NewAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) { + out := new(SignMessageResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SignMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) VerifyMessage(ctx context.Context, in *VerifyMessageRequest, opts ...grpc.CallOption) (*VerifyMessageResponse, error) { + out := new(VerifyMessageResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/VerifyMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error) { + out := new(ConnectPeerResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ConnectPeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) DisconnectPeer(ctx context.Context, in *DisconnectPeerRequest, opts ...grpc.CallOption) (*DisconnectPeerResponse, error) { + out := new(DisconnectPeerResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DisconnectPeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) { + out := new(ListPeersResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListPeers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SubscribePeerEvents(ctx context.Context, in *PeerEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribePeerEventsClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[1], "/lnrpc.Lightning/SubscribePeerEvents", opts...) + if err != nil { + return nil, err + } + x := &lightningSubscribePeerEventsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_SubscribePeerEventsClient interface { + Recv() (*PeerEvent, error) + grpc.ClientStream +} + +type lightningSubscribePeerEventsClient struct { + grpc.ClientStream +} + +func (x *lightningSubscribePeerEventsClient) Recv() (*PeerEvent, error) { + m := new(PeerEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { + out := new(GetInfoResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) GetRecoveryInfo(ctx context.Context, in *GetRecoveryInfoRequest, opts ...grpc.CallOption) (*GetRecoveryInfoResponse, error) { + out := new(GetRecoveryInfoResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetRecoveryInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) PendingChannels(ctx context.Context, in *PendingChannelsRequest, opts ...grpc.CallOption) (*PendingChannelsResponse, error) { + out := new(PendingChannelsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/PendingChannels", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) { + out := new(ListChannelsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListChannels", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SubscribeChannelEvents(ctx context.Context, in *ChannelEventSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelEventsClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[2], "/lnrpc.Lightning/SubscribeChannelEvents", opts...) + if err != nil { + return nil, err + } + x := &lightningSubscribeChannelEventsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_SubscribeChannelEventsClient interface { + Recv() (*ChannelEventUpdate, error) + grpc.ClientStream +} + +type lightningSubscribeChannelEventsClient struct { + grpc.ClientStream +} + +func (x *lightningSubscribeChannelEventsClient) Recv() (*ChannelEventUpdate, error) { + m := new(ChannelEventUpdate) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) ClosedChannels(ctx context.Context, in *ClosedChannelsRequest, opts ...grpc.CallOption) (*ClosedChannelsResponse, error) { + out := new(ClosedChannelsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ClosedChannels", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) OpenChannelSync(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*ChannelPoint, error) { + out := new(ChannelPoint) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/OpenChannelSync", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) OpenChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (Lightning_OpenChannelClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[3], "/lnrpc.Lightning/OpenChannel", opts...) + if err != nil { + return nil, err + } + x := &lightningOpenChannelClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_OpenChannelClient interface { + Recv() (*OpenStatusUpdate, error) + grpc.ClientStream +} + +type lightningOpenChannelClient struct { + grpc.ClientStream +} + +func (x *lightningOpenChannelClient) Recv() (*OpenStatusUpdate, error) { + m := new(OpenStatusUpdate) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) FundingStateStep(ctx context.Context, in *FundingTransitionMsg, opts ...grpc.CallOption) (*FundingStateStepResp, error) { + out := new(FundingStateStepResp) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/FundingStateStep", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ChannelAcceptor(ctx context.Context, opts ...grpc.CallOption) (Lightning_ChannelAcceptorClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[4], "/lnrpc.Lightning/ChannelAcceptor", opts...) + if err != nil { + return nil, err + } + x := &lightningChannelAcceptorClient{stream} + return x, nil +} + +type Lightning_ChannelAcceptorClient interface { + Send(*ChannelAcceptResponse) error + Recv() (*ChannelAcceptRequest, error) + grpc.ClientStream +} + +type lightningChannelAcceptorClient struct { + grpc.ClientStream +} + +func (x *lightningChannelAcceptorClient) Send(m *ChannelAcceptResponse) error { + return x.ClientStream.SendMsg(m) +} + +func (x *lightningChannelAcceptorClient) Recv() (*ChannelAcceptRequest, error) { + m := new(ChannelAcceptRequest) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) CloseChannel(ctx context.Context, in *CloseChannelRequest, opts ...grpc.CallOption) (Lightning_CloseChannelClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[5], "/lnrpc.Lightning/CloseChannel", opts...) + if err != nil { + return nil, err + } + x := &lightningCloseChannelClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_CloseChannelClient interface { + Recv() (*CloseStatusUpdate, error) + grpc.ClientStream +} + +type lightningCloseChannelClient struct { + grpc.ClientStream +} + +func (x *lightningCloseChannelClient) Recv() (*CloseStatusUpdate, error) { + m := new(CloseStatusUpdate) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) AbandonChannel(ctx context.Context, in *AbandonChannelRequest, opts ...grpc.CallOption) (*AbandonChannelResponse, error) { + out := new(AbandonChannelResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/AbandonChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *lightningClient) SendPayment(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendPaymentClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[6], "/lnrpc.Lightning/SendPayment", opts...) + if err != nil { + return nil, err + } + x := &lightningSendPaymentClient{stream} + return x, nil +} + +type Lightning_SendPaymentClient interface { + Send(*SendRequest) error + Recv() (*SendResponse, error) + grpc.ClientStream +} + +type lightningSendPaymentClient struct { + grpc.ClientStream +} + +func (x *lightningSendPaymentClient) Send(m *SendRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *lightningSendPaymentClient) Recv() (*SendResponse, error) { + m := new(SendResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) SendPaymentSync(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) { + out := new(SendResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendPaymentSync", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *lightningClient) SendToRoute(ctx context.Context, opts ...grpc.CallOption) (Lightning_SendToRouteClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[7], "/lnrpc.Lightning/SendToRoute", opts...) + if err != nil { + return nil, err + } + x := &lightningSendToRouteClient{stream} + return x, nil +} + +type Lightning_SendToRouteClient interface { + Send(*SendToRouteRequest) error + Recv() (*SendResponse, error) + grpc.ClientStream +} + +type lightningSendToRouteClient struct { + grpc.ClientStream +} + +func (x *lightningSendToRouteClient) Send(m *SendToRouteRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *lightningSendToRouteClient) Recv() (*SendResponse, error) { + m := new(SendResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) SendToRouteSync(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendResponse, error) { + out := new(SendResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/SendToRouteSync", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) AddInvoice(ctx context.Context, in *Invoice, opts ...grpc.CallOption) (*AddInvoiceResponse, error) { + out := new(AddInvoiceResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/AddInvoice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListInvoices(ctx context.Context, in *ListInvoiceRequest, opts ...grpc.CallOption) (*ListInvoiceResponse, error) { + out := new(ListInvoiceResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListInvoices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) LookupInvoice(ctx context.Context, in *PaymentHash, opts ...grpc.CallOption) (*Invoice, error) { + out := new(Invoice) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/LookupInvoice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SubscribeInvoices(ctx context.Context, in *InvoiceSubscription, opts ...grpc.CallOption) (Lightning_SubscribeInvoicesClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[8], "/lnrpc.Lightning/SubscribeInvoices", opts...) + if err != nil { + return nil, err + } + x := &lightningSubscribeInvoicesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_SubscribeInvoicesClient interface { + Recv() (*Invoice, error) + grpc.ClientStream +} + +type lightningSubscribeInvoicesClient struct { + grpc.ClientStream +} + +func (x *lightningSubscribeInvoicesClient) Recv() (*Invoice, error) { + m := new(Invoice) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) DecodePayReq(ctx context.Context, in *PayReqString, opts ...grpc.CallOption) (*PayReq, error) { + out := new(PayReq) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DecodePayReq", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) { + out := new(ListPaymentsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListPayments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) DeleteAllPayments(ctx context.Context, in *DeleteAllPaymentsRequest, opts ...grpc.CallOption) (*DeleteAllPaymentsResponse, error) { + out := new(DeleteAllPaymentsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DeleteAllPayments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) DescribeGraph(ctx context.Context, in *ChannelGraphRequest, opts ...grpc.CallOption) (*ChannelGraph, error) { + out := new(ChannelGraph) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DescribeGraph", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) GetNodeMetrics(ctx context.Context, in *NodeMetricsRequest, opts ...grpc.CallOption) (*NodeMetricsResponse, error) { + out := new(NodeMetricsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetNodeMetrics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) GetChanInfo(ctx context.Context, in *ChanInfoRequest, opts ...grpc.CallOption) (*ChannelEdge, error) { + out := new(ChannelEdge) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetChanInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfo, error) { + out := new(NodeInfo) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetNodeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) QueryRoutes(ctx context.Context, in *QueryRoutesRequest, opts ...grpc.CallOption) (*QueryRoutesResponse, error) { + out := new(QueryRoutesResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/QueryRoutes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) GetNetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfo, error) { + out := new(NetworkInfo) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetNetworkInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) StopDaemon(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) { + out := new(StopResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/StopDaemon", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SubscribeChannelGraph(ctx context.Context, in *GraphTopologySubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelGraphClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[9], "/lnrpc.Lightning/SubscribeChannelGraph", opts...) + if err != nil { + return nil, err + } + x := &lightningSubscribeChannelGraphClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_SubscribeChannelGraphClient interface { + Recv() (*GraphTopologyUpdate, error) + grpc.ClientStream +} + +type lightningSubscribeChannelGraphClient struct { + grpc.ClientStream +} + +func (x *lightningSubscribeChannelGraphClient) Recv() (*GraphTopologyUpdate, error) { + m := new(GraphTopologyUpdate) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) DebugLevel(ctx context.Context, in *DebugLevelRequest, opts ...grpc.CallOption) (*DebugLevelResponse, error) { + out := new(DebugLevelResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DebugLevel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) FeeReport(ctx context.Context, in *FeeReportRequest, opts ...grpc.CallOption) (*FeeReportResponse, error) { + out := new(FeeReportResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/FeeReport", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) UpdateChannelPolicy(ctx context.Context, in *PolicyUpdateRequest, opts ...grpc.CallOption) (*PolicyUpdateResponse, error) { + out := new(PolicyUpdateResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/UpdateChannelPolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ForwardingHistory(ctx context.Context, in *ForwardingHistoryRequest, opts ...grpc.CallOption) (*ForwardingHistoryResponse, error) { + out := new(ForwardingHistoryResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ForwardingHistory", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ExportChannelBackup(ctx context.Context, in *ExportChannelBackupRequest, opts ...grpc.CallOption) (*ChannelBackup, error) { + out := new(ChannelBackup) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ExportChannelBackup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ExportAllChannelBackups(ctx context.Context, in *ChanBackupExportRequest, opts ...grpc.CallOption) (*ChanBackupSnapshot, error) { + out := new(ChanBackupSnapshot) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ExportAllChannelBackups", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) VerifyChanBackup(ctx context.Context, in *ChanBackupSnapshot, opts ...grpc.CallOption) (*VerifyChanBackupResponse, error) { + out := new(VerifyChanBackupResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/VerifyChanBackup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) RestoreChannelBackups(ctx context.Context, in *RestoreChanBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) { + out := new(RestoreBackupResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/RestoreChannelBackups", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) SubscribeChannelBackups(ctx context.Context, in *ChannelBackupSubscription, opts ...grpc.CallOption) (Lightning_SubscribeChannelBackupsClient, error) { + stream, err := c.cc.NewStream(ctx, &Lightning_ServiceDesc.Streams[10], "/lnrpc.Lightning/SubscribeChannelBackups", opts...) + if err != nil { + return nil, err + } + x := &lightningSubscribeChannelBackupsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Lightning_SubscribeChannelBackupsClient interface { + Recv() (*ChanBackupSnapshot, error) + grpc.ClientStream +} + +type lightningSubscribeChannelBackupsClient struct { + grpc.ClientStream +} + +func (x *lightningSubscribeChannelBackupsClient) Recv() (*ChanBackupSnapshot, error) { + m := new(ChanBackupSnapshot) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *lightningClient) BakeMacaroon(ctx context.Context, in *BakeMacaroonRequest, opts ...grpc.CallOption) (*BakeMacaroonResponse, error) { + out := new(BakeMacaroonResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/BakeMacaroon", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListMacaroonIDs(ctx context.Context, in *ListMacaroonIDsRequest, opts ...grpc.CallOption) (*ListMacaroonIDsResponse, error) { + out := new(ListMacaroonIDsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListMacaroonIDs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) DeleteMacaroonID(ctx context.Context, in *DeleteMacaroonIDRequest, opts ...grpc.CallOption) (*DeleteMacaroonIDResponse, error) { + out := new(DeleteMacaroonIDResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/DeleteMacaroonID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lightningClient) ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error) { + out := new(ListPermissionsResponse) + err := c.cc.Invoke(ctx, "/lnrpc.Lightning/ListPermissions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LightningServer is the server API for Lightning service. +// All implementations must embed UnimplementedLightningServer +// for forward compatibility +type LightningServer interface { + // lncli: `walletbalance` + //WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + //confirmed unspent outputs and all unconfirmed unspent outputs under control + //of the wallet. + WalletBalance(context.Context, *WalletBalanceRequest) (*WalletBalanceResponse, error) + // lncli: `channelbalance` + //ChannelBalance returns a report on the total funds across all open channels, + //categorized in local/remote, pending local/remote and unsettled local/remote + //balances. + ChannelBalance(context.Context, *ChannelBalanceRequest) (*ChannelBalanceResponse, error) + // lncli: `listchaintxns` + //GetTransactions returns a list describing all the known transactions + //relevant to the wallet. + GetTransactions(context.Context, *GetTransactionsRequest) (*TransactionDetails, error) + // lncli: `estimatefee` + //EstimateFee asks the chain backend to estimate the fee rate and total fees + //for a transaction that pays to multiple specified outputs. + // + //When using REST, the `AddrToAmount` map type can be set by appending + //`&AddrToAmount[
]=` to the URL. Unfortunately this + //map type doesn't appear in the REST API documentation because of a bug in + //the grpc-gateway library. + EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) + // lncli: `sendcoins` + //SendCoins executes a request to send coins to a particular address. Unlike + //SendMany, this RPC call only allows creating a single output at a time. If + //neither target_conf, or sat_per_vbyte are set, then the internal wallet will + //consult its fee model to determine a fee for the default confirmation + //target. + SendCoins(context.Context, *SendCoinsRequest) (*SendCoinsResponse, error) + // lncli: `listunspent` + //Deprecated, use walletrpc.ListUnspent instead. + // + //ListUnspent returns a list of all utxos spendable by the wallet with a + //number of confirmations between the specified minimum and maximum. + ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) + // + //SubscribeTransactions creates a uni-directional stream from the server to + //the client in which any newly discovered transactions relevant to the + //wallet are sent over. + SubscribeTransactions(*GetTransactionsRequest, Lightning_SubscribeTransactionsServer) error + // lncli: `sendmany` + //SendMany handles a request for a transaction that creates multiple specified + //outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then + //the internal wallet will consult its fee model to determine a fee for the + //default confirmation target. + SendMany(context.Context, *SendManyRequest) (*SendManyResponse, error) + // lncli: `newaddress` + //NewAddress creates a new address under control of the local wallet. + NewAddress(context.Context, *NewAddressRequest) (*NewAddressResponse, error) + // lncli: `signmessage` + //SignMessage signs a message with this node's private key. The returned + //signature string is `zbase32` encoded and pubkey recoverable, meaning that + //only the message digest and signature are needed for verification. + SignMessage(context.Context, *SignMessageRequest) (*SignMessageResponse, error) + // lncli: `verifymessage` + //VerifyMessage verifies a signature over a msg. The signature must be + //zbase32 encoded and signed by an active node in the resident node's + //channel database. In addition to returning the validity of the signature, + //VerifyMessage also returns the recovered pubkey from the signature. + VerifyMessage(context.Context, *VerifyMessageRequest) (*VerifyMessageResponse, error) + // lncli: `connect` + //ConnectPeer attempts to establish a connection to a remote peer. This is at + //the networking level, and is used for communication between nodes. This is + //distinct from establishing a channel with a peer. + ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error) + // lncli: `disconnect` + //DisconnectPeer attempts to disconnect one peer from another identified by a + //given pubKey. In the case that we currently have a pending or active channel + //with the target peer, then this action will be not be allowed. + DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error) + // lncli: `listpeers` + //ListPeers returns a verbose listing of all currently active peers. + ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) + // + //SubscribePeerEvents creates a uni-directional stream from the server to + //the client in which any events relevant to the state of peers are sent + //over. Events include peers going online and offline. + SubscribePeerEvents(*PeerEventSubscription, Lightning_SubscribePeerEventsServer) error + // lncli: `getinfo` + //GetInfo returns general information concerning the lightning node including + //it's identity pubkey, alias, the chains it is connected to, and information + //concerning the number of open+pending channels. + GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) + //* lncli: `getrecoveryinfo` + //GetRecoveryInfo returns information concerning the recovery mode including + //whether it's in a recovery mode, whether the recovery is finished, and the + //progress made so far. + GetRecoveryInfo(context.Context, *GetRecoveryInfoRequest) (*GetRecoveryInfoResponse, error) + // lncli: `pendingchannels` + //PendingChannels returns a list of all the channels that are currently + //considered "pending". A channel is pending if it has finished the funding + //workflow and is waiting for confirmations for the funding txn, or is in the + //process of closure, either initiated cooperatively or non-cooperatively. + PendingChannels(context.Context, *PendingChannelsRequest) (*PendingChannelsResponse, error) + // lncli: `listchannels` + //ListChannels returns a description of all the open channels that this node + //is a participant in. + ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) + // + //SubscribeChannelEvents creates a uni-directional stream from the server to + //the client in which any updates relevant to the state of the channels are + //sent over. Events include new active channels, inactive channels, and closed + //channels. + SubscribeChannelEvents(*ChannelEventSubscription, Lightning_SubscribeChannelEventsServer) error + // lncli: `closedchannels` + //ClosedChannels returns a description of all the closed channels that + //this node was a participant in. + ClosedChannels(context.Context, *ClosedChannelsRequest) (*ClosedChannelsResponse, error) + // + //OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + //call is meant to be consumed by clients to the REST proxy. As with all + //other sync calls, all byte slices are intended to be populated as hex + //encoded strings. + OpenChannelSync(context.Context, *OpenChannelRequest) (*ChannelPoint, error) + // lncli: `openchannel` + //OpenChannel attempts to open a singly funded channel specified in the + //request to a remote peer. Users are able to specify a target number of + //blocks that the funding transaction should be confirmed in, or a manual fee + //rate to us for the funding transaction. If neither are specified, then a + //lax block confirmation target is used. Each OpenStatusUpdate will return + //the pending channel ID of the in-progress channel. Depending on the + //arguments specified in the OpenChannelRequest, this pending channel ID can + //then be used to manually progress the channel funding flow. + OpenChannel(*OpenChannelRequest, Lightning_OpenChannelServer) error + // + //FundingStateStep is an advanced funding related call that allows the caller + //to either execute some preparatory steps for a funding workflow, or + //manually progress a funding workflow. The primary way a funding flow is + //identified is via its pending channel ID. As an example, this method can be + //used to specify that we're expecting a funding flow for a particular + //pending channel ID, for which we need to use specific parameters. + //Alternatively, this can be used to interactively drive PSBT signing for + //funding for partially complete funding transactions. + FundingStateStep(context.Context, *FundingTransitionMsg) (*FundingStateStepResp, error) + // + //ChannelAcceptor dispatches a bi-directional streaming RPC in which + //OpenChannel requests are sent to the client and the client responds with + //a boolean that tells LND whether or not to accept the channel. This allows + //node operators to specify their own criteria for accepting inbound channels + //through a single persistent connection. + ChannelAcceptor(Lightning_ChannelAcceptorServer) error + // lncli: `closechannel` + //CloseChannel attempts to close an active channel identified by its channel + //outpoint (ChannelPoint). The actions of this method can additionally be + //augmented to attempt a force close after a timeout period in the case of an + //inactive peer. If a non-force close (cooperative closure) is requested, + //then the user can specify either a target number of blocks until the + //closure transaction is confirmed, or a manual fee rate. If neither are + //specified, then a default lax, block confirmation target is used. + CloseChannel(*CloseChannelRequest, Lightning_CloseChannelServer) error + // lncli: `abandonchannel` + //AbandonChannel removes all channel state from the database except for a + //close summary. This method can be used to get rid of permanently unusable + //channels due to bugs fixed in newer versions of lnd. This method can also be + //used to remove externally funded channels where the funding transaction was + //never broadcast. Only available for non-externally funded channels in dev + //build. + AbandonChannel(context.Context, *AbandonChannelRequest) (*AbandonChannelResponse, error) + // Deprecated: Do not use. + // lncli: `sendpayment` + //Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a + //bi-directional streaming RPC for sending payments through the Lightning + //Network. A single RPC invocation creates a persistent bi-directional + //stream allowing clients to rapidly send payments through the Lightning + //Network with a single persistent connection. + SendPayment(Lightning_SendPaymentServer) error + // + //SendPaymentSync is the synchronous non-streaming version of SendPayment. + //This RPC is intended to be consumed by clients of the REST proxy. + //Additionally, this RPC expects the destination's public key and the payment + //hash (if any) to be encoded as hex strings. + SendPaymentSync(context.Context, *SendRequest) (*SendResponse, error) + // Deprecated: Do not use. + // lncli: `sendtoroute` + //Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + //streaming RPC for sending payment through the Lightning Network. This + //method differs from SendPayment in that it allows users to specify a full + //route manually. This can be used for things like rebalancing, and atomic + //swaps. + SendToRoute(Lightning_SendToRouteServer) error + // + //SendToRouteSync is a synchronous version of SendToRoute. It Will block + //until the payment either fails or succeeds. + SendToRouteSync(context.Context, *SendToRouteRequest) (*SendResponse, error) + // lncli: `addinvoice` + //AddInvoice attempts to add a new invoice to the invoice database. Any + //duplicated invoices are rejected, therefore all invoices *must* have a + //unique payment preimage. + AddInvoice(context.Context, *Invoice) (*AddInvoiceResponse, error) + // lncli: `listinvoices` + //ListInvoices returns a list of all the invoices currently stored within the + //database. Any active debug invoices are ignored. It has full support for + //paginated responses, allowing users to query for specific invoices through + //their add_index. This can be done by using either the first_index_offset or + //last_index_offset fields included in the response as the index_offset of the + //next request. By default, the first 100 invoices created will be returned. + //Backwards pagination is also supported through the Reversed flag. + ListInvoices(context.Context, *ListInvoiceRequest) (*ListInvoiceResponse, error) + // lncli: `lookupinvoice` + //LookupInvoice attempts to look up an invoice according to its payment hash. + //The passed payment hash *must* be exactly 32 bytes, if not, an error is + //returned. + LookupInvoice(context.Context, *PaymentHash) (*Invoice, error) + // + //SubscribeInvoices returns a uni-directional stream (server -> client) for + //notifying the client of newly added/settled invoices. The caller can + //optionally specify the add_index and/or the settle_index. If the add_index + //is specified, then we'll first start by sending add invoice events for all + //invoices with an add_index greater than the specified value. If the + //settle_index is specified, the next, we'll send out all settle events for + //invoices with a settle_index greater than the specified value. One or both + //of these fields can be set. If no fields are set, then we'll only send out + //the latest add/settle events. + SubscribeInvoices(*InvoiceSubscription, Lightning_SubscribeInvoicesServer) error + // lncli: `decodepayreq` + //DecodePayReq takes an encoded payment request string and attempts to decode + //it, returning a full description of the conditions encoded within the + //payment request. + DecodePayReq(context.Context, *PayReqString) (*PayReq, error) + // lncli: `listpayments` + //ListPayments returns a list of all outgoing payments. + ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) + // + //DeleteAllPayments deletes all outgoing payments from DB. + DeleteAllPayments(context.Context, *DeleteAllPaymentsRequest) (*DeleteAllPaymentsResponse, error) + // lncli: `describegraph` + //DescribeGraph returns a description of the latest graph state from the + //point of view of the node. The graph information is partitioned into two + //components: all the nodes/vertexes, and all the edges that connect the + //vertexes themselves. As this is a directed graph, the edges also contain + //the node directional specific routing policy which includes: the time lock + //delta, fee information, etc. + DescribeGraph(context.Context, *ChannelGraphRequest) (*ChannelGraph, error) + // lncli: `getnodemetrics` + //GetNodeMetrics returns node metrics calculated from the graph. Currently + //the only supported metric is betweenness centrality of individual nodes. + GetNodeMetrics(context.Context, *NodeMetricsRequest) (*NodeMetricsResponse, error) + // lncli: `getchaninfo` + //GetChanInfo returns the latest authenticated network announcement for the + //given channel identified by its channel ID: an 8-byte integer which + //uniquely identifies the location of transaction's funding output within the + //blockchain. + GetChanInfo(context.Context, *ChanInfoRequest) (*ChannelEdge, error) + // lncli: `getnodeinfo` + //GetNodeInfo returns the latest advertised, aggregated, and authenticated + //channel information for the specified node identified by its public key. + GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfo, error) + // lncli: `queryroutes` + //QueryRoutes attempts to query the daemon's Channel Router for a possible + //route to a target destination capable of carrying a specific amount of + //satoshis. The returned route contains the full details required to craft and + //send an HTLC, also including the necessary information that should be + //present within the Sphinx packet encapsulated within the HTLC. + // + //When using REST, the `dest_custom_records` map type can be set by appending + //`&dest_custom_records[]=` + //to the URL. Unfortunately this map type doesn't appear in the REST API + //documentation because of a bug in the grpc-gateway library. + QueryRoutes(context.Context, *QueryRoutesRequest) (*QueryRoutesResponse, error) + // lncli: `getnetworkinfo` + //GetNetworkInfo returns some basic stats about the known channel graph from + //the point of view of the node. + GetNetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfo, error) + // lncli: `stop` + //StopDaemon will send a shutdown request to the interrupt handler, triggering + //a graceful shutdown of the daemon. + StopDaemon(context.Context, *StopRequest) (*StopResponse, error) + // + //SubscribeChannelGraph launches a streaming RPC that allows the caller to + //receive notifications upon any changes to the channel graph topology from + //the point of view of the responding node. Events notified include: new + //nodes coming online, nodes updating their authenticated attributes, new + //channels being advertised, updates in the routing policy for a directional + //channel edge, and when channels are closed on-chain. + SubscribeChannelGraph(*GraphTopologySubscription, Lightning_SubscribeChannelGraphServer) error + // lncli: `debuglevel` + //DebugLevel allows a caller to programmatically set the logging verbosity of + //lnd. The logging can be targeted according to a coarse daemon-wide logging + //level, or in a granular fashion to specify the logging for a target + //sub-system. + DebugLevel(context.Context, *DebugLevelRequest) (*DebugLevelResponse, error) + // lncli: `feereport` + //FeeReport allows the caller to obtain a report detailing the current fee + //schedule enforced by the node globally for each channel. + FeeReport(context.Context, *FeeReportRequest) (*FeeReportResponse, error) + // lncli: `updatechanpolicy` + //UpdateChannelPolicy allows the caller to update the fee schedule and + //channel policies for all channels globally, or a particular channel. + UpdateChannelPolicy(context.Context, *PolicyUpdateRequest) (*PolicyUpdateResponse, error) + // lncli: `fwdinghistory` + //ForwardingHistory allows the caller to query the htlcswitch for a record of + //all HTLCs forwarded within the target time range, and integer offset + //within that time range, for a maximum number of events. If no maximum number + //of events is specified, up to 100 events will be returned. If no time-range + //is specified, then events will be returned in the order that they occured. + // + //A list of forwarding events are returned. The size of each forwarding event + //is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. + //As a result each message can only contain 50k entries. Each response has + //the index offset of the last entry. The index offset can be provided to the + //request to allow the caller to skip a series of records. + ForwardingHistory(context.Context, *ForwardingHistoryRequest) (*ForwardingHistoryResponse, error) + // lncli: `exportchanbackup` + //ExportChannelBackup attempts to return an encrypted static channel backup + //for the target channel identified by it channel point. The backup is + //encrypted with a key generated from the aezeed seed of the user. The + //returned backup can either be restored using the RestoreChannelBackup + //method once lnd is running, or via the InitWallet and UnlockWallet methods + //from the WalletUnlocker service. + ExportChannelBackup(context.Context, *ExportChannelBackupRequest) (*ChannelBackup, error) + // + //ExportAllChannelBackups returns static channel backups for all existing + //channels known to lnd. A set of regular singular static channel backups for + //each channel are returned. Additionally, a multi-channel backup is returned + //as well, which contains a single encrypted blob containing the backups of + //each channel. + ExportAllChannelBackups(context.Context, *ChanBackupExportRequest) (*ChanBackupSnapshot, error) + // + //VerifyChanBackup allows a caller to verify the integrity of a channel backup + //snapshot. This method will accept either a packed Single or a packed Multi. + //Specifying both will result in an error. + VerifyChanBackup(context.Context, *ChanBackupSnapshot) (*VerifyChanBackupResponse, error) + // lncli: `restorechanbackup` + //RestoreChannelBackups accepts a set of singular channel backups, or a + //single encrypted multi-chan backup and attempts to recover any funds + //remaining within the channel. If we are able to unpack the backup, then the + //new channel will be shown under listchannels, as well as pending channels. + RestoreChannelBackups(context.Context, *RestoreChanBackupRequest) (*RestoreBackupResponse, error) + // + //SubscribeChannelBackups allows a client to sub-subscribe to the most up to + //date information concerning the state of all channel backups. Each time a + //new channel is added, we return the new set of channels, along with a + //multi-chan backup containing the backup info for all channels. Each time a + //channel is closed, we send a new update, which contains new new chan back + //ups, but the updated set of encrypted multi-chan backups with the closed + //channel(s) removed. + SubscribeChannelBackups(*ChannelBackupSubscription, Lightning_SubscribeChannelBackupsServer) error + // lncli: `bakemacaroon` + //BakeMacaroon allows the creation of a new macaroon with custom read and + //write permissions. No first-party caveats are added since this can be done + //offline. + BakeMacaroon(context.Context, *BakeMacaroonRequest) (*BakeMacaroonResponse, error) + // lncli: `listmacaroonids` + //ListMacaroonIDs returns all root key IDs that are in use. + ListMacaroonIDs(context.Context, *ListMacaroonIDsRequest) (*ListMacaroonIDsResponse, error) + // lncli: `deletemacaroonid` + //DeleteMacaroonID deletes the specified macaroon ID and invalidates all + //macaroons derived from that ID. + DeleteMacaroonID(context.Context, *DeleteMacaroonIDRequest) (*DeleteMacaroonIDResponse, error) + // lncli: `listpermissions` + //ListPermissions lists all RPC method URIs and their required macaroon + //permissions to access them. + ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error) + mustEmbedUnimplementedLightningServer() +} + +// UnimplementedLightningServer must be embedded to have forward compatible implementations. +type UnimplementedLightningServer struct { +} + +func (UnimplementedLightningServer) WalletBalance(context.Context, *WalletBalanceRequest) (*WalletBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WalletBalance not implemented") +} +func (UnimplementedLightningServer) ChannelBalance(context.Context, *ChannelBalanceRequest) (*ChannelBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelBalance not implemented") +} +func (UnimplementedLightningServer) GetTransactions(context.Context, *GetTransactionsRequest) (*TransactionDetails, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTransactions not implemented") +} +func (UnimplementedLightningServer) EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateFee not implemented") +} +func (UnimplementedLightningServer) SendCoins(context.Context, *SendCoinsRequest) (*SendCoinsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendCoins not implemented") +} +func (UnimplementedLightningServer) ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUnspent not implemented") +} +func (UnimplementedLightningServer) SubscribeTransactions(*GetTransactionsRequest, Lightning_SubscribeTransactionsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeTransactions not implemented") +} +func (UnimplementedLightningServer) SendMany(context.Context, *SendManyRequest) (*SendManyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendMany not implemented") +} +func (UnimplementedLightningServer) NewAddress(context.Context, *NewAddressRequest) (*NewAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewAddress not implemented") +} +func (UnimplementedLightningServer) SignMessage(context.Context, *SignMessageRequest) (*SignMessageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignMessage not implemented") +} +func (UnimplementedLightningServer) VerifyMessage(context.Context, *VerifyMessageRequest) (*VerifyMessageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyMessage not implemented") +} +func (UnimplementedLightningServer) ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectPeer not implemented") +} +func (UnimplementedLightningServer) DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DisconnectPeer not implemented") +} +func (UnimplementedLightningServer) ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") +} +func (UnimplementedLightningServer) SubscribePeerEvents(*PeerEventSubscription, Lightning_SubscribePeerEventsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribePeerEvents not implemented") +} +func (UnimplementedLightningServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedLightningServer) GetRecoveryInfo(context.Context, *GetRecoveryInfoRequest) (*GetRecoveryInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRecoveryInfo not implemented") +} +func (UnimplementedLightningServer) PendingChannels(context.Context, *PendingChannelsRequest) (*PendingChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PendingChannels not implemented") +} +func (UnimplementedLightningServer) ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListChannels not implemented") +} +func (UnimplementedLightningServer) SubscribeChannelEvents(*ChannelEventSubscription, Lightning_SubscribeChannelEventsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeChannelEvents not implemented") +} +func (UnimplementedLightningServer) ClosedChannels(context.Context, *ClosedChannelsRequest) (*ClosedChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClosedChannels not implemented") +} +func (UnimplementedLightningServer) OpenChannelSync(context.Context, *OpenChannelRequest) (*ChannelPoint, error) { + return nil, status.Errorf(codes.Unimplemented, "method OpenChannelSync not implemented") +} +func (UnimplementedLightningServer) OpenChannel(*OpenChannelRequest, Lightning_OpenChannelServer) error { + return status.Errorf(codes.Unimplemented, "method OpenChannel not implemented") +} +func (UnimplementedLightningServer) FundingStateStep(context.Context, *FundingTransitionMsg) (*FundingStateStepResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundingStateStep not implemented") +} +func (UnimplementedLightningServer) ChannelAcceptor(Lightning_ChannelAcceptorServer) error { + return status.Errorf(codes.Unimplemented, "method ChannelAcceptor not implemented") +} +func (UnimplementedLightningServer) CloseChannel(*CloseChannelRequest, Lightning_CloseChannelServer) error { + return status.Errorf(codes.Unimplemented, "method CloseChannel not implemented") +} +func (UnimplementedLightningServer) AbandonChannel(context.Context, *AbandonChannelRequest) (*AbandonChannelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AbandonChannel not implemented") +} +func (UnimplementedLightningServer) SendPayment(Lightning_SendPaymentServer) error { + return status.Errorf(codes.Unimplemented, "method SendPayment not implemented") +} +func (UnimplementedLightningServer) SendPaymentSync(context.Context, *SendRequest) (*SendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendPaymentSync not implemented") +} +func (UnimplementedLightningServer) SendToRoute(Lightning_SendToRouteServer) error { + return status.Errorf(codes.Unimplemented, "method SendToRoute not implemented") +} +func (UnimplementedLightningServer) SendToRouteSync(context.Context, *SendToRouteRequest) (*SendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendToRouteSync not implemented") +} +func (UnimplementedLightningServer) AddInvoice(context.Context, *Invoice) (*AddInvoiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddInvoice not implemented") +} +func (UnimplementedLightningServer) ListInvoices(context.Context, *ListInvoiceRequest) (*ListInvoiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListInvoices not implemented") +} +func (UnimplementedLightningServer) LookupInvoice(context.Context, *PaymentHash) (*Invoice, error) { + return nil, status.Errorf(codes.Unimplemented, "method LookupInvoice not implemented") +} +func (UnimplementedLightningServer) SubscribeInvoices(*InvoiceSubscription, Lightning_SubscribeInvoicesServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeInvoices not implemented") +} +func (UnimplementedLightningServer) DecodePayReq(context.Context, *PayReqString) (*PayReq, error) { + return nil, status.Errorf(codes.Unimplemented, "method DecodePayReq not implemented") +} +func (UnimplementedLightningServer) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPayments not implemented") +} +func (UnimplementedLightningServer) DeleteAllPayments(context.Context, *DeleteAllPaymentsRequest) (*DeleteAllPaymentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAllPayments not implemented") +} +func (UnimplementedLightningServer) DescribeGraph(context.Context, *ChannelGraphRequest) (*ChannelGraph, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeGraph not implemented") +} +func (UnimplementedLightningServer) GetNodeMetrics(context.Context, *NodeMetricsRequest) (*NodeMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNodeMetrics not implemented") +} +func (UnimplementedLightningServer) GetChanInfo(context.Context, *ChanInfoRequest) (*ChannelEdge, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChanInfo not implemented") +} +func (UnimplementedLightningServer) GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") +} +func (UnimplementedLightningServer) QueryRoutes(context.Context, *QueryRoutesRequest) (*QueryRoutesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryRoutes not implemented") +} +func (UnimplementedLightningServer) GetNetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetworkInfo not implemented") +} +func (UnimplementedLightningServer) StopDaemon(context.Context, *StopRequest) (*StopResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopDaemon not implemented") +} +func (UnimplementedLightningServer) SubscribeChannelGraph(*GraphTopologySubscription, Lightning_SubscribeChannelGraphServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeChannelGraph not implemented") +} +func (UnimplementedLightningServer) DebugLevel(context.Context, *DebugLevelRequest) (*DebugLevelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DebugLevel not implemented") +} +func (UnimplementedLightningServer) FeeReport(context.Context, *FeeReportRequest) (*FeeReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeeReport not implemented") +} +func (UnimplementedLightningServer) UpdateChannelPolicy(context.Context, *PolicyUpdateRequest) (*PolicyUpdateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChannelPolicy not implemented") +} +func (UnimplementedLightningServer) ForwardingHistory(context.Context, *ForwardingHistoryRequest) (*ForwardingHistoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ForwardingHistory not implemented") +} +func (UnimplementedLightningServer) ExportChannelBackup(context.Context, *ExportChannelBackupRequest) (*ChannelBackup, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExportChannelBackup not implemented") +} +func (UnimplementedLightningServer) ExportAllChannelBackups(context.Context, *ChanBackupExportRequest) (*ChanBackupSnapshot, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExportAllChannelBackups not implemented") +} +func (UnimplementedLightningServer) VerifyChanBackup(context.Context, *ChanBackupSnapshot) (*VerifyChanBackupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyChanBackup not implemented") +} +func (UnimplementedLightningServer) RestoreChannelBackups(context.Context, *RestoreChanBackupRequest) (*RestoreBackupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RestoreChannelBackups not implemented") +} +func (UnimplementedLightningServer) SubscribeChannelBackups(*ChannelBackupSubscription, Lightning_SubscribeChannelBackupsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeChannelBackups not implemented") +} +func (UnimplementedLightningServer) BakeMacaroon(context.Context, *BakeMacaroonRequest) (*BakeMacaroonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BakeMacaroon not implemented") +} +func (UnimplementedLightningServer) ListMacaroonIDs(context.Context, *ListMacaroonIDsRequest) (*ListMacaroonIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMacaroonIDs not implemented") +} +func (UnimplementedLightningServer) DeleteMacaroonID(context.Context, *DeleteMacaroonIDRequest) (*DeleteMacaroonIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMacaroonID not implemented") +} +func (UnimplementedLightningServer) ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPermissions not implemented") +} +func (UnimplementedLightningServer) mustEmbedUnimplementedLightningServer() {} + +// UnsafeLightningServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LightningServer will +// result in compilation errors. +type UnsafeLightningServer interface { + mustEmbedUnimplementedLightningServer() +} + +func RegisterLightningServer(s grpc.ServiceRegistrar, srv LightningServer) { + s.RegisterService(&Lightning_ServiceDesc, srv) +} + +func _Lightning_WalletBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WalletBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).WalletBalance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/WalletBalance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).WalletBalance(ctx, req.(*WalletBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ChannelBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChannelBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ChannelBalance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ChannelBalance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ChannelBalance(ctx, req.(*ChannelBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_GetTransactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTransactionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetTransactions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetTransactions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetTransactions(ctx, req.(*GetTransactionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_EstimateFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EstimateFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).EstimateFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/EstimateFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).EstimateFee(ctx, req.(*EstimateFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SendCoins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendCoinsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).SendCoins(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/SendCoins", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).SendCoins(ctx, req.(*SendCoinsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListUnspent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUnspentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListUnspent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListUnspent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListUnspent(ctx, req.(*ListUnspentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SubscribeTransactions_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetTransactionsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).SubscribeTransactions(m, &lightningSubscribeTransactionsServer{stream}) +} + +type Lightning_SubscribeTransactionsServer interface { + Send(*Transaction) error + grpc.ServerStream +} + +type lightningSubscribeTransactionsServer struct { + grpc.ServerStream +} + +func (x *lightningSubscribeTransactionsServer) Send(m *Transaction) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_SendMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).SendMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/SendMany", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).SendMany(ctx, req.(*SendManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_NewAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).NewAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/NewAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).NewAddress(ctx, req.(*NewAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SignMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignMessageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).SignMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/SignMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).SignMessage(ctx, req.(*SignMessageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_VerifyMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyMessageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).VerifyMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/VerifyMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).VerifyMessage(ctx, req.(*VerifyMessageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ConnectPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConnectPeerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ConnectPeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ConnectPeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ConnectPeer(ctx, req.(*ConnectPeerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_DisconnectPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisconnectPeerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).DisconnectPeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/DisconnectPeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).DisconnectPeer(ctx, req.(*DisconnectPeerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPeersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListPeers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListPeers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListPeers(ctx, req.(*ListPeersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SubscribePeerEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(PeerEventSubscription) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).SubscribePeerEvents(m, &lightningSubscribePeerEventsServer{stream}) +} + +type Lightning_SubscribePeerEventsServer interface { + Send(*PeerEvent) error + grpc.ServerStream +} + +type lightningSubscribePeerEventsServer struct { + grpc.ServerStream +} + +func (x *lightningSubscribePeerEventsServer) Send(m *PeerEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetInfo(ctx, req.(*GetInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_GetRecoveryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRecoveryInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetRecoveryInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetRecoveryInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetRecoveryInfo(ctx, req.(*GetRecoveryInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_PendingChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PendingChannelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).PendingChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/PendingChannels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).PendingChannels(ctx, req.(*PendingChannelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListChannelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListChannels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListChannels(ctx, req.(*ListChannelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SubscribeChannelEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ChannelEventSubscription) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).SubscribeChannelEvents(m, &lightningSubscribeChannelEventsServer{stream}) +} + +type Lightning_SubscribeChannelEventsServer interface { + Send(*ChannelEventUpdate) error + grpc.ServerStream +} + +type lightningSubscribeChannelEventsServer struct { + grpc.ServerStream +} + +func (x *lightningSubscribeChannelEventsServer) Send(m *ChannelEventUpdate) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_ClosedChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClosedChannelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ClosedChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ClosedChannels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ClosedChannels(ctx, req.(*ClosedChannelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_OpenChannelSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OpenChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).OpenChannelSync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/OpenChannelSync", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).OpenChannelSync(ctx, req.(*OpenChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_OpenChannel_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(OpenChannelRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).OpenChannel(m, &lightningOpenChannelServer{stream}) +} + +type Lightning_OpenChannelServer interface { + Send(*OpenStatusUpdate) error + grpc.ServerStream +} + +type lightningOpenChannelServer struct { + grpc.ServerStream +} + +func (x *lightningOpenChannelServer) Send(m *OpenStatusUpdate) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_FundingStateStep_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FundingTransitionMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).FundingStateStep(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/FundingStateStep", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).FundingStateStep(ctx, req.(*FundingTransitionMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ChannelAcceptor_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(LightningServer).ChannelAcceptor(&lightningChannelAcceptorServer{stream}) +} + +type Lightning_ChannelAcceptorServer interface { + Send(*ChannelAcceptRequest) error + Recv() (*ChannelAcceptResponse, error) + grpc.ServerStream +} + +type lightningChannelAcceptorServer struct { + grpc.ServerStream +} + +func (x *lightningChannelAcceptorServer) Send(m *ChannelAcceptRequest) error { + return x.ServerStream.SendMsg(m) +} + +func (x *lightningChannelAcceptorServer) Recv() (*ChannelAcceptResponse, error) { + m := new(ChannelAcceptResponse) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Lightning_CloseChannel_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(CloseChannelRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).CloseChannel(m, &lightningCloseChannelServer{stream}) +} + +type Lightning_CloseChannelServer interface { + Send(*CloseStatusUpdate) error + grpc.ServerStream +} + +type lightningCloseChannelServer struct { + grpc.ServerStream +} + +func (x *lightningCloseChannelServer) Send(m *CloseStatusUpdate) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_AbandonChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AbandonChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).AbandonChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/AbandonChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).AbandonChannel(ctx, req.(*AbandonChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SendPayment_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(LightningServer).SendPayment(&lightningSendPaymentServer{stream}) +} + +type Lightning_SendPaymentServer interface { + Send(*SendResponse) error + Recv() (*SendRequest, error) + grpc.ServerStream +} + +type lightningSendPaymentServer struct { + grpc.ServerStream +} + +func (x *lightningSendPaymentServer) Send(m *SendResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *lightningSendPaymentServer) Recv() (*SendRequest, error) { + m := new(SendRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Lightning_SendPaymentSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).SendPaymentSync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/SendPaymentSync", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).SendPaymentSync(ctx, req.(*SendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SendToRoute_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(LightningServer).SendToRoute(&lightningSendToRouteServer{stream}) +} + +type Lightning_SendToRouteServer interface { + Send(*SendResponse) error + Recv() (*SendToRouteRequest, error) + grpc.ServerStream +} + +type lightningSendToRouteServer struct { + grpc.ServerStream +} + +func (x *lightningSendToRouteServer) Send(m *SendResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *lightningSendToRouteServer) Recv() (*SendToRouteRequest, error) { + m := new(SendToRouteRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Lightning_SendToRouteSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendToRouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).SendToRouteSync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/SendToRouteSync", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).SendToRouteSync(ctx, req.(*SendToRouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_AddInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Invoice) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).AddInvoice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/AddInvoice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).AddInvoice(ctx, req.(*Invoice)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListInvoices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInvoiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListInvoices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListInvoices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListInvoices(ctx, req.(*ListInvoiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_LookupInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PaymentHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).LookupInvoice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/LookupInvoice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).LookupInvoice(ctx, req.(*PaymentHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SubscribeInvoices_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(InvoiceSubscription) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).SubscribeInvoices(m, &lightningSubscribeInvoicesServer{stream}) +} + +type Lightning_SubscribeInvoicesServer interface { + Send(*Invoice) error + grpc.ServerStream +} + +type lightningSubscribeInvoicesServer struct { + grpc.ServerStream +} + +func (x *lightningSubscribeInvoicesServer) Send(m *Invoice) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_DecodePayReq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PayReqString) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).DecodePayReq(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/DecodePayReq", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).DecodePayReq(ctx, req.(*PayReqString)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPaymentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListPayments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListPayments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListPayments(ctx, req.(*ListPaymentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_DeleteAllPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAllPaymentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).DeleteAllPayments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/DeleteAllPayments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).DeleteAllPayments(ctx, req.(*DeleteAllPaymentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_DescribeGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChannelGraphRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).DescribeGraph(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/DescribeGraph", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).DescribeGraph(ctx, req.(*ChannelGraphRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_GetNodeMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeMetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetNodeMetrics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetNodeMetrics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetNodeMetrics(ctx, req.(*NodeMetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_GetChanInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChanInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetChanInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetChanInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetChanInfo(ctx, req.(*ChanInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetNodeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetNodeInfo(ctx, req.(*NodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_QueryRoutes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRoutesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).QueryRoutes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/QueryRoutes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).QueryRoutes(ctx, req.(*QueryRoutesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_GetNetworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NetworkInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).GetNetworkInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/GetNetworkInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).GetNetworkInfo(ctx, req.(*NetworkInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_StopDaemon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).StopDaemon(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/StopDaemon", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).StopDaemon(ctx, req.(*StopRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SubscribeChannelGraph_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GraphTopologySubscription) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).SubscribeChannelGraph(m, &lightningSubscribeChannelGraphServer{stream}) +} + +type Lightning_SubscribeChannelGraphServer interface { + Send(*GraphTopologyUpdate) error + grpc.ServerStream +} + +type lightningSubscribeChannelGraphServer struct { + grpc.ServerStream +} + +func (x *lightningSubscribeChannelGraphServer) Send(m *GraphTopologyUpdate) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_DebugLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DebugLevelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).DebugLevel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/DebugLevel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).DebugLevel(ctx, req.(*DebugLevelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_FeeReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FeeReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).FeeReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/FeeReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).FeeReport(ctx, req.(*FeeReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_UpdateChannelPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PolicyUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).UpdateChannelPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/UpdateChannelPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).UpdateChannelPolicy(ctx, req.(*PolicyUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ForwardingHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ForwardingHistoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ForwardingHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ForwardingHistory", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ForwardingHistory(ctx, req.(*ForwardingHistoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ExportChannelBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportChannelBackupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ExportChannelBackup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ExportChannelBackup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ExportChannelBackup(ctx, req.(*ExportChannelBackupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ExportAllChannelBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChanBackupExportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ExportAllChannelBackups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ExportAllChannelBackups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ExportAllChannelBackups(ctx, req.(*ChanBackupExportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_VerifyChanBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChanBackupSnapshot) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).VerifyChanBackup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/VerifyChanBackup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).VerifyChanBackup(ctx, req.(*ChanBackupSnapshot)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_RestoreChannelBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RestoreChanBackupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).RestoreChannelBackups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/RestoreChannelBackups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).RestoreChannelBackups(ctx, req.(*RestoreChanBackupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_SubscribeChannelBackups_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ChannelBackupSubscription) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightningServer).SubscribeChannelBackups(m, &lightningSubscribeChannelBackupsServer{stream}) +} + +type Lightning_SubscribeChannelBackupsServer interface { + Send(*ChanBackupSnapshot) error + grpc.ServerStream +} + +type lightningSubscribeChannelBackupsServer struct { + grpc.ServerStream +} + +func (x *lightningSubscribeChannelBackupsServer) Send(m *ChanBackupSnapshot) error { + return x.ServerStream.SendMsg(m) +} + +func _Lightning_BakeMacaroon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BakeMacaroonRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).BakeMacaroon(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/BakeMacaroon", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).BakeMacaroon(ctx, req.(*BakeMacaroonRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListMacaroonIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMacaroonIDsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListMacaroonIDs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListMacaroonIDs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListMacaroonIDs(ctx, req.(*ListMacaroonIDsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_DeleteMacaroonID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMacaroonIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).DeleteMacaroonID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/DeleteMacaroonID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).DeleteMacaroonID(ctx, req.(*DeleteMacaroonIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lightning_ListPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LightningServer).ListPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.Lightning/ListPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LightningServer).ListPermissions(ctx, req.(*ListPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Lightning_ServiceDesc is the grpc.ServiceDesc for Lightning service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Lightning_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "lnrpc.Lightning", + HandlerType: (*LightningServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "WalletBalance", + Handler: _Lightning_WalletBalance_Handler, + }, + { + MethodName: "ChannelBalance", + Handler: _Lightning_ChannelBalance_Handler, + }, + { + MethodName: "GetTransactions", + Handler: _Lightning_GetTransactions_Handler, + }, + { + MethodName: "EstimateFee", + Handler: _Lightning_EstimateFee_Handler, + }, + { + MethodName: "SendCoins", + Handler: _Lightning_SendCoins_Handler, + }, + { + MethodName: "ListUnspent", + Handler: _Lightning_ListUnspent_Handler, + }, + { + MethodName: "SendMany", + Handler: _Lightning_SendMany_Handler, + }, + { + MethodName: "NewAddress", + Handler: _Lightning_NewAddress_Handler, + }, + { + MethodName: "SignMessage", + Handler: _Lightning_SignMessage_Handler, + }, + { + MethodName: "VerifyMessage", + Handler: _Lightning_VerifyMessage_Handler, + }, + { + MethodName: "ConnectPeer", + Handler: _Lightning_ConnectPeer_Handler, + }, + { + MethodName: "DisconnectPeer", + Handler: _Lightning_DisconnectPeer_Handler, + }, + { + MethodName: "ListPeers", + Handler: _Lightning_ListPeers_Handler, + }, + { + MethodName: "GetInfo", + Handler: _Lightning_GetInfo_Handler, + }, + { + MethodName: "GetRecoveryInfo", + Handler: _Lightning_GetRecoveryInfo_Handler, + }, + { + MethodName: "PendingChannels", + Handler: _Lightning_PendingChannels_Handler, + }, + { + MethodName: "ListChannels", + Handler: _Lightning_ListChannels_Handler, + }, + { + MethodName: "ClosedChannels", + Handler: _Lightning_ClosedChannels_Handler, + }, + { + MethodName: "OpenChannelSync", + Handler: _Lightning_OpenChannelSync_Handler, + }, + { + MethodName: "FundingStateStep", + Handler: _Lightning_FundingStateStep_Handler, + }, + { + MethodName: "AbandonChannel", + Handler: _Lightning_AbandonChannel_Handler, + }, + { + MethodName: "SendPaymentSync", + Handler: _Lightning_SendPaymentSync_Handler, + }, + { + MethodName: "SendToRouteSync", + Handler: _Lightning_SendToRouteSync_Handler, + }, + { + MethodName: "AddInvoice", + Handler: _Lightning_AddInvoice_Handler, + }, + { + MethodName: "ListInvoices", + Handler: _Lightning_ListInvoices_Handler, + }, + { + MethodName: "LookupInvoice", + Handler: _Lightning_LookupInvoice_Handler, + }, + { + MethodName: "DecodePayReq", + Handler: _Lightning_DecodePayReq_Handler, + }, + { + MethodName: "ListPayments", + Handler: _Lightning_ListPayments_Handler, + }, + { + MethodName: "DeleteAllPayments", + Handler: _Lightning_DeleteAllPayments_Handler, + }, + { + MethodName: "DescribeGraph", + Handler: _Lightning_DescribeGraph_Handler, + }, + { + MethodName: "GetNodeMetrics", + Handler: _Lightning_GetNodeMetrics_Handler, + }, + { + MethodName: "GetChanInfo", + Handler: _Lightning_GetChanInfo_Handler, + }, + { + MethodName: "GetNodeInfo", + Handler: _Lightning_GetNodeInfo_Handler, + }, + { + MethodName: "QueryRoutes", + Handler: _Lightning_QueryRoutes_Handler, + }, + { + MethodName: "GetNetworkInfo", + Handler: _Lightning_GetNetworkInfo_Handler, + }, + { + MethodName: "StopDaemon", + Handler: _Lightning_StopDaemon_Handler, + }, + { + MethodName: "DebugLevel", + Handler: _Lightning_DebugLevel_Handler, + }, + { + MethodName: "FeeReport", + Handler: _Lightning_FeeReport_Handler, + }, + { + MethodName: "UpdateChannelPolicy", + Handler: _Lightning_UpdateChannelPolicy_Handler, + }, + { + MethodName: "ForwardingHistory", + Handler: _Lightning_ForwardingHistory_Handler, + }, + { + MethodName: "ExportChannelBackup", + Handler: _Lightning_ExportChannelBackup_Handler, + }, + { + MethodName: "ExportAllChannelBackups", + Handler: _Lightning_ExportAllChannelBackups_Handler, + }, + { + MethodName: "VerifyChanBackup", + Handler: _Lightning_VerifyChanBackup_Handler, + }, + { + MethodName: "RestoreChannelBackups", + Handler: _Lightning_RestoreChannelBackups_Handler, + }, + { + MethodName: "BakeMacaroon", + Handler: _Lightning_BakeMacaroon_Handler, + }, + { + MethodName: "ListMacaroonIDs", + Handler: _Lightning_ListMacaroonIDs_Handler, + }, + { + MethodName: "DeleteMacaroonID", + Handler: _Lightning_DeleteMacaroonID_Handler, + }, + { + MethodName: "ListPermissions", + Handler: _Lightning_ListPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeTransactions", + Handler: _Lightning_SubscribeTransactions_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribePeerEvents", + Handler: _Lightning_SubscribePeerEvents_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeChannelEvents", + Handler: _Lightning_SubscribeChannelEvents_Handler, + ServerStreams: true, + }, + { + StreamName: "OpenChannel", + Handler: _Lightning_OpenChannel_Handler, + ServerStreams: true, + }, + { + StreamName: "ChannelAcceptor", + Handler: _Lightning_ChannelAcceptor_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "CloseChannel", + Handler: _Lightning_CloseChannel_Handler, + ServerStreams: true, + }, + { + StreamName: "SendPayment", + Handler: _Lightning_SendPayment_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "SendToRoute", + Handler: _Lightning_SendToRoute_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "SubscribeInvoices", + Handler: _Lightning_SubscribeInvoices_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeChannelGraph", + Handler: _Lightning_SubscribeChannelGraph_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeChannelBackups", + Handler: _Lightning_SubscribeChannelBackups_Handler, + ServerStreams: true, + }, + }, + Metadata: "lightning.proto", +} diff --git a/lnrpc/lnclipb/lncli.pb.go b/lnrpc/lnclipb/lncli.pb.go index 32a632a91..c84ed5d52 100644 --- a/lnrpc/lnclipb/lncli.pb.go +++ b/lnrpc/lnclipb/lncli.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: lnclipb/lncli.proto package lnclipb import ( - proto "github.com/golang/protobuf/proto" verrpc "github.com/lightningnetwork/lnd/lnrpc/verrpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type VersionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/lnrpc/lnclipb/lncli.swagger.json b/lnrpc/lnclipb/lncli.swagger.json index eb88452f0..e3628f10b 100644 --- a/lnrpc/lnclipb/lncli.swagger.json +++ b/lnrpc/lnclipb/lncli.swagger.json @@ -24,12 +24,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" diff --git a/lnrpc/routerrpc/router.pb.go b/lnrpc/routerrpc/router.pb.go index 0cde080f7..fcbecbe64 100644 --- a/lnrpc/routerrpc/router.pb.go +++ b/lnrpc/routerrpc/router.pb.go @@ -1,18 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: routerrpc/router.proto package routerrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" lnrpc "github.com/lightningnetwork/lnd/lnrpc" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -26,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type FailureDetail int32 const ( @@ -3937,966 +3928,3 @@ func file_routerrpc_router_proto_init() { file_routerrpc_router_proto_goTypes = nil file_routerrpc_router_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// RouterClient is the client API for Router service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RouterClient interface { - // - //SendPaymentV2 attempts to route a payment described by the passed - //PaymentRequest to the final destination. The call returns a stream of - //payment updates. - SendPaymentV2(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentV2Client, error) - // - //TrackPaymentV2 returns an update stream for the payment identified by the - //payment hash. - TrackPaymentV2(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentV2Client, error) - // - //EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it - //may cost to send an HTLC to the target end destination. - EstimateRouteFee(ctx context.Context, in *RouteFeeRequest, opts ...grpc.CallOption) (*RouteFeeResponse, error) - // Deprecated: Do not use. - // - //Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - //the specified route. This method differs from SendPayment in that it - //allows users to specify a full route manually. This can be used for - //things like rebalancing, and atomic swaps. It differs from the newer - //SendToRouteV2 in that it doesn't return the full HTLC information. - SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) - // - //SendToRouteV2 attempts to make a payment via the specified route. This - //method differs from SendPayment in that it allows users to specify a full - //route manually. This can be used for things like rebalancing, and atomic - //swaps. - SendToRouteV2(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*lnrpc.HTLCAttempt, error) - // - //ResetMissionControl clears all mission control state and starts with a clean - //slate. - ResetMissionControl(ctx context.Context, in *ResetMissionControlRequest, opts ...grpc.CallOption) (*ResetMissionControlResponse, error) - // - //QueryMissionControl exposes the internal mission control state to callers. - //It is a development feature. - QueryMissionControl(ctx context.Context, in *QueryMissionControlRequest, opts ...grpc.CallOption) (*QueryMissionControlResponse, error) - // - //XImportMissionControl is an experimental API that imports the state provided - //to the internal mission control's state, using all results which are more - //recent than our existing values. These values will only be imported - //in-memory, and will not be persisted across restarts. - XImportMissionControl(ctx context.Context, in *XImportMissionControlRequest, opts ...grpc.CallOption) (*XImportMissionControlResponse, error) - // - //GetMissionControlConfig returns mission control's current config. - GetMissionControlConfig(ctx context.Context, in *GetMissionControlConfigRequest, opts ...grpc.CallOption) (*GetMissionControlConfigResponse, error) - // - //SetMissionControlConfig will set mission control's config, if the config - //provided is valid. - SetMissionControlConfig(ctx context.Context, in *SetMissionControlConfigRequest, opts ...grpc.CallOption) (*SetMissionControlConfigResponse, error) - // - //QueryProbability returns the current success probability estimate for a - //given node pair and amount. - QueryProbability(ctx context.Context, in *QueryProbabilityRequest, opts ...grpc.CallOption) (*QueryProbabilityResponse, error) - // - //BuildRoute builds a fully specified route based on a list of hop public - //keys. It retrieves the relevant channel policies from the graph in order to - //calculate the correct fees and time locks. - BuildRoute(ctx context.Context, in *BuildRouteRequest, opts ...grpc.CallOption) (*BuildRouteResponse, error) - // - //SubscribeHtlcEvents creates a uni-directional stream from the server to - //the client which delivers a stream of htlc events. - SubscribeHtlcEvents(ctx context.Context, in *SubscribeHtlcEventsRequest, opts ...grpc.CallOption) (Router_SubscribeHtlcEventsClient, error) - // Deprecated: Do not use. - // - //Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - //described by the passed PaymentRequest to the final destination. The call - //returns a stream of payment status updates. - SendPayment(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentClient, error) - // Deprecated: Do not use. - // - //Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - //the payment identified by the payment hash. - TrackPayment(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentClient, error) - //* - //HtlcInterceptor dispatches a bi-directional streaming RPC in which - //Forwarded HTLC requests are sent to the client and the client responds with - //a boolean that tells LND if this htlc should be intercepted. - //In case of interception, the htlc can be either settled, cancelled or - //resumed later by using the ResolveHoldForward endpoint. - HtlcInterceptor(ctx context.Context, opts ...grpc.CallOption) (Router_HtlcInterceptorClient, error) - // - //UpdateChanStatus attempts to manually set the state of a channel - //(enabled, disabled, or auto). A manual "disable" request will cause the - //channel to stay disabled until a subsequent manual request of either - //"enable" or "auto". - UpdateChanStatus(ctx context.Context, in *UpdateChanStatusRequest, opts ...grpc.CallOption) (*UpdateChanStatusResponse, error) -} - -type routerClient struct { - cc grpc.ClientConnInterface -} - -func NewRouterClient(cc grpc.ClientConnInterface) RouterClient { - return &routerClient{cc} -} - -func (c *routerClient) SendPaymentV2(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentV2Client, error) { - stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[0], "/routerrpc.Router/SendPaymentV2", opts...) - if err != nil { - return nil, err - } - x := &routerSendPaymentV2Client{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Router_SendPaymentV2Client interface { - Recv() (*lnrpc.Payment, error) - grpc.ClientStream -} - -type routerSendPaymentV2Client struct { - grpc.ClientStream -} - -func (x *routerSendPaymentV2Client) Recv() (*lnrpc.Payment, error) { - m := new(lnrpc.Payment) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *routerClient) TrackPaymentV2(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentV2Client, error) { - stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[1], "/routerrpc.Router/TrackPaymentV2", opts...) - if err != nil { - return nil, err - } - x := &routerTrackPaymentV2Client{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Router_TrackPaymentV2Client interface { - Recv() (*lnrpc.Payment, error) - grpc.ClientStream -} - -type routerTrackPaymentV2Client struct { - grpc.ClientStream -} - -func (x *routerTrackPaymentV2Client) Recv() (*lnrpc.Payment, error) { - m := new(lnrpc.Payment) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *routerClient) EstimateRouteFee(ctx context.Context, in *RouteFeeRequest, opts ...grpc.CallOption) (*RouteFeeResponse, error) { - out := new(RouteFeeResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/EstimateRouteFee", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *routerClient) SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) { - out := new(SendToRouteResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRoute", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) SendToRouteV2(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*lnrpc.HTLCAttempt, error) { - out := new(lnrpc.HTLCAttempt) - err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRouteV2", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) ResetMissionControl(ctx context.Context, in *ResetMissionControlRequest, opts ...grpc.CallOption) (*ResetMissionControlResponse, error) { - out := new(ResetMissionControlResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/ResetMissionControl", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) QueryMissionControl(ctx context.Context, in *QueryMissionControlRequest, opts ...grpc.CallOption) (*QueryMissionControlResponse, error) { - out := new(QueryMissionControlResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/QueryMissionControl", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) XImportMissionControl(ctx context.Context, in *XImportMissionControlRequest, opts ...grpc.CallOption) (*XImportMissionControlResponse, error) { - out := new(XImportMissionControlResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/XImportMissionControl", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) GetMissionControlConfig(ctx context.Context, in *GetMissionControlConfigRequest, opts ...grpc.CallOption) (*GetMissionControlConfigResponse, error) { - out := new(GetMissionControlConfigResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/GetMissionControlConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) SetMissionControlConfig(ctx context.Context, in *SetMissionControlConfigRequest, opts ...grpc.CallOption) (*SetMissionControlConfigResponse, error) { - out := new(SetMissionControlConfigResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/SetMissionControlConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) QueryProbability(ctx context.Context, in *QueryProbabilityRequest, opts ...grpc.CallOption) (*QueryProbabilityResponse, error) { - out := new(QueryProbabilityResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/QueryProbability", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) BuildRoute(ctx context.Context, in *BuildRouteRequest, opts ...grpc.CallOption) (*BuildRouteResponse, error) { - out := new(BuildRouteResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/BuildRoute", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerClient) SubscribeHtlcEvents(ctx context.Context, in *SubscribeHtlcEventsRequest, opts ...grpc.CallOption) (Router_SubscribeHtlcEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[2], "/routerrpc.Router/SubscribeHtlcEvents", opts...) - if err != nil { - return nil, err - } - x := &routerSubscribeHtlcEventsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Router_SubscribeHtlcEventsClient interface { - Recv() (*HtlcEvent, error) - grpc.ClientStream -} - -type routerSubscribeHtlcEventsClient struct { - grpc.ClientStream -} - -func (x *routerSubscribeHtlcEventsClient) Recv() (*HtlcEvent, error) { - m := new(HtlcEvent) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Deprecated: Do not use. -func (c *routerClient) SendPayment(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentClient, error) { - stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[3], "/routerrpc.Router/SendPayment", opts...) - if err != nil { - return nil, err - } - x := &routerSendPaymentClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Router_SendPaymentClient interface { - Recv() (*PaymentStatus, error) - grpc.ClientStream -} - -type routerSendPaymentClient struct { - grpc.ClientStream -} - -func (x *routerSendPaymentClient) Recv() (*PaymentStatus, error) { - m := new(PaymentStatus) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Deprecated: Do not use. -func (c *routerClient) TrackPayment(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentClient, error) { - stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[4], "/routerrpc.Router/TrackPayment", opts...) - if err != nil { - return nil, err - } - x := &routerTrackPaymentClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Router_TrackPaymentClient interface { - Recv() (*PaymentStatus, error) - grpc.ClientStream -} - -type routerTrackPaymentClient struct { - grpc.ClientStream -} - -func (x *routerTrackPaymentClient) Recv() (*PaymentStatus, error) { - m := new(PaymentStatus) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *routerClient) HtlcInterceptor(ctx context.Context, opts ...grpc.CallOption) (Router_HtlcInterceptorClient, error) { - stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[5], "/routerrpc.Router/HtlcInterceptor", opts...) - if err != nil { - return nil, err - } - x := &routerHtlcInterceptorClient{stream} - return x, nil -} - -type Router_HtlcInterceptorClient interface { - Send(*ForwardHtlcInterceptResponse) error - Recv() (*ForwardHtlcInterceptRequest, error) - grpc.ClientStream -} - -type routerHtlcInterceptorClient struct { - grpc.ClientStream -} - -func (x *routerHtlcInterceptorClient) Send(m *ForwardHtlcInterceptResponse) error { - return x.ClientStream.SendMsg(m) -} - -func (x *routerHtlcInterceptorClient) Recv() (*ForwardHtlcInterceptRequest, error) { - m := new(ForwardHtlcInterceptRequest) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *routerClient) UpdateChanStatus(ctx context.Context, in *UpdateChanStatusRequest, opts ...grpc.CallOption) (*UpdateChanStatusResponse, error) { - out := new(UpdateChanStatusResponse) - err := c.cc.Invoke(ctx, "/routerrpc.Router/UpdateChanStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RouterServer is the server API for Router service. -type RouterServer interface { - // - //SendPaymentV2 attempts to route a payment described by the passed - //PaymentRequest to the final destination. The call returns a stream of - //payment updates. - SendPaymentV2(*SendPaymentRequest, Router_SendPaymentV2Server) error - // - //TrackPaymentV2 returns an update stream for the payment identified by the - //payment hash. - TrackPaymentV2(*TrackPaymentRequest, Router_TrackPaymentV2Server) error - // - //EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it - //may cost to send an HTLC to the target end destination. - EstimateRouteFee(context.Context, *RouteFeeRequest) (*RouteFeeResponse, error) - // Deprecated: Do not use. - // - //Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - //the specified route. This method differs from SendPayment in that it - //allows users to specify a full route manually. This can be used for - //things like rebalancing, and atomic swaps. It differs from the newer - //SendToRouteV2 in that it doesn't return the full HTLC information. - SendToRoute(context.Context, *SendToRouteRequest) (*SendToRouteResponse, error) - // - //SendToRouteV2 attempts to make a payment via the specified route. This - //method differs from SendPayment in that it allows users to specify a full - //route manually. This can be used for things like rebalancing, and atomic - //swaps. - SendToRouteV2(context.Context, *SendToRouteRequest) (*lnrpc.HTLCAttempt, error) - // - //ResetMissionControl clears all mission control state and starts with a clean - //slate. - ResetMissionControl(context.Context, *ResetMissionControlRequest) (*ResetMissionControlResponse, error) - // - //QueryMissionControl exposes the internal mission control state to callers. - //It is a development feature. - QueryMissionControl(context.Context, *QueryMissionControlRequest) (*QueryMissionControlResponse, error) - // - //XImportMissionControl is an experimental API that imports the state provided - //to the internal mission control's state, using all results which are more - //recent than our existing values. These values will only be imported - //in-memory, and will not be persisted across restarts. - XImportMissionControl(context.Context, *XImportMissionControlRequest) (*XImportMissionControlResponse, error) - // - //GetMissionControlConfig returns mission control's current config. - GetMissionControlConfig(context.Context, *GetMissionControlConfigRequest) (*GetMissionControlConfigResponse, error) - // - //SetMissionControlConfig will set mission control's config, if the config - //provided is valid. - SetMissionControlConfig(context.Context, *SetMissionControlConfigRequest) (*SetMissionControlConfigResponse, error) - // - //QueryProbability returns the current success probability estimate for a - //given node pair and amount. - QueryProbability(context.Context, *QueryProbabilityRequest) (*QueryProbabilityResponse, error) - // - //BuildRoute builds a fully specified route based on a list of hop public - //keys. It retrieves the relevant channel policies from the graph in order to - //calculate the correct fees and time locks. - BuildRoute(context.Context, *BuildRouteRequest) (*BuildRouteResponse, error) - // - //SubscribeHtlcEvents creates a uni-directional stream from the server to - //the client which delivers a stream of htlc events. - SubscribeHtlcEvents(*SubscribeHtlcEventsRequest, Router_SubscribeHtlcEventsServer) error - // Deprecated: Do not use. - // - //Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - //described by the passed PaymentRequest to the final destination. The call - //returns a stream of payment status updates. - SendPayment(*SendPaymentRequest, Router_SendPaymentServer) error - // Deprecated: Do not use. - // - //Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - //the payment identified by the payment hash. - TrackPayment(*TrackPaymentRequest, Router_TrackPaymentServer) error - //* - //HtlcInterceptor dispatches a bi-directional streaming RPC in which - //Forwarded HTLC requests are sent to the client and the client responds with - //a boolean that tells LND if this htlc should be intercepted. - //In case of interception, the htlc can be either settled, cancelled or - //resumed later by using the ResolveHoldForward endpoint. - HtlcInterceptor(Router_HtlcInterceptorServer) error - // - //UpdateChanStatus attempts to manually set the state of a channel - //(enabled, disabled, or auto). A manual "disable" request will cause the - //channel to stay disabled until a subsequent manual request of either - //"enable" or "auto". - UpdateChanStatus(context.Context, *UpdateChanStatusRequest) (*UpdateChanStatusResponse, error) -} - -// UnimplementedRouterServer can be embedded to have forward compatible implementations. -type UnimplementedRouterServer struct { -} - -func (*UnimplementedRouterServer) SendPaymentV2(*SendPaymentRequest, Router_SendPaymentV2Server) error { - return status.Errorf(codes.Unimplemented, "method SendPaymentV2 not implemented") -} -func (*UnimplementedRouterServer) TrackPaymentV2(*TrackPaymentRequest, Router_TrackPaymentV2Server) error { - return status.Errorf(codes.Unimplemented, "method TrackPaymentV2 not implemented") -} -func (*UnimplementedRouterServer) EstimateRouteFee(context.Context, *RouteFeeRequest) (*RouteFeeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimateRouteFee not implemented") -} -func (*UnimplementedRouterServer) SendToRoute(context.Context, *SendToRouteRequest) (*SendToRouteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendToRoute not implemented") -} -func (*UnimplementedRouterServer) SendToRouteV2(context.Context, *SendToRouteRequest) (*lnrpc.HTLCAttempt, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendToRouteV2 not implemented") -} -func (*UnimplementedRouterServer) ResetMissionControl(context.Context, *ResetMissionControlRequest) (*ResetMissionControlResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResetMissionControl not implemented") -} -func (*UnimplementedRouterServer) QueryMissionControl(context.Context, *QueryMissionControlRequest) (*QueryMissionControlResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryMissionControl not implemented") -} -func (*UnimplementedRouterServer) XImportMissionControl(context.Context, *XImportMissionControlRequest) (*XImportMissionControlResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method XImportMissionControl not implemented") -} -func (*UnimplementedRouterServer) GetMissionControlConfig(context.Context, *GetMissionControlConfigRequest) (*GetMissionControlConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMissionControlConfig not implemented") -} -func (*UnimplementedRouterServer) SetMissionControlConfig(context.Context, *SetMissionControlConfigRequest) (*SetMissionControlConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetMissionControlConfig not implemented") -} -func (*UnimplementedRouterServer) QueryProbability(context.Context, *QueryProbabilityRequest) (*QueryProbabilityResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryProbability not implemented") -} -func (*UnimplementedRouterServer) BuildRoute(context.Context, *BuildRouteRequest) (*BuildRouteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BuildRoute not implemented") -} -func (*UnimplementedRouterServer) SubscribeHtlcEvents(*SubscribeHtlcEventsRequest, Router_SubscribeHtlcEventsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeHtlcEvents not implemented") -} -func (*UnimplementedRouterServer) SendPayment(*SendPaymentRequest, Router_SendPaymentServer) error { - return status.Errorf(codes.Unimplemented, "method SendPayment not implemented") -} -func (*UnimplementedRouterServer) TrackPayment(*TrackPaymentRequest, Router_TrackPaymentServer) error { - return status.Errorf(codes.Unimplemented, "method TrackPayment not implemented") -} -func (*UnimplementedRouterServer) HtlcInterceptor(Router_HtlcInterceptorServer) error { - return status.Errorf(codes.Unimplemented, "method HtlcInterceptor not implemented") -} -func (*UnimplementedRouterServer) UpdateChanStatus(context.Context, *UpdateChanStatusRequest) (*UpdateChanStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateChanStatus not implemented") -} - -func RegisterRouterServer(s *grpc.Server, srv RouterServer) { - s.RegisterService(&_Router_serviceDesc, srv) -} - -func _Router_SendPaymentV2_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SendPaymentRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RouterServer).SendPaymentV2(m, &routerSendPaymentV2Server{stream}) -} - -type Router_SendPaymentV2Server interface { - Send(*lnrpc.Payment) error - grpc.ServerStream -} - -type routerSendPaymentV2Server struct { - grpc.ServerStream -} - -func (x *routerSendPaymentV2Server) Send(m *lnrpc.Payment) error { - return x.ServerStream.SendMsg(m) -} - -func _Router_TrackPaymentV2_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(TrackPaymentRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RouterServer).TrackPaymentV2(m, &routerTrackPaymentV2Server{stream}) -} - -type Router_TrackPaymentV2Server interface { - Send(*lnrpc.Payment) error - grpc.ServerStream -} - -type routerTrackPaymentV2Server struct { - grpc.ServerStream -} - -func (x *routerTrackPaymentV2Server) Send(m *lnrpc.Payment) error { - return x.ServerStream.SendMsg(m) -} - -func _Router_EstimateRouteFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RouteFeeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).EstimateRouteFee(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/EstimateRouteFee", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).EstimateRouteFee(ctx, req.(*RouteFeeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_SendToRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendToRouteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).SendToRoute(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/SendToRoute", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).SendToRoute(ctx, req.(*SendToRouteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_SendToRouteV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendToRouteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).SendToRouteV2(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/SendToRouteV2", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).SendToRouteV2(ctx, req.(*SendToRouteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_ResetMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResetMissionControlRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).ResetMissionControl(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/ResetMissionControl", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).ResetMissionControl(ctx, req.(*ResetMissionControlRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_QueryMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMissionControlRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).QueryMissionControl(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/QueryMissionControl", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).QueryMissionControl(ctx, req.(*QueryMissionControlRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_XImportMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(XImportMissionControlRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).XImportMissionControl(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/XImportMissionControl", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).XImportMissionControl(ctx, req.(*XImportMissionControlRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_GetMissionControlConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMissionControlConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).GetMissionControlConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/GetMissionControlConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).GetMissionControlConfig(ctx, req.(*GetMissionControlConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_SetMissionControlConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetMissionControlConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).SetMissionControlConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/SetMissionControlConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).SetMissionControlConfig(ctx, req.(*SetMissionControlConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_QueryProbability_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProbabilityRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).QueryProbability(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/QueryProbability", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).QueryProbability(ctx, req.(*QueryProbabilityRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_BuildRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BuildRouteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).BuildRoute(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/BuildRoute", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).BuildRoute(ctx, req.(*BuildRouteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Router_SubscribeHtlcEvents_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeHtlcEventsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RouterServer).SubscribeHtlcEvents(m, &routerSubscribeHtlcEventsServer{stream}) -} - -type Router_SubscribeHtlcEventsServer interface { - Send(*HtlcEvent) error - grpc.ServerStream -} - -type routerSubscribeHtlcEventsServer struct { - grpc.ServerStream -} - -func (x *routerSubscribeHtlcEventsServer) Send(m *HtlcEvent) error { - return x.ServerStream.SendMsg(m) -} - -func _Router_SendPayment_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SendPaymentRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RouterServer).SendPayment(m, &routerSendPaymentServer{stream}) -} - -type Router_SendPaymentServer interface { - Send(*PaymentStatus) error - grpc.ServerStream -} - -type routerSendPaymentServer struct { - grpc.ServerStream -} - -func (x *routerSendPaymentServer) Send(m *PaymentStatus) error { - return x.ServerStream.SendMsg(m) -} - -func _Router_TrackPayment_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(TrackPaymentRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RouterServer).TrackPayment(m, &routerTrackPaymentServer{stream}) -} - -type Router_TrackPaymentServer interface { - Send(*PaymentStatus) error - grpc.ServerStream -} - -type routerTrackPaymentServer struct { - grpc.ServerStream -} - -func (x *routerTrackPaymentServer) Send(m *PaymentStatus) error { - return x.ServerStream.SendMsg(m) -} - -func _Router_HtlcInterceptor_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RouterServer).HtlcInterceptor(&routerHtlcInterceptorServer{stream}) -} - -type Router_HtlcInterceptorServer interface { - Send(*ForwardHtlcInterceptRequest) error - Recv() (*ForwardHtlcInterceptResponse, error) - grpc.ServerStream -} - -type routerHtlcInterceptorServer struct { - grpc.ServerStream -} - -func (x *routerHtlcInterceptorServer) Send(m *ForwardHtlcInterceptRequest) error { - return x.ServerStream.SendMsg(m) -} - -func (x *routerHtlcInterceptorServer) Recv() (*ForwardHtlcInterceptResponse, error) { - m := new(ForwardHtlcInterceptResponse) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Router_UpdateChanStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateChanStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterServer).UpdateChanStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/routerrpc.Router/UpdateChanStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterServer).UpdateChanStatus(ctx, req.(*UpdateChanStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Router_serviceDesc = grpc.ServiceDesc{ - ServiceName: "routerrpc.Router", - HandlerType: (*RouterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EstimateRouteFee", - Handler: _Router_EstimateRouteFee_Handler, - }, - { - MethodName: "SendToRoute", - Handler: _Router_SendToRoute_Handler, - }, - { - MethodName: "SendToRouteV2", - Handler: _Router_SendToRouteV2_Handler, - }, - { - MethodName: "ResetMissionControl", - Handler: _Router_ResetMissionControl_Handler, - }, - { - MethodName: "QueryMissionControl", - Handler: _Router_QueryMissionControl_Handler, - }, - { - MethodName: "XImportMissionControl", - Handler: _Router_XImportMissionControl_Handler, - }, - { - MethodName: "GetMissionControlConfig", - Handler: _Router_GetMissionControlConfig_Handler, - }, - { - MethodName: "SetMissionControlConfig", - Handler: _Router_SetMissionControlConfig_Handler, - }, - { - MethodName: "QueryProbability", - Handler: _Router_QueryProbability_Handler, - }, - { - MethodName: "BuildRoute", - Handler: _Router_BuildRoute_Handler, - }, - { - MethodName: "UpdateChanStatus", - Handler: _Router_UpdateChanStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SendPaymentV2", - Handler: _Router_SendPaymentV2_Handler, - ServerStreams: true, - }, - { - StreamName: "TrackPaymentV2", - Handler: _Router_TrackPaymentV2_Handler, - ServerStreams: true, - }, - { - StreamName: "SubscribeHtlcEvents", - Handler: _Router_SubscribeHtlcEvents_Handler, - ServerStreams: true, - }, - { - StreamName: "SendPayment", - Handler: _Router_SendPayment_Handler, - ServerStreams: true, - }, - { - StreamName: "TrackPayment", - Handler: _Router_TrackPayment_Handler, - ServerStreams: true, - }, - { - StreamName: "HtlcInterceptor", - Handler: _Router_HtlcInterceptor_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "routerrpc/router.proto", -} diff --git a/lnrpc/routerrpc/router.pb.gw.go b/lnrpc/routerrpc/router.pb.gw.go index ad7c1e24f..43a881362 100644 --- a/lnrpc/routerrpc/router.pb.gw.go +++ b/lnrpc/routerrpc/router.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Router_SendPaymentV2_0(ctx context.Context, marshaler runtime.Marshaler, client RouterClient, req *http.Request, pathParams map[string]string) (Router_SendPaymentV2Client, runtime.ServerMetadata, error) { var protoReq SendPaymentRequest @@ -77,7 +77,6 @@ func request_Router_TrackPaymentV2_0(ctx context.Context, marshaler runtime.Mars } protoReq.PaymentHash, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payment_hash", err) } @@ -325,7 +324,6 @@ func request_Router_QueryProbability_0(ctx context.Context, marshaler runtime.Ma } protoReq.FromNode, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "from_node", err) } @@ -336,7 +334,6 @@ func request_Router_QueryProbability_0(ctx context.Context, marshaler runtime.Ma } protoReq.ToNode, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "to_node", err) } @@ -347,7 +344,6 @@ func request_Router_QueryProbability_0(ctx context.Context, marshaler runtime.Ma } protoReq.AmtMsat, err = runtime.Int64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amt_msat", err) } @@ -374,7 +370,6 @@ func local_request_Router_QueryProbability_0(ctx context.Context, marshaler runt } protoReq.FromNode, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "from_node", err) } @@ -385,7 +380,6 @@ func local_request_Router_QueryProbability_0(ctx context.Context, marshaler runt } protoReq.ToNode, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "to_node", err) } @@ -396,7 +390,6 @@ func local_request_Router_QueryProbability_0(ctx context.Context, marshaler runt } protoReq.AmtMsat, err = runtime.Int64(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amt_msat", err) } @@ -546,6 +539,7 @@ func local_request_Router_UpdateChanStatus_0(ctx context.Context, marshaler runt // RegisterRouterHandlerServer registers the http handlers for service Router to "mux". // UnaryRPC :call RouterServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRouterHandlerFromEndpoint instead. func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RouterServer) error { mux.Handle("POST", pattern_Router_SendPaymentV2_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -565,13 +559,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_EstimateRouteFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/EstimateRouteFee", runtime.WithHTTPPathPattern("/v2/router/route/estimatefee")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_EstimateRouteFee_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -585,13 +582,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_SendToRouteV2_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/SendToRouteV2", runtime.WithHTTPPathPattern("/v2/router/route/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_SendToRouteV2_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -605,13 +605,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_ResetMissionControl_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/ResetMissionControl", runtime.WithHTTPPathPattern("/v2/router/mc/reset")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_ResetMissionControl_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -625,13 +628,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("GET", pattern_Router_QueryMissionControl_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/QueryMissionControl", runtime.WithHTTPPathPattern("/v2/router/mc")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_QueryMissionControl_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -645,13 +651,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_XImportMissionControl_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/XImportMissionControl", runtime.WithHTTPPathPattern("/v2/router/x/importhistory")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_XImportMissionControl_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -665,13 +674,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("GET", pattern_Router_GetMissionControlConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/GetMissionControlConfig", runtime.WithHTTPPathPattern("/v2/router/mccfg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_GetMissionControlConfig_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -685,13 +697,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_SetMissionControlConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/SetMissionControlConfig", runtime.WithHTTPPathPattern("/v2/router/mccfg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_SetMissionControlConfig_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -705,13 +720,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("GET", pattern_Router_QueryProbability_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/QueryProbability", runtime.WithHTTPPathPattern("/v2/router/mc/probability/{from_node}/{to_node}/{amt_msat}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_QueryProbability_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -725,13 +743,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_BuildRoute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/BuildRoute", runtime.WithHTTPPathPattern("/v2/router/route")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_BuildRoute_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -759,13 +780,16 @@ func RegisterRouterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Router_UpdateChanStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/routerrpc.Router/UpdateChanStatus", runtime.WithHTTPPathPattern("/v2/router/updatechanstatus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Router_UpdateChanStatus_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -821,7 +845,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/SendPaymentV2", runtime.WithHTTPPathPattern("/v2/router/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -841,7 +865,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/TrackPaymentV2", runtime.WithHTTPPathPattern("/v2/router/track/{payment_hash}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -861,7 +885,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/EstimateRouteFee", runtime.WithHTTPPathPattern("/v2/router/route/estimatefee")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -881,7 +905,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/SendToRouteV2", runtime.WithHTTPPathPattern("/v2/router/route/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -901,7 +925,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/ResetMissionControl", runtime.WithHTTPPathPattern("/v2/router/mc/reset")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -921,7 +945,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/QueryMissionControl", runtime.WithHTTPPathPattern("/v2/router/mc")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -941,7 +965,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/XImportMissionControl", runtime.WithHTTPPathPattern("/v2/router/x/importhistory")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -961,7 +985,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/GetMissionControlConfig", runtime.WithHTTPPathPattern("/v2/router/mccfg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -981,7 +1005,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/SetMissionControlConfig", runtime.WithHTTPPathPattern("/v2/router/mccfg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1001,7 +1025,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/QueryProbability", runtime.WithHTTPPathPattern("/v2/router/mc/probability/{from_node}/{to_node}/{amt_msat}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1021,7 +1045,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/BuildRoute", runtime.WithHTTPPathPattern("/v2/router/route")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1041,7 +1065,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/SubscribeHtlcEvents", runtime.WithHTTPPathPattern("/v2/router/htlcevents")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1061,7 +1085,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/HtlcInterceptor", runtime.WithHTTPPathPattern("/v2/router/htlcinterceptor")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1081,7 +1105,7 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/routerrpc.Router/UpdateChanStatus", runtime.WithHTTPPathPattern("/v2/router/updatechanstatus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1101,33 +1125,33 @@ func RegisterRouterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli } var ( - pattern_Router_SendPaymentV2_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "send"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_SendPaymentV2_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "send"}, "")) - pattern_Router_TrackPaymentV2_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "router", "track", "payment_hash"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_TrackPaymentV2_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "router", "track", "payment_hash"}, "")) - pattern_Router_EstimateRouteFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "route", "estimatefee"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_EstimateRouteFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "route", "estimatefee"}, "")) - pattern_Router_SendToRouteV2_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "route", "send"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_SendToRouteV2_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "route", "send"}, "")) - pattern_Router_ResetMissionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "mc", "reset"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_ResetMissionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "mc", "reset"}, "")) - pattern_Router_QueryMissionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "mc"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_QueryMissionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "mc"}, "")) - pattern_Router_XImportMissionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "x", "importhistory"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_XImportMissionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "router", "x", "importhistory"}, "")) - pattern_Router_GetMissionControlConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "mccfg"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_GetMissionControlConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "mccfg"}, "")) - pattern_Router_SetMissionControlConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "mccfg"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_SetMissionControlConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "mccfg"}, "")) - pattern_Router_QueryProbability_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"v2", "router", "mc", "probability", "from_node", "to_node", "amt_msat"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_QueryProbability_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"v2", "router", "mc", "probability", "from_node", "to_node", "amt_msat"}, "")) - pattern_Router_BuildRoute_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "route"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_BuildRoute_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "route"}, "")) - pattern_Router_SubscribeHtlcEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "htlcevents"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_SubscribeHtlcEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "htlcevents"}, "")) - pattern_Router_HtlcInterceptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "htlcinterceptor"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_HtlcInterceptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "htlcinterceptor"}, "")) - pattern_Router_UpdateChanStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "updatechanstatus"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Router_UpdateChanStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "router", "updatechanstatus"}, "")) ) var ( diff --git a/lnrpc/routerrpc/router.swagger.json b/lnrpc/routerrpc/router.swagger.json index 09de41277..98f568913 100644 --- a/lnrpc/routerrpc/router.swagger.json +++ b/lnrpc/routerrpc/router.swagger.json @@ -4,6 +4,11 @@ "title": "routerrpc/router.proto", "version": "version not set" }, + "tags": [ + { + "name": "Router" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/router/htlcevents": { "get": { "summary": "SubscribeHtlcEvents creates a uni-directional stream from the server to\nthe client which delivers a stream of htlc events.", - "operationId": "SubscribeHtlcEvents", + "operationId": "Router_SubscribeHtlcEvents", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -25,16 +30,16 @@ "$ref": "#/definitions/routerrpcHtlcEvent" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of routerrpcHtlcEvent" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -46,7 +51,7 @@ "/v2/router/htlcinterceptor": { "post": { "summary": "*\nHtlcInterceptor dispatches a bi-directional streaming RPC in which\nForwarded HTLC requests are sent to the client and the client responds with\na boolean that tells LND if this htlc should be intercepted.\nIn case of interception, the htlc can be either settled, cancelled or\nresumed later by using the ResolveHoldForward endpoint.", - "operationId": "HtlcInterceptor", + "operationId": "Router_HtlcInterceptor", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -57,16 +62,16 @@ "$ref": "#/definitions/routerrpcForwardHtlcInterceptRequest" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of routerrpcForwardHtlcInterceptRequest" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -89,7 +94,7 @@ "/v2/router/mc": { "get": { "summary": "QueryMissionControl exposes the internal mission control state to callers.\nIt is a development feature.", - "operationId": "QueryMissionControl", + "operationId": "Router_QueryMissionControl", "responses": { "200": { "description": "A successful response.", @@ -98,9 +103,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -112,7 +117,7 @@ "/v2/router/mc/probability/{from_node}/{to_node}/{amt_msat}": { "get": { "summary": "QueryProbability returns the current success probability estimate for a\ngiven node pair and amount.", - "operationId": "QueryProbability", + "operationId": "Router_QueryProbability", "responses": { "200": { "description": "A successful response.", @@ -121,9 +126,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -161,7 +166,7 @@ "/v2/router/mc/reset": { "post": { "summary": "ResetMissionControl clears all mission control state and starts with a clean\nslate.", - "operationId": "ResetMissionControl", + "operationId": "Router_ResetMissionControl", "responses": { "200": { "description": "A successful response.", @@ -170,9 +175,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -194,7 +199,7 @@ "/v2/router/mccfg": { "get": { "summary": "GetMissionControlConfig returns mission control's current config.", - "operationId": "GetMissionControlConfig", + "operationId": "Router_GetMissionControlConfig", "responses": { "200": { "description": "A successful response.", @@ -203,9 +208,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -215,7 +220,7 @@ }, "post": { "summary": "SetMissionControlConfig will set mission control's config, if the config\nprovided is valid.", - "operationId": "SetMissionControlConfig", + "operationId": "Router_SetMissionControlConfig", "responses": { "200": { "description": "A successful response.", @@ -224,9 +229,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -248,7 +253,7 @@ "/v2/router/route": { "post": { "summary": "BuildRoute builds a fully specified route based on a list of hop public\nkeys. It retrieves the relevant channel policies from the graph in order to\ncalculate the correct fees and time locks.", - "operationId": "BuildRoute", + "operationId": "Router_BuildRoute", "responses": { "200": { "description": "A successful response.", @@ -257,9 +262,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -281,7 +286,7 @@ "/v2/router/route/estimatefee": { "post": { "summary": "EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it\nmay cost to send an HTLC to the target end destination.", - "operationId": "EstimateRouteFee", + "operationId": "Router_EstimateRouteFee", "responses": { "200": { "description": "A successful response.", @@ -290,9 +295,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -314,7 +319,7 @@ "/v2/router/route/send": { "post": { "summary": "SendToRouteV2 attempts to make a payment via the specified route. This\nmethod differs from SendPayment in that it allows users to specify a full\nroute manually. This can be used for things like rebalancing, and atomic\nswaps.", - "operationId": "SendToRouteV2", + "operationId": "Router_SendToRouteV2", "responses": { "200": { "description": "A successful response.", @@ -323,9 +328,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -347,7 +352,7 @@ "/v2/router/send": { "post": { "summary": "SendPaymentV2 attempts to route a payment described by the passed\nPaymentRequest to the final destination. The call returns a stream of\npayment updates.", - "operationId": "SendPaymentV2", + "operationId": "Router_SendPaymentV2", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -358,16 +363,16 @@ "$ref": "#/definitions/lnrpcPayment" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcPayment" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -389,7 +394,7 @@ "/v2/router/track/{payment_hash}": { "get": { "summary": "TrackPaymentV2 returns an update stream for the payment identified by the\npayment hash.", - "operationId": "TrackPaymentV2", + "operationId": "Router_TrackPaymentV2", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -400,16 +405,16 @@ "$ref": "#/definitions/lnrpcPayment" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcPayment" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -427,8 +432,7 @@ "description": "If set, only the final payment update is streamed back. Intermediate updates\nthat show which htlcs are still in flight are suppressed.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -439,7 +443,7 @@ "/v2/router/updatechanstatus": { "post": { "summary": "UpdateChanStatus attempts to manually set the state of a channel\n(enabled, disabled, or auto). A manual \"disable\" request will cause the\nchannel to stay disabled until a subsequent manual request of either\n\"enable\" or \"auto\".", - "operationId": "UpdateChanStatus", + "operationId": "Router_UpdateChanStatus", "responses": { "200": { "description": "A successful response.", @@ -448,9 +452,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -472,7 +476,7 @@ "/v2/router/x/importhistory": { "post": { "summary": "XImportMissionControl is an experimental API that imports the state provided\nto the internal mission control's state, using all results which are more\nrecent than our existing values. These values will only be imported\nin-memory, and will not be persisted across restarts.", - "operationId": "XImportMissionControl", + "operationId": "Router_XImportMissionControl", "responses": { "200": { "description": "A successful response.", @@ -481,9 +485,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -798,7 +802,6 @@ }, "tlv_payload": { "type": "boolean", - "format": "boolean", "description": "If set to true, then this hop will be encoded using the new variable length\nTLV format. Note that if any custom tlv_records below are specified, then\nthis field MUST be set to true for them to be encoded properly." }, "mpp_record": { @@ -1597,7 +1600,6 @@ }, "allow_self_payment": { "type": "boolean", - "format": "boolean", "description": "If set, circular payments to self are permitted." }, "dest_features": { @@ -1614,7 +1616,6 @@ }, "no_inflight_updates": { "type": "boolean", - "format": "boolean", "description": "If set, only the final payment update is streamed back. Intermediate updates\nthat show which htlcs are still in flight are suppressed." }, "max_shard_size_msat": { @@ -1624,7 +1625,6 @@ }, "amp": { "type": "boolean", - "format": "boolean", "description": "If set, an AMP-payment will be attempted." } } @@ -1708,12 +1708,9 @@ "routerrpcXImportMissionControlResponse": { "type": "object" }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -1728,31 +1725,6 @@ } } } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpc_code": { - "type": "integer", - "format": "int32" - }, - "http_code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "http_status": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } } } } diff --git a/lnrpc/routerrpc/router_grpc.pb.go b/lnrpc/routerrpc/router_grpc.pb.go new file mode 100644 index 000000000..4e7f8fda8 --- /dev/null +++ b/lnrpc/routerrpc/router_grpc.pb.go @@ -0,0 +1,985 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package routerrpc + +import ( + context "context" + lnrpc "github.com/lightningnetwork/lnd/lnrpc" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RouterClient is the client API for Router service. +// +// 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 RouterClient interface { + // + //SendPaymentV2 attempts to route a payment described by the passed + //PaymentRequest to the final destination. The call returns a stream of + //payment updates. + SendPaymentV2(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentV2Client, error) + // + //TrackPaymentV2 returns an update stream for the payment identified by the + //payment hash. + TrackPaymentV2(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentV2Client, error) + // + //EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + //may cost to send an HTLC to the target end destination. + EstimateRouteFee(ctx context.Context, in *RouteFeeRequest, opts ...grpc.CallOption) (*RouteFeeResponse, error) + // Deprecated: Do not use. + // + //Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + //the specified route. This method differs from SendPayment in that it + //allows users to specify a full route manually. This can be used for + //things like rebalancing, and atomic swaps. It differs from the newer + //SendToRouteV2 in that it doesn't return the full HTLC information. + SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) + // + //SendToRouteV2 attempts to make a payment via the specified route. This + //method differs from SendPayment in that it allows users to specify a full + //route manually. This can be used for things like rebalancing, and atomic + //swaps. + SendToRouteV2(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*lnrpc.HTLCAttempt, error) + // + //ResetMissionControl clears all mission control state and starts with a clean + //slate. + ResetMissionControl(ctx context.Context, in *ResetMissionControlRequest, opts ...grpc.CallOption) (*ResetMissionControlResponse, error) + // + //QueryMissionControl exposes the internal mission control state to callers. + //It is a development feature. + QueryMissionControl(ctx context.Context, in *QueryMissionControlRequest, opts ...grpc.CallOption) (*QueryMissionControlResponse, error) + // + //XImportMissionControl is an experimental API that imports the state provided + //to the internal mission control's state, using all results which are more + //recent than our existing values. These values will only be imported + //in-memory, and will not be persisted across restarts. + XImportMissionControl(ctx context.Context, in *XImportMissionControlRequest, opts ...grpc.CallOption) (*XImportMissionControlResponse, error) + // + //GetMissionControlConfig returns mission control's current config. + GetMissionControlConfig(ctx context.Context, in *GetMissionControlConfigRequest, opts ...grpc.CallOption) (*GetMissionControlConfigResponse, error) + // + //SetMissionControlConfig will set mission control's config, if the config + //provided is valid. + SetMissionControlConfig(ctx context.Context, in *SetMissionControlConfigRequest, opts ...grpc.CallOption) (*SetMissionControlConfigResponse, error) + // + //QueryProbability returns the current success probability estimate for a + //given node pair and amount. + QueryProbability(ctx context.Context, in *QueryProbabilityRequest, opts ...grpc.CallOption) (*QueryProbabilityResponse, error) + // + //BuildRoute builds a fully specified route based on a list of hop public + //keys. It retrieves the relevant channel policies from the graph in order to + //calculate the correct fees and time locks. + BuildRoute(ctx context.Context, in *BuildRouteRequest, opts ...grpc.CallOption) (*BuildRouteResponse, error) + // + //SubscribeHtlcEvents creates a uni-directional stream from the server to + //the client which delivers a stream of htlc events. + SubscribeHtlcEvents(ctx context.Context, in *SubscribeHtlcEventsRequest, opts ...grpc.CallOption) (Router_SubscribeHtlcEventsClient, error) + // Deprecated: Do not use. + // + //Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + //described by the passed PaymentRequest to the final destination. The call + //returns a stream of payment status updates. + SendPayment(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentClient, error) + // Deprecated: Do not use. + // + //Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + //the payment identified by the payment hash. + TrackPayment(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentClient, error) + //* + //HtlcInterceptor dispatches a bi-directional streaming RPC in which + //Forwarded HTLC requests are sent to the client and the client responds with + //a boolean that tells LND if this htlc should be intercepted. + //In case of interception, the htlc can be either settled, cancelled or + //resumed later by using the ResolveHoldForward endpoint. + HtlcInterceptor(ctx context.Context, opts ...grpc.CallOption) (Router_HtlcInterceptorClient, error) + // + //UpdateChanStatus attempts to manually set the state of a channel + //(enabled, disabled, or auto). A manual "disable" request will cause the + //channel to stay disabled until a subsequent manual request of either + //"enable" or "auto". + UpdateChanStatus(ctx context.Context, in *UpdateChanStatusRequest, opts ...grpc.CallOption) (*UpdateChanStatusResponse, error) +} + +type routerClient struct { + cc grpc.ClientConnInterface +} + +func NewRouterClient(cc grpc.ClientConnInterface) RouterClient { + return &routerClient{cc} +} + +func (c *routerClient) SendPaymentV2(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentV2Client, error) { + stream, err := c.cc.NewStream(ctx, &Router_ServiceDesc.Streams[0], "/routerrpc.Router/SendPaymentV2", opts...) + if err != nil { + return nil, err + } + x := &routerSendPaymentV2Client{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Router_SendPaymentV2Client interface { + Recv() (*lnrpc.Payment, error) + grpc.ClientStream +} + +type routerSendPaymentV2Client struct { + grpc.ClientStream +} + +func (x *routerSendPaymentV2Client) Recv() (*lnrpc.Payment, error) { + m := new(lnrpc.Payment) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *routerClient) TrackPaymentV2(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentV2Client, error) { + stream, err := c.cc.NewStream(ctx, &Router_ServiceDesc.Streams[1], "/routerrpc.Router/TrackPaymentV2", opts...) + if err != nil { + return nil, err + } + x := &routerTrackPaymentV2Client{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Router_TrackPaymentV2Client interface { + Recv() (*lnrpc.Payment, error) + grpc.ClientStream +} + +type routerTrackPaymentV2Client struct { + grpc.ClientStream +} + +func (x *routerTrackPaymentV2Client) Recv() (*lnrpc.Payment, error) { + m := new(lnrpc.Payment) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *routerClient) EstimateRouteFee(ctx context.Context, in *RouteFeeRequest, opts ...grpc.CallOption) (*RouteFeeResponse, error) { + out := new(RouteFeeResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/EstimateRouteFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *routerClient) SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) { + out := new(SendToRouteResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRoute", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) SendToRouteV2(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*lnrpc.HTLCAttempt, error) { + out := new(lnrpc.HTLCAttempt) + err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRouteV2", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) ResetMissionControl(ctx context.Context, in *ResetMissionControlRequest, opts ...grpc.CallOption) (*ResetMissionControlResponse, error) { + out := new(ResetMissionControlResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/ResetMissionControl", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) QueryMissionControl(ctx context.Context, in *QueryMissionControlRequest, opts ...grpc.CallOption) (*QueryMissionControlResponse, error) { + out := new(QueryMissionControlResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/QueryMissionControl", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) XImportMissionControl(ctx context.Context, in *XImportMissionControlRequest, opts ...grpc.CallOption) (*XImportMissionControlResponse, error) { + out := new(XImportMissionControlResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/XImportMissionControl", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) GetMissionControlConfig(ctx context.Context, in *GetMissionControlConfigRequest, opts ...grpc.CallOption) (*GetMissionControlConfigResponse, error) { + out := new(GetMissionControlConfigResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/GetMissionControlConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) SetMissionControlConfig(ctx context.Context, in *SetMissionControlConfigRequest, opts ...grpc.CallOption) (*SetMissionControlConfigResponse, error) { + out := new(SetMissionControlConfigResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/SetMissionControlConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) QueryProbability(ctx context.Context, in *QueryProbabilityRequest, opts ...grpc.CallOption) (*QueryProbabilityResponse, error) { + out := new(QueryProbabilityResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/QueryProbability", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) BuildRoute(ctx context.Context, in *BuildRouteRequest, opts ...grpc.CallOption) (*BuildRouteResponse, error) { + out := new(BuildRouteResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/BuildRoute", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) SubscribeHtlcEvents(ctx context.Context, in *SubscribeHtlcEventsRequest, opts ...grpc.CallOption) (Router_SubscribeHtlcEventsClient, error) { + stream, err := c.cc.NewStream(ctx, &Router_ServiceDesc.Streams[2], "/routerrpc.Router/SubscribeHtlcEvents", opts...) + if err != nil { + return nil, err + } + x := &routerSubscribeHtlcEventsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Router_SubscribeHtlcEventsClient interface { + Recv() (*HtlcEvent, error) + grpc.ClientStream +} + +type routerSubscribeHtlcEventsClient struct { + grpc.ClientStream +} + +func (x *routerSubscribeHtlcEventsClient) Recv() (*HtlcEvent, error) { + m := new(HtlcEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Deprecated: Do not use. +func (c *routerClient) SendPayment(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentClient, error) { + stream, err := c.cc.NewStream(ctx, &Router_ServiceDesc.Streams[3], "/routerrpc.Router/SendPayment", opts...) + if err != nil { + return nil, err + } + x := &routerSendPaymentClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Router_SendPaymentClient interface { + Recv() (*PaymentStatus, error) + grpc.ClientStream +} + +type routerSendPaymentClient struct { + grpc.ClientStream +} + +func (x *routerSendPaymentClient) Recv() (*PaymentStatus, error) { + m := new(PaymentStatus) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Deprecated: Do not use. +func (c *routerClient) TrackPayment(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentClient, error) { + stream, err := c.cc.NewStream(ctx, &Router_ServiceDesc.Streams[4], "/routerrpc.Router/TrackPayment", opts...) + if err != nil { + return nil, err + } + x := &routerTrackPaymentClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Router_TrackPaymentClient interface { + Recv() (*PaymentStatus, error) + grpc.ClientStream +} + +type routerTrackPaymentClient struct { + grpc.ClientStream +} + +func (x *routerTrackPaymentClient) Recv() (*PaymentStatus, error) { + m := new(PaymentStatus) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *routerClient) HtlcInterceptor(ctx context.Context, opts ...grpc.CallOption) (Router_HtlcInterceptorClient, error) { + stream, err := c.cc.NewStream(ctx, &Router_ServiceDesc.Streams[5], "/routerrpc.Router/HtlcInterceptor", opts...) + if err != nil { + return nil, err + } + x := &routerHtlcInterceptorClient{stream} + return x, nil +} + +type Router_HtlcInterceptorClient interface { + Send(*ForwardHtlcInterceptResponse) error + Recv() (*ForwardHtlcInterceptRequest, error) + grpc.ClientStream +} + +type routerHtlcInterceptorClient struct { + grpc.ClientStream +} + +func (x *routerHtlcInterceptorClient) Send(m *ForwardHtlcInterceptResponse) error { + return x.ClientStream.SendMsg(m) +} + +func (x *routerHtlcInterceptorClient) Recv() (*ForwardHtlcInterceptRequest, error) { + m := new(ForwardHtlcInterceptRequest) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *routerClient) UpdateChanStatus(ctx context.Context, in *UpdateChanStatusRequest, opts ...grpc.CallOption) (*UpdateChanStatusResponse, error) { + out := new(UpdateChanStatusResponse) + err := c.cc.Invoke(ctx, "/routerrpc.Router/UpdateChanStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RouterServer is the server API for Router service. +// All implementations must embed UnimplementedRouterServer +// for forward compatibility +type RouterServer interface { + // + //SendPaymentV2 attempts to route a payment described by the passed + //PaymentRequest to the final destination. The call returns a stream of + //payment updates. + SendPaymentV2(*SendPaymentRequest, Router_SendPaymentV2Server) error + // + //TrackPaymentV2 returns an update stream for the payment identified by the + //payment hash. + TrackPaymentV2(*TrackPaymentRequest, Router_TrackPaymentV2Server) error + // + //EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + //may cost to send an HTLC to the target end destination. + EstimateRouteFee(context.Context, *RouteFeeRequest) (*RouteFeeResponse, error) + // Deprecated: Do not use. + // + //Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + //the specified route. This method differs from SendPayment in that it + //allows users to specify a full route manually. This can be used for + //things like rebalancing, and atomic swaps. It differs from the newer + //SendToRouteV2 in that it doesn't return the full HTLC information. + SendToRoute(context.Context, *SendToRouteRequest) (*SendToRouteResponse, error) + // + //SendToRouteV2 attempts to make a payment via the specified route. This + //method differs from SendPayment in that it allows users to specify a full + //route manually. This can be used for things like rebalancing, and atomic + //swaps. + SendToRouteV2(context.Context, *SendToRouteRequest) (*lnrpc.HTLCAttempt, error) + // + //ResetMissionControl clears all mission control state and starts with a clean + //slate. + ResetMissionControl(context.Context, *ResetMissionControlRequest) (*ResetMissionControlResponse, error) + // + //QueryMissionControl exposes the internal mission control state to callers. + //It is a development feature. + QueryMissionControl(context.Context, *QueryMissionControlRequest) (*QueryMissionControlResponse, error) + // + //XImportMissionControl is an experimental API that imports the state provided + //to the internal mission control's state, using all results which are more + //recent than our existing values. These values will only be imported + //in-memory, and will not be persisted across restarts. + XImportMissionControl(context.Context, *XImportMissionControlRequest) (*XImportMissionControlResponse, error) + // + //GetMissionControlConfig returns mission control's current config. + GetMissionControlConfig(context.Context, *GetMissionControlConfigRequest) (*GetMissionControlConfigResponse, error) + // + //SetMissionControlConfig will set mission control's config, if the config + //provided is valid. + SetMissionControlConfig(context.Context, *SetMissionControlConfigRequest) (*SetMissionControlConfigResponse, error) + // + //QueryProbability returns the current success probability estimate for a + //given node pair and amount. + QueryProbability(context.Context, *QueryProbabilityRequest) (*QueryProbabilityResponse, error) + // + //BuildRoute builds a fully specified route based on a list of hop public + //keys. It retrieves the relevant channel policies from the graph in order to + //calculate the correct fees and time locks. + BuildRoute(context.Context, *BuildRouteRequest) (*BuildRouteResponse, error) + // + //SubscribeHtlcEvents creates a uni-directional stream from the server to + //the client which delivers a stream of htlc events. + SubscribeHtlcEvents(*SubscribeHtlcEventsRequest, Router_SubscribeHtlcEventsServer) error + // Deprecated: Do not use. + // + //Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + //described by the passed PaymentRequest to the final destination. The call + //returns a stream of payment status updates. + SendPayment(*SendPaymentRequest, Router_SendPaymentServer) error + // Deprecated: Do not use. + // + //Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + //the payment identified by the payment hash. + TrackPayment(*TrackPaymentRequest, Router_TrackPaymentServer) error + //* + //HtlcInterceptor dispatches a bi-directional streaming RPC in which + //Forwarded HTLC requests are sent to the client and the client responds with + //a boolean that tells LND if this htlc should be intercepted. + //In case of interception, the htlc can be either settled, cancelled or + //resumed later by using the ResolveHoldForward endpoint. + HtlcInterceptor(Router_HtlcInterceptorServer) error + // + //UpdateChanStatus attempts to manually set the state of a channel + //(enabled, disabled, or auto). A manual "disable" request will cause the + //channel to stay disabled until a subsequent manual request of either + //"enable" or "auto". + UpdateChanStatus(context.Context, *UpdateChanStatusRequest) (*UpdateChanStatusResponse, error) + mustEmbedUnimplementedRouterServer() +} + +// UnimplementedRouterServer must be embedded to have forward compatible implementations. +type UnimplementedRouterServer struct { +} + +func (UnimplementedRouterServer) SendPaymentV2(*SendPaymentRequest, Router_SendPaymentV2Server) error { + return status.Errorf(codes.Unimplemented, "method SendPaymentV2 not implemented") +} +func (UnimplementedRouterServer) TrackPaymentV2(*TrackPaymentRequest, Router_TrackPaymentV2Server) error { + return status.Errorf(codes.Unimplemented, "method TrackPaymentV2 not implemented") +} +func (UnimplementedRouterServer) EstimateRouteFee(context.Context, *RouteFeeRequest) (*RouteFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateRouteFee not implemented") +} +func (UnimplementedRouterServer) SendToRoute(context.Context, *SendToRouteRequest) (*SendToRouteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendToRoute not implemented") +} +func (UnimplementedRouterServer) SendToRouteV2(context.Context, *SendToRouteRequest) (*lnrpc.HTLCAttempt, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendToRouteV2 not implemented") +} +func (UnimplementedRouterServer) ResetMissionControl(context.Context, *ResetMissionControlRequest) (*ResetMissionControlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResetMissionControl not implemented") +} +func (UnimplementedRouterServer) QueryMissionControl(context.Context, *QueryMissionControlRequest) (*QueryMissionControlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryMissionControl not implemented") +} +func (UnimplementedRouterServer) XImportMissionControl(context.Context, *XImportMissionControlRequest) (*XImportMissionControlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method XImportMissionControl not implemented") +} +func (UnimplementedRouterServer) GetMissionControlConfig(context.Context, *GetMissionControlConfigRequest) (*GetMissionControlConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMissionControlConfig not implemented") +} +func (UnimplementedRouterServer) SetMissionControlConfig(context.Context, *SetMissionControlConfigRequest) (*SetMissionControlConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMissionControlConfig not implemented") +} +func (UnimplementedRouterServer) QueryProbability(context.Context, *QueryProbabilityRequest) (*QueryProbabilityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryProbability not implemented") +} +func (UnimplementedRouterServer) BuildRoute(context.Context, *BuildRouteRequest) (*BuildRouteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuildRoute not implemented") +} +func (UnimplementedRouterServer) SubscribeHtlcEvents(*SubscribeHtlcEventsRequest, Router_SubscribeHtlcEventsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeHtlcEvents not implemented") +} +func (UnimplementedRouterServer) SendPayment(*SendPaymentRequest, Router_SendPaymentServer) error { + return status.Errorf(codes.Unimplemented, "method SendPayment not implemented") +} +func (UnimplementedRouterServer) TrackPayment(*TrackPaymentRequest, Router_TrackPaymentServer) error { + return status.Errorf(codes.Unimplemented, "method TrackPayment not implemented") +} +func (UnimplementedRouterServer) HtlcInterceptor(Router_HtlcInterceptorServer) error { + return status.Errorf(codes.Unimplemented, "method HtlcInterceptor not implemented") +} +func (UnimplementedRouterServer) UpdateChanStatus(context.Context, *UpdateChanStatusRequest) (*UpdateChanStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChanStatus not implemented") +} +func (UnimplementedRouterServer) mustEmbedUnimplementedRouterServer() {} + +// UnsafeRouterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RouterServer will +// result in compilation errors. +type UnsafeRouterServer interface { + mustEmbedUnimplementedRouterServer() +} + +func RegisterRouterServer(s grpc.ServiceRegistrar, srv RouterServer) { + s.RegisterService(&Router_ServiceDesc, srv) +} + +func _Router_SendPaymentV2_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SendPaymentRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RouterServer).SendPaymentV2(m, &routerSendPaymentV2Server{stream}) +} + +type Router_SendPaymentV2Server interface { + Send(*lnrpc.Payment) error + grpc.ServerStream +} + +type routerSendPaymentV2Server struct { + grpc.ServerStream +} + +func (x *routerSendPaymentV2Server) Send(m *lnrpc.Payment) error { + return x.ServerStream.SendMsg(m) +} + +func _Router_TrackPaymentV2_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(TrackPaymentRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RouterServer).TrackPaymentV2(m, &routerTrackPaymentV2Server{stream}) +} + +type Router_TrackPaymentV2Server interface { + Send(*lnrpc.Payment) error + grpc.ServerStream +} + +type routerTrackPaymentV2Server struct { + grpc.ServerStream +} + +func (x *routerTrackPaymentV2Server) Send(m *lnrpc.Payment) error { + return x.ServerStream.SendMsg(m) +} + +func _Router_EstimateRouteFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RouteFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).EstimateRouteFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/EstimateRouteFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).EstimateRouteFee(ctx, req.(*RouteFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_SendToRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendToRouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).SendToRoute(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/SendToRoute", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).SendToRoute(ctx, req.(*SendToRouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_SendToRouteV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendToRouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).SendToRouteV2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/SendToRouteV2", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).SendToRouteV2(ctx, req.(*SendToRouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_ResetMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResetMissionControlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).ResetMissionControl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/ResetMissionControl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).ResetMissionControl(ctx, req.(*ResetMissionControlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_QueryMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMissionControlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).QueryMissionControl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/QueryMissionControl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).QueryMissionControl(ctx, req.(*QueryMissionControlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_XImportMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(XImportMissionControlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).XImportMissionControl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/XImportMissionControl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).XImportMissionControl(ctx, req.(*XImportMissionControlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_GetMissionControlConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMissionControlConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).GetMissionControlConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/GetMissionControlConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).GetMissionControlConfig(ctx, req.(*GetMissionControlConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_SetMissionControlConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMissionControlConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).SetMissionControlConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/SetMissionControlConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).SetMissionControlConfig(ctx, req.(*SetMissionControlConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_QueryProbability_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProbabilityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).QueryProbability(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/QueryProbability", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).QueryProbability(ctx, req.(*QueryProbabilityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_BuildRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BuildRouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).BuildRoute(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/BuildRoute", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).BuildRoute(ctx, req.(*BuildRouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_SubscribeHtlcEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeHtlcEventsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RouterServer).SubscribeHtlcEvents(m, &routerSubscribeHtlcEventsServer{stream}) +} + +type Router_SubscribeHtlcEventsServer interface { + Send(*HtlcEvent) error + grpc.ServerStream +} + +type routerSubscribeHtlcEventsServer struct { + grpc.ServerStream +} + +func (x *routerSubscribeHtlcEventsServer) Send(m *HtlcEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _Router_SendPayment_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SendPaymentRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RouterServer).SendPayment(m, &routerSendPaymentServer{stream}) +} + +type Router_SendPaymentServer interface { + Send(*PaymentStatus) error + grpc.ServerStream +} + +type routerSendPaymentServer struct { + grpc.ServerStream +} + +func (x *routerSendPaymentServer) Send(m *PaymentStatus) error { + return x.ServerStream.SendMsg(m) +} + +func _Router_TrackPayment_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(TrackPaymentRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RouterServer).TrackPayment(m, &routerTrackPaymentServer{stream}) +} + +type Router_TrackPaymentServer interface { + Send(*PaymentStatus) error + grpc.ServerStream +} + +type routerTrackPaymentServer struct { + grpc.ServerStream +} + +func (x *routerTrackPaymentServer) Send(m *PaymentStatus) error { + return x.ServerStream.SendMsg(m) +} + +func _Router_HtlcInterceptor_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RouterServer).HtlcInterceptor(&routerHtlcInterceptorServer{stream}) +} + +type Router_HtlcInterceptorServer interface { + Send(*ForwardHtlcInterceptRequest) error + Recv() (*ForwardHtlcInterceptResponse, error) + grpc.ServerStream +} + +type routerHtlcInterceptorServer struct { + grpc.ServerStream +} + +func (x *routerHtlcInterceptorServer) Send(m *ForwardHtlcInterceptRequest) error { + return x.ServerStream.SendMsg(m) +} + +func (x *routerHtlcInterceptorServer) Recv() (*ForwardHtlcInterceptResponse, error) { + m := new(ForwardHtlcInterceptResponse) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Router_UpdateChanStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateChanStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).UpdateChanStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routerrpc.Router/UpdateChanStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).UpdateChanStatus(ctx, req.(*UpdateChanStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Router_ServiceDesc is the grpc.ServiceDesc for Router service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Router_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "routerrpc.Router", + HandlerType: (*RouterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EstimateRouteFee", + Handler: _Router_EstimateRouteFee_Handler, + }, + { + MethodName: "SendToRoute", + Handler: _Router_SendToRoute_Handler, + }, + { + MethodName: "SendToRouteV2", + Handler: _Router_SendToRouteV2_Handler, + }, + { + MethodName: "ResetMissionControl", + Handler: _Router_ResetMissionControl_Handler, + }, + { + MethodName: "QueryMissionControl", + Handler: _Router_QueryMissionControl_Handler, + }, + { + MethodName: "XImportMissionControl", + Handler: _Router_XImportMissionControl_Handler, + }, + { + MethodName: "GetMissionControlConfig", + Handler: _Router_GetMissionControlConfig_Handler, + }, + { + MethodName: "SetMissionControlConfig", + Handler: _Router_SetMissionControlConfig_Handler, + }, + { + MethodName: "QueryProbability", + Handler: _Router_QueryProbability_Handler, + }, + { + MethodName: "BuildRoute", + Handler: _Router_BuildRoute_Handler, + }, + { + MethodName: "UpdateChanStatus", + Handler: _Router_UpdateChanStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SendPaymentV2", + Handler: _Router_SendPaymentV2_Handler, + ServerStreams: true, + }, + { + StreamName: "TrackPaymentV2", + Handler: _Router_TrackPaymentV2_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeHtlcEvents", + Handler: _Router_SubscribeHtlcEvents_Handler, + ServerStreams: true, + }, + { + StreamName: "SendPayment", + Handler: _Router_SendPayment_Handler, + ServerStreams: true, + }, + { + StreamName: "TrackPayment", + Handler: _Router_TrackPayment_Handler, + ServerStreams: true, + }, + { + StreamName: "HtlcInterceptor", + Handler: _Router_HtlcInterceptor_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "routerrpc/router.proto", +} diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go index 8c40517d8..4aef7ef25 100644 --- a/lnrpc/routerrpc/router_server.go +++ b/lnrpc/routerrpc/router_server.go @@ -12,7 +12,7 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lntypes" @@ -147,6 +147,11 @@ type Server struct { shutdown int32 // To be used atomically. forwardInterceptorActive int32 // To be used atomically. + // Required by the grpc-gateway/v2 library for forward compatibility. + // Must be after the atomically used variables to not break struct + // alignment. + UnimplementedRouterServer + cfg *Config quit chan struct{} diff --git a/lnrpc/signrpc/signer.pb.go b/lnrpc/signrpc/signer.pb.go index 34ae727aa..c1e920c51 100644 --- a/lnrpc/signrpc/signer.pb.go +++ b/lnrpc/signrpc/signer.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: signrpc/signer.proto package signrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type KeyLocator struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1255,309 +1246,3 @@ func file_signrpc_signer_proto_init() { file_signrpc_signer_proto_goTypes = nil file_signrpc_signer_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// SignerClient is the client API for Signer service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SignerClient interface { - // - //SignOutputRaw is a method that can be used to generated a signature for a - //set of inputs/outputs to a transaction. Each request specifies details - //concerning how the outputs should be signed, which keys they should be - //signed with, and also any optional tweaks. The return value is a fixed - //64-byte signature (the same format as we use on the wire in Lightning). - // - //If we are unable to sign using the specified keys, then an error will be - //returned. - SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error) - // - //ComputeInputScript generates a complete InputIndex for the passed - //transaction with the signature as defined within the passed SignDescriptor. - //This method should be capable of generating the proper input script for - //both regular p2wkh output and p2wkh outputs nested within a regular p2sh - //output. - // - //Note that when using this method to sign inputs belonging to the wallet, - //the only items of the SignDescriptor that need to be populated are pkScript - //in the TxOut field, the value in that same field, and finally the input - //index. - ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error) - // - //SignMessage signs a message with the key specified in the key locator. The - //returned signature is fixed-size LN wire format encoded. - // - //The main difference to SignMessage in the main RPC is that a specific key is - //used to sign the message instead of the node identity private key. - SignMessage(ctx context.Context, in *SignMessageReq, opts ...grpc.CallOption) (*SignMessageResp, error) - // - //VerifyMessage verifies a signature over a message using the public key - //provided. The signature must be fixed-size LN wire format encoded. - // - //The main difference to VerifyMessage in the main RPC is that the public key - //used to sign the message does not have to be a node known to the network. - VerifyMessage(ctx context.Context, in *VerifyMessageReq, opts ...grpc.CallOption) (*VerifyMessageResp, error) - // - //DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key - //derivation between the ephemeral public key in the request and the node's - //key specified in the key_desc parameter. Either a key locator or a raw - //public key is expected in the key_desc, if neither is supplied, defaults to - //the node's identity private key: - //P_shared = privKeyNode * ephemeralPubkey - //The resulting shared public key is serialized in the compressed format and - //hashed with sha256, resulting in the final key length of 256bit. - DeriveSharedKey(ctx context.Context, in *SharedKeyRequest, opts ...grpc.CallOption) (*SharedKeyResponse, error) -} - -type signerClient struct { - cc grpc.ClientConnInterface -} - -func NewSignerClient(cc grpc.ClientConnInterface) SignerClient { - return &signerClient{cc} -} - -func (c *signerClient) SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error) { - out := new(SignResp) - err := c.cc.Invoke(ctx, "/signrpc.Signer/SignOutputRaw", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *signerClient) ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error) { - out := new(InputScriptResp) - err := c.cc.Invoke(ctx, "/signrpc.Signer/ComputeInputScript", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *signerClient) SignMessage(ctx context.Context, in *SignMessageReq, opts ...grpc.CallOption) (*SignMessageResp, error) { - out := new(SignMessageResp) - err := c.cc.Invoke(ctx, "/signrpc.Signer/SignMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *signerClient) VerifyMessage(ctx context.Context, in *VerifyMessageReq, opts ...grpc.CallOption) (*VerifyMessageResp, error) { - out := new(VerifyMessageResp) - err := c.cc.Invoke(ctx, "/signrpc.Signer/VerifyMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *signerClient) DeriveSharedKey(ctx context.Context, in *SharedKeyRequest, opts ...grpc.CallOption) (*SharedKeyResponse, error) { - out := new(SharedKeyResponse) - err := c.cc.Invoke(ctx, "/signrpc.Signer/DeriveSharedKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SignerServer is the server API for Signer service. -type SignerServer interface { - // - //SignOutputRaw is a method that can be used to generated a signature for a - //set of inputs/outputs to a transaction. Each request specifies details - //concerning how the outputs should be signed, which keys they should be - //signed with, and also any optional tweaks. The return value is a fixed - //64-byte signature (the same format as we use on the wire in Lightning). - // - //If we are unable to sign using the specified keys, then an error will be - //returned. - SignOutputRaw(context.Context, *SignReq) (*SignResp, error) - // - //ComputeInputScript generates a complete InputIndex for the passed - //transaction with the signature as defined within the passed SignDescriptor. - //This method should be capable of generating the proper input script for - //both regular p2wkh output and p2wkh outputs nested within a regular p2sh - //output. - // - //Note that when using this method to sign inputs belonging to the wallet, - //the only items of the SignDescriptor that need to be populated are pkScript - //in the TxOut field, the value in that same field, and finally the input - //index. - ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error) - // - //SignMessage signs a message with the key specified in the key locator. The - //returned signature is fixed-size LN wire format encoded. - // - //The main difference to SignMessage in the main RPC is that a specific key is - //used to sign the message instead of the node identity private key. - SignMessage(context.Context, *SignMessageReq) (*SignMessageResp, error) - // - //VerifyMessage verifies a signature over a message using the public key - //provided. The signature must be fixed-size LN wire format encoded. - // - //The main difference to VerifyMessage in the main RPC is that the public key - //used to sign the message does not have to be a node known to the network. - VerifyMessage(context.Context, *VerifyMessageReq) (*VerifyMessageResp, error) - // - //DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key - //derivation between the ephemeral public key in the request and the node's - //key specified in the key_desc parameter. Either a key locator or a raw - //public key is expected in the key_desc, if neither is supplied, defaults to - //the node's identity private key: - //P_shared = privKeyNode * ephemeralPubkey - //The resulting shared public key is serialized in the compressed format and - //hashed with sha256, resulting in the final key length of 256bit. - DeriveSharedKey(context.Context, *SharedKeyRequest) (*SharedKeyResponse, error) -} - -// UnimplementedSignerServer can be embedded to have forward compatible implementations. -type UnimplementedSignerServer struct { -} - -func (*UnimplementedSignerServer) SignOutputRaw(context.Context, *SignReq) (*SignResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SignOutputRaw not implemented") -} -func (*UnimplementedSignerServer) ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ComputeInputScript not implemented") -} -func (*UnimplementedSignerServer) SignMessage(context.Context, *SignMessageReq) (*SignMessageResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SignMessage not implemented") -} -func (*UnimplementedSignerServer) VerifyMessage(context.Context, *VerifyMessageReq) (*VerifyMessageResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyMessage not implemented") -} -func (*UnimplementedSignerServer) DeriveSharedKey(context.Context, *SharedKeyRequest) (*SharedKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeriveSharedKey not implemented") -} - -func RegisterSignerServer(s *grpc.Server, srv SignerServer) { - s.RegisterService(&_Signer_serviceDesc, srv) -} - -func _Signer_SignOutputRaw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SignerServer).SignOutputRaw(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/signrpc.Signer/SignOutputRaw", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SignerServer).SignOutputRaw(ctx, req.(*SignReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Signer_ComputeInputScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SignerServer).ComputeInputScript(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/signrpc.Signer/ComputeInputScript", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SignerServer).ComputeInputScript(ctx, req.(*SignReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Signer_SignMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignMessageReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SignerServer).SignMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/signrpc.Signer/SignMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SignerServer).SignMessage(ctx, req.(*SignMessageReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Signer_VerifyMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyMessageReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SignerServer).VerifyMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/signrpc.Signer/VerifyMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SignerServer).VerifyMessage(ctx, req.(*VerifyMessageReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Signer_DeriveSharedKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SharedKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SignerServer).DeriveSharedKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/signrpc.Signer/DeriveSharedKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SignerServer).DeriveSharedKey(ctx, req.(*SharedKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Signer_serviceDesc = grpc.ServiceDesc{ - ServiceName: "signrpc.Signer", - HandlerType: (*SignerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SignOutputRaw", - Handler: _Signer_SignOutputRaw_Handler, - }, - { - MethodName: "ComputeInputScript", - Handler: _Signer_ComputeInputScript_Handler, - }, - { - MethodName: "SignMessage", - Handler: _Signer_SignMessage_Handler, - }, - { - MethodName: "VerifyMessage", - Handler: _Signer_VerifyMessage_Handler, - }, - { - MethodName: "DeriveSharedKey", - Handler: _Signer_DeriveSharedKey_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "signrpc/signer.proto", -} diff --git a/lnrpc/signrpc/signer.pb.gw.go b/lnrpc/signrpc/signer.pb.gw.go index 0247c1a04..9e9715917 100644 --- a/lnrpc/signrpc/signer.pb.gw.go +++ b/lnrpc/signrpc/signer.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Signer_SignOutputRaw_0(ctx context.Context, marshaler runtime.Marshaler, client SignerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq SignReq @@ -204,18 +204,22 @@ func local_request_Signer_DeriveSharedKey_0(ctx context.Context, marshaler runti // RegisterSignerHandlerServer registers the http handlers for service Signer to "mux". // UnaryRPC :call SignerServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSignerHandlerFromEndpoint instead. func RegisterSignerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SignerServer) error { mux.Handle("POST", pattern_Signer_SignOutputRaw_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/signrpc.Signer/SignOutputRaw", runtime.WithHTTPPathPattern("/v2/signer/signraw")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Signer_SignOutputRaw_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -229,13 +233,16 @@ func RegisterSignerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Signer_ComputeInputScript_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/signrpc.Signer/ComputeInputScript", runtime.WithHTTPPathPattern("/v2/signer/inputscript")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Signer_ComputeInputScript_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -249,13 +256,16 @@ func RegisterSignerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Signer_SignMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/signrpc.Signer/SignMessage", runtime.WithHTTPPathPattern("/v2/signer/signmessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Signer_SignMessage_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -269,13 +279,16 @@ func RegisterSignerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Signer_VerifyMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/signrpc.Signer/VerifyMessage", runtime.WithHTTPPathPattern("/v2/signer/verifymessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Signer_VerifyMessage_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -289,13 +302,16 @@ func RegisterSignerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser mux.Handle("POST", pattern_Signer_DeriveSharedKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/signrpc.Signer/DeriveSharedKey", runtime.WithHTTPPathPattern("/v2/signer/sharedkey")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Signer_DeriveSharedKey_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -351,7 +367,7 @@ func RegisterSignerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/signrpc.Signer/SignOutputRaw", runtime.WithHTTPPathPattern("/v2/signer/signraw")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -371,7 +387,7 @@ func RegisterSignerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/signrpc.Signer/ComputeInputScript", runtime.WithHTTPPathPattern("/v2/signer/inputscript")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -391,7 +407,7 @@ func RegisterSignerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/signrpc.Signer/SignMessage", runtime.WithHTTPPathPattern("/v2/signer/signmessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -411,7 +427,7 @@ func RegisterSignerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/signrpc.Signer/VerifyMessage", runtime.WithHTTPPathPattern("/v2/signer/verifymessage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -431,7 +447,7 @@ func RegisterSignerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/signrpc.Signer/DeriveSharedKey", runtime.WithHTTPPathPattern("/v2/signer/sharedkey")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -451,15 +467,15 @@ func RegisterSignerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli } var ( - pattern_Signer_SignOutputRaw_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "signraw"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Signer_SignOutputRaw_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "signraw"}, "")) - pattern_Signer_ComputeInputScript_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "inputscript"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Signer_ComputeInputScript_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "inputscript"}, "")) - pattern_Signer_SignMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "signmessage"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Signer_SignMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "signmessage"}, "")) - pattern_Signer_VerifyMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "verifymessage"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Signer_VerifyMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "verifymessage"}, "")) - pattern_Signer_DeriveSharedKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "sharedkey"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Signer_DeriveSharedKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "signer", "sharedkey"}, "")) ) var ( diff --git a/lnrpc/signrpc/signer.swagger.json b/lnrpc/signrpc/signer.swagger.json index e539204f9..fbe8d8a85 100644 --- a/lnrpc/signrpc/signer.swagger.json +++ b/lnrpc/signrpc/signer.swagger.json @@ -4,6 +4,11 @@ "title": "signrpc/signer.proto", "version": "version not set" }, + "tags": [ + { + "name": "Signer" + } + ], "consumes": [ "application/json" ], @@ -15,7 +20,7 @@ "post": { "summary": "ComputeInputScript generates a complete InputIndex for the passed\ntransaction with the signature as defined within the passed SignDescriptor.\nThis method should be capable of generating the proper input script for\nboth regular p2wkh output and p2wkh outputs nested within a regular p2sh\noutput.", "description": "Note that when using this method to sign inputs belonging to the wallet,\nthe only items of the SignDescriptor that need to be populated are pkScript\nin the TxOut field, the value in that same field, and finally the input\nindex.", - "operationId": "ComputeInputScript", + "operationId": "Signer_ComputeInputScript", "responses": { "200": { "description": "A successful response.", @@ -24,9 +29,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -48,7 +53,7 @@ "/v2/signer/sharedkey": { "post": { "summary": "DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key\nderivation between the ephemeral public key in the request and the node's\nkey specified in the key_desc parameter. Either a key locator or a raw\npublic key is expected in the key_desc, if neither is supplied, defaults to\nthe node's identity private key:\nP_shared = privKeyNode * ephemeralPubkey\nThe resulting shared public key is serialized in the compressed format and\nhashed with sha256, resulting in the final key length of 256bit.", - "operationId": "DeriveSharedKey", + "operationId": "Signer_DeriveSharedKey", "responses": { "200": { "description": "A successful response.", @@ -57,9 +62,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -82,7 +87,7 @@ "post": { "summary": "SignMessage signs a message with the key specified in the key locator. The\nreturned signature is fixed-size LN wire format encoded.", "description": "The main difference to SignMessage in the main RPC is that a specific key is\nused to sign the message instead of the node identity private key.", - "operationId": "SignMessage", + "operationId": "Signer_SignMessage", "responses": { "200": { "description": "A successful response.", @@ -91,9 +96,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -116,7 +121,7 @@ "post": { "summary": "SignOutputRaw is a method that can be used to generated a signature for a\nset of inputs/outputs to a transaction. Each request specifies details\nconcerning how the outputs should be signed, which keys they should be\nsigned with, and also any optional tweaks. The return value is a fixed\n64-byte signature (the same format as we use on the wire in Lightning).", "description": "If we are unable to sign using the specified keys, then an error will be\nreturned.", - "operationId": "SignOutputRaw", + "operationId": "Signer_SignOutputRaw", "responses": { "200": { "description": "A successful response.", @@ -125,9 +130,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -150,7 +155,7 @@ "post": { "summary": "VerifyMessage verifies a signature over a message using the public key\nprovided. The signature must be fixed-size LN wire format encoded.", "description": "The main difference to VerifyMessage in the main RPC is that the public key\nused to sign the message does not have to be a node known to the network.", - "operationId": "VerifyMessage", + "operationId": "Signer_VerifyMessage", "responses": { "200": { "description": "A successful response.", @@ -159,9 +164,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -194,12 +199,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -435,7 +437,6 @@ "properties": { "valid": { "type": "boolean", - "format": "boolean", "description": "Whether the signature was valid over the given message." } } diff --git a/lnrpc/signrpc/signer_grpc.pb.go b/lnrpc/signrpc/signer_grpc.pb.go new file mode 100644 index 000000000..4a6724fff --- /dev/null +++ b/lnrpc/signrpc/signer_grpc.pb.go @@ -0,0 +1,327 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package signrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// SignerClient is the client API for Signer service. +// +// 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 SignerClient interface { + // + //SignOutputRaw is a method that can be used to generated a signature for a + //set of inputs/outputs to a transaction. Each request specifies details + //concerning how the outputs should be signed, which keys they should be + //signed with, and also any optional tweaks. The return value is a fixed + //64-byte signature (the same format as we use on the wire in Lightning). + // + //If we are unable to sign using the specified keys, then an error will be + //returned. + SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error) + // + //ComputeInputScript generates a complete InputIndex for the passed + //transaction with the signature as defined within the passed SignDescriptor. + //This method should be capable of generating the proper input script for + //both regular p2wkh output and p2wkh outputs nested within a regular p2sh + //output. + // + //Note that when using this method to sign inputs belonging to the wallet, + //the only items of the SignDescriptor that need to be populated are pkScript + //in the TxOut field, the value in that same field, and finally the input + //index. + ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error) + // + //SignMessage signs a message with the key specified in the key locator. The + //returned signature is fixed-size LN wire format encoded. + // + //The main difference to SignMessage in the main RPC is that a specific key is + //used to sign the message instead of the node identity private key. + SignMessage(ctx context.Context, in *SignMessageReq, opts ...grpc.CallOption) (*SignMessageResp, error) + // + //VerifyMessage verifies a signature over a message using the public key + //provided. The signature must be fixed-size LN wire format encoded. + // + //The main difference to VerifyMessage in the main RPC is that the public key + //used to sign the message does not have to be a node known to the network. + VerifyMessage(ctx context.Context, in *VerifyMessageReq, opts ...grpc.CallOption) (*VerifyMessageResp, error) + // + //DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key + //derivation between the ephemeral public key in the request and the node's + //key specified in the key_desc parameter. Either a key locator or a raw + //public key is expected in the key_desc, if neither is supplied, defaults to + //the node's identity private key: + //P_shared = privKeyNode * ephemeralPubkey + //The resulting shared public key is serialized in the compressed format and + //hashed with sha256, resulting in the final key length of 256bit. + DeriveSharedKey(ctx context.Context, in *SharedKeyRequest, opts ...grpc.CallOption) (*SharedKeyResponse, error) +} + +type signerClient struct { + cc grpc.ClientConnInterface +} + +func NewSignerClient(cc grpc.ClientConnInterface) SignerClient { + return &signerClient{cc} +} + +func (c *signerClient) SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error) { + out := new(SignResp) + err := c.cc.Invoke(ctx, "/signrpc.Signer/SignOutputRaw", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *signerClient) ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error) { + out := new(InputScriptResp) + err := c.cc.Invoke(ctx, "/signrpc.Signer/ComputeInputScript", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *signerClient) SignMessage(ctx context.Context, in *SignMessageReq, opts ...grpc.CallOption) (*SignMessageResp, error) { + out := new(SignMessageResp) + err := c.cc.Invoke(ctx, "/signrpc.Signer/SignMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *signerClient) VerifyMessage(ctx context.Context, in *VerifyMessageReq, opts ...grpc.CallOption) (*VerifyMessageResp, error) { + out := new(VerifyMessageResp) + err := c.cc.Invoke(ctx, "/signrpc.Signer/VerifyMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *signerClient) DeriveSharedKey(ctx context.Context, in *SharedKeyRequest, opts ...grpc.CallOption) (*SharedKeyResponse, error) { + out := new(SharedKeyResponse) + err := c.cc.Invoke(ctx, "/signrpc.Signer/DeriveSharedKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SignerServer is the server API for Signer service. +// All implementations must embed UnimplementedSignerServer +// for forward compatibility +type SignerServer interface { + // + //SignOutputRaw is a method that can be used to generated a signature for a + //set of inputs/outputs to a transaction. Each request specifies details + //concerning how the outputs should be signed, which keys they should be + //signed with, and also any optional tweaks. The return value is a fixed + //64-byte signature (the same format as we use on the wire in Lightning). + // + //If we are unable to sign using the specified keys, then an error will be + //returned. + SignOutputRaw(context.Context, *SignReq) (*SignResp, error) + // + //ComputeInputScript generates a complete InputIndex for the passed + //transaction with the signature as defined within the passed SignDescriptor. + //This method should be capable of generating the proper input script for + //both regular p2wkh output and p2wkh outputs nested within a regular p2sh + //output. + // + //Note that when using this method to sign inputs belonging to the wallet, + //the only items of the SignDescriptor that need to be populated are pkScript + //in the TxOut field, the value in that same field, and finally the input + //index. + ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error) + // + //SignMessage signs a message with the key specified in the key locator. The + //returned signature is fixed-size LN wire format encoded. + // + //The main difference to SignMessage in the main RPC is that a specific key is + //used to sign the message instead of the node identity private key. + SignMessage(context.Context, *SignMessageReq) (*SignMessageResp, error) + // + //VerifyMessage verifies a signature over a message using the public key + //provided. The signature must be fixed-size LN wire format encoded. + // + //The main difference to VerifyMessage in the main RPC is that the public key + //used to sign the message does not have to be a node known to the network. + VerifyMessage(context.Context, *VerifyMessageReq) (*VerifyMessageResp, error) + // + //DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key + //derivation between the ephemeral public key in the request and the node's + //key specified in the key_desc parameter. Either a key locator or a raw + //public key is expected in the key_desc, if neither is supplied, defaults to + //the node's identity private key: + //P_shared = privKeyNode * ephemeralPubkey + //The resulting shared public key is serialized in the compressed format and + //hashed with sha256, resulting in the final key length of 256bit. + DeriveSharedKey(context.Context, *SharedKeyRequest) (*SharedKeyResponse, error) + mustEmbedUnimplementedSignerServer() +} + +// UnimplementedSignerServer must be embedded to have forward compatible implementations. +type UnimplementedSignerServer struct { +} + +func (UnimplementedSignerServer) SignOutputRaw(context.Context, *SignReq) (*SignResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignOutputRaw not implemented") +} +func (UnimplementedSignerServer) ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ComputeInputScript not implemented") +} +func (UnimplementedSignerServer) SignMessage(context.Context, *SignMessageReq) (*SignMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignMessage not implemented") +} +func (UnimplementedSignerServer) VerifyMessage(context.Context, *VerifyMessageReq) (*VerifyMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyMessage not implemented") +} +func (UnimplementedSignerServer) DeriveSharedKey(context.Context, *SharedKeyRequest) (*SharedKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeriveSharedKey not implemented") +} +func (UnimplementedSignerServer) mustEmbedUnimplementedSignerServer() {} + +// UnsafeSignerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SignerServer will +// result in compilation errors. +type UnsafeSignerServer interface { + mustEmbedUnimplementedSignerServer() +} + +func RegisterSignerServer(s grpc.ServiceRegistrar, srv SignerServer) { + s.RegisterService(&Signer_ServiceDesc, srv) +} + +func _Signer_SignOutputRaw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SignerServer).SignOutputRaw(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/signrpc.Signer/SignOutputRaw", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SignerServer).SignOutputRaw(ctx, req.(*SignReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Signer_ComputeInputScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SignerServer).ComputeInputScript(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/signrpc.Signer/ComputeInputScript", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SignerServer).ComputeInputScript(ctx, req.(*SignReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Signer_SignMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SignerServer).SignMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/signrpc.Signer/SignMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SignerServer).SignMessage(ctx, req.(*SignMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Signer_VerifyMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SignerServer).VerifyMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/signrpc.Signer/VerifyMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SignerServer).VerifyMessage(ctx, req.(*VerifyMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Signer_DeriveSharedKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SharedKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SignerServer).DeriveSharedKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/signrpc.Signer/DeriveSharedKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SignerServer).DeriveSharedKey(ctx, req.(*SharedKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Signer_ServiceDesc is the grpc.ServiceDesc for Signer service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Signer_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "signrpc.Signer", + HandlerType: (*SignerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SignOutputRaw", + Handler: _Signer_SignOutputRaw_Handler, + }, + { + MethodName: "ComputeInputScript", + Handler: _Signer_ComputeInputScript_Handler, + }, + { + MethodName: "SignMessage", + Handler: _Signer_SignMessage_Handler, + }, + { + MethodName: "VerifyMessage", + Handler: _Signer_VerifyMessage_Handler, + }, + { + MethodName: "DeriveSharedKey", + Handler: _Signer_DeriveSharedKey_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "signrpc/signer.proto", +} diff --git a/lnrpc/signrpc/signer_server.go b/lnrpc/signrpc/signer_server.go index c48c36e1e..2eefdd48e 100644 --- a/lnrpc/signrpc/signer_server.go +++ b/lnrpc/signrpc/signer_server.go @@ -14,7 +14,7 @@ import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/lnrpc" @@ -88,6 +88,9 @@ type ServerShell struct { // lnd. This allows callers to create custom protocols, external to lnd, even // backed by multiple distinct lnd across independent failure domains. type Server struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedSignerServer + cfg *Config } diff --git a/lnrpc/stateservice.pb.go b/lnrpc/stateservice.pb.go index 46dcfbc3e..79376fdb5 100644 --- a/lnrpc/stateservice.pb.go +++ b/lnrpc/stateservice.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: stateservice.proto package lnrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type WalletState int32 const ( @@ -401,155 +392,3 @@ func file_stateservice_proto_init() { file_stateservice_proto_goTypes = nil file_stateservice_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// StateClient is the client API for State service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StateClient interface { - // SubscribeState subscribes to the state of the wallet. The current wallet - // state will always be delivered immediately. - SubscribeState(ctx context.Context, in *SubscribeStateRequest, opts ...grpc.CallOption) (State_SubscribeStateClient, error) - // GetState returns the current wallet state without streaming further - // changes. - GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) -} - -type stateClient struct { - cc grpc.ClientConnInterface -} - -func NewStateClient(cc grpc.ClientConnInterface) StateClient { - return &stateClient{cc} -} - -func (c *stateClient) SubscribeState(ctx context.Context, in *SubscribeStateRequest, opts ...grpc.CallOption) (State_SubscribeStateClient, error) { - stream, err := c.cc.NewStream(ctx, &_State_serviceDesc.Streams[0], "/lnrpc.State/SubscribeState", opts...) - if err != nil { - return nil, err - } - x := &stateSubscribeStateClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type State_SubscribeStateClient interface { - Recv() (*SubscribeStateResponse, error) - grpc.ClientStream -} - -type stateSubscribeStateClient struct { - grpc.ClientStream -} - -func (x *stateSubscribeStateClient) Recv() (*SubscribeStateResponse, error) { - m := new(SubscribeStateResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *stateClient) GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) { - out := new(GetStateResponse) - err := c.cc.Invoke(ctx, "/lnrpc.State/GetState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StateServer is the server API for State service. -type StateServer interface { - // SubscribeState subscribes to the state of the wallet. The current wallet - // state will always be delivered immediately. - SubscribeState(*SubscribeStateRequest, State_SubscribeStateServer) error - // GetState returns the current wallet state without streaming further - // changes. - GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) -} - -// UnimplementedStateServer can be embedded to have forward compatible implementations. -type UnimplementedStateServer struct { -} - -func (*UnimplementedStateServer) SubscribeState(*SubscribeStateRequest, State_SubscribeStateServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeState not implemented") -} -func (*UnimplementedStateServer) GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented") -} - -func RegisterStateServer(s *grpc.Server, srv StateServer) { - s.RegisterService(&_State_serviceDesc, srv) -} - -func _State_SubscribeState_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeStateRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StateServer).SubscribeState(m, &stateSubscribeStateServer{stream}) -} - -type State_SubscribeStateServer interface { - Send(*SubscribeStateResponse) error - grpc.ServerStream -} - -type stateSubscribeStateServer struct { - grpc.ServerStream -} - -func (x *stateSubscribeStateServer) Send(m *SubscribeStateResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _State_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StateServer).GetState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.State/GetState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StateServer).GetState(ctx, req.(*GetStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _State_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lnrpc.State", - HandlerType: (*StateServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetState", - Handler: _State_GetState_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SubscribeState", - Handler: _State_SubscribeState_Handler, - ServerStreams: true, - }, - }, - Metadata: "stateservice.proto", -} diff --git a/lnrpc/stateservice.pb.gw.go b/lnrpc/stateservice.pb.gw.go index a017ca540..4bc2bb8ad 100644 --- a/lnrpc/stateservice.pb.gw.go +++ b/lnrpc/stateservice.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_State_SubscribeState_0(ctx context.Context, marshaler runtime.Marshaler, client StateClient, req *http.Request, pathParams map[string]string) (State_SubscribeStateClient, runtime.ServerMetadata, error) { var protoReq SubscribeStateRequest @@ -69,6 +69,7 @@ func local_request_State_GetState_0(ctx context.Context, marshaler runtime.Marsh // RegisterStateHandlerServer registers the http handlers for service State to "mux". // UnaryRPC :call StateServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterStateHandlerFromEndpoint instead. func RegisterStateHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StateServer) error { mux.Handle("GET", pattern_State_SubscribeState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -81,13 +82,16 @@ func RegisterStateHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_State_GetState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.State/GetState", runtime.WithHTTPPathPattern("/v1/state")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_State_GetState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -143,7 +147,7 @@ func RegisterStateHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.State/SubscribeState", runtime.WithHTTPPathPattern("/v1/state/subscribe")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -163,7 +167,7 @@ func RegisterStateHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.State/GetState", runtime.WithHTTPPathPattern("/v1/state")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -183,9 +187,9 @@ func RegisterStateHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_State_SubscribeState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "state", "subscribe"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_State_SubscribeState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "state", "subscribe"}, "")) - pattern_State_GetState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "state"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_State_GetState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "state"}, "")) ) var ( diff --git a/lnrpc/stateservice.swagger.json b/lnrpc/stateservice.swagger.json index 36e28c7ce..2716d244a 100644 --- a/lnrpc/stateservice.swagger.json +++ b/lnrpc/stateservice.swagger.json @@ -4,6 +4,11 @@ "title": "stateservice.proto", "version": "version not set" }, + "tags": [ + { + "name": "State" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v1/state": { "get": { "summary": "GetState returns the current wallet state without streaming further\nchanges.", - "operationId": "GetState", + "operationId": "State_GetState", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -37,7 +42,7 @@ "/v1/state/subscribe": { "get": { "summary": "SubscribeState subscribes to the state of the wallet. The current wallet\nstate will always be delivered immediately.", - "operationId": "SubscribeState", + "operationId": "State_SubscribeState", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -48,16 +53,16 @@ "$ref": "#/definitions/lnrpcSubscribeStateResponse" }, "error": { - "$ref": "#/definitions/runtimeStreamError" + "$ref": "#/definitions/rpcStatus" } }, "title": "Stream result of lnrpcSubscribeStateResponse" } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -107,12 +112,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -127,31 +129,6 @@ } } } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpc_code": { - "type": "integer", - "format": "int32" - }, - "http_code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "http_status": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } } } } diff --git a/lnrpc/stateservice_grpc.pb.go b/lnrpc/stateservice_grpc.pb.go new file mode 100644 index 000000000..dcbb3d468 --- /dev/null +++ b/lnrpc/stateservice_grpc.pb.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package lnrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StateClient is the client API for State service. +// +// 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 StateClient interface { + // SubscribeState subscribes to the state of the wallet. The current wallet + // state will always be delivered immediately. + SubscribeState(ctx context.Context, in *SubscribeStateRequest, opts ...grpc.CallOption) (State_SubscribeStateClient, error) + // GetState returns the current wallet state without streaming further + // changes. + GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) +} + +type stateClient struct { + cc grpc.ClientConnInterface +} + +func NewStateClient(cc grpc.ClientConnInterface) StateClient { + return &stateClient{cc} +} + +func (c *stateClient) SubscribeState(ctx context.Context, in *SubscribeStateRequest, opts ...grpc.CallOption) (State_SubscribeStateClient, error) { + stream, err := c.cc.NewStream(ctx, &State_ServiceDesc.Streams[0], "/lnrpc.State/SubscribeState", opts...) + if err != nil { + return nil, err + } + x := &stateSubscribeStateClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type State_SubscribeStateClient interface { + Recv() (*SubscribeStateResponse, error) + grpc.ClientStream +} + +type stateSubscribeStateClient struct { + grpc.ClientStream +} + +func (x *stateSubscribeStateClient) Recv() (*SubscribeStateResponse, error) { + m := new(SubscribeStateResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *stateClient) GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) { + out := new(GetStateResponse) + err := c.cc.Invoke(ctx, "/lnrpc.State/GetState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StateServer is the server API for State service. +// All implementations must embed UnimplementedStateServer +// for forward compatibility +type StateServer interface { + // SubscribeState subscribes to the state of the wallet. The current wallet + // state will always be delivered immediately. + SubscribeState(*SubscribeStateRequest, State_SubscribeStateServer) error + // GetState returns the current wallet state without streaming further + // changes. + GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) + mustEmbedUnimplementedStateServer() +} + +// UnimplementedStateServer must be embedded to have forward compatible implementations. +type UnimplementedStateServer struct { +} + +func (UnimplementedStateServer) SubscribeState(*SubscribeStateRequest, State_SubscribeStateServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeState not implemented") +} +func (UnimplementedStateServer) GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented") +} +func (UnimplementedStateServer) mustEmbedUnimplementedStateServer() {} + +// UnsafeStateServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StateServer will +// result in compilation errors. +type UnsafeStateServer interface { + mustEmbedUnimplementedStateServer() +} + +func RegisterStateServer(s grpc.ServiceRegistrar, srv StateServer) { + s.RegisterService(&State_ServiceDesc, srv) +} + +func _State_SubscribeState_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeStateRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StateServer).SubscribeState(m, &stateSubscribeStateServer{stream}) +} + +type State_SubscribeStateServer interface { + Send(*SubscribeStateResponse) error + grpc.ServerStream +} + +type stateSubscribeStateServer struct { + grpc.ServerStream +} + +func (x *stateSubscribeStateServer) Send(m *SubscribeStateResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _State_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateServer).GetState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.State/GetState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateServer).GetState(ctx, req.(*GetStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// State_ServiceDesc is the grpc.ServiceDesc for State service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var State_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "lnrpc.State", + HandlerType: (*StateServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetState", + Handler: _State_GetState_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeState", + Handler: _State_SubscribeState_Handler, + ServerStreams: true, + }, + }, + Metadata: "stateservice.proto", +} diff --git a/lnrpc/sub_server.go b/lnrpc/sub_server.go index 23033abbe..b09828213 100644 --- a/lnrpc/sub_server.go +++ b/lnrpc/sub_server.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "google.golang.org/grpc" "gopkg.in/macaroon-bakery.v2/bakery" ) diff --git a/lnrpc/verrpc/server.go b/lnrpc/verrpc/server.go index 31c348990..a68e87c53 100644 --- a/lnrpc/verrpc/server.go +++ b/lnrpc/verrpc/server.go @@ -3,7 +3,7 @@ package verrpc import ( "context" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/lnrpc" "google.golang.org/grpc" @@ -28,7 +28,10 @@ type ServerShell struct { // Server is an rpc server that supports querying for information about the // running binary. -type Server struct{} +type Server struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedVersionerServer +} // Start launches any helper goroutines required for the rpcServer to function. // diff --git a/lnrpc/verrpc/verrpc.pb.go b/lnrpc/verrpc/verrpc.pb.go index 824b15fcb..27ed490b2 100644 --- a/lnrpc/verrpc/verrpc.pb.go +++ b/lnrpc/verrpc/verrpc.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: verrpc/verrpc.proto package verrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type VersionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -298,89 +289,3 @@ func file_verrpc_verrpc_proto_init() { file_verrpc_verrpc_proto_goTypes = nil file_verrpc_verrpc_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// VersionerClient is the client API for Versioner service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type VersionerClient interface { - // lncli: `version` - //GetVersion returns the current version and build information of the running - //daemon. - GetVersion(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*Version, error) -} - -type versionerClient struct { - cc grpc.ClientConnInterface -} - -func NewVersionerClient(cc grpc.ClientConnInterface) VersionerClient { - return &versionerClient{cc} -} - -func (c *versionerClient) GetVersion(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*Version, error) { - out := new(Version) - err := c.cc.Invoke(ctx, "/verrpc.Versioner/GetVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// VersionerServer is the server API for Versioner service. -type VersionerServer interface { - // lncli: `version` - //GetVersion returns the current version and build information of the running - //daemon. - GetVersion(context.Context, *VersionRequest) (*Version, error) -} - -// UnimplementedVersionerServer can be embedded to have forward compatible implementations. -type UnimplementedVersionerServer struct { -} - -func (*UnimplementedVersionerServer) GetVersion(context.Context, *VersionRequest) (*Version, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") -} - -func RegisterVersionerServer(s *grpc.Server, srv VersionerServer) { - s.RegisterService(&_Versioner_serviceDesc, srv) -} - -func _Versioner_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VersionerServer).GetVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/verrpc.Versioner/GetVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VersionerServer).GetVersion(ctx, req.(*VersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Versioner_serviceDesc = grpc.ServiceDesc{ - ServiceName: "verrpc.Versioner", - HandlerType: (*VersionerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetVersion", - Handler: _Versioner_GetVersion_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "verrpc/verrpc.proto", -} diff --git a/lnrpc/verrpc/verrpc.pb.gw.go b/lnrpc/verrpc/verrpc.pb.gw.go index d6f6d5970..eff559f3a 100644 --- a/lnrpc/verrpc/verrpc.pb.gw.go +++ b/lnrpc/verrpc/verrpc.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Versioner_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, client VersionerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq VersionRequest @@ -52,18 +52,22 @@ func local_request_Versioner_GetVersion_0(ctx context.Context, marshaler runtime // RegisterVersionerHandlerServer registers the http handlers for service Versioner to "mux". // UnaryRPC :call VersionerServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterVersionerHandlerFromEndpoint instead. func RegisterVersionerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VersionerServer) error { mux.Handle("GET", pattern_Versioner_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/verrpc.Versioner/GetVersion", runtime.WithHTTPPathPattern("/v2/versioner/version")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Versioner_GetVersion_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -119,7 +123,7 @@ func RegisterVersionerHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/verrpc.Versioner/GetVersion", runtime.WithHTTPPathPattern("/v2/versioner/version")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -139,7 +143,7 @@ func RegisterVersionerHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_Versioner_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "versioner", "version"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Versioner_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "versioner", "version"}, "")) ) var ( diff --git a/lnrpc/verrpc/verrpc.swagger.json b/lnrpc/verrpc/verrpc.swagger.json index 67271dea6..df33753ba 100644 --- a/lnrpc/verrpc/verrpc.swagger.json +++ b/lnrpc/verrpc/verrpc.swagger.json @@ -4,6 +4,11 @@ "title": "verrpc/verrpc.proto", "version": "version not set" }, + "tags": [ + { + "name": "Versioner" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/versioner/version": { "get": { "summary": "lncli: `version`\nGetVersion returns the current version and build information of the running\ndaemon.", - "operationId": "GetVersion", + "operationId": "Versioner_GetVersion", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -48,12 +53,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" diff --git a/lnrpc/verrpc/verrpc_grpc.pb.go b/lnrpc/verrpc/verrpc_grpc.pb.go new file mode 100644 index 000000000..acb077236 --- /dev/null +++ b/lnrpc/verrpc/verrpc_grpc.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package verrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// VersionerClient is the client API for Versioner service. +// +// 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 VersionerClient interface { + // lncli: `version` + //GetVersion returns the current version and build information of the running + //daemon. + GetVersion(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*Version, error) +} + +type versionerClient struct { + cc grpc.ClientConnInterface +} + +func NewVersionerClient(cc grpc.ClientConnInterface) VersionerClient { + return &versionerClient{cc} +} + +func (c *versionerClient) GetVersion(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*Version, error) { + out := new(Version) + err := c.cc.Invoke(ctx, "/verrpc.Versioner/GetVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// VersionerServer is the server API for Versioner service. +// All implementations must embed UnimplementedVersionerServer +// for forward compatibility +type VersionerServer interface { + // lncli: `version` + //GetVersion returns the current version and build information of the running + //daemon. + GetVersion(context.Context, *VersionRequest) (*Version, error) + mustEmbedUnimplementedVersionerServer() +} + +// UnimplementedVersionerServer must be embedded to have forward compatible implementations. +type UnimplementedVersionerServer struct { +} + +func (UnimplementedVersionerServer) GetVersion(context.Context, *VersionRequest) (*Version, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") +} +func (UnimplementedVersionerServer) mustEmbedUnimplementedVersionerServer() {} + +// UnsafeVersionerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to VersionerServer will +// result in compilation errors. +type UnsafeVersionerServer interface { + mustEmbedUnimplementedVersionerServer() +} + +func RegisterVersionerServer(s grpc.ServiceRegistrar, srv VersionerServer) { + s.RegisterService(&Versioner_ServiceDesc, srv) +} + +func _Versioner_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VersionerServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/verrpc.Versioner/GetVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VersionerServer).GetVersion(ctx, req.(*VersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Versioner_ServiceDesc is the grpc.ServiceDesc for Versioner service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Versioner_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "verrpc.Versioner", + HandlerType: (*VersionerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetVersion", + Handler: _Versioner_GetVersion_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "verrpc/verrpc.proto", +} diff --git a/lnrpc/walletrpc/walletkit.pb.go b/lnrpc/walletrpc/walletkit.pb.go index f43c8a698..746b61fc7 100644 --- a/lnrpc/walletrpc/walletkit.pb.go +++ b/lnrpc/walletrpc/walletkit.pb.go @@ -1,19 +1,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: walletrpc/walletkit.proto package walletrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" lnrpc "github.com/lightningnetwork/lnd/lnrpc" signrpc "github.com/lightningnetwork/lnd/lnrpc/signrpc" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -27,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddressType int32 const ( @@ -3852,1023 +3843,3 @@ func file_walletrpc_walletkit_proto_init() { file_walletrpc_walletkit_proto_goTypes = nil file_walletrpc_walletkit_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// WalletKitClient is the client API for WalletKit service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WalletKitClient interface { - // - //ListUnspent returns a list of all utxos spendable by the wallet with a - //number of confirmations between the specified minimum and maximum. - ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) - // - //LeaseOutput locks an output to the given ID, preventing it from being - //available for any future coin selection attempts. The absolute time of the - //lock's expiration is returned. The expiration of the lock can be extended by - //successive invocations of this RPC. Outputs can be unlocked before their - //expiration through `ReleaseOutput`. - LeaseOutput(ctx context.Context, in *LeaseOutputRequest, opts ...grpc.CallOption) (*LeaseOutputResponse, error) - // - //ReleaseOutput unlocks an output, allowing it to be available for coin - //selection if it remains unspent. The ID should match the one used to - //originally lock the output. - ReleaseOutput(ctx context.Context, in *ReleaseOutputRequest, opts ...grpc.CallOption) (*ReleaseOutputResponse, error) - // - //ListLeases lists all currently locked utxos. - ListLeases(ctx context.Context, in *ListLeasesRequest, opts ...grpc.CallOption) (*ListLeasesResponse, error) - // - //DeriveNextKey attempts to derive the *next* key within the key family - //(account in BIP43) specified. This method should return the next external - //child within this branch. - DeriveNextKey(ctx context.Context, in *KeyReq, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) - // - //DeriveKey attempts to derive an arbitrary key specified by the passed - //KeyLocator. - DeriveKey(ctx context.Context, in *signrpc.KeyLocator, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) - // - //NextAddr returns the next unused address within the wallet. - NextAddr(ctx context.Context, in *AddrRequest, opts ...grpc.CallOption) (*AddrResponse, error) - // - //ListAccounts retrieves all accounts belonging to the wallet by default. A - //name and key scope filter can be provided to filter through all of the - //wallet accounts and return only those matching. - ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) - // - //ImportAccount imports an account backed by an account extended public key. - //The master key fingerprint denotes the fingerprint of the root key - //corresponding to the account public key (also known as the key with - //derivation path m/). This may be required by some hardware wallets for - //proper identification and signing. - // - //The address type can usually be inferred from the key's version, but may be - //required for certain keys to map them into the proper scope. - // - //For BIP-0044 keys, an address type must be specified as we intend to not - //support importing BIP-0044 keys into the wallet using the legacy - //pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force - //the standard BIP-0049 derivation scheme, while a witness address type will - //force the standard BIP-0084 derivation scheme. - // - //For BIP-0049 keys, an address type must also be specified to make a - //distinction between the standard BIP-0049 address schema (nested witness - //pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys - //externally, witness pubkeys internally). - // - //NOTE: Events (deposits/spends) for keys derived from an account will only be - //detected by lnd if they happen after the import. Rescans to detect past - //events will be supported later on. - ImportAccount(ctx context.Context, in *ImportAccountRequest, opts ...grpc.CallOption) (*ImportAccountResponse, error) - // - //ImportPublicKey imports a public key as watch-only into the wallet. - // - //NOTE: Events (deposits/spends) for a key will only be detected by lnd if - //they happen after the import. Rescans to detect past events will be - //supported later on. - ImportPublicKey(ctx context.Context, in *ImportPublicKeyRequest, opts ...grpc.CallOption) (*ImportPublicKeyResponse, error) - // - //PublishTransaction attempts to publish the passed transaction to the - //network. Once this returns without an error, the wallet will continually - //attempt to re-broadcast the transaction on start up, until it enters the - //chain. - PublishTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*PublishResponse, error) - // - //SendOutputs is similar to the existing sendmany call in Bitcoind, and - //allows the caller to create a transaction that sends to several outputs at - //once. This is ideal when wanting to batch create a set of transactions. - SendOutputs(ctx context.Context, in *SendOutputsRequest, opts ...grpc.CallOption) (*SendOutputsResponse, error) - // - //EstimateFee attempts to query the internal fee estimator of the wallet to - //determine the fee (in sat/kw) to attach to a transaction in order to - //achieve the confirmation target. - EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) - // - //PendingSweeps returns lists of on-chain outputs that lnd is currently - //attempting to sweep within its central batching engine. Outputs with similar - //fee rates are batched together in order to sweep them within a single - //transaction. - // - //NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to - //remain supported. This is an advanced API that depends on the internals of - //the UtxoSweeper, so things may change. - PendingSweeps(ctx context.Context, in *PendingSweepsRequest, opts ...grpc.CallOption) (*PendingSweepsResponse, error) - // - //BumpFee bumps the fee of an arbitrary input within a transaction. This RPC - //takes a different approach than bitcoind's bumpfee command. lnd has a - //central batching engine in which inputs with similar fee rates are batched - //together to save on transaction fees. Due to this, we cannot rely on - //bumping the fee on a specific transaction, since transactions can change at - //any point with the addition of new inputs. The list of inputs that - //currently exist within lnd's central batching engine can be retrieved - //through the PendingSweeps RPC. - // - //When bumping the fee of an input that currently exists within lnd's central - //batching engine, a higher fee transaction will be created that replaces the - //lower fee transaction through the Replace-By-Fee (RBF) policy. If it - // - //This RPC also serves useful when wanting to perform a Child-Pays-For-Parent - //(CPFP), where the child transaction pays for its parent's fee. This can be - //done by specifying an outpoint within the low fee transaction that is under - //the control of the wallet. - // - //The fee preference can be expressed either as a specific fee rate or a delta - //of blocks in which the output should be swept on-chain within. If a fee - //preference is not explicitly specified, then an error is returned. - // - //Note that this RPC currently doesn't perform any validation checks on the - //fee preference being provided. For now, the responsibility of ensuring that - //the new fee preference is sufficient is delegated to the user. - BumpFee(ctx context.Context, in *BumpFeeRequest, opts ...grpc.CallOption) (*BumpFeeResponse, error) - // - //ListSweeps returns a list of the sweep transactions our node has produced. - //Note that these sweeps may not be confirmed yet, as we record sweeps on - //broadcast, not confirmation. - ListSweeps(ctx context.Context, in *ListSweepsRequest, opts ...grpc.CallOption) (*ListSweepsResponse, error) - // - //LabelTransaction adds a label to a transaction. If the transaction already - //has a label the call will fail unless the overwrite bool is set. This will - //overwrite the exiting transaction label. Labels must not be empty, and - //cannot exceed 500 characters. - LabelTransaction(ctx context.Context, in *LabelTransactionRequest, opts ...grpc.CallOption) (*LabelTransactionResponse, error) - // - //FundPsbt creates a fully populated PSBT that contains enough inputs to fund - //the outputs specified in the template. There are two ways of specifying a - //template: Either by passing in a PSBT with at least one output declared or - //by passing in a raw TxTemplate message. - // - //If there are no inputs specified in the template, coin selection is - //performed automatically. If the template does contain any inputs, it is - //assumed that full coin selection happened externally and no additional - //inputs are added. If the specified inputs aren't enough to fund the outputs - //with the given fee rate, an error is returned. - // - //After either selecting or verifying the inputs, all input UTXOs are locked - //with an internal app ID. - // - //NOTE: If this method returns without an error, it is the caller's - //responsibility to either spend the locked UTXOs (by finalizing and then - //publishing the transaction) or to unlock/release the locked UTXOs in case of - //an error on the caller's side. - FundPsbt(ctx context.Context, in *FundPsbtRequest, opts ...grpc.CallOption) (*FundPsbtResponse, error) - // - //FinalizePsbt expects a partial transaction with all inputs and outputs fully - //declared and tries to sign all inputs that belong to the wallet. Lnd must be - //the last signer of the transaction. That means, if there are any unsigned - //non-witness inputs or inputs without UTXO information attached or inputs - //without witness data that do not belong to lnd's wallet, this method will - //fail. If no error is returned, the PSBT is ready to be extracted and the - //final TX within to be broadcast. - // - //NOTE: This method does NOT publish the transaction once finalized. It is the - //caller's responsibility to either publish the transaction on success or - //unlock/release any locked UTXOs in case of an error in this method. - FinalizePsbt(ctx context.Context, in *FinalizePsbtRequest, opts ...grpc.CallOption) (*FinalizePsbtResponse, error) -} - -type walletKitClient struct { - cc grpc.ClientConnInterface -} - -func NewWalletKitClient(cc grpc.ClientConnInterface) WalletKitClient { - return &walletKitClient{cc} -} - -func (c *walletKitClient) ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) { - out := new(ListUnspentResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListUnspent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) LeaseOutput(ctx context.Context, in *LeaseOutputRequest, opts ...grpc.CallOption) (*LeaseOutputResponse, error) { - out := new(LeaseOutputResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/LeaseOutput", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) ReleaseOutput(ctx context.Context, in *ReleaseOutputRequest, opts ...grpc.CallOption) (*ReleaseOutputResponse, error) { - out := new(ReleaseOutputResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ReleaseOutput", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) ListLeases(ctx context.Context, in *ListLeasesRequest, opts ...grpc.CallOption) (*ListLeasesResponse, error) { - out := new(ListLeasesResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListLeases", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) DeriveNextKey(ctx context.Context, in *KeyReq, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) { - out := new(signrpc.KeyDescriptor) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/DeriveNextKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) DeriveKey(ctx context.Context, in *signrpc.KeyLocator, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) { - out := new(signrpc.KeyDescriptor) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/DeriveKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) NextAddr(ctx context.Context, in *AddrRequest, opts ...grpc.CallOption) (*AddrResponse, error) { - out := new(AddrResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/NextAddr", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) { - out := new(ListAccountsResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListAccounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) ImportAccount(ctx context.Context, in *ImportAccountRequest, opts ...grpc.CallOption) (*ImportAccountResponse, error) { - out := new(ImportAccountResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ImportAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) ImportPublicKey(ctx context.Context, in *ImportPublicKeyRequest, opts ...grpc.CallOption) (*ImportPublicKeyResponse, error) { - out := new(ImportPublicKeyResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ImportPublicKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) PublishTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*PublishResponse, error) { - out := new(PublishResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/PublishTransaction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) SendOutputs(ctx context.Context, in *SendOutputsRequest, opts ...grpc.CallOption) (*SendOutputsResponse, error) { - out := new(SendOutputsResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/SendOutputs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) { - out := new(EstimateFeeResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/EstimateFee", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) PendingSweeps(ctx context.Context, in *PendingSweepsRequest, opts ...grpc.CallOption) (*PendingSweepsResponse, error) { - out := new(PendingSweepsResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/PendingSweeps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) BumpFee(ctx context.Context, in *BumpFeeRequest, opts ...grpc.CallOption) (*BumpFeeResponse, error) { - out := new(BumpFeeResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/BumpFee", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) ListSweeps(ctx context.Context, in *ListSweepsRequest, opts ...grpc.CallOption) (*ListSweepsResponse, error) { - out := new(ListSweepsResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListSweeps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) LabelTransaction(ctx context.Context, in *LabelTransactionRequest, opts ...grpc.CallOption) (*LabelTransactionResponse, error) { - out := new(LabelTransactionResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/LabelTransaction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) FundPsbt(ctx context.Context, in *FundPsbtRequest, opts ...grpc.CallOption) (*FundPsbtResponse, error) { - out := new(FundPsbtResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/FundPsbt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletKitClient) FinalizePsbt(ctx context.Context, in *FinalizePsbtRequest, opts ...grpc.CallOption) (*FinalizePsbtResponse, error) { - out := new(FinalizePsbtResponse) - err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/FinalizePsbt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WalletKitServer is the server API for WalletKit service. -type WalletKitServer interface { - // - //ListUnspent returns a list of all utxos spendable by the wallet with a - //number of confirmations between the specified minimum and maximum. - ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) - // - //LeaseOutput locks an output to the given ID, preventing it from being - //available for any future coin selection attempts. The absolute time of the - //lock's expiration is returned. The expiration of the lock can be extended by - //successive invocations of this RPC. Outputs can be unlocked before their - //expiration through `ReleaseOutput`. - LeaseOutput(context.Context, *LeaseOutputRequest) (*LeaseOutputResponse, error) - // - //ReleaseOutput unlocks an output, allowing it to be available for coin - //selection if it remains unspent. The ID should match the one used to - //originally lock the output. - ReleaseOutput(context.Context, *ReleaseOutputRequest) (*ReleaseOutputResponse, error) - // - //ListLeases lists all currently locked utxos. - ListLeases(context.Context, *ListLeasesRequest) (*ListLeasesResponse, error) - // - //DeriveNextKey attempts to derive the *next* key within the key family - //(account in BIP43) specified. This method should return the next external - //child within this branch. - DeriveNextKey(context.Context, *KeyReq) (*signrpc.KeyDescriptor, error) - // - //DeriveKey attempts to derive an arbitrary key specified by the passed - //KeyLocator. - DeriveKey(context.Context, *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) - // - //NextAddr returns the next unused address within the wallet. - NextAddr(context.Context, *AddrRequest) (*AddrResponse, error) - // - //ListAccounts retrieves all accounts belonging to the wallet by default. A - //name and key scope filter can be provided to filter through all of the - //wallet accounts and return only those matching. - ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) - // - //ImportAccount imports an account backed by an account extended public key. - //The master key fingerprint denotes the fingerprint of the root key - //corresponding to the account public key (also known as the key with - //derivation path m/). This may be required by some hardware wallets for - //proper identification and signing. - // - //The address type can usually be inferred from the key's version, but may be - //required for certain keys to map them into the proper scope. - // - //For BIP-0044 keys, an address type must be specified as we intend to not - //support importing BIP-0044 keys into the wallet using the legacy - //pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force - //the standard BIP-0049 derivation scheme, while a witness address type will - //force the standard BIP-0084 derivation scheme. - // - //For BIP-0049 keys, an address type must also be specified to make a - //distinction between the standard BIP-0049 address schema (nested witness - //pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys - //externally, witness pubkeys internally). - // - //NOTE: Events (deposits/spends) for keys derived from an account will only be - //detected by lnd if they happen after the import. Rescans to detect past - //events will be supported later on. - ImportAccount(context.Context, *ImportAccountRequest) (*ImportAccountResponse, error) - // - //ImportPublicKey imports a public key as watch-only into the wallet. - // - //NOTE: Events (deposits/spends) for a key will only be detected by lnd if - //they happen after the import. Rescans to detect past events will be - //supported later on. - ImportPublicKey(context.Context, *ImportPublicKeyRequest) (*ImportPublicKeyResponse, error) - // - //PublishTransaction attempts to publish the passed transaction to the - //network. Once this returns without an error, the wallet will continually - //attempt to re-broadcast the transaction on start up, until it enters the - //chain. - PublishTransaction(context.Context, *Transaction) (*PublishResponse, error) - // - //SendOutputs is similar to the existing sendmany call in Bitcoind, and - //allows the caller to create a transaction that sends to several outputs at - //once. This is ideal when wanting to batch create a set of transactions. - SendOutputs(context.Context, *SendOutputsRequest) (*SendOutputsResponse, error) - // - //EstimateFee attempts to query the internal fee estimator of the wallet to - //determine the fee (in sat/kw) to attach to a transaction in order to - //achieve the confirmation target. - EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) - // - //PendingSweeps returns lists of on-chain outputs that lnd is currently - //attempting to sweep within its central batching engine. Outputs with similar - //fee rates are batched together in order to sweep them within a single - //transaction. - // - //NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to - //remain supported. This is an advanced API that depends on the internals of - //the UtxoSweeper, so things may change. - PendingSweeps(context.Context, *PendingSweepsRequest) (*PendingSweepsResponse, error) - // - //BumpFee bumps the fee of an arbitrary input within a transaction. This RPC - //takes a different approach than bitcoind's bumpfee command. lnd has a - //central batching engine in which inputs with similar fee rates are batched - //together to save on transaction fees. Due to this, we cannot rely on - //bumping the fee on a specific transaction, since transactions can change at - //any point with the addition of new inputs. The list of inputs that - //currently exist within lnd's central batching engine can be retrieved - //through the PendingSweeps RPC. - // - //When bumping the fee of an input that currently exists within lnd's central - //batching engine, a higher fee transaction will be created that replaces the - //lower fee transaction through the Replace-By-Fee (RBF) policy. If it - // - //This RPC also serves useful when wanting to perform a Child-Pays-For-Parent - //(CPFP), where the child transaction pays for its parent's fee. This can be - //done by specifying an outpoint within the low fee transaction that is under - //the control of the wallet. - // - //The fee preference can be expressed either as a specific fee rate or a delta - //of blocks in which the output should be swept on-chain within. If a fee - //preference is not explicitly specified, then an error is returned. - // - //Note that this RPC currently doesn't perform any validation checks on the - //fee preference being provided. For now, the responsibility of ensuring that - //the new fee preference is sufficient is delegated to the user. - BumpFee(context.Context, *BumpFeeRequest) (*BumpFeeResponse, error) - // - //ListSweeps returns a list of the sweep transactions our node has produced. - //Note that these sweeps may not be confirmed yet, as we record sweeps on - //broadcast, not confirmation. - ListSweeps(context.Context, *ListSweepsRequest) (*ListSweepsResponse, error) - // - //LabelTransaction adds a label to a transaction. If the transaction already - //has a label the call will fail unless the overwrite bool is set. This will - //overwrite the exiting transaction label. Labels must not be empty, and - //cannot exceed 500 characters. - LabelTransaction(context.Context, *LabelTransactionRequest) (*LabelTransactionResponse, error) - // - //FundPsbt creates a fully populated PSBT that contains enough inputs to fund - //the outputs specified in the template. There are two ways of specifying a - //template: Either by passing in a PSBT with at least one output declared or - //by passing in a raw TxTemplate message. - // - //If there are no inputs specified in the template, coin selection is - //performed automatically. If the template does contain any inputs, it is - //assumed that full coin selection happened externally and no additional - //inputs are added. If the specified inputs aren't enough to fund the outputs - //with the given fee rate, an error is returned. - // - //After either selecting or verifying the inputs, all input UTXOs are locked - //with an internal app ID. - // - //NOTE: If this method returns without an error, it is the caller's - //responsibility to either spend the locked UTXOs (by finalizing and then - //publishing the transaction) or to unlock/release the locked UTXOs in case of - //an error on the caller's side. - FundPsbt(context.Context, *FundPsbtRequest) (*FundPsbtResponse, error) - // - //FinalizePsbt expects a partial transaction with all inputs and outputs fully - //declared and tries to sign all inputs that belong to the wallet. Lnd must be - //the last signer of the transaction. That means, if there are any unsigned - //non-witness inputs or inputs without UTXO information attached or inputs - //without witness data that do not belong to lnd's wallet, this method will - //fail. If no error is returned, the PSBT is ready to be extracted and the - //final TX within to be broadcast. - // - //NOTE: This method does NOT publish the transaction once finalized. It is the - //caller's responsibility to either publish the transaction on success or - //unlock/release any locked UTXOs in case of an error in this method. - FinalizePsbt(context.Context, *FinalizePsbtRequest) (*FinalizePsbtResponse, error) -} - -// UnimplementedWalletKitServer can be embedded to have forward compatible implementations. -type UnimplementedWalletKitServer struct { -} - -func (*UnimplementedWalletKitServer) ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUnspent not implemented") -} -func (*UnimplementedWalletKitServer) LeaseOutput(context.Context, *LeaseOutputRequest) (*LeaseOutputResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaseOutput not implemented") -} -func (*UnimplementedWalletKitServer) ReleaseOutput(context.Context, *ReleaseOutputRequest) (*ReleaseOutputResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReleaseOutput not implemented") -} -func (*UnimplementedWalletKitServer) ListLeases(context.Context, *ListLeasesRequest) (*ListLeasesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListLeases not implemented") -} -func (*UnimplementedWalletKitServer) DeriveNextKey(context.Context, *KeyReq) (*signrpc.KeyDescriptor, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeriveNextKey not implemented") -} -func (*UnimplementedWalletKitServer) DeriveKey(context.Context, *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeriveKey not implemented") -} -func (*UnimplementedWalletKitServer) NextAddr(context.Context, *AddrRequest) (*AddrResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NextAddr not implemented") -} -func (*UnimplementedWalletKitServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented") -} -func (*UnimplementedWalletKitServer) ImportAccount(context.Context, *ImportAccountRequest) (*ImportAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ImportAccount not implemented") -} -func (*UnimplementedWalletKitServer) ImportPublicKey(context.Context, *ImportPublicKeyRequest) (*ImportPublicKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ImportPublicKey not implemented") -} -func (*UnimplementedWalletKitServer) PublishTransaction(context.Context, *Transaction) (*PublishResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PublishTransaction not implemented") -} -func (*UnimplementedWalletKitServer) SendOutputs(context.Context, *SendOutputsRequest) (*SendOutputsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendOutputs not implemented") -} -func (*UnimplementedWalletKitServer) EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimateFee not implemented") -} -func (*UnimplementedWalletKitServer) PendingSweeps(context.Context, *PendingSweepsRequest) (*PendingSweepsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PendingSweeps not implemented") -} -func (*UnimplementedWalletKitServer) BumpFee(context.Context, *BumpFeeRequest) (*BumpFeeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BumpFee not implemented") -} -func (*UnimplementedWalletKitServer) ListSweeps(context.Context, *ListSweepsRequest) (*ListSweepsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSweeps not implemented") -} -func (*UnimplementedWalletKitServer) LabelTransaction(context.Context, *LabelTransactionRequest) (*LabelTransactionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelTransaction not implemented") -} -func (*UnimplementedWalletKitServer) FundPsbt(context.Context, *FundPsbtRequest) (*FundPsbtResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FundPsbt not implemented") -} -func (*UnimplementedWalletKitServer) FinalizePsbt(context.Context, *FinalizePsbtRequest) (*FinalizePsbtResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FinalizePsbt not implemented") -} - -func RegisterWalletKitServer(s *grpc.Server, srv WalletKitServer) { - s.RegisterService(&_WalletKit_serviceDesc, srv) -} - -func _WalletKit_ListUnspent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUnspentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ListUnspent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ListUnspent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ListUnspent(ctx, req.(*ListUnspentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_LeaseOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseOutputRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).LeaseOutput(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/LeaseOutput", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).LeaseOutput(ctx, req.(*LeaseOutputRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_ReleaseOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReleaseOutputRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ReleaseOutput(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ReleaseOutput", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ReleaseOutput(ctx, req.(*ReleaseOutputRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_ListLeases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListLeasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ListLeases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ListLeases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ListLeases(ctx, req.(*ListLeasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_DeriveNextKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(KeyReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).DeriveNextKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/DeriveNextKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).DeriveNextKey(ctx, req.(*KeyReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_DeriveKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(signrpc.KeyLocator) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).DeriveKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/DeriveKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).DeriveKey(ctx, req.(*signrpc.KeyLocator)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_NextAddr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddrRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).NextAddr(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/NextAddr", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).NextAddr(ctx, req.(*AddrRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAccountsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ListAccounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ListAccounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ListAccounts(ctx, req.(*ListAccountsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_ImportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ImportAccountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ImportAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ImportAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ImportAccount(ctx, req.(*ImportAccountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_ImportPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ImportPublicKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ImportPublicKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ImportPublicKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ImportPublicKey(ctx, req.(*ImportPublicKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_PublishTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Transaction) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).PublishTransaction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/PublishTransaction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).PublishTransaction(ctx, req.(*Transaction)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_SendOutputs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendOutputsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).SendOutputs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/SendOutputs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).SendOutputs(ctx, req.(*SendOutputsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_EstimateFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EstimateFeeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).EstimateFee(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/EstimateFee", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).EstimateFee(ctx, req.(*EstimateFeeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_PendingSweeps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PendingSweepsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).PendingSweeps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/PendingSweeps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).PendingSweeps(ctx, req.(*PendingSweepsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_BumpFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BumpFeeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).BumpFee(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/BumpFee", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).BumpFee(ctx, req.(*BumpFeeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_ListSweeps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSweepsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).ListSweeps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/ListSweeps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).ListSweeps(ctx, req.(*ListSweepsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_LabelTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelTransactionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).LabelTransaction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/LabelTransaction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).LabelTransaction(ctx, req.(*LabelTransactionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_FundPsbt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FundPsbtRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).FundPsbt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/FundPsbt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).FundPsbt(ctx, req.(*FundPsbtRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletKit_FinalizePsbt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FinalizePsbtRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletKitServer).FinalizePsbt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/walletrpc.WalletKit/FinalizePsbt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletKitServer).FinalizePsbt(ctx, req.(*FinalizePsbtRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _WalletKit_serviceDesc = grpc.ServiceDesc{ - ServiceName: "walletrpc.WalletKit", - HandlerType: (*WalletKitServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListUnspent", - Handler: _WalletKit_ListUnspent_Handler, - }, - { - MethodName: "LeaseOutput", - Handler: _WalletKit_LeaseOutput_Handler, - }, - { - MethodName: "ReleaseOutput", - Handler: _WalletKit_ReleaseOutput_Handler, - }, - { - MethodName: "ListLeases", - Handler: _WalletKit_ListLeases_Handler, - }, - { - MethodName: "DeriveNextKey", - Handler: _WalletKit_DeriveNextKey_Handler, - }, - { - MethodName: "DeriveKey", - Handler: _WalletKit_DeriveKey_Handler, - }, - { - MethodName: "NextAddr", - Handler: _WalletKit_NextAddr_Handler, - }, - { - MethodName: "ListAccounts", - Handler: _WalletKit_ListAccounts_Handler, - }, - { - MethodName: "ImportAccount", - Handler: _WalletKit_ImportAccount_Handler, - }, - { - MethodName: "ImportPublicKey", - Handler: _WalletKit_ImportPublicKey_Handler, - }, - { - MethodName: "PublishTransaction", - Handler: _WalletKit_PublishTransaction_Handler, - }, - { - MethodName: "SendOutputs", - Handler: _WalletKit_SendOutputs_Handler, - }, - { - MethodName: "EstimateFee", - Handler: _WalletKit_EstimateFee_Handler, - }, - { - MethodName: "PendingSweeps", - Handler: _WalletKit_PendingSweeps_Handler, - }, - { - MethodName: "BumpFee", - Handler: _WalletKit_BumpFee_Handler, - }, - { - MethodName: "ListSweeps", - Handler: _WalletKit_ListSweeps_Handler, - }, - { - MethodName: "LabelTransaction", - Handler: _WalletKit_LabelTransaction_Handler, - }, - { - MethodName: "FundPsbt", - Handler: _WalletKit_FundPsbt_Handler, - }, - { - MethodName: "FinalizePsbt", - Handler: _WalletKit_FinalizePsbt_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "walletrpc/walletkit.proto", -} diff --git a/lnrpc/walletrpc/walletkit.pb.gw.go b/lnrpc/walletrpc/walletkit.pb.gw.go index f3f06ef80..f8da00bb8 100644 --- a/lnrpc/walletrpc/walletkit.pb.gw.go +++ b/lnrpc/walletrpc/walletkit.pb.gw.go @@ -13,15 +13,15 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "github.com/lightningnetwork/lnd/lnrpc/signrpc" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -30,7 +30,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_WalletKit_ListUnspent_0(ctx context.Context, marshaler runtime.Marshaler, client WalletKitClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ListUnspentRequest @@ -278,7 +278,10 @@ func local_request_WalletKit_ListAccounts_0(ctx context.Context, marshaler runti var protoReq ListAccountsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WalletKit_ListAccounts_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WalletKit_ListAccounts_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -440,7 +443,6 @@ func request_WalletKit_EstimateFee_0(ctx context.Context, marshaler runtime.Mars } protoReq.ConfTarget, err = runtime.Int32(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "conf_target", err) } @@ -467,7 +469,6 @@ func local_request_WalletKit_EstimateFee_0(ctx context.Context, marshaler runtim } protoReq.ConfTarget, err = runtime.Int32(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "conf_target", err) } @@ -553,7 +554,10 @@ func local_request_WalletKit_ListSweeps_0(ctx context.Context, marshaler runtime var protoReq ListSweepsRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WalletKit_ListSweeps_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WalletKit_ListSweeps_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -667,18 +671,22 @@ func local_request_WalletKit_FinalizePsbt_0(ctx context.Context, marshaler runti // RegisterWalletKitHandlerServer registers the http handlers for service WalletKit to "mux". // UnaryRPC :call WalletKitServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWalletKitHandlerFromEndpoint instead. func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WalletKitServer) error { mux.Handle("POST", pattern_WalletKit_ListUnspent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ListUnspent", runtime.WithHTTPPathPattern("/v2/wallet/utxos")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ListUnspent_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -692,13 +700,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_LeaseOutput_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/LeaseOutput", runtime.WithHTTPPathPattern("/v2/wallet/utxos/lease")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_LeaseOutput_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -712,13 +723,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_ReleaseOutput_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ReleaseOutput", runtime.WithHTTPPathPattern("/v2/wallet/utxos/release")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ReleaseOutput_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -732,13 +746,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_ListLeases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ListLeases", runtime.WithHTTPPathPattern("/v2/wallet/utxos/leases")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ListLeases_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -752,13 +769,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_DeriveNextKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/DeriveNextKey", runtime.WithHTTPPathPattern("/v2/wallet/key/next")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_DeriveNextKey_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -772,13 +792,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_DeriveKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/DeriveKey", runtime.WithHTTPPathPattern("/v2/wallet/key")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_DeriveKey_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -792,13 +815,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_NextAddr_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/NextAddr", runtime.WithHTTPPathPattern("/v2/wallet/address/next")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_NextAddr_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -812,13 +838,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_WalletKit_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ListAccounts", runtime.WithHTTPPathPattern("/v2/wallet/accounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ListAccounts_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -832,13 +861,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_ImportAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ImportAccount", runtime.WithHTTPPathPattern("/v2/wallet/accounts/import")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ImportAccount_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -852,13 +884,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_ImportPublicKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ImportPublicKey", runtime.WithHTTPPathPattern("/v2/wallet/key/import")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ImportPublicKey_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -872,13 +907,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_PublishTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/PublishTransaction", runtime.WithHTTPPathPattern("/v2/wallet/tx")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_PublishTransaction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -892,13 +930,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_SendOutputs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/SendOutputs", runtime.WithHTTPPathPattern("/v2/wallet/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_SendOutputs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -912,13 +953,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_WalletKit_EstimateFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/EstimateFee", runtime.WithHTTPPathPattern("/v2/wallet/estimatefee/{conf_target}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_EstimateFee_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -932,13 +976,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_WalletKit_PendingSweeps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/PendingSweeps", runtime.WithHTTPPathPattern("/v2/wallet/sweeps/pending")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_PendingSweeps_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -952,13 +999,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_BumpFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/BumpFee", runtime.WithHTTPPathPattern("/v2/wallet/bumpfee")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_BumpFee_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -972,13 +1022,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("GET", pattern_WalletKit_ListSweeps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/ListSweeps", runtime.WithHTTPPathPattern("/v2/wallet/sweeps")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_ListSweeps_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -992,13 +1045,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_LabelTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/LabelTransaction", runtime.WithHTTPPathPattern("/v2/wallet/tx/label")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_LabelTransaction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1012,13 +1068,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_FundPsbt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/FundPsbt", runtime.WithHTTPPathPattern("/v2/wallet/psbt/fund")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_FundPsbt_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1032,13 +1091,16 @@ func RegisterWalletKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, mux.Handle("POST", pattern_WalletKit_FinalizePsbt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/walletrpc.WalletKit/FinalizePsbt", runtime.WithHTTPPathPattern("/v2/wallet/psbt/finalize")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletKit_FinalizePsbt_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1094,7 +1156,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ListUnspent", runtime.WithHTTPPathPattern("/v2/wallet/utxos")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1114,7 +1176,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/LeaseOutput", runtime.WithHTTPPathPattern("/v2/wallet/utxos/lease")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1134,7 +1196,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ReleaseOutput", runtime.WithHTTPPathPattern("/v2/wallet/utxos/release")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1154,7 +1216,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ListLeases", runtime.WithHTTPPathPattern("/v2/wallet/utxos/leases")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1174,7 +1236,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/DeriveNextKey", runtime.WithHTTPPathPattern("/v2/wallet/key/next")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1194,7 +1256,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/DeriveKey", runtime.WithHTTPPathPattern("/v2/wallet/key")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1214,7 +1276,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/NextAddr", runtime.WithHTTPPathPattern("/v2/wallet/address/next")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1234,7 +1296,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ListAccounts", runtime.WithHTTPPathPattern("/v2/wallet/accounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1254,7 +1316,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ImportAccount", runtime.WithHTTPPathPattern("/v2/wallet/accounts/import")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1274,7 +1336,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ImportPublicKey", runtime.WithHTTPPathPattern("/v2/wallet/key/import")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1294,7 +1356,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/PublishTransaction", runtime.WithHTTPPathPattern("/v2/wallet/tx")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1314,7 +1376,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/SendOutputs", runtime.WithHTTPPathPattern("/v2/wallet/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1334,7 +1396,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/EstimateFee", runtime.WithHTTPPathPattern("/v2/wallet/estimatefee/{conf_target}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1354,7 +1416,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/PendingSweeps", runtime.WithHTTPPathPattern("/v2/wallet/sweeps/pending")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1374,7 +1436,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/BumpFee", runtime.WithHTTPPathPattern("/v2/wallet/bumpfee")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1394,7 +1456,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/ListSweeps", runtime.WithHTTPPathPattern("/v2/wallet/sweeps")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1414,7 +1476,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/LabelTransaction", runtime.WithHTTPPathPattern("/v2/wallet/tx/label")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1434,7 +1496,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/FundPsbt", runtime.WithHTTPPathPattern("/v2/wallet/psbt/fund")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1454,7 +1516,7 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/walletrpc.WalletKit/FinalizePsbt", runtime.WithHTTPPathPattern("/v2/wallet/psbt/finalize")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1474,43 +1536,43 @@ func RegisterWalletKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_WalletKit_ListUnspent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "utxos"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ListUnspent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "utxos"}, "")) - pattern_WalletKit_LeaseOutput_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "utxos", "lease"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_LeaseOutput_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "utxos", "lease"}, "")) - pattern_WalletKit_ReleaseOutput_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "utxos", "release"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ReleaseOutput_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "utxos", "release"}, "")) - pattern_WalletKit_ListLeases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "utxos", "leases"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ListLeases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "utxos", "leases"}, "")) - pattern_WalletKit_DeriveNextKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "key", "next"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_DeriveNextKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "key", "next"}, "")) - pattern_WalletKit_DeriveKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "key"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_DeriveKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "key"}, "")) - pattern_WalletKit_NextAddr_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "address", "next"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_NextAddr_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "address", "next"}, "")) - pattern_WalletKit_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "accounts"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "accounts"}, "")) - pattern_WalletKit_ImportAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "accounts", "import"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ImportAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "accounts", "import"}, "")) - pattern_WalletKit_ImportPublicKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "key", "import"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ImportPublicKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "key", "import"}, "")) - pattern_WalletKit_PublishTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "tx"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_PublishTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "tx"}, "")) - pattern_WalletKit_SendOutputs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "send"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_SendOutputs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "send"}, "")) - pattern_WalletKit_EstimateFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "wallet", "estimatefee", "conf_target"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_EstimateFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "wallet", "estimatefee", "conf_target"}, "")) - pattern_WalletKit_PendingSweeps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "sweeps", "pending"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_PendingSweeps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "sweeps", "pending"}, "")) - pattern_WalletKit_BumpFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "bumpfee"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_BumpFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "bumpfee"}, "")) - pattern_WalletKit_ListSweeps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "sweeps"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_ListSweeps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "wallet", "sweeps"}, "")) - pattern_WalletKit_LabelTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "tx", "label"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_LabelTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "tx", "label"}, "")) - pattern_WalletKit_FundPsbt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "psbt", "fund"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_FundPsbt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "psbt", "fund"}, "")) - pattern_WalletKit_FinalizePsbt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "psbt", "finalize"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletKit_FinalizePsbt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "wallet", "psbt", "finalize"}, "")) ) var ( diff --git a/lnrpc/walletrpc/walletkit.swagger.json b/lnrpc/walletrpc/walletkit.swagger.json index 31394d3c1..0a4f1d1de 100644 --- a/lnrpc/walletrpc/walletkit.swagger.json +++ b/lnrpc/walletrpc/walletkit.swagger.json @@ -4,6 +4,11 @@ "title": "walletrpc/walletkit.proto", "version": "version not set" }, + "tags": [ + { + "name": "WalletKit" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/wallet/accounts": { "get": { "summary": "ListAccounts retrieves all accounts belonging to the wallet by default. A\nname and key scope filter can be provided to filter through all of the\nwallet accounts and return only those matching.", - "operationId": "ListAccounts", + "operationId": "WalletKit_ListAccounts", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -61,7 +66,7 @@ "post": { "summary": "ImportAccount imports an account backed by an account extended public key.\nThe master key fingerprint denotes the fingerprint of the root key\ncorresponding to the account public key (also known as the key with\nderivation path m/). This may be required by some hardware wallets for\nproper identification and signing.", "description": "The address type can usually be inferred from the key's version, but may be\nrequired for certain keys to map them into the proper scope.\n\nFor BIP-0044 keys, an address type must be specified as we intend to not\nsupport importing BIP-0044 keys into the wallet using the legacy\npay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force\nthe standard BIP-0049 derivation scheme, while a witness address type will\nforce the standard BIP-0084 derivation scheme.\n\nFor BIP-0049 keys, an address type must also be specified to make a\ndistinction between the standard BIP-0049 address schema (nested witness\npubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys\nexternally, witness pubkeys internally).\n\nNOTE: Events (deposits/spends) for keys derived from an account will only be\ndetected by lnd if they happen after the import. Rescans to detect past\nevents will be supported later on.", - "operationId": "ImportAccount", + "operationId": "WalletKit_ImportAccount", "responses": { "200": { "description": "A successful response.", @@ -70,9 +75,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -94,7 +99,7 @@ "/v2/wallet/address/next": { "post": { "summary": "NextAddr returns the next unused address within the wallet.", - "operationId": "NextAddr", + "operationId": "WalletKit_NextAddr", "responses": { "200": { "description": "A successful response.", @@ -103,9 +108,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -128,7 +133,7 @@ "post": { "summary": "BumpFee bumps the fee of an arbitrary input within a transaction. This RPC\ntakes a different approach than bitcoind's bumpfee command. lnd has a\ncentral batching engine in which inputs with similar fee rates are batched\ntogether to save on transaction fees. Due to this, we cannot rely on\nbumping the fee on a specific transaction, since transactions can change at\nany point with the addition of new inputs. The list of inputs that\ncurrently exist within lnd's central batching engine can be retrieved\nthrough the PendingSweeps RPC.", "description": "When bumping the fee of an input that currently exists within lnd's central\nbatching engine, a higher fee transaction will be created that replaces the\nlower fee transaction through the Replace-By-Fee (RBF) policy. If it\n\nThis RPC also serves useful when wanting to perform a Child-Pays-For-Parent\n(CPFP), where the child transaction pays for its parent's fee. This can be\ndone by specifying an outpoint within the low fee transaction that is under\nthe control of the wallet.\n\nThe fee preference can be expressed either as a specific fee rate or a delta\nof blocks in which the output should be swept on-chain within. If a fee\npreference is not explicitly specified, then an error is returned.\n\nNote that this RPC currently doesn't perform any validation checks on the\nfee preference being provided. For now, the responsibility of ensuring that\nthe new fee preference is sufficient is delegated to the user.", - "operationId": "BumpFee", + "operationId": "WalletKit_BumpFee", "responses": { "200": { "description": "A successful response.", @@ -137,9 +142,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -161,7 +166,7 @@ "/v2/wallet/estimatefee/{conf_target}": { "get": { "summary": "EstimateFee attempts to query the internal fee estimator of the wallet to\ndetermine the fee (in sat/kw) to attach to a transaction in order to\nachieve the confirmation target.", - "operationId": "EstimateFee", + "operationId": "WalletKit_EstimateFee", "responses": { "200": { "description": "A successful response.", @@ -170,9 +175,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -194,7 +199,7 @@ "/v2/wallet/key": { "post": { "summary": "DeriveKey attempts to derive an arbitrary key specified by the passed\nKeyLocator.", - "operationId": "DeriveKey", + "operationId": "WalletKit_DeriveKey", "responses": { "200": { "description": "A successful response.", @@ -203,9 +208,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -228,7 +233,7 @@ "post": { "summary": "ImportPublicKey imports a public key as watch-only into the wallet.", "description": "NOTE: Events (deposits/spends) for a key will only be detected by lnd if\nthey happen after the import. Rescans to detect past events will be\nsupported later on.", - "operationId": "ImportPublicKey", + "operationId": "WalletKit_ImportPublicKey", "responses": { "200": { "description": "A successful response.", @@ -237,9 +242,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -261,7 +266,7 @@ "/v2/wallet/key/next": { "post": { "summary": "DeriveNextKey attempts to derive the *next* key within the key family\n(account in BIP43) specified. This method should return the next external\nchild within this branch.", - "operationId": "DeriveNextKey", + "operationId": "WalletKit_DeriveNextKey", "responses": { "200": { "description": "A successful response.", @@ -270,9 +275,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -295,7 +300,7 @@ "post": { "summary": "FinalizePsbt expects a partial transaction with all inputs and outputs fully\ndeclared and tries to sign all inputs that belong to the wallet. Lnd must be\nthe last signer of the transaction. That means, if there are any unsigned\nnon-witness inputs or inputs without UTXO information attached or inputs\nwithout witness data that do not belong to lnd's wallet, this method will\nfail. If no error is returned, the PSBT is ready to be extracted and the\nfinal TX within to be broadcast.", "description": "NOTE: This method does NOT publish the transaction once finalized. It is the\ncaller's responsibility to either publish the transaction on success or\nunlock/release any locked UTXOs in case of an error in this method.", - "operationId": "FinalizePsbt", + "operationId": "WalletKit_FinalizePsbt", "responses": { "200": { "description": "A successful response.", @@ -304,9 +309,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -329,7 +334,7 @@ "post": { "summary": "FundPsbt creates a fully populated PSBT that contains enough inputs to fund\nthe outputs specified in the template. There are two ways of specifying a\ntemplate: Either by passing in a PSBT with at least one output declared or\nby passing in a raw TxTemplate message.", "description": "If there are no inputs specified in the template, coin selection is\nperformed automatically. If the template does contain any inputs, it is\nassumed that full coin selection happened externally and no additional\ninputs are added. If the specified inputs aren't enough to fund the outputs\nwith the given fee rate, an error is returned.\n\nAfter either selecting or verifying the inputs, all input UTXOs are locked\nwith an internal app ID.\n\nNOTE: If this method returns without an error, it is the caller's\nresponsibility to either spend the locked UTXOs (by finalizing and then\npublishing the transaction) or to unlock/release the locked UTXOs in case of\nan error on the caller's side.", - "operationId": "FundPsbt", + "operationId": "WalletKit_FundPsbt", "responses": { "200": { "description": "A successful response.", @@ -338,9 +343,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -362,7 +367,7 @@ "/v2/wallet/send": { "post": { "summary": "SendOutputs is similar to the existing sendmany call in Bitcoind, and\nallows the caller to create a transaction that sends to several outputs at\nonce. This is ideal when wanting to batch create a set of transactions.", - "operationId": "SendOutputs", + "operationId": "WalletKit_SendOutputs", "responses": { "200": { "description": "A successful response.", @@ -371,9 +376,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -395,7 +400,7 @@ "/v2/wallet/sweeps": { "get": { "summary": "ListSweeps returns a list of the sweep transactions our node has produced.\nNote that these sweeps may not be confirmed yet, as we record sweeps on\nbroadcast, not confirmation.", - "operationId": "ListSweeps", + "operationId": "WalletKit_ListSweeps", "responses": { "200": { "description": "A successful response.", @@ -404,9 +409,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -416,8 +421,7 @@ "description": "Retrieve the full sweep transaction details. If false, only the sweep txids\nwill be returned. Note that some sweeps that LND publishes will have been\nreplaced-by-fee, so will not be included in this output.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -429,7 +433,7 @@ "get": { "summary": "PendingSweeps returns lists of on-chain outputs that lnd is currently\nattempting to sweep within its central batching engine. Outputs with similar\nfee rates are batched together in order to sweep them within a single\ntransaction.", "description": "NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to\nremain supported. This is an advanced API that depends on the internals of\nthe UtxoSweeper, so things may change.", - "operationId": "PendingSweeps", + "operationId": "WalletKit_PendingSweeps", "responses": { "200": { "description": "A successful response.", @@ -438,9 +442,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -452,7 +456,7 @@ "/v2/wallet/tx": { "post": { "summary": "PublishTransaction attempts to publish the passed transaction to the\nnetwork. Once this returns without an error, the wallet will continually\nattempt to re-broadcast the transaction on start up, until it enters the\nchain.", - "operationId": "PublishTransaction", + "operationId": "WalletKit_PublishTransaction", "responses": { "200": { "description": "A successful response.", @@ -461,9 +465,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -485,7 +489,7 @@ "/v2/wallet/tx/label": { "post": { "summary": "LabelTransaction adds a label to a transaction. If the transaction already\nhas a label the call will fail unless the overwrite bool is set. This will\noverwrite the exiting transaction label. Labels must not be empty, and\ncannot exceed 500 characters.", - "operationId": "LabelTransaction", + "operationId": "WalletKit_LabelTransaction", "responses": { "200": { "description": "A successful response.", @@ -494,9 +498,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -518,7 +522,7 @@ "/v2/wallet/utxos": { "post": { "summary": "ListUnspent returns a list of all utxos spendable by the wallet with a\nnumber of confirmations between the specified minimum and maximum.", - "operationId": "ListUnspent", + "operationId": "WalletKit_ListUnspent", "responses": { "200": { "description": "A successful response.", @@ -527,9 +531,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -551,7 +555,7 @@ "/v2/wallet/utxos/lease": { "post": { "summary": "LeaseOutput locks an output to the given ID, preventing it from being\navailable for any future coin selection attempts. The absolute time of the\nlock's expiration is returned. The expiration of the lock can be extended by\nsuccessive invocations of this RPC. Outputs can be unlocked before their\nexpiration through `ReleaseOutput`.", - "operationId": "LeaseOutput", + "operationId": "WalletKit_LeaseOutput", "responses": { "200": { "description": "A successful response.", @@ -560,9 +564,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -584,7 +588,7 @@ "/v2/wallet/utxos/leases": { "post": { "summary": "ListLeases lists all currently locked utxos.", - "operationId": "ListLeases", + "operationId": "WalletKit_ListLeases", "responses": { "200": { "description": "A successful response.", @@ -593,9 +597,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -607,7 +611,7 @@ "/v2/wallet/utxos/release": { "post": { "summary": "ReleaseOutput unlocks an output, allowing it to be available for coin\nselection if it remains unspent. The ID should match the one used to\noriginally lock the output.", - "operationId": "ReleaseOutput", + "operationId": "WalletKit_ReleaseOutput", "responses": { "200": { "description": "A successful response.", @@ -616,9 +620,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -790,12 +794,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -891,7 +892,6 @@ }, "watch_only": { "type": "boolean", - "format": "boolean", "description": "Whether the wallet stores private keys for the account." } } @@ -943,7 +943,6 @@ }, "force": { "type": "boolean", - "format": "boolean", "description": "Whether this input must be force-swept. This means that it is swept even\nif it has a negative yield." }, "sat_per_vbyte": { @@ -1028,7 +1027,6 @@ }, "spend_unconfirmed": { "type": "boolean", - "format": "boolean", "description": "Whether unconfirmed outputs should be used as inputs for the transaction." } } @@ -1077,7 +1075,6 @@ }, "dry_run": { "type": "boolean", - "format": "boolean", "description": "Whether a dry run should be attempted when importing the account. This\nserves as a way to confirm whether the account is being imported correctly\nby returning the first N addresses for the external and internal branches of\nthe account. If these addresses match as expected, then it should be safe to\nimport the account as is." } } @@ -1151,7 +1148,6 @@ }, "overwrite": { "type": "boolean", - "format": "boolean", "description": "Whether to overwrite the existing label, if it is present." } } @@ -1306,7 +1302,6 @@ }, "force": { "type": "boolean", - "format": "boolean", "description": "Whether this input must be force-swept. This means that it is swept even\nif it has a negative yield." } } @@ -1375,7 +1370,6 @@ }, "spend_unconfirmed": { "type": "boolean", - "format": "boolean", "description": "Whether unconfirmed outputs should be used as inputs for the transaction." } } diff --git a/lnrpc/walletrpc/walletkit_grpc.pb.go b/lnrpc/walletrpc/walletkit_grpc.pb.go new file mode 100644 index 000000000..d73d095ac --- /dev/null +++ b/lnrpc/walletrpc/walletkit_grpc.pb.go @@ -0,0 +1,1042 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package walletrpc + +import ( + context "context" + signrpc "github.com/lightningnetwork/lnd/lnrpc/signrpc" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WalletKitClient is the client API for WalletKit service. +// +// 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 WalletKitClient interface { + // + //ListUnspent returns a list of all utxos spendable by the wallet with a + //number of confirmations between the specified minimum and maximum. + ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) + // + //LeaseOutput locks an output to the given ID, preventing it from being + //available for any future coin selection attempts. The absolute time of the + //lock's expiration is returned. The expiration of the lock can be extended by + //successive invocations of this RPC. Outputs can be unlocked before their + //expiration through `ReleaseOutput`. + LeaseOutput(ctx context.Context, in *LeaseOutputRequest, opts ...grpc.CallOption) (*LeaseOutputResponse, error) + // + //ReleaseOutput unlocks an output, allowing it to be available for coin + //selection if it remains unspent. The ID should match the one used to + //originally lock the output. + ReleaseOutput(ctx context.Context, in *ReleaseOutputRequest, opts ...grpc.CallOption) (*ReleaseOutputResponse, error) + // + //ListLeases lists all currently locked utxos. + ListLeases(ctx context.Context, in *ListLeasesRequest, opts ...grpc.CallOption) (*ListLeasesResponse, error) + // + //DeriveNextKey attempts to derive the *next* key within the key family + //(account in BIP43) specified. This method should return the next external + //child within this branch. + DeriveNextKey(ctx context.Context, in *KeyReq, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) + // + //DeriveKey attempts to derive an arbitrary key specified by the passed + //KeyLocator. + DeriveKey(ctx context.Context, in *signrpc.KeyLocator, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) + // + //NextAddr returns the next unused address within the wallet. + NextAddr(ctx context.Context, in *AddrRequest, opts ...grpc.CallOption) (*AddrResponse, error) + // + //ListAccounts retrieves all accounts belonging to the wallet by default. A + //name and key scope filter can be provided to filter through all of the + //wallet accounts and return only those matching. + ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) + // + //ImportAccount imports an account backed by an account extended public key. + //The master key fingerprint denotes the fingerprint of the root key + //corresponding to the account public key (also known as the key with + //derivation path m/). This may be required by some hardware wallets for + //proper identification and signing. + // + //The address type can usually be inferred from the key's version, but may be + //required for certain keys to map them into the proper scope. + // + //For BIP-0044 keys, an address type must be specified as we intend to not + //support importing BIP-0044 keys into the wallet using the legacy + //pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force + //the standard BIP-0049 derivation scheme, while a witness address type will + //force the standard BIP-0084 derivation scheme. + // + //For BIP-0049 keys, an address type must also be specified to make a + //distinction between the standard BIP-0049 address schema (nested witness + //pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys + //externally, witness pubkeys internally). + // + //NOTE: Events (deposits/spends) for keys derived from an account will only be + //detected by lnd if they happen after the import. Rescans to detect past + //events will be supported later on. + ImportAccount(ctx context.Context, in *ImportAccountRequest, opts ...grpc.CallOption) (*ImportAccountResponse, error) + // + //ImportPublicKey imports a public key as watch-only into the wallet. + // + //NOTE: Events (deposits/spends) for a key will only be detected by lnd if + //they happen after the import. Rescans to detect past events will be + //supported later on. + ImportPublicKey(ctx context.Context, in *ImportPublicKeyRequest, opts ...grpc.CallOption) (*ImportPublicKeyResponse, error) + // + //PublishTransaction attempts to publish the passed transaction to the + //network. Once this returns without an error, the wallet will continually + //attempt to re-broadcast the transaction on start up, until it enters the + //chain. + PublishTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*PublishResponse, error) + // + //SendOutputs is similar to the existing sendmany call in Bitcoind, and + //allows the caller to create a transaction that sends to several outputs at + //once. This is ideal when wanting to batch create a set of transactions. + SendOutputs(ctx context.Context, in *SendOutputsRequest, opts ...grpc.CallOption) (*SendOutputsResponse, error) + // + //EstimateFee attempts to query the internal fee estimator of the wallet to + //determine the fee (in sat/kw) to attach to a transaction in order to + //achieve the confirmation target. + EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) + // + //PendingSweeps returns lists of on-chain outputs that lnd is currently + //attempting to sweep within its central batching engine. Outputs with similar + //fee rates are batched together in order to sweep them within a single + //transaction. + // + //NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to + //remain supported. This is an advanced API that depends on the internals of + //the UtxoSweeper, so things may change. + PendingSweeps(ctx context.Context, in *PendingSweepsRequest, opts ...grpc.CallOption) (*PendingSweepsResponse, error) + // + //BumpFee bumps the fee of an arbitrary input within a transaction. This RPC + //takes a different approach than bitcoind's bumpfee command. lnd has a + //central batching engine in which inputs with similar fee rates are batched + //together to save on transaction fees. Due to this, we cannot rely on + //bumping the fee on a specific transaction, since transactions can change at + //any point with the addition of new inputs. The list of inputs that + //currently exist within lnd's central batching engine can be retrieved + //through the PendingSweeps RPC. + // + //When bumping the fee of an input that currently exists within lnd's central + //batching engine, a higher fee transaction will be created that replaces the + //lower fee transaction through the Replace-By-Fee (RBF) policy. If it + // + //This RPC also serves useful when wanting to perform a Child-Pays-For-Parent + //(CPFP), where the child transaction pays for its parent's fee. This can be + //done by specifying an outpoint within the low fee transaction that is under + //the control of the wallet. + // + //The fee preference can be expressed either as a specific fee rate or a delta + //of blocks in which the output should be swept on-chain within. If a fee + //preference is not explicitly specified, then an error is returned. + // + //Note that this RPC currently doesn't perform any validation checks on the + //fee preference being provided. For now, the responsibility of ensuring that + //the new fee preference is sufficient is delegated to the user. + BumpFee(ctx context.Context, in *BumpFeeRequest, opts ...grpc.CallOption) (*BumpFeeResponse, error) + // + //ListSweeps returns a list of the sweep transactions our node has produced. + //Note that these sweeps may not be confirmed yet, as we record sweeps on + //broadcast, not confirmation. + ListSweeps(ctx context.Context, in *ListSweepsRequest, opts ...grpc.CallOption) (*ListSweepsResponse, error) + // + //LabelTransaction adds a label to a transaction. If the transaction already + //has a label the call will fail unless the overwrite bool is set. This will + //overwrite the exiting transaction label. Labels must not be empty, and + //cannot exceed 500 characters. + LabelTransaction(ctx context.Context, in *LabelTransactionRequest, opts ...grpc.CallOption) (*LabelTransactionResponse, error) + // + //FundPsbt creates a fully populated PSBT that contains enough inputs to fund + //the outputs specified in the template. There are two ways of specifying a + //template: Either by passing in a PSBT with at least one output declared or + //by passing in a raw TxTemplate message. + // + //If there are no inputs specified in the template, coin selection is + //performed automatically. If the template does contain any inputs, it is + //assumed that full coin selection happened externally and no additional + //inputs are added. If the specified inputs aren't enough to fund the outputs + //with the given fee rate, an error is returned. + // + //After either selecting or verifying the inputs, all input UTXOs are locked + //with an internal app ID. + // + //NOTE: If this method returns without an error, it is the caller's + //responsibility to either spend the locked UTXOs (by finalizing and then + //publishing the transaction) or to unlock/release the locked UTXOs in case of + //an error on the caller's side. + FundPsbt(ctx context.Context, in *FundPsbtRequest, opts ...grpc.CallOption) (*FundPsbtResponse, error) + // + //FinalizePsbt expects a partial transaction with all inputs and outputs fully + //declared and tries to sign all inputs that belong to the wallet. Lnd must be + //the last signer of the transaction. That means, if there are any unsigned + //non-witness inputs or inputs without UTXO information attached or inputs + //without witness data that do not belong to lnd's wallet, this method will + //fail. If no error is returned, the PSBT is ready to be extracted and the + //final TX within to be broadcast. + // + //NOTE: This method does NOT publish the transaction once finalized. It is the + //caller's responsibility to either publish the transaction on success or + //unlock/release any locked UTXOs in case of an error in this method. + FinalizePsbt(ctx context.Context, in *FinalizePsbtRequest, opts ...grpc.CallOption) (*FinalizePsbtResponse, error) +} + +type walletKitClient struct { + cc grpc.ClientConnInterface +} + +func NewWalletKitClient(cc grpc.ClientConnInterface) WalletKitClient { + return &walletKitClient{cc} +} + +func (c *walletKitClient) ListUnspent(ctx context.Context, in *ListUnspentRequest, opts ...grpc.CallOption) (*ListUnspentResponse, error) { + out := new(ListUnspentResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListUnspent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) LeaseOutput(ctx context.Context, in *LeaseOutputRequest, opts ...grpc.CallOption) (*LeaseOutputResponse, error) { + out := new(LeaseOutputResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/LeaseOutput", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) ReleaseOutput(ctx context.Context, in *ReleaseOutputRequest, opts ...grpc.CallOption) (*ReleaseOutputResponse, error) { + out := new(ReleaseOutputResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ReleaseOutput", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) ListLeases(ctx context.Context, in *ListLeasesRequest, opts ...grpc.CallOption) (*ListLeasesResponse, error) { + out := new(ListLeasesResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListLeases", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) DeriveNextKey(ctx context.Context, in *KeyReq, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) { + out := new(signrpc.KeyDescriptor) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/DeriveNextKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) DeriveKey(ctx context.Context, in *signrpc.KeyLocator, opts ...grpc.CallOption) (*signrpc.KeyDescriptor, error) { + out := new(signrpc.KeyDescriptor) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/DeriveKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) NextAddr(ctx context.Context, in *AddrRequest, opts ...grpc.CallOption) (*AddrResponse, error) { + out := new(AddrResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/NextAddr", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) { + out := new(ListAccountsResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListAccounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) ImportAccount(ctx context.Context, in *ImportAccountRequest, opts ...grpc.CallOption) (*ImportAccountResponse, error) { + out := new(ImportAccountResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ImportAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) ImportPublicKey(ctx context.Context, in *ImportPublicKeyRequest, opts ...grpc.CallOption) (*ImportPublicKeyResponse, error) { + out := new(ImportPublicKeyResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ImportPublicKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) PublishTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*PublishResponse, error) { + out := new(PublishResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/PublishTransaction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) SendOutputs(ctx context.Context, in *SendOutputsRequest, opts ...grpc.CallOption) (*SendOutputsResponse, error) { + out := new(SendOutputsResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/SendOutputs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) { + out := new(EstimateFeeResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/EstimateFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) PendingSweeps(ctx context.Context, in *PendingSweepsRequest, opts ...grpc.CallOption) (*PendingSweepsResponse, error) { + out := new(PendingSweepsResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/PendingSweeps", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) BumpFee(ctx context.Context, in *BumpFeeRequest, opts ...grpc.CallOption) (*BumpFeeResponse, error) { + out := new(BumpFeeResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/BumpFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) ListSweeps(ctx context.Context, in *ListSweepsRequest, opts ...grpc.CallOption) (*ListSweepsResponse, error) { + out := new(ListSweepsResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/ListSweeps", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) LabelTransaction(ctx context.Context, in *LabelTransactionRequest, opts ...grpc.CallOption) (*LabelTransactionResponse, error) { + out := new(LabelTransactionResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/LabelTransaction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) FundPsbt(ctx context.Context, in *FundPsbtRequest, opts ...grpc.CallOption) (*FundPsbtResponse, error) { + out := new(FundPsbtResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/FundPsbt", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletKitClient) FinalizePsbt(ctx context.Context, in *FinalizePsbtRequest, opts ...grpc.CallOption) (*FinalizePsbtResponse, error) { + out := new(FinalizePsbtResponse) + err := c.cc.Invoke(ctx, "/walletrpc.WalletKit/FinalizePsbt", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WalletKitServer is the server API for WalletKit service. +// All implementations must embed UnimplementedWalletKitServer +// for forward compatibility +type WalletKitServer interface { + // + //ListUnspent returns a list of all utxos spendable by the wallet with a + //number of confirmations between the specified minimum and maximum. + ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) + // + //LeaseOutput locks an output to the given ID, preventing it from being + //available for any future coin selection attempts. The absolute time of the + //lock's expiration is returned. The expiration of the lock can be extended by + //successive invocations of this RPC. Outputs can be unlocked before their + //expiration through `ReleaseOutput`. + LeaseOutput(context.Context, *LeaseOutputRequest) (*LeaseOutputResponse, error) + // + //ReleaseOutput unlocks an output, allowing it to be available for coin + //selection if it remains unspent. The ID should match the one used to + //originally lock the output. + ReleaseOutput(context.Context, *ReleaseOutputRequest) (*ReleaseOutputResponse, error) + // + //ListLeases lists all currently locked utxos. + ListLeases(context.Context, *ListLeasesRequest) (*ListLeasesResponse, error) + // + //DeriveNextKey attempts to derive the *next* key within the key family + //(account in BIP43) specified. This method should return the next external + //child within this branch. + DeriveNextKey(context.Context, *KeyReq) (*signrpc.KeyDescriptor, error) + // + //DeriveKey attempts to derive an arbitrary key specified by the passed + //KeyLocator. + DeriveKey(context.Context, *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) + // + //NextAddr returns the next unused address within the wallet. + NextAddr(context.Context, *AddrRequest) (*AddrResponse, error) + // + //ListAccounts retrieves all accounts belonging to the wallet by default. A + //name and key scope filter can be provided to filter through all of the + //wallet accounts and return only those matching. + ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) + // + //ImportAccount imports an account backed by an account extended public key. + //The master key fingerprint denotes the fingerprint of the root key + //corresponding to the account public key (also known as the key with + //derivation path m/). This may be required by some hardware wallets for + //proper identification and signing. + // + //The address type can usually be inferred from the key's version, but may be + //required for certain keys to map them into the proper scope. + // + //For BIP-0044 keys, an address type must be specified as we intend to not + //support importing BIP-0044 keys into the wallet using the legacy + //pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force + //the standard BIP-0049 derivation scheme, while a witness address type will + //force the standard BIP-0084 derivation scheme. + // + //For BIP-0049 keys, an address type must also be specified to make a + //distinction between the standard BIP-0049 address schema (nested witness + //pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys + //externally, witness pubkeys internally). + // + //NOTE: Events (deposits/spends) for keys derived from an account will only be + //detected by lnd if they happen after the import. Rescans to detect past + //events will be supported later on. + ImportAccount(context.Context, *ImportAccountRequest) (*ImportAccountResponse, error) + // + //ImportPublicKey imports a public key as watch-only into the wallet. + // + //NOTE: Events (deposits/spends) for a key will only be detected by lnd if + //they happen after the import. Rescans to detect past events will be + //supported later on. + ImportPublicKey(context.Context, *ImportPublicKeyRequest) (*ImportPublicKeyResponse, error) + // + //PublishTransaction attempts to publish the passed transaction to the + //network. Once this returns without an error, the wallet will continually + //attempt to re-broadcast the transaction on start up, until it enters the + //chain. + PublishTransaction(context.Context, *Transaction) (*PublishResponse, error) + // + //SendOutputs is similar to the existing sendmany call in Bitcoind, and + //allows the caller to create a transaction that sends to several outputs at + //once. This is ideal when wanting to batch create a set of transactions. + SendOutputs(context.Context, *SendOutputsRequest) (*SendOutputsResponse, error) + // + //EstimateFee attempts to query the internal fee estimator of the wallet to + //determine the fee (in sat/kw) to attach to a transaction in order to + //achieve the confirmation target. + EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) + // + //PendingSweeps returns lists of on-chain outputs that lnd is currently + //attempting to sweep within its central batching engine. Outputs with similar + //fee rates are batched together in order to sweep them within a single + //transaction. + // + //NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to + //remain supported. This is an advanced API that depends on the internals of + //the UtxoSweeper, so things may change. + PendingSweeps(context.Context, *PendingSweepsRequest) (*PendingSweepsResponse, error) + // + //BumpFee bumps the fee of an arbitrary input within a transaction. This RPC + //takes a different approach than bitcoind's bumpfee command. lnd has a + //central batching engine in which inputs with similar fee rates are batched + //together to save on transaction fees. Due to this, we cannot rely on + //bumping the fee on a specific transaction, since transactions can change at + //any point with the addition of new inputs. The list of inputs that + //currently exist within lnd's central batching engine can be retrieved + //through the PendingSweeps RPC. + // + //When bumping the fee of an input that currently exists within lnd's central + //batching engine, a higher fee transaction will be created that replaces the + //lower fee transaction through the Replace-By-Fee (RBF) policy. If it + // + //This RPC also serves useful when wanting to perform a Child-Pays-For-Parent + //(CPFP), where the child transaction pays for its parent's fee. This can be + //done by specifying an outpoint within the low fee transaction that is under + //the control of the wallet. + // + //The fee preference can be expressed either as a specific fee rate or a delta + //of blocks in which the output should be swept on-chain within. If a fee + //preference is not explicitly specified, then an error is returned. + // + //Note that this RPC currently doesn't perform any validation checks on the + //fee preference being provided. For now, the responsibility of ensuring that + //the new fee preference is sufficient is delegated to the user. + BumpFee(context.Context, *BumpFeeRequest) (*BumpFeeResponse, error) + // + //ListSweeps returns a list of the sweep transactions our node has produced. + //Note that these sweeps may not be confirmed yet, as we record sweeps on + //broadcast, not confirmation. + ListSweeps(context.Context, *ListSweepsRequest) (*ListSweepsResponse, error) + // + //LabelTransaction adds a label to a transaction. If the transaction already + //has a label the call will fail unless the overwrite bool is set. This will + //overwrite the exiting transaction label. Labels must not be empty, and + //cannot exceed 500 characters. + LabelTransaction(context.Context, *LabelTransactionRequest) (*LabelTransactionResponse, error) + // + //FundPsbt creates a fully populated PSBT that contains enough inputs to fund + //the outputs specified in the template. There are two ways of specifying a + //template: Either by passing in a PSBT with at least one output declared or + //by passing in a raw TxTemplate message. + // + //If there are no inputs specified in the template, coin selection is + //performed automatically. If the template does contain any inputs, it is + //assumed that full coin selection happened externally and no additional + //inputs are added. If the specified inputs aren't enough to fund the outputs + //with the given fee rate, an error is returned. + // + //After either selecting or verifying the inputs, all input UTXOs are locked + //with an internal app ID. + // + //NOTE: If this method returns without an error, it is the caller's + //responsibility to either spend the locked UTXOs (by finalizing and then + //publishing the transaction) or to unlock/release the locked UTXOs in case of + //an error on the caller's side. + FundPsbt(context.Context, *FundPsbtRequest) (*FundPsbtResponse, error) + // + //FinalizePsbt expects a partial transaction with all inputs and outputs fully + //declared and tries to sign all inputs that belong to the wallet. Lnd must be + //the last signer of the transaction. That means, if there are any unsigned + //non-witness inputs or inputs without UTXO information attached or inputs + //without witness data that do not belong to lnd's wallet, this method will + //fail. If no error is returned, the PSBT is ready to be extracted and the + //final TX within to be broadcast. + // + //NOTE: This method does NOT publish the transaction once finalized. It is the + //caller's responsibility to either publish the transaction on success or + //unlock/release any locked UTXOs in case of an error in this method. + FinalizePsbt(context.Context, *FinalizePsbtRequest) (*FinalizePsbtResponse, error) + mustEmbedUnimplementedWalletKitServer() +} + +// UnimplementedWalletKitServer must be embedded to have forward compatible implementations. +type UnimplementedWalletKitServer struct { +} + +func (UnimplementedWalletKitServer) ListUnspent(context.Context, *ListUnspentRequest) (*ListUnspentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUnspent not implemented") +} +func (UnimplementedWalletKitServer) LeaseOutput(context.Context, *LeaseOutputRequest) (*LeaseOutputResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeaseOutput not implemented") +} +func (UnimplementedWalletKitServer) ReleaseOutput(context.Context, *ReleaseOutputRequest) (*ReleaseOutputResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReleaseOutput not implemented") +} +func (UnimplementedWalletKitServer) ListLeases(context.Context, *ListLeasesRequest) (*ListLeasesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListLeases not implemented") +} +func (UnimplementedWalletKitServer) DeriveNextKey(context.Context, *KeyReq) (*signrpc.KeyDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeriveNextKey not implemented") +} +func (UnimplementedWalletKitServer) DeriveKey(context.Context, *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeriveKey not implemented") +} +func (UnimplementedWalletKitServer) NextAddr(context.Context, *AddrRequest) (*AddrResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextAddr not implemented") +} +func (UnimplementedWalletKitServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented") +} +func (UnimplementedWalletKitServer) ImportAccount(context.Context, *ImportAccountRequest) (*ImportAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportAccount not implemented") +} +func (UnimplementedWalletKitServer) ImportPublicKey(context.Context, *ImportPublicKeyRequest) (*ImportPublicKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportPublicKey not implemented") +} +func (UnimplementedWalletKitServer) PublishTransaction(context.Context, *Transaction) (*PublishResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublishTransaction not implemented") +} +func (UnimplementedWalletKitServer) SendOutputs(context.Context, *SendOutputsRequest) (*SendOutputsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendOutputs not implemented") +} +func (UnimplementedWalletKitServer) EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateFee not implemented") +} +func (UnimplementedWalletKitServer) PendingSweeps(context.Context, *PendingSweepsRequest) (*PendingSweepsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PendingSweeps not implemented") +} +func (UnimplementedWalletKitServer) BumpFee(context.Context, *BumpFeeRequest) (*BumpFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BumpFee not implemented") +} +func (UnimplementedWalletKitServer) ListSweeps(context.Context, *ListSweepsRequest) (*ListSweepsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSweeps not implemented") +} +func (UnimplementedWalletKitServer) LabelTransaction(context.Context, *LabelTransactionRequest) (*LabelTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LabelTransaction not implemented") +} +func (UnimplementedWalletKitServer) FundPsbt(context.Context, *FundPsbtRequest) (*FundPsbtResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundPsbt not implemented") +} +func (UnimplementedWalletKitServer) FinalizePsbt(context.Context, *FinalizePsbtRequest) (*FinalizePsbtResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizePsbt not implemented") +} +func (UnimplementedWalletKitServer) mustEmbedUnimplementedWalletKitServer() {} + +// UnsafeWalletKitServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WalletKitServer will +// result in compilation errors. +type UnsafeWalletKitServer interface { + mustEmbedUnimplementedWalletKitServer() +} + +func RegisterWalletKitServer(s grpc.ServiceRegistrar, srv WalletKitServer) { + s.RegisterService(&WalletKit_ServiceDesc, srv) +} + +func _WalletKit_ListUnspent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUnspentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ListUnspent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ListUnspent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ListUnspent(ctx, req.(*ListUnspentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_LeaseOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LeaseOutputRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).LeaseOutput(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/LeaseOutput", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).LeaseOutput(ctx, req.(*LeaseOutputRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_ReleaseOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReleaseOutputRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ReleaseOutput(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ReleaseOutput", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ReleaseOutput(ctx, req.(*ReleaseOutputRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_ListLeases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLeasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ListLeases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ListLeases", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ListLeases(ctx, req.(*ListLeasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_DeriveNextKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).DeriveNextKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/DeriveNextKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).DeriveNextKey(ctx, req.(*KeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_DeriveKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(signrpc.KeyLocator) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).DeriveKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/DeriveKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).DeriveKey(ctx, req.(*signrpc.KeyLocator)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_NextAddr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddrRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).NextAddr(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/NextAddr", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).NextAddr(ctx, req.(*AddrRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ListAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ListAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ListAccounts(ctx, req.(*ListAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_ImportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ImportAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ImportAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ImportAccount(ctx, req.(*ImportAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_ImportPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ImportPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ImportPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ImportPublicKey(ctx, req.(*ImportPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_PublishTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Transaction) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).PublishTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/PublishTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).PublishTransaction(ctx, req.(*Transaction)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_SendOutputs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendOutputsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).SendOutputs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/SendOutputs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).SendOutputs(ctx, req.(*SendOutputsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_EstimateFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EstimateFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).EstimateFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/EstimateFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).EstimateFee(ctx, req.(*EstimateFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_PendingSweeps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PendingSweepsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).PendingSweeps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/PendingSweeps", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).PendingSweeps(ctx, req.(*PendingSweepsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_BumpFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BumpFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).BumpFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/BumpFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).BumpFee(ctx, req.(*BumpFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_ListSweeps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSweepsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).ListSweeps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/ListSweeps", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).ListSweeps(ctx, req.(*ListSweepsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_LabelTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LabelTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).LabelTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/LabelTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).LabelTransaction(ctx, req.(*LabelTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_FundPsbt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FundPsbtRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).FundPsbt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/FundPsbt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).FundPsbt(ctx, req.(*FundPsbtRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletKit_FinalizePsbt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FinalizePsbtRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletKitServer).FinalizePsbt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/walletrpc.WalletKit/FinalizePsbt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletKitServer).FinalizePsbt(ctx, req.(*FinalizePsbtRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WalletKit_ServiceDesc is the grpc.ServiceDesc for WalletKit service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WalletKit_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "walletrpc.WalletKit", + HandlerType: (*WalletKitServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUnspent", + Handler: _WalletKit_ListUnspent_Handler, + }, + { + MethodName: "LeaseOutput", + Handler: _WalletKit_LeaseOutput_Handler, + }, + { + MethodName: "ReleaseOutput", + Handler: _WalletKit_ReleaseOutput_Handler, + }, + { + MethodName: "ListLeases", + Handler: _WalletKit_ListLeases_Handler, + }, + { + MethodName: "DeriveNextKey", + Handler: _WalletKit_DeriveNextKey_Handler, + }, + { + MethodName: "DeriveKey", + Handler: _WalletKit_DeriveKey_Handler, + }, + { + MethodName: "NextAddr", + Handler: _WalletKit_NextAddr_Handler, + }, + { + MethodName: "ListAccounts", + Handler: _WalletKit_ListAccounts_Handler, + }, + { + MethodName: "ImportAccount", + Handler: _WalletKit_ImportAccount_Handler, + }, + { + MethodName: "ImportPublicKey", + Handler: _WalletKit_ImportPublicKey_Handler, + }, + { + MethodName: "PublishTransaction", + Handler: _WalletKit_PublishTransaction_Handler, + }, + { + MethodName: "SendOutputs", + Handler: _WalletKit_SendOutputs_Handler, + }, + { + MethodName: "EstimateFee", + Handler: _WalletKit_EstimateFee_Handler, + }, + { + MethodName: "PendingSweeps", + Handler: _WalletKit_PendingSweeps_Handler, + }, + { + MethodName: "BumpFee", + Handler: _WalletKit_BumpFee_Handler, + }, + { + MethodName: "ListSweeps", + Handler: _WalletKit_ListSweeps_Handler, + }, + { + MethodName: "LabelTransaction", + Handler: _WalletKit_LabelTransaction_Handler, + }, + { + MethodName: "FundPsbt", + Handler: _WalletKit_FundPsbt_Handler, + }, + { + MethodName: "FinalizePsbt", + Handler: _WalletKit_FinalizePsbt_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "walletrpc/walletkit.proto", +} diff --git a/lnrpc/walletrpc/walletkit_server.go b/lnrpc/walletrpc/walletkit_server.go index d04b3c463..28f502f6b 100644 --- a/lnrpc/walletrpc/walletkit_server.go +++ b/lnrpc/walletrpc/walletkit_server.go @@ -22,7 +22,7 @@ import ( "github.com/btcsuite/btcutil/psbt" "github.com/btcsuite/btcwallet/waddrmgr" "github.com/btcsuite/btcwallet/wtxmgr" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/labels" @@ -179,6 +179,9 @@ type ServerShell struct { // to execute common wallet operations. This includes requesting new addresses, // keys (for contracts!), and publishing transactions. type WalletKit struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedWalletKitServer + cfg *Config } diff --git a/lnrpc/walletunlocker.pb.go b/lnrpc/walletunlocker.pb.go index f7923eb77..c908e3ef2 100644 --- a/lnrpc/walletunlocker.pb.go +++ b/lnrpc/walletunlocker.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: walletunlocker.proto package lnrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type GenSeedRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -858,247 +849,3 @@ func file_walletunlocker_proto_init() { file_walletunlocker_proto_goTypes = nil file_walletunlocker_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// WalletUnlockerClient is the client API for WalletUnlocker service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WalletUnlockerClient interface { - // - //GenSeed is the first method that should be used to instantiate a new lnd - //instance. This method allows a caller to generate a new aezeed cipher seed - //given an optional passphrase. If provided, the passphrase will be necessary - //to decrypt the cipherseed to expose the internal wallet seed. - // - //Once the cipherseed is obtained and verified by the user, the InitWallet - //method should be used to commit the newly generated seed, and create the - //wallet. - GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error) - // - //InitWallet is used when lnd is starting up for the first time to fully - //initialize the daemon and its internal wallet. At the very least a wallet - //password must be provided. This will be used to encrypt sensitive material - //on disk. - // - //In the case of a recovery scenario, the user can also specify their aezeed - //mnemonic and passphrase. If set, then the daemon will use this prior state - //to initialize its internal wallet. - // - //Alternatively, this can be used along with the GenSeed RPC to obtain a - //seed, then present it to the user. Once it has been verified by the user, - //the seed can be fed into this RPC in order to commit the new wallet. - InitWallet(ctx context.Context, in *InitWalletRequest, opts ...grpc.CallOption) (*InitWalletResponse, error) - // lncli: `unlock` - //UnlockWallet is used at startup of lnd to provide a password to unlock - //the wallet database. - UnlockWallet(ctx context.Context, in *UnlockWalletRequest, opts ...grpc.CallOption) (*UnlockWalletResponse, error) - // lncli: `changepassword` - //ChangePassword changes the password of the encrypted wallet. This will - //automatically unlock the wallet database if successful. - ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) -} - -type walletUnlockerClient struct { - cc grpc.ClientConnInterface -} - -func NewWalletUnlockerClient(cc grpc.ClientConnInterface) WalletUnlockerClient { - return &walletUnlockerClient{cc} -} - -func (c *walletUnlockerClient) GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error) { - out := new(GenSeedResponse) - err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/GenSeed", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletUnlockerClient) InitWallet(ctx context.Context, in *InitWalletRequest, opts ...grpc.CallOption) (*InitWalletResponse, error) { - out := new(InitWalletResponse) - err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/InitWallet", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletUnlockerClient) UnlockWallet(ctx context.Context, in *UnlockWalletRequest, opts ...grpc.CallOption) (*UnlockWalletResponse, error) { - out := new(UnlockWalletResponse) - err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/UnlockWallet", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *walletUnlockerClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) { - out := new(ChangePasswordResponse) - err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/ChangePassword", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WalletUnlockerServer is the server API for WalletUnlocker service. -type WalletUnlockerServer interface { - // - //GenSeed is the first method that should be used to instantiate a new lnd - //instance. This method allows a caller to generate a new aezeed cipher seed - //given an optional passphrase. If provided, the passphrase will be necessary - //to decrypt the cipherseed to expose the internal wallet seed. - // - //Once the cipherseed is obtained and verified by the user, the InitWallet - //method should be used to commit the newly generated seed, and create the - //wallet. - GenSeed(context.Context, *GenSeedRequest) (*GenSeedResponse, error) - // - //InitWallet is used when lnd is starting up for the first time to fully - //initialize the daemon and its internal wallet. At the very least a wallet - //password must be provided. This will be used to encrypt sensitive material - //on disk. - // - //In the case of a recovery scenario, the user can also specify their aezeed - //mnemonic and passphrase. If set, then the daemon will use this prior state - //to initialize its internal wallet. - // - //Alternatively, this can be used along with the GenSeed RPC to obtain a - //seed, then present it to the user. Once it has been verified by the user, - //the seed can be fed into this RPC in order to commit the new wallet. - InitWallet(context.Context, *InitWalletRequest) (*InitWalletResponse, error) - // lncli: `unlock` - //UnlockWallet is used at startup of lnd to provide a password to unlock - //the wallet database. - UnlockWallet(context.Context, *UnlockWalletRequest) (*UnlockWalletResponse, error) - // lncli: `changepassword` - //ChangePassword changes the password of the encrypted wallet. This will - //automatically unlock the wallet database if successful. - ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) -} - -// UnimplementedWalletUnlockerServer can be embedded to have forward compatible implementations. -type UnimplementedWalletUnlockerServer struct { -} - -func (*UnimplementedWalletUnlockerServer) GenSeed(context.Context, *GenSeedRequest) (*GenSeedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GenSeed not implemented") -} -func (*UnimplementedWalletUnlockerServer) InitWallet(context.Context, *InitWalletRequest) (*InitWalletResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitWallet not implemented") -} -func (*UnimplementedWalletUnlockerServer) UnlockWallet(context.Context, *UnlockWalletRequest) (*UnlockWalletResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnlockWallet not implemented") -} -func (*UnimplementedWalletUnlockerServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented") -} - -func RegisterWalletUnlockerServer(s *grpc.Server, srv WalletUnlockerServer) { - s.RegisterService(&_WalletUnlocker_serviceDesc, srv) -} - -func _WalletUnlocker_GenSeed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GenSeedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletUnlockerServer).GenSeed(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.WalletUnlocker/GenSeed", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletUnlockerServer).GenSeed(ctx, req.(*GenSeedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletUnlocker_InitWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitWalletRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletUnlockerServer).InitWallet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.WalletUnlocker/InitWallet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletUnlockerServer).InitWallet(ctx, req.(*InitWalletRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletUnlocker_UnlockWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnlockWalletRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletUnlockerServer).UnlockWallet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.WalletUnlocker/UnlockWallet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletUnlockerServer).UnlockWallet(ctx, req.(*UnlockWalletRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WalletUnlocker_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangePasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WalletUnlockerServer).ChangePassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lnrpc.WalletUnlocker/ChangePassword", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WalletUnlockerServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _WalletUnlocker_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lnrpc.WalletUnlocker", - HandlerType: (*WalletUnlockerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GenSeed", - Handler: _WalletUnlocker_GenSeed_Handler, - }, - { - MethodName: "InitWallet", - Handler: _WalletUnlocker_InitWallet_Handler, - }, - { - MethodName: "UnlockWallet", - Handler: _WalletUnlocker_UnlockWallet_Handler, - }, - { - MethodName: "ChangePassword", - Handler: _WalletUnlocker_ChangePassword_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "walletunlocker.proto", -} diff --git a/lnrpc/walletunlocker.pb.gw.go b/lnrpc/walletunlocker.pb.gw.go index 06a0ce901..d7cd401a1 100644 --- a/lnrpc/walletunlocker.pb.gw.go +++ b/lnrpc/walletunlocker.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join var ( filter_WalletUnlocker_GenSeed_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -55,7 +55,10 @@ func local_request_WalletUnlocker_GenSeed_0(ctx context.Context, marshaler runti var protoReq GenSeedRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WalletUnlocker_GenSeed_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WalletUnlocker_GenSeed_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -169,18 +172,22 @@ func local_request_WalletUnlocker_ChangePassword_0(ctx context.Context, marshale // RegisterWalletUnlockerHandlerServer registers the http handlers for service WalletUnlocker to "mux". // UnaryRPC :call WalletUnlockerServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWalletUnlockerHandlerFromEndpoint instead. func RegisterWalletUnlockerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WalletUnlockerServer) error { mux.Handle("GET", pattern_WalletUnlocker_GenSeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.WalletUnlocker/GenSeed", runtime.WithHTTPPathPattern("/v1/genseed")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletUnlocker_GenSeed_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -194,13 +201,16 @@ func RegisterWalletUnlockerHandlerServer(ctx context.Context, mux *runtime.Serve mux.Handle("POST", pattern_WalletUnlocker_InitWallet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.WalletUnlocker/InitWallet", runtime.WithHTTPPathPattern("/v1/initwallet")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletUnlocker_InitWallet_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -214,13 +224,16 @@ func RegisterWalletUnlockerHandlerServer(ctx context.Context, mux *runtime.Serve mux.Handle("POST", pattern_WalletUnlocker_UnlockWallet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.WalletUnlocker/UnlockWallet", runtime.WithHTTPPathPattern("/v1/unlockwallet")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletUnlocker_UnlockWallet_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -234,13 +247,16 @@ func RegisterWalletUnlockerHandlerServer(ctx context.Context, mux *runtime.Serve mux.Handle("POST", pattern_WalletUnlocker_ChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.WalletUnlocker/ChangePassword", runtime.WithHTTPPathPattern("/v1/changepassword")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WalletUnlocker_ChangePassword_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -296,7 +312,7 @@ func RegisterWalletUnlockerHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.WalletUnlocker/GenSeed", runtime.WithHTTPPathPattern("/v1/genseed")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -316,7 +332,7 @@ func RegisterWalletUnlockerHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.WalletUnlocker/InitWallet", runtime.WithHTTPPathPattern("/v1/initwallet")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -336,7 +352,7 @@ func RegisterWalletUnlockerHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.WalletUnlocker/UnlockWallet", runtime.WithHTTPPathPattern("/v1/unlockwallet")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -356,7 +372,7 @@ func RegisterWalletUnlockerHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.WalletUnlocker/ChangePassword", runtime.WithHTTPPathPattern("/v1/changepassword")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -376,13 +392,13 @@ func RegisterWalletUnlockerHandlerClient(ctx context.Context, mux *runtime.Serve } var ( - pattern_WalletUnlocker_GenSeed_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "genseed"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletUnlocker_GenSeed_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "genseed"}, "")) - pattern_WalletUnlocker_InitWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "initwallet"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletUnlocker_InitWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "initwallet"}, "")) - pattern_WalletUnlocker_UnlockWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "unlockwallet"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletUnlocker_UnlockWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "unlockwallet"}, "")) - pattern_WalletUnlocker_ChangePassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "changepassword"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WalletUnlocker_ChangePassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "changepassword"}, "")) ) var ( diff --git a/lnrpc/walletunlocker.swagger.json b/lnrpc/walletunlocker.swagger.json index 1071ed8ff..b93505c74 100644 --- a/lnrpc/walletunlocker.swagger.json +++ b/lnrpc/walletunlocker.swagger.json @@ -4,6 +4,11 @@ "title": "walletunlocker.proto", "version": "version not set" }, + "tags": [ + { + "name": "WalletUnlocker" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v1/changepassword": { "post": { "summary": "lncli: `changepassword`\nChangePassword changes the password of the encrypted wallet. This will\nautomatically unlock the wallet database if successful.", - "operationId": "ChangePassword", + "operationId": "WalletUnlocker_ChangePassword", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -48,7 +53,7 @@ "get": { "summary": "GenSeed is the first method that should be used to instantiate a new lnd\ninstance. This method allows a caller to generate a new aezeed cipher seed\ngiven an optional passphrase. If provided, the passphrase will be necessary\nto decrypt the cipherseed to expose the internal wallet seed.", "description": "Once the cipherseed is obtained and verified by the user, the InitWallet\nmethod should be used to commit the newly generated seed, and create the\nwallet.", - "operationId": "GenSeed", + "operationId": "WalletUnlocker_GenSeed", "responses": { "200": { "description": "A successful response.", @@ -57,9 +62,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -90,7 +95,7 @@ "post": { "summary": "InitWallet is used when lnd is starting up for the first time to fully\ninitialize the daemon and its internal wallet. At the very least a wallet\npassword must be provided. This will be used to encrypt sensitive material\non disk.", "description": "In the case of a recovery scenario, the user can also specify their aezeed\nmnemonic and passphrase. If set, then the daemon will use this prior state\nto initialize its internal wallet.\n\nAlternatively, this can be used along with the GenSeed RPC to obtain a\nseed, then present it to the user. Once it has been verified by the user,\nthe seed can be fed into this RPC in order to commit the new wallet.", - "operationId": "InitWallet", + "operationId": "WalletUnlocker_InitWallet", "responses": { "200": { "description": "A successful response.", @@ -99,9 +104,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -123,7 +128,7 @@ "/v1/unlockwallet": { "post": { "summary": "lncli: `unlock`\nUnlockWallet is used at startup of lnd to provide a password to unlock\nthe wallet database.", - "operationId": "UnlockWallet", + "operationId": "WalletUnlocker_UnlockWallet", "responses": { "200": { "description": "A successful response.", @@ -132,9 +137,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -183,12 +188,10 @@ }, "stateless_init": { "type": "boolean", - "format": "boolean", "title": "stateless_init is an optional argument instructing the daemon NOT to create\nany *.macaroon files in its filesystem. If this parameter is set, then the\nadmin macaroon returned in the response MUST be stored by the caller of the\nRPC as otherwise all access to the daemon will be lost!" }, "new_macaroon_root_key": { "type": "boolean", - "format": "boolean", "description": "new_macaroon_root_key is an optional argument instructing the daemon to\nrotate the macaroon root key when set to true. This will invalidate all\npreviously generated macaroons." } } @@ -296,7 +299,6 @@ }, "stateless_init": { "type": "boolean", - "format": "boolean", "title": "stateless_init is an optional argument instructing the daemon NOT to create\nany *.macaroon files in its filesystem. If this parameter is set, then the\nadmin macaroon returned in the response MUST be stored by the caller of the\nRPC as otherwise all access to the daemon will be lost!" } } @@ -347,7 +349,6 @@ }, "stateless_init": { "type": "boolean", - "format": "boolean", "description": "stateless_init is an optional argument instructing the daemon NOT to create\nany *.macaroon files in its file system." } } @@ -367,12 +368,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" diff --git a/lnrpc/walletunlocker_grpc.pb.go b/lnrpc/walletunlocker_grpc.pb.go new file mode 100644 index 000000000..e35116126 --- /dev/null +++ b/lnrpc/walletunlocker_grpc.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package lnrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WalletUnlockerClient is the client API for WalletUnlocker service. +// +// 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 WalletUnlockerClient interface { + // + //GenSeed is the first method that should be used to instantiate a new lnd + //instance. This method allows a caller to generate a new aezeed cipher seed + //given an optional passphrase. If provided, the passphrase will be necessary + //to decrypt the cipherseed to expose the internal wallet seed. + // + //Once the cipherseed is obtained and verified by the user, the InitWallet + //method should be used to commit the newly generated seed, and create the + //wallet. + GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error) + // + //InitWallet is used when lnd is starting up for the first time to fully + //initialize the daemon and its internal wallet. At the very least a wallet + //password must be provided. This will be used to encrypt sensitive material + //on disk. + // + //In the case of a recovery scenario, the user can also specify their aezeed + //mnemonic and passphrase. If set, then the daemon will use this prior state + //to initialize its internal wallet. + // + //Alternatively, this can be used along with the GenSeed RPC to obtain a + //seed, then present it to the user. Once it has been verified by the user, + //the seed can be fed into this RPC in order to commit the new wallet. + InitWallet(ctx context.Context, in *InitWalletRequest, opts ...grpc.CallOption) (*InitWalletResponse, error) + // lncli: `unlock` + //UnlockWallet is used at startup of lnd to provide a password to unlock + //the wallet database. + UnlockWallet(ctx context.Context, in *UnlockWalletRequest, opts ...grpc.CallOption) (*UnlockWalletResponse, error) + // lncli: `changepassword` + //ChangePassword changes the password of the encrypted wallet. This will + //automatically unlock the wallet database if successful. + ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) +} + +type walletUnlockerClient struct { + cc grpc.ClientConnInterface +} + +func NewWalletUnlockerClient(cc grpc.ClientConnInterface) WalletUnlockerClient { + return &walletUnlockerClient{cc} +} + +func (c *walletUnlockerClient) GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error) { + out := new(GenSeedResponse) + err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/GenSeed", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletUnlockerClient) InitWallet(ctx context.Context, in *InitWalletRequest, opts ...grpc.CallOption) (*InitWalletResponse, error) { + out := new(InitWalletResponse) + err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/InitWallet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletUnlockerClient) UnlockWallet(ctx context.Context, in *UnlockWalletRequest, opts ...grpc.CallOption) (*UnlockWalletResponse, error) { + out := new(UnlockWalletResponse) + err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/UnlockWallet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletUnlockerClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) { + out := new(ChangePasswordResponse) + err := c.cc.Invoke(ctx, "/lnrpc.WalletUnlocker/ChangePassword", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WalletUnlockerServer is the server API for WalletUnlocker service. +// All implementations must embed UnimplementedWalletUnlockerServer +// for forward compatibility +type WalletUnlockerServer interface { + // + //GenSeed is the first method that should be used to instantiate a new lnd + //instance. This method allows a caller to generate a new aezeed cipher seed + //given an optional passphrase. If provided, the passphrase will be necessary + //to decrypt the cipherseed to expose the internal wallet seed. + // + //Once the cipherseed is obtained and verified by the user, the InitWallet + //method should be used to commit the newly generated seed, and create the + //wallet. + GenSeed(context.Context, *GenSeedRequest) (*GenSeedResponse, error) + // + //InitWallet is used when lnd is starting up for the first time to fully + //initialize the daemon and its internal wallet. At the very least a wallet + //password must be provided. This will be used to encrypt sensitive material + //on disk. + // + //In the case of a recovery scenario, the user can also specify their aezeed + //mnemonic and passphrase. If set, then the daemon will use this prior state + //to initialize its internal wallet. + // + //Alternatively, this can be used along with the GenSeed RPC to obtain a + //seed, then present it to the user. Once it has been verified by the user, + //the seed can be fed into this RPC in order to commit the new wallet. + InitWallet(context.Context, *InitWalletRequest) (*InitWalletResponse, error) + // lncli: `unlock` + //UnlockWallet is used at startup of lnd to provide a password to unlock + //the wallet database. + UnlockWallet(context.Context, *UnlockWalletRequest) (*UnlockWalletResponse, error) + // lncli: `changepassword` + //ChangePassword changes the password of the encrypted wallet. This will + //automatically unlock the wallet database if successful. + ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) + mustEmbedUnimplementedWalletUnlockerServer() +} + +// UnimplementedWalletUnlockerServer must be embedded to have forward compatible implementations. +type UnimplementedWalletUnlockerServer struct { +} + +func (UnimplementedWalletUnlockerServer) GenSeed(context.Context, *GenSeedRequest) (*GenSeedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenSeed not implemented") +} +func (UnimplementedWalletUnlockerServer) InitWallet(context.Context, *InitWalletRequest) (*InitWalletResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitWallet not implemented") +} +func (UnimplementedWalletUnlockerServer) UnlockWallet(context.Context, *UnlockWalletRequest) (*UnlockWalletResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnlockWallet not implemented") +} +func (UnimplementedWalletUnlockerServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented") +} +func (UnimplementedWalletUnlockerServer) mustEmbedUnimplementedWalletUnlockerServer() {} + +// UnsafeWalletUnlockerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WalletUnlockerServer will +// result in compilation errors. +type UnsafeWalletUnlockerServer interface { + mustEmbedUnimplementedWalletUnlockerServer() +} + +func RegisterWalletUnlockerServer(s grpc.ServiceRegistrar, srv WalletUnlockerServer) { + s.RegisterService(&WalletUnlocker_ServiceDesc, srv) +} + +func _WalletUnlocker_GenSeed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GenSeedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletUnlockerServer).GenSeed(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.WalletUnlocker/GenSeed", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletUnlockerServer).GenSeed(ctx, req.(*GenSeedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletUnlocker_InitWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitWalletRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletUnlockerServer).InitWallet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.WalletUnlocker/InitWallet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletUnlockerServer).InitWallet(ctx, req.(*InitWalletRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletUnlocker_UnlockWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnlockWalletRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletUnlockerServer).UnlockWallet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.WalletUnlocker/UnlockWallet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletUnlockerServer).UnlockWallet(ctx, req.(*UnlockWalletRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletUnlocker_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangePasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletUnlockerServer).ChangePassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lnrpc.WalletUnlocker/ChangePassword", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletUnlockerServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WalletUnlocker_ServiceDesc is the grpc.ServiceDesc for WalletUnlocker service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WalletUnlocker_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "lnrpc.WalletUnlocker", + HandlerType: (*WalletUnlockerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GenSeed", + Handler: _WalletUnlocker_GenSeed_Handler, + }, + { + MethodName: "InitWallet", + Handler: _WalletUnlocker_InitWallet_Handler, + }, + { + MethodName: "UnlockWallet", + Handler: _WalletUnlocker_UnlockWallet_Handler, + }, + { + MethodName: "ChangePassword", + Handler: _WalletUnlocker_ChangePassword_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "walletunlocker.proto", +} diff --git a/lnrpc/watchtowerrpc/handler.go b/lnrpc/watchtowerrpc/handler.go index 88add9d06..a9b602160 100644 --- a/lnrpc/watchtowerrpc/handler.go +++ b/lnrpc/watchtowerrpc/handler.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/lnrpc" "google.golang.org/grpc" "gopkg.in/macaroon-bakery.v2/bakery" @@ -45,6 +45,9 @@ type ServerShell struct { // Handler is the RPC server we'll use to interact with the backing active // watchtower. type Handler struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedWatchtowerServer + cfg Config } @@ -58,7 +61,7 @@ var _ WatchtowerServer = (*Handler)(nil) // on start up. If we're unable to locate, or create the macaroons we need, then // we'll return with an error. func New(cfg *Config) (*Handler, lnrpc.MacaroonPerms, error) { - return &Handler{*cfg}, macPermissions, nil + return &Handler{cfg: *cfg}, macPermissions, nil } // Start launches any helper goroutines required for the Handler to function. diff --git a/lnrpc/watchtowerrpc/watchtower.pb.go b/lnrpc/watchtowerrpc/watchtower.pb.go index e98831d8e..6b86b0218 100644 --- a/lnrpc/watchtowerrpc/watchtower.pb.go +++ b/lnrpc/watchtowerrpc/watchtower.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: watchtowerrpc/watchtower.proto package watchtowerrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type GetInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -235,91 +226,3 @@ func file_watchtowerrpc_watchtower_proto_init() { file_watchtowerrpc_watchtower_proto_goTypes = nil file_watchtowerrpc_watchtower_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// WatchtowerClient is the client API for Watchtower service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WatchtowerClient interface { - // lncli: tower info - //GetInfo returns general information concerning the companion watchtower - //including its public key and URIs where the server is currently - //listening for clients. - GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) -} - -type watchtowerClient struct { - cc grpc.ClientConnInterface -} - -func NewWatchtowerClient(cc grpc.ClientConnInterface) WatchtowerClient { - return &watchtowerClient{cc} -} - -func (c *watchtowerClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { - out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, "/watchtowerrpc.Watchtower/GetInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WatchtowerServer is the server API for Watchtower service. -type WatchtowerServer interface { - // lncli: tower info - //GetInfo returns general information concerning the companion watchtower - //including its public key and URIs where the server is currently - //listening for clients. - GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) -} - -// UnimplementedWatchtowerServer can be embedded to have forward compatible implementations. -type UnimplementedWatchtowerServer struct { -} - -func (*UnimplementedWatchtowerServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") -} - -func RegisterWatchtowerServer(s *grpc.Server, srv WatchtowerServer) { - s.RegisterService(&_Watchtower_serviceDesc, srv) -} - -func _Watchtower_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerServer).GetInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/watchtowerrpc.Watchtower/GetInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerServer).GetInfo(ctx, req.(*GetInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Watchtower_serviceDesc = grpc.ServiceDesc{ - ServiceName: "watchtowerrpc.Watchtower", - HandlerType: (*WatchtowerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetInfo", - Handler: _Watchtower_GetInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "watchtowerrpc/watchtower.proto", -} diff --git a/lnrpc/watchtowerrpc/watchtower.pb.gw.go b/lnrpc/watchtowerrpc/watchtower.pb.gw.go index 5fecdb720..7c8c19ddc 100644 --- a/lnrpc/watchtowerrpc/watchtower.pb.gw.go +++ b/lnrpc/watchtowerrpc/watchtower.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_Watchtower_GetInfo_0(ctx context.Context, marshaler runtime.Marshaler, client WatchtowerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetInfoRequest @@ -52,18 +52,22 @@ func local_request_Watchtower_GetInfo_0(ctx context.Context, marshaler runtime.M // RegisterWatchtowerHandlerServer registers the http handlers for service Watchtower to "mux". // UnaryRPC :call WatchtowerServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWatchtowerHandlerFromEndpoint instead. func RegisterWatchtowerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WatchtowerServer) error { mux.Handle("GET", pattern_Watchtower_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/watchtowerrpc.Watchtower/GetInfo", runtime.WithHTTPPathPattern("/v2/watchtower/server")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_Watchtower_GetInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -119,7 +123,7 @@ func RegisterWatchtowerHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/watchtowerrpc.Watchtower/GetInfo", runtime.WithHTTPPathPattern("/v2/watchtower/server")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -139,7 +143,7 @@ func RegisterWatchtowerHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_Watchtower_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "watchtower", "server"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Watchtower_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "watchtower", "server"}, "")) ) var ( diff --git a/lnrpc/watchtowerrpc/watchtower.swagger.json b/lnrpc/watchtowerrpc/watchtower.swagger.json index 60d4023f8..4c50729f7 100644 --- a/lnrpc/watchtowerrpc/watchtower.swagger.json +++ b/lnrpc/watchtowerrpc/watchtower.swagger.json @@ -4,6 +4,11 @@ "title": "watchtowerrpc/watchtower.proto", "version": "version not set" }, + "tags": [ + { + "name": "Watchtower" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/watchtower/server": { "get": { "summary": "lncli: tower info\nGetInfo returns general information concerning the companion watchtower\nincluding its public key and URIs where the server is currently\nlistening for clients.", - "operationId": "GetInfo", + "operationId": "Watchtower_GetInfo", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -48,12 +53,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" diff --git a/lnrpc/watchtowerrpc/watchtower_grpc.pb.go b/lnrpc/watchtowerrpc/watchtower_grpc.pb.go new file mode 100644 index 000000000..d5a13d3a3 --- /dev/null +++ b/lnrpc/watchtowerrpc/watchtower_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package watchtowerrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WatchtowerClient is the client API for Watchtower service. +// +// 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 WatchtowerClient interface { + // lncli: tower info + //GetInfo returns general information concerning the companion watchtower + //including its public key and URIs where the server is currently + //listening for clients. + GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) +} + +type watchtowerClient struct { + cc grpc.ClientConnInterface +} + +func NewWatchtowerClient(cc grpc.ClientConnInterface) WatchtowerClient { + return &watchtowerClient{cc} +} + +func (c *watchtowerClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { + out := new(GetInfoResponse) + err := c.cc.Invoke(ctx, "/watchtowerrpc.Watchtower/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WatchtowerServer is the server API for Watchtower service. +// All implementations must embed UnimplementedWatchtowerServer +// for forward compatibility +type WatchtowerServer interface { + // lncli: tower info + //GetInfo returns general information concerning the companion watchtower + //including its public key and URIs where the server is currently + //listening for clients. + GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) + mustEmbedUnimplementedWatchtowerServer() +} + +// UnimplementedWatchtowerServer must be embedded to have forward compatible implementations. +type UnimplementedWatchtowerServer struct { +} + +func (UnimplementedWatchtowerServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedWatchtowerServer) mustEmbedUnimplementedWatchtowerServer() {} + +// UnsafeWatchtowerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WatchtowerServer will +// result in compilation errors. +type UnsafeWatchtowerServer interface { + mustEmbedUnimplementedWatchtowerServer() +} + +func RegisterWatchtowerServer(s grpc.ServiceRegistrar, srv WatchtowerServer) { + s.RegisterService(&Watchtower_ServiceDesc, srv) +} + +func _Watchtower_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/watchtowerrpc.Watchtower/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerServer).GetInfo(ctx, req.(*GetInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Watchtower_ServiceDesc is the grpc.ServiceDesc for Watchtower service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Watchtower_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "watchtowerrpc.Watchtower", + HandlerType: (*WatchtowerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _Watchtower_GetInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "watchtowerrpc/watchtower.proto", +} diff --git a/lnrpc/wtclientrpc/wtclient.go b/lnrpc/wtclientrpc/wtclient.go index 683866e4a..a42f560ac 100644 --- a/lnrpc/wtclientrpc/wtclient.go +++ b/lnrpc/wtclientrpc/wtclient.go @@ -8,7 +8,7 @@ import ( "strconv" "github.com/btcsuite/btcd/btcec" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/lncfg" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lnwire" @@ -76,6 +76,9 @@ type ServerShell struct { // // TODO(wilmer): better name? type WatchtowerClient struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + UnimplementedWatchtowerClientServer + cfg Config } @@ -89,7 +92,7 @@ var _ WatchtowerClientServer = (*WatchtowerClient)(nil) // then we'll create them on start up. If we're unable to locate, or create the // macaroons we need, then we'll return with an error. func New(cfg *Config) (*WatchtowerClient, lnrpc.MacaroonPerms, error) { - return &WatchtowerClient{*cfg}, macPermissions, nil + return &WatchtowerClient{cfg: *cfg}, macPermissions, nil } // Start launches any helper goroutines required for the WatchtowerClient to diff --git a/lnrpc/wtclientrpc/wtclient.pb.go b/lnrpc/wtclientrpc/wtclient.pb.go index 8ef388130..40addafd1 100644 --- a/lnrpc/wtclientrpc/wtclient.pb.go +++ b/lnrpc/wtclientrpc/wtclient.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.26.0 // protoc v3.6.1 // source: wtclientrpc/wtclient.proto package wtclientrpc import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type PolicyType int32 const ( @@ -1218,291 +1209,3 @@ func file_wtclientrpc_wtclient_proto_init() { file_wtclientrpc_wtclient_proto_goTypes = nil file_wtclientrpc_wtclient_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// WatchtowerClientClient is the client API for WatchtowerClient service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WatchtowerClientClient interface { - // - //AddTower adds a new watchtower reachable at the given address and - //considers it for new sessions. If the watchtower already exists, then - //any new addresses included will be considered when dialing it for - //session negotiations and backups. - AddTower(ctx context.Context, in *AddTowerRequest, opts ...grpc.CallOption) (*AddTowerResponse, error) - // - //RemoveTower removes a watchtower from being considered for future session - //negotiations and from being used for any subsequent backups until it's added - //again. If an address is provided, then this RPC only serves as a way of - //removing the address from the watchtower instead. - RemoveTower(ctx context.Context, in *RemoveTowerRequest, opts ...grpc.CallOption) (*RemoveTowerResponse, error) - // ListTowers returns the list of watchtowers registered with the client. - ListTowers(ctx context.Context, in *ListTowersRequest, opts ...grpc.CallOption) (*ListTowersResponse, error) - // GetTowerInfo retrieves information for a registered watchtower. - GetTowerInfo(ctx context.Context, in *GetTowerInfoRequest, opts ...grpc.CallOption) (*Tower, error) - // Stats returns the in-memory statistics of the client since startup. - Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) - // Policy returns the active watchtower client policy configuration. - Policy(ctx context.Context, in *PolicyRequest, opts ...grpc.CallOption) (*PolicyResponse, error) -} - -type watchtowerClientClient struct { - cc grpc.ClientConnInterface -} - -func NewWatchtowerClientClient(cc grpc.ClientConnInterface) WatchtowerClientClient { - return &watchtowerClientClient{cc} -} - -func (c *watchtowerClientClient) AddTower(ctx context.Context, in *AddTowerRequest, opts ...grpc.CallOption) (*AddTowerResponse, error) { - out := new(AddTowerResponse) - err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/AddTower", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *watchtowerClientClient) RemoveTower(ctx context.Context, in *RemoveTowerRequest, opts ...grpc.CallOption) (*RemoveTowerResponse, error) { - out := new(RemoveTowerResponse) - err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/RemoveTower", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *watchtowerClientClient) ListTowers(ctx context.Context, in *ListTowersRequest, opts ...grpc.CallOption) (*ListTowersResponse, error) { - out := new(ListTowersResponse) - err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/ListTowers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *watchtowerClientClient) GetTowerInfo(ctx context.Context, in *GetTowerInfoRequest, opts ...grpc.CallOption) (*Tower, error) { - out := new(Tower) - err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/GetTowerInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *watchtowerClientClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) { - out := new(StatsResponse) - err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/Stats", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *watchtowerClientClient) Policy(ctx context.Context, in *PolicyRequest, opts ...grpc.CallOption) (*PolicyResponse, error) { - out := new(PolicyResponse) - err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/Policy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WatchtowerClientServer is the server API for WatchtowerClient service. -type WatchtowerClientServer interface { - // - //AddTower adds a new watchtower reachable at the given address and - //considers it for new sessions. If the watchtower already exists, then - //any new addresses included will be considered when dialing it for - //session negotiations and backups. - AddTower(context.Context, *AddTowerRequest) (*AddTowerResponse, error) - // - //RemoveTower removes a watchtower from being considered for future session - //negotiations and from being used for any subsequent backups until it's added - //again. If an address is provided, then this RPC only serves as a way of - //removing the address from the watchtower instead. - RemoveTower(context.Context, *RemoveTowerRequest) (*RemoveTowerResponse, error) - // ListTowers returns the list of watchtowers registered with the client. - ListTowers(context.Context, *ListTowersRequest) (*ListTowersResponse, error) - // GetTowerInfo retrieves information for a registered watchtower. - GetTowerInfo(context.Context, *GetTowerInfoRequest) (*Tower, error) - // Stats returns the in-memory statistics of the client since startup. - Stats(context.Context, *StatsRequest) (*StatsResponse, error) - // Policy returns the active watchtower client policy configuration. - Policy(context.Context, *PolicyRequest) (*PolicyResponse, error) -} - -// UnimplementedWatchtowerClientServer can be embedded to have forward compatible implementations. -type UnimplementedWatchtowerClientServer struct { -} - -func (*UnimplementedWatchtowerClientServer) AddTower(context.Context, *AddTowerRequest) (*AddTowerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddTower not implemented") -} -func (*UnimplementedWatchtowerClientServer) RemoveTower(context.Context, *RemoveTowerRequest) (*RemoveTowerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveTower not implemented") -} -func (*UnimplementedWatchtowerClientServer) ListTowers(context.Context, *ListTowersRequest) (*ListTowersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTowers not implemented") -} -func (*UnimplementedWatchtowerClientServer) GetTowerInfo(context.Context, *GetTowerInfoRequest) (*Tower, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTowerInfo not implemented") -} -func (*UnimplementedWatchtowerClientServer) Stats(context.Context, *StatsRequest) (*StatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Stats not implemented") -} -func (*UnimplementedWatchtowerClientServer) Policy(context.Context, *PolicyRequest) (*PolicyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Policy not implemented") -} - -func RegisterWatchtowerClientServer(s *grpc.Server, srv WatchtowerClientServer) { - s.RegisterService(&_WatchtowerClient_serviceDesc, srv) -} - -func _WatchtowerClient_AddTower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddTowerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerClientServer).AddTower(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wtclientrpc.WatchtowerClient/AddTower", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerClientServer).AddTower(ctx, req.(*AddTowerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WatchtowerClient_RemoveTower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveTowerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerClientServer).RemoveTower(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wtclientrpc.WatchtowerClient/RemoveTower", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerClientServer).RemoveTower(ctx, req.(*RemoveTowerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WatchtowerClient_ListTowers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTowersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerClientServer).ListTowers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wtclientrpc.WatchtowerClient/ListTowers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerClientServer).ListTowers(ctx, req.(*ListTowersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WatchtowerClient_GetTowerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTowerInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerClientServer).GetTowerInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wtclientrpc.WatchtowerClient/GetTowerInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerClientServer).GetTowerInfo(ctx, req.(*GetTowerInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WatchtowerClient_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerClientServer).Stats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wtclientrpc.WatchtowerClient/Stats", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerClientServer).Stats(ctx, req.(*StatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _WatchtowerClient_Policy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchtowerClientServer).Policy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wtclientrpc.WatchtowerClient/Policy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchtowerClientServer).Policy(ctx, req.(*PolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _WatchtowerClient_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wtclientrpc.WatchtowerClient", - HandlerType: (*WatchtowerClientServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddTower", - Handler: _WatchtowerClient_AddTower_Handler, - }, - { - MethodName: "RemoveTower", - Handler: _WatchtowerClient_RemoveTower_Handler, - }, - { - MethodName: "ListTowers", - Handler: _WatchtowerClient_ListTowers_Handler, - }, - { - MethodName: "GetTowerInfo", - Handler: _WatchtowerClient_GetTowerInfo_Handler, - }, - { - MethodName: "Stats", - Handler: _WatchtowerClient_Stats_Handler, - }, - { - MethodName: "Policy", - Handler: _WatchtowerClient_Policy_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "wtclientrpc/wtclient.proto", -} diff --git a/lnrpc/wtclientrpc/wtclient.pb.gw.go b/lnrpc/wtclientrpc/wtclient.pb.gw.go index c650cfec2..331976431 100644 --- a/lnrpc/wtclientrpc/wtclient.pb.gw.go +++ b/lnrpc/wtclientrpc/wtclient.pb.gw.go @@ -13,14 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -29,7 +29,7 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage +var _ = metadata.Join func request_WatchtowerClient_AddTower_0(ctx context.Context, marshaler runtime.Marshaler, client WatchtowerClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AddTowerRequest @@ -86,7 +86,6 @@ func request_WatchtowerClient_RemoveTower_0(ctx context.Context, marshaler runti } protoReq.Pubkey, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) } @@ -120,12 +119,14 @@ func local_request_WatchtowerClient_RemoveTower_0(ctx context.Context, marshaler } protoReq.Pubkey, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WatchtowerClient_RemoveTower_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WatchtowerClient_RemoveTower_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -158,7 +159,10 @@ func local_request_WatchtowerClient_ListTowers_0(ctx context.Context, marshaler var protoReq ListTowersRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WatchtowerClient_ListTowers_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WatchtowerClient_ListTowers_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -188,7 +192,6 @@ func request_WatchtowerClient_GetTowerInfo_0(ctx context.Context, marshaler runt } protoReq.Pubkey, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) } @@ -222,12 +225,14 @@ func local_request_WatchtowerClient_GetTowerInfo_0(ctx context.Context, marshale } protoReq.Pubkey, err = runtime.Bytes(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WatchtowerClient_GetTowerInfo_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WatchtowerClient_GetTowerInfo_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -278,7 +283,10 @@ func local_request_WatchtowerClient_Policy_0(ctx context.Context, marshaler runt var protoReq PolicyRequest var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WatchtowerClient_Policy_0); err != nil { + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WatchtowerClient_Policy_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -290,18 +298,22 @@ func local_request_WatchtowerClient_Policy_0(ctx context.Context, marshaler runt // RegisterWatchtowerClientHandlerServer registers the http handlers for service WatchtowerClient to "mux". // UnaryRPC :call WatchtowerClientServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWatchtowerClientHandlerFromEndpoint instead. func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WatchtowerClientServer) error { mux.Handle("POST", pattern_WatchtowerClient_AddTower_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/AddTower", runtime.WithHTTPPathPattern("/v2/watchtower/client")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WatchtowerClient_AddTower_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -315,13 +327,16 @@ func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.Ser mux.Handle("DELETE", pattern_WatchtowerClient_RemoveTower_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/RemoveTower", runtime.WithHTTPPathPattern("/v2/watchtower/client/{pubkey}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WatchtowerClient_RemoveTower_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -335,13 +350,16 @@ func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.Ser mux.Handle("GET", pattern_WatchtowerClient_ListTowers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/ListTowers", runtime.WithHTTPPathPattern("/v2/watchtower/client")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WatchtowerClient_ListTowers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -355,13 +373,16 @@ func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.Ser mux.Handle("GET", pattern_WatchtowerClient_GetTowerInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/GetTowerInfo", runtime.WithHTTPPathPattern("/v2/watchtower/client/info/{pubkey}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WatchtowerClient_GetTowerInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -375,13 +396,16 @@ func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.Ser mux.Handle("GET", pattern_WatchtowerClient_Stats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/Stats", runtime.WithHTTPPathPattern("/v2/watchtower/client/stats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WatchtowerClient_Stats_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -395,13 +419,16 @@ func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.Ser mux.Handle("GET", pattern_WatchtowerClient_Policy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/Policy", runtime.WithHTTPPathPattern("/v2/watchtower/client/policy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } resp, md, err := local_request_WatchtowerClient_Policy_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -457,7 +484,7 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/AddTower", runtime.WithHTTPPathPattern("/v2/watchtower/client")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -477,7 +504,7 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/RemoveTower", runtime.WithHTTPPathPattern("/v2/watchtower/client/{pubkey}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -497,7 +524,7 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/ListTowers", runtime.WithHTTPPathPattern("/v2/watchtower/client")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -517,7 +544,7 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/GetTowerInfo", runtime.WithHTTPPathPattern("/v2/watchtower/client/info/{pubkey}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -537,7 +564,7 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/Stats", runtime.WithHTTPPathPattern("/v2/watchtower/client/stats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -557,7 +584,7 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/wtclientrpc.WatchtowerClient/Policy", runtime.WithHTTPPathPattern("/v2/watchtower/client/policy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -577,17 +604,17 @@ func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.Ser } var ( - pattern_WatchtowerClient_AddTower_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "watchtower", "client"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WatchtowerClient_AddTower_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "watchtower", "client"}, "")) - pattern_WatchtowerClient_RemoveTower_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "watchtower", "client", "pubkey"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WatchtowerClient_RemoveTower_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "watchtower", "client", "pubkey"}, "")) - pattern_WatchtowerClient_ListTowers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "watchtower", "client"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WatchtowerClient_ListTowers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "watchtower", "client"}, "")) - pattern_WatchtowerClient_GetTowerInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v2", "watchtower", "client", "info", "pubkey"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WatchtowerClient_GetTowerInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v2", "watchtower", "client", "info", "pubkey"}, "")) - pattern_WatchtowerClient_Stats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "watchtower", "client", "stats"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WatchtowerClient_Stats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "watchtower", "client", "stats"}, "")) - pattern_WatchtowerClient_Policy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "watchtower", "client", "policy"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_WatchtowerClient_Policy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "watchtower", "client", "policy"}, "")) ) var ( diff --git a/lnrpc/wtclientrpc/wtclient.swagger.json b/lnrpc/wtclientrpc/wtclient.swagger.json index e370de718..9ba618316 100644 --- a/lnrpc/wtclientrpc/wtclient.swagger.json +++ b/lnrpc/wtclientrpc/wtclient.swagger.json @@ -4,6 +4,11 @@ "title": "wtclientrpc/wtclient.proto", "version": "version not set" }, + "tags": [ + { + "name": "WatchtowerClient" + } + ], "consumes": [ "application/json" ], @@ -14,7 +19,7 @@ "/v2/watchtower/client": { "get": { "summary": "ListTowers returns the list of watchtowers registered with the client.", - "operationId": "ListTowers", + "operationId": "WatchtowerClient_ListTowers", "responses": { "200": { "description": "A successful response.", @@ -23,9 +28,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -35,8 +40,7 @@ "description": "Whether we should include sessions with the watchtower in the response.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -45,7 +49,7 @@ }, "post": { "summary": "AddTower adds a new watchtower reachable at the given address and\nconsiders it for new sessions. If the watchtower already exists, then\nany new addresses included will be considered when dialing it for\nsession negotiations and backups.", - "operationId": "AddTower", + "operationId": "WatchtowerClient_AddTower", "responses": { "200": { "description": "A successful response.", @@ -54,9 +58,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -78,7 +82,7 @@ "/v2/watchtower/client/info/{pubkey}": { "get": { "summary": "GetTowerInfo retrieves information for a registered watchtower.", - "operationId": "GetTowerInfo", + "operationId": "WatchtowerClient_GetTowerInfo", "responses": { "200": { "description": "A successful response.", @@ -87,9 +91,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -107,8 +111,7 @@ "description": "Whether we should include sessions with the watchtower in the response.", "in": "query", "required": false, - "type": "boolean", - "format": "boolean" + "type": "boolean" } ], "tags": [ @@ -119,7 +122,7 @@ "/v2/watchtower/client/policy": { "get": { "summary": "Policy returns the active watchtower client policy configuration.", - "operationId": "Policy", + "operationId": "WatchtowerClient_Policy", "responses": { "200": { "description": "A successful response.", @@ -128,9 +131,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -156,7 +159,7 @@ "/v2/watchtower/client/stats": { "get": { "summary": "Stats returns the in-memory statistics of the client since startup.", - "operationId": "Stats", + "operationId": "WatchtowerClient_Stats", "responses": { "200": { "description": "A successful response.", @@ -165,9 +168,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -179,7 +182,7 @@ "/v2/watchtower/client/{pubkey}": { "delete": { "summary": "RemoveTower removes a watchtower from being considered for future session\nnegotiations and from being used for any subsequent backups until it's added\nagain. If an address is provided, then this RPC only serves as a way of\nremoving the address from the watchtower instead.", - "operationId": "RemoveTower", + "operationId": "WatchtowerClient_RemoveTower", "responses": { "200": { "description": "A successful response.", @@ -188,9 +191,9 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/runtimeError" + "$ref": "#/definitions/rpcStatus" } } }, @@ -230,12 +233,9 @@ } } }, - "runtimeError": { + "rpcStatus": { "type": "object", "properties": { - "error": { - "type": "string" - }, "code": { "type": "integer", "format": "int32" @@ -359,7 +359,6 @@ }, "active_session_candidate": { "type": "boolean", - "format": "boolean", "description": "Whether the watchtower is currently a candidate for new sessions." }, "num_sessions": { diff --git a/lnrpc/wtclientrpc/wtclient_grpc.pb.go b/lnrpc/wtclientrpc/wtclient_grpc.pb.go new file mode 100644 index 000000000..4a5fca350 --- /dev/null +++ b/lnrpc/wtclientrpc/wtclient_grpc.pb.go @@ -0,0 +1,309 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package wtclientrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WatchtowerClientClient is the client API for WatchtowerClient service. +// +// 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 WatchtowerClientClient interface { + // + //AddTower adds a new watchtower reachable at the given address and + //considers it for new sessions. If the watchtower already exists, then + //any new addresses included will be considered when dialing it for + //session negotiations and backups. + AddTower(ctx context.Context, in *AddTowerRequest, opts ...grpc.CallOption) (*AddTowerResponse, error) + // + //RemoveTower removes a watchtower from being considered for future session + //negotiations and from being used for any subsequent backups until it's added + //again. If an address is provided, then this RPC only serves as a way of + //removing the address from the watchtower instead. + RemoveTower(ctx context.Context, in *RemoveTowerRequest, opts ...grpc.CallOption) (*RemoveTowerResponse, error) + // ListTowers returns the list of watchtowers registered with the client. + ListTowers(ctx context.Context, in *ListTowersRequest, opts ...grpc.CallOption) (*ListTowersResponse, error) + // GetTowerInfo retrieves information for a registered watchtower. + GetTowerInfo(ctx context.Context, in *GetTowerInfoRequest, opts ...grpc.CallOption) (*Tower, error) + // Stats returns the in-memory statistics of the client since startup. + Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) + // Policy returns the active watchtower client policy configuration. + Policy(ctx context.Context, in *PolicyRequest, opts ...grpc.CallOption) (*PolicyResponse, error) +} + +type watchtowerClientClient struct { + cc grpc.ClientConnInterface +} + +func NewWatchtowerClientClient(cc grpc.ClientConnInterface) WatchtowerClientClient { + return &watchtowerClientClient{cc} +} + +func (c *watchtowerClientClient) AddTower(ctx context.Context, in *AddTowerRequest, opts ...grpc.CallOption) (*AddTowerResponse, error) { + out := new(AddTowerResponse) + err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/AddTower", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *watchtowerClientClient) RemoveTower(ctx context.Context, in *RemoveTowerRequest, opts ...grpc.CallOption) (*RemoveTowerResponse, error) { + out := new(RemoveTowerResponse) + err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/RemoveTower", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *watchtowerClientClient) ListTowers(ctx context.Context, in *ListTowersRequest, opts ...grpc.CallOption) (*ListTowersResponse, error) { + out := new(ListTowersResponse) + err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/ListTowers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *watchtowerClientClient) GetTowerInfo(ctx context.Context, in *GetTowerInfoRequest, opts ...grpc.CallOption) (*Tower, error) { + out := new(Tower) + err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/GetTowerInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *watchtowerClientClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) { + out := new(StatsResponse) + err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/Stats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *watchtowerClientClient) Policy(ctx context.Context, in *PolicyRequest, opts ...grpc.CallOption) (*PolicyResponse, error) { + out := new(PolicyResponse) + err := c.cc.Invoke(ctx, "/wtclientrpc.WatchtowerClient/Policy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WatchtowerClientServer is the server API for WatchtowerClient service. +// All implementations must embed UnimplementedWatchtowerClientServer +// for forward compatibility +type WatchtowerClientServer interface { + // + //AddTower adds a new watchtower reachable at the given address and + //considers it for new sessions. If the watchtower already exists, then + //any new addresses included will be considered when dialing it for + //session negotiations and backups. + AddTower(context.Context, *AddTowerRequest) (*AddTowerResponse, error) + // + //RemoveTower removes a watchtower from being considered for future session + //negotiations and from being used for any subsequent backups until it's added + //again. If an address is provided, then this RPC only serves as a way of + //removing the address from the watchtower instead. + RemoveTower(context.Context, *RemoveTowerRequest) (*RemoveTowerResponse, error) + // ListTowers returns the list of watchtowers registered with the client. + ListTowers(context.Context, *ListTowersRequest) (*ListTowersResponse, error) + // GetTowerInfo retrieves information for a registered watchtower. + GetTowerInfo(context.Context, *GetTowerInfoRequest) (*Tower, error) + // Stats returns the in-memory statistics of the client since startup. + Stats(context.Context, *StatsRequest) (*StatsResponse, error) + // Policy returns the active watchtower client policy configuration. + Policy(context.Context, *PolicyRequest) (*PolicyResponse, error) + mustEmbedUnimplementedWatchtowerClientServer() +} + +// UnimplementedWatchtowerClientServer must be embedded to have forward compatible implementations. +type UnimplementedWatchtowerClientServer struct { +} + +func (UnimplementedWatchtowerClientServer) AddTower(context.Context, *AddTowerRequest) (*AddTowerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddTower not implemented") +} +func (UnimplementedWatchtowerClientServer) RemoveTower(context.Context, *RemoveTowerRequest) (*RemoveTowerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveTower not implemented") +} +func (UnimplementedWatchtowerClientServer) ListTowers(context.Context, *ListTowersRequest) (*ListTowersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTowers not implemented") +} +func (UnimplementedWatchtowerClientServer) GetTowerInfo(context.Context, *GetTowerInfoRequest) (*Tower, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTowerInfo not implemented") +} +func (UnimplementedWatchtowerClientServer) Stats(context.Context, *StatsRequest) (*StatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stats not implemented") +} +func (UnimplementedWatchtowerClientServer) Policy(context.Context, *PolicyRequest) (*PolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Policy not implemented") +} +func (UnimplementedWatchtowerClientServer) mustEmbedUnimplementedWatchtowerClientServer() {} + +// UnsafeWatchtowerClientServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WatchtowerClientServer will +// result in compilation errors. +type UnsafeWatchtowerClientServer interface { + mustEmbedUnimplementedWatchtowerClientServer() +} + +func RegisterWatchtowerClientServer(s grpc.ServiceRegistrar, srv WatchtowerClientServer) { + s.RegisterService(&WatchtowerClient_ServiceDesc, srv) +} + +func _WatchtowerClient_AddTower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddTowerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerClientServer).AddTower(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wtclientrpc.WatchtowerClient/AddTower", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerClientServer).AddTower(ctx, req.(*AddTowerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WatchtowerClient_RemoveTower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveTowerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerClientServer).RemoveTower(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wtclientrpc.WatchtowerClient/RemoveTower", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerClientServer).RemoveTower(ctx, req.(*RemoveTowerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WatchtowerClient_ListTowers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTowersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerClientServer).ListTowers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wtclientrpc.WatchtowerClient/ListTowers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerClientServer).ListTowers(ctx, req.(*ListTowersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WatchtowerClient_GetTowerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTowerInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerClientServer).GetTowerInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wtclientrpc.WatchtowerClient/GetTowerInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerClientServer).GetTowerInfo(ctx, req.(*GetTowerInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WatchtowerClient_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerClientServer).Stats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wtclientrpc.WatchtowerClient/Stats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerClientServer).Stats(ctx, req.(*StatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WatchtowerClient_Policy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WatchtowerClientServer).Policy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wtclientrpc.WatchtowerClient/Policy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WatchtowerClientServer).Policy(ctx, req.(*PolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WatchtowerClient_ServiceDesc is the grpc.ServiceDesc for WatchtowerClient service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WatchtowerClient_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "wtclientrpc.WatchtowerClient", + HandlerType: (*WatchtowerClientServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddTower", + Handler: _WatchtowerClient_AddTower_Handler, + }, + { + MethodName: "RemoveTower", + Handler: _WatchtowerClient_RemoveTower_Handler, + }, + { + MethodName: "ListTowers", + Handler: _WatchtowerClient_ListTowers_Handler, + }, + { + MethodName: "GetTowerInfo", + Handler: _WatchtowerClient_GetTowerInfo_Handler, + }, + { + MethodName: "Stats", + Handler: _WatchtowerClient_Stats_Handler, + }, + { + MethodName: "Policy", + Handler: _WatchtowerClient_Policy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "wtclientrpc/wtclient.proto", +} diff --git a/rpcperms/interceptor.go b/rpcperms/interceptor.go index b45607083..51305ed1c 100644 --- a/rpcperms/interceptor.go +++ b/rpcperms/interceptor.go @@ -90,6 +90,9 @@ var ( // intercepting API calls. This is useful for logging, enforcing permissions // etc. type InterceptorChain struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + lnrpc.UnimplementedStateServer + started sync.Once stopped sync.Once diff --git a/rpcserver.go b/rpcserver.go index 675a7ae31..8ff36d964 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -28,7 +28,7 @@ import ( "github.com/btcsuite/btcwallet/waddrmgr" "github.com/btcsuite/btcwallet/wallet/txauthor" "github.com/davecgh/go-spew/spew" - proxy "github.com/grpc-ecosystem/grpc-gateway/runtime" + proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/autopilot" "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/chainreg" @@ -521,6 +521,11 @@ type rpcServer struct { started int32 // To be used atomically. shutdown int32 // To be used atomically. + // Required by the grpc-gateway/v2 library for forward compatibility. + // Must be after the atomically used variables to not break struct + // alignment. + lnrpc.UnimplementedLightningServer + server *server cfg *Config diff --git a/walletunlocker/service.go b/walletunlocker/service.go index be9ae08bd..9865795c3 100644 --- a/walletunlocker/service.go +++ b/walletunlocker/service.go @@ -109,6 +109,9 @@ type WalletUnlockMsg struct { // initial setup, users can provide their own source of entropy which will be // used to generate the seed that's ultimately used within the wallet. type UnlockerService struct { + // Required by the grpc-gateway/v2 library for forward compatibility. + lnrpc.UnimplementedWalletUnlockerServer + // InitMsgs is a channel that carries all wallet init messages. InitMsgs chan *WalletInitMsg