@libp2p/floodsub 11.0.25 → 11.0.26-02fcf704d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +4 -4
- package/dist/src/decodeRpc.d.ts +22 -0
- package/dist/src/decodeRpc.d.ts.map +1 -0
- package/dist/src/decodeRpc.js +15 -0
- package/dist/src/decodeRpc.js.map +1 -0
- package/dist/src/floodsub.d.ts +1 -0
- package/dist/src/floodsub.d.ts.map +1 -1
- package/dist/src/floodsub.js +17 -7
- package/dist/src/floodsub.js.map +1 -1
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/message/rpc.d.ts +1 -187
- package/dist/src/message/rpc.d.ts.map +1 -1
- package/dist/src/message/rpc.js +0 -650
- package/dist/src/message/rpc.js.map +1 -1
- package/dist/src/peer-streams.d.ts +2 -1
- package/dist/src/peer-streams.d.ts.map +1 -1
- package/dist/src/peer-streams.js +7 -2
- package/dist/src/peer-streams.js.map +1 -1
- package/dist/src/sign.d.ts.map +1 -1
- package/dist/src/sign.js +7 -3
- package/dist/src/sign.js.map +1 -1
- package/package.json +10 -10
- package/src/decodeRpc.ts +33 -0
- package/src/floodsub.ts +19 -7
- package/src/index.ts +8 -0
- package/src/message/rpc.proto +3 -32
- package/src/message/rpc.ts +1 -934
- package/src/peer-streams.ts +8 -2
- package/src/sign.ts +8 -4
- package/dist/typedoc-urls.json +0 -41
package/src/message/rpc.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { Uint8ArrayList } from 'uint8arraylist'
|
|
|
5
5
|
export interface RPC {
|
|
6
6
|
subscriptions: RPC.SubOpts[]
|
|
7
7
|
messages: RPC.Message[]
|
|
8
|
-
control?: ControlMessage
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export namespace RPC {
|
|
@@ -338,11 +337,6 @@ export namespace RPC {
|
|
|
338
337
|
}
|
|
339
338
|
}
|
|
340
339
|
|
|
341
|
-
if (obj.control != null) {
|
|
342
|
-
w.uint32(26)
|
|
343
|
-
ControlMessage.codec().encode(obj.control, w)
|
|
344
|
-
}
|
|
345
|
-
|
|
346
340
|
if (opts.lengthDelimited !== false) {
|
|
347
341
|
w.ldelim()
|
|
348
342
|
}
|
|
@@ -378,12 +372,6 @@ export namespace RPC {
|
|
|
378
372
|
}))
|
|
379
373
|
break
|
|
380
374
|
}
|
|
381
|
-
case 3: {
|
|
382
|
-
obj.control = ControlMessage.codec().decode(reader, reader.uint32(), {
|
|
383
|
-
limits: opts.limits?.control
|
|
384
|
-
})
|
|
385
|
-
break
|
|
386
|
-
}
|
|
387
375
|
default: {
|
|
388
376
|
reader.skipType(tag & 7)
|
|
389
377
|
break
|
|
@@ -440,13 +428,6 @@ export namespace RPC {
|
|
|
440
428
|
|
|
441
429
|
break
|
|
442
430
|
}
|
|
443
|
-
case 3: {
|
|
444
|
-
yield * ControlMessage.codec().stream(reader, reader.uint32(), `${prefix}.control`, {
|
|
445
|
-
limits: opts.limits?.control
|
|
446
|
-
})
|
|
447
|
-
|
|
448
|
-
break
|
|
449
|
-
}
|
|
450
431
|
default: {
|
|
451
432
|
reader.skipType(tag & 7)
|
|
452
433
|
break
|
|
@@ -507,54 +488,6 @@ export namespace RPC {
|
|
|
507
488
|
index: number
|
|
508
489
|
}
|
|
509
490
|
|
|
510
|
-
export interface RPCControlIhaveTopicFieldEvent {
|
|
511
|
-
field: '$.control.ihave[].topic'
|
|
512
|
-
value: string
|
|
513
|
-
index: number
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export interface RPCControlIhaveMessageIDsFieldEvent {
|
|
517
|
-
field: '$.control.ihave[].messageIDs[]'
|
|
518
|
-
index: number
|
|
519
|
-
value: Uint8Array
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
export interface RPCControlIwantMessageIDsFieldEvent {
|
|
523
|
-
field: '$.control.iwant[].messageIDs[]'
|
|
524
|
-
index: number
|
|
525
|
-
value: Uint8Array
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
export interface RPCControlGraftTopicFieldEvent {
|
|
529
|
-
field: '$.control.graft[].topic'
|
|
530
|
-
value: string
|
|
531
|
-
index: number
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
export interface RPCControlPruneTopicFieldEvent {
|
|
535
|
-
field: '$.control.prune[].topic'
|
|
536
|
-
value: string
|
|
537
|
-
index: number
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
export interface RPCControlPrunePeersPeerIDFieldEvent {
|
|
541
|
-
field: '$.control.prune[].peers[].peerID'
|
|
542
|
-
value: Uint8Array
|
|
543
|
-
index: number
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
export interface RPCControlPrunePeersSignedPeerRecordFieldEvent {
|
|
547
|
-
field: '$.control.prune[].peers[].signedPeerRecord'
|
|
548
|
-
value: Uint8Array
|
|
549
|
-
index: number
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
export interface RPCControlPruneBackoffFieldEvent {
|
|
553
|
-
field: '$.control.prune[].backoff'
|
|
554
|
-
value: bigint
|
|
555
|
-
index: number
|
|
556
|
-
}
|
|
557
|
-
|
|
558
491
|
export function encode (obj: Partial<RPC>): Uint8Array {
|
|
559
492
|
return encodeMessage(obj, RPC.codec())
|
|
560
493
|
}
|
|
@@ -563,873 +496,7 @@ export namespace RPC {
|
|
|
563
496
|
return decodeMessage(buf, RPC.codec(), opts)
|
|
564
497
|
}
|
|
565
498
|
|
|
566
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<RPC>): Generator<RPCSubscriptionsSubscribeFieldEvent | RPCSubscriptionsTopicFieldEvent | RPCMessagesFromFieldEvent | RPCMessagesDataFieldEvent | RPCMessagesSequenceNumberFieldEvent | RPCMessagesTopicFieldEvent | RPCMessagesSignatureFieldEvent | RPCMessagesKeyFieldEvent
|
|
499
|
+
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<RPC>): Generator<RPCSubscriptionsSubscribeFieldEvent | RPCSubscriptionsTopicFieldEvent | RPCMessagesFromFieldEvent | RPCMessagesDataFieldEvent | RPCMessagesSequenceNumberFieldEvent | RPCMessagesTopicFieldEvent | RPCMessagesSignatureFieldEvent | RPCMessagesKeyFieldEvent> {
|
|
567
500
|
return streamMessage(buf, RPC.codec(), opts)
|
|
568
501
|
}
|
|
569
502
|
}
|
|
570
|
-
|
|
571
|
-
export interface ControlMessage {
|
|
572
|
-
ihave: ControlIHave[]
|
|
573
|
-
iwant: ControlIWant[]
|
|
574
|
-
graft: ControlGraft[]
|
|
575
|
-
prune: ControlPrune[]
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
export namespace ControlMessage {
|
|
579
|
-
let _codec: Codec<ControlMessage>
|
|
580
|
-
|
|
581
|
-
export const codec = (): Codec<ControlMessage> => {
|
|
582
|
-
if (_codec == null) {
|
|
583
|
-
_codec = message<ControlMessage>((obj, w, opts = {}) => {
|
|
584
|
-
if (opts.lengthDelimited !== false) {
|
|
585
|
-
w.fork()
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
if (obj.ihave != null && obj.ihave.length > 0) {
|
|
589
|
-
for (const value of obj.ihave) {
|
|
590
|
-
w.uint32(10)
|
|
591
|
-
ControlIHave.codec().encode(value, w)
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
if (obj.iwant != null && obj.iwant.length > 0) {
|
|
596
|
-
for (const value of obj.iwant) {
|
|
597
|
-
w.uint32(18)
|
|
598
|
-
ControlIWant.codec().encode(value, w)
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
if (obj.graft != null && obj.graft.length > 0) {
|
|
603
|
-
for (const value of obj.graft) {
|
|
604
|
-
w.uint32(26)
|
|
605
|
-
ControlGraft.codec().encode(value, w)
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
if (obj.prune != null && obj.prune.length > 0) {
|
|
610
|
-
for (const value of obj.prune) {
|
|
611
|
-
w.uint32(34)
|
|
612
|
-
ControlPrune.codec().encode(value, w)
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
if (opts.lengthDelimited !== false) {
|
|
617
|
-
w.ldelim()
|
|
618
|
-
}
|
|
619
|
-
}, (reader, length, opts = {}) => {
|
|
620
|
-
const obj: any = {
|
|
621
|
-
ihave: [],
|
|
622
|
-
iwant: [],
|
|
623
|
-
graft: [],
|
|
624
|
-
prune: []
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
628
|
-
|
|
629
|
-
while (reader.pos < end) {
|
|
630
|
-
const tag = reader.uint32()
|
|
631
|
-
|
|
632
|
-
switch (tag >>> 3) {
|
|
633
|
-
case 1: {
|
|
634
|
-
if (opts.limits?.ihave != null && obj.ihave.length === opts.limits.ihave) {
|
|
635
|
-
throw new MaxLengthError('Decode error - repeated field "ihave" had too many elements')
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
obj.ihave.push(ControlIHave.codec().decode(reader, reader.uint32(), {
|
|
639
|
-
limits: opts.limits?.ihave$
|
|
640
|
-
}))
|
|
641
|
-
break
|
|
642
|
-
}
|
|
643
|
-
case 2: {
|
|
644
|
-
if (opts.limits?.iwant != null && obj.iwant.length === opts.limits.iwant) {
|
|
645
|
-
throw new MaxLengthError('Decode error - repeated field "iwant" had too many elements')
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
obj.iwant.push(ControlIWant.codec().decode(reader, reader.uint32(), {
|
|
649
|
-
limits: opts.limits?.iwant$
|
|
650
|
-
}))
|
|
651
|
-
break
|
|
652
|
-
}
|
|
653
|
-
case 3: {
|
|
654
|
-
if (opts.limits?.graft != null && obj.graft.length === opts.limits.graft) {
|
|
655
|
-
throw new MaxLengthError('Decode error - repeated field "graft" had too many elements')
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
obj.graft.push(ControlGraft.codec().decode(reader, reader.uint32(), {
|
|
659
|
-
limits: opts.limits?.graft$
|
|
660
|
-
}))
|
|
661
|
-
break
|
|
662
|
-
}
|
|
663
|
-
case 4: {
|
|
664
|
-
if (opts.limits?.prune != null && obj.prune.length === opts.limits.prune) {
|
|
665
|
-
throw new MaxLengthError('Decode error - repeated field "prune" had too many elements')
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
obj.prune.push(ControlPrune.codec().decode(reader, reader.uint32(), {
|
|
669
|
-
limits: opts.limits?.prune$
|
|
670
|
-
}))
|
|
671
|
-
break
|
|
672
|
-
}
|
|
673
|
-
default: {
|
|
674
|
-
reader.skipType(tag & 7)
|
|
675
|
-
break
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
return obj
|
|
681
|
-
}, function * (reader, length, prefix, opts = {}) {
|
|
682
|
-
const obj = {
|
|
683
|
-
ihave: 0,
|
|
684
|
-
iwant: 0,
|
|
685
|
-
graft: 0,
|
|
686
|
-
prune: 0
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
690
|
-
|
|
691
|
-
while (reader.pos < end) {
|
|
692
|
-
const tag = reader.uint32()
|
|
693
|
-
|
|
694
|
-
switch (tag >>> 3) {
|
|
695
|
-
case 1: {
|
|
696
|
-
if (opts.limits?.ihave != null && obj.ihave === opts.limits.ihave) {
|
|
697
|
-
throw new MaxLengthError('Streaming decode error - repeated field "ihave" had too many elements')
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
for (const evt of ControlIHave.codec().stream(reader, reader.uint32(), `${prefix}.ihave[]`, {
|
|
701
|
-
limits: opts.limits?.ihave$
|
|
702
|
-
})) {
|
|
703
|
-
yield {
|
|
704
|
-
...evt,
|
|
705
|
-
index: obj.ihave
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
obj.ihave++
|
|
710
|
-
|
|
711
|
-
break
|
|
712
|
-
}
|
|
713
|
-
case 2: {
|
|
714
|
-
if (opts.limits?.iwant != null && obj.iwant === opts.limits.iwant) {
|
|
715
|
-
throw new MaxLengthError('Streaming decode error - repeated field "iwant" had too many elements')
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
for (const evt of ControlIWant.codec().stream(reader, reader.uint32(), `${prefix}.iwant[]`, {
|
|
719
|
-
limits: opts.limits?.iwant$
|
|
720
|
-
})) {
|
|
721
|
-
yield {
|
|
722
|
-
...evt,
|
|
723
|
-
index: obj.iwant
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
obj.iwant++
|
|
728
|
-
|
|
729
|
-
break
|
|
730
|
-
}
|
|
731
|
-
case 3: {
|
|
732
|
-
if (opts.limits?.graft != null && obj.graft === opts.limits.graft) {
|
|
733
|
-
throw new MaxLengthError('Streaming decode error - repeated field "graft" had too many elements')
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
for (const evt of ControlGraft.codec().stream(reader, reader.uint32(), `${prefix}.graft[]`, {
|
|
737
|
-
limits: opts.limits?.graft$
|
|
738
|
-
})) {
|
|
739
|
-
yield {
|
|
740
|
-
...evt,
|
|
741
|
-
index: obj.graft
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
obj.graft++
|
|
746
|
-
|
|
747
|
-
break
|
|
748
|
-
}
|
|
749
|
-
case 4: {
|
|
750
|
-
if (opts.limits?.prune != null && obj.prune === opts.limits.prune) {
|
|
751
|
-
throw new MaxLengthError('Streaming decode error - repeated field "prune" had too many elements')
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
for (const evt of ControlPrune.codec().stream(reader, reader.uint32(), `${prefix}.prune[]`, {
|
|
755
|
-
limits: opts.limits?.prune$
|
|
756
|
-
})) {
|
|
757
|
-
yield {
|
|
758
|
-
...evt,
|
|
759
|
-
index: obj.prune
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
obj.prune++
|
|
764
|
-
|
|
765
|
-
break
|
|
766
|
-
}
|
|
767
|
-
default: {
|
|
768
|
-
reader.skipType(tag & 7)
|
|
769
|
-
break
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
})
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
return _codec
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
export interface ControlMessageIhaveTopicFieldEvent {
|
|
780
|
-
field: '$.ihave[].topic'
|
|
781
|
-
value: string
|
|
782
|
-
index: number
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
export interface ControlMessageIhaveMessageIDsFieldEvent {
|
|
786
|
-
field: '$.ihave[].messageIDs[]'
|
|
787
|
-
index: number
|
|
788
|
-
value: Uint8Array
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
export interface ControlMessageIwantMessageIDsFieldEvent {
|
|
792
|
-
field: '$.iwant[].messageIDs[]'
|
|
793
|
-
index: number
|
|
794
|
-
value: Uint8Array
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
export interface ControlMessageGraftTopicFieldEvent {
|
|
798
|
-
field: '$.graft[].topic'
|
|
799
|
-
value: string
|
|
800
|
-
index: number
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
export interface ControlMessagePruneTopicFieldEvent {
|
|
804
|
-
field: '$.prune[].topic'
|
|
805
|
-
value: string
|
|
806
|
-
index: number
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
export interface ControlMessagePrunePeersPeerIDFieldEvent {
|
|
810
|
-
field: '$.prune[].peers[].peerID'
|
|
811
|
-
value: Uint8Array
|
|
812
|
-
index: number
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
export interface ControlMessagePrunePeersSignedPeerRecordFieldEvent {
|
|
816
|
-
field: '$.prune[].peers[].signedPeerRecord'
|
|
817
|
-
value: Uint8Array
|
|
818
|
-
index: number
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
export interface ControlMessagePruneBackoffFieldEvent {
|
|
822
|
-
field: '$.prune[].backoff'
|
|
823
|
-
value: bigint
|
|
824
|
-
index: number
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
export function encode (obj: Partial<ControlMessage>): Uint8Array {
|
|
828
|
-
return encodeMessage(obj, ControlMessage.codec())
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
export function decode (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlMessage>): ControlMessage {
|
|
832
|
-
return decodeMessage(buf, ControlMessage.codec(), opts)
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlMessage>): Generator<ControlMessageIhaveTopicFieldEvent | ControlMessageIhaveMessageIDsFieldEvent | ControlMessageIwantMessageIDsFieldEvent | ControlMessageGraftTopicFieldEvent | ControlMessagePruneTopicFieldEvent | ControlMessagePrunePeersPeerIDFieldEvent | ControlMessagePrunePeersSignedPeerRecordFieldEvent | ControlMessagePruneBackoffFieldEvent> {
|
|
836
|
-
return streamMessage(buf, ControlMessage.codec(), opts)
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
export interface ControlIHave {
|
|
841
|
-
topic?: string
|
|
842
|
-
messageIDs: Uint8Array[]
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
export namespace ControlIHave {
|
|
846
|
-
let _codec: Codec<ControlIHave>
|
|
847
|
-
|
|
848
|
-
export const codec = (): Codec<ControlIHave> => {
|
|
849
|
-
if (_codec == null) {
|
|
850
|
-
_codec = message<ControlIHave>((obj, w, opts = {}) => {
|
|
851
|
-
if (opts.lengthDelimited !== false) {
|
|
852
|
-
w.fork()
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
if (obj.topic != null) {
|
|
856
|
-
w.uint32(10)
|
|
857
|
-
w.string(obj.topic)
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
if (obj.messageIDs != null && obj.messageIDs.length > 0) {
|
|
861
|
-
for (const value of obj.messageIDs) {
|
|
862
|
-
w.uint32(18)
|
|
863
|
-
w.bytes(value)
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
if (opts.lengthDelimited !== false) {
|
|
868
|
-
w.ldelim()
|
|
869
|
-
}
|
|
870
|
-
}, (reader, length, opts = {}) => {
|
|
871
|
-
const obj: any = {
|
|
872
|
-
messageIDs: []
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
876
|
-
|
|
877
|
-
while (reader.pos < end) {
|
|
878
|
-
const tag = reader.uint32()
|
|
879
|
-
|
|
880
|
-
switch (tag >>> 3) {
|
|
881
|
-
case 1: {
|
|
882
|
-
obj.topic = reader.string()
|
|
883
|
-
break
|
|
884
|
-
}
|
|
885
|
-
case 2: {
|
|
886
|
-
if (opts.limits?.messageIDs != null && obj.messageIDs.length === opts.limits.messageIDs) {
|
|
887
|
-
throw new MaxLengthError('Decode error - repeated field "messageIDs" had too many elements')
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
obj.messageIDs.push(reader.bytes())
|
|
891
|
-
break
|
|
892
|
-
}
|
|
893
|
-
default: {
|
|
894
|
-
reader.skipType(tag & 7)
|
|
895
|
-
break
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
return obj
|
|
901
|
-
}, function * (reader, length, prefix, opts = {}) {
|
|
902
|
-
const obj = {
|
|
903
|
-
messageIDs: 0
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
907
|
-
|
|
908
|
-
while (reader.pos < end) {
|
|
909
|
-
const tag = reader.uint32()
|
|
910
|
-
|
|
911
|
-
switch (tag >>> 3) {
|
|
912
|
-
case 1: {
|
|
913
|
-
yield {
|
|
914
|
-
field: `${prefix}.topic`,
|
|
915
|
-
value: reader.string()
|
|
916
|
-
}
|
|
917
|
-
break
|
|
918
|
-
}
|
|
919
|
-
case 2: {
|
|
920
|
-
if (opts.limits?.messageIDs != null && obj.messageIDs === opts.limits.messageIDs) {
|
|
921
|
-
throw new MaxLengthError('Streaming decode error - repeated field "messageIDs" had too many elements')
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
yield {
|
|
925
|
-
field: `${prefix}.messageIDs[]`,
|
|
926
|
-
index: obj.messageIDs,
|
|
927
|
-
value: reader.bytes()
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
obj.messageIDs++
|
|
931
|
-
|
|
932
|
-
break
|
|
933
|
-
}
|
|
934
|
-
default: {
|
|
935
|
-
reader.skipType(tag & 7)
|
|
936
|
-
break
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
})
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
return _codec
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
export interface ControlIHaveTopicFieldEvent {
|
|
947
|
-
field: '$.topic'
|
|
948
|
-
value: string
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
export interface ControlIHaveMessageIDsFieldEvent {
|
|
952
|
-
field: '$.messageIDs[]'
|
|
953
|
-
index: number
|
|
954
|
-
value: Uint8Array
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
export function encode (obj: Partial<ControlIHave>): Uint8Array {
|
|
958
|
-
return encodeMessage(obj, ControlIHave.codec())
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
export function decode (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlIHave>): ControlIHave {
|
|
962
|
-
return decodeMessage(buf, ControlIHave.codec(), opts)
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlIHave>): Generator<ControlIHaveTopicFieldEvent | ControlIHaveMessageIDsFieldEvent> {
|
|
966
|
-
return streamMessage(buf, ControlIHave.codec(), opts)
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
export interface ControlIWant {
|
|
971
|
-
messageIDs: Uint8Array[]
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
export namespace ControlIWant {
|
|
975
|
-
let _codec: Codec<ControlIWant>
|
|
976
|
-
|
|
977
|
-
export const codec = (): Codec<ControlIWant> => {
|
|
978
|
-
if (_codec == null) {
|
|
979
|
-
_codec = message<ControlIWant>((obj, w, opts = {}) => {
|
|
980
|
-
if (opts.lengthDelimited !== false) {
|
|
981
|
-
w.fork()
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
if (obj.messageIDs != null && obj.messageIDs.length > 0) {
|
|
985
|
-
for (const value of obj.messageIDs) {
|
|
986
|
-
w.uint32(10)
|
|
987
|
-
w.bytes(value)
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
if (opts.lengthDelimited !== false) {
|
|
992
|
-
w.ldelim()
|
|
993
|
-
}
|
|
994
|
-
}, (reader, length, opts = {}) => {
|
|
995
|
-
const obj: any = {
|
|
996
|
-
messageIDs: []
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1000
|
-
|
|
1001
|
-
while (reader.pos < end) {
|
|
1002
|
-
const tag = reader.uint32()
|
|
1003
|
-
|
|
1004
|
-
switch (tag >>> 3) {
|
|
1005
|
-
case 1: {
|
|
1006
|
-
if (opts.limits?.messageIDs != null && obj.messageIDs.length === opts.limits.messageIDs) {
|
|
1007
|
-
throw new MaxLengthError('Decode error - repeated field "messageIDs" had too many elements')
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
obj.messageIDs.push(reader.bytes())
|
|
1011
|
-
break
|
|
1012
|
-
}
|
|
1013
|
-
default: {
|
|
1014
|
-
reader.skipType(tag & 7)
|
|
1015
|
-
break
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
return obj
|
|
1021
|
-
}, function * (reader, length, prefix, opts = {}) {
|
|
1022
|
-
const obj = {
|
|
1023
|
-
messageIDs: 0
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1027
|
-
|
|
1028
|
-
while (reader.pos < end) {
|
|
1029
|
-
const tag = reader.uint32()
|
|
1030
|
-
|
|
1031
|
-
switch (tag >>> 3) {
|
|
1032
|
-
case 1: {
|
|
1033
|
-
if (opts.limits?.messageIDs != null && obj.messageIDs === opts.limits.messageIDs) {
|
|
1034
|
-
throw new MaxLengthError('Streaming decode error - repeated field "messageIDs" had too many elements')
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
yield {
|
|
1038
|
-
field: `${prefix}.messageIDs[]`,
|
|
1039
|
-
index: obj.messageIDs,
|
|
1040
|
-
value: reader.bytes()
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
obj.messageIDs++
|
|
1044
|
-
|
|
1045
|
-
break
|
|
1046
|
-
}
|
|
1047
|
-
default: {
|
|
1048
|
-
reader.skipType(tag & 7)
|
|
1049
|
-
break
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
})
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
return _codec
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
export interface ControlIWantMessageIDsFieldEvent {
|
|
1060
|
-
field: '$.messageIDs[]'
|
|
1061
|
-
index: number
|
|
1062
|
-
value: Uint8Array
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
export function encode (obj: Partial<ControlIWant>): Uint8Array {
|
|
1066
|
-
return encodeMessage(obj, ControlIWant.codec())
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
export function decode (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlIWant>): ControlIWant {
|
|
1070
|
-
return decodeMessage(buf, ControlIWant.codec(), opts)
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlIWant>): Generator<ControlIWantMessageIDsFieldEvent> {
|
|
1074
|
-
return streamMessage(buf, ControlIWant.codec(), opts)
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
export interface ControlGraft {
|
|
1079
|
-
topic?: string
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
export namespace ControlGraft {
|
|
1083
|
-
let _codec: Codec<ControlGraft>
|
|
1084
|
-
|
|
1085
|
-
export const codec = (): Codec<ControlGraft> => {
|
|
1086
|
-
if (_codec == null) {
|
|
1087
|
-
_codec = message<ControlGraft>((obj, w, opts = {}) => {
|
|
1088
|
-
if (opts.lengthDelimited !== false) {
|
|
1089
|
-
w.fork()
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
if (obj.topic != null) {
|
|
1093
|
-
w.uint32(10)
|
|
1094
|
-
w.string(obj.topic)
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
if (opts.lengthDelimited !== false) {
|
|
1098
|
-
w.ldelim()
|
|
1099
|
-
}
|
|
1100
|
-
}, (reader, length, opts = {}) => {
|
|
1101
|
-
const obj: any = {}
|
|
1102
|
-
|
|
1103
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1104
|
-
|
|
1105
|
-
while (reader.pos < end) {
|
|
1106
|
-
const tag = reader.uint32()
|
|
1107
|
-
|
|
1108
|
-
switch (tag >>> 3) {
|
|
1109
|
-
case 1: {
|
|
1110
|
-
obj.topic = reader.string()
|
|
1111
|
-
break
|
|
1112
|
-
}
|
|
1113
|
-
default: {
|
|
1114
|
-
reader.skipType(tag & 7)
|
|
1115
|
-
break
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
return obj
|
|
1121
|
-
}, function * (reader, length, prefix, opts = {}) {
|
|
1122
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1123
|
-
|
|
1124
|
-
while (reader.pos < end) {
|
|
1125
|
-
const tag = reader.uint32()
|
|
1126
|
-
|
|
1127
|
-
switch (tag >>> 3) {
|
|
1128
|
-
case 1: {
|
|
1129
|
-
yield {
|
|
1130
|
-
field: `${prefix}.topic`,
|
|
1131
|
-
value: reader.string()
|
|
1132
|
-
}
|
|
1133
|
-
break
|
|
1134
|
-
}
|
|
1135
|
-
default: {
|
|
1136
|
-
reader.skipType(tag & 7)
|
|
1137
|
-
break
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
})
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
return _codec
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
export interface ControlGraftTopicFieldEvent {
|
|
1148
|
-
field: '$.topic'
|
|
1149
|
-
value: string
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
export function encode (obj: Partial<ControlGraft>): Uint8Array {
|
|
1153
|
-
return encodeMessage(obj, ControlGraft.codec())
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
export function decode (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlGraft>): ControlGraft {
|
|
1157
|
-
return decodeMessage(buf, ControlGraft.codec(), opts)
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlGraft>): Generator<ControlGraftTopicFieldEvent> {
|
|
1161
|
-
return streamMessage(buf, ControlGraft.codec(), opts)
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
export interface ControlPrune {
|
|
1166
|
-
topic?: string
|
|
1167
|
-
peers: PeerInfo[]
|
|
1168
|
-
backoff?: bigint
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
export namespace ControlPrune {
|
|
1172
|
-
let _codec: Codec<ControlPrune>
|
|
1173
|
-
|
|
1174
|
-
export const codec = (): Codec<ControlPrune> => {
|
|
1175
|
-
if (_codec == null) {
|
|
1176
|
-
_codec = message<ControlPrune>((obj, w, opts = {}) => {
|
|
1177
|
-
if (opts.lengthDelimited !== false) {
|
|
1178
|
-
w.fork()
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
if (obj.topic != null) {
|
|
1182
|
-
w.uint32(10)
|
|
1183
|
-
w.string(obj.topic)
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
if (obj.peers != null && obj.peers.length > 0) {
|
|
1187
|
-
for (const value of obj.peers) {
|
|
1188
|
-
w.uint32(18)
|
|
1189
|
-
PeerInfo.codec().encode(value, w)
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
if (obj.backoff != null) {
|
|
1194
|
-
w.uint32(24)
|
|
1195
|
-
w.uint64(obj.backoff)
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
if (opts.lengthDelimited !== false) {
|
|
1199
|
-
w.ldelim()
|
|
1200
|
-
}
|
|
1201
|
-
}, (reader, length, opts = {}) => {
|
|
1202
|
-
const obj: any = {
|
|
1203
|
-
peers: []
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1207
|
-
|
|
1208
|
-
while (reader.pos < end) {
|
|
1209
|
-
const tag = reader.uint32()
|
|
1210
|
-
|
|
1211
|
-
switch (tag >>> 3) {
|
|
1212
|
-
case 1: {
|
|
1213
|
-
obj.topic = reader.string()
|
|
1214
|
-
break
|
|
1215
|
-
}
|
|
1216
|
-
case 2: {
|
|
1217
|
-
if (opts.limits?.peers != null && obj.peers.length === opts.limits.peers) {
|
|
1218
|
-
throw new MaxLengthError('Decode error - repeated field "peers" had too many elements')
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
obj.peers.push(PeerInfo.codec().decode(reader, reader.uint32(), {
|
|
1222
|
-
limits: opts.limits?.peers$
|
|
1223
|
-
}))
|
|
1224
|
-
break
|
|
1225
|
-
}
|
|
1226
|
-
case 3: {
|
|
1227
|
-
obj.backoff = reader.uint64()
|
|
1228
|
-
break
|
|
1229
|
-
}
|
|
1230
|
-
default: {
|
|
1231
|
-
reader.skipType(tag & 7)
|
|
1232
|
-
break
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
return obj
|
|
1238
|
-
}, function * (reader, length, prefix, opts = {}) {
|
|
1239
|
-
const obj = {
|
|
1240
|
-
peers: 0
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1244
|
-
|
|
1245
|
-
while (reader.pos < end) {
|
|
1246
|
-
const tag = reader.uint32()
|
|
1247
|
-
|
|
1248
|
-
switch (tag >>> 3) {
|
|
1249
|
-
case 1: {
|
|
1250
|
-
yield {
|
|
1251
|
-
field: `${prefix}.topic`,
|
|
1252
|
-
value: reader.string()
|
|
1253
|
-
}
|
|
1254
|
-
break
|
|
1255
|
-
}
|
|
1256
|
-
case 2: {
|
|
1257
|
-
if (opts.limits?.peers != null && obj.peers === opts.limits.peers) {
|
|
1258
|
-
throw new MaxLengthError('Streaming decode error - repeated field "peers" had too many elements')
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
for (const evt of PeerInfo.codec().stream(reader, reader.uint32(), `${prefix}.peers[]`, {
|
|
1262
|
-
limits: opts.limits?.peers$
|
|
1263
|
-
})) {
|
|
1264
|
-
yield {
|
|
1265
|
-
...evt,
|
|
1266
|
-
index: obj.peers
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
obj.peers++
|
|
1271
|
-
|
|
1272
|
-
break
|
|
1273
|
-
}
|
|
1274
|
-
case 3: {
|
|
1275
|
-
yield {
|
|
1276
|
-
field: `${prefix}.backoff`,
|
|
1277
|
-
value: reader.uint64()
|
|
1278
|
-
}
|
|
1279
|
-
break
|
|
1280
|
-
}
|
|
1281
|
-
default: {
|
|
1282
|
-
reader.skipType(tag & 7)
|
|
1283
|
-
break
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
})
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
return _codec
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
export interface ControlPruneTopicFieldEvent {
|
|
1294
|
-
field: '$.topic'
|
|
1295
|
-
value: string
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
export interface ControlPrunePeersPeerIDFieldEvent {
|
|
1299
|
-
field: '$.peers[].peerID'
|
|
1300
|
-
value: Uint8Array
|
|
1301
|
-
index: number
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
export interface ControlPrunePeersSignedPeerRecordFieldEvent {
|
|
1305
|
-
field: '$.peers[].signedPeerRecord'
|
|
1306
|
-
value: Uint8Array
|
|
1307
|
-
index: number
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
export interface ControlPruneBackoffFieldEvent {
|
|
1311
|
-
field: '$.backoff'
|
|
1312
|
-
value: bigint
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
export function encode (obj: Partial<ControlPrune>): Uint8Array {
|
|
1316
|
-
return encodeMessage(obj, ControlPrune.codec())
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
export function decode (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlPrune>): ControlPrune {
|
|
1320
|
-
return decodeMessage(buf, ControlPrune.codec(), opts)
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<ControlPrune>): Generator<ControlPruneTopicFieldEvent | ControlPrunePeersPeerIDFieldEvent | ControlPrunePeersSignedPeerRecordFieldEvent | ControlPruneBackoffFieldEvent> {
|
|
1324
|
-
return streamMessage(buf, ControlPrune.codec(), opts)
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
export interface PeerInfo {
|
|
1329
|
-
peerID?: Uint8Array
|
|
1330
|
-
signedPeerRecord?: Uint8Array
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
export namespace PeerInfo {
|
|
1334
|
-
let _codec: Codec<PeerInfo>
|
|
1335
|
-
|
|
1336
|
-
export const codec = (): Codec<PeerInfo> => {
|
|
1337
|
-
if (_codec == null) {
|
|
1338
|
-
_codec = message<PeerInfo>((obj, w, opts = {}) => {
|
|
1339
|
-
if (opts.lengthDelimited !== false) {
|
|
1340
|
-
w.fork()
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
if (obj.peerID != null) {
|
|
1344
|
-
w.uint32(10)
|
|
1345
|
-
w.bytes(obj.peerID)
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
if (obj.signedPeerRecord != null) {
|
|
1349
|
-
w.uint32(18)
|
|
1350
|
-
w.bytes(obj.signedPeerRecord)
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
if (opts.lengthDelimited !== false) {
|
|
1354
|
-
w.ldelim()
|
|
1355
|
-
}
|
|
1356
|
-
}, (reader, length, opts = {}) => {
|
|
1357
|
-
const obj: any = {}
|
|
1358
|
-
|
|
1359
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1360
|
-
|
|
1361
|
-
while (reader.pos < end) {
|
|
1362
|
-
const tag = reader.uint32()
|
|
1363
|
-
|
|
1364
|
-
switch (tag >>> 3) {
|
|
1365
|
-
case 1: {
|
|
1366
|
-
obj.peerID = reader.bytes()
|
|
1367
|
-
break
|
|
1368
|
-
}
|
|
1369
|
-
case 2: {
|
|
1370
|
-
obj.signedPeerRecord = reader.bytes()
|
|
1371
|
-
break
|
|
1372
|
-
}
|
|
1373
|
-
default: {
|
|
1374
|
-
reader.skipType(tag & 7)
|
|
1375
|
-
break
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
return obj
|
|
1381
|
-
}, function * (reader, length, prefix, opts = {}) {
|
|
1382
|
-
const end = length == null ? reader.len : reader.pos + length
|
|
1383
|
-
|
|
1384
|
-
while (reader.pos < end) {
|
|
1385
|
-
const tag = reader.uint32()
|
|
1386
|
-
|
|
1387
|
-
switch (tag >>> 3) {
|
|
1388
|
-
case 1: {
|
|
1389
|
-
yield {
|
|
1390
|
-
field: `${prefix}.peerID`,
|
|
1391
|
-
value: reader.bytes()
|
|
1392
|
-
}
|
|
1393
|
-
break
|
|
1394
|
-
}
|
|
1395
|
-
case 2: {
|
|
1396
|
-
yield {
|
|
1397
|
-
field: `${prefix}.signedPeerRecord`,
|
|
1398
|
-
value: reader.bytes()
|
|
1399
|
-
}
|
|
1400
|
-
break
|
|
1401
|
-
}
|
|
1402
|
-
default: {
|
|
1403
|
-
reader.skipType(tag & 7)
|
|
1404
|
-
break
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
})
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
return _codec
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
export interface PeerInfoPeerIDFieldEvent {
|
|
1415
|
-
field: '$.peerID'
|
|
1416
|
-
value: Uint8Array
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
export interface PeerInfoSignedPeerRecordFieldEvent {
|
|
1420
|
-
field: '$.signedPeerRecord'
|
|
1421
|
-
value: Uint8Array
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
export function encode (obj: Partial<PeerInfo>): Uint8Array {
|
|
1425
|
-
return encodeMessage(obj, PeerInfo.codec())
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
export function decode (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<PeerInfo>): PeerInfo {
|
|
1429
|
-
return decodeMessage(buf, PeerInfo.codec(), opts)
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
export function stream (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<PeerInfo>): Generator<PeerInfoPeerIDFieldEvent | PeerInfoSignedPeerRecordFieldEvent> {
|
|
1433
|
-
return streamMessage(buf, PeerInfo.codec(), opts)
|
|
1434
|
-
}
|
|
1435
|
-
}
|