Detect redemptions and mark vtxos has redeemed (#87)

* Update ocean protos & Add blockchain scanner

* Detect redemptions and mark vtxos as redeemed

* Update comment

* Fixes

* Fix watched event type

* Fixes

* Fixes

* Restore watching vtxos at startup

* Update deps
This commit is contained in:
Pietralberto Mazza
2024-02-08 13:40:28 +01:00
committed by GitHub
parent b2e034cf0e
commit 940214f699
29 changed files with 1450 additions and 516 deletions

View File

@@ -28,16 +28,7 @@
],
"default": "FORMAT_UNSPECIFIED"
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
@@ -56,6 +47,15 @@
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"v1AccountInfo": {
"type": "object",
"properties": {

View File

@@ -17,16 +17,7 @@
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
@@ -45,6 +36,15 @@
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"v1AddWebhookResponse": {
"type": "object",
"properties": {
@@ -128,6 +128,9 @@
"default": "TX_EVENT_TYPE_UNSPECIFIED",
"description": " - TX_EVENT_TYPE_BROADCASTED: Tx broadcasted.\n - TX_EVENT_TYPE_UNCONFIRMED: Tx unconfirmed.\n - TX_EVENT_TYPE_CONFIRMED: Tx confirmed."
},
"v1UnwatchExternalScriptResponse": {
"type": "object"
},
"v1Utxo": {
"type": "object",
"properties": {
@@ -187,7 +190,8 @@
"UTXO_EVENT_TYPE_CONFIRMED",
"UTXO_EVENT_TYPE_LOCKED",
"UTXO_EVENT_TYPE_UNLOCKED",
"UTXO_EVENT_TYPE_SPENT"
"UTXO_EVENT_TYPE_SPENT",
"UTXO_EVENT_TYPE_CONFIRMED_SPENT"
],
"default": "UTXO_EVENT_TYPE_UNSPECIFIED"
},
@@ -222,6 +226,14 @@
}
}
},
"v1WatchExternalScriptResponse": {
"type": "object",
"properties": {
"label": {
"type": "string"
}
}
},
"v1WebhookEventType": {
"type": "string",
"enum": [

View File

@@ -27,16 +27,7 @@
"default": "STRATEGY_UNSPECIFIED",
"description": "Coin-selection algorithm."
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
@@ -55,6 +46,15 @@
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"v1BlindPsetResponse": {
"type": "object",
"properties": {
@@ -262,6 +262,14 @@
}
}
},
"v1SignPsetWithSchnorrKeyResponse": {
"type": "object",
"properties": {
"signedTx": {
"type": "string"
}
}
},
"v1SignTransactionResponse": {
"type": "object",
"properties": {

View File

@@ -12,16 +12,7 @@
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
@@ -39,6 +30,15 @@
}
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
}
}
}

View File

@@ -27,16 +27,7 @@
],
"default": "NETWORK_UNSPECIFIED"
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
@@ -55,6 +46,15 @@
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"v1AccountInfo": {
"type": "object",
"properties": {

View File

@@ -35,11 +35,7 @@ func request_ArkService_RegisterPayment_0(ctx context.Context, marshaler runtime
var protoReq RegisterPaymentRequest
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 {
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -52,11 +48,7 @@ func local_request_ArkService_RegisterPayment_0(ctx context.Context, marshaler r
var protoReq RegisterPaymentRequest
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 {
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -69,11 +61,7 @@ func request_ArkService_ClaimPayment_0(ctx context.Context, marshaler runtime.Ma
var protoReq ClaimPaymentRequest
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 {
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -86,11 +74,7 @@ func local_request_ArkService_ClaimPayment_0(ctx context.Context, marshaler runt
var protoReq ClaimPaymentRequest
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 {
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -103,11 +87,7 @@ func request_ArkService_FinalizePayment_0(ctx context.Context, marshaler runtime
var protoReq FinalizePaymentRequest
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 {
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -120,11 +100,7 @@ func local_request_ArkService_FinalizePayment_0(ctx context.Context, marshaler r
var protoReq FinalizePaymentRequest
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 {
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}

View File

@@ -20,6 +20,195 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type WatchExternalScriptRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The script to watch.
Script string `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"`
// Optional: the private blinding key in case the script locks confidential utxos to unblind.
BlindingKey string `protobuf:"bytes,2,opt,name=blinding_key,json=blindingKey,proto3" json:"blinding_key,omitempty"`
}
func (x *WatchExternalScriptRequest) Reset() {
*x = WatchExternalScriptRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WatchExternalScriptRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WatchExternalScriptRequest) ProtoMessage() {}
func (x *WatchExternalScriptRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WatchExternalScriptRequest.ProtoReflect.Descriptor instead.
func (*WatchExternalScriptRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{0}
}
func (x *WatchExternalScriptRequest) GetScript() string {
if x != nil {
return x.Script
}
return ""
}
func (x *WatchExternalScriptRequest) GetBlindingKey() string {
if x != nil {
return x.BlindingKey
}
return ""
}
type WatchExternalScriptResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
}
func (x *WatchExternalScriptResponse) Reset() {
*x = WatchExternalScriptResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WatchExternalScriptResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WatchExternalScriptResponse) ProtoMessage() {}
func (x *WatchExternalScriptResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WatchExternalScriptResponse.ProtoReflect.Descriptor instead.
func (*WatchExternalScriptResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{1}
}
func (x *WatchExternalScriptResponse) GetLabel() string {
if x != nil {
return x.Label
}
return ""
}
type UnwatchExternalScriptRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
}
func (x *UnwatchExternalScriptRequest) Reset() {
*x = UnwatchExternalScriptRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnwatchExternalScriptRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnwatchExternalScriptRequest) ProtoMessage() {}
func (x *UnwatchExternalScriptRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnwatchExternalScriptRequest.ProtoReflect.Descriptor instead.
func (*UnwatchExternalScriptRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{2}
}
func (x *UnwatchExternalScriptRequest) GetLabel() string {
if x != nil {
return x.Label
}
return ""
}
type UnwatchExternalScriptResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UnwatchExternalScriptResponse) Reset() {
*x = UnwatchExternalScriptResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnwatchExternalScriptResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnwatchExternalScriptResponse) ProtoMessage() {}
func (x *UnwatchExternalScriptResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnwatchExternalScriptResponse.ProtoReflect.Descriptor instead.
func (*UnwatchExternalScriptResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{3}
}
type TransactionNotificationsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -29,7 +218,7 @@ type TransactionNotificationsRequest struct {
func (x *TransactionNotificationsRequest) Reset() {
*x = TransactionNotificationsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[0]
mi := &file_ocean_v1_notification_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -42,7 +231,7 @@ func (x *TransactionNotificationsRequest) String() string {
func (*TransactionNotificationsRequest) ProtoMessage() {}
func (x *TransactionNotificationsRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[0]
mi := &file_ocean_v1_notification_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -55,7 +244,7 @@ func (x *TransactionNotificationsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use TransactionNotificationsRequest.ProtoReflect.Descriptor instead.
func (*TransactionNotificationsRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{0}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{4}
}
type TransactionNotificationsResponse struct {
@@ -78,7 +267,7 @@ type TransactionNotificationsResponse struct {
func (x *TransactionNotificationsResponse) Reset() {
*x = TransactionNotificationsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[1]
mi := &file_ocean_v1_notification_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -91,7 +280,7 @@ func (x *TransactionNotificationsResponse) String() string {
func (*TransactionNotificationsResponse) ProtoMessage() {}
func (x *TransactionNotificationsResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[1]
mi := &file_ocean_v1_notification_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -104,7 +293,7 @@ func (x *TransactionNotificationsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use TransactionNotificationsResponse.ProtoReflect.Descriptor instead.
func (*TransactionNotificationsResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{1}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{5}
}
func (x *TransactionNotificationsResponse) GetEventType() TxEventType {
@@ -151,7 +340,7 @@ type UtxosNotificationsRequest struct {
func (x *UtxosNotificationsRequest) Reset() {
*x = UtxosNotificationsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[2]
mi := &file_ocean_v1_notification_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -164,7 +353,7 @@ func (x *UtxosNotificationsRequest) String() string {
func (*UtxosNotificationsRequest) ProtoMessage() {}
func (x *UtxosNotificationsRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[2]
mi := &file_ocean_v1_notification_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -177,7 +366,7 @@ func (x *UtxosNotificationsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UtxosNotificationsRequest.ProtoReflect.Descriptor instead.
func (*UtxosNotificationsRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{2}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{6}
}
type UtxosNotificationsResponse struct {
@@ -194,7 +383,7 @@ type UtxosNotificationsResponse struct {
func (x *UtxosNotificationsResponse) Reset() {
*x = UtxosNotificationsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[3]
mi := &file_ocean_v1_notification_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -207,7 +396,7 @@ func (x *UtxosNotificationsResponse) String() string {
func (*UtxosNotificationsResponse) ProtoMessage() {}
func (x *UtxosNotificationsResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[3]
mi := &file_ocean_v1_notification_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -220,7 +409,7 @@ func (x *UtxosNotificationsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UtxosNotificationsResponse.ProtoReflect.Descriptor instead.
func (*UtxosNotificationsResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{3}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{7}
}
func (x *UtxosNotificationsResponse) GetEventType() UtxoEventType {
@@ -254,7 +443,7 @@ type AddWebhookRequest struct {
func (x *AddWebhookRequest) Reset() {
*x = AddWebhookRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[4]
mi := &file_ocean_v1_notification_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -267,7 +456,7 @@ func (x *AddWebhookRequest) String() string {
func (*AddWebhookRequest) ProtoMessage() {}
func (x *AddWebhookRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[4]
mi := &file_ocean_v1_notification_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -280,7 +469,7 @@ func (x *AddWebhookRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AddWebhookRequest.ProtoReflect.Descriptor instead.
func (*AddWebhookRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{4}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{8}
}
func (x *AddWebhookRequest) GetEndpoint() string {
@@ -316,7 +505,7 @@ type AddWebhookResponse struct {
func (x *AddWebhookResponse) Reset() {
*x = AddWebhookResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[5]
mi := &file_ocean_v1_notification_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -329,7 +518,7 @@ func (x *AddWebhookResponse) String() string {
func (*AddWebhookResponse) ProtoMessage() {}
func (x *AddWebhookResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[5]
mi := &file_ocean_v1_notification_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -342,7 +531,7 @@ func (x *AddWebhookResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use AddWebhookResponse.ProtoReflect.Descriptor instead.
func (*AddWebhookResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{5}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{9}
}
func (x *AddWebhookResponse) GetId() string {
@@ -364,7 +553,7 @@ type RemoveWebhookRequest struct {
func (x *RemoveWebhookRequest) Reset() {
*x = RemoveWebhookRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[6]
mi := &file_ocean_v1_notification_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -377,7 +566,7 @@ func (x *RemoveWebhookRequest) String() string {
func (*RemoveWebhookRequest) ProtoMessage() {}
func (x *RemoveWebhookRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[6]
mi := &file_ocean_v1_notification_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -390,7 +579,7 @@ func (x *RemoveWebhookRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveWebhookRequest.ProtoReflect.Descriptor instead.
func (*RemoveWebhookRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{6}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{10}
}
func (x *RemoveWebhookRequest) GetId() string {
@@ -409,7 +598,7 @@ type RemoveWebhookResponse struct {
func (x *RemoveWebhookResponse) Reset() {
*x = RemoveWebhookResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[7]
mi := &file_ocean_v1_notification_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -422,7 +611,7 @@ func (x *RemoveWebhookResponse) String() string {
func (*RemoveWebhookResponse) ProtoMessage() {}
func (x *RemoveWebhookResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[7]
mi := &file_ocean_v1_notification_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -435,7 +624,7 @@ func (x *RemoveWebhookResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveWebhookResponse.ProtoReflect.Descriptor instead.
func (*RemoveWebhookResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{7}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{11}
}
type ListWebhooksRequest struct {
@@ -450,7 +639,7 @@ type ListWebhooksRequest struct {
func (x *ListWebhooksRequest) Reset() {
*x = ListWebhooksRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[8]
mi := &file_ocean_v1_notification_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -463,7 +652,7 @@ func (x *ListWebhooksRequest) String() string {
func (*ListWebhooksRequest) ProtoMessage() {}
func (x *ListWebhooksRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[8]
mi := &file_ocean_v1_notification_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -476,7 +665,7 @@ func (x *ListWebhooksRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListWebhooksRequest.ProtoReflect.Descriptor instead.
func (*ListWebhooksRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{8}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{12}
}
func (x *ListWebhooksRequest) GetEventType() WebhookEventType {
@@ -498,7 +687,7 @@ type ListWebhooksResponse struct {
func (x *ListWebhooksResponse) Reset() {
*x = ListWebhooksResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[9]
mi := &file_ocean_v1_notification_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -511,7 +700,7 @@ func (x *ListWebhooksResponse) String() string {
func (*ListWebhooksResponse) ProtoMessage() {}
func (x *ListWebhooksResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[9]
mi := &file_ocean_v1_notification_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -524,7 +713,7 @@ func (x *ListWebhooksResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListWebhooksResponse.ProtoReflect.Descriptor instead.
func (*ListWebhooksResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{9}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{13}
}
func (x *ListWebhooksResponse) GetWebhookInfo() []*WebhookInfo {
@@ -550,7 +739,7 @@ type WebhookInfo struct {
func (x *WebhookInfo) Reset() {
*x = WebhookInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_notification_proto_msgTypes[10]
mi := &file_ocean_v1_notification_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -563,7 +752,7 @@ func (x *WebhookInfo) String() string {
func (*WebhookInfo) ProtoMessage() {}
func (x *WebhookInfo) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_notification_proto_msgTypes[10]
mi := &file_ocean_v1_notification_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -576,7 +765,7 @@ func (x *WebhookInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use WebhookInfo.ProtoReflect.Descriptor instead.
func (*WebhookInfo) Descriptor() ([]byte, []int) {
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{10}
return file_ocean_v1_notification_proto_rawDescGZIP(), []int{14}
}
func (x *WebhookInfo) GetId() string {
@@ -606,105 +795,132 @@ var file_ocean_v1_notification_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76,
0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x21, 0x0a,
0x1f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x22, 0xe4, 0x01, 0x0a, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65,
0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03,
0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73,
0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x68, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x74, 0x78, 0x68, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0d, 0x62, 0x6c,
0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f,
0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x74, 0x78, 0x6f, 0x73,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x1a, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74,
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52,
0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x05, 0x75, 0x74,
0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73,
0x22, 0x82, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69,
0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79,
0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x24, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68,
0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x14, 0x52,
0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x69, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62,
0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x0a, 0x13,
0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54,
0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x50,
0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0c, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f,
0x6b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f,
0x22, 0x58, 0x0a, 0x0b, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69,
0x73, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x09, 0x69, 0x73, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x64, 0x32, 0xdd, 0x03, 0x0a, 0x13, 0x4e,
0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x73, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61,
0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a,
0x1a, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63,
0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f,
0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x6c, 0x69, 0x6e, 0x64,
0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x22, 0x33, 0x0a, 0x1b, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45,
0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x34, 0x0a, 0x1c, 0x55,
0x6e, 0x77, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63,
0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c,
0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65,
0x6c, 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x6e, 0x77, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x21, 0x0a, 0x1f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x61, 0x0a, 0x12, 0x55, 0x74, 0x78, 0x6f, 0x73,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x2e,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f,
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74,
0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65,
0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x68, 0x65, 0x78, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x68, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x74,
0x78, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12,
0x3b, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x0c,
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x1b, 0x0a, 0x19,
0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x1a, 0x55, 0x74, 0x78,
0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6f, 0x63,
0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12,
0x24, 0x0a, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x52, 0x05,
0x75, 0x74, 0x78, 0x6f, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62,
0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65,
0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65,
0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x63,
0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79,
0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x24, 0x0a, 0x12, 0x41, 0x64,
0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
0x22, 0x26, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f,
0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x50, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54,
0x79, 0x70, 0x65, 0x22, 0x50, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f,
0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0c, 0x77,
0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62,
0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f,
0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x58, 0x0a, 0x0b, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74,
0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x64, 0x32,
0xa5, 0x05, 0x0a, 0x13, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x13, 0x57, 0x61, 0x74, 0x63, 0x68,
0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x24,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45,
0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72,
0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x15, 0x55,
0x6e, 0x77, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63,
0x72, 0x69, 0x70, 0x74, 0x12, 0x26, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x55, 0x6e, 0x77, 0x61, 0x74, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53,
0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x77, 0x61, 0x74, 0x63, 0x68, 0x45,
0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x12, 0x29, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61,
0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x61, 0x0a, 0x12, 0x55, 0x74,
0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x0a, 0x41, 0x64,
0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e,
0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f,
0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x47, 0x0a,
0x0a, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1b, 0x2e, 0x6f, 0x63,
0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e,
0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57,
0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0c, 0x4c, 0x69, 0x73,
0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65,
0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74,
0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e,
0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xa5, 0x01, 0x0a, 0x0c, 0x63,
0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4e, 0x6f, 0x74,
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x6b,
0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x61, 0x70, 0x69,
0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67,
0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2,
0x02, 0x14, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a,
0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa5, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70,
0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31,
0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56,
0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4f,
0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -719,45 +935,53 @@ func file_ocean_v1_notification_proto_rawDescGZIP() []byte {
return file_ocean_v1_notification_proto_rawDescData
}
var file_ocean_v1_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_ocean_v1_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_ocean_v1_notification_proto_goTypes = []interface{}{
(*TransactionNotificationsRequest)(nil), // 0: ocean.v1.TransactionNotificationsRequest
(*TransactionNotificationsResponse)(nil), // 1: ocean.v1.TransactionNotificationsResponse
(*UtxosNotificationsRequest)(nil), // 2: ocean.v1.UtxosNotificationsRequest
(*UtxosNotificationsResponse)(nil), // 3: ocean.v1.UtxosNotificationsResponse
(*AddWebhookRequest)(nil), // 4: ocean.v1.AddWebhookRequest
(*AddWebhookResponse)(nil), // 5: ocean.v1.AddWebhookResponse
(*RemoveWebhookRequest)(nil), // 6: ocean.v1.RemoveWebhookRequest
(*RemoveWebhookResponse)(nil), // 7: ocean.v1.RemoveWebhookResponse
(*ListWebhooksRequest)(nil), // 8: ocean.v1.ListWebhooksRequest
(*ListWebhooksResponse)(nil), // 9: ocean.v1.ListWebhooksResponse
(*WebhookInfo)(nil), // 10: ocean.v1.WebhookInfo
(TxEventType)(0), // 11: ocean.v1.TxEventType
(*BlockDetails)(nil), // 12: ocean.v1.BlockDetails
(UtxoEventType)(0), // 13: ocean.v1.UtxoEventType
(*Utxo)(nil), // 14: ocean.v1.Utxo
(WebhookEventType)(0), // 15: ocean.v1.WebhookEventType
(*WatchExternalScriptRequest)(nil), // 0: ocean.v1.WatchExternalScriptRequest
(*WatchExternalScriptResponse)(nil), // 1: ocean.v1.WatchExternalScriptResponse
(*UnwatchExternalScriptRequest)(nil), // 2: ocean.v1.UnwatchExternalScriptRequest
(*UnwatchExternalScriptResponse)(nil), // 3: ocean.v1.UnwatchExternalScriptResponse
(*TransactionNotificationsRequest)(nil), // 4: ocean.v1.TransactionNotificationsRequest
(*TransactionNotificationsResponse)(nil), // 5: ocean.v1.TransactionNotificationsResponse
(*UtxosNotificationsRequest)(nil), // 6: ocean.v1.UtxosNotificationsRequest
(*UtxosNotificationsResponse)(nil), // 7: ocean.v1.UtxosNotificationsResponse
(*AddWebhookRequest)(nil), // 8: ocean.v1.AddWebhookRequest
(*AddWebhookResponse)(nil), // 9: ocean.v1.AddWebhookResponse
(*RemoveWebhookRequest)(nil), // 10: ocean.v1.RemoveWebhookRequest
(*RemoveWebhookResponse)(nil), // 11: ocean.v1.RemoveWebhookResponse
(*ListWebhooksRequest)(nil), // 12: ocean.v1.ListWebhooksRequest
(*ListWebhooksResponse)(nil), // 13: ocean.v1.ListWebhooksResponse
(*WebhookInfo)(nil), // 14: ocean.v1.WebhookInfo
(TxEventType)(0), // 15: ocean.v1.TxEventType
(*BlockDetails)(nil), // 16: ocean.v1.BlockDetails
(UtxoEventType)(0), // 17: ocean.v1.UtxoEventType
(*Utxo)(nil), // 18: ocean.v1.Utxo
(WebhookEventType)(0), // 19: ocean.v1.WebhookEventType
}
var file_ocean_v1_notification_proto_depIdxs = []int32{
11, // 0: ocean.v1.TransactionNotificationsResponse.event_type:type_name -> ocean.v1.TxEventType
12, // 1: ocean.v1.TransactionNotificationsResponse.block_details:type_name -> ocean.v1.BlockDetails
13, // 2: ocean.v1.UtxosNotificationsResponse.event_type:type_name -> ocean.v1.UtxoEventType
14, // 3: ocean.v1.UtxosNotificationsResponse.utxos:type_name -> ocean.v1.Utxo
15, // 4: ocean.v1.AddWebhookRequest.event_type:type_name -> ocean.v1.WebhookEventType
15, // 5: ocean.v1.ListWebhooksRequest.event_type:type_name -> ocean.v1.WebhookEventType
10, // 6: ocean.v1.ListWebhooksResponse.webhook_info:type_name -> ocean.v1.WebhookInfo
0, // 7: ocean.v1.NotificationService.TransactionNotifications:input_type -> ocean.v1.TransactionNotificationsRequest
2, // 8: ocean.v1.NotificationService.UtxosNotifications:input_type -> ocean.v1.UtxosNotificationsRequest
4, // 9: ocean.v1.NotificationService.AddWebhook:input_type -> ocean.v1.AddWebhookRequest
6, // 10: ocean.v1.NotificationService.RemoveWebhook:input_type -> ocean.v1.RemoveWebhookRequest
8, // 11: ocean.v1.NotificationService.ListWebhooks:input_type -> ocean.v1.ListWebhooksRequest
1, // 12: ocean.v1.NotificationService.TransactionNotifications:output_type -> ocean.v1.TransactionNotificationsResponse
3, // 13: ocean.v1.NotificationService.UtxosNotifications:output_type -> ocean.v1.UtxosNotificationsResponse
5, // 14: ocean.v1.NotificationService.AddWebhook:output_type -> ocean.v1.AddWebhookResponse
7, // 15: ocean.v1.NotificationService.RemoveWebhook:output_type -> ocean.v1.RemoveWebhookResponse
9, // 16: ocean.v1.NotificationService.ListWebhooks:output_type -> ocean.v1.ListWebhooksResponse
12, // [12:17] is the sub-list for method output_type
7, // [7:12] is the sub-list for method input_type
15, // 0: ocean.v1.TransactionNotificationsResponse.event_type:type_name -> ocean.v1.TxEventType
16, // 1: ocean.v1.TransactionNotificationsResponse.block_details:type_name -> ocean.v1.BlockDetails
17, // 2: ocean.v1.UtxosNotificationsResponse.event_type:type_name -> ocean.v1.UtxoEventType
18, // 3: ocean.v1.UtxosNotificationsResponse.utxos:type_name -> ocean.v1.Utxo
19, // 4: ocean.v1.AddWebhookRequest.event_type:type_name -> ocean.v1.WebhookEventType
19, // 5: ocean.v1.ListWebhooksRequest.event_type:type_name -> ocean.v1.WebhookEventType
14, // 6: ocean.v1.ListWebhooksResponse.webhook_info:type_name -> ocean.v1.WebhookInfo
0, // 7: ocean.v1.NotificationService.WatchExternalScript:input_type -> ocean.v1.WatchExternalScriptRequest
2, // 8: ocean.v1.NotificationService.UnwatchExternalScript:input_type -> ocean.v1.UnwatchExternalScriptRequest
4, // 9: ocean.v1.NotificationService.TransactionNotifications:input_type -> ocean.v1.TransactionNotificationsRequest
6, // 10: ocean.v1.NotificationService.UtxosNotifications:input_type -> ocean.v1.UtxosNotificationsRequest
8, // 11: ocean.v1.NotificationService.AddWebhook:input_type -> ocean.v1.AddWebhookRequest
10, // 12: ocean.v1.NotificationService.RemoveWebhook:input_type -> ocean.v1.RemoveWebhookRequest
12, // 13: ocean.v1.NotificationService.ListWebhooks:input_type -> ocean.v1.ListWebhooksRequest
1, // 14: ocean.v1.NotificationService.WatchExternalScript:output_type -> ocean.v1.WatchExternalScriptResponse
3, // 15: ocean.v1.NotificationService.UnwatchExternalScript:output_type -> ocean.v1.UnwatchExternalScriptResponse
5, // 16: ocean.v1.NotificationService.TransactionNotifications:output_type -> ocean.v1.TransactionNotificationsResponse
7, // 17: ocean.v1.NotificationService.UtxosNotifications:output_type -> ocean.v1.UtxosNotificationsResponse
9, // 18: ocean.v1.NotificationService.AddWebhook:output_type -> ocean.v1.AddWebhookResponse
11, // 19: ocean.v1.NotificationService.RemoveWebhook:output_type -> ocean.v1.RemoveWebhookResponse
13, // 20: ocean.v1.NotificationService.ListWebhooks:output_type -> ocean.v1.ListWebhooksResponse
14, // [14:21] is the sub-list for method output_type
7, // [7:14] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
@@ -771,7 +995,7 @@ func file_ocean_v1_notification_proto_init() {
file_ocean_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_ocean_v1_notification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransactionNotificationsRequest); i {
switch v := v.(*WatchExternalScriptRequest); i {
case 0:
return &v.state
case 1:
@@ -783,7 +1007,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransactionNotificationsResponse); i {
switch v := v.(*WatchExternalScriptResponse); i {
case 0:
return &v.state
case 1:
@@ -795,7 +1019,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UtxosNotificationsRequest); i {
switch v := v.(*UnwatchExternalScriptRequest); i {
case 0:
return &v.state
case 1:
@@ -807,7 +1031,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UtxosNotificationsResponse); i {
switch v := v.(*UnwatchExternalScriptResponse); i {
case 0:
return &v.state
case 1:
@@ -819,7 +1043,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddWebhookRequest); i {
switch v := v.(*TransactionNotificationsRequest); i {
case 0:
return &v.state
case 1:
@@ -831,7 +1055,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddWebhookResponse); i {
switch v := v.(*TransactionNotificationsResponse); i {
case 0:
return &v.state
case 1:
@@ -843,7 +1067,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveWebhookRequest); i {
switch v := v.(*UtxosNotificationsRequest); i {
case 0:
return &v.state
case 1:
@@ -855,7 +1079,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveWebhookResponse); i {
switch v := v.(*UtxosNotificationsResponse); i {
case 0:
return &v.state
case 1:
@@ -867,7 +1091,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListWebhooksRequest); i {
switch v := v.(*AddWebhookRequest); i {
case 0:
return &v.state
case 1:
@@ -879,7 +1103,7 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListWebhooksResponse); i {
switch v := v.(*AddWebhookResponse); i {
case 0:
return &v.state
case 1:
@@ -891,6 +1115,54 @@ func file_ocean_v1_notification_proto_init() {
}
}
file_ocean_v1_notification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveWebhookRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_ocean_v1_notification_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveWebhookResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_ocean_v1_notification_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListWebhooksRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_ocean_v1_notification_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListWebhooksResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_ocean_v1_notification_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WebhookInfo); i {
case 0:
return &v.state
@@ -909,7 +1181,7 @@ func file_ocean_v1_notification_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_ocean_v1_notification_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumMessages: 15,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -18,6 +18,14 @@ const _ = grpc.SupportPackageIsVersion7
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type NotificationServiceClient interface {
// WatchExternalScript allows to get notified about utxos/txs related to the given
// external script, ie. not derived from a wallet account.
// The service answers with the label assigned to the given script.
// The label is used as identifier of the utxos/txs received from the streams.
WatchExternalScript(ctx context.Context, in *WatchExternalScriptRequest, opts ...grpc.CallOption) (*WatchExternalScriptResponse, error)
// UnwatchExternalScript allows to stop watching for the script identified with
// the given label.
UnwatchExternalScript(ctx context.Context, in *UnwatchExternalScriptRequest, opts ...grpc.CallOption) (*UnwatchExternalScriptResponse, error)
// Notifies about events related to wallet transactions.
TransactionNotifications(ctx context.Context, in *TransactionNotificationsRequest, opts ...grpc.CallOption) (NotificationService_TransactionNotificationsClient, error)
// Notifies about events realted to wallet utxos.
@@ -38,6 +46,24 @@ func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServi
return &notificationServiceClient{cc}
}
func (c *notificationServiceClient) WatchExternalScript(ctx context.Context, in *WatchExternalScriptRequest, opts ...grpc.CallOption) (*WatchExternalScriptResponse, error) {
out := new(WatchExternalScriptResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/WatchExternalScript", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *notificationServiceClient) UnwatchExternalScript(ctx context.Context, in *UnwatchExternalScriptRequest, opts ...grpc.CallOption) (*UnwatchExternalScriptResponse, error) {
out := new(UnwatchExternalScriptResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/UnwatchExternalScript", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *notificationServiceClient) TransactionNotifications(ctx context.Context, in *TransactionNotificationsRequest, opts ...grpc.CallOption) (NotificationService_TransactionNotificationsClient, error) {
stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], "/ocean.v1.NotificationService/TransactionNotifications", opts...)
if err != nil {
@@ -133,6 +159,14 @@ func (c *notificationServiceClient) ListWebhooks(ctx context.Context, in *ListWe
// All implementations should embed UnimplementedNotificationServiceServer
// for forward compatibility
type NotificationServiceServer interface {
// WatchExternalScript allows to get notified about utxos/txs related to the given
// external script, ie. not derived from a wallet account.
// The service answers with the label assigned to the given script.
// The label is used as identifier of the utxos/txs received from the streams.
WatchExternalScript(context.Context, *WatchExternalScriptRequest) (*WatchExternalScriptResponse, error)
// UnwatchExternalScript allows to stop watching for the script identified with
// the given label.
UnwatchExternalScript(context.Context, *UnwatchExternalScriptRequest) (*UnwatchExternalScriptResponse, error)
// Notifies about events related to wallet transactions.
TransactionNotifications(*TransactionNotificationsRequest, NotificationService_TransactionNotificationsServer) error
// Notifies about events realted to wallet utxos.
@@ -149,6 +183,12 @@ type NotificationServiceServer interface {
type UnimplementedNotificationServiceServer struct {
}
func (UnimplementedNotificationServiceServer) WatchExternalScript(context.Context, *WatchExternalScriptRequest) (*WatchExternalScriptResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method WatchExternalScript not implemented")
}
func (UnimplementedNotificationServiceServer) UnwatchExternalScript(context.Context, *UnwatchExternalScriptRequest) (*UnwatchExternalScriptResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnwatchExternalScript not implemented")
}
func (UnimplementedNotificationServiceServer) TransactionNotifications(*TransactionNotificationsRequest, NotificationService_TransactionNotificationsServer) error {
return status.Errorf(codes.Unimplemented, "method TransactionNotifications not implemented")
}
@@ -176,6 +216,42 @@ func RegisterNotificationServiceServer(s grpc.ServiceRegistrar, srv Notification
s.RegisterService(&NotificationService_ServiceDesc, srv)
}
func _NotificationService_WatchExternalScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(WatchExternalScriptRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NotificationServiceServer).WatchExternalScript(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.NotificationService/WatchExternalScript",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NotificationServiceServer).WatchExternalScript(ctx, req.(*WatchExternalScriptRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NotificationService_UnwatchExternalScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnwatchExternalScriptRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NotificationServiceServer).UnwatchExternalScript(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.NotificationService/UnwatchExternalScript",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NotificationServiceServer).UnwatchExternalScript(ctx, req.(*UnwatchExternalScriptRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NotificationService_TransactionNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(TransactionNotificationsRequest)
if err := stream.RecvMsg(m); err != nil {
@@ -279,6 +355,14 @@ var NotificationService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ocean.v1.NotificationService",
HandlerType: (*NotificationServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "WatchExternalScript",
Handler: _NotificationService_WatchExternalScript_Handler,
},
{
MethodName: "UnwatchExternalScript",
Handler: _NotificationService_UnwatchExternalScript_Handler,
},
{
MethodName: "AddWebhook",
Handler: _NotificationService_AddWebhook_Handler,

View File

@@ -1786,6 +1786,110 @@ func (x *ClaimPegInResponse) GetTxHex() string {
return ""
}
type SignPsetWithSchnorrKeyRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The partial transaction to sign in base64 format.
Tx string `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"`
// The sighash type. SIGHASH_DEFAULT is used for any input that does not specify one.
SighashType uint32 `protobuf:"varint,2,opt,name=sighash_type,json=sighashType,proto3" json:"sighash_type,omitempty"`
}
func (x *SignPsetWithSchnorrKeyRequest) Reset() {
*x = SignPsetWithSchnorrKeyRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_transaction_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignPsetWithSchnorrKeyRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignPsetWithSchnorrKeyRequest) ProtoMessage() {}
func (x *SignPsetWithSchnorrKeyRequest) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_transaction_proto_msgTypes[30]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignPsetWithSchnorrKeyRequest.ProtoReflect.Descriptor instead.
func (*SignPsetWithSchnorrKeyRequest) Descriptor() ([]byte, []int) {
return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{30}
}
func (x *SignPsetWithSchnorrKeyRequest) GetTx() string {
if x != nil {
return x.Tx
}
return ""
}
func (x *SignPsetWithSchnorrKeyRequest) GetSighashType() uint32 {
if x != nil {
return x.SighashType
}
return 0
}
type SignPsetWithSchnorrKeyResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SignedTx string `protobuf:"bytes,1,opt,name=signed_tx,json=signedTx,proto3" json:"signed_tx,omitempty"`
}
func (x *SignPsetWithSchnorrKeyResponse) Reset() {
*x = SignPsetWithSchnorrKeyResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_ocean_v1_transaction_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignPsetWithSchnorrKeyResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignPsetWithSchnorrKeyResponse) ProtoMessage() {}
func (x *SignPsetWithSchnorrKeyResponse) ProtoReflect() protoreflect.Message {
mi := &file_ocean_v1_transaction_proto_msgTypes[31]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignPsetWithSchnorrKeyResponse.ProtoReflect.Descriptor instead.
func (*SignPsetWithSchnorrKeyResponse) Descriptor() ([]byte, []int) {
return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{31}
}
func (x *SignPsetWithSchnorrKeyResponse) GetSignedTx() string {
if x != nil {
return x.SignedTx
}
return ""
}
var File_ocean_v1_transaction_proto protoreflect.FileDescriptor
var file_ocean_v1_transaction_proto_rawDesc = []byte{
@@ -1970,77 +2074,93 @@ var file_ocean_v1_transaction_proto_rawDesc = []byte{
0x61, 0x69, 0x6d, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x2b, 0x0a, 0x12, 0x43, 0x6c, 0x61,
0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x32, 0xe4, 0x08, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a,
0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72,
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f,
0x73, 0x12, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c,
0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63,
0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d,
0x0a, 0x0c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x12, 0x1d,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61,
0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74,
0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a,
0x0f, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69,
0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x14, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61,
0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61,
0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65,
0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x52, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73,
0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x4b, 0x65, 0x79,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x68, 0x61,
0x73, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73,
0x69, 0x67, 0x68, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x3d, 0x0a, 0x1e, 0x53, 0x69,
0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72,
0x72, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09,
0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x78, 0x32, 0xd1, 0x09, 0x0a, 0x12, 0x54, 0x72,
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x53, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47,
0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55,
0x74, 0x78, 0x6f, 0x73, 0x12, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65,
0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74,
0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69,
0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x56, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53,
0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x14, 0x42, 0x72, 0x6f, 0x61,
0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x25, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61,
0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e,
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x47, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x2e,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50,
0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65,
0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50,
0x73, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44,
0x0a, 0x09, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x63,
0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74,
0x12, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6f, 0x63,
0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x4d, 0x69, 0x6e, 0x74, 0x12,
0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b,
0x0a, 0x06, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e,
0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x18, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d,
0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x42,
0x75, 0x72, 0x6e, 0x12, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42,
0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6f, 0x63, 0x65,
0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x19,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64,
0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67,
0x49, 0x6e, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c,
0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d,
0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa4, 0x01,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x44, 0x0a, 0x09, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1a,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50,
0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x63, 0x65,
0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x50,
0x73, 0x65, 0x74, 0x12, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53,
0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a,
0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73,
0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x4d, 0x69,
0x6e, 0x74, 0x12, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69,
0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x3b, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x6f, 0x63,
0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35,
0x0a, 0x04, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65,
0x72, 0x12, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61,
0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x50, 0x65, 0x67, 0x49,
0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e,
0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d,
0x50, 0x65, 0x67, 0x49, 0x6e, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c,
0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x6b, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68,
0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x2e, 0x6f, 0x63, 0x65,
0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x57, 0x69,
0x74, 0x68, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53,
0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x68, 0x6e, 0x6f,
0x72, 0x72, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa4, 0x01,
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x10,
0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61,
@@ -2067,7 +2187,7 @@ func file_ocean_v1_transaction_proto_rawDescGZIP() []byte {
}
var file_ocean_v1_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_ocean_v1_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
var file_ocean_v1_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 32)
var file_ocean_v1_transaction_proto_goTypes = []interface{}{
(SelectUtxosRequest_Strategy)(0), // 0: ocean.v1.SelectUtxosRequest.Strategy
(*GetTransactionRequest)(nil), // 1: ocean.v1.GetTransactionRequest
@@ -2100,25 +2220,27 @@ var file_ocean_v1_transaction_proto_goTypes = []interface{}{
(*PegInAddressResponse)(nil), // 28: ocean.v1.PegInAddressResponse
(*ClaimPegInRequest)(nil), // 29: ocean.v1.ClaimPegInRequest
(*ClaimPegInResponse)(nil), // 30: ocean.v1.ClaimPegInResponse
(*BlockDetails)(nil), // 31: ocean.v1.BlockDetails
(*Utxo)(nil), // 32: ocean.v1.Utxo
(*Input)(nil), // 33: ocean.v1.Input
(*Output)(nil), // 34: ocean.v1.Output
(*UnblindedInput)(nil), // 35: ocean.v1.UnblindedInput
(*SignPsetWithSchnorrKeyRequest)(nil), // 31: ocean.v1.SignPsetWithSchnorrKeyRequest
(*SignPsetWithSchnorrKeyResponse)(nil), // 32: ocean.v1.SignPsetWithSchnorrKeyResponse
(*BlockDetails)(nil), // 33: ocean.v1.BlockDetails
(*Utxo)(nil), // 34: ocean.v1.Utxo
(*Input)(nil), // 35: ocean.v1.Input
(*Output)(nil), // 36: ocean.v1.Output
(*UnblindedInput)(nil), // 37: ocean.v1.UnblindedInput
}
var file_ocean_v1_transaction_proto_depIdxs = []int32{
31, // 0: ocean.v1.GetTransactionResponse.block_details:type_name -> ocean.v1.BlockDetails
33, // 0: ocean.v1.GetTransactionResponse.block_details:type_name -> ocean.v1.BlockDetails
0, // 1: ocean.v1.SelectUtxosRequest.strategy:type_name -> ocean.v1.SelectUtxosRequest.Strategy
32, // 2: ocean.v1.SelectUtxosResponse.utxos:type_name -> ocean.v1.Utxo
33, // 3: ocean.v1.EstimateFeesRequest.inputs:type_name -> ocean.v1.Input
34, // 4: ocean.v1.EstimateFeesRequest.outputs:type_name -> ocean.v1.Output
33, // 5: ocean.v1.CreatePsetRequest.inputs:type_name -> ocean.v1.Input
34, // 6: ocean.v1.CreatePsetRequest.outputs:type_name -> ocean.v1.Output
33, // 7: ocean.v1.UpdatePsetRequest.inputs:type_name -> ocean.v1.Input
34, // 8: ocean.v1.UpdatePsetRequest.outputs:type_name -> ocean.v1.Output
35, // 9: ocean.v1.BlindPsetRequest.extra_unblinded_inputs:type_name -> ocean.v1.UnblindedInput
34, // 10: ocean.v1.BurnRequest.receivers:type_name -> ocean.v1.Output
34, // 11: ocean.v1.TransferRequest.receivers:type_name -> ocean.v1.Output
34, // 2: ocean.v1.SelectUtxosResponse.utxos:type_name -> ocean.v1.Utxo
35, // 3: ocean.v1.EstimateFeesRequest.inputs:type_name -> ocean.v1.Input
36, // 4: ocean.v1.EstimateFeesRequest.outputs:type_name -> ocean.v1.Output
35, // 5: ocean.v1.CreatePsetRequest.inputs:type_name -> ocean.v1.Input
36, // 6: ocean.v1.CreatePsetRequest.outputs:type_name -> ocean.v1.Output
35, // 7: ocean.v1.UpdatePsetRequest.inputs:type_name -> ocean.v1.Input
36, // 8: ocean.v1.UpdatePsetRequest.outputs:type_name -> ocean.v1.Output
37, // 9: ocean.v1.BlindPsetRequest.extra_unblinded_inputs:type_name -> ocean.v1.UnblindedInput
36, // 10: ocean.v1.BurnRequest.receivers:type_name -> ocean.v1.Output
36, // 11: ocean.v1.TransferRequest.receivers:type_name -> ocean.v1.Output
1, // 12: ocean.v1.TransactionService.GetTransaction:input_type -> ocean.v1.GetTransactionRequest
3, // 13: ocean.v1.TransactionService.SelectUtxos:input_type -> ocean.v1.SelectUtxosRequest
5, // 14: ocean.v1.TransactionService.EstimateFees:input_type -> ocean.v1.EstimateFeesRequest
@@ -2134,23 +2256,25 @@ var file_ocean_v1_transaction_proto_depIdxs = []int32{
25, // 24: ocean.v1.TransactionService.Transfer:input_type -> ocean.v1.TransferRequest
27, // 25: ocean.v1.TransactionService.PegInAddress:input_type -> ocean.v1.PegInAddressRequest
29, // 26: ocean.v1.TransactionService.ClaimPegIn:input_type -> ocean.v1.ClaimPegInRequest
2, // 27: ocean.v1.TransactionService.GetTransaction:output_type -> ocean.v1.GetTransactionResponse
4, // 28: ocean.v1.TransactionService.SelectUtxos:output_type -> ocean.v1.SelectUtxosResponse
6, // 29: ocean.v1.TransactionService.EstimateFees:output_type -> ocean.v1.EstimateFeesResponse
8, // 30: ocean.v1.TransactionService.SignTransaction:output_type -> ocean.v1.SignTransactionResponse
10, // 31: ocean.v1.TransactionService.BroadcastTransaction:output_type -> ocean.v1.BroadcastTransactionResponse
12, // 32: ocean.v1.TransactionService.CreatePset:output_type -> ocean.v1.CreatePsetResponse
14, // 33: ocean.v1.TransactionService.UpdatePset:output_type -> ocean.v1.UpdatePsetResponse
16, // 34: ocean.v1.TransactionService.BlindPset:output_type -> ocean.v1.BlindPsetResponse
18, // 35: ocean.v1.TransactionService.SignPset:output_type -> ocean.v1.SignPsetResponse
20, // 36: ocean.v1.TransactionService.Mint:output_type -> ocean.v1.MintResponse
22, // 37: ocean.v1.TransactionService.Remint:output_type -> ocean.v1.RemintResponse
24, // 38: ocean.v1.TransactionService.Burn:output_type -> ocean.v1.BurnResponse
26, // 39: ocean.v1.TransactionService.Transfer:output_type -> ocean.v1.TransferResponse
28, // 40: ocean.v1.TransactionService.PegInAddress:output_type -> ocean.v1.PegInAddressResponse
30, // 41: ocean.v1.TransactionService.ClaimPegIn:output_type -> ocean.v1.ClaimPegInResponse
27, // [27:42] is the sub-list for method output_type
12, // [12:27] is the sub-list for method input_type
31, // 27: ocean.v1.TransactionService.SignPsetWithSchnorrKey:input_type -> ocean.v1.SignPsetWithSchnorrKeyRequest
2, // 28: ocean.v1.TransactionService.GetTransaction:output_type -> ocean.v1.GetTransactionResponse
4, // 29: ocean.v1.TransactionService.SelectUtxos:output_type -> ocean.v1.SelectUtxosResponse
6, // 30: ocean.v1.TransactionService.EstimateFees:output_type -> ocean.v1.EstimateFeesResponse
8, // 31: ocean.v1.TransactionService.SignTransaction:output_type -> ocean.v1.SignTransactionResponse
10, // 32: ocean.v1.TransactionService.BroadcastTransaction:output_type -> ocean.v1.BroadcastTransactionResponse
12, // 33: ocean.v1.TransactionService.CreatePset:output_type -> ocean.v1.CreatePsetResponse
14, // 34: ocean.v1.TransactionService.UpdatePset:output_type -> ocean.v1.UpdatePsetResponse
16, // 35: ocean.v1.TransactionService.BlindPset:output_type -> ocean.v1.BlindPsetResponse
18, // 36: ocean.v1.TransactionService.SignPset:output_type -> ocean.v1.SignPsetResponse
20, // 37: ocean.v1.TransactionService.Mint:output_type -> ocean.v1.MintResponse
22, // 38: ocean.v1.TransactionService.Remint:output_type -> ocean.v1.RemintResponse
24, // 39: ocean.v1.TransactionService.Burn:output_type -> ocean.v1.BurnResponse
26, // 40: ocean.v1.TransactionService.Transfer:output_type -> ocean.v1.TransferResponse
28, // 41: ocean.v1.TransactionService.PegInAddress:output_type -> ocean.v1.PegInAddressResponse
30, // 42: ocean.v1.TransactionService.ClaimPegIn:output_type -> ocean.v1.ClaimPegInResponse
32, // 43: ocean.v1.TransactionService.SignPsetWithSchnorrKey:output_type -> ocean.v1.SignPsetWithSchnorrKeyResponse
28, // [28:44] is the sub-list for method output_type
12, // [12:28] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
@@ -2523,6 +2647,30 @@ func file_ocean_v1_transaction_proto_init() {
return nil
}
}
file_ocean_v1_transaction_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignPsetWithSchnorrKeyRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_ocean_v1_transaction_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignPsetWithSchnorrKeyResponse); 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{
@@ -2530,7 +2678,7 @@ func file_ocean_v1_transaction_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_ocean_v1_transaction_proto_rawDesc,
NumEnums: 1,
NumMessages: 30,
NumMessages: 32,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -56,6 +56,9 @@ type TransactionServiceClient interface {
// ClaimPegIn returns a transaction to claim funds pegged on the Bitcoin
// main-chain to have them available on the Liquid side-chain.
ClaimPegIn(ctx context.Context, in *ClaimPegInRequest, opts ...grpc.CallOption) (*ClaimPegInResponse, error)
// SignPsetWithSchnorrKey signs all taproot inputs of the provided tx with
// the key at the given derivation path.
SignPsetWithSchnorrKey(ctx context.Context, in *SignPsetWithSchnorrKeyRequest, opts ...grpc.CallOption) (*SignPsetWithSchnorrKeyResponse, error)
}
type transactionServiceClient struct {
@@ -201,6 +204,15 @@ func (c *transactionServiceClient) ClaimPegIn(ctx context.Context, in *ClaimPegI
return out, nil
}
func (c *transactionServiceClient) SignPsetWithSchnorrKey(ctx context.Context, in *SignPsetWithSchnorrKeyRequest, opts ...grpc.CallOption) (*SignPsetWithSchnorrKeyResponse, error) {
out := new(SignPsetWithSchnorrKeyResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SignPsetWithSchnorrKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// TransactionServiceServer is the server API for TransactionService service.
// All implementations should embed UnimplementedTransactionServiceServer
// for forward compatibility
@@ -243,6 +255,9 @@ type TransactionServiceServer interface {
// ClaimPegIn returns a transaction to claim funds pegged on the Bitcoin
// main-chain to have them available on the Liquid side-chain.
ClaimPegIn(context.Context, *ClaimPegInRequest) (*ClaimPegInResponse, error)
// SignPsetWithSchnorrKey signs all taproot inputs of the provided tx with
// the key at the given derivation path.
SignPsetWithSchnorrKey(context.Context, *SignPsetWithSchnorrKeyRequest) (*SignPsetWithSchnorrKeyResponse, error)
}
// UnimplementedTransactionServiceServer should be embedded to have forward compatible implementations.
@@ -294,6 +309,9 @@ func (UnimplementedTransactionServiceServer) PegInAddress(context.Context, *PegI
func (UnimplementedTransactionServiceServer) ClaimPegIn(context.Context, *ClaimPegInRequest) (*ClaimPegInResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ClaimPegIn not implemented")
}
func (UnimplementedTransactionServiceServer) SignPsetWithSchnorrKey(context.Context, *SignPsetWithSchnorrKeyRequest) (*SignPsetWithSchnorrKeyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignPsetWithSchnorrKey not implemented")
}
// UnsafeTransactionServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TransactionServiceServer will
@@ -576,6 +594,24 @@ func _TransactionService_ClaimPegIn_Handler(srv interface{}, ctx context.Context
return interceptor(ctx, in, info, handler)
}
func _TransactionService_SignPsetWithSchnorrKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignPsetWithSchnorrKeyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).SignPsetWithSchnorrKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/SignPsetWithSchnorrKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).SignPsetWithSchnorrKey(ctx, req.(*SignPsetWithSchnorrKeyRequest))
}
return interceptor(ctx, in, info, handler)
}
// TransactionService_ServiceDesc is the grpc.ServiceDesc for TransactionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -643,6 +679,10 @@ var TransactionService_ServiceDesc = grpc.ServiceDesc{
MethodName: "ClaimPegIn",
Handler: _TransactionService_ClaimPegIn_Handler,
},
{
MethodName: "SignPsetWithSchnorrKey",
Handler: _TransactionService_SignPsetWithSchnorrKey_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ocean/v1/transaction.proto",

View File

@@ -84,6 +84,7 @@ const (
UtxoEventType_UTXO_EVENT_TYPE_LOCKED UtxoEventType = 3
UtxoEventType_UTXO_EVENT_TYPE_UNLOCKED UtxoEventType = 4
UtxoEventType_UTXO_EVENT_TYPE_SPENT UtxoEventType = 5
UtxoEventType_UTXO_EVENT_TYPE_CONFIRMED_SPENT UtxoEventType = 6
)
// Enum value maps for UtxoEventType.
@@ -95,6 +96,7 @@ var (
3: "UTXO_EVENT_TYPE_LOCKED",
4: "UTXO_EVENT_TYPE_UNLOCKED",
5: "UTXO_EVENT_TYPE_SPENT",
6: "UTXO_EVENT_TYPE_CONFIRMED_SPENT",
}
UtxoEventType_value = map[string]int32{
"UTXO_EVENT_TYPE_UNSPECIFIED": 0,
@@ -103,6 +105,7 @@ var (
"UTXO_EVENT_TYPE_LOCKED": 3,
"UTXO_EVENT_TYPE_UNLOCKED": 4,
"UTXO_EVENT_TYPE_SPENT": 5,
"UTXO_EVENT_TYPE_CONFIRMED_SPENT": 6,
}
)
@@ -1219,7 +1222,7 @@ var file_ocean_v1_types_proto_rawDesc = []byte{
0x01, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x02,
0x12, 0x1b, 0x0a, 0x17, 0x54, 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x03, 0x2a, 0xbd, 0x01,
0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x03, 0x2a, 0xe2, 0x01,
0x0a, 0x0d, 0x55, 0x74, 0x78, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12,
0x1f, 0x0a, 0x1b, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
@@ -1231,25 +1234,28 @@ var file_ocean_v1_types_proto_rawDesc = []byte{
0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45,
0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44,
0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54,
0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x50, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x2a, 0x77, 0x0a,
0x10, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70,
0x65, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45,
0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b,
0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e,
0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x57, 0x45, 0x42,
0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x55, 0x54, 0x58, 0x4f, 0x10, 0x02, 0x42, 0x9e, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f,
0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x61, 0x72,
0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31,
0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02,
0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61,
0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x5c,
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x63,
0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x50, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x12, 0x23, 0x0a,
0x1f, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x53, 0x50, 0x45, 0x4e, 0x54,
0x10, 0x06, 0x2a, 0x77, 0x0a, 0x10, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65,
0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f,
0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45,
0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b,
0x0a, 0x17, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x54, 0x58, 0x4f, 0x10, 0x02, 0x42, 0x9e, 0x01, 0x0a, 0x0c,
0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79,
0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f,
0x72, 0x6b, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x65,
0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03,
0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4f, 0x63, 0x65, 0x61,
0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -37,6 +37,7 @@ func main() {
Network: cfg.Network,
SchedulerType: cfg.SchedulerType,
TxBuilderType: cfg.TxBuilderType,
BlockchainScannerType: cfg.BlockchainScannerType,
WalletAddr: cfg.WalletAddr,
MinRelayFee: cfg.MinRelayFee,
}

View File

@@ -68,7 +68,7 @@ require (
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.17.0
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect

View File

@@ -26,6 +26,9 @@ var (
"dummy": {},
"covenant": {},
}
supportedScanners = supportedType{
"ocean": {},
}
)
type Config struct {
@@ -35,6 +38,7 @@ type Config struct {
Network common.Network
SchedulerType string
TxBuilderType string
BlockchainScannerType string
WalletAddr string
MinRelayFee uint64
@@ -42,6 +46,7 @@ type Config struct {
svc application.Service
wallet ports.WalletService
txBuilder ports.TxBuilder
scanner ports.BlockchainScanner
}
func (c *Config) Validate() error {
@@ -54,6 +59,9 @@ func (c *Config) Validate() error {
if !supportedTxBuilders.supports(c.TxBuilderType) {
return fmt.Errorf("tx builder type not supported, please select one of: %s", supportedTxBuilders)
}
if !supportedScanners.supports(c.BlockchainScannerType) {
return fmt.Errorf("blockchain scanner type not supported, please select one of: %s", supportedScanners)
}
if c.RoundInterval < 5 {
return fmt.Errorf("invalid round interval, must be at least 5 seconds")
}
@@ -75,6 +83,9 @@ func (c *Config) Validate() error {
if err := c.txBuilderService(); err != nil {
return err
}
if err := c.scannerService(); err != nil {
return err
}
if err := c.appService(); err != nil {
return err
}
@@ -142,10 +153,27 @@ func (c *Config) txBuilderService() error {
return nil
}
func (c *Config) scannerService() error {
var svc ports.BlockchainScanner
var err error
switch c.BlockchainScannerType {
case "ocean":
svc = c.wallet
default:
err = fmt.Errorf("unknown blockchain scanner type")
}
if err != nil {
return err
}
c.scanner = svc
return nil
}
func (c *Config) appService() error {
net := c.mainChain()
svc, err := application.NewService(
c.RoundInterval, c.Network, net, c.wallet, c.repo, c.txBuilder, c.MinRelayFee,
c.RoundInterval, c.Network, net, c.wallet, c.repo, c.txBuilder, c.scanner, c.MinRelayFee,
)
if err != nil {
return err

View File

@@ -18,6 +18,7 @@ type Config struct {
DbDir string
SchedulerType string
TxBuilderType string
BlockchainScannerType string
NoTLS bool
Network common.Network
LogLevel int
@@ -32,6 +33,7 @@ var (
DbType = "DB_TYPE"
SchedulerType = "SCHEDULER_TYPE"
TxBuilderType = "TX_BUILDER_TYPE"
BlockchainScannerType = "BC_SCANNER_TYPE"
Insecure = "INSECURE"
LogLevel = "LOG_LEVEL"
Network = "NETWORK"
@@ -43,6 +45,7 @@ var (
defaultDbType = "badger"
defaultSchedulerType = "gocron"
defaultTxBuilderType = "covenant"
defaultBlockchainScannerType = "ocean"
defaultInsecure = true
defaultNetwork = "testnet"
defaultLogLevel = 5
@@ -59,6 +62,7 @@ func LoadConfig() (*Config, error) {
viper.SetDefault(DbType, defaultDbType)
viper.SetDefault(SchedulerType, defaultSchedulerType)
viper.SetDefault(TxBuilderType, defaultTxBuilderType)
viper.SetDefault(BlockchainScannerType, defaultBlockchainScannerType)
viper.SetDefault(Insecure, defaultInsecure)
viper.SetDefault(LogLevel, defaultLogLevel)
viper.SetDefault(Network, defaultNetwork)
@@ -80,6 +84,7 @@ func LoadConfig() (*Config, error) {
DbType: viper.GetString(DbType),
SchedulerType: viper.GetString(SchedulerType),
TxBuilderType: viper.GetString(TxBuilderType),
BlockchainScannerType: viper.GetString(BlockchainScannerType),
NoTLS: viper.GetBool(Insecure),
DbDir: filepath.Join(viper.GetString(Datadir), "db"),
LogLevel: viper.GetInt(LogLevel),

View File

@@ -50,15 +50,17 @@ type service struct {
wallet ports.WalletService
repoManager ports.RepoManager
builder ports.TxBuilder
scanner ports.BlockchainScanner
paymentRequests *paymentsMap
forfeitTxs *forfeitTxsMap
eventsCh chan domain.RoundEvent
}
func NewService(
interval int64, network common.Network, onchainNetwork network.Network,
walletSvc ports.WalletService, repoManager ports.RepoManager, builder ports.TxBuilder,
walletSvc ports.WalletService, repoManager ports.RepoManager,
builder ports.TxBuilder, scanner ports.BlockchainScanner,
minRelayFee uint64,
) (Service, error) {
eventsCh := make(chan domain.RoundEvent)
@@ -72,7 +74,7 @@ func NewService(
}
svc := &service{
minRelayFee, interval, network, onchainNetwork, pubkey,
walletSvc, repoManager, builder, paymentRequests, forfeitTxs,
walletSvc, repoManager, builder, scanner, paymentRequests, forfeitTxs,
eventsCh,
}
repoManager.RegisterEventsHandler(
@@ -81,15 +83,29 @@ func NewService(
svc.propagateEvents(round)
},
)
if err := svc.restoreWatchingVtxos(); err != nil {
return nil, fmt.Errorf("failed to restore watching vtxos: %s", err)
}
go svc.listenToRedemptions()
return svc, nil
}
func (s *service) Start() error {
log.Debug("starting app service")
return s.start()
go s.start()
return nil
}
func (s *service) Stop() {
// nolint
vtxos, _ := s.repoManager.Vtxos().GetSpendableVtxos(
context.Background(), "",
)
if len(vtxos) > 0 {
s.stopWatchingVtxos(vtxos)
}
s.wallet.Close()
log.Debug("closed connection to wallet")
s.repoManager.Close()
@@ -177,7 +193,7 @@ func (s *service) SignVtxos(ctx context.Context, forfeitTxs []string) error {
func (s *service) ListVtxos(ctx context.Context, pubkey *secp256k1.PublicKey) ([]domain.Vtxo, error) {
pk := hex.EncodeToString(pubkey.SerializeCompressed())
return s.repoManager.Vtxos().GetSpendableVtxosWithPubkey(ctx, pk)
return s.repoManager.Vtxos().GetSpendableVtxos(ctx, pk)
}
func (s *service) GetEventsChannel(ctx context.Context) <-chan domain.RoundEvent {
@@ -196,9 +212,8 @@ func (s *service) GetPubkey(ctx context.Context) (string, error) {
return pubkey, nil
}
func (s *service) start() error {
func (s *service) start() {
s.startRound()
return nil
}
func (s *service) startRound() {
@@ -345,6 +360,28 @@ func (s *service) finalizeRound() {
log.Debugf("finalized round %s with pool tx %s", round.Id, round.Txid)
}
func (s *service) listenToRedemptions() {
ctx := context.Background()
chVtxos := s.scanner.GetNotificationChannel(ctx)
for vtxoKeys := range chVtxos {
if len(vtxoKeys) > 0 {
for {
// TODO: make sure that the vtxos haven't been already spent, otherwise
// broadcast the corresponding forfeit tx and connector to prevent
// getting cheated.
vtxos, err := s.repoManager.Vtxos().RedeemVtxos(ctx, vtxoKeys)
if err != nil {
log.WithError(err).Warn("failed to redeem vtxos, retrying...")
time.Sleep(100 * time.Millisecond)
continue
}
log.Debugf("redeemed %d vtxos", len(vtxos))
break
}
}
}
}
func (s *service) updateProjectionStore(round *domain.Round) {
ctx := context.Background()
lastChange := round.Events()[len(round.Events())-1]
@@ -374,6 +411,19 @@ func (s *service) updateProjectionStore(round *domain.Round) {
log.Debugf("added %d new vtxos", len(newVtxos))
break
}
go func() {
for {
if err := s.startWatchingVtxos(newVtxos); err != nil {
log.WithError(err).Warn(
"failed to start watching vtxos, retrying in a moment...",
)
continue
}
log.Debugf("started watching %d vtxos", len(newVtxos))
return
}
}()
}
// Always update the status of the round.
@@ -419,7 +469,7 @@ func (s *service) getNewVtxos(round *domain.Round) []domain.Vtxo {
buf, _ := hex.DecodeString(r.Pubkey)
pk, _ := secp256k1.ParsePubKey(buf)
script, _ := s.builder.GetVtxoOutputScript(pk, s.pubkey)
script, _ := s.builder.GetVtxoScript(pk, s.pubkey)
if bytes.Equal(script, out.Script) {
found = true
pubkey = r.Pubkey
@@ -440,6 +490,77 @@ func (s *service) getNewVtxos(round *domain.Round) []domain.Vtxo {
return vtxos
}
func (s *service) startWatchingVtxos(vtxos []domain.Vtxo) error {
scripts, err := s.extractVtxosScripts(vtxos)
if err != nil {
return err
}
return s.scanner.WatchScripts(context.Background(), scripts)
}
func (s *service) stopWatchingVtxos(vtxos []domain.Vtxo) {
scripts, err := s.extractVtxosScripts(vtxos)
if err != nil {
log.WithError(err).Warn("failed to extract scripts from vtxos")
return
}
for {
if err := s.scanner.UnwatchScripts(context.Background(), scripts); err != nil {
log.WithError(err).Warn("failed to stop watching vtxos, retrying in a moment...")
time.Sleep(100 * time.Millisecond)
continue
}
log.Debugf("stopped watching %d vtxos", len(vtxos))
break
}
}
func (s *service) restoreWatchingVtxos() error {
vtxos, err := s.repoManager.Vtxos().GetSpendableVtxos(
context.Background(), "",
)
if err != nil {
return err
}
if len(vtxos) <= 0 {
return nil
}
if err := s.startWatchingVtxos(vtxos); err != nil {
return err
}
log.Debugf("restored watching %d vtxos", len(vtxos))
return nil
}
func (s *service) extractVtxosScripts(vtxos []domain.Vtxo) ([]string, error) {
indexedScripts := make(map[string]struct{})
for _, vtxo := range vtxos {
buf, err := hex.DecodeString(vtxo.Pubkey)
if err != nil {
return nil, err
}
userPubkey, err := secp256k1.ParsePubKey(buf)
if err != nil {
return nil, err
}
script, err := s.builder.GetVtxoScript(userPubkey, s.pubkey)
if err != nil {
return nil, err
}
indexedScripts[hex.EncodeToString(script)] = struct{}{}
}
scripts := make([]string, 0, len(indexedScripts))
for script := range indexedScripts {
scripts = append(scripts, script)
}
return scripts, nil
}
func getSpentVtxos(payments map[string]domain.Payment) []domain.VtxoKey {
vtxos := make([]domain.VtxoKey, 0)
for _, p := range payments {

View File

@@ -122,6 +122,7 @@ func (r Receiver) IsOnchain() bool {
type Vtxo struct {
VtxoKey
Receiver
Spent bool
PoolTx string
Spent bool
Redeemed bool
}

View File

@@ -17,6 +17,7 @@ type RoundRepository interface {
type VtxoRepository interface {
AddVtxos(ctx context.Context, vtxos []Vtxo) error
SpendVtxos(ctx context.Context, vtxos []VtxoKey) error
RedeemVtxos(ctx context.Context, vtxos []VtxoKey) ([]Vtxo, error)
GetVtxos(ctx context.Context, vtxos []VtxoKey) ([]Vtxo, error)
GetSpendableVtxosWithPubkey(ctx context.Context, pubkey string) ([]Vtxo, error)
GetSpendableVtxos(ctx context.Context, pubkey string) ([]Vtxo, error)
}

View File

@@ -0,0 +1,12 @@
package ports
import (
"github.com/ark-network/ark/internal/core/domain"
"golang.org/x/net/context"
)
type BlockchainScanner interface {
WatchScripts(ctx context.Context, scripts []string) error
UnwatchScripts(ctx context.Context, scripts []string) error
GetNotificationChannel(ctx context.Context) chan []domain.VtxoKey
}

View File

@@ -13,5 +13,5 @@ type TxBuilder interface {
BuildForfeitTxs(
aspPubkey *secp256k1.PublicKey, poolTx string, payments []domain.Payment,
) (connectors []string, forfeitTxs []string, err error)
GetVtxoOutputScript(userPubkey, aspPubkey *secp256k1.PublicKey) ([]byte, error)
GetVtxoScript(userPubkey, aspPubkey *secp256k1.PublicKey) ([]byte, error)
}

View File

@@ -7,6 +7,7 @@ import (
)
type WalletService interface {
BlockchainScanner
Status(ctx context.Context) (WalletStatus, error)
GetPubkey(ctx context.Context) (*secp256k1.PublicKey, error)
DeriveAddresses(ctx context.Context, num int) ([]string, error)

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"path/filepath"
"strings"
"github.com/ark-network/ark/internal/core/domain"
dbtypes "github.com/ark-network/ark/internal/infrastructure/db/types"
@@ -62,6 +63,22 @@ func (r *vtxoRepository) SpendVtxos(
return nil
}
func (r *vtxoRepository) RedeemVtxos(
ctx context.Context, vtxoKeys []domain.VtxoKey,
) ([]domain.Vtxo, error) {
vtxos := make([]domain.Vtxo, 0, len(vtxoKeys))
for _, vtxoKey := range vtxoKeys {
vtxo, err := r.redeemVtxo(ctx, vtxoKey)
if err != nil {
return nil, err
}
if vtxo != nil {
vtxos = append(vtxos, *vtxo)
}
}
return vtxos, nil
}
func (r *vtxoRepository) GetVtxos(
ctx context.Context, vtxoKeys []domain.VtxoKey,
) ([]domain.Vtxo, error) {
@@ -76,10 +93,13 @@ func (r *vtxoRepository) GetVtxos(
return vtxos, nil
}
func (r *vtxoRepository) GetSpendableVtxosWithPubkey(
func (r *vtxoRepository) GetSpendableVtxos(
ctx context.Context, pubkey string,
) ([]domain.Vtxo, error) {
query := badgerhold.Where("Pubkey").Eq(pubkey).And("Spent").Eq(false)
query := badgerhold.Where("Spent").Eq(false).And("Redeemed").Eq(false)
if len(pubkey) > 0 {
query = query.And("Pubkey").Eq(pubkey)
}
return r.findVtxos(ctx, query)
}
@@ -126,6 +146,9 @@ func (r *vtxoRepository) getVtxo(
func (r *vtxoRepository) spendVtxo(ctx context.Context, vtxoKey domain.VtxoKey) error {
vtxo, err := r.getVtxo(ctx, vtxoKey)
if err != nil {
if strings.Contains(err.Error(), "not found") {
return nil
}
return err
}
if vtxo.Spent {
@@ -142,6 +165,31 @@ func (r *vtxoRepository) spendVtxo(ctx context.Context, vtxoKey domain.VtxoKey)
return err
}
func (r *vtxoRepository) redeemVtxo(ctx context.Context, vtxoKey domain.VtxoKey) (*domain.Vtxo, error) {
vtxo, err := r.getVtxo(ctx, vtxoKey)
if err != nil {
if strings.Contains(err.Error(), "not found") {
return nil, nil
}
return nil, err
}
if vtxo.Redeemed {
return nil, nil
}
vtxo.Redeemed = true
if ctx.Value("tx") != nil {
tx := ctx.Value("tx").(*badger.Txn)
err = r.store.TxUpdate(tx, vtxoKey.Hash(), *vtxo)
} else {
err = r.store.Update(vtxoKey.Hash(), *vtxo)
}
if err != nil {
return nil, err
}
return vtxo, nil
}
func (r *vtxoRepository) findVtxos(ctx context.Context, query *badgerhold.Query) ([]domain.Vtxo, error) {
var vtxos []domain.Vtxo
var err error

View File

@@ -19,7 +19,8 @@ const (
emptyPtx = "cHNldP8BAgQCAAAAAQQBAAEFAQABBgEDAfsEAgAAAAA="
emptyTx = "0200000000000000000000"
txid = "00000000000000000000000000000000000000000000000000000000000000000"
pubkey = "0300000000000000000000000000000000000000000000000000000000000000001"
pubkey1 = "0300000000000000000000000000000000000000000000000000000000000000001"
pubkey2 = "0200000000000000000000000000000000000000000000000000000000000000002"
)
var congestionTree = [][]tree.Node{
@@ -295,14 +296,14 @@ func testVtxoRepository(t *testing.T, svc ports.RepoManager) {
t.Run("test_vtxo_repository", func(t *testing.T) {
ctx := context.Background()
newVtxos := []domain.Vtxo{
userVtxos := []domain.Vtxo{
{
VtxoKey: domain.VtxoKey{
Txid: txid,
VOut: 0,
},
Receiver: domain.Receiver{
Pubkey: pubkey,
Pubkey: pubkey1,
Amount: 1000,
},
},
@@ -312,13 +313,24 @@ func testVtxoRepository(t *testing.T, svc ports.RepoManager) {
VOut: 1,
},
Receiver: domain.Receiver{
Pubkey: pubkey,
Pubkey: pubkey1,
Amount: 2000,
},
},
}
vtxoKeys := make([]domain.VtxoKey, 0, len(newVtxos))
for _, v := range newVtxos {
newVtxos := append(userVtxos, domain.Vtxo{
VtxoKey: domain.VtxoKey{
Txid: txid,
VOut: 1,
},
Receiver: domain.Receiver{
Pubkey: pubkey2,
Amount: 2000,
},
})
vtxoKeys := make([]domain.VtxoKey, 0, len(userVtxos))
for _, v := range userVtxos {
vtxoKeys = append(vtxoKeys, v.VtxoKey)
}
@@ -326,7 +338,11 @@ func testVtxoRepository(t *testing.T, svc ports.RepoManager) {
require.Error(t, err)
require.Empty(t, vtxos)
spendableVtxos, err := svc.Vtxos().GetSpendableVtxosWithPubkey(ctx, pubkey)
spendableVtxos, err := svc.Vtxos().GetSpendableVtxos(ctx, pubkey1)
require.NoError(t, err)
require.Empty(t, spendableVtxos)
spendableVtxos, err = svc.Vtxos().GetSpendableVtxos(ctx, "")
require.NoError(t, err)
require.Empty(t, spendableVtxos)
@@ -335,12 +351,16 @@ func testVtxoRepository(t *testing.T, svc ports.RepoManager) {
vtxos, err = svc.Vtxos().GetVtxos(ctx, vtxoKeys)
require.NoError(t, err)
require.Exactly(t, vtxos, newVtxos)
require.Exactly(t, userVtxos, vtxos)
spendableVtxos, err = svc.Vtxos().GetSpendableVtxosWithPubkey(ctx, pubkey)
spendableVtxos, err = svc.Vtxos().GetSpendableVtxos(ctx, pubkey1)
require.NoError(t, err)
require.Exactly(t, vtxos, spendableVtxos)
spendableVtxos, err = svc.Vtxos().GetSpendableVtxos(ctx, "")
require.NoError(t, err)
require.Exactly(t, userVtxos, spendableVtxos)
err = svc.Vtxos().SpendVtxos(ctx, vtxoKeys[:1])
require.NoError(t, err)
@@ -351,7 +371,7 @@ func testVtxoRepository(t *testing.T, svc ports.RepoManager) {
require.True(t, v.Spent)
}
spendableVtxos, err = svc.Vtxos().GetSpendableVtxosWithPubkey(ctx, pubkey)
spendableVtxos, err = svc.Vtxos().GetSpendableVtxos(ctx, pubkey1)
require.NoError(t, err)
require.Exactly(t, vtxos[1:], spendableVtxos)
})

View File

@@ -0,0 +1,47 @@
package oceanwallet
import (
"context"
"crypto/sha256"
"encoding/hex"
pb "github.com/ark-network/ark/api-spec/protobuf/gen/ocean/v1"
"github.com/ark-network/ark/internal/core/domain"
"github.com/btcsuite/btcd/chaincfg/chainhash"
)
func (s *service) WatchScripts(ctx context.Context, scripts []string) error {
for _, script := range scripts {
if _, err := s.notifyClient.WatchExternalScript(ctx, &pb.WatchExternalScriptRequest{
Script: script,
}); err != nil {
return err
}
}
return nil
}
func (s *service) UnwatchScripts(ctx context.Context, scripts []string) error {
for _, script := range scripts {
scriptHash := calcScriptHash(script)
if _, err := s.notifyClient.UnwatchExternalScript(ctx, &pb.UnwatchExternalScriptRequest{
Label: scriptHash,
}); err != nil {
return err
}
}
return nil
}
func (s *service) GetNotificationChannel(ctx context.Context) chan []domain.VtxoKey {
return s.chVtxos
}
func calcScriptHash(script string) string {
buf, _ := hex.DecodeString(script)
hashedBuf := sha256.Sum256(buf)
hash, _ := chainhash.NewHash(hashedBuf[:])
return hash.String()
}

View File

@@ -3,11 +3,17 @@ package oceanwallet
import (
"context"
"fmt"
"io"
"strings"
pb "github.com/ark-network/ark/api-spec/protobuf/gen/ocean/v1"
"github.com/ark-network/ark/internal/core/domain"
"github.com/ark-network/ark/internal/core/ports"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/status"
)
type service struct {
@@ -16,6 +22,8 @@ type service struct {
walletClient pb.WalletServiceClient
accountClient pb.AccountServiceClient
txClient pb.TransactionServiceClient
notifyClient pb.NotificationServiceClient
chVtxos chan []domain.VtxoKey
}
func NewService(addr string) (ports.WalletService, error) {
@@ -26,12 +34,16 @@ func NewService(addr string) (ports.WalletService, error) {
walletClient := pb.NewWalletServiceClient(conn)
accountClient := pb.NewAccountServiceClient(conn)
txClient := pb.NewTransactionServiceClient(conn)
notifyClient := pb.NewNotificationServiceClient(conn)
chVtxos := make(chan []domain.VtxoKey)
svc := &service{
addr: addr,
conn: conn,
walletClient: walletClient,
accountClient: accountClient,
txClient: txClient,
notifyClient: notifyClient,
chVtxos: chVtxos,
}
ctx := context.Background()
@@ -64,9 +76,63 @@ func NewService(addr string) (ports.WalletService, error) {
}
}
go svc.listenToNotificaitons()
return svc, nil
}
func (s *service) Close() {
close(s.chVtxos)
s.conn.Close()
}
func (s *service) listenToNotificaitons() {
var stream pb.NotificationService_UtxosNotificationsClient
var err error
for {
stream, err = s.notifyClient.UtxosNotifications(context.Background(), &pb.UtxosNotificationsRequest{})
if err != nil {
continue
}
break
}
for {
msg, err := stream.Recv()
if err != nil {
if err == io.EOF || status.Convert(err).Code() == codes.Canceled {
return
}
log.WithError(err).Warn("received unexpected error from source")
return
}
if msg.GetEventType() != pb.UtxoEventType_UTXO_EVENT_TYPE_NEW {
continue
}
vtxos := toVtxos(msg.GetUtxos())
if len(vtxos) > 0 {
go func() {
s.chVtxos <- vtxos
}()
}
}
}
func toVtxos(utxos []*pb.Utxo) []domain.VtxoKey {
vtxos := make([]domain.VtxoKey, 0, len(utxos))
for _, utxo := range utxos {
// We want to notify for activity related to vtxos owner, therefore we skip
// returning anything related to the internal accounts of the wallet, like
// for example bip84-account0.
if strings.HasPrefix(utxo.GetAccountName(), "bip") {
continue
}
vtxos = append(vtxos, domain.VtxoKey{
Txid: utxo.GetTxid(),
VOut: utxo.GetIndex(),
})
}
return vtxos
}

View File

@@ -30,7 +30,7 @@ func NewTxBuilder(
return &txBuilder{wallet, &net}
}
func (b *txBuilder) GetVtxoOutputScript(userPubkey, aspPubkey *secp256k1.PublicKey) ([]byte, error) {
func (b *txBuilder) GetVtxoScript(userPubkey, aspPubkey *secp256k1.PublicKey) ([]byte, error) {
outputScript, _, err := b.getLeafScriptAndTree(userPubkey, aspPubkey)
if err != nil {
return nil, err
@@ -158,7 +158,7 @@ func (b *txBuilder) createPoolTx(
},
{
Asset: b.net.AssetID,
Amount: connectorAmount,
Amount: connectorsAmount,
Script: aspScript,
},
}

View File

@@ -3,6 +3,7 @@ package txbuilder_test
import (
"context"
"github.com/ark-network/ark/internal/core/domain"
"github.com/ark-network/ark/internal/core/ports"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/stretchr/testify/mock"
@@ -96,6 +97,30 @@ func (m *mockedWallet) EstimateFees(ctx context.Context, pset string) (uint64, e
return res, args.Error(1)
}
func (m *mockedWallet) WatchScripts(
ctx context.Context, scripts []string,
) error {
args := m.Called(ctx, scripts)
return args.Error(0)
}
func (m *mockedWallet) UnwatchScripts(
ctx context.Context, scripts []string,
) error {
args := m.Called(ctx, scripts)
return args.Error(0)
}
func (m *mockedWallet) GetNotificationChannel(ctx context.Context) chan []domain.VtxoKey {
args := m.Called(ctx)
var res chan []domain.VtxoKey
if a := args.Get(0); a != nil {
res = a.(chan []domain.VtxoKey)
}
return res
}
type mockedInput struct {
mock.Mock
}

View File

@@ -179,7 +179,7 @@ func (b *txBuilder) BuildPoolTx(
return poolTx, congestionTree, err
}
func (b *txBuilder) GetVtxoOutputScript(userPubkey, _ *secp256k1.PublicKey) ([]byte, error) {
func (b *txBuilder) GetVtxoScript(userPubkey, _ *secp256k1.PublicKey) ([]byte, error) {
p2wpkh := payment.FromPublicKey(userPubkey, &b.net, nil)
addr, _ := p2wpkh.WitnessPubKeyHash()
return address.ToOutputScript(addr)

View File

@@ -79,6 +79,18 @@ func (*mockedWalletService) Status(ctx context.Context) (ports.WalletStatus, err
panic("unimplemented")
}
func (*mockedWalletService) WatchScripts(ctx context.Context, scripts []string) error {
panic("unimplemented")
}
func (*mockedWalletService) UnwatchScripts(ctx context.Context, scripts []string) error {
panic("unimplemented")
}
func (*mockedWalletService) GetNotificationChannel(ctx context.Context) chan []domain.VtxoKey {
panic("unimplemented")
}
func (*mockedWalletService) SelectUtxos(ctx context.Context, asset string, amount uint64) ([]ports.TxInput, uint64, error) {
// random txid
bytes := make([]byte, 32)