Rename folders (#97)

* Rename arkd folder & drop cli

* Rename ark cli folder & update docs

* Update readme

* Fix

* scripts: add build-all

* Add target to build cli for all platforms

* Update build scripts

---------

Co-authored-by: tiero <3596602+tiero@users.noreply.github.com>
This commit is contained in:
Pietralberto Mazza
2024-02-09 19:32:58 +01:00
committed by GitHub
parent 0d8c7bffb2
commit dc00d60585
119 changed files with 154 additions and 449 deletions

View File

@@ -0,0 +1,179 @@
syntax = "proto3";
package ark.v1;
import "google/api/annotations.proto";
service ArkService {
rpc RegisterPayment(RegisterPaymentRequest) returns (RegisterPaymentResponse) {
option (google.api.http) = {
post: "/v1/payment/register"
body: "*"
};
};
rpc ClaimPayment(ClaimPaymentRequest) returns (ClaimPaymentResponse) {
option (google.api.http) = {
post: "/v1/payment/claim"
body: "*"
};
};
rpc FinalizePayment(FinalizePaymentRequest) returns (FinalizePaymentResponse) {
option (google.api.http) = {
post: "/v1/payment/finalize"
body: "*"
};
};
rpc GetRound(GetRoundRequest) returns (GetRoundResponse) {
option (google.api.http) = {
get: "/v1/round/{txid}"
};
};
rpc GetEventStream(GetEventStreamRequest) returns (stream GetEventStreamResponse) {
option (google.api.http) = {
get: "/v1/events"
};
};
rpc Ping(PingRequest) returns (PingResponse) {
option (google.api.http) = {
get: "/v1/ping/{payment_id}"
};
};
rpc Faucet(FaucetRequest) returns (FaucetResponse) {
option (google.api.http) = {
post: "/v1/faucet/{address}"
};
}
rpc ListVtxos(ListVtxosRequest) returns (ListVtxosResponse) {
option (google.api.http) = {
get: "/v1/vtxos/{address}"
};
}
rpc GetPubkey(GetPubkeyRequest) returns (GetPubkeyResponse) {
option (google.api.http) = {
get: "/v1/pubkey"
};
}
}
message RegisterPaymentRequest {
repeated Input inputs = 1;
}
message RegisterPaymentResponse {
// Mocks wabisabi's credentials.
string id = 1;
}
message ClaimPaymentRequest {
// Mocks wabisabi's credentials.
string id = 1;
// List of receivers for a registered payment.
repeated Output outputs = 2;
}
message ClaimPaymentResponse {}
message FinalizePaymentRequest {
// Forfeit txs signed by the user.
repeated string signed_forfeit_txs = 1;
}
message FinalizePaymentResponse {}
message GetRoundRequest {
string txid = 1;
}
message GetRoundResponse {
Round round = 1;
}
message Round {
string id = 1;
int64 start = 2;
int64 end = 3;
string txid = 4;
Tree congestion_tree = 5;
}
message Input {
string txid = 1;
uint32 vout = 2;
}
message Output {
// Either the offchain or onchain address.
string address = 1;
// Amount to send in satoshis.
uint64 amount = 2;
}
message RoundFinalizationEvent {
string id = 1;
string pool_partial_tx = 2;
repeated string forfeit_txs = 3;
Tree congestion_tree = 4;
}
message Tree {
repeated TreeLevel levels = 1;
}
message TreeLevel {
repeated Node nodes = 1;
}
message Node {
string txid = 1;
string tx = 2;
string parent_txid = 3;
}
message RoundFinalizedEvent {
string id = 1;
string pool_txid = 2;
}
message RoundFailed {
string id = 1;
string reason = 2;
}
message GetEventStreamRequest {}
message GetEventStreamResponse {
oneof event {
RoundFinalizationEvent round_finalization = 1;
RoundFinalizedEvent round_finalized = 2;
RoundFailed round_failed = 3;
}
}
message PingRequest {
string payment_id = 1;
}
message PingResponse {}
message FaucetRequest {
string address = 1;
}
message FaucetResponse {}
message ListVtxosRequest {
string address = 1;
}
message ListVtxosResponse {
repeated Vtxo vtxos = 1;
}
message Vtxo {
Input outpoint = 1;
Output receiver = 2;
bool spent = 3;
string pool_txid = 4;
}
message GetPubkeyRequest {}
message GetPubkeyResponse {
string pubkey = 1;
}

View File

@@ -0,0 +1,7 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: b30c5775bfb3485d9da2e87b26590ac9

View File

@@ -0,0 +1,12 @@
version: v1
name: buf.build/ark-network/ark
deps:
- buf.build/googleapis/googleapis
breaking:
use:
- FILE
ignore_unstable_packages: true
lint:
use:
- DEFAULT

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,848 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: ark/v1/service.proto
/*
Package arkv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package arkv1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_ArkService_RegisterPayment_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RegisterPaymentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.RegisterPayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_RegisterPayment_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RegisterPaymentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.RegisterPayment(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_ClaimPayment_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ClaimPaymentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ClaimPayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_ClaimPayment_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ClaimPaymentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ClaimPayment(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_FinalizePayment_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq FinalizePaymentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.FinalizePayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_FinalizePayment_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq FinalizePaymentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.FinalizePayment(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_GetRound_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetRoundRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["txid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "txid")
}
protoReq.Txid, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "txid", err)
}
msg, err := client.GetRound(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_GetRound_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetRoundRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["txid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "txid")
}
protoReq.Txid, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "txid", err)
}
msg, err := server.GetRound(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_GetEventStream_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (ArkService_GetEventStreamClient, runtime.ServerMetadata, error) {
var protoReq GetEventStreamRequest
var metadata runtime.ServerMetadata
stream, err := client.GetEventStream(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
func request_ArkService_Ping_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq PingRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["payment_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payment_id")
}
protoReq.PaymentId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payment_id", err)
}
msg, err := client.Ping(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_Ping_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq PingRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["payment_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payment_id")
}
protoReq.PaymentId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payment_id", err)
}
msg, err := server.Ping(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_Faucet_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq FaucetRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
}
msg, err := client.Faucet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_Faucet_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq FaucetRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
}
msg, err := server.Faucet(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_ListVtxos_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListVtxosRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
}
msg, err := client.ListVtxos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_ListVtxos_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListVtxosRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
}
msg, err := server.ListVtxos(ctx, &protoReq)
return msg, metadata, err
}
func request_ArkService_GetPubkey_0(ctx context.Context, marshaler runtime.Marshaler, client ArkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetPubkeyRequest
var metadata runtime.ServerMetadata
msg, err := client.GetPubkey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ArkService_GetPubkey_0(ctx context.Context, marshaler runtime.Marshaler, server ArkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetPubkeyRequest
var metadata runtime.ServerMetadata
msg, err := server.GetPubkey(ctx, &protoReq)
return msg, metadata, err
}
// RegisterArkServiceHandlerServer registers the http handlers for service ArkService to "mux".
// UnaryRPC :call ArkServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterArkServiceHandlerFromEndpoint instead.
func RegisterArkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ArkServiceServer) error {
mux.Handle("POST", pattern_ArkService_RegisterPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/RegisterPayment", runtime.WithHTTPPathPattern("/v1/payment/register"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_RegisterPayment_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_RegisterPayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ArkService_ClaimPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/ClaimPayment", runtime.WithHTTPPathPattern("/v1/payment/claim"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_ClaimPayment_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_ClaimPayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ArkService_FinalizePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/FinalizePayment", runtime.WithHTTPPathPattern("/v1/payment/finalize"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_FinalizePayment_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_FinalizePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_GetRound_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/GetRound", runtime.WithHTTPPathPattern("/v1/round/{txid}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_GetRound_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_GetRound_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_GetEventStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_ArkService_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/Ping", runtime.WithHTTPPathPattern("/v1/ping/{payment_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_Ping_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ArkService_Faucet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/Faucet", runtime.WithHTTPPathPattern("/v1/faucet/{address}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_Faucet_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_Faucet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_ListVtxos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/ListVtxos", runtime.WithHTTPPathPattern("/v1/vtxos/{address}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_ListVtxos_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_ListVtxos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_GetPubkey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ark.v1.ArkService/GetPubkey", runtime.WithHTTPPathPattern("/v1/pubkey"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ArkService_GetPubkey_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_GetPubkey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterArkServiceHandlerFromEndpoint is same as RegisterArkServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterArkServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterArkServiceHandler(ctx, mux, conn)
}
// RegisterArkServiceHandler registers the http handlers for service ArkService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterArkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterArkServiceHandlerClient(ctx, mux, NewArkServiceClient(conn))
}
// RegisterArkServiceHandlerClient registers the http handlers for service ArkService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ArkServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ArkServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ArkServiceClient" to call the correct interceptors.
func RegisterArkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ArkServiceClient) error {
mux.Handle("POST", pattern_ArkService_RegisterPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/RegisterPayment", runtime.WithHTTPPathPattern("/v1/payment/register"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_RegisterPayment_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_RegisterPayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ArkService_ClaimPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/ClaimPayment", runtime.WithHTTPPathPattern("/v1/payment/claim"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_ClaimPayment_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_ClaimPayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ArkService_FinalizePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/FinalizePayment", runtime.WithHTTPPathPattern("/v1/payment/finalize"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_FinalizePayment_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_FinalizePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_GetRound_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/GetRound", runtime.WithHTTPPathPattern("/v1/round/{txid}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_GetRound_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_GetRound_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_GetEventStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/GetEventStream", runtime.WithHTTPPathPattern("/v1/events"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_GetEventStream_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_GetEventStream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/Ping", runtime.WithHTTPPathPattern("/v1/ping/{payment_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_Ping_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ArkService_Faucet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/Faucet", runtime.WithHTTPPathPattern("/v1/faucet/{address}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_Faucet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_Faucet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_ListVtxos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/ListVtxos", runtime.WithHTTPPathPattern("/v1/vtxos/{address}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_ListVtxos_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_ListVtxos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ArkService_GetPubkey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ark.v1.ArkService/GetPubkey", runtime.WithHTTPPathPattern("/v1/pubkey"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ArkService_GetPubkey_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ArkService_GetPubkey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ArkService_RegisterPayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payment", "register"}, ""))
pattern_ArkService_ClaimPayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payment", "claim"}, ""))
pattern_ArkService_FinalizePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payment", "finalize"}, ""))
pattern_ArkService_GetRound_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "round", "txid"}, ""))
pattern_ArkService_GetEventStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "events"}, ""))
pattern_ArkService_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "ping", "payment_id"}, ""))
pattern_ArkService_Faucet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "faucet", "address"}, ""))
pattern_ArkService_ListVtxos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "vtxos", "address"}, ""))
pattern_ArkService_GetPubkey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "pubkey"}, ""))
)
var (
forward_ArkService_RegisterPayment_0 = runtime.ForwardResponseMessage
forward_ArkService_ClaimPayment_0 = runtime.ForwardResponseMessage
forward_ArkService_FinalizePayment_0 = runtime.ForwardResponseMessage
forward_ArkService_GetRound_0 = runtime.ForwardResponseMessage
forward_ArkService_GetEventStream_0 = runtime.ForwardResponseStream
forward_ArkService_Ping_0 = runtime.ForwardResponseMessage
forward_ArkService_Faucet_0 = runtime.ForwardResponseMessage
forward_ArkService_ListVtxos_0 = runtime.ForwardResponseMessage
forward_ArkService_GetPubkey_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,415 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package arkv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// ArkServiceClient is the client API for ArkService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ArkServiceClient interface {
RegisterPayment(ctx context.Context, in *RegisterPaymentRequest, opts ...grpc.CallOption) (*RegisterPaymentResponse, error)
ClaimPayment(ctx context.Context, in *ClaimPaymentRequest, opts ...grpc.CallOption) (*ClaimPaymentResponse, error)
FinalizePayment(ctx context.Context, in *FinalizePaymentRequest, opts ...grpc.CallOption) (*FinalizePaymentResponse, error)
GetRound(ctx context.Context, in *GetRoundRequest, opts ...grpc.CallOption) (*GetRoundResponse, error)
GetEventStream(ctx context.Context, in *GetEventStreamRequest, opts ...grpc.CallOption) (ArkService_GetEventStreamClient, error)
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
Faucet(ctx context.Context, in *FaucetRequest, opts ...grpc.CallOption) (*FaucetResponse, error)
ListVtxos(ctx context.Context, in *ListVtxosRequest, opts ...grpc.CallOption) (*ListVtxosResponse, error)
GetPubkey(ctx context.Context, in *GetPubkeyRequest, opts ...grpc.CallOption) (*GetPubkeyResponse, error)
}
type arkServiceClient struct {
cc grpc.ClientConnInterface
}
func NewArkServiceClient(cc grpc.ClientConnInterface) ArkServiceClient {
return &arkServiceClient{cc}
}
func (c *arkServiceClient) RegisterPayment(ctx context.Context, in *RegisterPaymentRequest, opts ...grpc.CallOption) (*RegisterPaymentResponse, error) {
out := new(RegisterPaymentResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/RegisterPayment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) ClaimPayment(ctx context.Context, in *ClaimPaymentRequest, opts ...grpc.CallOption) (*ClaimPaymentResponse, error) {
out := new(ClaimPaymentResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/ClaimPayment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) FinalizePayment(ctx context.Context, in *FinalizePaymentRequest, opts ...grpc.CallOption) (*FinalizePaymentResponse, error) {
out := new(FinalizePaymentResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/FinalizePayment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) GetRound(ctx context.Context, in *GetRoundRequest, opts ...grpc.CallOption) (*GetRoundResponse, error) {
out := new(GetRoundResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/GetRound", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) GetEventStream(ctx context.Context, in *GetEventStreamRequest, opts ...grpc.CallOption) (ArkService_GetEventStreamClient, error) {
stream, err := c.cc.NewStream(ctx, &ArkService_ServiceDesc.Streams[0], "/ark.v1.ArkService/GetEventStream", opts...)
if err != nil {
return nil, err
}
x := &arkServiceGetEventStreamClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type ArkService_GetEventStreamClient interface {
Recv() (*GetEventStreamResponse, error)
grpc.ClientStream
}
type arkServiceGetEventStreamClient struct {
grpc.ClientStream
}
func (x *arkServiceGetEventStreamClient) Recv() (*GetEventStreamResponse, error) {
m := new(GetEventStreamResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *arkServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
out := new(PingResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/Ping", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) Faucet(ctx context.Context, in *FaucetRequest, opts ...grpc.CallOption) (*FaucetResponse, error) {
out := new(FaucetResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/Faucet", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) ListVtxos(ctx context.Context, in *ListVtxosRequest, opts ...grpc.CallOption) (*ListVtxosResponse, error) {
out := new(ListVtxosResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/ListVtxos", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *arkServiceClient) GetPubkey(ctx context.Context, in *GetPubkeyRequest, opts ...grpc.CallOption) (*GetPubkeyResponse, error) {
out := new(GetPubkeyResponse)
err := c.cc.Invoke(ctx, "/ark.v1.ArkService/GetPubkey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ArkServiceServer is the server API for ArkService service.
// All implementations should embed UnimplementedArkServiceServer
// for forward compatibility
type ArkServiceServer interface {
RegisterPayment(context.Context, *RegisterPaymentRequest) (*RegisterPaymentResponse, error)
ClaimPayment(context.Context, *ClaimPaymentRequest) (*ClaimPaymentResponse, error)
FinalizePayment(context.Context, *FinalizePaymentRequest) (*FinalizePaymentResponse, error)
GetRound(context.Context, *GetRoundRequest) (*GetRoundResponse, error)
GetEventStream(*GetEventStreamRequest, ArkService_GetEventStreamServer) error
Ping(context.Context, *PingRequest) (*PingResponse, error)
Faucet(context.Context, *FaucetRequest) (*FaucetResponse, error)
ListVtxos(context.Context, *ListVtxosRequest) (*ListVtxosResponse, error)
GetPubkey(context.Context, *GetPubkeyRequest) (*GetPubkeyResponse, error)
}
// UnimplementedArkServiceServer should be embedded to have forward compatible implementations.
type UnimplementedArkServiceServer struct {
}
func (UnimplementedArkServiceServer) RegisterPayment(context.Context, *RegisterPaymentRequest) (*RegisterPaymentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterPayment not implemented")
}
func (UnimplementedArkServiceServer) ClaimPayment(context.Context, *ClaimPaymentRequest) (*ClaimPaymentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ClaimPayment not implemented")
}
func (UnimplementedArkServiceServer) FinalizePayment(context.Context, *FinalizePaymentRequest) (*FinalizePaymentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FinalizePayment not implemented")
}
func (UnimplementedArkServiceServer) GetRound(context.Context, *GetRoundRequest) (*GetRoundResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRound not implemented")
}
func (UnimplementedArkServiceServer) GetEventStream(*GetEventStreamRequest, ArkService_GetEventStreamServer) error {
return status.Errorf(codes.Unimplemented, "method GetEventStream not implemented")
}
func (UnimplementedArkServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedArkServiceServer) Faucet(context.Context, *FaucetRequest) (*FaucetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Faucet not implemented")
}
func (UnimplementedArkServiceServer) ListVtxos(context.Context, *ListVtxosRequest) (*ListVtxosResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListVtxos not implemented")
}
func (UnimplementedArkServiceServer) GetPubkey(context.Context, *GetPubkeyRequest) (*GetPubkeyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPubkey not implemented")
}
// UnsafeArkServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ArkServiceServer will
// result in compilation errors.
type UnsafeArkServiceServer interface {
mustEmbedUnimplementedArkServiceServer()
}
func RegisterArkServiceServer(s grpc.ServiceRegistrar, srv ArkServiceServer) {
s.RegisterService(&ArkService_ServiceDesc, srv)
}
func _ArkService_RegisterPayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterPaymentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).RegisterPayment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/RegisterPayment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).RegisterPayment(ctx, req.(*RegisterPaymentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_ClaimPayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ClaimPaymentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).ClaimPayment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/ClaimPayment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).ClaimPayment(ctx, req.(*ClaimPaymentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_FinalizePayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FinalizePaymentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).FinalizePayment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/FinalizePayment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).FinalizePayment(ctx, req.(*FinalizePaymentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_GetRound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRoundRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).GetRound(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/GetRound",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).GetRound(ctx, req.(*GetRoundRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_GetEventStream_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(GetEventStreamRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ArkServiceServer).GetEventStream(m, &arkServiceGetEventStreamServer{stream})
}
type ArkService_GetEventStreamServer interface {
Send(*GetEventStreamResponse) error
grpc.ServerStream
}
type arkServiceGetEventStreamServer struct {
grpc.ServerStream
}
func (x *arkServiceGetEventStreamServer) Send(m *GetEventStreamResponse) error {
return x.ServerStream.SendMsg(m)
}
func _ArkService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).Ping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/Ping",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).Ping(ctx, req.(*PingRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_Faucet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FaucetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).Faucet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/Faucet",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).Faucet(ctx, req.(*FaucetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_ListVtxos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListVtxosRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).ListVtxos(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/ListVtxos",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).ListVtxos(ctx, req.(*ListVtxosRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ArkService_GetPubkey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPubkeyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ArkServiceServer).GetPubkey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ark.v1.ArkService/GetPubkey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ArkServiceServer).GetPubkey(ctx, req.(*GetPubkeyRequest))
}
return interceptor(ctx, in, info, handler)
}
// ArkService_ServiceDesc is the grpc.ServiceDesc for ArkService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ArkService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ark.v1.ArkService",
HandlerType: (*ArkServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterPayment",
Handler: _ArkService_RegisterPayment_Handler,
},
{
MethodName: "ClaimPayment",
Handler: _ArkService_ClaimPayment_Handler,
},
{
MethodName: "FinalizePayment",
Handler: _ArkService_FinalizePayment_Handler,
},
{
MethodName: "GetRound",
Handler: _ArkService_GetRound_Handler,
},
{
MethodName: "Ping",
Handler: _ArkService_Ping_Handler,
},
{
MethodName: "Faucet",
Handler: _ArkService_Faucet_Handler,
},
{
MethodName: "ListVtxos",
Handler: _ArkService_ListVtxos_Handler,
},
{
MethodName: "GetPubkey",
Handler: _ArkService_GetPubkey_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "GetEventStream",
Handler: _ArkService_GetEventStream_Handler,
ServerStreams: true,
},
},
Metadata: "ark/v1/service.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,487 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package oceanv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// AccountServiceClient is the client API for AccountService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AccountServiceClient interface {
// CreateAccountBIP44 creates a new BIP44 account.
CreateAccountBIP44(ctx context.Context, in *CreateAccountBIP44Request, opts ...grpc.CallOption) (*CreateAccountBIP44Response, error)
// CreateAccountMultiSig creates a new multisig account.
CreateAccountMultiSig(ctx context.Context, in *CreateAccountMultiSigRequest, opts ...grpc.CallOption) (*CreateAccountMultiSigResponse, error)
// CreateAccountCustom creates a new custom account for which loading a template.
CreateAccountCustom(ctx context.Context, in *CreateAccountCustomRequest, opts ...grpc.CallOption) (*CreateAccountCustomResponse, error)
// SetAccountLabel sets a label for the account that can be used later to refer to it.
SetAccountLabel(ctx context.Context, in *SetAccountLabelRequest, opts ...grpc.CallOption) (*SetAccountLabelResponse, error)
// SetAccountTemplate sets the template for the account used to generate new addresses.
SetAccountTemplate(ctx context.Context, in *SetAccountTemplateRequest, opts ...grpc.CallOption) (*SetAccountTemplateResponse, error)
// DeriveAddresses generates new address(es) for the account.
DeriveAddresses(ctx context.Context, in *DeriveAddressesRequest, opts ...grpc.CallOption) (*DeriveAddressesResponse, error)
// DeriveChangeAddresses generates new change address(es) for the account.
DeriveChangeAddresses(ctx context.Context, in *DeriveChangeAddressesRequest, opts ...grpc.CallOption) (*DeriveChangeAddressesResponse, error)
// ListAddresses returns all derived addresses for the account.
ListAddresses(ctx context.Context, in *ListAddressesRequest, opts ...grpc.CallOption) (*ListAddressesResponse, error)
// Balance returns the balance for the account, or for specific list of
// account's addresses.
Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error)
// ListUtxos returns the utxos for the account, or specific list of
// account's addresses.
ListUtxos(ctx context.Context, in *ListUtxosRequest, opts ...grpc.CallOption) (*ListUtxosResponse, error)
// DeleteAccount deletes an existing account. The operation is allowed only
// if the account has zero balance.
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error)
}
type accountServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient {
return &accountServiceClient{cc}
}
func (c *accountServiceClient) CreateAccountBIP44(ctx context.Context, in *CreateAccountBIP44Request, opts ...grpc.CallOption) (*CreateAccountBIP44Response, error) {
out := new(CreateAccountBIP44Response)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/CreateAccountBIP44", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) CreateAccountMultiSig(ctx context.Context, in *CreateAccountMultiSigRequest, opts ...grpc.CallOption) (*CreateAccountMultiSigResponse, error) {
out := new(CreateAccountMultiSigResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/CreateAccountMultiSig", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) CreateAccountCustom(ctx context.Context, in *CreateAccountCustomRequest, opts ...grpc.CallOption) (*CreateAccountCustomResponse, error) {
out := new(CreateAccountCustomResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/CreateAccountCustom", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) SetAccountLabel(ctx context.Context, in *SetAccountLabelRequest, opts ...grpc.CallOption) (*SetAccountLabelResponse, error) {
out := new(SetAccountLabelResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/SetAccountLabel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) SetAccountTemplate(ctx context.Context, in *SetAccountTemplateRequest, opts ...grpc.CallOption) (*SetAccountTemplateResponse, error) {
out := new(SetAccountTemplateResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/SetAccountTemplate", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) DeriveAddresses(ctx context.Context, in *DeriveAddressesRequest, opts ...grpc.CallOption) (*DeriveAddressesResponse, error) {
out := new(DeriveAddressesResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/DeriveAddresses", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) DeriveChangeAddresses(ctx context.Context, in *DeriveChangeAddressesRequest, opts ...grpc.CallOption) (*DeriveChangeAddressesResponse, error) {
out := new(DeriveChangeAddressesResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/DeriveChangeAddresses", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) ListAddresses(ctx context.Context, in *ListAddressesRequest, opts ...grpc.CallOption) (*ListAddressesResponse, error) {
out := new(ListAddressesResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/ListAddresses", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) {
out := new(BalanceResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/Balance", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) ListUtxos(ctx context.Context, in *ListUtxosRequest, opts ...grpc.CallOption) (*ListUtxosResponse, error) {
out := new(ListUtxosResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/ListUtxos", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) {
out := new(DeleteAccountResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/DeleteAccount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AccountServiceServer is the server API for AccountService service.
// All implementations should embed UnimplementedAccountServiceServer
// for forward compatibility
type AccountServiceServer interface {
// CreateAccountBIP44 creates a new BIP44 account.
CreateAccountBIP44(context.Context, *CreateAccountBIP44Request) (*CreateAccountBIP44Response, error)
// CreateAccountMultiSig creates a new multisig account.
CreateAccountMultiSig(context.Context, *CreateAccountMultiSigRequest) (*CreateAccountMultiSigResponse, error)
// CreateAccountCustom creates a new custom account for which loading a template.
CreateAccountCustom(context.Context, *CreateAccountCustomRequest) (*CreateAccountCustomResponse, error)
// SetAccountLabel sets a label for the account that can be used later to refer to it.
SetAccountLabel(context.Context, *SetAccountLabelRequest) (*SetAccountLabelResponse, error)
// SetAccountTemplate sets the template for the account used to generate new addresses.
SetAccountTemplate(context.Context, *SetAccountTemplateRequest) (*SetAccountTemplateResponse, error)
// DeriveAddresses generates new address(es) for the account.
DeriveAddresses(context.Context, *DeriveAddressesRequest) (*DeriveAddressesResponse, error)
// DeriveChangeAddresses generates new change address(es) for the account.
DeriveChangeAddresses(context.Context, *DeriveChangeAddressesRequest) (*DeriveChangeAddressesResponse, error)
// ListAddresses returns all derived addresses for the account.
ListAddresses(context.Context, *ListAddressesRequest) (*ListAddressesResponse, error)
// Balance returns the balance for the account, or for specific list of
// account's addresses.
Balance(context.Context, *BalanceRequest) (*BalanceResponse, error)
// ListUtxos returns the utxos for the account, or specific list of
// account's addresses.
ListUtxos(context.Context, *ListUtxosRequest) (*ListUtxosResponse, error)
// DeleteAccount deletes an existing account. The operation is allowed only
// if the account has zero balance.
DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error)
}
// UnimplementedAccountServiceServer should be embedded to have forward compatible implementations.
type UnimplementedAccountServiceServer struct {
}
func (UnimplementedAccountServiceServer) CreateAccountBIP44(context.Context, *CreateAccountBIP44Request) (*CreateAccountBIP44Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateAccountBIP44 not implemented")
}
func (UnimplementedAccountServiceServer) CreateAccountMultiSig(context.Context, *CreateAccountMultiSigRequest) (*CreateAccountMultiSigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateAccountMultiSig not implemented")
}
func (UnimplementedAccountServiceServer) CreateAccountCustom(context.Context, *CreateAccountCustomRequest) (*CreateAccountCustomResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateAccountCustom not implemented")
}
func (UnimplementedAccountServiceServer) SetAccountLabel(context.Context, *SetAccountLabelRequest) (*SetAccountLabelResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetAccountLabel not implemented")
}
func (UnimplementedAccountServiceServer) SetAccountTemplate(context.Context, *SetAccountTemplateRequest) (*SetAccountTemplateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetAccountTemplate not implemented")
}
func (UnimplementedAccountServiceServer) DeriveAddresses(context.Context, *DeriveAddressesRequest) (*DeriveAddressesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeriveAddresses not implemented")
}
func (UnimplementedAccountServiceServer) DeriveChangeAddresses(context.Context, *DeriveChangeAddressesRequest) (*DeriveChangeAddressesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeriveChangeAddresses not implemented")
}
func (UnimplementedAccountServiceServer) ListAddresses(context.Context, *ListAddressesRequest) (*ListAddressesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListAddresses not implemented")
}
func (UnimplementedAccountServiceServer) Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented")
}
func (UnimplementedAccountServiceServer) ListUtxos(context.Context, *ListUtxosRequest) (*ListUtxosResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListUtxos not implemented")
}
func (UnimplementedAccountServiceServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteAccount not implemented")
}
// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AccountServiceServer will
// result in compilation errors.
type UnsafeAccountServiceServer interface {
mustEmbedUnimplementedAccountServiceServer()
}
func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) {
s.RegisterService(&AccountService_ServiceDesc, srv)
}
func _AccountService_CreateAccountBIP44_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateAccountBIP44Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).CreateAccountBIP44(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/CreateAccountBIP44",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).CreateAccountBIP44(ctx, req.(*CreateAccountBIP44Request))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_CreateAccountMultiSig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateAccountMultiSigRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).CreateAccountMultiSig(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/CreateAccountMultiSig",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).CreateAccountMultiSig(ctx, req.(*CreateAccountMultiSigRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_CreateAccountCustom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateAccountCustomRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).CreateAccountCustom(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/CreateAccountCustom",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).CreateAccountCustom(ctx, req.(*CreateAccountCustomRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_SetAccountLabel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetAccountLabelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).SetAccountLabel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/SetAccountLabel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).SetAccountLabel(ctx, req.(*SetAccountLabelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_SetAccountTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetAccountTemplateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).SetAccountTemplate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/SetAccountTemplate",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).SetAccountTemplate(ctx, req.(*SetAccountTemplateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_DeriveAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeriveAddressesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).DeriveAddresses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/DeriveAddresses",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).DeriveAddresses(ctx, req.(*DeriveAddressesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_DeriveChangeAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeriveChangeAddressesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).DeriveChangeAddresses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/DeriveChangeAddresses",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).DeriveChangeAddresses(ctx, req.(*DeriveChangeAddressesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_ListAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListAddressesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).ListAddresses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/ListAddresses",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).ListAddresses(ctx, req.(*ListAddressesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).Balance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/Balance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).Balance(ctx, req.(*BalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_ListUtxos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListUtxosRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).ListUtxos(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/ListUtxos",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).ListUtxos(ctx, req.(*ListUtxosRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_DeleteAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteAccountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).DeleteAccount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.AccountService/DeleteAccount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).DeleteAccount(ctx, req.(*DeleteAccountRequest))
}
return interceptor(ctx, in, info, handler)
}
// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AccountService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ocean.v1.AccountService",
HandlerType: (*AccountServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateAccountBIP44",
Handler: _AccountService_CreateAccountBIP44_Handler,
},
{
MethodName: "CreateAccountMultiSig",
Handler: _AccountService_CreateAccountMultiSig_Handler,
},
{
MethodName: "CreateAccountCustom",
Handler: _AccountService_CreateAccountCustom_Handler,
},
{
MethodName: "SetAccountLabel",
Handler: _AccountService_SetAccountLabel_Handler,
},
{
MethodName: "SetAccountTemplate",
Handler: _AccountService_SetAccountTemplate_Handler,
},
{
MethodName: "DeriveAddresses",
Handler: _AccountService_DeriveAddresses_Handler,
},
{
MethodName: "DeriveChangeAddresses",
Handler: _AccountService_DeriveChangeAddresses_Handler,
},
{
MethodName: "ListAddresses",
Handler: _AccountService_ListAddresses_Handler,
},
{
MethodName: "Balance",
Handler: _AccountService_Balance_Handler,
},
{
MethodName: "ListUtxos",
Handler: _AccountService_ListUtxos_Handler,
},
{
MethodName: "DeleteAccount",
Handler: _AccountService_DeleteAccount_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ocean/v1/account.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,392 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package oceanv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// NotificationServiceClient is the client API for NotificationService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type 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.
UtxosNotifications(ctx context.Context, in *UtxosNotificationsRequest, opts ...grpc.CallOption) (NotificationService_UtxosNotificationsClient, error)
// Adds a webhook registered for some kind of event.
AddWebhook(ctx context.Context, in *AddWebhookRequest, opts ...grpc.CallOption) (*AddWebhookResponse, error)
// Removes some previously added webhook.
RemoveWebhook(ctx context.Context, in *RemoveWebhookRequest, opts ...grpc.CallOption) (*RemoveWebhookResponse, error)
// Returns registered webhooks.
ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error)
}
type notificationServiceClient struct {
cc grpc.ClientConnInterface
}
func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServiceClient {
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 {
return nil, err
}
x := &notificationServiceTransactionNotificationsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type NotificationService_TransactionNotificationsClient interface {
Recv() (*TransactionNotificationsResponse, error)
grpc.ClientStream
}
type notificationServiceTransactionNotificationsClient struct {
grpc.ClientStream
}
func (x *notificationServiceTransactionNotificationsClient) Recv() (*TransactionNotificationsResponse, error) {
m := new(TransactionNotificationsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *notificationServiceClient) UtxosNotifications(ctx context.Context, in *UtxosNotificationsRequest, opts ...grpc.CallOption) (NotificationService_UtxosNotificationsClient, error) {
stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[1], "/ocean.v1.NotificationService/UtxosNotifications", opts...)
if err != nil {
return nil, err
}
x := &notificationServiceUtxosNotificationsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type NotificationService_UtxosNotificationsClient interface {
Recv() (*UtxosNotificationsResponse, error)
grpc.ClientStream
}
type notificationServiceUtxosNotificationsClient struct {
grpc.ClientStream
}
func (x *notificationServiceUtxosNotificationsClient) Recv() (*UtxosNotificationsResponse, error) {
m := new(UtxosNotificationsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *notificationServiceClient) AddWebhook(ctx context.Context, in *AddWebhookRequest, opts ...grpc.CallOption) (*AddWebhookResponse, error) {
out := new(AddWebhookResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/AddWebhook", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *notificationServiceClient) RemoveWebhook(ctx context.Context, in *RemoveWebhookRequest, opts ...grpc.CallOption) (*RemoveWebhookResponse, error) {
out := new(RemoveWebhookResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/RemoveWebhook", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *notificationServiceClient) ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error) {
out := new(ListWebhooksResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/ListWebhooks", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// NotificationServiceServer is the server API for NotificationService service.
// 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.
UtxosNotifications(*UtxosNotificationsRequest, NotificationService_UtxosNotificationsServer) error
// Adds a webhook registered for some kind of event.
AddWebhook(context.Context, *AddWebhookRequest) (*AddWebhookResponse, error)
// Removes some previously added webhook.
RemoveWebhook(context.Context, *RemoveWebhookRequest) (*RemoveWebhookResponse, error)
// Returns registered webhooks.
ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error)
}
// UnimplementedNotificationServiceServer should be embedded to have forward compatible implementations.
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")
}
func (UnimplementedNotificationServiceServer) UtxosNotifications(*UtxosNotificationsRequest, NotificationService_UtxosNotificationsServer) error {
return status.Errorf(codes.Unimplemented, "method UtxosNotifications not implemented")
}
func (UnimplementedNotificationServiceServer) AddWebhook(context.Context, *AddWebhookRequest) (*AddWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddWebhook not implemented")
}
func (UnimplementedNotificationServiceServer) RemoveWebhook(context.Context, *RemoveWebhookRequest) (*RemoveWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveWebhook not implemented")
}
func (UnimplementedNotificationServiceServer) ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListWebhooks not implemented")
}
// UnsafeNotificationServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NotificationServiceServer will
// result in compilation errors.
type UnsafeNotificationServiceServer interface {
mustEmbedUnimplementedNotificationServiceServer()
}
func RegisterNotificationServiceServer(s grpc.ServiceRegistrar, srv NotificationServiceServer) {
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 {
return err
}
return srv.(NotificationServiceServer).TransactionNotifications(m, &notificationServiceTransactionNotificationsServer{stream})
}
type NotificationService_TransactionNotificationsServer interface {
Send(*TransactionNotificationsResponse) error
grpc.ServerStream
}
type notificationServiceTransactionNotificationsServer struct {
grpc.ServerStream
}
func (x *notificationServiceTransactionNotificationsServer) Send(m *TransactionNotificationsResponse) error {
return x.ServerStream.SendMsg(m)
}
func _NotificationService_UtxosNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(UtxosNotificationsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(NotificationServiceServer).UtxosNotifications(m, &notificationServiceUtxosNotificationsServer{stream})
}
type NotificationService_UtxosNotificationsServer interface {
Send(*UtxosNotificationsResponse) error
grpc.ServerStream
}
type notificationServiceUtxosNotificationsServer struct {
grpc.ServerStream
}
func (x *notificationServiceUtxosNotificationsServer) Send(m *UtxosNotificationsResponse) error {
return x.ServerStream.SendMsg(m)
}
func _NotificationService_AddWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NotificationServiceServer).AddWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.NotificationService/AddWebhook",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NotificationServiceServer).AddWebhook(ctx, req.(*AddWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NotificationService_RemoveWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NotificationServiceServer).RemoveWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.NotificationService/RemoveWebhook",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NotificationServiceServer).RemoveWebhook(ctx, req.(*RemoveWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NotificationService_ListWebhooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListWebhooksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NotificationServiceServer).ListWebhooks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.NotificationService/ListWebhooks",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NotificationServiceServer).ListWebhooks(ctx, req.(*ListWebhooksRequest))
}
return interceptor(ctx, in, info, handler)
}
// NotificationService_ServiceDesc is the grpc.ServiceDesc for NotificationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
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,
},
{
MethodName: "RemoveWebhook",
Handler: _NotificationService_RemoveWebhook_Handler,
},
{
MethodName: "ListWebhooks",
Handler: _NotificationService_ListWebhooks_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "TransactionNotifications",
Handler: _NotificationService_TransactionNotifications_Handler,
ServerStreams: true,
},
{
StreamName: "UtxosNotifications",
Handler: _NotificationService_UtxosNotifications_Handler,
ServerStreams: true,
},
},
Metadata: "ocean/v1/notification.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,689 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package oceanv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// TransactionServiceClient is the client API for TransactionService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type TransactionServiceClient interface {
// GetTransaction returns the hex of a transaction given its id.
GetTransaction(ctx context.Context, in *GetTransactionRequest, opts ...grpc.CallOption) (*GetTransactionResponse, error)
// SelectUtxos returns a selction of utxos, to be used in another
// transaction, for provided target amount and strategy.
// Selected utxos are locked for predefined amount of time to prevent
// double-spending them.
SelectUtxos(ctx context.Context, in *SelectUtxosRequest, opts ...grpc.CallOption) (*SelectUtxosResponse, error)
// EstimateFees returns the fee amount to pay for a tx containing the given
// inputs and outputs.
EstimateFees(ctx context.Context, in *EstimateFeesRequest, opts ...grpc.CallOption) (*EstimateFeesResponse, error)
// SignTransaction signs a raw transaction in hex format.
SignTransaction(ctx context.Context, in *SignTransactionRequest, opts ...grpc.CallOption) (*SignTransactionResponse, error)
// BroadcastTransaction broadacats a raw transaction in hex format.
BroadcastTransaction(ctx context.Context, in *BroadcastTransactionRequest, opts ...grpc.CallOption) (*BroadcastTransactionResponse, error)
// CreatePset returns an unsigned pset for given inputs and outputs.
CreatePset(ctx context.Context, in *CreatePsetRequest, opts ...grpc.CallOption) (*CreatePsetResponse, error)
// UpdatePset adds the given inputs and outputs to the partial transaction.
UpdatePset(ctx context.Context, in *UpdatePsetRequest, opts ...grpc.CallOption) (*UpdatePsetResponse, error)
// BlindPset updates the given pset with required ins and outs blinded.
BlindPset(ctx context.Context, in *BlindPsetRequest, opts ...grpc.CallOption) (*BlindPsetResponse, error)
// SignPset updates the given pset adding the required signatures.
SignPset(ctx context.Context, in *SignPsetRequest, opts ...grpc.CallOption) (*SignPsetResponse, error)
// Mint returns a transaction that issues a new asset.
Mint(ctx context.Context, in *MintRequest, opts ...grpc.CallOption) (*MintResponse, error)
// Remint returns a transaction that re-issues an existing asset.
Remint(ctx context.Context, in *RemintRequest, opts ...grpc.CallOption) (*RemintResponse, error)
// Burn returns a transaction that burns some funds.
Burn(ctx context.Context, in *BurnRequest, opts ...grpc.CallOption) (*BurnResponse, error)
// Transfer returns a transaction to send funds to some receiver.
Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error)
// PegInAddress returns what's necessary to peg funds of the Bitcoin
// main-chain and have them available on the Liquid side-chain.
// Bitcoin funds must be sent to the main-chain address while the claim
// output script must be used to redeem the LBTC ones.
PegInAddress(ctx context.Context, in *PegInAddressRequest, opts ...grpc.CallOption) (*PegInAddressResponse, error)
// 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 {
cc grpc.ClientConnInterface
}
func NewTransactionServiceClient(cc grpc.ClientConnInterface) TransactionServiceClient {
return &transactionServiceClient{cc}
}
func (c *transactionServiceClient) GetTransaction(ctx context.Context, in *GetTransactionRequest, opts ...grpc.CallOption) (*GetTransactionResponse, error) {
out := new(GetTransactionResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/GetTransaction", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) SelectUtxos(ctx context.Context, in *SelectUtxosRequest, opts ...grpc.CallOption) (*SelectUtxosResponse, error) {
out := new(SelectUtxosResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SelectUtxos", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) EstimateFees(ctx context.Context, in *EstimateFeesRequest, opts ...grpc.CallOption) (*EstimateFeesResponse, error) {
out := new(EstimateFeesResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/EstimateFees", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) SignTransaction(ctx context.Context, in *SignTransactionRequest, opts ...grpc.CallOption) (*SignTransactionResponse, error) {
out := new(SignTransactionResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SignTransaction", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) BroadcastTransaction(ctx context.Context, in *BroadcastTransactionRequest, opts ...grpc.CallOption) (*BroadcastTransactionResponse, error) {
out := new(BroadcastTransactionResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/BroadcastTransaction", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) CreatePset(ctx context.Context, in *CreatePsetRequest, opts ...grpc.CallOption) (*CreatePsetResponse, error) {
out := new(CreatePsetResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/CreatePset", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) UpdatePset(ctx context.Context, in *UpdatePsetRequest, opts ...grpc.CallOption) (*UpdatePsetResponse, error) {
out := new(UpdatePsetResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/UpdatePset", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) BlindPset(ctx context.Context, in *BlindPsetRequest, opts ...grpc.CallOption) (*BlindPsetResponse, error) {
out := new(BlindPsetResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/BlindPset", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) SignPset(ctx context.Context, in *SignPsetRequest, opts ...grpc.CallOption) (*SignPsetResponse, error) {
out := new(SignPsetResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SignPset", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) Mint(ctx context.Context, in *MintRequest, opts ...grpc.CallOption) (*MintResponse, error) {
out := new(MintResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Mint", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) Remint(ctx context.Context, in *RemintRequest, opts ...grpc.CallOption) (*RemintResponse, error) {
out := new(RemintResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Remint", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) Burn(ctx context.Context, in *BurnRequest, opts ...grpc.CallOption) (*BurnResponse, error) {
out := new(BurnResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Burn", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error) {
out := new(TransferResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Transfer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) PegInAddress(ctx context.Context, in *PegInAddressRequest, opts ...grpc.CallOption) (*PegInAddressResponse, error) {
out := new(PegInAddressResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/PegInAddress", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *transactionServiceClient) ClaimPegIn(ctx context.Context, in *ClaimPegInRequest, opts ...grpc.CallOption) (*ClaimPegInResponse, error) {
out := new(ClaimPegInResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/ClaimPegIn", in, out, opts...)
if err != nil {
return nil, err
}
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
type TransactionServiceServer interface {
// GetTransaction returns the hex of a transaction given its id.
GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error)
// SelectUtxos returns a selction of utxos, to be used in another
// transaction, for provided target amount and strategy.
// Selected utxos are locked for predefined amount of time to prevent
// double-spending them.
SelectUtxos(context.Context, *SelectUtxosRequest) (*SelectUtxosResponse, error)
// EstimateFees returns the fee amount to pay for a tx containing the given
// inputs and outputs.
EstimateFees(context.Context, *EstimateFeesRequest) (*EstimateFeesResponse, error)
// SignTransaction signs a raw transaction in hex format.
SignTransaction(context.Context, *SignTransactionRequest) (*SignTransactionResponse, error)
// BroadcastTransaction broadacats a raw transaction in hex format.
BroadcastTransaction(context.Context, *BroadcastTransactionRequest) (*BroadcastTransactionResponse, error)
// CreatePset returns an unsigned pset for given inputs and outputs.
CreatePset(context.Context, *CreatePsetRequest) (*CreatePsetResponse, error)
// UpdatePset adds the given inputs and outputs to the partial transaction.
UpdatePset(context.Context, *UpdatePsetRequest) (*UpdatePsetResponse, error)
// BlindPset updates the given pset with required ins and outs blinded.
BlindPset(context.Context, *BlindPsetRequest) (*BlindPsetResponse, error)
// SignPset updates the given pset adding the required signatures.
SignPset(context.Context, *SignPsetRequest) (*SignPsetResponse, error)
// Mint returns a transaction that issues a new asset.
Mint(context.Context, *MintRequest) (*MintResponse, error)
// Remint returns a transaction that re-issues an existing asset.
Remint(context.Context, *RemintRequest) (*RemintResponse, error)
// Burn returns a transaction that burns some funds.
Burn(context.Context, *BurnRequest) (*BurnResponse, error)
// Transfer returns a transaction to send funds to some receiver.
Transfer(context.Context, *TransferRequest) (*TransferResponse, error)
// PegInAddress returns what's necessary to peg funds of the Bitcoin
// main-chain and have them available on the Liquid side-chain.
// Bitcoin funds must be sent to the main-chain address while the claim
// output script must be used to redeem the LBTC ones.
PegInAddress(context.Context, *PegInAddressRequest) (*PegInAddressResponse, error)
// 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.
type UnimplementedTransactionServiceServer struct {
}
func (UnimplementedTransactionServiceServer) GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTransaction not implemented")
}
func (UnimplementedTransactionServiceServer) SelectUtxos(context.Context, *SelectUtxosRequest) (*SelectUtxosResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SelectUtxos not implemented")
}
func (UnimplementedTransactionServiceServer) EstimateFees(context.Context, *EstimateFeesRequest) (*EstimateFeesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EstimateFees not implemented")
}
func (UnimplementedTransactionServiceServer) SignTransaction(context.Context, *SignTransactionRequest) (*SignTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignTransaction not implemented")
}
func (UnimplementedTransactionServiceServer) BroadcastTransaction(context.Context, *BroadcastTransactionRequest) (*BroadcastTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BroadcastTransaction not implemented")
}
func (UnimplementedTransactionServiceServer) CreatePset(context.Context, *CreatePsetRequest) (*CreatePsetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreatePset not implemented")
}
func (UnimplementedTransactionServiceServer) UpdatePset(context.Context, *UpdatePsetRequest) (*UpdatePsetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdatePset not implemented")
}
func (UnimplementedTransactionServiceServer) BlindPset(context.Context, *BlindPsetRequest) (*BlindPsetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BlindPset not implemented")
}
func (UnimplementedTransactionServiceServer) SignPset(context.Context, *SignPsetRequest) (*SignPsetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignPset not implemented")
}
func (UnimplementedTransactionServiceServer) Mint(context.Context, *MintRequest) (*MintResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Mint not implemented")
}
func (UnimplementedTransactionServiceServer) Remint(context.Context, *RemintRequest) (*RemintResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Remint not implemented")
}
func (UnimplementedTransactionServiceServer) Burn(context.Context, *BurnRequest) (*BurnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented")
}
func (UnimplementedTransactionServiceServer) Transfer(context.Context, *TransferRequest) (*TransferResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented")
}
func (UnimplementedTransactionServiceServer) PegInAddress(context.Context, *PegInAddressRequest) (*PegInAddressResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PegInAddress not implemented")
}
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
// result in compilation errors.
type UnsafeTransactionServiceServer interface {
mustEmbedUnimplementedTransactionServiceServer()
}
func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer) {
s.RegisterService(&TransactionService_ServiceDesc, srv)
}
func _TransactionService_GetTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).GetTransaction(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/GetTransaction",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).GetTransaction(ctx, req.(*GetTransactionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_SelectUtxos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SelectUtxosRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).SelectUtxos(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/SelectUtxos",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).SelectUtxos(ctx, req.(*SelectUtxosRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_EstimateFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EstimateFeesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).EstimateFees(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/EstimateFees",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).EstimateFees(ctx, req.(*EstimateFeesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_SignTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).SignTransaction(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/SignTransaction",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).SignTransaction(ctx, req.(*SignTransactionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_BroadcastTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BroadcastTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).BroadcastTransaction(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/BroadcastTransaction",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).BroadcastTransaction(ctx, req.(*BroadcastTransactionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_CreatePset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePsetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).CreatePset(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/CreatePset",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).CreatePset(ctx, req.(*CreatePsetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_UpdatePset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePsetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).UpdatePset(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/UpdatePset",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).UpdatePset(ctx, req.(*UpdatePsetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_BlindPset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BlindPsetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).BlindPset(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/BlindPset",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).BlindPset(ctx, req.(*BlindPsetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_SignPset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignPsetRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).SignPset(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/SignPset",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).SignPset(ctx, req.(*SignPsetRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MintRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).Mint(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/Mint",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).Mint(ctx, req.(*MintRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_Remint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemintRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).Remint(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/Remint",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).Remint(ctx, req.(*RemintRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BurnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).Burn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/Burn",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).Burn(ctx, req.(*BurnRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TransferRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).Transfer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/Transfer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).Transfer(ctx, req.(*TransferRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_PegInAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PegInAddressRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).PegInAddress(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/PegInAddress",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).PegInAddress(ctx, req.(*PegInAddressRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TransactionService_ClaimPegIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ClaimPegInRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TransactionServiceServer).ClaimPegIn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.TransactionService/ClaimPegIn",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TransactionServiceServer).ClaimPegIn(ctx, req.(*ClaimPegInRequest))
}
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)
var TransactionService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ocean.v1.TransactionService",
HandlerType: (*TransactionServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetTransaction",
Handler: _TransactionService_GetTransaction_Handler,
},
{
MethodName: "SelectUtxos",
Handler: _TransactionService_SelectUtxos_Handler,
},
{
MethodName: "EstimateFees",
Handler: _TransactionService_EstimateFees_Handler,
},
{
MethodName: "SignTransaction",
Handler: _TransactionService_SignTransaction_Handler,
},
{
MethodName: "BroadcastTransaction",
Handler: _TransactionService_BroadcastTransaction_Handler,
},
{
MethodName: "CreatePset",
Handler: _TransactionService_CreatePset_Handler,
},
{
MethodName: "UpdatePset",
Handler: _TransactionService_UpdatePset_Handler,
},
{
MethodName: "BlindPset",
Handler: _TransactionService_BlindPset_Handler,
},
{
MethodName: "SignPset",
Handler: _TransactionService_SignPset_Handler,
},
{
MethodName: "Mint",
Handler: _TransactionService_Mint_Handler,
},
{
MethodName: "Remint",
Handler: _TransactionService_Remint_Handler,
},
{
MethodName: "Burn",
Handler: _TransactionService_Burn_Handler,
},
{
MethodName: "Transfer",
Handler: _TransactionService_Transfer_Handler,
},
{
MethodName: "PegInAddress",
Handler: _TransactionService_PegInAddress_Handler,
},
{
MethodName: "ClaimPegIn",
Handler: _TransactionService_ClaimPegIn_Handler,
},
{
MethodName: "SignPsetWithSchnorrKey",
Handler: _TransactionService_SignPsetWithSchnorrKey_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ocean/v1/transaction.proto",
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,441 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package oceanv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// WalletServiceClient is the client API for WalletService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type WalletServiceClient interface {
// GenSeed returns signing and blinding seed that should be used to create a
// new HD Wallet.
GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error)
// CreateWallet creates an HD Wallet based on signing, blinding seeds,
// encrypts them with the password and persists the encrypted seeds.
CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error)
// Unlock tries to unlock the HD Wallet using the given password.
Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error)
// Lock locks the HD wallet.
Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error)
// ChangePassword changes the password used to encrypt/decrypt the HD seeds.
// It requires the wallet to be locked.
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
// RestoreWallet restores an HD Wallet based on signing and blinding seeds,
// encrypts them with the password and persists the encrypted seeds.
RestoreWallet(ctx context.Context, in *RestoreWalletRequest, opts ...grpc.CallOption) (WalletService_RestoreWalletClient, error)
// Status returns info about the status of the wallet.
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
// GetInfo returns info about the HD wallet.
GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
// Auth verifies whether the given password is valid without unlocking the wallet
Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error)
}
type walletServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWalletServiceClient(cc grpc.ClientConnInterface) WalletServiceClient {
return &walletServiceClient{cc}
}
func (c *walletServiceClient) GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error) {
out := new(GenSeedResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/GenSeed", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) {
out := new(CreateWalletResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/CreateWallet", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) {
out := new(UnlockResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Unlock", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) {
out := new(LockResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Lock", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) {
out := new(ChangePasswordResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/ChangePassword", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) RestoreWallet(ctx context.Context, in *RestoreWalletRequest, opts ...grpc.CallOption) (WalletService_RestoreWalletClient, error) {
stream, err := c.cc.NewStream(ctx, &WalletService_ServiceDesc.Streams[0], "/ocean.v1.WalletService/RestoreWallet", opts...)
if err != nil {
return nil, err
}
x := &walletServiceRestoreWalletClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type WalletService_RestoreWalletClient interface {
Recv() (*RestoreWalletResponse, error)
grpc.ClientStream
}
type walletServiceRestoreWalletClient struct {
grpc.ClientStream
}
func (x *walletServiceRestoreWalletClient) Recv() (*RestoreWalletResponse, error) {
m := new(RestoreWalletResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *walletServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
out := new(StatusResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Status", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) {
out := new(GetInfoResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/GetInfo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
out := new(AuthResponse)
err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Auth", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// WalletServiceServer is the server API for WalletService service.
// All implementations should embed UnimplementedWalletServiceServer
// for forward compatibility
type WalletServiceServer interface {
// GenSeed returns signing and blinding seed that should be used to create a
// new HD Wallet.
GenSeed(context.Context, *GenSeedRequest) (*GenSeedResponse, error)
// CreateWallet creates an HD Wallet based on signing, blinding seeds,
// encrypts them with the password and persists the encrypted seeds.
CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error)
// Unlock tries to unlock the HD Wallet using the given password.
Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error)
// Lock locks the HD wallet.
Lock(context.Context, *LockRequest) (*LockResponse, error)
// ChangePassword changes the password used to encrypt/decrypt the HD seeds.
// It requires the wallet to be locked.
ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
// RestoreWallet restores an HD Wallet based on signing and blinding seeds,
// encrypts them with the password and persists the encrypted seeds.
RestoreWallet(*RestoreWalletRequest, WalletService_RestoreWalletServer) error
// Status returns info about the status of the wallet.
Status(context.Context, *StatusRequest) (*StatusResponse, error)
// GetInfo returns info about the HD wallet.
GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
// Auth verifies whether the given password is valid without unlocking the wallet
Auth(context.Context, *AuthRequest) (*AuthResponse, error)
}
// UnimplementedWalletServiceServer should be embedded to have forward compatible implementations.
type UnimplementedWalletServiceServer struct {
}
func (UnimplementedWalletServiceServer) GenSeed(context.Context, *GenSeedRequest) (*GenSeedResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GenSeed not implemented")
}
func (UnimplementedWalletServiceServer) CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateWallet not implemented")
}
func (UnimplementedWalletServiceServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Unlock not implemented")
}
func (UnimplementedWalletServiceServer) Lock(context.Context, *LockRequest) (*LockResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Lock not implemented")
}
func (UnimplementedWalletServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
}
func (UnimplementedWalletServiceServer) RestoreWallet(*RestoreWalletRequest, WalletService_RestoreWalletServer) error {
return status.Errorf(codes.Unimplemented, "method RestoreWallet not implemented")
}
func (UnimplementedWalletServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func (UnimplementedWalletServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
}
func (UnimplementedWalletServiceServer) Auth(context.Context, *AuthRequest) (*AuthResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Auth not implemented")
}
// UnsafeWalletServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WalletServiceServer will
// result in compilation errors.
type UnsafeWalletServiceServer interface {
mustEmbedUnimplementedWalletServiceServer()
}
func RegisterWalletServiceServer(s grpc.ServiceRegistrar, srv WalletServiceServer) {
s.RegisterService(&WalletService_ServiceDesc, srv)
}
func _WalletService_GenSeed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GenSeedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).GenSeed(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/GenSeed",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).GenSeed(ctx, req.(*GenSeedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).CreateWallet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/CreateWallet",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).CreateWallet(ctx, req.(*CreateWalletRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_Unlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnlockRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).Unlock(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/Unlock",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).Unlock(ctx, req.(*UnlockRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_Lock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LockRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).Lock(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/Lock",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).Lock(ctx, req.(*LockRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangePasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).ChangePassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/ChangePassword",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_RestoreWallet_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(RestoreWalletRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(WalletServiceServer).RestoreWallet(m, &walletServiceRestoreWalletServer{stream})
}
type WalletService_RestoreWalletServer interface {
Send(*RestoreWalletResponse) error
grpc.ServerStream
}
type walletServiceRestoreWalletServer struct {
grpc.ServerStream
}
func (x *walletServiceRestoreWalletServer) Send(m *RestoreWalletResponse) error {
return x.ServerStream.SendMsg(m)
}
func _WalletService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).Status(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/Status",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).Status(ctx, req.(*StatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).GetInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/GetInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).GetInfo(ctx, req.(*GetInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_Auth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).Auth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ocean.v1.WalletService/Auth",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).Auth(ctx, req.(*AuthRequest))
}
return interceptor(ctx, in, info, handler)
}
// WalletService_ServiceDesc is the grpc.ServiceDesc for WalletService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WalletService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ocean.v1.WalletService",
HandlerType: (*WalletServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GenSeed",
Handler: _WalletService_GenSeed_Handler,
},
{
MethodName: "CreateWallet",
Handler: _WalletService_CreateWallet_Handler,
},
{
MethodName: "Unlock",
Handler: _WalletService_Unlock_Handler,
},
{
MethodName: "Lock",
Handler: _WalletService_Lock_Handler,
},
{
MethodName: "ChangePassword",
Handler: _WalletService_ChangePassword_Handler,
},
{
MethodName: "Status",
Handler: _WalletService_Status_Handler,
},
{
MethodName: "GetInfo",
Handler: _WalletService_GetInfo_Handler,
},
{
MethodName: "Auth",
Handler: _WalletService_Auth_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "RestoreWallet",
Handler: _WalletService_RestoreWallet_Handler,
ServerStreams: true,
},
},
Metadata: "ocean/v1/wallet.proto",
}