-
Notifications
You must be signed in to change notification settings - Fork 0
/
chainnotifier.pb.go
1050 lines (939 loc) · 35.1 KB
/
chainnotifier.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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: chainrpc/chainnotifier.proto
package chainrpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ConfRequest struct {
//
// The transaction hash for which we should request a confirmation notification
// for. If set to a hash of all zeros, then the confirmation notification will
// be requested for the script instead.
Txid []byte `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"`
//
// An output script within a transaction with the hash above which will be used
// by light clients to match block filters. If the transaction hash is set to a
// hash of all zeros, then a confirmation notification will be requested for
// this script instead.
Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"`
//
// The number of desired confirmations the transaction/output script should
// reach before dispatching a confirmation notification.
NumConfs uint32 `protobuf:"varint,3,opt,name=num_confs,json=numConfs,proto3" json:"num_confs,omitempty"`
//
// The earliest height in the chain for which the transaction/output script
// could have been included in a block. This should in most cases be set to the
// broadcast height of the transaction/output script.
HeightHint uint32 `protobuf:"varint,4,opt,name=height_hint,json=heightHint,proto3" json:"height_hint,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConfRequest) Reset() { *m = ConfRequest{} }
func (m *ConfRequest) String() string { return proto.CompactTextString(m) }
func (*ConfRequest) ProtoMessage() {}
func (*ConfRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{0}
}
func (m *ConfRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConfRequest.Unmarshal(m, b)
}
func (m *ConfRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConfRequest.Marshal(b, m, deterministic)
}
func (dst *ConfRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConfRequest.Merge(dst, src)
}
func (m *ConfRequest) XXX_Size() int {
return xxx_messageInfo_ConfRequest.Size(m)
}
func (m *ConfRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ConfRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ConfRequest proto.InternalMessageInfo
func (m *ConfRequest) GetTxid() []byte {
if m != nil {
return m.Txid
}
return nil
}
func (m *ConfRequest) GetScript() []byte {
if m != nil {
return m.Script
}
return nil
}
func (m *ConfRequest) GetNumConfs() uint32 {
if m != nil {
return m.NumConfs
}
return 0
}
func (m *ConfRequest) GetHeightHint() uint32 {
if m != nil {
return m.HeightHint
}
return 0
}
type ConfDetails struct {
// The raw bytes of the confirmed transaction.
RawTx []byte `protobuf:"bytes,1,opt,name=raw_tx,json=rawTx,proto3" json:"raw_tx,omitempty"`
// The hash of the block in which the confirmed transaction was included in.
BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
// The height of the block in which the confirmed transaction was included in.
BlockHeight uint32 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
// The index of the confirmed transaction within the transaction.
TxIndex uint32 `protobuf:"varint,4,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConfDetails) Reset() { *m = ConfDetails{} }
func (m *ConfDetails) String() string { return proto.CompactTextString(m) }
func (*ConfDetails) ProtoMessage() {}
func (*ConfDetails) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{1}
}
func (m *ConfDetails) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConfDetails.Unmarshal(m, b)
}
func (m *ConfDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConfDetails.Marshal(b, m, deterministic)
}
func (dst *ConfDetails) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConfDetails.Merge(dst, src)
}
func (m *ConfDetails) XXX_Size() int {
return xxx_messageInfo_ConfDetails.Size(m)
}
func (m *ConfDetails) XXX_DiscardUnknown() {
xxx_messageInfo_ConfDetails.DiscardUnknown(m)
}
var xxx_messageInfo_ConfDetails proto.InternalMessageInfo
func (m *ConfDetails) GetRawTx() []byte {
if m != nil {
return m.RawTx
}
return nil
}
func (m *ConfDetails) GetBlockHash() []byte {
if m != nil {
return m.BlockHash
}
return nil
}
func (m *ConfDetails) GetBlockHeight() uint32 {
if m != nil {
return m.BlockHeight
}
return 0
}
func (m *ConfDetails) GetTxIndex() uint32 {
if m != nil {
return m.TxIndex
}
return 0
}
type Reorg struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Reorg) Reset() { *m = Reorg{} }
func (m *Reorg) String() string { return proto.CompactTextString(m) }
func (*Reorg) ProtoMessage() {}
func (*Reorg) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{2}
}
func (m *Reorg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Reorg.Unmarshal(m, b)
}
func (m *Reorg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Reorg.Marshal(b, m, deterministic)
}
func (dst *Reorg) XXX_Merge(src proto.Message) {
xxx_messageInfo_Reorg.Merge(dst, src)
}
func (m *Reorg) XXX_Size() int {
return xxx_messageInfo_Reorg.Size(m)
}
func (m *Reorg) XXX_DiscardUnknown() {
xxx_messageInfo_Reorg.DiscardUnknown(m)
}
var xxx_messageInfo_Reorg proto.InternalMessageInfo
type ConfEvent struct {
// Types that are valid to be assigned to Event:
// *ConfEvent_Conf
// *ConfEvent_Reorg
Event isConfEvent_Event `protobuf_oneof:"event"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConfEvent) Reset() { *m = ConfEvent{} }
func (m *ConfEvent) String() string { return proto.CompactTextString(m) }
func (*ConfEvent) ProtoMessage() {}
func (*ConfEvent) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{3}
}
func (m *ConfEvent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConfEvent.Unmarshal(m, b)
}
func (m *ConfEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConfEvent.Marshal(b, m, deterministic)
}
func (dst *ConfEvent) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConfEvent.Merge(dst, src)
}
func (m *ConfEvent) XXX_Size() int {
return xxx_messageInfo_ConfEvent.Size(m)
}
func (m *ConfEvent) XXX_DiscardUnknown() {
xxx_messageInfo_ConfEvent.DiscardUnknown(m)
}
var xxx_messageInfo_ConfEvent proto.InternalMessageInfo
type isConfEvent_Event interface {
isConfEvent_Event()
}
type ConfEvent_Conf struct {
Conf *ConfDetails `protobuf:"bytes,1,opt,name=conf,proto3,oneof"`
}
type ConfEvent_Reorg struct {
Reorg *Reorg `protobuf:"bytes,2,opt,name=reorg,proto3,oneof"`
}
func (*ConfEvent_Conf) isConfEvent_Event() {}
func (*ConfEvent_Reorg) isConfEvent_Event() {}
func (m *ConfEvent) GetEvent() isConfEvent_Event {
if m != nil {
return m.Event
}
return nil
}
func (m *ConfEvent) GetConf() *ConfDetails {
if x, ok := m.GetEvent().(*ConfEvent_Conf); ok {
return x.Conf
}
return nil
}
func (m *ConfEvent) GetReorg() *Reorg {
if x, ok := m.GetEvent().(*ConfEvent_Reorg); ok {
return x.Reorg
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*ConfEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _ConfEvent_OneofMarshaler, _ConfEvent_OneofUnmarshaler, _ConfEvent_OneofSizer, []interface{}{
(*ConfEvent_Conf)(nil),
(*ConfEvent_Reorg)(nil),
}
}
func _ConfEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*ConfEvent)
// event
switch x := m.Event.(type) {
case *ConfEvent_Conf:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Conf); err != nil {
return err
}
case *ConfEvent_Reorg:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Reorg); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("ConfEvent.Event has unexpected type %T", x)
}
return nil
}
func _ConfEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*ConfEvent)
switch tag {
case 1: // event.conf
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ConfDetails)
err := b.DecodeMessage(msg)
m.Event = &ConfEvent_Conf{msg}
return true, err
case 2: // event.reorg
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(Reorg)
err := b.DecodeMessage(msg)
m.Event = &ConfEvent_Reorg{msg}
return true, err
default:
return false, nil
}
}
func _ConfEvent_OneofSizer(msg proto.Message) (n int) {
m := msg.(*ConfEvent)
// event
switch x := m.Event.(type) {
case *ConfEvent_Conf:
s := proto.Size(x.Conf)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *ConfEvent_Reorg:
s := proto.Size(x.Reorg)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type Outpoint struct {
// The hash of the transaction.
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
// The index of the output within the transaction.
Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Outpoint) Reset() { *m = Outpoint{} }
func (m *Outpoint) String() string { return proto.CompactTextString(m) }
func (*Outpoint) ProtoMessage() {}
func (*Outpoint) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{4}
}
func (m *Outpoint) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Outpoint.Unmarshal(m, b)
}
func (m *Outpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Outpoint.Marshal(b, m, deterministic)
}
func (dst *Outpoint) XXX_Merge(src proto.Message) {
xxx_messageInfo_Outpoint.Merge(dst, src)
}
func (m *Outpoint) XXX_Size() int {
return xxx_messageInfo_Outpoint.Size(m)
}
func (m *Outpoint) XXX_DiscardUnknown() {
xxx_messageInfo_Outpoint.DiscardUnknown(m)
}
var xxx_messageInfo_Outpoint proto.InternalMessageInfo
func (m *Outpoint) GetHash() []byte {
if m != nil {
return m.Hash
}
return nil
}
func (m *Outpoint) GetIndex() uint32 {
if m != nil {
return m.Index
}
return 0
}
type SpendRequest struct {
//
// The outpoint for which we should request a spend notification for. If set to
// a zero outpoint, then the spend notification will be requested for the
// script instead.
Outpoint *Outpoint `protobuf:"bytes,1,opt,name=outpoint,proto3" json:"outpoint,omitempty"`
//
// The output script for the outpoint above. This will be used by light clients
// to match block filters. If the outpoint is set to a zero outpoint, then a
// spend notification will be requested for this script instead.
Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"`
//
// The earliest height in the chain for which the outpoint/output script could
// have been spent. This should in most cases be set to the broadcast height of
// the outpoint/output script.
HeightHint uint32 `protobuf:"varint,3,opt,name=height_hint,json=heightHint,proto3" json:"height_hint,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SpendRequest) Reset() { *m = SpendRequest{} }
func (m *SpendRequest) String() string { return proto.CompactTextString(m) }
func (*SpendRequest) ProtoMessage() {}
func (*SpendRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{5}
}
func (m *SpendRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SpendRequest.Unmarshal(m, b)
}
func (m *SpendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SpendRequest.Marshal(b, m, deterministic)
}
func (dst *SpendRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SpendRequest.Merge(dst, src)
}
func (m *SpendRequest) XXX_Size() int {
return xxx_messageInfo_SpendRequest.Size(m)
}
func (m *SpendRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SpendRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SpendRequest proto.InternalMessageInfo
func (m *SpendRequest) GetOutpoint() *Outpoint {
if m != nil {
return m.Outpoint
}
return nil
}
func (m *SpendRequest) GetScript() []byte {
if m != nil {
return m.Script
}
return nil
}
func (m *SpendRequest) GetHeightHint() uint32 {
if m != nil {
return m.HeightHint
}
return 0
}
type SpendDetails struct {
// The outpoint was that spent.
SpendingOutpoint *Outpoint `protobuf:"bytes,1,opt,name=spending_outpoint,json=spendingOutpoint,proto3" json:"spending_outpoint,omitempty"`
// The raw bytes of the spending transaction.
RawSpendingTx []byte `protobuf:"bytes,2,opt,name=raw_spending_tx,json=rawSpendingTx,proto3" json:"raw_spending_tx,omitempty"`
// The hash of the spending transaction.
SpendingTxHash []byte `protobuf:"bytes,3,opt,name=spending_tx_hash,json=spendingTxHash,proto3" json:"spending_tx_hash,omitempty"`
// The input of the spending transaction that fulfilled the spend request.
SpendingInputIndex uint32 `protobuf:"varint,4,opt,name=spending_input_index,json=spendingInputIndex,proto3" json:"spending_input_index,omitempty"`
// The height at which the spending transaction was included in a block.
SpendingHeight uint32 `protobuf:"varint,5,opt,name=spending_height,json=spendingHeight,proto3" json:"spending_height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SpendDetails) Reset() { *m = SpendDetails{} }
func (m *SpendDetails) String() string { return proto.CompactTextString(m) }
func (*SpendDetails) ProtoMessage() {}
func (*SpendDetails) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{6}
}
func (m *SpendDetails) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SpendDetails.Unmarshal(m, b)
}
func (m *SpendDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SpendDetails.Marshal(b, m, deterministic)
}
func (dst *SpendDetails) XXX_Merge(src proto.Message) {
xxx_messageInfo_SpendDetails.Merge(dst, src)
}
func (m *SpendDetails) XXX_Size() int {
return xxx_messageInfo_SpendDetails.Size(m)
}
func (m *SpendDetails) XXX_DiscardUnknown() {
xxx_messageInfo_SpendDetails.DiscardUnknown(m)
}
var xxx_messageInfo_SpendDetails proto.InternalMessageInfo
func (m *SpendDetails) GetSpendingOutpoint() *Outpoint {
if m != nil {
return m.SpendingOutpoint
}
return nil
}
func (m *SpendDetails) GetRawSpendingTx() []byte {
if m != nil {
return m.RawSpendingTx
}
return nil
}
func (m *SpendDetails) GetSpendingTxHash() []byte {
if m != nil {
return m.SpendingTxHash
}
return nil
}
func (m *SpendDetails) GetSpendingInputIndex() uint32 {
if m != nil {
return m.SpendingInputIndex
}
return 0
}
func (m *SpendDetails) GetSpendingHeight() uint32 {
if m != nil {
return m.SpendingHeight
}
return 0
}
type SpendEvent struct {
// Types that are valid to be assigned to Event:
// *SpendEvent_Spend
// *SpendEvent_Reorg
Event isSpendEvent_Event `protobuf_oneof:"event"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SpendEvent) Reset() { *m = SpendEvent{} }
func (m *SpendEvent) String() string { return proto.CompactTextString(m) }
func (*SpendEvent) ProtoMessage() {}
func (*SpendEvent) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{7}
}
func (m *SpendEvent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SpendEvent.Unmarshal(m, b)
}
func (m *SpendEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SpendEvent.Marshal(b, m, deterministic)
}
func (dst *SpendEvent) XXX_Merge(src proto.Message) {
xxx_messageInfo_SpendEvent.Merge(dst, src)
}
func (m *SpendEvent) XXX_Size() int {
return xxx_messageInfo_SpendEvent.Size(m)
}
func (m *SpendEvent) XXX_DiscardUnknown() {
xxx_messageInfo_SpendEvent.DiscardUnknown(m)
}
var xxx_messageInfo_SpendEvent proto.InternalMessageInfo
type isSpendEvent_Event interface {
isSpendEvent_Event()
}
type SpendEvent_Spend struct {
Spend *SpendDetails `protobuf:"bytes,1,opt,name=spend,proto3,oneof"`
}
type SpendEvent_Reorg struct {
Reorg *Reorg `protobuf:"bytes,2,opt,name=reorg,proto3,oneof"`
}
func (*SpendEvent_Spend) isSpendEvent_Event() {}
func (*SpendEvent_Reorg) isSpendEvent_Event() {}
func (m *SpendEvent) GetEvent() isSpendEvent_Event {
if m != nil {
return m.Event
}
return nil
}
func (m *SpendEvent) GetSpend() *SpendDetails {
if x, ok := m.GetEvent().(*SpendEvent_Spend); ok {
return x.Spend
}
return nil
}
func (m *SpendEvent) GetReorg() *Reorg {
if x, ok := m.GetEvent().(*SpendEvent_Reorg); ok {
return x.Reorg
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*SpendEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _SpendEvent_OneofMarshaler, _SpendEvent_OneofUnmarshaler, _SpendEvent_OneofSizer, []interface{}{
(*SpendEvent_Spend)(nil),
(*SpendEvent_Reorg)(nil),
}
}
func _SpendEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*SpendEvent)
// event
switch x := m.Event.(type) {
case *SpendEvent_Spend:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Spend); err != nil {
return err
}
case *SpendEvent_Reorg:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Reorg); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("SpendEvent.Event has unexpected type %T", x)
}
return nil
}
func _SpendEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*SpendEvent)
switch tag {
case 1: // event.spend
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(SpendDetails)
err := b.DecodeMessage(msg)
m.Event = &SpendEvent_Spend{msg}
return true, err
case 2: // event.reorg
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(Reorg)
err := b.DecodeMessage(msg)
m.Event = &SpendEvent_Reorg{msg}
return true, err
default:
return false, nil
}
}
func _SpendEvent_OneofSizer(msg proto.Message) (n int) {
m := msg.(*SpendEvent)
// event
switch x := m.Event.(type) {
case *SpendEvent_Spend:
s := proto.Size(x.Spend)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *SpendEvent_Reorg:
s := proto.Size(x.Reorg)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type BlockEpoch struct {
// The hash of the block.
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
// The height of the block.
Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BlockEpoch) Reset() { *m = BlockEpoch{} }
func (m *BlockEpoch) String() string { return proto.CompactTextString(m) }
func (*BlockEpoch) ProtoMessage() {}
func (*BlockEpoch) Descriptor() ([]byte, []int) {
return fileDescriptor_chainnotifier_7f5a7ad17988064c, []int{8}
}
func (m *BlockEpoch) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BlockEpoch.Unmarshal(m, b)
}
func (m *BlockEpoch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BlockEpoch.Marshal(b, m, deterministic)
}
func (dst *BlockEpoch) XXX_Merge(src proto.Message) {
xxx_messageInfo_BlockEpoch.Merge(dst, src)
}
func (m *BlockEpoch) XXX_Size() int {
return xxx_messageInfo_BlockEpoch.Size(m)
}
func (m *BlockEpoch) XXX_DiscardUnknown() {
xxx_messageInfo_BlockEpoch.DiscardUnknown(m)
}
var xxx_messageInfo_BlockEpoch proto.InternalMessageInfo
func (m *BlockEpoch) GetHash() []byte {
if m != nil {
return m.Hash
}
return nil
}
func (m *BlockEpoch) GetHeight() uint32 {
if m != nil {
return m.Height
}
return 0
}
func init() {
proto.RegisterType((*ConfRequest)(nil), "chainrpc.ConfRequest")
proto.RegisterType((*ConfDetails)(nil), "chainrpc.ConfDetails")
proto.RegisterType((*Reorg)(nil), "chainrpc.Reorg")
proto.RegisterType((*ConfEvent)(nil), "chainrpc.ConfEvent")
proto.RegisterType((*Outpoint)(nil), "chainrpc.Outpoint")
proto.RegisterType((*SpendRequest)(nil), "chainrpc.SpendRequest")
proto.RegisterType((*SpendDetails)(nil), "chainrpc.SpendDetails")
proto.RegisterType((*SpendEvent)(nil), "chainrpc.SpendEvent")
proto.RegisterType((*BlockEpoch)(nil), "chainrpc.BlockEpoch")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// ChainNotifierClient is the client API for ChainNotifier service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ChainNotifierClient interface {
//
// RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
// registers an intent for a client to be notified once a confirmation request
// has reached its required number of confirmations on-chain.
//
// A client can specify whether the confirmation request should be for a
// particular transaction by its hash or for an output script by specifying a
// zero hash.
RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error)
//
// RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
// intent for a client to be notification once a spend request has been spent
// by a transaction that has confirmed on-chain.
//
// A client can specify whether the spend request should be for a particular
// outpoint or for an output script by specifying a zero outpoint.
RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error)
//
// RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
// registers an intent for a client to be notified of blocks in the chain. The
// stream will return a hash and height tuple of a block for each new/stale
// block in the chain. It is the client's responsibility to determine whether
// the tuple returned is for a new or stale block in the chain.
//
// A client can also request a historical backlog of blocks from a particular
// point. This allows clients to be idempotent by ensuring that they do not
// missing processing a single block within the chain.
RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error)
}
type chainNotifierClient struct {
cc *grpc.ClientConn
}
func NewChainNotifierClient(cc *grpc.ClientConn) ChainNotifierClient {
return &chainNotifierClient{cc}
}
func (c *chainNotifierClient) RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error) {
stream, err := c.cc.NewStream(ctx, &_ChainNotifier_serviceDesc.Streams[0], "/chainrpc.ChainNotifier/RegisterConfirmationsNtfn", opts...)
if err != nil {
return nil, err
}
x := &chainNotifierRegisterConfirmationsNtfnClient{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 ChainNotifier_RegisterConfirmationsNtfnClient interface {
Recv() (*ConfEvent, error)
grpc.ClientStream
}
type chainNotifierRegisterConfirmationsNtfnClient struct {
grpc.ClientStream
}
func (x *chainNotifierRegisterConfirmationsNtfnClient) Recv() (*ConfEvent, error) {
m := new(ConfEvent)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *chainNotifierClient) RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error) {
stream, err := c.cc.NewStream(ctx, &_ChainNotifier_serviceDesc.Streams[1], "/chainrpc.ChainNotifier/RegisterSpendNtfn", opts...)
if err != nil {
return nil, err
}
x := &chainNotifierRegisterSpendNtfnClient{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 ChainNotifier_RegisterSpendNtfnClient interface {
Recv() (*SpendEvent, error)
grpc.ClientStream
}
type chainNotifierRegisterSpendNtfnClient struct {
grpc.ClientStream
}
func (x *chainNotifierRegisterSpendNtfnClient) Recv() (*SpendEvent, error) {
m := new(SpendEvent)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *chainNotifierClient) RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error) {
stream, err := c.cc.NewStream(ctx, &_ChainNotifier_serviceDesc.Streams[2], "/chainrpc.ChainNotifier/RegisterBlockEpochNtfn", opts...)
if err != nil {
return nil, err
}
x := &chainNotifierRegisterBlockEpochNtfnClient{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 ChainNotifier_RegisterBlockEpochNtfnClient interface {
Recv() (*BlockEpoch, error)
grpc.ClientStream
}
type chainNotifierRegisterBlockEpochNtfnClient struct {
grpc.ClientStream
}
func (x *chainNotifierRegisterBlockEpochNtfnClient) Recv() (*BlockEpoch, error) {
m := new(BlockEpoch)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ChainNotifierServer is the server API for ChainNotifier service.
type ChainNotifierServer interface {
//
// RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
// registers an intent for a client to be notified once a confirmation request
// has reached its required number of confirmations on-chain.
//
// A client can specify whether the confirmation request should be for a
// particular transaction by its hash or for an output script by specifying a
// zero hash.
RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error
//
// RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
// intent for a client to be notification once a spend request has been spent
// by a transaction that has confirmed on-chain.
//
// A client can specify whether the spend request should be for a particular
// outpoint or for an output script by specifying a zero outpoint.
RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error
//
// RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
// registers an intent for a client to be notified of blocks in the chain. The
// stream will return a hash and height tuple of a block for each new/stale
// block in the chain. It is the client's responsibility to determine whether
// the tuple returned is for a new or stale block in the chain.
//
// A client can also request a historical backlog of blocks from a particular
// point. This allows clients to be idempotent by ensuring that they do not
// missing processing a single block within the chain.
RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error
}
func RegisterChainNotifierServer(s *grpc.Server, srv ChainNotifierServer) {
s.RegisterService(&_ChainNotifier_serviceDesc, srv)
}
func _ChainNotifier_RegisterConfirmationsNtfn_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ConfRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ChainNotifierServer).RegisterConfirmationsNtfn(m, &chainNotifierRegisterConfirmationsNtfnServer{stream})
}
type ChainNotifier_RegisterConfirmationsNtfnServer interface {
Send(*ConfEvent) error
grpc.ServerStream
}
type chainNotifierRegisterConfirmationsNtfnServer struct {
grpc.ServerStream
}
func (x *chainNotifierRegisterConfirmationsNtfnServer) Send(m *ConfEvent) error {
return x.ServerStream.SendMsg(m)
}
func _ChainNotifier_RegisterSpendNtfn_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SpendRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ChainNotifierServer).RegisterSpendNtfn(m, &chainNotifierRegisterSpendNtfnServer{stream})
}
type ChainNotifier_RegisterSpendNtfnServer interface {
Send(*SpendEvent) error
grpc.ServerStream
}
type chainNotifierRegisterSpendNtfnServer struct {
grpc.ServerStream
}
func (x *chainNotifierRegisterSpendNtfnServer) Send(m *SpendEvent) error {
return x.ServerStream.SendMsg(m)
}
func _ChainNotifier_RegisterBlockEpochNtfn_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(BlockEpoch)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ChainNotifierServer).RegisterBlockEpochNtfn(m, &chainNotifierRegisterBlockEpochNtfnServer{stream})
}
type ChainNotifier_RegisterBlockEpochNtfnServer interface {
Send(*BlockEpoch) error
grpc.ServerStream
}
type chainNotifierRegisterBlockEpochNtfnServer struct {
grpc.ServerStream
}
func (x *chainNotifierRegisterBlockEpochNtfnServer) Send(m *BlockEpoch) error {
return x.ServerStream.SendMsg(m)
}
var _ChainNotifier_serviceDesc = grpc.ServiceDesc{
ServiceName: "chainrpc.ChainNotifier",
HandlerType: (*ChainNotifierServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "RegisterConfirmationsNtfn",
Handler: _ChainNotifier_RegisterConfirmationsNtfn_Handler,
ServerStreams: true,
},
{
StreamName: "RegisterSpendNtfn",
Handler: _ChainNotifier_RegisterSpendNtfn_Handler,
ServerStreams: true,
},
{
StreamName: "RegisterBlockEpochNtfn",