@minip2p/react-native 0.9.1 → 0.10.1
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/android/src/main/jniLibs/arm64-v8a/libminip2p_ffi.so +0 -0
- package/android/src/main/jniLibs/x86_64/libminip2p_ffi.so +0 -0
- package/build/Minip2pFfi.xcframework/ios-arm64/libminip2p_ffi.a +2 -2
- package/build/Minip2pFfi.xcframework/ios-arm64-simulator/libminip2p_ffi.a +2 -2
- package/cpp/generated/minip2p_ffi.cpp +3 -2
- package/lib/module/adapter.js +32 -10
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi.js +11 -8
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/module/generated/minip2p_ffi_core.js +662 -243
- package/lib/module/generated/minip2p_ffi_core.js.map +1 -1
- package/lib/typescript/src/adapter.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +14 -8
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts +464 -130
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts.map +1 -1
- package/lib/typescript/src/hook-lifecycle.d.ts +2 -2
- package/lib/typescript/src/hook-lifecycle.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +45 -7
- package/src/generated/minip2p_ffi-ffi.ts +1 -1
- package/src/generated/minip2p_ffi.ts +18 -11
- package/src/generated/minip2p_ffi_core.ts +864 -378
- package/src/hook-lifecycle.ts +2 -2
|
@@ -56,8 +56,161 @@ const stringConverter = (() => {
|
|
|
56
56
|
})();
|
|
57
57
|
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
58
58
|
|
|
59
|
+
// Enum: PathKind
|
|
60
|
+
export let PathKind_Tags = /*#__PURE__*/function (PathKind_Tags) {
|
|
61
|
+
PathKind_Tags["Direct"] = "Direct";
|
|
62
|
+
PathKind_Tags["Punched"] = "Punched";
|
|
63
|
+
PathKind_Tags["Relayed"] = "Relayed";
|
|
64
|
+
return PathKind_Tags;
|
|
65
|
+
}({});
|
|
59
66
|
/**
|
|
60
|
-
*
|
|
67
|
+
* How an established connection was made; see `minip2p::Path`.
|
|
68
|
+
*/
|
|
69
|
+
export const PathKind = (() => {
|
|
70
|
+
/**
|
|
71
|
+
* A direct connection we dialed or accepted.
|
|
72
|
+
*/
|
|
73
|
+
class Direct_ extends UniffiEnum {
|
|
74
|
+
/**
|
|
75
|
+
* @private
|
|
76
|
+
* This field is private and should not be used, use `tag` instead.
|
|
77
|
+
*/
|
|
78
|
+
[uniffiTypeNameSymbol] = "PathKind";
|
|
79
|
+
tag = PathKind_Tags.Direct;
|
|
80
|
+
constructor() {
|
|
81
|
+
super("PathKind", "Direct");
|
|
82
|
+
}
|
|
83
|
+
static new() {
|
|
84
|
+
return new Direct_();
|
|
85
|
+
}
|
|
86
|
+
static instanceOf(obj) {
|
|
87
|
+
return obj.tag === PathKind_Tags.Direct;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A direct connection made by a DCUtR hole punch.
|
|
92
|
+
*/
|
|
93
|
+
class Punched_ extends UniffiEnum {
|
|
94
|
+
/**
|
|
95
|
+
* @private
|
|
96
|
+
* This field is private and should not be used, use `tag` instead.
|
|
97
|
+
*/
|
|
98
|
+
[uniffiTypeNameSymbol] = "PathKind";
|
|
99
|
+
tag = PathKind_Tags.Punched;
|
|
100
|
+
constructor() {
|
|
101
|
+
super("PathKind", "Punched");
|
|
102
|
+
}
|
|
103
|
+
static new() {
|
|
104
|
+
return new Punched_();
|
|
105
|
+
}
|
|
106
|
+
static instanceOf(obj) {
|
|
107
|
+
return obj.tag === PathKind_Tags.Punched;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Traffic is carried through a relay.
|
|
112
|
+
*/
|
|
113
|
+
class Relayed_ extends UniffiEnum {
|
|
114
|
+
/**
|
|
115
|
+
* @private
|
|
116
|
+
* This field is private and should not be used, use `tag` instead.
|
|
117
|
+
*/
|
|
118
|
+
[uniffiTypeNameSymbol] = "PathKind";
|
|
119
|
+
tag = PathKind_Tags.Relayed;
|
|
120
|
+
constructor(inner) {
|
|
121
|
+
super("PathKind", "Relayed");
|
|
122
|
+
this.inner = Object.freeze(inner);
|
|
123
|
+
}
|
|
124
|
+
static new(inner) {
|
|
125
|
+
return new Relayed_(inner);
|
|
126
|
+
}
|
|
127
|
+
static instanceOf(obj) {
|
|
128
|
+
return obj.tag === PathKind_Tags.Relayed;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function instanceOf(obj) {
|
|
132
|
+
return obj[uniffiTypeNameSymbol] === "PathKind";
|
|
133
|
+
}
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
instanceOf,
|
|
136
|
+
Direct: Direct_,
|
|
137
|
+
Punched: Punched_,
|
|
138
|
+
Relayed: Relayed_
|
|
139
|
+
});
|
|
140
|
+
})();
|
|
141
|
+
/**
|
|
142
|
+
* How an established connection was made; see `minip2p::Path`.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
// FfiConverter for enum PathKind
|
|
146
|
+
const FfiConverterTypePathKind = (() => {
|
|
147
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
148
|
+
readFromCursor(c) {
|
|
149
|
+
switch (c.readI32()) {
|
|
150
|
+
case 1:
|
|
151
|
+
return new PathKind.Direct();
|
|
152
|
+
case 2:
|
|
153
|
+
return new PathKind.Punched();
|
|
154
|
+
case 3:
|
|
155
|
+
return new PathKind.Relayed({
|
|
156
|
+
relayPeerId: FfiConverterString.readFromCursor(c)
|
|
157
|
+
});
|
|
158
|
+
default:
|
|
159
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
writeIntoCursor(value, c) {
|
|
163
|
+
switch (value.tag) {
|
|
164
|
+
case PathKind_Tags.Direct:
|
|
165
|
+
{
|
|
166
|
+
c.writeI32(1);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
case PathKind_Tags.Punched:
|
|
170
|
+
{
|
|
171
|
+
c.writeI32(2);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
case PathKind_Tags.Relayed:
|
|
175
|
+
{
|
|
176
|
+
c.writeI32(3);
|
|
177
|
+
const inner = value.inner;
|
|
178
|
+
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
default:
|
|
182
|
+
// Throwing from here means that PathKind_Tags hasn't matched an ordinal.
|
|
183
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
allocationSize(value) {
|
|
187
|
+
switch (value.tag) {
|
|
188
|
+
case PathKind_Tags.Direct:
|
|
189
|
+
{
|
|
190
|
+
return 4;
|
|
191
|
+
}
|
|
192
|
+
case PathKind_Tags.Punched:
|
|
193
|
+
{
|
|
194
|
+
return 4;
|
|
195
|
+
}
|
|
196
|
+
case PathKind_Tags.Relayed:
|
|
197
|
+
{
|
|
198
|
+
const inner = value.inner;
|
|
199
|
+
let size = 4;
|
|
200
|
+
size += FfiConverterString.allocationSize(inner.relayPeerId);
|
|
201
|
+
return size;
|
|
202
|
+
}
|
|
203
|
+
default:
|
|
204
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return new FFIConverter();
|
|
209
|
+
})();
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* State snapshot of a peer's established connection; see
|
|
213
|
+
* `minip2p::ConnectionInfo`.
|
|
61
214
|
*/
|
|
62
215
|
|
|
63
216
|
/**
|
|
@@ -78,18 +231,22 @@ const FfiConverterTypeConnectionInfo = (() => {
|
|
|
78
231
|
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
79
232
|
readFromCursor(c) {
|
|
80
233
|
return {
|
|
234
|
+
peerId: FfiConverterString.readFromCursor(c),
|
|
81
235
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
82
|
-
remoteAddr:
|
|
236
|
+
remoteAddr: FfiConverterString.readFromCursor(c),
|
|
237
|
+
path: FfiConverterTypePathKind.readFromCursor(c),
|
|
83
238
|
readyProtocols: FfiConverterOptionalSequenceString.readFromCursor(c)
|
|
84
239
|
};
|
|
85
240
|
}
|
|
86
241
|
writeIntoCursor(value, c) {
|
|
242
|
+
FfiConverterString.writeIntoCursor(value.peerId, c);
|
|
87
243
|
FfiConverterUInt64.writeIntoCursor(value.connId, c);
|
|
88
|
-
|
|
244
|
+
FfiConverterString.writeIntoCursor(value.remoteAddr, c);
|
|
245
|
+
FfiConverterTypePathKind.writeIntoCursor(value.path, c);
|
|
89
246
|
FfiConverterOptionalSequenceString.writeIntoCursor(value.readyProtocols, c);
|
|
90
247
|
}
|
|
91
248
|
allocationSize(value) {
|
|
92
|
-
return FfiConverterUInt64.allocationSize(value.connId) +
|
|
249
|
+
return FfiConverterString.allocationSize(value.peerId) + FfiConverterUInt64.allocationSize(value.connId) + FfiConverterString.allocationSize(value.remoteAddr) + FfiConverterTypePathKind.allocationSize(value.path) + FfiConverterOptionalSequenceString.allocationSize(value.readyProtocols);
|
|
93
250
|
}
|
|
94
251
|
}
|
|
95
252
|
;
|
|
@@ -408,6 +565,94 @@ const FfiConverterTypeRelayReservationInfo = (() => {
|
|
|
408
565
|
return new FFIConverter();
|
|
409
566
|
})();
|
|
410
567
|
|
|
568
|
+
/**
|
|
569
|
+
* A connection still tracked when the closing drain ended.
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Generated factory for {@link UnfinishedConnection} record objects.
|
|
574
|
+
*/
|
|
575
|
+
export const UnfinishedConnection = (() => {
|
|
576
|
+
const defaults = () => ({});
|
|
577
|
+
const create = (() => {
|
|
578
|
+
return uniffiCreateRecord(defaults);
|
|
579
|
+
})();
|
|
580
|
+
return Object.freeze({
|
|
581
|
+
create,
|
|
582
|
+
new: create,
|
|
583
|
+
defaults: () => Object.freeze(defaults())
|
|
584
|
+
});
|
|
585
|
+
})();
|
|
586
|
+
const FfiConverterTypeUnfinishedConnection = (() => {
|
|
587
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
588
|
+
readFromCursor(c) {
|
|
589
|
+
return {
|
|
590
|
+
connId: FfiConverterUInt64.readFromCursor(c),
|
|
591
|
+
peerId: FfiConverterOptionalString.readFromCursor(c)
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
writeIntoCursor(value, c) {
|
|
595
|
+
FfiConverterUInt64.writeIntoCursor(value.connId, c);
|
|
596
|
+
FfiConverterOptionalString.writeIntoCursor(value.peerId, c);
|
|
597
|
+
}
|
|
598
|
+
allocationSize(value) {
|
|
599
|
+
return FfiConverterUInt64.allocationSize(value.connId) + FfiConverterOptionalString.allocationSize(value.peerId);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
;
|
|
603
|
+
return new FFIConverter();
|
|
604
|
+
})();
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* How the driver's closing drain ended; see [`P2pEvent::EndpointClosed`].
|
|
608
|
+
*/
|
|
609
|
+
export let CloseOutcome = /*#__PURE__*/function (CloseOutcome) {
|
|
610
|
+
/**
|
|
611
|
+
* Every tracked connection finished its teardown in time.
|
|
612
|
+
*/
|
|
613
|
+
CloseOutcome[CloseOutcome["Drained"] = 0] = "Drained";
|
|
614
|
+
/**
|
|
615
|
+
* The stop deadline passed with connections still tracked.
|
|
616
|
+
*/
|
|
617
|
+
CloseOutcome[CloseOutcome["DeadlineExpired"] = 1] = "DeadlineExpired";
|
|
618
|
+
/**
|
|
619
|
+
* Driving the transports failed and ended the drain early, or the
|
|
620
|
+
* driver panicked and dropped the endpoint without a drain.
|
|
621
|
+
*/
|
|
622
|
+
CloseOutcome[CloseOutcome["Failed"] = 2] = "Failed";
|
|
623
|
+
return CloseOutcome;
|
|
624
|
+
}({});
|
|
625
|
+
const FfiConverterTypeCloseOutcome = (() => {
|
|
626
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
627
|
+
readFromCursor(c) {
|
|
628
|
+
switch (c.readI32()) {
|
|
629
|
+
case 1:
|
|
630
|
+
return CloseOutcome.Drained;
|
|
631
|
+
case 2:
|
|
632
|
+
return CloseOutcome.DeadlineExpired;
|
|
633
|
+
case 3:
|
|
634
|
+
return CloseOutcome.Failed;
|
|
635
|
+
default:
|
|
636
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
writeIntoCursor(value, c) {
|
|
640
|
+
switch (value) {
|
|
641
|
+
case CloseOutcome.Drained:
|
|
642
|
+
return c.writeI32(1);
|
|
643
|
+
case CloseOutcome.DeadlineExpired:
|
|
644
|
+
return c.writeI32(2);
|
|
645
|
+
case CloseOutcome.Failed:
|
|
646
|
+
return c.writeI32(3);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
allocationSize(value) {
|
|
650
|
+
return 4;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return new FFIConverter();
|
|
654
|
+
})();
|
|
655
|
+
|
|
411
656
|
/**
|
|
412
657
|
* The part of an endpoint's configuration an [`FfiError::InvalidConfig`]
|
|
413
658
|
* names.
|
|
@@ -614,6 +859,233 @@ const FfiConverterTypeConnectTarget = (() => {
|
|
|
614
859
|
return new FFIConverter();
|
|
615
860
|
})();
|
|
616
861
|
|
|
862
|
+
// Enum: ConnectionCloseReason
|
|
863
|
+
export let ConnectionCloseReason_Tags = /*#__PURE__*/function (ConnectionCloseReason_Tags) {
|
|
864
|
+
ConnectionCloseReason_Tags["Local"] = "Local";
|
|
865
|
+
ConnectionCloseReason_Tags["Remote"] = "Remote";
|
|
866
|
+
ConnectionCloseReason_Tags["TimedOut"] = "TimedOut";
|
|
867
|
+
ConnectionCloseReason_Tags["Stalled"] = "Stalled";
|
|
868
|
+
ConnectionCloseReason_Tags["Error"] = "Error";
|
|
869
|
+
return ConnectionCloseReason_Tags;
|
|
870
|
+
}({});
|
|
871
|
+
/**
|
|
872
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
873
|
+
*/
|
|
874
|
+
export const ConnectionCloseReason = (() => {
|
|
875
|
+
/**
|
|
876
|
+
* We closed it.
|
|
877
|
+
*/
|
|
878
|
+
class Local_ extends UniffiEnum {
|
|
879
|
+
/**
|
|
880
|
+
* @private
|
|
881
|
+
* This field is private and should not be used, use `tag` instead.
|
|
882
|
+
*/
|
|
883
|
+
[uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
884
|
+
tag = ConnectionCloseReason_Tags.Local;
|
|
885
|
+
constructor() {
|
|
886
|
+
super("ConnectionCloseReason", "Local");
|
|
887
|
+
}
|
|
888
|
+
static new() {
|
|
889
|
+
return new Local_();
|
|
890
|
+
}
|
|
891
|
+
static instanceOf(obj) {
|
|
892
|
+
return obj.tag === ConnectionCloseReason_Tags.Local;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* The peer closed it with `code`: its QUIC CONNECTION_CLOSE code, or
|
|
897
|
+
* its Yamux `GoAway` code on TCP and relay circuits.
|
|
898
|
+
*/
|
|
899
|
+
class Remote_ extends UniffiEnum {
|
|
900
|
+
/**
|
|
901
|
+
* @private
|
|
902
|
+
* This field is private and should not be used, use `tag` instead.
|
|
903
|
+
*/
|
|
904
|
+
[uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
905
|
+
tag = ConnectionCloseReason_Tags.Remote;
|
|
906
|
+
constructor(inner) {
|
|
907
|
+
super("ConnectionCloseReason", "Remote");
|
|
908
|
+
this.inner = Object.freeze(inner);
|
|
909
|
+
}
|
|
910
|
+
static new(inner) {
|
|
911
|
+
return new Remote_(inner);
|
|
912
|
+
}
|
|
913
|
+
static instanceOf(obj) {
|
|
914
|
+
return obj.tag === ConnectionCloseReason_Tags.Remote;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* The peer went silent (an idle, keepalive or handshake timeout).
|
|
919
|
+
*/
|
|
920
|
+
class TimedOut_ extends UniffiEnum {
|
|
921
|
+
/**
|
|
922
|
+
* @private
|
|
923
|
+
* This field is private and should not be used, use `tag` instead.
|
|
924
|
+
*/
|
|
925
|
+
[uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
926
|
+
tag = ConnectionCloseReason_Tags.TimedOut;
|
|
927
|
+
constructor() {
|
|
928
|
+
super("ConnectionCloseReason", "TimedOut");
|
|
929
|
+
}
|
|
930
|
+
static new() {
|
|
931
|
+
return new TimedOut_();
|
|
932
|
+
}
|
|
933
|
+
static instanceOf(obj) {
|
|
934
|
+
return obj.tag === ConnectionCloseReason_Tags.TimedOut;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* The peer stopped reading (a TCP send stall).
|
|
939
|
+
*/
|
|
940
|
+
class Stalled_ extends UniffiEnum {
|
|
941
|
+
/**
|
|
942
|
+
* @private
|
|
943
|
+
* This field is private and should not be used, use `tag` instead.
|
|
944
|
+
*/
|
|
945
|
+
[uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
946
|
+
tag = ConnectionCloseReason_Tags.Stalled;
|
|
947
|
+
constructor() {
|
|
948
|
+
super("ConnectionCloseReason", "Stalled");
|
|
949
|
+
}
|
|
950
|
+
static new() {
|
|
951
|
+
return new Stalled_();
|
|
952
|
+
}
|
|
953
|
+
static instanceOf(obj) {
|
|
954
|
+
return obj.tag === ConnectionCloseReason_Tags.Stalled;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Anything else that ended it.
|
|
959
|
+
*/
|
|
960
|
+
class Error_ extends UniffiEnum {
|
|
961
|
+
/**
|
|
962
|
+
* @private
|
|
963
|
+
* This field is private and should not be used, use `tag` instead.
|
|
964
|
+
*/
|
|
965
|
+
[uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
966
|
+
tag = ConnectionCloseReason_Tags.Error;
|
|
967
|
+
constructor(inner) {
|
|
968
|
+
super("ConnectionCloseReason", "Error");
|
|
969
|
+
this.inner = Object.freeze(inner);
|
|
970
|
+
}
|
|
971
|
+
static new(inner) {
|
|
972
|
+
return new Error_(inner);
|
|
973
|
+
}
|
|
974
|
+
static instanceOf(obj) {
|
|
975
|
+
return obj.tag === ConnectionCloseReason_Tags.Error;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
function instanceOf(obj) {
|
|
979
|
+
return obj[uniffiTypeNameSymbol] === "ConnectionCloseReason";
|
|
980
|
+
}
|
|
981
|
+
return Object.freeze({
|
|
982
|
+
instanceOf,
|
|
983
|
+
Local: Local_,
|
|
984
|
+
Remote: Remote_,
|
|
985
|
+
TimedOut: TimedOut_,
|
|
986
|
+
Stalled: Stalled_,
|
|
987
|
+
Error: Error_
|
|
988
|
+
});
|
|
989
|
+
})();
|
|
990
|
+
/**
|
|
991
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
992
|
+
*/
|
|
993
|
+
|
|
994
|
+
// FfiConverter for enum ConnectionCloseReason
|
|
995
|
+
const FfiConverterTypeConnectionCloseReason = (() => {
|
|
996
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
997
|
+
readFromCursor(c) {
|
|
998
|
+
switch (c.readI32()) {
|
|
999
|
+
case 1:
|
|
1000
|
+
return new ConnectionCloseReason.Local();
|
|
1001
|
+
case 2:
|
|
1002
|
+
return new ConnectionCloseReason.Remote({
|
|
1003
|
+
code: FfiConverterUInt64.readFromCursor(c)
|
|
1004
|
+
});
|
|
1005
|
+
case 3:
|
|
1006
|
+
return new ConnectionCloseReason.TimedOut();
|
|
1007
|
+
case 4:
|
|
1008
|
+
return new ConnectionCloseReason.Stalled();
|
|
1009
|
+
case 5:
|
|
1010
|
+
return new ConnectionCloseReason.Error({
|
|
1011
|
+
message: FfiConverterString.readFromCursor(c)
|
|
1012
|
+
});
|
|
1013
|
+
default:
|
|
1014
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
writeIntoCursor(value, c) {
|
|
1018
|
+
switch (value.tag) {
|
|
1019
|
+
case ConnectionCloseReason_Tags.Local:
|
|
1020
|
+
{
|
|
1021
|
+
c.writeI32(1);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
case ConnectionCloseReason_Tags.Remote:
|
|
1025
|
+
{
|
|
1026
|
+
c.writeI32(2);
|
|
1027
|
+
const inner = value.inner;
|
|
1028
|
+
FfiConverterUInt64.writeIntoCursor(inner.code, c);
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
case ConnectionCloseReason_Tags.TimedOut:
|
|
1032
|
+
{
|
|
1033
|
+
c.writeI32(3);
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
case ConnectionCloseReason_Tags.Stalled:
|
|
1037
|
+
{
|
|
1038
|
+
c.writeI32(4);
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
case ConnectionCloseReason_Tags.Error:
|
|
1042
|
+
{
|
|
1043
|
+
c.writeI32(5);
|
|
1044
|
+
const inner = value.inner;
|
|
1045
|
+
FfiConverterString.writeIntoCursor(inner.message, c);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
default:
|
|
1049
|
+
// Throwing from here means that ConnectionCloseReason_Tags hasn't matched an ordinal.
|
|
1050
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
allocationSize(value) {
|
|
1054
|
+
switch (value.tag) {
|
|
1055
|
+
case ConnectionCloseReason_Tags.Local:
|
|
1056
|
+
{
|
|
1057
|
+
return 4;
|
|
1058
|
+
}
|
|
1059
|
+
case ConnectionCloseReason_Tags.Remote:
|
|
1060
|
+
{
|
|
1061
|
+
const inner = value.inner;
|
|
1062
|
+
let size = 4;
|
|
1063
|
+
size += FfiConverterUInt64.allocationSize(inner.code);
|
|
1064
|
+
return size;
|
|
1065
|
+
}
|
|
1066
|
+
case ConnectionCloseReason_Tags.TimedOut:
|
|
1067
|
+
{
|
|
1068
|
+
return 4;
|
|
1069
|
+
}
|
|
1070
|
+
case ConnectionCloseReason_Tags.Stalled:
|
|
1071
|
+
{
|
|
1072
|
+
return 4;
|
|
1073
|
+
}
|
|
1074
|
+
case ConnectionCloseReason_Tags.Error:
|
|
1075
|
+
{
|
|
1076
|
+
const inner = value.inner;
|
|
1077
|
+
let size = 4;
|
|
1078
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
1079
|
+
return size;
|
|
1080
|
+
}
|
|
1081
|
+
default:
|
|
1082
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return new FFIConverter();
|
|
1087
|
+
})();
|
|
1088
|
+
|
|
617
1089
|
/**
|
|
618
1090
|
* Source that contributed a discovery observation.
|
|
619
1091
|
*/
|
|
@@ -1592,175 +2064,23 @@ const FfiConverterTypeReachability = (() => {
|
|
|
1592
2064
|
case 2:
|
|
1593
2065
|
return Reachability.Public;
|
|
1594
2066
|
case 3:
|
|
1595
|
-
return Reachability.Private;
|
|
1596
|
-
default:
|
|
1597
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
writeIntoCursor(value, c) {
|
|
1601
|
-
switch (value) {
|
|
1602
|
-
case Reachability.Unknown:
|
|
1603
|
-
return c.writeI32(1);
|
|
1604
|
-
case Reachability.Public:
|
|
1605
|
-
return c.writeI32(2);
|
|
1606
|
-
case Reachability.Private:
|
|
1607
|
-
return c.writeI32(3);
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
allocationSize(value) {
|
|
1611
|
-
return 4;
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
return new FFIConverter();
|
|
1615
|
-
})();
|
|
1616
|
-
|
|
1617
|
-
// Enum: PathKind
|
|
1618
|
-
export let PathKind_Tags = /*#__PURE__*/function (PathKind_Tags) {
|
|
1619
|
-
PathKind_Tags["DirectDialed"] = "DirectDialed";
|
|
1620
|
-
PathKind_Tags["DirectPunched"] = "DirectPunched";
|
|
1621
|
-
PathKind_Tags["Relayed"] = "Relayed";
|
|
1622
|
-
return PathKind_Tags;
|
|
1623
|
-
}({});
|
|
1624
|
-
/**
|
|
1625
|
-
* Kind of usable connection path.
|
|
1626
|
-
*/
|
|
1627
|
-
export const PathKind = (() => {
|
|
1628
|
-
/**
|
|
1629
|
-
* A known address was dialed directly.
|
|
1630
|
-
*/
|
|
1631
|
-
class DirectDialed_ extends UniffiEnum {
|
|
1632
|
-
/**
|
|
1633
|
-
* @private
|
|
1634
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1635
|
-
*/
|
|
1636
|
-
[uniffiTypeNameSymbol] = "PathKind";
|
|
1637
|
-
tag = PathKind_Tags.DirectDialed;
|
|
1638
|
-
constructor() {
|
|
1639
|
-
super("PathKind", "DirectDialed");
|
|
1640
|
-
}
|
|
1641
|
-
static new() {
|
|
1642
|
-
return new DirectDialed_();
|
|
1643
|
-
}
|
|
1644
|
-
static instanceOf(obj) {
|
|
1645
|
-
return obj.tag === PathKind_Tags.DirectDialed;
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
/**
|
|
1649
|
-
* A direct path was established by hole punching.
|
|
1650
|
-
*/
|
|
1651
|
-
class DirectPunched_ extends UniffiEnum {
|
|
1652
|
-
/**
|
|
1653
|
-
* @private
|
|
1654
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1655
|
-
*/
|
|
1656
|
-
[uniffiTypeNameSymbol] = "PathKind";
|
|
1657
|
-
tag = PathKind_Tags.DirectPunched;
|
|
1658
|
-
constructor() {
|
|
1659
|
-
super("PathKind", "DirectPunched");
|
|
1660
|
-
}
|
|
1661
|
-
static new() {
|
|
1662
|
-
return new DirectPunched_();
|
|
1663
|
-
}
|
|
1664
|
-
static instanceOf(obj) {
|
|
1665
|
-
return obj.tag === PathKind_Tags.DirectPunched;
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
/**
|
|
1669
|
-
* Traffic is carried through a relay.
|
|
1670
|
-
*/
|
|
1671
|
-
class Relayed_ extends UniffiEnum {
|
|
1672
|
-
/**
|
|
1673
|
-
* @private
|
|
1674
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1675
|
-
*/
|
|
1676
|
-
[uniffiTypeNameSymbol] = "PathKind";
|
|
1677
|
-
tag = PathKind_Tags.Relayed;
|
|
1678
|
-
constructor(inner) {
|
|
1679
|
-
super("PathKind", "Relayed");
|
|
1680
|
-
this.inner = Object.freeze(inner);
|
|
1681
|
-
}
|
|
1682
|
-
static new(inner) {
|
|
1683
|
-
return new Relayed_(inner);
|
|
1684
|
-
}
|
|
1685
|
-
static instanceOf(obj) {
|
|
1686
|
-
return obj.tag === PathKind_Tags.Relayed;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
function instanceOf(obj) {
|
|
1690
|
-
return obj[uniffiTypeNameSymbol] === "PathKind";
|
|
1691
|
-
}
|
|
1692
|
-
return Object.freeze({
|
|
1693
|
-
instanceOf,
|
|
1694
|
-
DirectDialed: DirectDialed_,
|
|
1695
|
-
DirectPunched: DirectPunched_,
|
|
1696
|
-
Relayed: Relayed_
|
|
1697
|
-
});
|
|
1698
|
-
})();
|
|
1699
|
-
/**
|
|
1700
|
-
* Kind of usable connection path.
|
|
1701
|
-
*/
|
|
1702
|
-
|
|
1703
|
-
// FfiConverter for enum PathKind
|
|
1704
|
-
const FfiConverterTypePathKind = (() => {
|
|
1705
|
-
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1706
|
-
readFromCursor(c) {
|
|
1707
|
-
switch (c.readI32()) {
|
|
1708
|
-
case 1:
|
|
1709
|
-
return new PathKind.DirectDialed();
|
|
1710
|
-
case 2:
|
|
1711
|
-
return new PathKind.DirectPunched();
|
|
1712
|
-
case 3:
|
|
1713
|
-
return new PathKind.Relayed({
|
|
1714
|
-
relayPeerId: FfiConverterString.readFromCursor(c)
|
|
1715
|
-
});
|
|
2067
|
+
return Reachability.Private;
|
|
1716
2068
|
default:
|
|
1717
2069
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1718
2070
|
}
|
|
1719
2071
|
}
|
|
1720
2072
|
writeIntoCursor(value, c) {
|
|
1721
|
-
switch (value
|
|
1722
|
-
case
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
{
|
|
1729
|
-
c.writeI32(2);
|
|
1730
|
-
return;
|
|
1731
|
-
}
|
|
1732
|
-
case PathKind_Tags.Relayed:
|
|
1733
|
-
{
|
|
1734
|
-
c.writeI32(3);
|
|
1735
|
-
const inner = value.inner;
|
|
1736
|
-
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
1737
|
-
return;
|
|
1738
|
-
}
|
|
1739
|
-
default:
|
|
1740
|
-
// Throwing from here means that PathKind_Tags hasn't matched an ordinal.
|
|
1741
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2073
|
+
switch (value) {
|
|
2074
|
+
case Reachability.Unknown:
|
|
2075
|
+
return c.writeI32(1);
|
|
2076
|
+
case Reachability.Public:
|
|
2077
|
+
return c.writeI32(2);
|
|
2078
|
+
case Reachability.Private:
|
|
2079
|
+
return c.writeI32(3);
|
|
1742
2080
|
}
|
|
1743
2081
|
}
|
|
1744
2082
|
allocationSize(value) {
|
|
1745
|
-
|
|
1746
|
-
case PathKind_Tags.DirectDialed:
|
|
1747
|
-
{
|
|
1748
|
-
return 4;
|
|
1749
|
-
}
|
|
1750
|
-
case PathKind_Tags.DirectPunched:
|
|
1751
|
-
{
|
|
1752
|
-
return 4;
|
|
1753
|
-
}
|
|
1754
|
-
case PathKind_Tags.Relayed:
|
|
1755
|
-
{
|
|
1756
|
-
const inner = value.inner;
|
|
1757
|
-
let size = 4;
|
|
1758
|
-
size += FfiConverterString.allocationSize(inner.relayPeerId);
|
|
1759
|
-
return size;
|
|
1760
|
-
}
|
|
1761
|
-
default:
|
|
1762
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1763
|
-
}
|
|
2083
|
+
return 4;
|
|
1764
2084
|
}
|
|
1765
2085
|
}
|
|
1766
2086
|
return new FFIConverter();
|
|
@@ -1770,6 +2090,7 @@ const FfiConverterTypePathKind = (() => {
|
|
|
1770
2090
|
export let P2pEvent_Tags = /*#__PURE__*/function (P2pEvent_Tags) {
|
|
1771
2091
|
P2pEvent_Tags["EventsDropped"] = "EventsDropped";
|
|
1772
2092
|
P2pEvent_Tags["DriverFailed"] = "DriverFailed";
|
|
2093
|
+
P2pEvent_Tags["EndpointClosed"] = "EndpointClosed";
|
|
1773
2094
|
P2pEvent_Tags["ConnectionEstablished"] = "ConnectionEstablished";
|
|
1774
2095
|
P2pEvent_Tags["ConnectionClosed"] = "ConnectionClosed";
|
|
1775
2096
|
P2pEvent_Tags["ConnectionReplaced"] = "ConnectionReplaced";
|
|
@@ -1785,6 +2106,7 @@ export let P2pEvent_Tags = /*#__PURE__*/function (P2pEvent_Tags) {
|
|
|
1785
2106
|
P2pEvent_Tags["StreamClosed"] = "StreamClosed";
|
|
1786
2107
|
P2pEvent_Tags["EndpointError"] = "EndpointError";
|
|
1787
2108
|
P2pEvent_Tags["ReachabilityChanged"] = "ReachabilityChanged";
|
|
2109
|
+
P2pEvent_Tags["ListenAddressesChanged"] = "ListenAddressesChanged";
|
|
1788
2110
|
P2pEvent_Tags["PublicAddressesChanged"] = "PublicAddressesChanged";
|
|
1789
2111
|
P2pEvent_Tags["RelayReserved"] = "RelayReserved";
|
|
1790
2112
|
P2pEvent_Tags["RelayReservationLost"] = "RelayReservationLost";
|
|
@@ -1855,6 +2177,29 @@ export const P2pEvent = (() => {
|
|
|
1855
2177
|
return obj.tag === P2pEvent_Tags.DriverFailed;
|
|
1856
2178
|
}
|
|
1857
2179
|
}
|
|
2180
|
+
/**
|
|
2181
|
+
* The driver finished shutting down: its last event, after
|
|
2182
|
+
* [`P2pEndpoint::stop`](crate::P2pEndpoint::stop) or a
|
|
2183
|
+
* [`P2pEvent::DriverFailed`], when a failed driver tears down at once.
|
|
2184
|
+
*/
|
|
2185
|
+
class EndpointClosed_ extends UniffiEnum {
|
|
2186
|
+
/**
|
|
2187
|
+
* @private
|
|
2188
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2189
|
+
*/
|
|
2190
|
+
[uniffiTypeNameSymbol] = "P2pEvent";
|
|
2191
|
+
tag = P2pEvent_Tags.EndpointClosed;
|
|
2192
|
+
constructor(inner) {
|
|
2193
|
+
super("P2pEvent", "EndpointClosed");
|
|
2194
|
+
this.inner = Object.freeze(inner);
|
|
2195
|
+
}
|
|
2196
|
+
static new(inner) {
|
|
2197
|
+
return new EndpointClosed_(inner);
|
|
2198
|
+
}
|
|
2199
|
+
static instanceOf(obj) {
|
|
2200
|
+
return obj.tag === P2pEvent_Tags.EndpointClosed;
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
1858
2203
|
/**
|
|
1859
2204
|
* A peer went from disconnected to connected over a verified connection.
|
|
1860
2205
|
*/
|
|
@@ -2177,6 +2522,30 @@ export const P2pEvent = (() => {
|
|
|
2177
2522
|
return obj.tag === P2pEvent_Tags.ReachabilityChanged;
|
|
2178
2523
|
}
|
|
2179
2524
|
}
|
|
2525
|
+
/**
|
|
2526
|
+
* The listen set changed without a `listen` call, as when a
|
|
2527
|
+
* WebTransport listener's certificate rotates: `addrs` is the whole new
|
|
2528
|
+
* set, with `/p2p/<local>`, for the app to republish. External and
|
|
2529
|
+
* public address changes never fire it.
|
|
2530
|
+
*/
|
|
2531
|
+
class ListenAddressesChanged_ extends UniffiEnum {
|
|
2532
|
+
/**
|
|
2533
|
+
* @private
|
|
2534
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2535
|
+
*/
|
|
2536
|
+
[uniffiTypeNameSymbol] = "P2pEvent";
|
|
2537
|
+
tag = P2pEvent_Tags.ListenAddressesChanged;
|
|
2538
|
+
constructor(inner) {
|
|
2539
|
+
super("P2pEvent", "ListenAddressesChanged");
|
|
2540
|
+
this.inner = Object.freeze(inner);
|
|
2541
|
+
}
|
|
2542
|
+
static new(inner) {
|
|
2543
|
+
return new ListenAddressesChanged_(inner);
|
|
2544
|
+
}
|
|
2545
|
+
static instanceOf(obj) {
|
|
2546
|
+
return obj.tag === P2pEvent_Tags.ListenAddressesChanged;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2180
2549
|
/**
|
|
2181
2550
|
* AutoNAT confirmed a changed public address set.
|
|
2182
2551
|
*/
|
|
@@ -2654,6 +3023,7 @@ export const P2pEvent = (() => {
|
|
|
2654
3023
|
instanceOf,
|
|
2655
3024
|
EventsDropped: EventsDropped_,
|
|
2656
3025
|
DriverFailed: DriverFailed_,
|
|
3026
|
+
EndpointClosed: EndpointClosed_,
|
|
2657
3027
|
ConnectionEstablished: ConnectionEstablished_,
|
|
2658
3028
|
ConnectionClosed: ConnectionClosed_,
|
|
2659
3029
|
ConnectionReplaced: ConnectionReplaced_,
|
|
@@ -2669,6 +3039,7 @@ export const P2pEvent = (() => {
|
|
|
2669
3039
|
StreamClosed: StreamClosed_,
|
|
2670
3040
|
EndpointError: EndpointError_,
|
|
2671
3041
|
ReachabilityChanged: ReachabilityChanged_,
|
|
3042
|
+
ListenAddressesChanged: ListenAddressesChanged_,
|
|
2672
3043
|
PublicAddressesChanged: PublicAddressesChanged_,
|
|
2673
3044
|
RelayReserved: RelayReserved_,
|
|
2674
3045
|
RelayReservationLost: RelayReservationLost_,
|
|
@@ -2714,45 +3085,51 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2714
3085
|
detail: FfiConverterString.readFromCursor(c)
|
|
2715
3086
|
});
|
|
2716
3087
|
case 3:
|
|
3088
|
+
return new P2pEvent.EndpointClosed({
|
|
3089
|
+
outcome: FfiConverterTypeCloseOutcome.readFromCursor(c),
|
|
3090
|
+
unfinished: FfiConverterSequenceTypeUnfinishedConnection.readFromCursor(c)
|
|
3091
|
+
});
|
|
3092
|
+
case 4:
|
|
2717
3093
|
return new P2pEvent.ConnectionEstablished({
|
|
2718
3094
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2719
3095
|
connId: FfiConverterUInt64.readFromCursor(c)
|
|
2720
3096
|
});
|
|
2721
|
-
case
|
|
3097
|
+
case 5:
|
|
2722
3098
|
return new P2pEvent.ConnectionClosed({
|
|
2723
3099
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2724
|
-
connId: FfiConverterUInt64.readFromCursor(c)
|
|
3100
|
+
connId: FfiConverterUInt64.readFromCursor(c),
|
|
3101
|
+
reason: FfiConverterTypeConnectionCloseReason.readFromCursor(c)
|
|
2725
3102
|
});
|
|
2726
|
-
case
|
|
3103
|
+
case 6:
|
|
2727
3104
|
return new P2pEvent.ConnectionReplaced({
|
|
2728
3105
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2729
3106
|
oldConnId: FfiConverterUInt64.readFromCursor(c),
|
|
2730
3107
|
newConnId: FfiConverterUInt64.readFromCursor(c)
|
|
2731
3108
|
});
|
|
2732
|
-
case
|
|
3109
|
+
case 7:
|
|
2733
3110
|
return new P2pEvent.PeerReady({
|
|
2734
3111
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2735
3112
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2736
3113
|
protocols: FfiConverterSequenceString.readFromCursor(c)
|
|
2737
3114
|
});
|
|
2738
|
-
case
|
|
3115
|
+
case 8:
|
|
2739
3116
|
return new P2pEvent.IdentifyReceived({
|
|
2740
3117
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2741
3118
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2742
3119
|
info: FfiConverterTypeIdentifyInfo.readFromCursor(c)
|
|
2743
3120
|
});
|
|
2744
|
-
case
|
|
3121
|
+
case 9:
|
|
2745
3122
|
return new P2pEvent.PingRttMeasured({
|
|
2746
3123
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2747
3124
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2748
3125
|
rttMs: FfiConverterUInt64.readFromCursor(c)
|
|
2749
3126
|
});
|
|
2750
|
-
case
|
|
3127
|
+
case 10:
|
|
2751
3128
|
return new P2pEvent.PingTimeout({
|
|
2752
3129
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2753
3130
|
connId: FfiConverterUInt64.readFromCursor(c)
|
|
2754
3131
|
});
|
|
2755
|
-
case
|
|
3132
|
+
case 11:
|
|
2756
3133
|
return new P2pEvent.StreamReady({
|
|
2757
3134
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2758
3135
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
@@ -2760,39 +3137,39 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2760
3137
|
protocolId: FfiConverterString.readFromCursor(c),
|
|
2761
3138
|
initiatedLocally: FfiConverterBool.readFromCursor(c)
|
|
2762
3139
|
});
|
|
2763
|
-
case
|
|
3140
|
+
case 12:
|
|
2764
3141
|
return new P2pEvent.StreamData({
|
|
2765
3142
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2766
3143
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2767
3144
|
streamId: FfiConverterUInt64.readFromCursor(c),
|
|
2768
3145
|
data: FfiConverterArrayBuffer.readFromCursor(c)
|
|
2769
3146
|
});
|
|
2770
|
-
case
|
|
3147
|
+
case 13:
|
|
2771
3148
|
return new P2pEvent.StreamWriteAccepted({
|
|
2772
3149
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2773
3150
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2774
3151
|
streamId: FfiConverterUInt64.readFromCursor(c)
|
|
2775
3152
|
});
|
|
2776
|
-
case
|
|
3153
|
+
case 14:
|
|
2777
3154
|
return new P2pEvent.StreamWriteStopped({
|
|
2778
3155
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2779
3156
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2780
3157
|
streamId: FfiConverterUInt64.readFromCursor(c),
|
|
2781
3158
|
errorCode: FfiConverterUInt64.readFromCursor(c)
|
|
2782
3159
|
});
|
|
2783
|
-
case
|
|
3160
|
+
case 15:
|
|
2784
3161
|
return new P2pEvent.StreamRemoteWriteClosed({
|
|
2785
3162
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2786
3163
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2787
3164
|
streamId: FfiConverterUInt64.readFromCursor(c)
|
|
2788
3165
|
});
|
|
2789
|
-
case
|
|
3166
|
+
case 16:
|
|
2790
3167
|
return new P2pEvent.StreamClosed({
|
|
2791
3168
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2792
3169
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2793
3170
|
streamId: FfiConverterUInt64.readFromCursor(c)
|
|
2794
3171
|
});
|
|
2795
|
-
case
|
|
3172
|
+
case 17:
|
|
2796
3173
|
return new P2pEvent.EndpointError({
|
|
2797
3174
|
kind: FfiConverterTypeEndpointErrorKind.readFromCursor(c),
|
|
2798
3175
|
peerId: FfiConverterOptionalString.readFromCursor(c),
|
|
@@ -2800,39 +3177,43 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2800
3177
|
streamId: FfiConverterOptionalUInt64.readFromCursor(c),
|
|
2801
3178
|
detail: FfiConverterString.readFromCursor(c)
|
|
2802
3179
|
});
|
|
2803
|
-
case
|
|
3180
|
+
case 18:
|
|
2804
3181
|
return new P2pEvent.ReachabilityChanged({
|
|
2805
3182
|
previous: FfiConverterTypeReachability.readFromCursor(c),
|
|
2806
3183
|
current: FfiConverterTypeReachability.readFromCursor(c),
|
|
2807
3184
|
confirmedAddrs: FfiConverterSequenceString.readFromCursor(c)
|
|
2808
3185
|
});
|
|
2809
|
-
case
|
|
3186
|
+
case 19:
|
|
3187
|
+
return new P2pEvent.ListenAddressesChanged({
|
|
3188
|
+
addrs: FfiConverterSequenceString.readFromCursor(c)
|
|
3189
|
+
});
|
|
3190
|
+
case 20:
|
|
2810
3191
|
return new P2pEvent.PublicAddressesChanged({
|
|
2811
3192
|
addrs: FfiConverterSequenceString.readFromCursor(c)
|
|
2812
3193
|
});
|
|
2813
|
-
case
|
|
3194
|
+
case 21:
|
|
2814
3195
|
return new P2pEvent.RelayReserved({
|
|
2815
3196
|
relayPeerId: FfiConverterString.readFromCursor(c),
|
|
2816
3197
|
expiresUnixSecs: FfiConverterOptionalUInt64.readFromCursor(c)
|
|
2817
3198
|
});
|
|
2818
|
-
case
|
|
3199
|
+
case 22:
|
|
2819
3200
|
return new P2pEvent.RelayReservationLost({
|
|
2820
3201
|
relayPeerId: FfiConverterString.readFromCursor(c)
|
|
2821
3202
|
});
|
|
2822
|
-
case
|
|
3203
|
+
case 23:
|
|
2823
3204
|
return new P2pEvent.PathEstablished({
|
|
2824
3205
|
connectId: FfiConverterUInt64.readFromCursor(c),
|
|
2825
3206
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2826
3207
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
2827
3208
|
path: FfiConverterTypePathKind.readFromCursor(c)
|
|
2828
3209
|
});
|
|
2829
|
-
case
|
|
3210
|
+
case 24:
|
|
2830
3211
|
return new P2pEvent.InboundPathEstablished({
|
|
2831
3212
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2832
3213
|
path: FfiConverterTypePathKind.readFromCursor(c),
|
|
2833
3214
|
connId: FfiConverterUInt64.readFromCursor(c)
|
|
2834
3215
|
});
|
|
2835
|
-
case
|
|
3216
|
+
case 25:
|
|
2836
3217
|
return new P2pEvent.PathUpgraded({
|
|
2837
3218
|
connectId: FfiConverterUInt64.readFromCursor(c),
|
|
2838
3219
|
peerId: FfiConverterString.readFromCursor(c),
|
|
@@ -2841,31 +3222,31 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2841
3222
|
oldConnId: FfiConverterUInt64.readFromCursor(c),
|
|
2842
3223
|
newConnId: FfiConverterUInt64.readFromCursor(c)
|
|
2843
3224
|
});
|
|
2844
|
-
case
|
|
3225
|
+
case 26:
|
|
2845
3226
|
return new P2pEvent.HolePunchFailed({
|
|
2846
3227
|
connectId: FfiConverterUInt64.readFromCursor(c),
|
|
2847
3228
|
attempt: FfiConverterUInt32.readFromCursor(c),
|
|
2848
3229
|
reason: FfiConverterString.readFromCursor(c)
|
|
2849
3230
|
});
|
|
2850
|
-
case
|
|
3231
|
+
case 27:
|
|
2851
3232
|
return new P2pEvent.ConnectFailed({
|
|
2852
3233
|
connectId: FfiConverterUInt64.readFromCursor(c),
|
|
2853
3234
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2854
3235
|
kind: FfiConverterTypeNatErrorKind.readFromCursor(c),
|
|
2855
3236
|
detail: FfiConverterString.readFromCursor(c)
|
|
2856
3237
|
});
|
|
2857
|
-
case
|
|
3238
|
+
case 28:
|
|
2858
3239
|
return new P2pEvent.ConnectCancelled({
|
|
2859
3240
|
connectId: FfiConverterUInt64.readFromCursor(c),
|
|
2860
3241
|
peerId: FfiConverterString.readFromCursor(c)
|
|
2861
3242
|
});
|
|
2862
|
-
case
|
|
3243
|
+
case 29:
|
|
2863
3244
|
return new P2pEvent.InboundDirectUpgrade({
|
|
2864
3245
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2865
3246
|
oldConnId: FfiConverterUInt64.readFromCursor(c),
|
|
2866
3247
|
newConnId: FfiConverterUInt64.readFromCursor(c)
|
|
2867
3248
|
});
|
|
2868
|
-
case
|
|
3249
|
+
case 30:
|
|
2869
3250
|
return new P2pEvent.Message({
|
|
2870
3251
|
fromPeerId: FfiConverterString.readFromCursor(c),
|
|
2871
3252
|
topics: FfiConverterSequenceString.readFromCursor(c),
|
|
@@ -2873,55 +3254,55 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2873
3254
|
seqno: FfiConverterArrayBuffer.readFromCursor(c),
|
|
2874
3255
|
signed: FfiConverterBool.readFromCursor(c)
|
|
2875
3256
|
});
|
|
2876
|
-
case
|
|
3257
|
+
case 31:
|
|
2877
3258
|
return new P2pEvent.PeerSubscribed({
|
|
2878
3259
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2879
3260
|
topic: FfiConverterString.readFromCursor(c)
|
|
2880
3261
|
});
|
|
2881
|
-
case
|
|
3262
|
+
case 32:
|
|
2882
3263
|
return new P2pEvent.PeerUnsubscribed({
|
|
2883
3264
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2884
3265
|
topic: FfiConverterString.readFromCursor(c)
|
|
2885
3266
|
});
|
|
2886
|
-
case
|
|
3267
|
+
case 33:
|
|
2887
3268
|
return new P2pEvent.GossipsubOutboundFailure({
|
|
2888
3269
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2889
3270
|
reason: FfiConverterString.readFromCursor(c)
|
|
2890
3271
|
});
|
|
2891
|
-
case
|
|
3272
|
+
case 34:
|
|
2892
3273
|
return new P2pEvent.GossipsubProtocolViolation({
|
|
2893
3274
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2894
3275
|
reason: FfiConverterString.readFromCursor(c)
|
|
2895
3276
|
});
|
|
2896
|
-
case
|
|
3277
|
+
case 35:
|
|
2897
3278
|
return new P2pEvent.PeerDiscovered({
|
|
2898
3279
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2899
3280
|
addrs: FfiConverterSequenceString.readFromCursor(c),
|
|
2900
3281
|
source: FfiConverterTypeDiscoverySource.readFromCursor(c)
|
|
2901
3282
|
});
|
|
2902
|
-
case
|
|
3283
|
+
case 36:
|
|
2903
3284
|
return new P2pEvent.PeerUpdated({
|
|
2904
3285
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2905
3286
|
addrs: FfiConverterSequenceString.readFromCursor(c),
|
|
2906
3287
|
source: FfiConverterTypeDiscoverySource.readFromCursor(c)
|
|
2907
3288
|
});
|
|
2908
|
-
case
|
|
3289
|
+
case 37:
|
|
2909
3290
|
return new P2pEvent.PeerExpired({
|
|
2910
3291
|
peerId: FfiConverterString.readFromCursor(c)
|
|
2911
3292
|
});
|
|
2912
|
-
case
|
|
3293
|
+
case 38:
|
|
2913
3294
|
return new P2pEvent.DiscoveryDialFailed({
|
|
2914
3295
|
peerId: FfiConverterString.readFromCursor(c),
|
|
2915
3296
|
reason: FfiConverterString.readFromCursor(c)
|
|
2916
3297
|
});
|
|
2917
|
-
case
|
|
3298
|
+
case 39:
|
|
2918
3299
|
return new P2pEvent.MdnsFailed({
|
|
2919
3300
|
kind: FfiConverterTypeMdnsFailureKind.readFromCursor(c),
|
|
2920
3301
|
detail: FfiConverterString.readFromCursor(c)
|
|
2921
3302
|
});
|
|
2922
|
-
case
|
|
3303
|
+
case 40:
|
|
2923
3304
|
return new P2pEvent.MdnsRecovered();
|
|
2924
|
-
case
|
|
3305
|
+
case 41:
|
|
2925
3306
|
return new P2pEvent.DiscoveryProtocolViolation({
|
|
2926
3307
|
peerId: FfiConverterOptionalString.readFromCursor(c),
|
|
2927
3308
|
source: FfiConverterTypeDiscoverySource.readFromCursor(c),
|
|
@@ -2951,25 +3332,34 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2951
3332
|
FfiConverterString.writeIntoCursor(inner.detail, c);
|
|
2952
3333
|
return;
|
|
2953
3334
|
}
|
|
2954
|
-
case P2pEvent_Tags.
|
|
3335
|
+
case P2pEvent_Tags.EndpointClosed:
|
|
2955
3336
|
{
|
|
2956
3337
|
c.writeI32(3);
|
|
2957
3338
|
const inner = value.inner;
|
|
3339
|
+
FfiConverterTypeCloseOutcome.writeIntoCursor(inner.outcome, c);
|
|
3340
|
+
FfiConverterSequenceTypeUnfinishedConnection.writeIntoCursor(inner.unfinished, c);
|
|
3341
|
+
return;
|
|
3342
|
+
}
|
|
3343
|
+
case P2pEvent_Tags.ConnectionEstablished:
|
|
3344
|
+
{
|
|
3345
|
+
c.writeI32(4);
|
|
3346
|
+
const inner = value.inner;
|
|
2958
3347
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
2959
3348
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
2960
3349
|
return;
|
|
2961
3350
|
}
|
|
2962
3351
|
case P2pEvent_Tags.ConnectionClosed:
|
|
2963
3352
|
{
|
|
2964
|
-
c.writeI32(
|
|
3353
|
+
c.writeI32(5);
|
|
2965
3354
|
const inner = value.inner;
|
|
2966
3355
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
2967
3356
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
3357
|
+
FfiConverterTypeConnectionCloseReason.writeIntoCursor(inner.reason, c);
|
|
2968
3358
|
return;
|
|
2969
3359
|
}
|
|
2970
3360
|
case P2pEvent_Tags.ConnectionReplaced:
|
|
2971
3361
|
{
|
|
2972
|
-
c.writeI32(
|
|
3362
|
+
c.writeI32(6);
|
|
2973
3363
|
const inner = value.inner;
|
|
2974
3364
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
2975
3365
|
FfiConverterUInt64.writeIntoCursor(inner.oldConnId, c);
|
|
@@ -2978,7 +3368,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2978
3368
|
}
|
|
2979
3369
|
case P2pEvent_Tags.PeerReady:
|
|
2980
3370
|
{
|
|
2981
|
-
c.writeI32(
|
|
3371
|
+
c.writeI32(7);
|
|
2982
3372
|
const inner = value.inner;
|
|
2983
3373
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
2984
3374
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -2987,7 +3377,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2987
3377
|
}
|
|
2988
3378
|
case P2pEvent_Tags.IdentifyReceived:
|
|
2989
3379
|
{
|
|
2990
|
-
c.writeI32(
|
|
3380
|
+
c.writeI32(8);
|
|
2991
3381
|
const inner = value.inner;
|
|
2992
3382
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
2993
3383
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -2996,7 +3386,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2996
3386
|
}
|
|
2997
3387
|
case P2pEvent_Tags.PingRttMeasured:
|
|
2998
3388
|
{
|
|
2999
|
-
c.writeI32(
|
|
3389
|
+
c.writeI32(9);
|
|
3000
3390
|
const inner = value.inner;
|
|
3001
3391
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3002
3392
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3005,7 +3395,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3005
3395
|
}
|
|
3006
3396
|
case P2pEvent_Tags.PingTimeout:
|
|
3007
3397
|
{
|
|
3008
|
-
c.writeI32(
|
|
3398
|
+
c.writeI32(10);
|
|
3009
3399
|
const inner = value.inner;
|
|
3010
3400
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3011
3401
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3013,7 +3403,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3013
3403
|
}
|
|
3014
3404
|
case P2pEvent_Tags.StreamReady:
|
|
3015
3405
|
{
|
|
3016
|
-
c.writeI32(
|
|
3406
|
+
c.writeI32(11);
|
|
3017
3407
|
const inner = value.inner;
|
|
3018
3408
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3019
3409
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3024,7 +3414,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3024
3414
|
}
|
|
3025
3415
|
case P2pEvent_Tags.StreamData:
|
|
3026
3416
|
{
|
|
3027
|
-
c.writeI32(
|
|
3417
|
+
c.writeI32(12);
|
|
3028
3418
|
const inner = value.inner;
|
|
3029
3419
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3030
3420
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3034,7 +3424,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3034
3424
|
}
|
|
3035
3425
|
case P2pEvent_Tags.StreamWriteAccepted:
|
|
3036
3426
|
{
|
|
3037
|
-
c.writeI32(
|
|
3427
|
+
c.writeI32(13);
|
|
3038
3428
|
const inner = value.inner;
|
|
3039
3429
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3040
3430
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3043,7 +3433,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3043
3433
|
}
|
|
3044
3434
|
case P2pEvent_Tags.StreamWriteStopped:
|
|
3045
3435
|
{
|
|
3046
|
-
c.writeI32(
|
|
3436
|
+
c.writeI32(14);
|
|
3047
3437
|
const inner = value.inner;
|
|
3048
3438
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3049
3439
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3053,7 +3443,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3053
3443
|
}
|
|
3054
3444
|
case P2pEvent_Tags.StreamRemoteWriteClosed:
|
|
3055
3445
|
{
|
|
3056
|
-
c.writeI32(
|
|
3446
|
+
c.writeI32(15);
|
|
3057
3447
|
const inner = value.inner;
|
|
3058
3448
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3059
3449
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3062,7 +3452,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3062
3452
|
}
|
|
3063
3453
|
case P2pEvent_Tags.StreamClosed:
|
|
3064
3454
|
{
|
|
3065
|
-
c.writeI32(
|
|
3455
|
+
c.writeI32(16);
|
|
3066
3456
|
const inner = value.inner;
|
|
3067
3457
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3068
3458
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3071,7 +3461,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3071
3461
|
}
|
|
3072
3462
|
case P2pEvent_Tags.EndpointError:
|
|
3073
3463
|
{
|
|
3074
|
-
c.writeI32(
|
|
3464
|
+
c.writeI32(17);
|
|
3075
3465
|
const inner = value.inner;
|
|
3076
3466
|
FfiConverterTypeEndpointErrorKind.writeIntoCursor(inner.kind, c);
|
|
3077
3467
|
FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3082,23 +3472,30 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3082
3472
|
}
|
|
3083
3473
|
case P2pEvent_Tags.ReachabilityChanged:
|
|
3084
3474
|
{
|
|
3085
|
-
c.writeI32(
|
|
3475
|
+
c.writeI32(18);
|
|
3086
3476
|
const inner = value.inner;
|
|
3087
3477
|
FfiConverterTypeReachability.writeIntoCursor(inner.previous, c);
|
|
3088
3478
|
FfiConverterTypeReachability.writeIntoCursor(inner.current, c);
|
|
3089
3479
|
FfiConverterSequenceString.writeIntoCursor(inner.confirmedAddrs, c);
|
|
3090
3480
|
return;
|
|
3091
3481
|
}
|
|
3482
|
+
case P2pEvent_Tags.ListenAddressesChanged:
|
|
3483
|
+
{
|
|
3484
|
+
c.writeI32(19);
|
|
3485
|
+
const inner = value.inner;
|
|
3486
|
+
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
3487
|
+
return;
|
|
3488
|
+
}
|
|
3092
3489
|
case P2pEvent_Tags.PublicAddressesChanged:
|
|
3093
3490
|
{
|
|
3094
|
-
c.writeI32(
|
|
3491
|
+
c.writeI32(20);
|
|
3095
3492
|
const inner = value.inner;
|
|
3096
3493
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
3097
3494
|
return;
|
|
3098
3495
|
}
|
|
3099
3496
|
case P2pEvent_Tags.RelayReserved:
|
|
3100
3497
|
{
|
|
3101
|
-
c.writeI32(
|
|
3498
|
+
c.writeI32(21);
|
|
3102
3499
|
const inner = value.inner;
|
|
3103
3500
|
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
3104
3501
|
FfiConverterOptionalUInt64.writeIntoCursor(inner.expiresUnixSecs, c);
|
|
@@ -3106,14 +3503,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3106
3503
|
}
|
|
3107
3504
|
case P2pEvent_Tags.RelayReservationLost:
|
|
3108
3505
|
{
|
|
3109
|
-
c.writeI32(
|
|
3506
|
+
c.writeI32(22);
|
|
3110
3507
|
const inner = value.inner;
|
|
3111
3508
|
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
3112
3509
|
return;
|
|
3113
3510
|
}
|
|
3114
3511
|
case P2pEvent_Tags.PathEstablished:
|
|
3115
3512
|
{
|
|
3116
|
-
c.writeI32(
|
|
3513
|
+
c.writeI32(23);
|
|
3117
3514
|
const inner = value.inner;
|
|
3118
3515
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3119
3516
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3123,7 +3520,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3123
3520
|
}
|
|
3124
3521
|
case P2pEvent_Tags.InboundPathEstablished:
|
|
3125
3522
|
{
|
|
3126
|
-
c.writeI32(
|
|
3523
|
+
c.writeI32(24);
|
|
3127
3524
|
const inner = value.inner;
|
|
3128
3525
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3129
3526
|
FfiConverterTypePathKind.writeIntoCursor(inner.path, c);
|
|
@@ -3132,7 +3529,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3132
3529
|
}
|
|
3133
3530
|
case P2pEvent_Tags.PathUpgraded:
|
|
3134
3531
|
{
|
|
3135
|
-
c.writeI32(
|
|
3532
|
+
c.writeI32(25);
|
|
3136
3533
|
const inner = value.inner;
|
|
3137
3534
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3138
3535
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3144,7 +3541,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3144
3541
|
}
|
|
3145
3542
|
case P2pEvent_Tags.HolePunchFailed:
|
|
3146
3543
|
{
|
|
3147
|
-
c.writeI32(
|
|
3544
|
+
c.writeI32(26);
|
|
3148
3545
|
const inner = value.inner;
|
|
3149
3546
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3150
3547
|
FfiConverterUInt32.writeIntoCursor(inner.attempt, c);
|
|
@@ -3153,7 +3550,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3153
3550
|
}
|
|
3154
3551
|
case P2pEvent_Tags.ConnectFailed:
|
|
3155
3552
|
{
|
|
3156
|
-
c.writeI32(
|
|
3553
|
+
c.writeI32(27);
|
|
3157
3554
|
const inner = value.inner;
|
|
3158
3555
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3159
3556
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3163,7 +3560,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3163
3560
|
}
|
|
3164
3561
|
case P2pEvent_Tags.ConnectCancelled:
|
|
3165
3562
|
{
|
|
3166
|
-
c.writeI32(
|
|
3563
|
+
c.writeI32(28);
|
|
3167
3564
|
const inner = value.inner;
|
|
3168
3565
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3169
3566
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3171,7 +3568,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3171
3568
|
}
|
|
3172
3569
|
case P2pEvent_Tags.InboundDirectUpgrade:
|
|
3173
3570
|
{
|
|
3174
|
-
c.writeI32(
|
|
3571
|
+
c.writeI32(29);
|
|
3175
3572
|
const inner = value.inner;
|
|
3176
3573
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3177
3574
|
FfiConverterUInt64.writeIntoCursor(inner.oldConnId, c);
|
|
@@ -3180,7 +3577,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3180
3577
|
}
|
|
3181
3578
|
case P2pEvent_Tags.Message:
|
|
3182
3579
|
{
|
|
3183
|
-
c.writeI32(
|
|
3580
|
+
c.writeI32(30);
|
|
3184
3581
|
const inner = value.inner;
|
|
3185
3582
|
FfiConverterString.writeIntoCursor(inner.fromPeerId, c);
|
|
3186
3583
|
FfiConverterSequenceString.writeIntoCursor(inner.topics, c);
|
|
@@ -3191,7 +3588,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3191
3588
|
}
|
|
3192
3589
|
case P2pEvent_Tags.PeerSubscribed:
|
|
3193
3590
|
{
|
|
3194
|
-
c.writeI32(
|
|
3591
|
+
c.writeI32(31);
|
|
3195
3592
|
const inner = value.inner;
|
|
3196
3593
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3197
3594
|
FfiConverterString.writeIntoCursor(inner.topic, c);
|
|
@@ -3199,7 +3596,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3199
3596
|
}
|
|
3200
3597
|
case P2pEvent_Tags.PeerUnsubscribed:
|
|
3201
3598
|
{
|
|
3202
|
-
c.writeI32(
|
|
3599
|
+
c.writeI32(32);
|
|
3203
3600
|
const inner = value.inner;
|
|
3204
3601
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3205
3602
|
FfiConverterString.writeIntoCursor(inner.topic, c);
|
|
@@ -3207,7 +3604,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3207
3604
|
}
|
|
3208
3605
|
case P2pEvent_Tags.GossipsubOutboundFailure:
|
|
3209
3606
|
{
|
|
3210
|
-
c.writeI32(
|
|
3607
|
+
c.writeI32(33);
|
|
3211
3608
|
const inner = value.inner;
|
|
3212
3609
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3213
3610
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
@@ -3215,7 +3612,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3215
3612
|
}
|
|
3216
3613
|
case P2pEvent_Tags.GossipsubProtocolViolation:
|
|
3217
3614
|
{
|
|
3218
|
-
c.writeI32(
|
|
3615
|
+
c.writeI32(34);
|
|
3219
3616
|
const inner = value.inner;
|
|
3220
3617
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3221
3618
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
@@ -3223,7 +3620,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3223
3620
|
}
|
|
3224
3621
|
case P2pEvent_Tags.PeerDiscovered:
|
|
3225
3622
|
{
|
|
3226
|
-
c.writeI32(
|
|
3623
|
+
c.writeI32(35);
|
|
3227
3624
|
const inner = value.inner;
|
|
3228
3625
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3229
3626
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
@@ -3232,7 +3629,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3232
3629
|
}
|
|
3233
3630
|
case P2pEvent_Tags.PeerUpdated:
|
|
3234
3631
|
{
|
|
3235
|
-
c.writeI32(
|
|
3632
|
+
c.writeI32(36);
|
|
3236
3633
|
const inner = value.inner;
|
|
3237
3634
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3238
3635
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
@@ -3241,14 +3638,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3241
3638
|
}
|
|
3242
3639
|
case P2pEvent_Tags.PeerExpired:
|
|
3243
3640
|
{
|
|
3244
|
-
c.writeI32(
|
|
3641
|
+
c.writeI32(37);
|
|
3245
3642
|
const inner = value.inner;
|
|
3246
3643
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3247
3644
|
return;
|
|
3248
3645
|
}
|
|
3249
3646
|
case P2pEvent_Tags.DiscoveryDialFailed:
|
|
3250
3647
|
{
|
|
3251
|
-
c.writeI32(
|
|
3648
|
+
c.writeI32(38);
|
|
3252
3649
|
const inner = value.inner;
|
|
3253
3650
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3254
3651
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
@@ -3256,7 +3653,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3256
3653
|
}
|
|
3257
3654
|
case P2pEvent_Tags.MdnsFailed:
|
|
3258
3655
|
{
|
|
3259
|
-
c.writeI32(
|
|
3656
|
+
c.writeI32(39);
|
|
3260
3657
|
const inner = value.inner;
|
|
3261
3658
|
FfiConverterTypeMdnsFailureKind.writeIntoCursor(inner.kind, c);
|
|
3262
3659
|
FfiConverterString.writeIntoCursor(inner.detail, c);
|
|
@@ -3264,12 +3661,12 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3264
3661
|
}
|
|
3265
3662
|
case P2pEvent_Tags.MdnsRecovered:
|
|
3266
3663
|
{
|
|
3267
|
-
c.writeI32(
|
|
3664
|
+
c.writeI32(40);
|
|
3268
3665
|
return;
|
|
3269
3666
|
}
|
|
3270
3667
|
case P2pEvent_Tags.DiscoveryProtocolViolation:
|
|
3271
3668
|
{
|
|
3272
|
-
c.writeI32(
|
|
3669
|
+
c.writeI32(41);
|
|
3273
3670
|
const inner = value.inner;
|
|
3274
3671
|
FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
|
|
3275
3672
|
FfiConverterTypeDiscoverySource.writeIntoCursor(inner.source, c);
|
|
@@ -3301,6 +3698,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3301
3698
|
size += FfiConverterString.allocationSize(inner.detail);
|
|
3302
3699
|
return size;
|
|
3303
3700
|
}
|
|
3701
|
+
case P2pEvent_Tags.EndpointClosed:
|
|
3702
|
+
{
|
|
3703
|
+
const inner = value.inner;
|
|
3704
|
+
let size = 4;
|
|
3705
|
+
size += FfiConverterTypeCloseOutcome.allocationSize(inner.outcome);
|
|
3706
|
+
size += FfiConverterSequenceTypeUnfinishedConnection.allocationSize(inner.unfinished);
|
|
3707
|
+
return size;
|
|
3708
|
+
}
|
|
3304
3709
|
case P2pEvent_Tags.ConnectionEstablished:
|
|
3305
3710
|
{
|
|
3306
3711
|
const inner = value.inner;
|
|
@@ -3315,6 +3720,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3315
3720
|
let size = 4;
|
|
3316
3721
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3317
3722
|
size += FfiConverterUInt64.allocationSize(inner.connId);
|
|
3723
|
+
size += FfiConverterTypeConnectionCloseReason.allocationSize(inner.reason);
|
|
3318
3724
|
return size;
|
|
3319
3725
|
}
|
|
3320
3726
|
case P2pEvent_Tags.ConnectionReplaced:
|
|
@@ -3439,6 +3845,13 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3439
3845
|
size += FfiConverterSequenceString.allocationSize(inner.confirmedAddrs);
|
|
3440
3846
|
return size;
|
|
3441
3847
|
}
|
|
3848
|
+
case P2pEvent_Tags.ListenAddressesChanged:
|
|
3849
|
+
{
|
|
3850
|
+
const inner = value.inner;
|
|
3851
|
+
let size = 4;
|
|
3852
|
+
size += FfiConverterSequenceString.allocationSize(inner.addrs);
|
|
3853
|
+
return size;
|
|
3854
|
+
}
|
|
3442
3855
|
case P2pEvent_Tags.PublicAddressesChanged:
|
|
3443
3856
|
{
|
|
3444
3857
|
const inner = value.inner;
|
|
@@ -3634,15 +4047,15 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3634
4047
|
return new FFIConverter();
|
|
3635
4048
|
})();
|
|
3636
4049
|
|
|
3637
|
-
// FfiConverter for string | undefined
|
|
3638
|
-
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
3639
|
-
|
|
3640
4050
|
// FfiConverter for Array<string>
|
|
3641
4051
|
const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
|
|
3642
4052
|
|
|
3643
4053
|
// FfiConverter for Array<string> | undefined
|
|
3644
4054
|
const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
|
|
3645
4055
|
|
|
4056
|
+
// FfiConverter for string | undefined
|
|
4057
|
+
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
4058
|
+
|
|
3646
4059
|
// FfiConverter for DiscoveryOptions | undefined
|
|
3647
4060
|
const FfiConverterOptionalTypeDiscoveryOptions = new FfiConverterOptional(FfiConverterTypeDiscoveryOptions);
|
|
3648
4061
|
|
|
@@ -3658,6 +4071,9 @@ const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
|
3658
4071
|
// FfiConverter for Array<bigint>
|
|
3659
4072
|
const FfiConverterSequenceUInt64 = new FfiConverterArray(FfiConverterUInt64);
|
|
3660
4073
|
|
|
4074
|
+
// FfiConverter for Array<UnfinishedConnection>
|
|
4075
|
+
const FfiConverterSequenceTypeUnfinishedConnection = new FfiConverterArray(FfiConverterTypeUnfinishedConnection);
|
|
4076
|
+
|
|
3661
4077
|
/**
|
|
3662
4078
|
* This should be called before anything else.
|
|
3663
4079
|
*
|
|
@@ -3680,8 +4096,10 @@ function uniffiEnsureInitialized() {
|
|
|
3680
4096
|
export default Object.freeze({
|
|
3681
4097
|
initialize: uniffiEnsureInitialized,
|
|
3682
4098
|
converters: {
|
|
4099
|
+
FfiConverterTypeCloseOutcome,
|
|
3683
4100
|
FfiConverterTypeConfigCapability,
|
|
3684
4101
|
FfiConverterTypeConnectTarget,
|
|
4102
|
+
FfiConverterTypeConnectionCloseReason,
|
|
3685
4103
|
FfiConverterTypeConnectionInfo,
|
|
3686
4104
|
FfiConverterTypeDiscoveryOptions,
|
|
3687
4105
|
FfiConverterTypeDiscoverySource,
|
|
@@ -3698,7 +4116,8 @@ export default Object.freeze({
|
|
|
3698
4116
|
FfiConverterTypeP2pEvent,
|
|
3699
4117
|
FfiConverterTypePathKind,
|
|
3700
4118
|
FfiConverterTypeReachability,
|
|
3701
|
-
FfiConverterTypeRelayReservationInfo
|
|
4119
|
+
FfiConverterTypeRelayReservationInfo,
|
|
4120
|
+
FfiConverterTypeUnfinishedConnection
|
|
3702
4121
|
}
|
|
3703
4122
|
});
|
|
3704
4123
|
//# sourceMappingURL=minip2p_ffi_core.js.map
|