-
Notifications
You must be signed in to change notification settings - Fork 107
/
assetwallet_grpc.pb.go
410 lines (382 loc) · 17.8 KB
/
assetwallet_grpc.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package assetwalletrpc
import (
context "context"
taprpc "github.com/lightninglabs/taproot-assets/taprpc"
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
// AssetWalletClient is the client API for AssetWallet 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 AssetWalletClient interface {
// FundVirtualPsbt selects inputs from the available asset commitments to fund
// a virtual transaction matching the template.
FundVirtualPsbt(ctx context.Context, in *FundVirtualPsbtRequest, opts ...grpc.CallOption) (*FundVirtualPsbtResponse, error)
// SignVirtualPsbt signs the inputs of a virtual transaction and prepares the
// commitments of the inputs and outputs.
SignVirtualPsbt(ctx context.Context, in *SignVirtualPsbtRequest, opts ...grpc.CallOption) (*SignVirtualPsbtResponse, error)
// AnchorVirtualPsbts merges and then commits multiple virtual transactions in
// a single BTC level anchor transaction.
//
// TODO(guggero): Actually implement accepting and merging multiple
// transactions.
AnchorVirtualPsbts(ctx context.Context, in *AnchorVirtualPsbtsRequest, opts ...grpc.CallOption) (*taprpc.SendAssetResponse, error)
// NextInternalKey derives the next internal key for the given key family and
// stores it as an internal key in the database to make sure it is identified
// as a local key later on when importing proofs. While an internal key can
// also be used as the internal key of a script key, it is recommended to use
// the NextScriptKey RPC instead, to make sure the tweaked Taproot output key
// is also recognized as a local key.
NextInternalKey(ctx context.Context, in *NextInternalKeyRequest, opts ...grpc.CallOption) (*NextInternalKeyResponse, error)
// NextScriptKey derives the next script key (and its corresponding internal
// key) and stores them both in the database to make sure they are identified
// as local keys later on when importing proofs.
NextScriptKey(ctx context.Context, in *NextScriptKeyRequest, opts ...grpc.CallOption) (*NextScriptKeyResponse, error)
// tapcli: `proofs proveownership`
// ProveAssetOwnership creates an ownership proof embedded in an asset
// transition proof. That ownership proof is a signed virtual transaction
// spending the asset with a valid witness to prove the prover owns the keys
// that can spend the asset.
ProveAssetOwnership(ctx context.Context, in *ProveAssetOwnershipRequest, opts ...grpc.CallOption) (*ProveAssetOwnershipResponse, error)
// tapcli: `proofs verifyownership`
// VerifyAssetOwnership verifies the asset ownership proof embedded in the
// given transition proof of an asset and returns true if the proof is valid.
VerifyAssetOwnership(ctx context.Context, in *VerifyAssetOwnershipRequest, opts ...grpc.CallOption) (*VerifyAssetOwnershipResponse, error)
// RemoveUTXOLease removes the lease/lock/reservation of the given managed
// UTXO.
RemoveUTXOLease(ctx context.Context, in *RemoveUTXOLeaseRequest, opts ...grpc.CallOption) (*RemoveUTXOLeaseResponse, error)
}
type assetWalletClient struct {
cc grpc.ClientConnInterface
}
func NewAssetWalletClient(cc grpc.ClientConnInterface) AssetWalletClient {
return &assetWalletClient{cc}
}
func (c *assetWalletClient) FundVirtualPsbt(ctx context.Context, in *FundVirtualPsbtRequest, opts ...grpc.CallOption) (*FundVirtualPsbtResponse, error) {
out := new(FundVirtualPsbtResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/FundVirtualPsbt", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) SignVirtualPsbt(ctx context.Context, in *SignVirtualPsbtRequest, opts ...grpc.CallOption) (*SignVirtualPsbtResponse, error) {
out := new(SignVirtualPsbtResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/SignVirtualPsbt", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) AnchorVirtualPsbts(ctx context.Context, in *AnchorVirtualPsbtsRequest, opts ...grpc.CallOption) (*taprpc.SendAssetResponse, error) {
out := new(taprpc.SendAssetResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/AnchorVirtualPsbts", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) NextInternalKey(ctx context.Context, in *NextInternalKeyRequest, opts ...grpc.CallOption) (*NextInternalKeyResponse, error) {
out := new(NextInternalKeyResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/NextInternalKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) NextScriptKey(ctx context.Context, in *NextScriptKeyRequest, opts ...grpc.CallOption) (*NextScriptKeyResponse, error) {
out := new(NextScriptKeyResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/NextScriptKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) ProveAssetOwnership(ctx context.Context, in *ProveAssetOwnershipRequest, opts ...grpc.CallOption) (*ProveAssetOwnershipResponse, error) {
out := new(ProveAssetOwnershipResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/ProveAssetOwnership", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) VerifyAssetOwnership(ctx context.Context, in *VerifyAssetOwnershipRequest, opts ...grpc.CallOption) (*VerifyAssetOwnershipResponse, error) {
out := new(VerifyAssetOwnershipResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/VerifyAssetOwnership", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *assetWalletClient) RemoveUTXOLease(ctx context.Context, in *RemoveUTXOLeaseRequest, opts ...grpc.CallOption) (*RemoveUTXOLeaseResponse, error) {
out := new(RemoveUTXOLeaseResponse)
err := c.cc.Invoke(ctx, "/assetwalletrpc.AssetWallet/RemoveUTXOLease", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AssetWalletServer is the server API for AssetWallet service.
// All implementations must embed UnimplementedAssetWalletServer
// for forward compatibility
type AssetWalletServer interface {
// FundVirtualPsbt selects inputs from the available asset commitments to fund
// a virtual transaction matching the template.
FundVirtualPsbt(context.Context, *FundVirtualPsbtRequest) (*FundVirtualPsbtResponse, error)
// SignVirtualPsbt signs the inputs of a virtual transaction and prepares the
// commitments of the inputs and outputs.
SignVirtualPsbt(context.Context, *SignVirtualPsbtRequest) (*SignVirtualPsbtResponse, error)
// AnchorVirtualPsbts merges and then commits multiple virtual transactions in
// a single BTC level anchor transaction.
//
// TODO(guggero): Actually implement accepting and merging multiple
// transactions.
AnchorVirtualPsbts(context.Context, *AnchorVirtualPsbtsRequest) (*taprpc.SendAssetResponse, error)
// NextInternalKey derives the next internal key for the given key family and
// stores it as an internal key in the database to make sure it is identified
// as a local key later on when importing proofs. While an internal key can
// also be used as the internal key of a script key, it is recommended to use
// the NextScriptKey RPC instead, to make sure the tweaked Taproot output key
// is also recognized as a local key.
NextInternalKey(context.Context, *NextInternalKeyRequest) (*NextInternalKeyResponse, error)
// NextScriptKey derives the next script key (and its corresponding internal
// key) and stores them both in the database to make sure they are identified
// as local keys later on when importing proofs.
NextScriptKey(context.Context, *NextScriptKeyRequest) (*NextScriptKeyResponse, error)
// tapcli: `proofs proveownership`
// ProveAssetOwnership creates an ownership proof embedded in an asset
// transition proof. That ownership proof is a signed virtual transaction
// spending the asset with a valid witness to prove the prover owns the keys
// that can spend the asset.
ProveAssetOwnership(context.Context, *ProveAssetOwnershipRequest) (*ProveAssetOwnershipResponse, error)
// tapcli: `proofs verifyownership`
// VerifyAssetOwnership verifies the asset ownership proof embedded in the
// given transition proof of an asset and returns true if the proof is valid.
VerifyAssetOwnership(context.Context, *VerifyAssetOwnershipRequest) (*VerifyAssetOwnershipResponse, error)
// RemoveUTXOLease removes the lease/lock/reservation of the given managed
// UTXO.
RemoveUTXOLease(context.Context, *RemoveUTXOLeaseRequest) (*RemoveUTXOLeaseResponse, error)
mustEmbedUnimplementedAssetWalletServer()
}
// UnimplementedAssetWalletServer must be embedded to have forward compatible implementations.
type UnimplementedAssetWalletServer struct {
}
func (UnimplementedAssetWalletServer) FundVirtualPsbt(context.Context, *FundVirtualPsbtRequest) (*FundVirtualPsbtResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FundVirtualPsbt not implemented")
}
func (UnimplementedAssetWalletServer) SignVirtualPsbt(context.Context, *SignVirtualPsbtRequest) (*SignVirtualPsbtResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignVirtualPsbt not implemented")
}
func (UnimplementedAssetWalletServer) AnchorVirtualPsbts(context.Context, *AnchorVirtualPsbtsRequest) (*taprpc.SendAssetResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AnchorVirtualPsbts not implemented")
}
func (UnimplementedAssetWalletServer) NextInternalKey(context.Context, *NextInternalKeyRequest) (*NextInternalKeyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NextInternalKey not implemented")
}
func (UnimplementedAssetWalletServer) NextScriptKey(context.Context, *NextScriptKeyRequest) (*NextScriptKeyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NextScriptKey not implemented")
}
func (UnimplementedAssetWalletServer) ProveAssetOwnership(context.Context, *ProveAssetOwnershipRequest) (*ProveAssetOwnershipResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProveAssetOwnership not implemented")
}
func (UnimplementedAssetWalletServer) VerifyAssetOwnership(context.Context, *VerifyAssetOwnershipRequest) (*VerifyAssetOwnershipResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyAssetOwnership not implemented")
}
func (UnimplementedAssetWalletServer) RemoveUTXOLease(context.Context, *RemoveUTXOLeaseRequest) (*RemoveUTXOLeaseResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveUTXOLease not implemented")
}
func (UnimplementedAssetWalletServer) mustEmbedUnimplementedAssetWalletServer() {}
// UnsafeAssetWalletServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AssetWalletServer will
// result in compilation errors.
type UnsafeAssetWalletServer interface {
mustEmbedUnimplementedAssetWalletServer()
}
func RegisterAssetWalletServer(s grpc.ServiceRegistrar, srv AssetWalletServer) {
s.RegisterService(&AssetWallet_ServiceDesc, srv)
}
func _AssetWallet_FundVirtualPsbt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FundVirtualPsbtRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).FundVirtualPsbt(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/FundVirtualPsbt",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).FundVirtualPsbt(ctx, req.(*FundVirtualPsbtRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_SignVirtualPsbt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignVirtualPsbtRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).SignVirtualPsbt(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/SignVirtualPsbt",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).SignVirtualPsbt(ctx, req.(*SignVirtualPsbtRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_AnchorVirtualPsbts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AnchorVirtualPsbtsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).AnchorVirtualPsbts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/AnchorVirtualPsbts",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).AnchorVirtualPsbts(ctx, req.(*AnchorVirtualPsbtsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_NextInternalKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NextInternalKeyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).NextInternalKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/NextInternalKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).NextInternalKey(ctx, req.(*NextInternalKeyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_NextScriptKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NextScriptKeyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).NextScriptKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/NextScriptKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).NextScriptKey(ctx, req.(*NextScriptKeyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_ProveAssetOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ProveAssetOwnershipRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).ProveAssetOwnership(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/ProveAssetOwnership",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).ProveAssetOwnership(ctx, req.(*ProveAssetOwnershipRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_VerifyAssetOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyAssetOwnershipRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).VerifyAssetOwnership(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/VerifyAssetOwnership",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).VerifyAssetOwnership(ctx, req.(*VerifyAssetOwnershipRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AssetWallet_RemoveUTXOLease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveUTXOLeaseRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AssetWalletServer).RemoveUTXOLease(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/assetwalletrpc.AssetWallet/RemoveUTXOLease",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AssetWalletServer).RemoveUTXOLease(ctx, req.(*RemoveUTXOLeaseRequest))
}
return interceptor(ctx, in, info, handler)
}
// AssetWallet_ServiceDesc is the grpc.ServiceDesc for AssetWallet service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AssetWallet_ServiceDesc = grpc.ServiceDesc{
ServiceName: "assetwalletrpc.AssetWallet",
HandlerType: (*AssetWalletServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "FundVirtualPsbt",
Handler: _AssetWallet_FundVirtualPsbt_Handler,
},
{
MethodName: "SignVirtualPsbt",
Handler: _AssetWallet_SignVirtualPsbt_Handler,
},
{
MethodName: "AnchorVirtualPsbts",
Handler: _AssetWallet_AnchorVirtualPsbts_Handler,
},
{
MethodName: "NextInternalKey",
Handler: _AssetWallet_NextInternalKey_Handler,
},
{
MethodName: "NextScriptKey",
Handler: _AssetWallet_NextScriptKey_Handler,
},
{
MethodName: "ProveAssetOwnership",
Handler: _AssetWallet_ProveAssetOwnership_Handler,
},
{
MethodName: "VerifyAssetOwnership",
Handler: _AssetWallet_VerifyAssetOwnership_Handler,
},
{
MethodName: "RemoveUTXOLease",
Handler: _AssetWallet_RemoveUTXOLease_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "assetwalletrpc/assetwallet.proto",
}