From 711843e11da9f648d8485bbaaa700e8b4b614e3e Mon Sep 17 00:00:00 2001 From: shelter2759 <195781132+shelter2759@users.noreply.github.com> Date: Sat, 8 Feb 2025 11:59:02 +0900 Subject: [PATCH] peerswaprpc: update makefile, Dockerfile to generate files --- peerswaprpc/Dockerfile | 5 +- peerswaprpc/Makefile | 3 +- peerswaprpc/peerswaprpc.pb.go | 966 ++++++++++++++++++++------- peerswaprpc/peerswaprpc.pb.gw.go | 843 +++++++++++++++-------- peerswaprpc/peerswaprpc.swagger.json | 5 - peerswaprpc/peerswaprpc_grpc.pb.go | 132 ++-- 6 files changed, 1333 insertions(+), 621 deletions(-) diff --git a/peerswaprpc/Dockerfile b/peerswaprpc/Dockerfile index dd6144fa..8eabcd81 100644 --- a/peerswaprpc/Dockerfile +++ b/peerswaprpc/Dockerfile @@ -21,8 +21,11 @@ RUN cd /tmp \ && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} \ && go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \ && go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION} \ + && GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/buf@v1.50.0 \ && chmod -R 777 /tmp/build/ WORKDIR /build -CMD ["buf", "generate"] +ENV BUF_CACHE_DIR=/tmp/.cache + +CMD ["sh", "-c", "buf generate"] diff --git a/peerswaprpc/Makefile b/peerswaprpc/Makefile index a8be0fce..96c76b7c 100644 --- a/peerswaprpc/Makefile +++ b/peerswaprpc/Makefile @@ -14,4 +14,5 @@ clean-rpc: .PHONY: all-rpc-docker all-rpc-docker: - ${DIR}/gen_protos_docker.sh \ No newline at end of file + ./gen_protos_docker.sh + diff --git a/peerswaprpc/peerswaprpc.pb.go b/peerswaprpc/peerswaprpc.pb.go index ae88d1c7..3b3ed96b 100644 --- a/peerswaprpc/peerswaprpc.pb.go +++ b/peerswaprpc/peerswaprpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.4 +// protoc-gen-go v1.28.1 // protoc (unknown) // source: peerswaprpc.proto @@ -11,7 +11,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" - unsafe "unsafe" ) const ( @@ -68,16 +67,18 @@ func (RequestedSwap_SwapType) EnumDescriptor() ([]byte, []int) { } type GetAddressRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *GetAddressRequest) Reset() { *x = GetAddressRequest{} - mi := &file_peerswaprpc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetAddressRequest) String() string { @@ -88,7 +89,7 @@ func (*GetAddressRequest) ProtoMessage() {} func (x *GetAddressRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -104,17 +105,20 @@ func (*GetAddressRequest) Descriptor() ([]byte, []int) { } type GetAddressResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (x *GetAddressResponse) Reset() { *x = GetAddressResponse{} - mi := &file_peerswaprpc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetAddressResponse) String() string { @@ -125,7 +129,7 @@ func (*GetAddressResponse) ProtoMessage() {} func (x *GetAddressResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -148,16 +152,18 @@ func (x *GetAddressResponse) GetAddress() string { } type GetBalanceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *GetBalanceRequest) Reset() { *x = GetBalanceRequest{} - mi := &file_peerswaprpc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetBalanceRequest) String() string { @@ -168,7 +174,7 @@ func (*GetBalanceRequest) ProtoMessage() {} func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -184,17 +190,20 @@ func (*GetBalanceRequest) Descriptor() ([]byte, []int) { } type GetBalanceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - SatAmount uint64 `protobuf:"varint,1,opt,name=sat_amount,json=satAmount,proto3" json:"sat_amount,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SatAmount uint64 `protobuf:"varint,1,opt,name=sat_amount,json=satAmount,proto3" json:"sat_amount,omitempty"` } func (x *GetBalanceResponse) Reset() { *x = GetBalanceResponse{} - mi := &file_peerswaprpc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetBalanceResponse) String() string { @@ -205,7 +214,7 @@ func (*GetBalanceResponse) ProtoMessage() {} func (x *GetBalanceResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -228,18 +237,21 @@ func (x *GetBalanceResponse) GetSatAmount() uint64 { } type SendToAddressRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - SatAmount uint64 `protobuf:"varint,2,opt,name=sat_amount,json=satAmount,proto3" json:"sat_amount,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + SatAmount uint64 `protobuf:"varint,2,opt,name=sat_amount,json=satAmount,proto3" json:"sat_amount,omitempty"` } func (x *SendToAddressRequest) Reset() { *x = SendToAddressRequest{} - mi := &file_peerswaprpc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SendToAddressRequest) String() string { @@ -250,7 +262,7 @@ func (*SendToAddressRequest) ProtoMessage() {} func (x *SendToAddressRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -280,17 +292,20 @@ func (x *SendToAddressRequest) GetSatAmount() uint64 { } type SendToAddressResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` } func (x *SendToAddressResponse) Reset() { *x = SendToAddressResponse{} - mi := &file_peerswaprpc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SendToAddressResponse) String() string { @@ -301,7 +316,7 @@ func (*SendToAddressResponse) ProtoMessage() {} func (x *SendToAddressResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -324,20 +339,23 @@ func (x *SendToAddressResponse) GetTxId() string { } type SwapOutRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - SwapAmount uint64 `protobuf:"varint,2,opt,name=swap_amount,json=swapAmount,proto3" json:"swap_amount,omitempty"` - Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` - Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + SwapAmount uint64 `protobuf:"varint,2,opt,name=swap_amount,json=swapAmount,proto3" json:"swap_amount,omitempty"` + Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` } func (x *SwapOutRequest) Reset() { *x = SwapOutRequest{} - mi := &file_peerswaprpc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SwapOutRequest) String() string { @@ -348,7 +366,7 @@ func (*SwapOutRequest) ProtoMessage() {} func (x *SwapOutRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[6] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -392,17 +410,20 @@ func (x *SwapOutRequest) GetForce() bool { } type SwapOutResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Swap *PrettyPrintSwap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Swap *PrettyPrintSwap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` } func (x *SwapOutResponse) Reset() { *x = SwapOutResponse{} - mi := &file_peerswaprpc_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SwapOutResponse) String() string { @@ -413,7 +434,7 @@ func (*SwapOutResponse) ProtoMessage() {} func (x *SwapOutResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[7] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -436,20 +457,23 @@ func (x *SwapOutResponse) GetSwap() *PrettyPrintSwap { } type SwapInRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - SwapAmount uint64 `protobuf:"varint,2,opt,name=swap_amount,json=swapAmount,proto3" json:"swap_amount,omitempty"` - Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` - Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + SwapAmount uint64 `protobuf:"varint,2,opt,name=swap_amount,json=swapAmount,proto3" json:"swap_amount,omitempty"` + Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` } func (x *SwapInRequest) Reset() { *x = SwapInRequest{} - mi := &file_peerswaprpc_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SwapInRequest) String() string { @@ -460,7 +484,7 @@ func (*SwapInRequest) ProtoMessage() {} func (x *SwapInRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[8] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -504,17 +528,20 @@ func (x *SwapInRequest) GetForce() bool { } type SwapResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Swap *PrettyPrintSwap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Swap *PrettyPrintSwap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` } func (x *SwapResponse) Reset() { *x = SwapResponse{} - mi := &file_peerswaprpc_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SwapResponse) String() string { @@ -525,7 +552,7 @@ func (*SwapResponse) ProtoMessage() {} func (x *SwapResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[9] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -548,17 +575,20 @@ func (x *SwapResponse) GetSwap() *PrettyPrintSwap { } type GetSwapRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SwapId string `protobuf:"bytes,1,opt,name=swap_id,json=swapId,proto3" json:"swap_id,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SwapId string `protobuf:"bytes,1,opt,name=swap_id,json=swapId,proto3" json:"swap_id,omitempty"` } func (x *GetSwapRequest) Reset() { *x = GetSwapRequest{} - mi := &file_peerswaprpc_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetSwapRequest) String() string { @@ -569,7 +599,7 @@ func (*GetSwapRequest) ProtoMessage() {} func (x *GetSwapRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[10] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -592,16 +622,18 @@ func (x *GetSwapRequest) GetSwapId() string { } type ListSwapsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *ListSwapsRequest) Reset() { *x = ListSwapsRequest{} - mi := &file_peerswaprpc_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListSwapsRequest) String() string { @@ -612,7 +644,7 @@ func (*ListSwapsRequest) ProtoMessage() {} func (x *ListSwapsRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[11] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -628,17 +660,20 @@ func (*ListSwapsRequest) Descriptor() ([]byte, []int) { } type ListSwapsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Swaps []*PrettyPrintSwap `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Swaps []*PrettyPrintSwap `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"` } func (x *ListSwapsResponse) Reset() { *x = ListSwapsResponse{} - mi := &file_peerswaprpc_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListSwapsResponse) String() string { @@ -649,7 +684,7 @@ func (*ListSwapsResponse) ProtoMessage() {} func (x *ListSwapsResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[12] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -672,16 +707,18 @@ func (x *ListSwapsResponse) GetSwaps() []*PrettyPrintSwap { } type ListPeersRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *ListPeersRequest) Reset() { *x = ListPeersRequest{} - mi := &file_peerswaprpc_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListPeersRequest) String() string { @@ -692,7 +729,7 @@ func (*ListPeersRequest) ProtoMessage() {} func (x *ListPeersRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[13] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -708,17 +745,20 @@ func (*ListPeersRequest) Descriptor() ([]byte, []int) { } type ListPeersResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Peers []*PeerSwapPeer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Peers []*PeerSwapPeer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` } func (x *ListPeersResponse) Reset() { *x = ListPeersResponse{} - mi := &file_peerswaprpc_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListPeersResponse) String() string { @@ -729,7 +769,7 @@ func (*ListPeersResponse) ProtoMessage() {} func (x *ListPeersResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[14] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -752,16 +792,18 @@ func (x *ListPeersResponse) GetPeers() []*PeerSwapPeer { } type ReloadPolicyFileRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *ReloadPolicyFileRequest) Reset() { *x = ReloadPolicyFileRequest{} - mi := &file_peerswaprpc_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ReloadPolicyFileRequest) String() string { @@ -772,7 +814,7 @@ func (*ReloadPolicyFileRequest) ProtoMessage() {} func (x *ReloadPolicyFileRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[15] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -788,17 +830,20 @@ func (*ReloadPolicyFileRequest) Descriptor() ([]byte, []int) { } type AddPeerRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeerPubkey string `protobuf:"bytes,1,opt,name=peer_pubkey,json=peerPubkey,proto3" json:"peer_pubkey,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerPubkey string `protobuf:"bytes,1,opt,name=peer_pubkey,json=peerPubkey,proto3" json:"peer_pubkey,omitempty"` } func (x *AddPeerRequest) Reset() { *x = AddPeerRequest{} - mi := &file_peerswaprpc_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AddPeerRequest) String() string { @@ -809,7 +854,7 @@ func (*AddPeerRequest) ProtoMessage() {} func (x *AddPeerRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[16] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -832,17 +877,20 @@ func (x *AddPeerRequest) GetPeerPubkey() string { } type RemovePeerRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PeerPubkey string `protobuf:"bytes,1,opt,name=peer_pubkey,json=peerPubkey,proto3" json:"peer_pubkey,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerPubkey string `protobuf:"bytes,1,opt,name=peer_pubkey,json=peerPubkey,proto3" json:"peer_pubkey,omitempty"` } func (x *RemovePeerRequest) Reset() { *x = RemovePeerRequest{} - mi := &file_peerswaprpc_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *RemovePeerRequest) String() string { @@ -853,7 +901,7 @@ func (*RemovePeerRequest) ProtoMessage() {} func (x *RemovePeerRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[17] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -876,16 +924,18 @@ func (x *RemovePeerRequest) GetPeerPubkey() string { } type ListRequestedSwapsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *ListRequestedSwapsRequest) Reset() { *x = ListRequestedSwapsRequest{} - mi := &file_peerswaprpc_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListRequestedSwapsRequest) String() string { @@ -896,7 +946,7 @@ func (*ListRequestedSwapsRequest) ProtoMessage() {} func (x *ListRequestedSwapsRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[18] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -912,17 +962,20 @@ func (*ListRequestedSwapsRequest) Descriptor() ([]byte, []int) { } type ListRequestedSwapsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestedSwaps map[string]*RequestSwapList `protobuf:"bytes,1,rep,name=requested_swaps,json=requestedSwaps,proto3" json:"requested_swaps,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestedSwaps map[string]*RequestSwapList `protobuf:"bytes,1,rep,name=requested_swaps,json=requestedSwaps,proto3" json:"requested_swaps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ListRequestedSwapsResponse) Reset() { *x = ListRequestedSwapsResponse{} - mi := &file_peerswaprpc_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListRequestedSwapsResponse) String() string { @@ -933,7 +986,7 @@ func (*ListRequestedSwapsResponse) ProtoMessage() {} func (x *ListRequestedSwapsResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[19] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -956,17 +1009,20 @@ func (x *ListRequestedSwapsResponse) GetRequestedSwaps() map[string]*RequestSwap } type RequestSwapList struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestedSwaps []*RequestedSwap `protobuf:"bytes,1,rep,name=requested_swaps,json=requestedSwaps,proto3" json:"requested_swaps,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestedSwaps []*RequestedSwap `protobuf:"bytes,1,rep,name=requested_swaps,json=requestedSwaps,proto3" json:"requested_swaps,omitempty"` } func (x *RequestSwapList) Reset() { *x = RequestSwapList{} - mi := &file_peerswaprpc_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *RequestSwapList) String() string { @@ -977,7 +1033,7 @@ func (*RequestSwapList) ProtoMessage() {} func (x *RequestSwapList) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[20] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1000,20 +1056,23 @@ func (x *RequestSwapList) GetRequestedSwaps() []*RequestedSwap { } type RequestedSwap struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Asset string `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` AmountSat uint64 `protobuf:"varint,2,opt,name=amount_sat,json=amountSat,proto3" json:"amount_sat,omitempty"` SwapType RequestedSwap_SwapType `protobuf:"varint,3,opt,name=swap_type,json=swapType,proto3,enum=peerswap.RequestedSwap_SwapType" json:"swap_type,omitempty"` RejectionReason string `protobuf:"bytes,4,opt,name=rejection_reason,json=rejectionReason,proto3" json:"rejection_reason,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache } func (x *RequestedSwap) Reset() { *x = RequestedSwap{} - mi := &file_peerswaprpc_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *RequestedSwap) String() string { @@ -1024,7 +1083,7 @@ func (*RequestedSwap) ProtoMessage() {} func (x *RequestedSwap) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[21] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1068,30 +1127,33 @@ func (x *RequestedSwap) GetRejectionReason() string { } type PrettyPrintSwap struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Role string `protobuf:"bytes,5,opt,name=role,proto3" json:"role,omitempty"` - State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` - InitiatorNodeId string `protobuf:"bytes,7,opt,name=initiator_node_id,json=initiatorNodeId,proto3" json:"initiator_node_id,omitempty"` - PeerNodeId string `protobuf:"bytes,8,opt,name=peer_node_id,json=peerNodeId,proto3" json:"peer_node_id,omitempty"` - Amount uint64 `protobuf:"varint,9,opt,name=amount,proto3" json:"amount,omitempty"` - ChannelId string `protobuf:"bytes,10,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - OpeningTxId string `protobuf:"bytes,11,opt,name=opening_tx_id,json=openingTxId,proto3" json:"opening_tx_id,omitempty"` - ClaimTxId string `protobuf:"bytes,12,opt,name=claim_tx_id,json=claimTxId,proto3" json:"claim_tx_id,omitempty"` - CancelMessage string `protobuf:"bytes,13,opt,name=cancel_message,json=cancelMessage,proto3" json:"cancel_message,omitempty"` - LndChanId uint64 `protobuf:"varint,14,opt,name=lnd_chan_id,json=lndChanId,proto3" json:"lnd_chan_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Role string `protobuf:"bytes,5,opt,name=role,proto3" json:"role,omitempty"` + State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` + InitiatorNodeId string `protobuf:"bytes,7,opt,name=initiator_node_id,json=initiatorNodeId,proto3" json:"initiator_node_id,omitempty"` + PeerNodeId string `protobuf:"bytes,8,opt,name=peer_node_id,json=peerNodeId,proto3" json:"peer_node_id,omitempty"` + Amount uint64 `protobuf:"varint,9,opt,name=amount,proto3" json:"amount,omitempty"` + ChannelId string `protobuf:"bytes,10,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + OpeningTxId string `protobuf:"bytes,11,opt,name=opening_tx_id,json=openingTxId,proto3" json:"opening_tx_id,omitempty"` + ClaimTxId string `protobuf:"bytes,12,opt,name=claim_tx_id,json=claimTxId,proto3" json:"claim_tx_id,omitempty"` + CancelMessage string `protobuf:"bytes,13,opt,name=cancel_message,json=cancelMessage,proto3" json:"cancel_message,omitempty"` + LndChanId uint64 `protobuf:"varint,14,opt,name=lnd_chan_id,json=lndChanId,proto3" json:"lnd_chan_id,omitempty"` } func (x *PrettyPrintSwap) Reset() { *x = PrettyPrintSwap{} - mi := &file_peerswaprpc_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PrettyPrintSwap) String() string { @@ -1102,7 +1164,7 @@ func (*PrettyPrintSwap) ProtoMessage() {} func (x *PrettyPrintSwap) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[22] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1216,7 +1278,10 @@ func (x *PrettyPrintSwap) GetLndChanId() uint64 { } type PeerSwapPeer struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` SwapsAllowed bool `protobuf:"varint,2,opt,name=swaps_allowed,json=swapsAllowed,proto3" json:"swaps_allowed,omitempty"` SupportedAssets []string `protobuf:"bytes,3,rep,name=supported_assets,json=supportedAssets,proto3" json:"supported_assets,omitempty"` @@ -1224,15 +1289,15 @@ type PeerSwapPeer struct { AsSender *SwapStats `protobuf:"bytes,5,opt,name=as_sender,json=asSender,proto3" json:"as_sender,omitempty"` AsReceiver *SwapStats `protobuf:"bytes,6,opt,name=as_receiver,json=asReceiver,proto3" json:"as_receiver,omitempty"` PaidFee uint64 `protobuf:"varint,7,opt,name=paid_fee,json=paidFee,proto3" json:"paid_fee,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache } func (x *PeerSwapPeer) Reset() { *x = PeerSwapPeer{} - mi := &file_peerswaprpc_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PeerSwapPeer) String() string { @@ -1243,7 +1308,7 @@ func (*PeerSwapPeer) ProtoMessage() {} func (x *PeerSwapPeer) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[23] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1308,20 +1373,23 @@ func (x *PeerSwapPeer) GetPaidFee() uint64 { } type PeerSwapPeerChannel struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - LocalBalance uint64 `protobuf:"varint,2,opt,name=local_balance,json=localBalance,proto3" json:"local_balance,omitempty"` - RemoteBalance uint64 `protobuf:"varint,3,opt,name=remote_balance,json=remoteBalance,proto3" json:"remote_balance,omitempty"` - Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + LocalBalance uint64 `protobuf:"varint,2,opt,name=local_balance,json=localBalance,proto3" json:"local_balance,omitempty"` + RemoteBalance uint64 `protobuf:"varint,3,opt,name=remote_balance,json=remoteBalance,proto3" json:"remote_balance,omitempty"` + Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` } func (x *PeerSwapPeerChannel) Reset() { *x = PeerSwapPeerChannel{} - mi := &file_peerswaprpc_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PeerSwapPeerChannel) String() string { @@ -1332,7 +1400,7 @@ func (*PeerSwapPeerChannel) ProtoMessage() {} func (x *PeerSwapPeerChannel) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[24] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1376,20 +1444,23 @@ func (x *PeerSwapPeerChannel) GetActive() bool { } type SwapStats struct { - state protoimpl.MessageState `protogen:"open.v1"` - SwapsOut uint64 `protobuf:"varint,1,opt,name=swaps_out,json=swapsOut,proto3" json:"swaps_out,omitempty"` - SwapsIn uint64 `protobuf:"varint,2,opt,name=swaps_in,json=swapsIn,proto3" json:"swaps_in,omitempty"` - SatsOut uint64 `protobuf:"varint,3,opt,name=sats_out,json=satsOut,proto3" json:"sats_out,omitempty"` - SatsIn uint64 `protobuf:"varint,4,opt,name=sats_in,json=satsIn,proto3" json:"sats_in,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SwapsOut uint64 `protobuf:"varint,1,opt,name=swaps_out,json=swapsOut,proto3" json:"swaps_out,omitempty"` + SwapsIn uint64 `protobuf:"varint,2,opt,name=swaps_in,json=swapsIn,proto3" json:"swaps_in,omitempty"` + SatsOut uint64 `protobuf:"varint,3,opt,name=sats_out,json=satsOut,proto3" json:"sats_out,omitempty"` + SatsIn uint64 `protobuf:"varint,4,opt,name=sats_in,json=satsIn,proto3" json:"sats_in,omitempty"` } func (x *SwapStats) Reset() { *x = SwapStats{} - mi := &file_peerswaprpc_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *SwapStats) String() string { @@ -1400,7 +1471,7 @@ func (*SwapStats) ProtoMessage() {} func (x *SwapStats) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[25] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1444,17 +1515,20 @@ func (x *SwapStats) GetSatsIn() uint64 { } type PeerSwapNodes struct { - state protoimpl.MessageState `protogen:"open.v1"` - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` } func (x *PeerSwapNodes) Reset() { *x = PeerSwapNodes{} - mi := &file_peerswaprpc_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PeerSwapNodes) String() string { @@ -1465,7 +1539,7 @@ func (*PeerSwapNodes) ProtoMessage() {} func (x *PeerSwapNodes) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[26] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1488,22 +1562,25 @@ func (x *PeerSwapNodes) GetNodeId() string { } type Policy struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReserveOnchainMsat uint64 `protobuf:"varint,1,opt,name=reserve_onchain_msat,json=reserveOnchainMsat,proto3" json:"reserve_onchain_msat,omitempty"` - MinSwapAmountMsat uint64 `protobuf:"varint,2,opt,name=min_swap_amount_msat,json=minSwapAmountMsat,proto3" json:"min_swap_amount_msat,omitempty"` - AcceptAllPeers bool `protobuf:"varint,3,opt,name=accept_all_peers,json=acceptAllPeers,proto3" json:"accept_all_peers,omitempty"` - AllowNewSwaps bool `protobuf:"varint,4,opt,name=allow_new_swaps,json=allowNewSwaps,proto3" json:"allow_new_swaps,omitempty"` - AllowlistedPeers []string `protobuf:"bytes,5,rep,name=allowlisted_peers,json=allowlistedPeers,proto3" json:"allowlisted_peers,omitempty"` - SuspiciousPeerList []string `protobuf:"bytes,6,rep,name=suspicious_peer_list,json=suspiciousPeerList,proto3" json:"suspicious_peer_list,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReserveOnchainMsat uint64 `protobuf:"varint,1,opt,name=reserve_onchain_msat,json=reserveOnchainMsat,proto3" json:"reserve_onchain_msat,omitempty"` + MinSwapAmountMsat uint64 `protobuf:"varint,2,opt,name=min_swap_amount_msat,json=minSwapAmountMsat,proto3" json:"min_swap_amount_msat,omitempty"` + AcceptAllPeers bool `protobuf:"varint,3,opt,name=accept_all_peers,json=acceptAllPeers,proto3" json:"accept_all_peers,omitempty"` + AllowNewSwaps bool `protobuf:"varint,4,opt,name=allow_new_swaps,json=allowNewSwaps,proto3" json:"allow_new_swaps,omitempty"` + AllowlistedPeers []string `protobuf:"bytes,5,rep,name=allowlisted_peers,json=allowlistedPeers,proto3" json:"allowlisted_peers,omitempty"` + SuspiciousPeerList []string `protobuf:"bytes,6,rep,name=suspicious_peer_list,json=suspiciousPeerList,proto3" json:"suspicious_peer_list,omitempty"` } func (x *Policy) Reset() { *x = Policy{} - mi := &file_peerswaprpc_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *Policy) String() string { @@ -1514,7 +1591,7 @@ func (*Policy) ProtoMessage() {} func (x *Policy) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[27] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1572,17 +1649,20 @@ func (x *Policy) GetSuspiciousPeerList() []string { } type AllowSwapRequestsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` } func (x *AllowSwapRequestsRequest) Reset() { *x = AllowSwapRequestsRequest{} - mi := &file_peerswaprpc_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllowSwapRequestsRequest) String() string { @@ -1593,7 +1673,7 @@ func (*AllowSwapRequestsRequest) ProtoMessage() {} func (x *AllowSwapRequestsRequest) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[28] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1616,17 +1696,20 @@ func (x *AllowSwapRequestsRequest) GetAllow() bool { } type AllowSwapRequestsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` } func (x *AllowSwapRequestsResponse) Reset() { *x = AllowSwapRequestsResponse{} - mi := &file_peerswaprpc_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllowSwapRequestsResponse) String() string { @@ -1637,7 +1720,7 @@ func (*AllowSwapRequestsResponse) ProtoMessage() {} func (x *AllowSwapRequestsResponse) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[29] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1660,16 +1743,18 @@ func (x *AllowSwapRequestsResponse) GetAllow() bool { } type Empty struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } func (x *Empty) Reset() { *x = Empty{} - mi := &file_peerswaprpc_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_peerswaprpc_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *Empty) String() string { @@ -1680,7 +1765,7 @@ func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { mi := &file_peerswaprpc_proto_msgTypes[30] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1697,7 +1782,7 @@ func (*Empty) Descriptor() ([]byte, []int) { var File_peerswaprpc_proto protoreflect.FileDescriptor -var file_peerswaprpc_proto_rawDesc = string([]byte{ +var file_peerswaprpc_proto_rawDesc = []byte{ 0x0a, 0x11, 0x70, 0x65, 0x65, 0x72, 0x73, 0x77, 0x61, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x65, 0x65, 0x72, 0x73, 0x77, 0x61, 0x70, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, @@ -1966,23 +2051,23 @@ var file_peerswaprpc_proto_rawDesc = string([]byte{ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x77, 0x61, 0x70, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x77, 0x61, 0x70, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +} var ( file_peerswaprpc_proto_rawDescOnce sync.Once - file_peerswaprpc_proto_rawDescData []byte + file_peerswaprpc_proto_rawDescData = file_peerswaprpc_proto_rawDesc ) func file_peerswaprpc_proto_rawDescGZIP() []byte { file_peerswaprpc_proto_rawDescOnce.Do(func() { - file_peerswaprpc_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_peerswaprpc_proto_rawDesc), len(file_peerswaprpc_proto_rawDesc))) + file_peerswaprpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_peerswaprpc_proto_rawDescData) }) return file_peerswaprpc_proto_rawDescData } var file_peerswaprpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_peerswaprpc_proto_msgTypes = make([]protoimpl.MessageInfo, 32) -var file_peerswaprpc_proto_goTypes = []any{ +var file_peerswaprpc_proto_goTypes = []interface{}{ (RequestedSwap_SwapType)(0), // 0: peerswap.RequestedSwap.SwapType (*GetAddressRequest)(nil), // 1: peerswap.GetAddressRequest (*GetAddressResponse)(nil), // 2: peerswap.GetAddressResponse @@ -2075,11 +2160,385 @@ func file_peerswaprpc_proto_init() { if File_peerswaprpc_proto != nil { return } + if !protoimpl.UnsafeEnabled { + file_peerswaprpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAddressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAddressResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBalanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBalanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendToAddressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendToAddressResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwapOutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwapOutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwapInRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwapResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSwapRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSwapsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSwapsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPeersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPeersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReloadPolicyFileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddPeerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemovePeerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequestedSwapsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequestedSwapsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestSwapList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestedSwap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrettyPrintSwap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerSwapPeer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerSwapPeerChannel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwapStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerSwapNodes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Policy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllowSwapRequestsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllowSwapRequestsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peerswaprpc_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_peerswaprpc_proto_rawDesc), len(file_peerswaprpc_proto_rawDesc)), + RawDescriptor: file_peerswaprpc_proto_rawDesc, NumEnums: 1, NumMessages: 32, NumExtensions: 0, @@ -2091,6 +2550,7 @@ func file_peerswaprpc_proto_init() { MessageInfos: file_peerswaprpc_proto_msgTypes, }.Build() File_peerswaprpc_proto = out.File + file_peerswaprpc_proto_rawDesc = nil file_peerswaprpc_proto_goTypes = nil file_peerswaprpc_proto_depIdxs = nil } diff --git a/peerswaprpc/peerswaprpc.pb.gw.go b/peerswaprpc/peerswaprpc.pb.gw.go index cfd09808..f286a128 100644 --- a/peerswaprpc/peerswaprpc.pb.gw.go +++ b/peerswaprpc/peerswaprpc.pb.gw.go @@ -10,7 +10,6 @@ package peerswaprpc import ( "context" - "errors" "io" "net/http" @@ -25,407 +24,512 @@ import ( ) // Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = errors.New - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join func request_PeerSwap_SwapOut_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SwapOutRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq SwapOutRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.SwapOut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_SwapOut_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SwapOutRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq SwapOutRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.SwapOut(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_SwapIn_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SwapInRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq SwapInRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.SwapIn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_SwapIn_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SwapInRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq SwapInRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.SwapIn(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_GetSwap_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetSwapRequest + var metadata runtime.ServerMetadata + var ( - protoReq GetSwapRequest - metadata runtime.ServerMetadata - err error + val string + ok bool + err error + _ = err ) - val, ok := pathParams["swap_id"] + + val, ok = pathParams["swap_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "swap_id") } + protoReq.SwapId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "swap_id", err) } + msg, err := client.GetSwap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_GetSwap_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetSwapRequest + var metadata runtime.ServerMetadata + var ( - protoReq GetSwapRequest - metadata runtime.ServerMetadata - err error + val string + ok bool + err error + _ = err ) - val, ok := pathParams["swap_id"] + + val, ok = pathParams["swap_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "swap_id") } + protoReq.SwapId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "swap_id", err) } + msg, err := server.GetSwap(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_ListSwaps_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListSwapsRequest - metadata runtime.ServerMetadata - ) + var protoReq ListSwapsRequest + var metadata runtime.ServerMetadata + msg, err := client.ListSwaps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_ListSwaps_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListSwapsRequest - metadata runtime.ServerMetadata - ) + var protoReq ListSwapsRequest + var metadata runtime.ServerMetadata + msg, err := server.ListSwaps(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListPeersRequest - metadata runtime.ServerMetadata - ) + var protoReq ListPeersRequest + var metadata runtime.ServerMetadata + msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListPeersRequest - metadata runtime.ServerMetadata - ) + var protoReq ListPeersRequest + var metadata runtime.ServerMetadata + msg, err := server.ListPeers(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_ListRequestedSwaps_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListRequestedSwapsRequest - metadata runtime.ServerMetadata - ) + var protoReq ListRequestedSwapsRequest + var metadata runtime.ServerMetadata + msg, err := client.ListRequestedSwaps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_ListRequestedSwaps_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListRequestedSwapsRequest - metadata runtime.ServerMetadata - ) + var protoReq ListRequestedSwapsRequest + var metadata runtime.ServerMetadata + msg, err := server.ListRequestedSwaps(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_ListActiveSwaps_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListSwapsRequest - metadata runtime.ServerMetadata - ) + var protoReq ListSwapsRequest + var metadata runtime.ServerMetadata + msg, err := client.ListActiveSwaps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_ListActiveSwaps_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ListSwapsRequest - metadata runtime.ServerMetadata - ) + var protoReq ListSwapsRequest + var metadata runtime.ServerMetadata + msg, err := server.ListActiveSwaps(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_AllowSwapRequests_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AllowSwapRequestsRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq AllowSwapRequestsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.AllowSwapRequests(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_AllowSwapRequests_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AllowSwapRequestsRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq AllowSwapRequestsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.AllowSwapRequests(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_ReloadPolicyFile_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ReloadPolicyFileRequest - metadata runtime.ServerMetadata - ) + var protoReq ReloadPolicyFileRequest + var metadata runtime.ServerMetadata + msg, err := client.ReloadPolicyFile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_ReloadPolicyFile_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq ReloadPolicyFileRequest - metadata runtime.ServerMetadata - ) + var protoReq ReloadPolicyFileRequest + var metadata runtime.ServerMetadata + msg, err := server.ReloadPolicyFile(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_AddPeer_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddPeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq AddPeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.AddPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_AddPeer_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddPeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq AddPeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.AddPeer(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_RemovePeer_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemovePeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq RemovePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.RemovePeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_RemovePeer_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemovePeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq RemovePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.RemovePeer(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_AddSusPeer_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddPeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq AddPeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.AddSusPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_AddSusPeer_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AddPeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq AddPeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.AddSusPeer(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_RemoveSusPeer_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemovePeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq RemovePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.RemoveSusPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_RemoveSusPeer_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq RemovePeerRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq RemovePeerRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.RemoveSusPeer(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_LiquidGetAddress_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetAddressRequest - metadata runtime.ServerMetadata - ) + var protoReq GetAddressRequest + var metadata runtime.ServerMetadata + msg, err := client.LiquidGetAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_LiquidGetAddress_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetAddressRequest - metadata runtime.ServerMetadata - ) + var protoReq GetAddressRequest + var metadata runtime.ServerMetadata + msg, err := server.LiquidGetAddress(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_LiquidGetBalance_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetBalanceRequest - metadata runtime.ServerMetadata - ) + var protoReq GetBalanceRequest + var metadata runtime.ServerMetadata + msg, err := client.LiquidGetBalance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_LiquidGetBalance_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq GetBalanceRequest - metadata runtime.ServerMetadata - ) + var protoReq GetBalanceRequest + var metadata runtime.ServerMetadata + msg, err := server.LiquidGetBalance(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_LiquidSendToAddress_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SendToAddressRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq SendToAddressRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.LiquidSendToAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_LiquidSendToAddress_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq SendToAddressRequest - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq SendToAddressRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.LiquidSendToAddress(ctx, &protoReq) return msg, metadata, err + } func request_PeerSwap_Stop_0(ctx context.Context, marshaler runtime.Marshaler, client PeerSwapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq Empty - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq Empty + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := client.Stop(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_PeerSwap_Stop_0(ctx context.Context, marshaler runtime.Marshaler, server PeerSwapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq Empty - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + var protoReq Empty + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + msg, err := server.Stop(ctx, &protoReq) return msg, metadata, err + } // RegisterPeerSwapHandlerServer registers the http handlers for service PeerSwap to "mux". // UnaryRPC :call PeerSwapServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPeerSwapHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PeerSwapServer) error { - mux.Handle(http.MethodPost, pattern_PeerSwap_SwapOut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_SwapOut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/SwapOut", runtime.WithHTTPPathPattern("/v1/swaps/swapout")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/SwapOut", runtime.WithHTTPPathPattern("/v1/swaps/swapout")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -437,15 +541,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_SwapOut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_SwapIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_SwapIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/SwapIn", runtime.WithHTTPPathPattern("/v1/swaps/swapin")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/SwapIn", runtime.WithHTTPPathPattern("/v1/swaps/swapin")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -457,15 +566,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_SwapIn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_GetSwap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_GetSwap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/GetSwap", runtime.WithHTTPPathPattern("/v1/swaps/{swap_id}")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/GetSwap", runtime.WithHTTPPathPattern("/v1/swaps/{swap_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -477,15 +591,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_GetSwap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListSwaps", runtime.WithHTTPPathPattern("/v1/swaps")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListSwaps", runtime.WithHTTPPathPattern("/v1/swaps")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -497,15 +616,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListSwaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListPeers", runtime.WithHTTPPathPattern("/v1/peers")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListPeers", runtime.WithHTTPPathPattern("/v1/peers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -517,15 +641,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListPeers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListRequestedSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListRequestedSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListRequestedSwaps", runtime.WithHTTPPathPattern("/v1/swaps/requests")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListRequestedSwaps", runtime.WithHTTPPathPattern("/v1/swaps/requests")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -537,15 +666,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListRequestedSwaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListActiveSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListActiveSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListActiveSwaps", runtime.WithHTTPPathPattern("/v1/swaps/active")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ListActiveSwaps", runtime.WithHTTPPathPattern("/v1/swaps/active")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -557,15 +691,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListActiveSwaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_AllowSwapRequests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_AllowSwapRequests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/AllowSwapRequests", runtime.WithHTTPPathPattern("/v1/swaps/allowrequests")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/AllowSwapRequests", runtime.WithHTTPPathPattern("/v1/swaps/allowrequests")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -577,15 +716,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_AllowSwapRequests_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ReloadPolicyFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ReloadPolicyFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ReloadPolicyFile", runtime.WithHTTPPathPattern("/v1/policy/reload")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/ReloadPolicyFile", runtime.WithHTTPPathPattern("/v1/policy/reload")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -597,15 +741,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ReloadPolicyFile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_AddPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_AddPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/AddPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/add")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/AddPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -617,15 +766,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_AddPeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_RemovePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_RemovePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/RemovePeer", runtime.WithHTTPPathPattern("/v1/policy/peer/remove")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/RemovePeer", runtime.WithHTTPPathPattern("/v1/policy/peer/remove")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -637,15 +791,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_RemovePeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_AddSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_AddSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/AddSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/addsus")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/AddSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/addsus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -657,15 +816,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_AddSusPeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_RemoveSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_RemoveSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/RemoveSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/removesus")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/RemoveSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/removesus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -677,15 +841,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_RemoveSusPeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_LiquidGetAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_LiquidGetAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetAddress", runtime.WithHTTPPathPattern("/v1/liquid/address")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetAddress", runtime.WithHTTPPathPattern("/v1/liquid/address")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -697,15 +866,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_LiquidGetAddress_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_LiquidGetBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_LiquidGetBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetBalance", runtime.WithHTTPPathPattern("/v1/liquid/balance")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetBalance", runtime.WithHTTPPathPattern("/v1/liquid/balance")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -717,15 +891,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_LiquidGetBalance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_LiquidSendToAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_LiquidSendToAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidSendToAddress", runtime.WithHTTPPathPattern("/v1/liquid/send")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidSendToAddress", runtime.WithHTTPPathPattern("/v1/liquid/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -737,15 +916,20 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_LiquidSendToAddress_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_Stop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_Stop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/Stop", runtime.WithHTTPPathPattern("/v1/stop")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/peerswap.PeerSwap/Stop", runtime.WithHTTPPathPattern("/v1/stop")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -757,7 +941,9 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_Stop_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil @@ -766,24 +952,25 @@ func RegisterPeerSwapHandlerServer(ctx context.Context, mux *runtime.ServeMux, s // RegisterPeerSwapHandlerFromEndpoint is same as RegisterPeerSwapHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterPeerSwapHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.NewClient(endpoint, opts...) + conn, err := grpc.Dial(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) } }() }() + return RegisterPeerSwapHandler(ctx, mux, conn) } @@ -797,13 +984,16 @@ func RegisterPeerSwapHandler(ctx context.Context, mux *runtime.ServeMux, conn *g // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PeerSwapClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PeerSwapClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "PeerSwapClient" to call the correct interceptors. This client ignores the HTTP middlewares. +// "PeerSwapClient" to call the correct interceptors. func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PeerSwapClient) error { - mux.Handle(http.MethodPost, pattern_PeerSwap_SwapOut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_SwapOut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/SwapOut", runtime.WithHTTPPathPattern("/v1/swaps/swapout")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/SwapOut", runtime.WithHTTPPathPattern("/v1/swaps/swapout")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -814,13 +1004,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_SwapOut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_SwapIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_SwapIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/SwapIn", runtime.WithHTTPPathPattern("/v1/swaps/swapin")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/SwapIn", runtime.WithHTTPPathPattern("/v1/swaps/swapin")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -831,13 +1026,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_SwapIn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_GetSwap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_GetSwap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/GetSwap", runtime.WithHTTPPathPattern("/v1/swaps/{swap_id}")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/GetSwap", runtime.WithHTTPPathPattern("/v1/swaps/{swap_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -848,13 +1048,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_GetSwap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListSwaps", runtime.WithHTTPPathPattern("/v1/swaps")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListSwaps", runtime.WithHTTPPathPattern("/v1/swaps")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -865,13 +1070,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListSwaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListPeers", runtime.WithHTTPPathPattern("/v1/peers")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListPeers", runtime.WithHTTPPathPattern("/v1/peers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -882,13 +1092,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListPeers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListRequestedSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListRequestedSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListRequestedSwaps", runtime.WithHTTPPathPattern("/v1/swaps/requests")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListRequestedSwaps", runtime.WithHTTPPathPattern("/v1/swaps/requests")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -899,13 +1114,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListRequestedSwaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ListActiveSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ListActiveSwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListActiveSwaps", runtime.WithHTTPPathPattern("/v1/swaps/active")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ListActiveSwaps", runtime.WithHTTPPathPattern("/v1/swaps/active")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -916,13 +1136,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ListActiveSwaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_AllowSwapRequests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_AllowSwapRequests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/AllowSwapRequests", runtime.WithHTTPPathPattern("/v1/swaps/allowrequests")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/AllowSwapRequests", runtime.WithHTTPPathPattern("/v1/swaps/allowrequests")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -933,13 +1158,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_AllowSwapRequests_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_ReloadPolicyFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_ReloadPolicyFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ReloadPolicyFile", runtime.WithHTTPPathPattern("/v1/policy/reload")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/ReloadPolicyFile", runtime.WithHTTPPathPattern("/v1/policy/reload")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -950,13 +1180,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_ReloadPolicyFile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_AddPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_AddPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/AddPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/add")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/AddPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -967,13 +1202,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_AddPeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_RemovePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_RemovePeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/RemovePeer", runtime.WithHTTPPathPattern("/v1/policy/peer/remove")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/RemovePeer", runtime.WithHTTPPathPattern("/v1/policy/peer/remove")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -984,13 +1224,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_RemovePeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_AddSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_AddSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/AddSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/addsus")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/AddSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/addsus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1001,13 +1246,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_AddSusPeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_RemoveSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_RemoveSusPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/RemoveSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/removesus")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/RemoveSusPeer", runtime.WithHTTPPathPattern("/v1/policy/peer/removesus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1018,13 +1268,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_RemoveSusPeer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_LiquidGetAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_LiquidGetAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetAddress", runtime.WithHTTPPathPattern("/v1/liquid/address")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetAddress", runtime.WithHTTPPathPattern("/v1/liquid/address")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1035,13 +1290,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_LiquidGetAddress_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodGet, pattern_PeerSwap_LiquidGetBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("GET", pattern_PeerSwap_LiquidGetBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetBalance", runtime.WithHTTPPathPattern("/v1/liquid/balance")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidGetBalance", runtime.WithHTTPPathPattern("/v1/liquid/balance")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1052,13 +1312,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_LiquidGetBalance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_LiquidSendToAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_LiquidSendToAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidSendToAddress", runtime.WithHTTPPathPattern("/v1/liquid/send")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/LiquidSendToAddress", runtime.WithHTTPPathPattern("/v1/liquid/send")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1069,13 +1334,18 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_LiquidSendToAddress_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) - mux.Handle(http.MethodPost, pattern_PeerSwap_Stop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + + mux.Handle("POST", pattern_PeerSwap_Stop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/Stop", runtime.WithHTTPPathPattern("/v1/stop")) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/peerswap.PeerSwap/Stop", runtime.WithHTTPPathPattern("/v1/stop")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1086,47 +1356,82 @@ func RegisterPeerSwapHandlerClient(ctx context.Context, mux *runtime.ServeMux, c runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } + forward_PeerSwap_Stop_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } var ( - pattern_PeerSwap_SwapOut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "swapout"}, "")) - pattern_PeerSwap_SwapIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "swapin"}, "")) - pattern_PeerSwap_GetSwap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "swaps", "swap_id"}, "")) - pattern_PeerSwap_ListSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "swaps"}, "")) - pattern_PeerSwap_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, "")) - pattern_PeerSwap_ListRequestedSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "requests"}, "")) - pattern_PeerSwap_ListActiveSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "active"}, "")) - pattern_PeerSwap_AllowSwapRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "allowrequests"}, "")) - pattern_PeerSwap_ReloadPolicyFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "policy", "reload"}, "")) - pattern_PeerSwap_AddPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "add"}, "")) - pattern_PeerSwap_RemovePeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "remove"}, "")) - pattern_PeerSwap_AddSusPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "addsus"}, "")) - pattern_PeerSwap_RemoveSusPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "removesus"}, "")) - pattern_PeerSwap_LiquidGetAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "liquid", "address"}, "")) - pattern_PeerSwap_LiquidGetBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "liquid", "balance"}, "")) + pattern_PeerSwap_SwapOut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "swapout"}, "")) + + pattern_PeerSwap_SwapIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "swapin"}, "")) + + pattern_PeerSwap_GetSwap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "swaps", "swap_id"}, "")) + + pattern_PeerSwap_ListSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "swaps"}, "")) + + pattern_PeerSwap_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "peers"}, "")) + + pattern_PeerSwap_ListRequestedSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "requests"}, "")) + + pattern_PeerSwap_ListActiveSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "active"}, "")) + + pattern_PeerSwap_AllowSwapRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "swaps", "allowrequests"}, "")) + + pattern_PeerSwap_ReloadPolicyFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "policy", "reload"}, "")) + + pattern_PeerSwap_AddPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "add"}, "")) + + pattern_PeerSwap_RemovePeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "remove"}, "")) + + pattern_PeerSwap_AddSusPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "addsus"}, "")) + + pattern_PeerSwap_RemoveSusPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "policy", "peer", "removesus"}, "")) + + pattern_PeerSwap_LiquidGetAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "liquid", "address"}, "")) + + pattern_PeerSwap_LiquidGetBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "liquid", "balance"}, "")) + pattern_PeerSwap_LiquidSendToAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "liquid", "send"}, "")) - pattern_PeerSwap_Stop_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "stop"}, "")) + + pattern_PeerSwap_Stop_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "stop"}, "")) ) var ( - forward_PeerSwap_SwapOut_0 = runtime.ForwardResponseMessage - forward_PeerSwap_SwapIn_0 = runtime.ForwardResponseMessage - forward_PeerSwap_GetSwap_0 = runtime.ForwardResponseMessage - forward_PeerSwap_ListSwaps_0 = runtime.ForwardResponseMessage - forward_PeerSwap_ListPeers_0 = runtime.ForwardResponseMessage - forward_PeerSwap_ListRequestedSwaps_0 = runtime.ForwardResponseMessage - forward_PeerSwap_ListActiveSwaps_0 = runtime.ForwardResponseMessage - forward_PeerSwap_AllowSwapRequests_0 = runtime.ForwardResponseMessage - forward_PeerSwap_ReloadPolicyFile_0 = runtime.ForwardResponseMessage - forward_PeerSwap_AddPeer_0 = runtime.ForwardResponseMessage - forward_PeerSwap_RemovePeer_0 = runtime.ForwardResponseMessage - forward_PeerSwap_AddSusPeer_0 = runtime.ForwardResponseMessage - forward_PeerSwap_RemoveSusPeer_0 = runtime.ForwardResponseMessage - forward_PeerSwap_LiquidGetAddress_0 = runtime.ForwardResponseMessage - forward_PeerSwap_LiquidGetBalance_0 = runtime.ForwardResponseMessage + forward_PeerSwap_SwapOut_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_SwapIn_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_GetSwap_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_ListSwaps_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_ListPeers_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_ListRequestedSwaps_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_ListActiveSwaps_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_AllowSwapRequests_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_ReloadPolicyFile_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_AddPeer_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_RemovePeer_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_AddSusPeer_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_RemoveSusPeer_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_LiquidGetAddress_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_LiquidGetBalance_0 = runtime.ForwardResponseMessage + forward_PeerSwap_LiquidSendToAddress_0 = runtime.ForwardResponseMessage - forward_PeerSwap_Stop_0 = runtime.ForwardResponseMessage + + forward_PeerSwap_Stop_0 = runtime.ForwardResponseMessage ) diff --git a/peerswaprpc/peerswaprpc.swagger.json b/peerswaprpc/peerswaprpc.swagger.json index bc56c561..569ff08a 100644 --- a/peerswaprpc/peerswaprpc.swagger.json +++ b/peerswaprpc/peerswaprpc.swagger.json @@ -542,7 +542,6 @@ "peers": { "type": "array", "items": { - "type": "object", "$ref": "#/definitions/peerswapPeerSwapPeer" } } @@ -565,7 +564,6 @@ "swaps": { "type": "array", "items": { - "type": "object", "$ref": "#/definitions/peerswapPrettyPrintSwap" } } @@ -589,7 +587,6 @@ "channels": { "type": "array", "items": { - "type": "object", "$ref": "#/definitions/peerswapPeerSwapPeerChannel" } }, @@ -720,7 +717,6 @@ "requestedSwaps": { "type": "array", "items": { - "type": "object", "$ref": "#/definitions/peerswapRequestedSwap" } } @@ -853,7 +849,6 @@ "details": { "type": "array", "items": { - "type": "object", "$ref": "#/definitions/protobufAny" } } diff --git a/peerswaprpc/peerswaprpc_grpc.pb.go b/peerswaprpc/peerswaprpc_grpc.pb.go index 554190c7..29188725 100644 --- a/peerswaprpc/peerswaprpc_grpc.pb.go +++ b/peerswaprpc/peerswaprpc_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc (unknown) -// source: peerswaprpc.proto package peerswaprpc @@ -15,28 +11,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - PeerSwap_SwapOut_FullMethodName = "/peerswap.PeerSwap/SwapOut" - PeerSwap_SwapIn_FullMethodName = "/peerswap.PeerSwap/SwapIn" - PeerSwap_GetSwap_FullMethodName = "/peerswap.PeerSwap/GetSwap" - PeerSwap_ListSwaps_FullMethodName = "/peerswap.PeerSwap/ListSwaps" - PeerSwap_ListPeers_FullMethodName = "/peerswap.PeerSwap/ListPeers" - PeerSwap_ListRequestedSwaps_FullMethodName = "/peerswap.PeerSwap/ListRequestedSwaps" - PeerSwap_ListActiveSwaps_FullMethodName = "/peerswap.PeerSwap/ListActiveSwaps" - PeerSwap_AllowSwapRequests_FullMethodName = "/peerswap.PeerSwap/AllowSwapRequests" - PeerSwap_ReloadPolicyFile_FullMethodName = "/peerswap.PeerSwap/ReloadPolicyFile" - PeerSwap_AddPeer_FullMethodName = "/peerswap.PeerSwap/AddPeer" - PeerSwap_RemovePeer_FullMethodName = "/peerswap.PeerSwap/RemovePeer" - PeerSwap_AddSusPeer_FullMethodName = "/peerswap.PeerSwap/AddSusPeer" - PeerSwap_RemoveSusPeer_FullMethodName = "/peerswap.PeerSwap/RemoveSusPeer" - PeerSwap_LiquidGetAddress_FullMethodName = "/peerswap.PeerSwap/LiquidGetAddress" - PeerSwap_LiquidGetBalance_FullMethodName = "/peerswap.PeerSwap/LiquidGetBalance" - PeerSwap_LiquidSendToAddress_FullMethodName = "/peerswap.PeerSwap/LiquidSendToAddress" - PeerSwap_Stop_FullMethodName = "/peerswap.PeerSwap/Stop" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // PeerSwapClient is the client API for PeerSwap service. // @@ -72,9 +48,8 @@ func NewPeerSwapClient(cc grpc.ClientConnInterface) PeerSwapClient { } func (c *peerSwapClient) SwapOut(ctx context.Context, in *SwapOutRequest, opts ...grpc.CallOption) (*SwapResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SwapResponse) - err := c.cc.Invoke(ctx, PeerSwap_SwapOut_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/SwapOut", in, out, opts...) if err != nil { return nil, err } @@ -82,9 +57,8 @@ func (c *peerSwapClient) SwapOut(ctx context.Context, in *SwapOutRequest, opts . } func (c *peerSwapClient) SwapIn(ctx context.Context, in *SwapInRequest, opts ...grpc.CallOption) (*SwapResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SwapResponse) - err := c.cc.Invoke(ctx, PeerSwap_SwapIn_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/SwapIn", in, out, opts...) if err != nil { return nil, err } @@ -92,9 +66,8 @@ func (c *peerSwapClient) SwapIn(ctx context.Context, in *SwapInRequest, opts ... } func (c *peerSwapClient) GetSwap(ctx context.Context, in *GetSwapRequest, opts ...grpc.CallOption) (*SwapResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SwapResponse) - err := c.cc.Invoke(ctx, PeerSwap_GetSwap_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/GetSwap", in, out, opts...) if err != nil { return nil, err } @@ -102,9 +75,8 @@ func (c *peerSwapClient) GetSwap(ctx context.Context, in *GetSwapRequest, opts . } func (c *peerSwapClient) ListSwaps(ctx context.Context, in *ListSwapsRequest, opts ...grpc.CallOption) (*ListSwapsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListSwapsResponse) - err := c.cc.Invoke(ctx, PeerSwap_ListSwaps_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/ListSwaps", in, out, opts...) if err != nil { return nil, err } @@ -112,9 +84,8 @@ func (c *peerSwapClient) ListSwaps(ctx context.Context, in *ListSwapsRequest, op } func (c *peerSwapClient) ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListPeersResponse) - err := c.cc.Invoke(ctx, PeerSwap_ListPeers_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/ListPeers", in, out, opts...) if err != nil { return nil, err } @@ -122,9 +93,8 @@ func (c *peerSwapClient) ListPeers(ctx context.Context, in *ListPeersRequest, op } func (c *peerSwapClient) ListRequestedSwaps(ctx context.Context, in *ListRequestedSwapsRequest, opts ...grpc.CallOption) (*ListRequestedSwapsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListRequestedSwapsResponse) - err := c.cc.Invoke(ctx, PeerSwap_ListRequestedSwaps_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/ListRequestedSwaps", in, out, opts...) if err != nil { return nil, err } @@ -132,9 +102,8 @@ func (c *peerSwapClient) ListRequestedSwaps(ctx context.Context, in *ListRequest } func (c *peerSwapClient) ListActiveSwaps(ctx context.Context, in *ListSwapsRequest, opts ...grpc.CallOption) (*ListSwapsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListSwapsResponse) - err := c.cc.Invoke(ctx, PeerSwap_ListActiveSwaps_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/ListActiveSwaps", in, out, opts...) if err != nil { return nil, err } @@ -142,9 +111,8 @@ func (c *peerSwapClient) ListActiveSwaps(ctx context.Context, in *ListSwapsReque } func (c *peerSwapClient) AllowSwapRequests(ctx context.Context, in *AllowSwapRequestsRequest, opts ...grpc.CallOption) (*Policy, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Policy) - err := c.cc.Invoke(ctx, PeerSwap_AllowSwapRequests_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/AllowSwapRequests", in, out, opts...) if err != nil { return nil, err } @@ -152,9 +120,8 @@ func (c *peerSwapClient) AllowSwapRequests(ctx context.Context, in *AllowSwapReq } func (c *peerSwapClient) ReloadPolicyFile(ctx context.Context, in *ReloadPolicyFileRequest, opts ...grpc.CallOption) (*Policy, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Policy) - err := c.cc.Invoke(ctx, PeerSwap_ReloadPolicyFile_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/ReloadPolicyFile", in, out, opts...) if err != nil { return nil, err } @@ -162,9 +129,8 @@ func (c *peerSwapClient) ReloadPolicyFile(ctx context.Context, in *ReloadPolicyF } func (c *peerSwapClient) AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*Policy, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Policy) - err := c.cc.Invoke(ctx, PeerSwap_AddPeer_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/AddPeer", in, out, opts...) if err != nil { return nil, err } @@ -172,9 +138,8 @@ func (c *peerSwapClient) AddPeer(ctx context.Context, in *AddPeerRequest, opts . } func (c *peerSwapClient) RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*Policy, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Policy) - err := c.cc.Invoke(ctx, PeerSwap_RemovePeer_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/RemovePeer", in, out, opts...) if err != nil { return nil, err } @@ -182,9 +147,8 @@ func (c *peerSwapClient) RemovePeer(ctx context.Context, in *RemovePeerRequest, } func (c *peerSwapClient) AddSusPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*Policy, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Policy) - err := c.cc.Invoke(ctx, PeerSwap_AddSusPeer_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/AddSusPeer", in, out, opts...) if err != nil { return nil, err } @@ -192,9 +156,8 @@ func (c *peerSwapClient) AddSusPeer(ctx context.Context, in *AddPeerRequest, opt } func (c *peerSwapClient) RemoveSusPeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*Policy, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Policy) - err := c.cc.Invoke(ctx, PeerSwap_RemoveSusPeer_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/RemoveSusPeer", in, out, opts...) if err != nil { return nil, err } @@ -202,9 +165,8 @@ func (c *peerSwapClient) RemoveSusPeer(ctx context.Context, in *RemovePeerReques } func (c *peerSwapClient) LiquidGetAddress(ctx context.Context, in *GetAddressRequest, opts ...grpc.CallOption) (*GetAddressResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetAddressResponse) - err := c.cc.Invoke(ctx, PeerSwap_LiquidGetAddress_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/LiquidGetAddress", in, out, opts...) if err != nil { return nil, err } @@ -212,9 +174,8 @@ func (c *peerSwapClient) LiquidGetAddress(ctx context.Context, in *GetAddressReq } func (c *peerSwapClient) LiquidGetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetBalanceResponse) - err := c.cc.Invoke(ctx, PeerSwap_LiquidGetBalance_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/LiquidGetBalance", in, out, opts...) if err != nil { return nil, err } @@ -222,9 +183,8 @@ func (c *peerSwapClient) LiquidGetBalance(ctx context.Context, in *GetBalanceReq } func (c *peerSwapClient) LiquidSendToAddress(ctx context.Context, in *SendToAddressRequest, opts ...grpc.CallOption) (*SendToAddressResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SendToAddressResponse) - err := c.cc.Invoke(ctx, PeerSwap_LiquidSendToAddress_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/LiquidSendToAddress", in, out, opts...) if err != nil { return nil, err } @@ -232,9 +192,8 @@ func (c *peerSwapClient) LiquidSendToAddress(ctx context.Context, in *SendToAddr } func (c *peerSwapClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PeerSwap_Stop_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/peerswap.PeerSwap/Stop", in, out, opts...) if err != nil { return nil, err } @@ -243,7 +202,7 @@ func (c *peerSwapClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallO // PeerSwapServer is the server API for PeerSwap service. // All implementations must embed UnimplementedPeerSwapServer -// for forward compatibility. +// for forward compatibility type PeerSwapServer interface { SwapOut(context.Context, *SwapOutRequest) (*SwapResponse, error) SwapIn(context.Context, *SwapInRequest) (*SwapResponse, error) @@ -267,12 +226,9 @@ type PeerSwapServer interface { mustEmbedUnimplementedPeerSwapServer() } -// UnimplementedPeerSwapServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedPeerSwapServer struct{} +// UnimplementedPeerSwapServer must be embedded to have forward compatible implementations. +type UnimplementedPeerSwapServer struct { +} func (UnimplementedPeerSwapServer) SwapOut(context.Context, *SwapOutRequest) (*SwapResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SwapOut not implemented") @@ -326,7 +282,6 @@ func (UnimplementedPeerSwapServer) Stop(context.Context, *Empty) (*Empty, error) return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } func (UnimplementedPeerSwapServer) mustEmbedUnimplementedPeerSwapServer() {} -func (UnimplementedPeerSwapServer) testEmbeddedByValue() {} // UnsafePeerSwapServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PeerSwapServer will @@ -336,13 +291,6 @@ type UnsafePeerSwapServer interface { } func RegisterPeerSwapServer(s grpc.ServiceRegistrar, srv PeerSwapServer) { - // If the following call pancis, it indicates UnimplementedPeerSwapServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&PeerSwap_ServiceDesc, srv) } @@ -356,7 +304,7 @@ func _PeerSwap_SwapOut_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_SwapOut_FullMethodName, + FullMethod: "/peerswap.PeerSwap/SwapOut", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).SwapOut(ctx, req.(*SwapOutRequest)) @@ -374,7 +322,7 @@ func _PeerSwap_SwapIn_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_SwapIn_FullMethodName, + FullMethod: "/peerswap.PeerSwap/SwapIn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).SwapIn(ctx, req.(*SwapInRequest)) @@ -392,7 +340,7 @@ func _PeerSwap_GetSwap_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_GetSwap_FullMethodName, + FullMethod: "/peerswap.PeerSwap/GetSwap", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).GetSwap(ctx, req.(*GetSwapRequest)) @@ -410,7 +358,7 @@ func _PeerSwap_ListSwaps_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_ListSwaps_FullMethodName, + FullMethod: "/peerswap.PeerSwap/ListSwaps", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).ListSwaps(ctx, req.(*ListSwapsRequest)) @@ -428,7 +376,7 @@ func _PeerSwap_ListPeers_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_ListPeers_FullMethodName, + FullMethod: "/peerswap.PeerSwap/ListPeers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).ListPeers(ctx, req.(*ListPeersRequest)) @@ -446,7 +394,7 @@ func _PeerSwap_ListRequestedSwaps_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_ListRequestedSwaps_FullMethodName, + FullMethod: "/peerswap.PeerSwap/ListRequestedSwaps", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).ListRequestedSwaps(ctx, req.(*ListRequestedSwapsRequest)) @@ -464,7 +412,7 @@ func _PeerSwap_ListActiveSwaps_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_ListActiveSwaps_FullMethodName, + FullMethod: "/peerswap.PeerSwap/ListActiveSwaps", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).ListActiveSwaps(ctx, req.(*ListSwapsRequest)) @@ -482,7 +430,7 @@ func _PeerSwap_AllowSwapRequests_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_AllowSwapRequests_FullMethodName, + FullMethod: "/peerswap.PeerSwap/AllowSwapRequests", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).AllowSwapRequests(ctx, req.(*AllowSwapRequestsRequest)) @@ -500,7 +448,7 @@ func _PeerSwap_ReloadPolicyFile_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_ReloadPolicyFile_FullMethodName, + FullMethod: "/peerswap.PeerSwap/ReloadPolicyFile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).ReloadPolicyFile(ctx, req.(*ReloadPolicyFileRequest)) @@ -518,7 +466,7 @@ func _PeerSwap_AddPeer_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_AddPeer_FullMethodName, + FullMethod: "/peerswap.PeerSwap/AddPeer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).AddPeer(ctx, req.(*AddPeerRequest)) @@ -536,7 +484,7 @@ func _PeerSwap_RemovePeer_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_RemovePeer_FullMethodName, + FullMethod: "/peerswap.PeerSwap/RemovePeer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).RemovePeer(ctx, req.(*RemovePeerRequest)) @@ -554,7 +502,7 @@ func _PeerSwap_AddSusPeer_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_AddSusPeer_FullMethodName, + FullMethod: "/peerswap.PeerSwap/AddSusPeer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).AddSusPeer(ctx, req.(*AddPeerRequest)) @@ -572,7 +520,7 @@ func _PeerSwap_RemoveSusPeer_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_RemoveSusPeer_FullMethodName, + FullMethod: "/peerswap.PeerSwap/RemoveSusPeer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).RemoveSusPeer(ctx, req.(*RemovePeerRequest)) @@ -590,7 +538,7 @@ func _PeerSwap_LiquidGetAddress_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_LiquidGetAddress_FullMethodName, + FullMethod: "/peerswap.PeerSwap/LiquidGetAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).LiquidGetAddress(ctx, req.(*GetAddressRequest)) @@ -608,7 +556,7 @@ func _PeerSwap_LiquidGetBalance_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_LiquidGetBalance_FullMethodName, + FullMethod: "/peerswap.PeerSwap/LiquidGetBalance", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).LiquidGetBalance(ctx, req.(*GetBalanceRequest)) @@ -626,7 +574,7 @@ func _PeerSwap_LiquidSendToAddress_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_LiquidSendToAddress_FullMethodName, + FullMethod: "/peerswap.PeerSwap/LiquidSendToAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).LiquidSendToAddress(ctx, req.(*SendToAddressRequest)) @@ -644,7 +592,7 @@ func _PeerSwap_Stop_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PeerSwap_Stop_FullMethodName, + FullMethod: "/peerswap.PeerSwap/Stop", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PeerSwapServer).Stop(ctx, req.(*Empty))