From 5dc8e14a0763cec6e42c9a554b7596968dc28945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Fri, 25 Oct 2024 19:28:26 +0200 Subject: [PATCH 1/5] lightning-terminal: install git for nodejsbuilder --- dev.Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev.Dockerfile b/dev.Dockerfile index fa61d30bb..5a70f97a0 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -1,6 +1,9 @@ # Start with a NodeJS base image that also contains yarn. FROM node:22.8.0-alpine@sha256:bec0ea49c2333c429b62e74e91f8ba1201b060110745c3a12ff957cd51b363c6 as nodejsbuilder +# Install dependencies to build the app +RUN apk add --no-cache --update git + # Copy in the local repository to build from. COPY . /go/src/github.com/lightninglabs/lightning-terminal From 83d61c6450698aff7c6e8a4f56d46a0c3520ce5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Fri, 25 Oct 2024 10:08:48 +0200 Subject: [PATCH 2/5] multi: bump `loop` and `swapserverrpc` This commit updates the `loop` dependency to version `v0.28.8-beta`. Notably, the actual `loop` reference points to a branch based on top of the `v0.28.8-beta` tag, which modifies `v0.28.8-beta` to use `lnd` version `v0.18.3-beta` rather than `v0.18.3-beta.rc1`. Additionally, we upgrade `github.com/lightninglabs/loop/swapserverrpc` to version `v1.0.10`. As `loop/swapserverrpc` `v1.0.10` references the `reservation.proto`, we need to modify the `build-protos.js` script to include it as on of the fetched protos files. --- app/scripts/build-protos.js | 6 ++++ go.mod | 25 +++++++++------- go.sum | 57 +++++++++++++++++++++---------------- 3 files changed, 52 insertions(+), 36 deletions(-) diff --git a/app/scripts/build-protos.js b/app/scripts/build-protos.js index 1f93bd647..412605b08 100644 --- a/app/scripts/build-protos.js +++ b/app/scripts/build-protos.js @@ -44,6 +44,7 @@ const protoSources = async () => { loop: `lightninglabs/loop/${loopVersion[1]}/looprpc/client.proto`, 'swapserverrpc/server': `lightninglabs/loop/${loopVersion[1]}/swapserverrpc/server.proto`, 'swapserverrpc/common': `lightninglabs/loop/${loopVersion[1]}/swapserverrpc/common.proto`, + 'swapserverrpc/reservation': `lightninglabs/loop/${loopVersion[1]}/swapserverrpc/reservation.proto`, trader: `lightninglabs/pool/${poolVersion[1]}/poolrpc/trader.proto`, 'auctioneerrpc/auctioneer': `lightninglabs/pool/${poolVersion[1]}/auctioneerrpc/auctioneer.proto`, }; @@ -54,6 +55,7 @@ const filePatches = { lnd: 'lnrpc: {}', loop: 'looprpc: {}', 'swapserverrpc/common': 'looprpc: {}', + 'swapserverrpc/reservation': 'looprpc: {}', 'swapserverrpc/server': 'looprpc: {}', trader: 'poolrpc: {}', 'auctioneerrpc/auctioneer': 'poolrpc: {}', @@ -118,6 +120,10 @@ const sanitize = async () => { 'import "common.proto"', 'import "swapserverrpc/common.proto"', ); + content = content.replace( + 'import "reservation.proto"', + 'import "swapserverrpc/reservation.proto"', + ); await fs.writeFile(path, content); } }; diff --git a/go.mod b/go.mod index 2a4031c7c..fe7776ffd 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,9 @@ require ( github.com/lightninglabs/lightning-terminal/autopilotserverrpc v0.0.1 github.com/lightninglabs/lightning-terminal/litrpc v1.0.0 github.com/lightninglabs/lndclient v0.18.0-3 - github.com/lightninglabs/loop v0.28.7-beta - github.com/lightninglabs/loop/swapserverrpc v1.0.8 + github.com/lightninglabs/loop v0.28.8-beta.0.20241025130130-d5df72f56c8c + github.com/lightninglabs/loop/looprpc v1.0.0 + github.com/lightninglabs/loop/swapserverrpc v1.0.10 github.com/lightninglabs/pool v0.6.5-beta.0.20240531084722-4000ec802aaa github.com/lightninglabs/pool/auctioneerrpc v1.1.2 github.com/lightninglabs/taproot-assets v0.4.2-0.20240725155459-2bf18437e945 @@ -41,6 +42,7 @@ require ( ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e // indirect @@ -74,15 +76,17 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/decred/dcrd/lru v1.1.2 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/docker/cli v20.10.17+incompatible // indirect - github.com/docker/docker v24.0.9+incompatible // indirect + github.com/docker/cli v27.1.1+incompatible // indirect + github.com/docker/docker v27.1.1+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/fortytw2/leaktest v1.3.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang-migrate/migrate/v4 v4.17.0 // indirect @@ -100,7 +104,6 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/imdario/mergo v0.3.13 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgconn v1.14.3 // indirect github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 // indirect @@ -110,7 +113,7 @@ require ( github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgtype v1.14.0 // indirect github.com/jackc/pgx/v4 v4.18.2 // indirect - github.com/jackc/pgx/v5 v5.5.4 // indirect + github.com/jackc/pgx/v5 v5.6.0 // indirect github.com/jackc/puddle v1.3.0 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jackpal/gateway v1.0.5 // indirect @@ -143,7 +146,7 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/mholt/acmez v1.0.4 // indirect github.com/miekg/dns v1.1.50 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -186,12 +189,12 @@ require ( go.etcd.io/etcd/raft/v3 v3.5.12 // indirect go.etcd.io/etcd/server/v3 v3.5.12 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/mock v0.4.0 // indirect diff --git a/go.sum b/go.sum index 9a3b3987a..66e2b218b 100644 --- a/go.sum +++ b/go.sum @@ -596,6 +596,8 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= @@ -763,12 +765,12 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dhui/dktest v0.4.0 h1:z05UmuXZHO/bgj/ds2bGMBu8FI4WA+Ag/m3ghL+om7M= github.com/dhui/dktest v0.4.0/go.mod h1:v/Dbz1LgCBOi2Uki2nUqLBGa83hWBGFMu5MrgMDCc78= -github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= -github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= -github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE= +github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/docker v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY= +github.com/docker/docker v27.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -794,6 +796,8 @@ github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0+ github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fergusstrange/embedded-postgres v1.25.0 h1:sa+k2Ycrtz40eCRPOzI7Ry7TtkWXXJ+YRsxpKMDhxK0= github.com/fergusstrange/embedded-postgres v1.25.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -834,8 +838,8 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= @@ -850,6 +854,8 @@ github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -1006,8 +1012,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/improbable-eng/grpc-web v0.12.0 h1:GlCS+lMZzIkfouf7CNqY+qqpowdKuJLSLLcKVfM1oLc= github.com/improbable-eng/grpc-web v0.12.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= @@ -1056,8 +1060,8 @@ github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQ github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.18.2 h1:xVpYkNR5pk5bMCZGfClbO962UIqVABcAGt7ha1s/FeU= github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= -github.com/jackc/pgx/v5 v5.5.4 h1:Xp2aQS8uXButQdnCMWNmvx6UysWQQC+u1EoizjguY+8= -github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= @@ -1153,10 +1157,12 @@ github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 h1:Er1miPZD2X github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4= github.com/lightninglabs/lndclient v0.18.0-3 h1:2k5NZJgtrcJlW3KFhvtquS7CWwKwjFN9rtLNa8MlqRA= github.com/lightninglabs/lndclient v0.18.0-3/go.mod h1:D/0qn5s0JSdB3Kelkw4vl3bqnuZ0IHHORAv9sJjYJcQ= -github.com/lightninglabs/loop v0.28.7-beta h1:wyxPIeUFxlw+Lmx3A7huBXh1cu0IXhTMFVs5y4WIA/Y= -github.com/lightninglabs/loop v0.28.7-beta/go.mod h1:ZJpTb6cQiFJMwGFTcEbSXy0HAkzaVxBxCip1txXVucg= -github.com/lightninglabs/loop/swapserverrpc v1.0.8 h1:bk7dDGuA3JQUsMDqZNyAy5Pcw5xS9jforz7YnyeSxKM= -github.com/lightninglabs/loop/swapserverrpc v1.0.8/go.mod h1:Ml3gMwe/iTRLvu1QGGZzXcr0DYSa9sJGwKPktLaWtwE= +github.com/lightninglabs/loop v0.28.8-beta.0.20241025130130-d5df72f56c8c h1:DQqiAv0xUErCOVtUeVDXKTafJFRcN7Ce32Mu51Ah8Ew= +github.com/lightninglabs/loop v0.28.8-beta.0.20241025130130-d5df72f56c8c/go.mod h1:30wla2TOtMyJ17OhPu3XjXZOKwm9ZZr2cpjcCDvU3ko= +github.com/lightninglabs/loop/looprpc v1.0.0 h1:xry4QPCZShPww660xJm1BVcNFj8etgNeN2vMpfsv3c4= +github.com/lightninglabs/loop/looprpc v1.0.0/go.mod h1:+hPlWT2LGxEUY9mMVB2FcbV3KJmd1cmEezmZQagVUtY= +github.com/lightninglabs/loop/swapserverrpc v1.0.10 h1:ZLib2zUytlYOwCYOEyWUPJE16wyjR3UG0MmG/Kx/NUc= +github.com/lightninglabs/loop/swapserverrpc v1.0.10/go.mod h1:Ml3gMwe/iTRLvu1QGGZzXcr0DYSa9sJGwKPktLaWtwE= github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd h1:D8aRocHpoCv43hL8egXEMYyPmyOiefFHZ66338KQB2s= github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk= github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g= @@ -1222,8 +1228,8 @@ github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1427,18 +1433,20 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -2183,7 +2191,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= From bc18ef9ae88267247f622effa2b721a0c8c15a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Fri, 25 Oct 2024 15:13:00 +0200 Subject: [PATCH 3/5] protos: run `make protos` --- .../swapserverrpc/reservation_pb.d.ts | 116 ++ .../generated/swapserverrpc/reservation_pb.js | 861 +++++++++ .../swapserverrpc/reservation_pb_service.d.ts | 74 + .../swapserverrpc/reservation_pb_service.js | 109 ++ .../generated/swapserverrpc/server_pb.d.ts | 193 +++ .../generated/swapserverrpc/server_pb.js | 1531 ++++++++++++++++- .../swapserverrpc/server_pb_service.d.ts | 59 + .../swapserverrpc/server_pb_service.js | 143 ++ proto/swapserverrpc/reservation.proto | 74 + proto/swapserverrpc/server.proto | 87 +- 10 files changed, 3243 insertions(+), 4 deletions(-) create mode 100644 app/src/types/generated/swapserverrpc/reservation_pb.d.ts create mode 100644 app/src/types/generated/swapserverrpc/reservation_pb.js create mode 100644 app/src/types/generated/swapserverrpc/reservation_pb_service.d.ts create mode 100644 app/src/types/generated/swapserverrpc/reservation_pb_service.js create mode 100644 proto/swapserverrpc/reservation.proto diff --git a/app/src/types/generated/swapserverrpc/reservation_pb.d.ts b/app/src/types/generated/swapserverrpc/reservation_pb.d.ts new file mode 100644 index 000000000..54554d192 --- /dev/null +++ b/app/src/types/generated/swapserverrpc/reservation_pb.d.ts @@ -0,0 +1,116 @@ +// package: looprpc +// file: swapserverrpc/reservation.proto + +import * as jspb from "google-protobuf"; + +export class ReservationNotificationRequest extends jspb.Message { + getProtocolVersion(): ReservationProtocolVersionMap[keyof ReservationProtocolVersionMap]; + setProtocolVersion(value: ReservationProtocolVersionMap[keyof ReservationProtocolVersionMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ReservationNotificationRequest.AsObject; + static toObject(includeInstance: boolean, msg: ReservationNotificationRequest): ReservationNotificationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ReservationNotificationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ReservationNotificationRequest; + static deserializeBinaryFromReader(message: ReservationNotificationRequest, reader: jspb.BinaryReader): ReservationNotificationRequest; +} + +export namespace ReservationNotificationRequest { + export type AsObject = { + protocolVersion: ReservationProtocolVersionMap[keyof ReservationProtocolVersionMap], + } +} + +export class ServerReservationNotification extends jspb.Message { + getReservationId(): Uint8Array | string; + getReservationId_asU8(): Uint8Array; + getReservationId_asB64(): string; + setReservationId(value: Uint8Array | string): void; + + getValue(): string; + setValue(value: string): void; + + getServerKey(): Uint8Array | string; + getServerKey_asU8(): Uint8Array; + getServerKey_asB64(): string; + setServerKey(value: Uint8Array | string): void; + + getExpiry(): number; + setExpiry(value: number): void; + + getProtocolVersion(): ReservationProtocolVersionMap[keyof ReservationProtocolVersionMap]; + setProtocolVersion(value: ReservationProtocolVersionMap[keyof ReservationProtocolVersionMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerReservationNotification.AsObject; + static toObject(includeInstance: boolean, msg: ServerReservationNotification): ServerReservationNotification.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerReservationNotification, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerReservationNotification; + static deserializeBinaryFromReader(message: ServerReservationNotification, reader: jspb.BinaryReader): ServerReservationNotification; +} + +export namespace ServerReservationNotification { + export type AsObject = { + reservationId: Uint8Array | string, + value: string, + serverKey: Uint8Array | string, + expiry: number, + protocolVersion: ReservationProtocolVersionMap[keyof ReservationProtocolVersionMap], + } +} + +export class ServerOpenReservationRequest extends jspb.Message { + getReservationId(): Uint8Array | string; + getReservationId_asU8(): Uint8Array; + getReservationId_asB64(): string; + setReservationId(value: Uint8Array | string): void; + + getClientKey(): Uint8Array | string; + getClientKey_asU8(): Uint8Array; + getClientKey_asB64(): string; + setClientKey(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerOpenReservationRequest.AsObject; + static toObject(includeInstance: boolean, msg: ServerOpenReservationRequest): ServerOpenReservationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerOpenReservationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerOpenReservationRequest; + static deserializeBinaryFromReader(message: ServerOpenReservationRequest, reader: jspb.BinaryReader): ServerOpenReservationRequest; +} + +export namespace ServerOpenReservationRequest { + export type AsObject = { + reservationId: Uint8Array | string, + clientKey: Uint8Array | string, + } +} + +export class ServerOpenReservationResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerOpenReservationResponse.AsObject; + static toObject(includeInstance: boolean, msg: ServerOpenReservationResponse): ServerOpenReservationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerOpenReservationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerOpenReservationResponse; + static deserializeBinaryFromReader(message: ServerOpenReservationResponse, reader: jspb.BinaryReader): ServerOpenReservationResponse; +} + +export namespace ServerOpenReservationResponse { + export type AsObject = { + } +} + +export interface ReservationProtocolVersionMap { + RESERVATION_NONE: 0; + RESERVATION_SERVER_NOTIFY: 1; +} + +export const ReservationProtocolVersion: ReservationProtocolVersionMap; + diff --git a/app/src/types/generated/swapserverrpc/reservation_pb.js b/app/src/types/generated/swapserverrpc/reservation_pb.js new file mode 100644 index 000000000..1ff282601 --- /dev/null +++ b/app/src/types/generated/swapserverrpc/reservation_pb.js @@ -0,0 +1,861 @@ +/* eslint-disable */ +var proto = { looprpc: {} }; + +// source: swapserverrpc/reservation.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = + (typeof globalThis !== 'undefined' && globalThis) || + (typeof window !== 'undefined' && window) || + (typeof global !== 'undefined' && global) || + (typeof self !== 'undefined' && self) || + (function () { return this; }).call(null) || + Function('return this')(); + +goog.exportSymbol('proto.looprpc.ReservationNotificationRequest', null, global); +goog.exportSymbol('proto.looprpc.ReservationProtocolVersion', null, global); +goog.exportSymbol('proto.looprpc.ServerOpenReservationRequest', null, global); +goog.exportSymbol('proto.looprpc.ServerOpenReservationResponse', null, global); +goog.exportSymbol('proto.looprpc.ServerReservationNotification', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ReservationNotificationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ReservationNotificationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ReservationNotificationRequest.displayName = 'proto.looprpc.ReservationNotificationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerReservationNotification = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerReservationNotification, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerReservationNotification.displayName = 'proto.looprpc.ServerReservationNotification'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerOpenReservationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerOpenReservationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerOpenReservationRequest.displayName = 'proto.looprpc.ServerOpenReservationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerOpenReservationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerOpenReservationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerOpenReservationResponse.displayName = 'proto.looprpc.ServerOpenReservationResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ReservationNotificationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ReservationNotificationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ReservationNotificationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ReservationNotificationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + protocolVersion: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ReservationNotificationRequest} + */ +proto.looprpc.ReservationNotificationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ReservationNotificationRequest; + return proto.looprpc.ReservationNotificationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ReservationNotificationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ReservationNotificationRequest} + */ +proto.looprpc.ReservationNotificationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.looprpc.ReservationProtocolVersion} */ (reader.readEnum()); + msg.setProtocolVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ReservationNotificationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ReservationNotificationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ReservationNotificationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ReservationNotificationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProtocolVersion(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * optional ReservationProtocolVersion protocol_version = 1; + * @return {!proto.looprpc.ReservationProtocolVersion} + */ +proto.looprpc.ReservationNotificationRequest.prototype.getProtocolVersion = function() { + return /** @type {!proto.looprpc.ReservationProtocolVersion} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.looprpc.ReservationProtocolVersion} value + * @return {!proto.looprpc.ReservationNotificationRequest} returns this + */ +proto.looprpc.ReservationNotificationRequest.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerReservationNotification.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerReservationNotification.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerReservationNotification} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerReservationNotification.toObject = function(includeInstance, msg) { + var f, obj = { + reservationId: msg.getReservationId_asB64(), + value: jspb.Message.getFieldWithDefault(msg, 2, "0"), + serverKey: msg.getServerKey_asB64(), + expiry: jspb.Message.getFieldWithDefault(msg, 4, 0), + protocolVersion: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerReservationNotification} + */ +proto.looprpc.ServerReservationNotification.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerReservationNotification; + return proto.looprpc.ServerReservationNotification.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerReservationNotification} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerReservationNotification} + */ +proto.looprpc.ServerReservationNotification.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setReservationId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setValue(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setServerKey(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setExpiry(value); + break; + case 5: + var value = /** @type {!proto.looprpc.ReservationProtocolVersion} */ (reader.readEnum()); + msg.setProtocolVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerReservationNotification.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerReservationNotification.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerReservationNotification} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerReservationNotification.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReservationId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getValue(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } + f = message.getServerKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getExpiry(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } + f = message.getProtocolVersion(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } +}; + + +/** + * optional bytes reservation_id = 1; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerReservationNotification.prototype.getReservationId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes reservation_id = 1; + * This is a type-conversion wrapper around `getReservationId()` + * @return {string} + */ +proto.looprpc.ServerReservationNotification.prototype.getReservationId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getReservationId())); +}; + + +/** + * optional bytes reservation_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getReservationId()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerReservationNotification.prototype.getReservationId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getReservationId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerReservationNotification} returns this + */ +proto.looprpc.ServerReservationNotification.prototype.setReservationId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint64 value = 2; + * @return {string} + */ +proto.looprpc.ServerReservationNotification.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.looprpc.ServerReservationNotification} returns this + */ +proto.looprpc.ServerReservationNotification.prototype.setValue = function(value) { + return jspb.Message.setProto3StringIntField(this, 2, value); +}; + + +/** + * optional bytes server_key = 3; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerReservationNotification.prototype.getServerKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes server_key = 3; + * This is a type-conversion wrapper around `getServerKey()` + * @return {string} + */ +proto.looprpc.ServerReservationNotification.prototype.getServerKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getServerKey())); +}; + + +/** + * optional bytes server_key = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getServerKey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerReservationNotification.prototype.getServerKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getServerKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerReservationNotification} returns this + */ +proto.looprpc.ServerReservationNotification.prototype.setServerKey = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional uint32 expiry = 4; + * @return {number} + */ +proto.looprpc.ServerReservationNotification.prototype.getExpiry = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.looprpc.ServerReservationNotification} returns this + */ +proto.looprpc.ServerReservationNotification.prototype.setExpiry = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional ReservationProtocolVersion protocol_version = 5; + * @return {!proto.looprpc.ReservationProtocolVersion} + */ +proto.looprpc.ServerReservationNotification.prototype.getProtocolVersion = function() { + return /** @type {!proto.looprpc.ReservationProtocolVersion} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.looprpc.ReservationProtocolVersion} value + * @return {!proto.looprpc.ServerReservationNotification} returns this + */ +proto.looprpc.ServerReservationNotification.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerOpenReservationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerOpenReservationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerOpenReservationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + reservationId: msg.getReservationId_asB64(), + clientKey: msg.getClientKey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerOpenReservationRequest} + */ +proto.looprpc.ServerOpenReservationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerOpenReservationRequest; + return proto.looprpc.ServerOpenReservationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerOpenReservationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerOpenReservationRequest} + */ +proto.looprpc.ServerOpenReservationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setReservationId(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setClientKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerOpenReservationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerOpenReservationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerOpenReservationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReservationId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getClientKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes reservation_id = 1; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.getReservationId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes reservation_id = 1; + * This is a type-conversion wrapper around `getReservationId()` + * @return {string} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.getReservationId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getReservationId())); +}; + + +/** + * optional bytes reservation_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getReservationId()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.getReservationId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getReservationId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerOpenReservationRequest} returns this + */ +proto.looprpc.ServerOpenReservationRequest.prototype.setReservationId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes client_key = 2; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.getClientKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes client_key = 2; + * This is a type-conversion wrapper around `getClientKey()` + * @return {string} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.getClientKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getClientKey())); +}; + + +/** + * optional bytes client_key = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getClientKey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerOpenReservationRequest.prototype.getClientKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getClientKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerOpenReservationRequest} returns this + */ +proto.looprpc.ServerOpenReservationRequest.prototype.setClientKey = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerOpenReservationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerOpenReservationResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerOpenReservationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerOpenReservationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerOpenReservationResponse} + */ +proto.looprpc.ServerOpenReservationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerOpenReservationResponse; + return proto.looprpc.ServerOpenReservationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerOpenReservationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerOpenReservationResponse} + */ +proto.looprpc.ServerOpenReservationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerOpenReservationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerOpenReservationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerOpenReservationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerOpenReservationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +/** + * @enum {number} + */ +proto.looprpc.ReservationProtocolVersion = { + RESERVATION_NONE: 0, + RESERVATION_SERVER_NOTIFY: 1 +}; + +goog.object.extend(exports, proto.looprpc); diff --git a/app/src/types/generated/swapserverrpc/reservation_pb_service.d.ts b/app/src/types/generated/swapserverrpc/reservation_pb_service.d.ts new file mode 100644 index 000000000..6d48b6cbc --- /dev/null +++ b/app/src/types/generated/swapserverrpc/reservation_pb_service.d.ts @@ -0,0 +1,74 @@ +// package: looprpc +// file: swapserverrpc/reservation.proto + +import * as swapserverrpc_reservation_pb from "../swapserverrpc/reservation_pb"; +import {grpc} from "@improbable-eng/grpc-web"; + +type ReservationServiceReservationNotificationStream = { + readonly methodName: string; + readonly service: typeof ReservationService; + readonly requestStream: false; + readonly responseStream: true; + readonly requestType: typeof swapserverrpc_reservation_pb.ReservationNotificationRequest; + readonly responseType: typeof swapserverrpc_reservation_pb.ServerReservationNotification; +}; + +type ReservationServiceOpenReservation = { + readonly methodName: string; + readonly service: typeof ReservationService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof swapserverrpc_reservation_pb.ServerOpenReservationRequest; + readonly responseType: typeof swapserverrpc_reservation_pb.ServerOpenReservationResponse; +}; + +export class ReservationService { + static readonly serviceName: string; + static readonly ReservationNotificationStream: ReservationServiceReservationNotificationStream; + static readonly OpenReservation: ReservationServiceOpenReservation; +} + +export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } +export type Status = { details: string, code: number; metadata: grpc.Metadata } + +interface UnaryResponse { + cancel(): void; +} +interface ResponseStream { + cancel(): void; + on(type: 'data', handler: (message: T) => void): ResponseStream; + on(type: 'end', handler: (status?: Status) => void): ResponseStream; + on(type: 'status', handler: (status: Status) => void): ResponseStream; +} +interface RequestStream { + write(message: T): RequestStream; + end(): void; + cancel(): void; + on(type: 'end', handler: (status?: Status) => void): RequestStream; + on(type: 'status', handler: (status: Status) => void): RequestStream; +} +interface BidirectionalStream { + write(message: ReqT): BidirectionalStream; + end(): void; + cancel(): void; + on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; + on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; + on(type: 'status', handler: (status: Status) => void): BidirectionalStream; +} + +export class ReservationServiceClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + reservationNotificationStream(requestMessage: swapserverrpc_reservation_pb.ReservationNotificationRequest, metadata?: grpc.Metadata): ResponseStream; + openReservation( + requestMessage: swapserverrpc_reservation_pb.ServerOpenReservationRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_reservation_pb.ServerOpenReservationResponse|null) => void + ): UnaryResponse; + openReservation( + requestMessage: swapserverrpc_reservation_pb.ServerOpenReservationRequest, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_reservation_pb.ServerOpenReservationResponse|null) => void + ): UnaryResponse; +} + diff --git a/app/src/types/generated/swapserverrpc/reservation_pb_service.js b/app/src/types/generated/swapserverrpc/reservation_pb_service.js new file mode 100644 index 000000000..697e7ba25 --- /dev/null +++ b/app/src/types/generated/swapserverrpc/reservation_pb_service.js @@ -0,0 +1,109 @@ +// package: looprpc +// file: swapserverrpc/reservation.proto + +var swapserverrpc_reservation_pb = require("../swapserverrpc/reservation_pb"); +var grpc = require("@improbable-eng/grpc-web").grpc; + +var ReservationService = (function () { + function ReservationService() {} + ReservationService.serviceName = "looprpc.ReservationService"; + return ReservationService; +}()); + +ReservationService.ReservationNotificationStream = { + methodName: "ReservationNotificationStream", + service: ReservationService, + requestStream: false, + responseStream: true, + requestType: swapserverrpc_reservation_pb.ReservationNotificationRequest, + responseType: swapserverrpc_reservation_pb.ServerReservationNotification +}; + +ReservationService.OpenReservation = { + methodName: "OpenReservation", + service: ReservationService, + requestStream: false, + responseStream: false, + requestType: swapserverrpc_reservation_pb.ServerOpenReservationRequest, + responseType: swapserverrpc_reservation_pb.ServerOpenReservationResponse +}; + +exports.ReservationService = ReservationService; + +function ReservationServiceClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +ReservationServiceClient.prototype.reservationNotificationStream = function reservationNotificationStream(requestMessage, metadata) { + var listeners = { + data: [], + end: [], + status: [] + }; + var client = grpc.invoke(ReservationService.ReservationNotificationStream, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onMessage: function (responseMessage) { + listeners.data.forEach(function (handler) { + handler(responseMessage); + }); + }, + onEnd: function (status, statusMessage, trailers) { + listeners.status.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners.end.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners = null; + } + }); + return { + on: function (type, handler) { + listeners[type].push(handler); + return this; + }, + cancel: function () { + listeners = null; + client.close(); + } + }; +}; + +ReservationServiceClient.prototype.openReservation = function openReservation(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(ReservationService.OpenReservation, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +exports.ReservationServiceClient = ReservationServiceClient; + diff --git a/app/src/types/generated/swapserverrpc/server_pb.d.ts b/app/src/types/generated/swapserverrpc/server_pb.d.ts index ae38bf531..5f94ab1b8 100644 --- a/app/src/types/generated/swapserverrpc/server_pb.d.ts +++ b/app/src/types/generated/swapserverrpc/server_pb.d.ts @@ -3,6 +3,7 @@ import * as jspb from "google-protobuf"; import * as swapserverrpc_common_pb from "../swapserverrpc/common_pb"; +import * as swapserverrpc_reservation_pb from "../swapserverrpc/reservation_pb"; export class ServerLoopOutRequest extends jspb.Message { getReceiverKey(): Uint8Array | string; @@ -347,6 +348,9 @@ export class ServerLoopInQuoteRequest extends jspb.Message { getUserAgent(): string; setUserAgent(value: string): void; + getNumStaticAddressDeposits(): number; + setNumStaticAddressDeposits(value: number): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ServerLoopInQuoteRequest.AsObject; static toObject(includeInstance: boolean, msg: ServerLoopInQuoteRequest): ServerLoopInQuoteRequest.AsObject; @@ -365,6 +369,7 @@ export namespace ServerLoopInQuoteRequest { routeHintsList: Array, protocolVersion: ProtocolVersionMap[keyof ProtocolVersionMap], userAgent: string, + numStaticAddressDeposits: number, } } @@ -1046,6 +1051,194 @@ export namespace FetchL402Response { } } +export class SubscribeNotificationsRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeNotificationsRequest.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeNotificationsRequest): SubscribeNotificationsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeNotificationsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeNotificationsRequest; + static deserializeBinaryFromReader(message: SubscribeNotificationsRequest, reader: jspb.BinaryReader): SubscribeNotificationsRequest; +} + +export namespace SubscribeNotificationsRequest { + export type AsObject = { + } +} + +export class SubscribeNotificationsResponse extends jspb.Message { + hasReservationNotification(): boolean; + clearReservationNotification(): void; + getReservationNotification(): swapserverrpc_reservation_pb.ServerReservationNotification | undefined; + setReservationNotification(value?: swapserverrpc_reservation_pb.ServerReservationNotification): void; + + getNotificationCase(): SubscribeNotificationsResponse.NotificationCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeNotificationsResponse.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeNotificationsResponse): SubscribeNotificationsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeNotificationsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeNotificationsResponse; + static deserializeBinaryFromReader(message: SubscribeNotificationsResponse, reader: jspb.BinaryReader): SubscribeNotificationsResponse; +} + +export namespace SubscribeNotificationsResponse { + export type AsObject = { + reservationNotification?: swapserverrpc_reservation_pb.ServerReservationNotification.AsObject, + } + + export enum NotificationCase { + NOTIFICATION_NOT_SET = 0, + RESERVATION_NOTIFICATION = 1, + } +} + +export class ServerNewAddressRequest extends jspb.Message { + getProtocolVersion(): StaticAddressProtocolVersionMap[keyof StaticAddressProtocolVersionMap]; + setProtocolVersion(value: StaticAddressProtocolVersionMap[keyof StaticAddressProtocolVersionMap]): void; + + getClientKey(): Uint8Array | string; + getClientKey_asU8(): Uint8Array; + getClientKey_asB64(): string; + setClientKey(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerNewAddressRequest.AsObject; + static toObject(includeInstance: boolean, msg: ServerNewAddressRequest): ServerNewAddressRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerNewAddressRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerNewAddressRequest; + static deserializeBinaryFromReader(message: ServerNewAddressRequest, reader: jspb.BinaryReader): ServerNewAddressRequest; +} + +export namespace ServerNewAddressRequest { + export type AsObject = { + protocolVersion: StaticAddressProtocolVersionMap[keyof StaticAddressProtocolVersionMap], + clientKey: Uint8Array | string, + } +} + +export class ServerNewAddressResponse extends jspb.Message { + hasParams(): boolean; + clearParams(): void; + getParams(): ServerAddressParameters | undefined; + setParams(value?: ServerAddressParameters): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerNewAddressResponse.AsObject; + static toObject(includeInstance: boolean, msg: ServerNewAddressResponse): ServerNewAddressResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerNewAddressResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerNewAddressResponse; + static deserializeBinaryFromReader(message: ServerNewAddressResponse, reader: jspb.BinaryReader): ServerNewAddressResponse; +} + +export namespace ServerNewAddressResponse { + export type AsObject = { + params?: ServerAddressParameters.AsObject, + } +} + +export class ServerAddressParameters extends jspb.Message { + getServerKey(): Uint8Array | string; + getServerKey_asU8(): Uint8Array; + getServerKey_asB64(): string; + setServerKey(value: Uint8Array | string): void; + + getExpiry(): number; + setExpiry(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerAddressParameters.AsObject; + static toObject(includeInstance: boolean, msg: ServerAddressParameters): ServerAddressParameters.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerAddressParameters, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerAddressParameters; + static deserializeBinaryFromReader(message: ServerAddressParameters, reader: jspb.BinaryReader): ServerAddressParameters; +} + +export namespace ServerAddressParameters { + export type AsObject = { + serverKey: Uint8Array | string, + expiry: number, + } +} + +export class ServerWithdrawRequest extends jspb.Message { + clearOutpointsList(): void; + getOutpointsList(): Array; + setOutpointsList(value: Array): void; + addOutpoints(value?: PrevoutInfo, index?: number): PrevoutInfo; + + clearClientNoncesList(): void; + getClientNoncesList(): Array; + getClientNoncesList_asU8(): Array; + getClientNoncesList_asB64(): Array; + setClientNoncesList(value: Array): void; + addClientNonces(value: Uint8Array | string, index?: number): Uint8Array | string; + + getClientSweepAddr(): string; + setClientSweepAddr(value: string): void; + + getTxFeeRate(): string; + setTxFeeRate(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerWithdrawRequest.AsObject; + static toObject(includeInstance: boolean, msg: ServerWithdrawRequest): ServerWithdrawRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerWithdrawRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerWithdrawRequest; + static deserializeBinaryFromReader(message: ServerWithdrawRequest, reader: jspb.BinaryReader): ServerWithdrawRequest; +} + +export namespace ServerWithdrawRequest { + export type AsObject = { + outpointsList: Array, + clientNoncesList: Array, + clientSweepAddr: string, + txFeeRate: string, + } +} + +export class ServerWithdrawResponse extends jspb.Message { + clearMusig2SweepSigsList(): void; + getMusig2SweepSigsList(): Array; + getMusig2SweepSigsList_asU8(): Array; + getMusig2SweepSigsList_asB64(): Array; + setMusig2SweepSigsList(value: Array): void; + addMusig2SweepSigs(value: Uint8Array | string, index?: number): Uint8Array | string; + + clearServerNoncesList(): void; + getServerNoncesList(): Array; + getServerNoncesList_asU8(): Array; + getServerNoncesList_asB64(): Array; + setServerNoncesList(value: Array): void; + addServerNonces(value: Uint8Array | string, index?: number): Uint8Array | string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerWithdrawResponse.AsObject; + static toObject(includeInstance: boolean, msg: ServerWithdrawResponse): ServerWithdrawResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerWithdrawResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerWithdrawResponse; + static deserializeBinaryFromReader(message: ServerWithdrawResponse, reader: jspb.BinaryReader): ServerWithdrawResponse; +} + +export namespace ServerWithdrawResponse { + export type AsObject = { + musig2SweepSigsList: Array, + serverNoncesList: Array, + } +} + export interface ProtocolVersionMap { LEGACY: 0; MULTI_LOOP_OUT: 1; diff --git a/app/src/types/generated/swapserverrpc/server_pb.js b/app/src/types/generated/swapserverrpc/server_pb.js index bb4000b71..37ebb24b1 100644 --- a/app/src/types/generated/swapserverrpc/server_pb.js +++ b/app/src/types/generated/swapserverrpc/server_pb.js @@ -26,6 +26,8 @@ var global = var swapserverrpc_common_pb = require('../swapserverrpc/common_pb.js'); goog.object.extend(proto, swapserverrpc_common_pb); +var swapserverrpc_reservation_pb = require('../swapserverrpc/reservation_pb.js'); +goog.object.extend(proto, swapserverrpc_reservation_pb); goog.exportSymbol('proto.looprpc.CancelLoopOutSwapRequest', null, global); goog.exportSymbol('proto.looprpc.CancelLoopOutSwapRequest.CancelInfoCase', null, global); goog.exportSymbol('proto.looprpc.CancelLoopOutSwapResponse', null, global); @@ -44,6 +46,7 @@ goog.exportSymbol('proto.looprpc.ReportRoutingResultRes', null, global); goog.exportSymbol('proto.looprpc.RouteCancel', null, global); goog.exportSymbol('proto.looprpc.RoutePaymentType', null, global); goog.exportSymbol('proto.looprpc.RoutingPlugin', null, global); +goog.exportSymbol('proto.looprpc.ServerAddressParameters', null, global); goog.exportSymbol('proto.looprpc.ServerLoopInQuoteRequest', null, global); goog.exportSymbol('proto.looprpc.ServerLoopInQuoteResponse', null, global); goog.exportSymbol('proto.looprpc.ServerLoopInRequest', null, global); @@ -58,14 +61,21 @@ goog.exportSymbol('proto.looprpc.ServerLoopOutRequest', null, global); goog.exportSymbol('proto.looprpc.ServerLoopOutResponse', null, global); goog.exportSymbol('proto.looprpc.ServerLoopOutTerms', null, global); goog.exportSymbol('proto.looprpc.ServerLoopOutTermsRequest', null, global); +goog.exportSymbol('proto.looprpc.ServerNewAddressRequest', null, global); +goog.exportSymbol('proto.looprpc.ServerNewAddressResponse', null, global); goog.exportSymbol('proto.looprpc.ServerProbeRequest', null, global); goog.exportSymbol('proto.looprpc.ServerProbeResponse', null, global); goog.exportSymbol('proto.looprpc.ServerPushKeyReq', null, global); goog.exportSymbol('proto.looprpc.ServerPushKeyRes', null, global); goog.exportSymbol('proto.looprpc.ServerSwapState', null, global); +goog.exportSymbol('proto.looprpc.ServerWithdrawRequest', null, global); +goog.exportSymbol('proto.looprpc.ServerWithdrawResponse', null, global); goog.exportSymbol('proto.looprpc.StaticAddressProtocolVersion', null, global); goog.exportSymbol('proto.looprpc.SubscribeLoopInUpdatesResponse', null, global); goog.exportSymbol('proto.looprpc.SubscribeLoopOutUpdatesResponse', null, global); +goog.exportSymbol('proto.looprpc.SubscribeNotificationsRequest', null, global); +goog.exportSymbol('proto.looprpc.SubscribeNotificationsResponse', null, global); +goog.exportSymbol('proto.looprpc.SubscribeNotificationsResponse.NotificationCase', null, global); goog.exportSymbol('proto.looprpc.SubscribeUpdatesRequest', null, global); /** * Generated by JsPbCodeGenerator. @@ -781,6 +791,153 @@ if (goog.DEBUG && !COMPILED) { */ proto.looprpc.FetchL402Response.displayName = 'proto.looprpc.FetchL402Response'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.SubscribeNotificationsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.SubscribeNotificationsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.SubscribeNotificationsRequest.displayName = 'proto.looprpc.SubscribeNotificationsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.SubscribeNotificationsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.looprpc.SubscribeNotificationsResponse.oneofGroups_); +}; +goog.inherits(proto.looprpc.SubscribeNotificationsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.SubscribeNotificationsResponse.displayName = 'proto.looprpc.SubscribeNotificationsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerNewAddressRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerNewAddressRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerNewAddressRequest.displayName = 'proto.looprpc.ServerNewAddressRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerNewAddressResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerNewAddressResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerNewAddressResponse.displayName = 'proto.looprpc.ServerNewAddressResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerAddressParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerAddressParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerAddressParameters.displayName = 'proto.looprpc.ServerAddressParameters'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerWithdrawRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.looprpc.ServerWithdrawRequest.repeatedFields_, null); +}; +goog.inherits(proto.looprpc.ServerWithdrawRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerWithdrawRequest.displayName = 'proto.looprpc.ServerWithdrawRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.looprpc.ServerWithdrawResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.looprpc.ServerWithdrawResponse.repeatedFields_, null); +}; +goog.inherits(proto.looprpc.ServerWithdrawResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerWithdrawResponse.displayName = 'proto.looprpc.ServerWithdrawResponse'; +} @@ -3132,7 +3289,8 @@ proto.looprpc.ServerLoopInQuoteRequest.toObject = function(includeInstance, msg) routeHintsList: jspb.Message.toObjectList(msg.getRouteHintsList(), swapserverrpc_common_pb.RouteHint.toObject, includeInstance), protocolVersion: jspb.Message.getFieldWithDefault(msg, 2, 0), - userAgent: jspb.Message.getFieldWithDefault(msg, 6, "") + userAgent: jspb.Message.getFieldWithDefault(msg, 6, ""), + numStaticAddressDeposits: jspb.Message.getFieldWithDefault(msg, 7, 0) }; if (includeInstance) { @@ -3194,6 +3352,10 @@ proto.looprpc.ServerLoopInQuoteRequest.deserializeBinaryFromReader = function(ms var value = /** @type {string} */ (reader.readString()); msg.setUserAgent(value); break; + case 7: + var value = /** @type {number} */ (reader.readUint32()); + msg.setNumStaticAddressDeposits(value); + break; default: reader.skipField(); break; @@ -3266,6 +3428,13 @@ proto.looprpc.ServerLoopInQuoteRequest.serializeBinaryToWriter = function(messag f ); } + f = message.getNumStaticAddressDeposits(); + if (f !== 0) { + writer.writeUint32( + 7, + f + ); + } }; @@ -3445,6 +3614,24 @@ proto.looprpc.ServerLoopInQuoteRequest.prototype.setUserAgent = function(value) }; +/** + * optional uint32 num_static_address_deposits = 7; + * @return {number} + */ +proto.looprpc.ServerLoopInQuoteRequest.prototype.getNumStaticAddressDeposits = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.looprpc.ServerLoopInQuoteRequest} returns this + */ +proto.looprpc.ServerLoopInQuoteRequest.prototype.setNumStaticAddressDeposits = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); +}; + + @@ -8248,6 +8435,1348 @@ proto.looprpc.FetchL402Response.serializeBinaryToWriter = function(message, writ }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.SubscribeNotificationsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.SubscribeNotificationsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.SubscribeNotificationsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.SubscribeNotificationsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.SubscribeNotificationsRequest} + */ +proto.looprpc.SubscribeNotificationsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.SubscribeNotificationsRequest; + return proto.looprpc.SubscribeNotificationsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.SubscribeNotificationsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.SubscribeNotificationsRequest} + */ +proto.looprpc.SubscribeNotificationsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.SubscribeNotificationsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.SubscribeNotificationsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.SubscribeNotificationsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.SubscribeNotificationsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.looprpc.SubscribeNotificationsResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.looprpc.SubscribeNotificationsResponse.NotificationCase = { + NOTIFICATION_NOT_SET: 0, + RESERVATION_NOTIFICATION: 1 +}; + +/** + * @return {proto.looprpc.SubscribeNotificationsResponse.NotificationCase} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.getNotificationCase = function() { + return /** @type {proto.looprpc.SubscribeNotificationsResponse.NotificationCase} */(jspb.Message.computeOneofCase(this, proto.looprpc.SubscribeNotificationsResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.SubscribeNotificationsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.SubscribeNotificationsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.SubscribeNotificationsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + reservationNotification: (f = msg.getReservationNotification()) && swapserverrpc_reservation_pb.ServerReservationNotification.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.SubscribeNotificationsResponse} + */ +proto.looprpc.SubscribeNotificationsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.SubscribeNotificationsResponse; + return proto.looprpc.SubscribeNotificationsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.SubscribeNotificationsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.SubscribeNotificationsResponse} + */ +proto.looprpc.SubscribeNotificationsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new swapserverrpc_reservation_pb.ServerReservationNotification; + reader.readMessage(value,swapserverrpc_reservation_pb.ServerReservationNotification.deserializeBinaryFromReader); + msg.setReservationNotification(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.SubscribeNotificationsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.SubscribeNotificationsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.SubscribeNotificationsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReservationNotification(); + if (f != null) { + writer.writeMessage( + 1, + f, + swapserverrpc_reservation_pb.ServerReservationNotification.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ServerReservationNotification reservation_notification = 1; + * @return {?proto.looprpc.ServerReservationNotification} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.getReservationNotification = function() { + return /** @type{?proto.looprpc.ServerReservationNotification} */ ( + jspb.Message.getWrapperField(this, swapserverrpc_reservation_pb.ServerReservationNotification, 1)); +}; + + +/** + * @param {?proto.looprpc.ServerReservationNotification|undefined} value + * @return {!proto.looprpc.SubscribeNotificationsResponse} returns this +*/ +proto.looprpc.SubscribeNotificationsResponse.prototype.setReservationNotification = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.looprpc.SubscribeNotificationsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.looprpc.SubscribeNotificationsResponse} returns this + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.clearReservationNotification = function() { + return this.setReservationNotification(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.hasReservationNotification = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerNewAddressRequest.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerNewAddressRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerNewAddressRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerNewAddressRequest.toObject = function(includeInstance, msg) { + var f, obj = { + protocolVersion: jspb.Message.getFieldWithDefault(msg, 1, 0), + clientKey: msg.getClientKey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerNewAddressRequest} + */ +proto.looprpc.ServerNewAddressRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerNewAddressRequest; + return proto.looprpc.ServerNewAddressRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerNewAddressRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerNewAddressRequest} + */ +proto.looprpc.ServerNewAddressRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.looprpc.StaticAddressProtocolVersion} */ (reader.readEnum()); + msg.setProtocolVersion(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setClientKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerNewAddressRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerNewAddressRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerNewAddressRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerNewAddressRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProtocolVersion(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getClientKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional StaticAddressProtocolVersion protocol_version = 1; + * @return {!proto.looprpc.StaticAddressProtocolVersion} + */ +proto.looprpc.ServerNewAddressRequest.prototype.getProtocolVersion = function() { + return /** @type {!proto.looprpc.StaticAddressProtocolVersion} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.looprpc.StaticAddressProtocolVersion} value + * @return {!proto.looprpc.ServerNewAddressRequest} returns this + */ +proto.looprpc.ServerNewAddressRequest.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes client_key = 2; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerNewAddressRequest.prototype.getClientKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes client_key = 2; + * This is a type-conversion wrapper around `getClientKey()` + * @return {string} + */ +proto.looprpc.ServerNewAddressRequest.prototype.getClientKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getClientKey())); +}; + + +/** + * optional bytes client_key = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getClientKey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerNewAddressRequest.prototype.getClientKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getClientKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerNewAddressRequest} returns this + */ +proto.looprpc.ServerNewAddressRequest.prototype.setClientKey = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerNewAddressResponse.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerNewAddressResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerNewAddressResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerNewAddressResponse.toObject = function(includeInstance, msg) { + var f, obj = { + params: (f = msg.getParams()) && proto.looprpc.ServerAddressParameters.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerNewAddressResponse} + */ +proto.looprpc.ServerNewAddressResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerNewAddressResponse; + return proto.looprpc.ServerNewAddressResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerNewAddressResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerNewAddressResponse} + */ +proto.looprpc.ServerNewAddressResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.looprpc.ServerAddressParameters; + reader.readMessage(value,proto.looprpc.ServerAddressParameters.deserializeBinaryFromReader); + msg.setParams(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerNewAddressResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerNewAddressResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerNewAddressResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerNewAddressResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getParams(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.looprpc.ServerAddressParameters.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ServerAddressParameters params = 1; + * @return {?proto.looprpc.ServerAddressParameters} + */ +proto.looprpc.ServerNewAddressResponse.prototype.getParams = function() { + return /** @type{?proto.looprpc.ServerAddressParameters} */ ( + jspb.Message.getWrapperField(this, proto.looprpc.ServerAddressParameters, 1)); +}; + + +/** + * @param {?proto.looprpc.ServerAddressParameters|undefined} value + * @return {!proto.looprpc.ServerNewAddressResponse} returns this +*/ +proto.looprpc.ServerNewAddressResponse.prototype.setParams = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.looprpc.ServerNewAddressResponse} returns this + */ +proto.looprpc.ServerNewAddressResponse.prototype.clearParams = function() { + return this.setParams(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.looprpc.ServerNewAddressResponse.prototype.hasParams = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerAddressParameters.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerAddressParameters.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerAddressParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerAddressParameters.toObject = function(includeInstance, msg) { + var f, obj = { + serverKey: msg.getServerKey_asB64(), + expiry: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerAddressParameters} + */ +proto.looprpc.ServerAddressParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerAddressParameters; + return proto.looprpc.ServerAddressParameters.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerAddressParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerAddressParameters} + */ +proto.looprpc.ServerAddressParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setServerKey(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setExpiry(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerAddressParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerAddressParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerAddressParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerAddressParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getServerKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getExpiry(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional bytes server_key = 1; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerAddressParameters.prototype.getServerKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes server_key = 1; + * This is a type-conversion wrapper around `getServerKey()` + * @return {string} + */ +proto.looprpc.ServerAddressParameters.prototype.getServerKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getServerKey())); +}; + + +/** + * optional bytes server_key = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getServerKey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerAddressParameters.prototype.getServerKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getServerKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerAddressParameters} returns this + */ +proto.looprpc.ServerAddressParameters.prototype.setServerKey = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint32 expiry = 2; + * @return {number} + */ +proto.looprpc.ServerAddressParameters.prototype.getExpiry = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.looprpc.ServerAddressParameters} returns this + */ +proto.looprpc.ServerAddressParameters.prototype.setExpiry = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.looprpc.ServerWithdrawRequest.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerWithdrawRequest.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerWithdrawRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerWithdrawRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerWithdrawRequest.toObject = function(includeInstance, msg) { + var f, obj = { + outpointsList: jspb.Message.toObjectList(msg.getOutpointsList(), + proto.looprpc.PrevoutInfo.toObject, includeInstance), + clientNoncesList: msg.getClientNoncesList_asB64(), + clientSweepAddr: jspb.Message.getFieldWithDefault(msg, 3, ""), + txFeeRate: jspb.Message.getFieldWithDefault(msg, 4, "0") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerWithdrawRequest} + */ +proto.looprpc.ServerWithdrawRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerWithdrawRequest; + return proto.looprpc.ServerWithdrawRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerWithdrawRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerWithdrawRequest} + */ +proto.looprpc.ServerWithdrawRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.looprpc.PrevoutInfo; + reader.readMessage(value,proto.looprpc.PrevoutInfo.deserializeBinaryFromReader); + msg.addOutpoints(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addClientNonces(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setClientSweepAddr(value); + break; + case 4: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setTxFeeRate(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerWithdrawRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerWithdrawRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerWithdrawRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerWithdrawRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOutpointsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.looprpc.PrevoutInfo.serializeBinaryToWriter + ); + } + f = message.getClientNoncesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } + f = message.getClientSweepAddr(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getTxFeeRate(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 4, + f + ); + } +}; + + +/** + * repeated PrevoutInfo outpoints = 1; + * @return {!Array} + */ +proto.looprpc.ServerWithdrawRequest.prototype.getOutpointsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.looprpc.PrevoutInfo, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.looprpc.ServerWithdrawRequest} returns this +*/ +proto.looprpc.ServerWithdrawRequest.prototype.setOutpointsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.looprpc.PrevoutInfo=} opt_value + * @param {number=} opt_index + * @return {!proto.looprpc.PrevoutInfo} + */ +proto.looprpc.ServerWithdrawRequest.prototype.addOutpoints = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.looprpc.PrevoutInfo, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.looprpc.ServerWithdrawRequest} returns this + */ +proto.looprpc.ServerWithdrawRequest.prototype.clearOutpointsList = function() { + return this.setOutpointsList([]); +}; + + +/** + * repeated bytes client_nonces = 2; + * @return {!(Array|Array)} + */ +proto.looprpc.ServerWithdrawRequest.prototype.getClientNoncesList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes client_nonces = 2; + * This is a type-conversion wrapper around `getClientNoncesList()` + * @return {!Array} + */ +proto.looprpc.ServerWithdrawRequest.prototype.getClientNoncesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getClientNoncesList())); +}; + + +/** + * repeated bytes client_nonces = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getClientNoncesList()` + * @return {!Array} + */ +proto.looprpc.ServerWithdrawRequest.prototype.getClientNoncesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getClientNoncesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.looprpc.ServerWithdrawRequest} returns this + */ +proto.looprpc.ServerWithdrawRequest.prototype.setClientNoncesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.looprpc.ServerWithdrawRequest} returns this + */ +proto.looprpc.ServerWithdrawRequest.prototype.addClientNonces = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.looprpc.ServerWithdrawRequest} returns this + */ +proto.looprpc.ServerWithdrawRequest.prototype.clearClientNoncesList = function() { + return this.setClientNoncesList([]); +}; + + +/** + * optional string client_sweep_addr = 3; + * @return {string} + */ +proto.looprpc.ServerWithdrawRequest.prototype.getClientSweepAddr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.looprpc.ServerWithdrawRequest} returns this + */ +proto.looprpc.ServerWithdrawRequest.prototype.setClientSweepAddr = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional uint64 tx_fee_rate = 4; + * @return {string} + */ +proto.looprpc.ServerWithdrawRequest.prototype.getTxFeeRate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.looprpc.ServerWithdrawRequest} returns this + */ +proto.looprpc.ServerWithdrawRequest.prototype.setTxFeeRate = function(value) { + return jspb.Message.setProto3StringIntField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.looprpc.ServerWithdrawResponse.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerWithdrawResponse.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerWithdrawResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerWithdrawResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerWithdrawResponse.toObject = function(includeInstance, msg) { + var f, obj = { + musig2SweepSigsList: msg.getMusig2SweepSigsList_asB64(), + serverNoncesList: msg.getServerNoncesList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerWithdrawResponse} + */ +proto.looprpc.ServerWithdrawResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerWithdrawResponse; + return proto.looprpc.ServerWithdrawResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerWithdrawResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerWithdrawResponse} + */ +proto.looprpc.ServerWithdrawResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addMusig2SweepSigs(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addServerNonces(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerWithdrawResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerWithdrawResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerWithdrawResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerWithdrawResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMusig2SweepSigsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getServerNoncesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } +}; + + +/** + * repeated bytes musig2_sweep_sigs = 1; + * @return {!(Array|Array)} + */ +proto.looprpc.ServerWithdrawResponse.prototype.getMusig2SweepSigsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes musig2_sweep_sigs = 1; + * This is a type-conversion wrapper around `getMusig2SweepSigsList()` + * @return {!Array} + */ +proto.looprpc.ServerWithdrawResponse.prototype.getMusig2SweepSigsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getMusig2SweepSigsList())); +}; + + +/** + * repeated bytes musig2_sweep_sigs = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getMusig2SweepSigsList()` + * @return {!Array} + */ +proto.looprpc.ServerWithdrawResponse.prototype.getMusig2SweepSigsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getMusig2SweepSigsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.looprpc.ServerWithdrawResponse} returns this + */ +proto.looprpc.ServerWithdrawResponse.prototype.setMusig2SweepSigsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.looprpc.ServerWithdrawResponse} returns this + */ +proto.looprpc.ServerWithdrawResponse.prototype.addMusig2SweepSigs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.looprpc.ServerWithdrawResponse} returns this + */ +proto.looprpc.ServerWithdrawResponse.prototype.clearMusig2SweepSigsList = function() { + return this.setMusig2SweepSigsList([]); +}; + + +/** + * repeated bytes server_nonces = 2; + * @return {!(Array|Array)} + */ +proto.looprpc.ServerWithdrawResponse.prototype.getServerNoncesList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes server_nonces = 2; + * This is a type-conversion wrapper around `getServerNoncesList()` + * @return {!Array} + */ +proto.looprpc.ServerWithdrawResponse.prototype.getServerNoncesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getServerNoncesList())); +}; + + +/** + * repeated bytes server_nonces = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getServerNoncesList()` + * @return {!Array} + */ +proto.looprpc.ServerWithdrawResponse.prototype.getServerNoncesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getServerNoncesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.looprpc.ServerWithdrawResponse} returns this + */ +proto.looprpc.ServerWithdrawResponse.prototype.setServerNoncesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.looprpc.ServerWithdrawResponse} returns this + */ +proto.looprpc.ServerWithdrawResponse.prototype.addServerNonces = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.looprpc.ServerWithdrawResponse} returns this + */ +proto.looprpc.ServerWithdrawResponse.prototype.clearServerNoncesList = function() { + return this.setServerNoncesList([]); +}; + + /** * @enum {number} */ diff --git a/app/src/types/generated/swapserverrpc/server_pb_service.d.ts b/app/src/types/generated/swapserverrpc/server_pb_service.d.ts index 2ead735c8..8b72ae472 100644 --- a/app/src/types/generated/swapserverrpc/server_pb_service.d.ts +++ b/app/src/types/generated/swapserverrpc/server_pb_service.d.ts @@ -148,6 +148,15 @@ type SwapServerFetchL402 = { readonly responseType: typeof swapserverrpc_server_pb.FetchL402Response; }; +type SwapServerSubscribeNotifications = { + readonly methodName: string; + readonly service: typeof SwapServer; + readonly requestStream: false; + readonly responseStream: true; + readonly requestType: typeof swapserverrpc_server_pb.SubscribeNotificationsRequest; + readonly responseType: typeof swapserverrpc_server_pb.SubscribeNotificationsResponse; +}; + export class SwapServer { static readonly serviceName: string; static readonly LoopOutTerms: SwapServerLoopOutTerms; @@ -166,6 +175,31 @@ export class SwapServer { static readonly MuSig2SignSweep: SwapServerMuSig2SignSweep; static readonly PushKey: SwapServerPushKey; static readonly FetchL402: SwapServerFetchL402; + static readonly SubscribeNotifications: SwapServerSubscribeNotifications; +} + +type StaticAddressServerServerNewAddress = { + readonly methodName: string; + readonly service: typeof StaticAddressServer; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof swapserverrpc_server_pb.ServerNewAddressRequest; + readonly responseType: typeof swapserverrpc_server_pb.ServerNewAddressResponse; +}; + +type StaticAddressServerServerWithdrawDeposits = { + readonly methodName: string; + readonly service: typeof StaticAddressServer; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof swapserverrpc_server_pb.ServerWithdrawRequest; + readonly responseType: typeof swapserverrpc_server_pb.ServerWithdrawResponse; +}; + +export class StaticAddressServer { + static readonly serviceName: string; + static readonly ServerNewAddress: StaticAddressServerServerNewAddress; + static readonly ServerWithdrawDeposits: StaticAddressServerServerWithdrawDeposits; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -328,5 +362,30 @@ export class SwapServerClient { requestMessage: swapserverrpc_server_pb.FetchL402Request, callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.FetchL402Response|null) => void ): UnaryResponse; + subscribeNotifications(requestMessage: swapserverrpc_server_pb.SubscribeNotificationsRequest, metadata?: grpc.Metadata): ResponseStream; +} + +export class StaticAddressServerClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + serverNewAddress( + requestMessage: swapserverrpc_server_pb.ServerNewAddressRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerNewAddressResponse|null) => void + ): UnaryResponse; + serverNewAddress( + requestMessage: swapserverrpc_server_pb.ServerNewAddressRequest, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerNewAddressResponse|null) => void + ): UnaryResponse; + serverWithdrawDeposits( + requestMessage: swapserverrpc_server_pb.ServerWithdrawRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerWithdrawResponse|null) => void + ): UnaryResponse; + serverWithdrawDeposits( + requestMessage: swapserverrpc_server_pb.ServerWithdrawRequest, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerWithdrawResponse|null) => void + ): UnaryResponse; } diff --git a/app/src/types/generated/swapserverrpc/server_pb_service.js b/app/src/types/generated/swapserverrpc/server_pb_service.js index cf2c35127..769064aca 100644 --- a/app/src/types/generated/swapserverrpc/server_pb_service.js +++ b/app/src/types/generated/swapserverrpc/server_pb_service.js @@ -154,6 +154,15 @@ SwapServer.FetchL402 = { responseType: swapserverrpc_server_pb.FetchL402Response }; +SwapServer.SubscribeNotifications = { + methodName: "SubscribeNotifications", + service: SwapServer, + requestStream: false, + responseStream: true, + requestType: swapserverrpc_server_pb.SubscribeNotificationsRequest, + responseType: swapserverrpc_server_pb.SubscribeNotificationsResponse +}; + exports.SwapServer = SwapServer; function SwapServerClient(serviceHost, options) { @@ -673,5 +682,139 @@ SwapServerClient.prototype.fetchL402 = function fetchL402(requestMessage, metada }; }; +SwapServerClient.prototype.subscribeNotifications = function subscribeNotifications(requestMessage, metadata) { + var listeners = { + data: [], + end: [], + status: [] + }; + var client = grpc.invoke(SwapServer.SubscribeNotifications, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onMessage: function (responseMessage) { + listeners.data.forEach(function (handler) { + handler(responseMessage); + }); + }, + onEnd: function (status, statusMessage, trailers) { + listeners.status.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners.end.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners = null; + } + }); + return { + on: function (type, handler) { + listeners[type].push(handler); + return this; + }, + cancel: function () { + listeners = null; + client.close(); + } + }; +}; + exports.SwapServerClient = SwapServerClient; +var StaticAddressServer = (function () { + function StaticAddressServer() {} + StaticAddressServer.serviceName = "looprpc.StaticAddressServer"; + return StaticAddressServer; +}()); + +StaticAddressServer.ServerNewAddress = { + methodName: "ServerNewAddress", + service: StaticAddressServer, + requestStream: false, + responseStream: false, + requestType: swapserverrpc_server_pb.ServerNewAddressRequest, + responseType: swapserverrpc_server_pb.ServerNewAddressResponse +}; + +StaticAddressServer.ServerWithdrawDeposits = { + methodName: "ServerWithdrawDeposits", + service: StaticAddressServer, + requestStream: false, + responseStream: false, + requestType: swapserverrpc_server_pb.ServerWithdrawRequest, + responseType: swapserverrpc_server_pb.ServerWithdrawResponse +}; + +exports.StaticAddressServer = StaticAddressServer; + +function StaticAddressServerClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +StaticAddressServerClient.prototype.serverNewAddress = function serverNewAddress(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(StaticAddressServer.ServerNewAddress, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +StaticAddressServerClient.prototype.serverWithdrawDeposits = function serverWithdrawDeposits(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(StaticAddressServer.ServerWithdrawDeposits, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +exports.StaticAddressServerClient = StaticAddressServerClient; + diff --git a/proto/swapserverrpc/reservation.proto b/proto/swapserverrpc/reservation.proto new file mode 100644 index 000000000..f337396de --- /dev/null +++ b/proto/swapserverrpc/reservation.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +// We can't change this to swapserverrpc, it would be a breaking change because +// the package name is also contained in the HTTP URIs and old clients would +// call the wrong endpoints. Luckily with the go_package option we can have +// different golang and RPC package names to fix protobuf namespace conflicts. +package looprpc; + +option go_package = "github.com/lightninglabs/loop/swapserverrpc"; + +service ReservationService { + // ReservationNotificationStream is a server side stream that sends + // notifications if the server wants to open a reservation to the client. + rpc ReservationNotificationStream (ReservationNotificationRequest) + returns (stream ServerReservationNotification) { + option deprecated = true; + } + + // OpenReservation requests a new reservation UTXO from the server. + rpc OpenReservation (ServerOpenReservationRequest) + returns (ServerOpenReservationResponse); +} + +// ReservationNotificationRequest is an empty request sent from the client to +// the server to open a stream to receive reservation notifications. +message ReservationNotificationRequest { + // protocol_version is the maximum version the client supports. + ReservationProtocolVersion protocol_version = 1; +} + +// ServerReservationNotification is a notification sent from the server to the +// client if the server wants to open a reservation. +message ServerReservationNotification { + // reservation_id is the id of the reservation. + bytes reservation_id = 1; + + // value is the value of the reservation in satoshis. + uint64 value = 2 [jstype = JS_STRING]; + + // server_key is the public key of the server. + bytes server_key = 3; + + // expiry is the absolute expiry of the reservation. + uint32 expiry = 4; + + // protocol_version is the version of the reservation protocol. + ReservationProtocolVersion protocol_version = 5; +} + +// ServerOpenReservationRequest is a request sent from the client to the server +// to confirm a reservation opening. +message ServerOpenReservationRequest { + // reservation_id is the id of the reservation. + bytes reservation_id = 1; + + // client_key is the public key of the client. + bytes client_key = 2; +} + +// ServerOpenReservationResponse is a response sent from the server to the +// client to confirm a reservation opening. +message ServerOpenReservationResponse { +} + +// ReservationProtocolVersion is the version of the reservation protocol. +enum ReservationProtocolVersion { + // RESERVATION_NONE is the default value and means that the reservation + // protocol version is not set. + RESERVATION_NONE = 0; + + // RESERVATION_SERVER_NOTIFY is the first version of the reservation + // protocol where the server notifies the client about a reservation. + RESERVATION_SERVER_NOTIFY = 1; +}; diff --git a/proto/swapserverrpc/server.proto b/proto/swapserverrpc/server.proto index 20078f492..57a3140e6 100644 --- a/proto/swapserverrpc/server.proto +++ b/proto/swapserverrpc/server.proto @@ -6,6 +6,7 @@ syntax = "proto3"; // different golang and RPC package names to fix protobuf namespace conflicts. package looprpc; import "swapserverrpc/common.proto"; +import "swapserverrpc/reservation.proto"; option go_package = "github.com/lightninglabs/loop/swapserverrpc"; @@ -50,6 +51,9 @@ service SwapServer { // FetchL402 is a simple non-l402-allowlisted request that is required // in order to force the creation of an l402. rpc FetchL402 (FetchL402Request) returns (FetchL402Response); + + rpc SubscribeNotifications (SubscribeNotificationsRequest) + returns (stream SubscribeNotificationsResponse); } /** @@ -284,6 +288,13 @@ message ServerLoopInQuoteRequest { // loopd/v0.10.0-beta/commit=3b635821 // litd/v0.2.0-alpha/commit=326d754 string user_agent = 6; + + // If this is a quote request for a static address loop in, this value + // defines the number of static address deposits that the client wants to + // quote for. The amount of the quote reflects the sum of all deposits. The + // number of deposits here is taken into consideration for the total swap + // fee. + uint32 num_static_address_deposits = 7; } message ServerLoopInQuoteResponse { @@ -514,6 +525,7 @@ message ServerProbeRequest { // The protocol version that the client adheres to. ProtocolVersion protocol_version = 1; + // The probe amount. uint64 amt = 2 [jstype = JS_STRING]; // The target node for the probe. @@ -638,18 +650,87 @@ message ServerPushKeyRes { } // FetchL402Request is an empty request sent from the client to the server to -// fetch the lnd l402. +// fetch the lnd L402. message FetchL402Request { } // FetchL402Response is an empty response sent from the server to the client to -// confirm the lnd l402. +// confirm the lnd L402. message FetchL402Response { } +// SubscribeNotificationsRequest is a request to subscribe to notifications. +message SubscribeNotificationsRequest { +} + +// SubscribeNotificationsResponse is a response to a +// SubscribeNotificationsRequest. +message SubscribeNotificationsResponse { + oneof notification { + ServerReservationNotification reservation_notification = 1; + } +} + // StaticAddressProtocolVersion represents the static address protocol version // the client adheres to. enum StaticAddressProtocolVersion { // V0 is the initially released static address protocol version. V0 = 0; -} \ No newline at end of file +} + +service StaticAddressServer { + // ServerNewAddress generates a new static address for the client to use. + // The server will generate the address and return the server key and the + // address's CSV expiry. + rpc ServerNewAddress (ServerNewAddressRequest) + returns (ServerNewAddressResponse); + + // ServerWithdrawDeposits allows to cooperatively sweep deposits that + // haven't timed out yet to the client's wallet. The server will generate + // the partial sigs for the client's selected deposits. + rpc ServerWithdrawDeposits (ServerWithdrawRequest) + returns (ServerWithdrawResponse); +} + +message ServerNewAddressRequest { + // The protocol version that the client adheres to. + StaticAddressProtocolVersion protocol_version = 1; + + // The client key for the MuSig2 static address output. + bytes client_key = 2; +} + +message ServerNewAddressResponse { + ServerAddressParameters params = 1; +} + +message ServerAddressParameters { + // The server key for the MuSig2 static address output. + bytes server_key = 1; + + // The CSV expiry of the static address output. + uint32 expiry = 2; +} + +message ServerWithdrawRequest { + // The deposit outpoints the client wishes to close. + repeated PrevoutInfo outpoints = 1; + + // The nonces that the client used to generate the coop close tx sigs. + repeated bytes client_nonces = 2; + + // The address that the client wants to sweep the static address deposits + // to. + string client_sweep_addr = 3; + + // The fee rate in sat/kw that the client wants to use for the sweep. + uint64 tx_fee_rate = 4 [jstype = JS_STRING]; +} + +message ServerWithdrawResponse { + // The sweep sigs that the server generated for the htlc. + repeated bytes musig2_sweep_sigs = 1; + + // The nonces that the server used to generate the sweepless sweep sigs. + repeated bytes server_nonces = 2; +} From 5941ea1a6b65f87a27b02b3156e395c87a23b7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Fri, 25 Oct 2024 15:49:51 +0200 Subject: [PATCH 4/5] docs/release-notes: cut release v0.13.5-alpha --- docs/release-notes/release-notes-0.13.5.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/release-notes/release-notes-0.13.5.md b/docs/release-notes/release-notes-0.13.5.md index 479468882..05c3eb004 100644 --- a/docs/release-notes/release-notes-0.13.5.md +++ b/docs/release-notes/release-notes-0.13.5.md @@ -35,8 +35,6 @@ * Check internal maps before registering new sub-servers for both the [status and sub-server manager.](https://github.com/lightninglabs/lightning-terminal/pull/877) - -### Autopilot ## Integrated Binary Updates @@ -45,15 +43,9 @@ setting a fixed timestamps for the files in the release script and by providing a dockerized release build command `make docker-release` for MacOS. -### LND - ### Loop - -### Pool - -### Faraday - -### Taproot Assets +* [Update the integrated Loop version to + v0.28.8-beta](https://github.com/lightninglabs/lightning-terminal/pull/885). # Contributors (Alphabetical Order) From d72a2cef7b588218d9b7b015674f1726d91030d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Fri, 25 Oct 2024 15:52:40 +0200 Subject: [PATCH 5/5] build: bump version to `v0.13.5-alpha` --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 99fede850..440cfb8ad 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ in remote mode (meaning that `lnd-mode=remote` is set). It shows the | LiT | LND | |-------------------|--------------| +| **v0.13.5-alpha** | v0.17.1-beta | | **v0.13.4-alpha** | v0.17.1-beta | | **v0.13.3-alpha** | v0.17.1-beta | | **v0.13.2-alpha** | v0.17.0-beta | @@ -160,6 +161,7 @@ The following table shows the supported combinations: | LiT | LND | Loop | Faraday | Pool | Taproot Assets | |-------------------|--------------|--------------|---------------|--------------|----------------| +| **v0.13.5-alpha** | v0.18.3-beta | v0.28.8-beta | v0.2.13-alpha | v0.6.5-beta | v0.4.1-alpha | | **v0.13.4-alpha** | v0.18.3-beta | v0.28.7-beta | v0.2.13-alpha | v0.6.5-beta | v0.4.1-alpha | | **v0.13.3-alpha** | v0.18.2-beta | v0.28.6-beta | v0.2.13-alpha | v0.6.5-beta | v0.4.1-alpha | | **v0.13.2-alpha** | v0.18.2-beta | v0.28.5-beta | v0.2.13-alpha | v0.6.5-beta | v0.3.3-alpha |