@minip2p/react-native 0.6.0 → 0.7.0
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/README.md +1 -1
- 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 +14 -175
- package/cpp/generated/minip2p_ffi.hpp +2 -10
- package/lib/module/adapter.js +23 -78
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi-ffi.js.map +1 -1
- package/lib/module/generated/minip2p_ffi.js +211 -118
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/typescript/src/adapter.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts +3 -11
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +204 -125
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +22 -142
- package/src/generated/minip2p_ffi-ffi.ts +3 -11
- package/src/generated/minip2p_ffi.ts +288 -223
|
@@ -11,6 +11,27 @@ export declare function generateSecretKey(): ArrayBuffer;
|
|
|
11
11
|
* Derives a base58 peer ID from raw Ed25519 secret key material.
|
|
12
12
|
*/
|
|
13
13
|
export declare function peerIdFromSecretKey(secretKey: ArrayBuffer): string;
|
|
14
|
+
/**
|
|
15
|
+
* State snapshot of the transport connection selected for a peer.
|
|
16
|
+
*/
|
|
17
|
+
export type ConnectionInfo = {
|
|
18
|
+
/**
|
|
19
|
+
* Endpoint-local transport connection id.
|
|
20
|
+
*/
|
|
21
|
+
connId: bigint;
|
|
22
|
+
/**
|
|
23
|
+
* Remote transport address, when recorded.
|
|
24
|
+
*/
|
|
25
|
+
remoteAddr?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Generated factory for {@link ConnectionInfo} record objects.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ConnectionInfo: Readonly<{
|
|
31
|
+
create: (partial: Partial<ConnectionInfo> & Required<Omit<ConnectionInfo, "remoteAddr">>) => ConnectionInfo;
|
|
32
|
+
new: (partial: Partial<ConnectionInfo> & Required<Omit<ConnectionInfo, "remoteAddr">>) => ConnectionInfo;
|
|
33
|
+
defaults: () => Partial<ConnectionInfo>;
|
|
34
|
+
}>;
|
|
14
35
|
/**
|
|
15
36
|
* Signed-discovery configuration.
|
|
16
37
|
*/
|
|
@@ -40,26 +61,6 @@ export declare const DiscoveryOptions: Readonly<{
|
|
|
40
61
|
new: (partial: Partial<DiscoveryOptions> & Required<Omit<DiscoveryOptions, never>>) => DiscoveryOptions;
|
|
41
62
|
defaults: () => Partial<DiscoveryOptions>;
|
|
42
63
|
}>;
|
|
43
|
-
/**
|
|
44
|
-
* One enabled transport and the addresses it should listen on.
|
|
45
|
-
*/
|
|
46
|
-
export type TransportOptions = {
|
|
47
|
-
/**
|
|
48
|
-
* Exact listen multiaddresses, or transport defaults when absent.
|
|
49
|
-
*
|
|
50
|
-
* An explicitly empty list is rejected: omit this field for defaults or
|
|
51
|
-
* disable the transport by omitting it from [`EndpointConfig`].
|
|
52
|
-
*/
|
|
53
|
-
listenAddrs?: Array<string>;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Generated factory for {@link TransportOptions} record objects.
|
|
57
|
-
*/
|
|
58
|
-
export declare const TransportOptions: Readonly<{
|
|
59
|
-
create: (partial: Partial<TransportOptions> & Required<Omit<TransportOptions, "listenAddrs">>) => TransportOptions;
|
|
60
|
-
new: (partial: Partial<TransportOptions> & Required<Omit<TransportOptions, "listenAddrs">>) => TransportOptions;
|
|
61
|
-
defaults: () => Partial<TransportOptions>;
|
|
62
|
-
}>;
|
|
63
64
|
/**
|
|
64
65
|
* Local-link mDNS discovery configuration.
|
|
65
66
|
*/
|
|
@@ -122,13 +123,10 @@ export type EndpointConfig = {
|
|
|
122
123
|
*/
|
|
123
124
|
autonatServers: Array<string>;
|
|
124
125
|
/**
|
|
125
|
-
*
|
|
126
|
+
* Listen multiaddresses; each address's shape selects its transport.
|
|
127
|
+
* Absent binds the QUIC dual-stack defaults; an empty list is rejected.
|
|
126
128
|
*/
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* TCP configuration, or no TCP transport when absent.
|
|
130
|
-
*/
|
|
131
|
-
tcp?: TransportOptions;
|
|
129
|
+
listen?: Array<string>;
|
|
132
130
|
/**
|
|
133
131
|
* Whether connection attempts must remain relayed.
|
|
134
132
|
*/
|
|
@@ -154,8 +152,8 @@ export type EndpointConfig = {
|
|
|
154
152
|
* Generated factory for {@link EndpointConfig} record objects.
|
|
155
153
|
*/
|
|
156
154
|
export declare const EndpointConfig: Readonly<{
|
|
157
|
-
create: (partial: Partial<EndpointConfig> & Required<Omit<EndpointConfig, "agentVersion" | "discovery" | "
|
|
158
|
-
new: (partial: Partial<EndpointConfig> & Required<Omit<EndpointConfig, "agentVersion" | "discovery" | "
|
|
155
|
+
create: (partial: Partial<EndpointConfig> & Required<Omit<EndpointConfig, "agentVersion" | "discovery" | "listen" | "mdns">>) => EndpointConfig;
|
|
156
|
+
new: (partial: Partial<EndpointConfig> & Required<Omit<EndpointConfig, "agentVersion" | "discovery" | "listen" | "mdns">>) => EndpointConfig;
|
|
159
157
|
defaults: () => Partial<EndpointConfig>;
|
|
160
158
|
}>;
|
|
161
159
|
/**
|
|
@@ -278,6 +276,102 @@ export declare const RelayReservationInfo: Readonly<{
|
|
|
278
276
|
new: (partial: Partial<RelayReservationInfo> & Required<Omit<RelayReservationInfo, "expiresUnixSecs">>) => RelayReservationInfo;
|
|
279
277
|
defaults: () => Partial<RelayReservationInfo>;
|
|
280
278
|
}>;
|
|
279
|
+
export declare enum ConnectTarget_Tags {
|
|
280
|
+
Peer = "Peer",
|
|
281
|
+
Addresses = "Addresses"
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* What a foreign runtime supplies to start one Connection attempt.
|
|
285
|
+
*
|
|
286
|
+
* Validation lives in `minip2p-ffi-core`; this mirror only declares the shape.
|
|
287
|
+
*/
|
|
288
|
+
export declare const ConnectTarget: Readonly<{
|
|
289
|
+
instanceOf: (obj: any) => obj is ConnectTarget;
|
|
290
|
+
Peer: {
|
|
291
|
+
new (inner: {
|
|
292
|
+
peerId: string;
|
|
293
|
+
}): {
|
|
294
|
+
/**
|
|
295
|
+
* @private
|
|
296
|
+
* This field is private and should not be used, use `tag` instead.
|
|
297
|
+
*/
|
|
298
|
+
readonly [uniffiTypeNameSymbol]: "ConnectTarget";
|
|
299
|
+
readonly tag: ConnectTarget_Tags.Peer;
|
|
300
|
+
readonly inner: Readonly<{
|
|
301
|
+
peerId: string;
|
|
302
|
+
}>;
|
|
303
|
+
};
|
|
304
|
+
"new"(inner: {
|
|
305
|
+
peerId: string;
|
|
306
|
+
}): {
|
|
307
|
+
/**
|
|
308
|
+
* @private
|
|
309
|
+
* This field is private and should not be used, use `tag` instead.
|
|
310
|
+
*/
|
|
311
|
+
readonly [uniffiTypeNameSymbol]: "ConnectTarget";
|
|
312
|
+
readonly tag: ConnectTarget_Tags.Peer;
|
|
313
|
+
readonly inner: Readonly<{
|
|
314
|
+
peerId: string;
|
|
315
|
+
}>;
|
|
316
|
+
};
|
|
317
|
+
instanceOf(obj: any): obj is {
|
|
318
|
+
/**
|
|
319
|
+
* @private
|
|
320
|
+
* This field is private and should not be used, use `tag` instead.
|
|
321
|
+
*/
|
|
322
|
+
readonly [uniffiTypeNameSymbol]: "ConnectTarget";
|
|
323
|
+
readonly tag: ConnectTarget_Tags.Peer;
|
|
324
|
+
readonly inner: Readonly<{
|
|
325
|
+
peerId: string;
|
|
326
|
+
}>;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
Addresses: {
|
|
330
|
+
new (inner: {
|
|
331
|
+
addresses: Array<string>;
|
|
332
|
+
}): {
|
|
333
|
+
/**
|
|
334
|
+
* @private
|
|
335
|
+
* This field is private and should not be used, use `tag` instead.
|
|
336
|
+
*/
|
|
337
|
+
readonly [uniffiTypeNameSymbol]: "ConnectTarget";
|
|
338
|
+
readonly tag: ConnectTarget_Tags.Addresses;
|
|
339
|
+
readonly inner: Readonly<{
|
|
340
|
+
addresses: Array<string>;
|
|
341
|
+
}>;
|
|
342
|
+
};
|
|
343
|
+
"new"(inner: {
|
|
344
|
+
addresses: Array<string>;
|
|
345
|
+
}): {
|
|
346
|
+
/**
|
|
347
|
+
* @private
|
|
348
|
+
* This field is private and should not be used, use `tag` instead.
|
|
349
|
+
*/
|
|
350
|
+
readonly [uniffiTypeNameSymbol]: "ConnectTarget";
|
|
351
|
+
readonly tag: ConnectTarget_Tags.Addresses;
|
|
352
|
+
readonly inner: Readonly<{
|
|
353
|
+
addresses: Array<string>;
|
|
354
|
+
}>;
|
|
355
|
+
};
|
|
356
|
+
instanceOf(obj: any): obj is {
|
|
357
|
+
/**
|
|
358
|
+
* @private
|
|
359
|
+
* This field is private and should not be used, use `tag` instead.
|
|
360
|
+
*/
|
|
361
|
+
readonly [uniffiTypeNameSymbol]: "ConnectTarget";
|
|
362
|
+
readonly tag: ConnectTarget_Tags.Addresses;
|
|
363
|
+
readonly inner: Readonly<{
|
|
364
|
+
addresses: Array<string>;
|
|
365
|
+
}>;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
}>;
|
|
369
|
+
/**
|
|
370
|
+
* What a foreign runtime supplies to start one Connection attempt.
|
|
371
|
+
*
|
|
372
|
+
* Validation lives in `minip2p-ffi-core`; this mirror only declares the shape.
|
|
373
|
+
*/
|
|
374
|
+
export type ConnectTarget = InstanceType<typeof ConnectTarget['Peer' | 'Addresses']>;
|
|
281
375
|
/**
|
|
282
376
|
* Source that contributed a discovery observation.
|
|
283
377
|
*/
|
|
@@ -811,6 +905,9 @@ export declare const FfiError: Readonly<{
|
|
|
811
905
|
new (inner: {
|
|
812
906
|
detail: string;
|
|
813
907
|
}): {
|
|
908
|
+
name: string;
|
|
909
|
+
message: string;
|
|
910
|
+
stack?: string;
|
|
814
911
|
/**
|
|
815
912
|
* @private
|
|
816
913
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -820,14 +917,14 @@ export declare const FfiError: Readonly<{
|
|
|
820
917
|
readonly inner: Readonly<{
|
|
821
918
|
detail: string;
|
|
822
919
|
}>;
|
|
823
|
-
name: string;
|
|
824
|
-
message: string;
|
|
825
|
-
stack?: string;
|
|
826
920
|
cause?: unknown;
|
|
827
921
|
};
|
|
828
922
|
"new"(inner: {
|
|
829
923
|
detail: string;
|
|
830
924
|
}): {
|
|
925
|
+
name: string;
|
|
926
|
+
message: string;
|
|
927
|
+
stack?: string;
|
|
831
928
|
/**
|
|
832
929
|
* @private
|
|
833
930
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -837,12 +934,12 @@ export declare const FfiError: Readonly<{
|
|
|
837
934
|
readonly inner: Readonly<{
|
|
838
935
|
detail: string;
|
|
839
936
|
}>;
|
|
840
|
-
name: string;
|
|
841
|
-
message: string;
|
|
842
|
-
stack?: string;
|
|
843
937
|
cause?: unknown;
|
|
844
938
|
};
|
|
845
939
|
instanceOf(obj: any): obj is {
|
|
940
|
+
name: string;
|
|
941
|
+
message: string;
|
|
942
|
+
stack?: string;
|
|
846
943
|
/**
|
|
847
944
|
* @private
|
|
848
945
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -852,12 +949,12 @@ export declare const FfiError: Readonly<{
|
|
|
852
949
|
readonly inner: Readonly<{
|
|
853
950
|
detail: string;
|
|
854
951
|
}>;
|
|
855
|
-
name: string;
|
|
856
|
-
message: string;
|
|
857
|
-
stack?: string;
|
|
858
952
|
cause?: unknown;
|
|
859
953
|
};
|
|
860
954
|
hasInner(obj: any): obj is {
|
|
955
|
+
name: string;
|
|
956
|
+
message: string;
|
|
957
|
+
stack?: string;
|
|
861
958
|
/**
|
|
862
959
|
* @private
|
|
863
960
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -867,12 +964,12 @@ export declare const FfiError: Readonly<{
|
|
|
867
964
|
readonly inner: Readonly<{
|
|
868
965
|
detail: string;
|
|
869
966
|
}>;
|
|
870
|
-
name: string;
|
|
871
|
-
message: string;
|
|
872
|
-
stack?: string;
|
|
873
967
|
cause?: unknown;
|
|
874
968
|
};
|
|
875
969
|
getInner(obj: {
|
|
970
|
+
name: string;
|
|
971
|
+
message: string;
|
|
972
|
+
stack?: string;
|
|
876
973
|
/**
|
|
877
974
|
* @private
|
|
878
975
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -882,9 +979,6 @@ export declare const FfiError: Readonly<{
|
|
|
882
979
|
readonly inner: Readonly<{
|
|
883
980
|
detail: string;
|
|
884
981
|
}>;
|
|
885
|
-
name: string;
|
|
886
|
-
message: string;
|
|
887
|
-
stack?: string;
|
|
888
982
|
cause?: unknown;
|
|
889
983
|
}): Readonly<{
|
|
890
984
|
detail: string;
|
|
@@ -1081,9 +1175,6 @@ export declare const FfiError: Readonly<{
|
|
|
1081
1175
|
new (inner: {
|
|
1082
1176
|
detail: string;
|
|
1083
1177
|
}): {
|
|
1084
|
-
name: string;
|
|
1085
|
-
message: string;
|
|
1086
|
-
stack?: string;
|
|
1087
1178
|
/**
|
|
1088
1179
|
* @private
|
|
1089
1180
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -1093,14 +1184,14 @@ export declare const FfiError: Readonly<{
|
|
|
1093
1184
|
readonly inner: Readonly<{
|
|
1094
1185
|
detail: string;
|
|
1095
1186
|
}>;
|
|
1187
|
+
name: string;
|
|
1188
|
+
message: string;
|
|
1189
|
+
stack?: string;
|
|
1096
1190
|
cause?: unknown;
|
|
1097
1191
|
};
|
|
1098
1192
|
"new"(inner: {
|
|
1099
1193
|
detail: string;
|
|
1100
1194
|
}): {
|
|
1101
|
-
name: string;
|
|
1102
|
-
message: string;
|
|
1103
|
-
stack?: string;
|
|
1104
1195
|
/**
|
|
1105
1196
|
* @private
|
|
1106
1197
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -1110,12 +1201,12 @@ export declare const FfiError: Readonly<{
|
|
|
1110
1201
|
readonly inner: Readonly<{
|
|
1111
1202
|
detail: string;
|
|
1112
1203
|
}>;
|
|
1113
|
-
cause?: unknown;
|
|
1114
|
-
};
|
|
1115
|
-
instanceOf(obj: any): obj is {
|
|
1116
1204
|
name: string;
|
|
1117
1205
|
message: string;
|
|
1118
1206
|
stack?: string;
|
|
1207
|
+
cause?: unknown;
|
|
1208
|
+
};
|
|
1209
|
+
instanceOf(obj: any): obj is {
|
|
1119
1210
|
/**
|
|
1120
1211
|
* @private
|
|
1121
1212
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -1125,12 +1216,12 @@ export declare const FfiError: Readonly<{
|
|
|
1125
1216
|
readonly inner: Readonly<{
|
|
1126
1217
|
detail: string;
|
|
1127
1218
|
}>;
|
|
1128
|
-
cause?: unknown;
|
|
1129
|
-
};
|
|
1130
|
-
hasInner(obj: any): obj is {
|
|
1131
1219
|
name: string;
|
|
1132
1220
|
message: string;
|
|
1133
1221
|
stack?: string;
|
|
1222
|
+
cause?: unknown;
|
|
1223
|
+
};
|
|
1224
|
+
hasInner(obj: any): obj is {
|
|
1134
1225
|
/**
|
|
1135
1226
|
* @private
|
|
1136
1227
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -1140,12 +1231,12 @@ export declare const FfiError: Readonly<{
|
|
|
1140
1231
|
readonly inner: Readonly<{
|
|
1141
1232
|
detail: string;
|
|
1142
1233
|
}>;
|
|
1143
|
-
cause?: unknown;
|
|
1144
|
-
};
|
|
1145
|
-
getInner(obj: {
|
|
1146
1234
|
name: string;
|
|
1147
1235
|
message: string;
|
|
1148
1236
|
stack?: string;
|
|
1237
|
+
cause?: unknown;
|
|
1238
|
+
};
|
|
1239
|
+
getInner(obj: {
|
|
1149
1240
|
/**
|
|
1150
1241
|
* @private
|
|
1151
1242
|
* This field is private and should not be used, use `tag` instead.
|
|
@@ -1155,6 +1246,9 @@ export declare const FfiError: Readonly<{
|
|
|
1155
1246
|
readonly inner: Readonly<{
|
|
1156
1247
|
detail: string;
|
|
1157
1248
|
}>;
|
|
1249
|
+
name: string;
|
|
1250
|
+
message: string;
|
|
1251
|
+
stack?: string;
|
|
1158
1252
|
cause?: unknown;
|
|
1159
1253
|
}): Readonly<{
|
|
1160
1254
|
detail: string;
|
|
@@ -1504,8 +1598,8 @@ export declare enum P2pEvent_Tags {
|
|
|
1504
1598
|
InboundPathEstablished = "InboundPathEstablished",
|
|
1505
1599
|
PathUpgraded = "PathUpgraded",
|
|
1506
1600
|
HolePunchFailed = "HolePunchFailed",
|
|
1507
|
-
FellBackToRelay = "FellBackToRelay",
|
|
1508
1601
|
ConnectFailed = "ConnectFailed",
|
|
1602
|
+
ConnectCancelled = "ConnectCancelled",
|
|
1509
1603
|
InboundDirectUpgrade = "InboundDirectUpgrade",
|
|
1510
1604
|
Message = "Message",
|
|
1511
1605
|
PeerSubscribed = "PeerSubscribed",
|
|
@@ -1527,6 +1621,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1527
1621
|
new (inner: {
|
|
1528
1622
|
dropped: bigint;
|
|
1529
1623
|
totalDropped: bigint;
|
|
1624
|
+
terminalConnectIds: Array<bigint>;
|
|
1530
1625
|
}): {
|
|
1531
1626
|
/**
|
|
1532
1627
|
* @private
|
|
@@ -1537,11 +1632,13 @@ export declare const P2pEvent: Readonly<{
|
|
|
1537
1632
|
readonly inner: Readonly<{
|
|
1538
1633
|
dropped: bigint;
|
|
1539
1634
|
totalDropped: bigint;
|
|
1635
|
+
terminalConnectIds: Array<bigint>;
|
|
1540
1636
|
}>;
|
|
1541
1637
|
};
|
|
1542
1638
|
"new"(inner: {
|
|
1543
1639
|
dropped: bigint;
|
|
1544
1640
|
totalDropped: bigint;
|
|
1641
|
+
terminalConnectIds: Array<bigint>;
|
|
1545
1642
|
}): {
|
|
1546
1643
|
/**
|
|
1547
1644
|
* @private
|
|
@@ -1552,6 +1649,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1552
1649
|
readonly inner: Readonly<{
|
|
1553
1650
|
dropped: bigint;
|
|
1554
1651
|
totalDropped: bigint;
|
|
1652
|
+
terminalConnectIds: Array<bigint>;
|
|
1555
1653
|
}>;
|
|
1556
1654
|
};
|
|
1557
1655
|
instanceOf(obj: any): obj is {
|
|
@@ -1564,6 +1662,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
1564
1662
|
readonly inner: Readonly<{
|
|
1565
1663
|
dropped: bigint;
|
|
1566
1664
|
totalDropped: bigint;
|
|
1665
|
+
terminalConnectIds: Array<bigint>;
|
|
1567
1666
|
}>;
|
|
1568
1667
|
};
|
|
1569
1668
|
};
|
|
@@ -2315,6 +2414,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
2315
2414
|
new (inner: {
|
|
2316
2415
|
connectId: bigint;
|
|
2317
2416
|
peerId: string;
|
|
2417
|
+
connId: bigint;
|
|
2318
2418
|
path: PathKind;
|
|
2319
2419
|
}): {
|
|
2320
2420
|
/**
|
|
@@ -2326,12 +2426,14 @@ export declare const P2pEvent: Readonly<{
|
|
|
2326
2426
|
readonly inner: Readonly<{
|
|
2327
2427
|
connectId: bigint;
|
|
2328
2428
|
peerId: string;
|
|
2429
|
+
connId: bigint;
|
|
2329
2430
|
path: PathKind;
|
|
2330
2431
|
}>;
|
|
2331
2432
|
};
|
|
2332
2433
|
"new"(inner: {
|
|
2333
2434
|
connectId: bigint;
|
|
2334
2435
|
peerId: string;
|
|
2436
|
+
connId: bigint;
|
|
2335
2437
|
path: PathKind;
|
|
2336
2438
|
}): {
|
|
2337
2439
|
/**
|
|
@@ -2343,6 +2445,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
2343
2445
|
readonly inner: Readonly<{
|
|
2344
2446
|
connectId: bigint;
|
|
2345
2447
|
peerId: string;
|
|
2448
|
+
connId: bigint;
|
|
2346
2449
|
path: PathKind;
|
|
2347
2450
|
}>;
|
|
2348
2451
|
};
|
|
@@ -2356,6 +2459,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
2356
2459
|
readonly inner: Readonly<{
|
|
2357
2460
|
connectId: bigint;
|
|
2358
2461
|
peerId: string;
|
|
2462
|
+
connId: bigint;
|
|
2359
2463
|
path: PathKind;
|
|
2360
2464
|
}>;
|
|
2361
2465
|
};
|
|
@@ -2507,35 +2611,43 @@ export declare const P2pEvent: Readonly<{
|
|
|
2507
2611
|
}>;
|
|
2508
2612
|
};
|
|
2509
2613
|
};
|
|
2510
|
-
|
|
2614
|
+
ConnectFailed: {
|
|
2511
2615
|
new (inner: {
|
|
2512
2616
|
connectId: bigint;
|
|
2513
2617
|
peerId: string;
|
|
2618
|
+
kind: NatErrorKind;
|
|
2619
|
+
detail: string;
|
|
2514
2620
|
}): {
|
|
2515
2621
|
/**
|
|
2516
2622
|
* @private
|
|
2517
2623
|
* This field is private and should not be used, use `tag` instead.
|
|
2518
2624
|
*/
|
|
2519
2625
|
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2520
|
-
readonly tag: P2pEvent_Tags.
|
|
2626
|
+
readonly tag: P2pEvent_Tags.ConnectFailed;
|
|
2521
2627
|
readonly inner: Readonly<{
|
|
2522
2628
|
connectId: bigint;
|
|
2523
2629
|
peerId: string;
|
|
2630
|
+
kind: NatErrorKind;
|
|
2631
|
+
detail: string;
|
|
2524
2632
|
}>;
|
|
2525
2633
|
};
|
|
2526
2634
|
"new"(inner: {
|
|
2527
2635
|
connectId: bigint;
|
|
2528
2636
|
peerId: string;
|
|
2637
|
+
kind: NatErrorKind;
|
|
2638
|
+
detail: string;
|
|
2529
2639
|
}): {
|
|
2530
2640
|
/**
|
|
2531
2641
|
* @private
|
|
2532
2642
|
* This field is private and should not be used, use `tag` instead.
|
|
2533
2643
|
*/
|
|
2534
2644
|
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2535
|
-
readonly tag: P2pEvent_Tags.
|
|
2645
|
+
readonly tag: P2pEvent_Tags.ConnectFailed;
|
|
2536
2646
|
readonly inner: Readonly<{
|
|
2537
2647
|
connectId: bigint;
|
|
2538
2648
|
peerId: string;
|
|
2649
|
+
kind: NatErrorKind;
|
|
2650
|
+
detail: string;
|
|
2539
2651
|
}>;
|
|
2540
2652
|
};
|
|
2541
2653
|
instanceOf(obj: any): obj is {
|
|
@@ -2544,50 +2656,44 @@ export declare const P2pEvent: Readonly<{
|
|
|
2544
2656
|
* This field is private and should not be used, use `tag` instead.
|
|
2545
2657
|
*/
|
|
2546
2658
|
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2547
|
-
readonly tag: P2pEvent_Tags.
|
|
2659
|
+
readonly tag: P2pEvent_Tags.ConnectFailed;
|
|
2548
2660
|
readonly inner: Readonly<{
|
|
2549
2661
|
connectId: bigint;
|
|
2550
2662
|
peerId: string;
|
|
2663
|
+
kind: NatErrorKind;
|
|
2664
|
+
detail: string;
|
|
2551
2665
|
}>;
|
|
2552
2666
|
};
|
|
2553
2667
|
};
|
|
2554
|
-
|
|
2668
|
+
ConnectCancelled: {
|
|
2555
2669
|
new (inner: {
|
|
2556
2670
|
connectId: bigint;
|
|
2557
2671
|
peerId: string;
|
|
2558
|
-
kind: NatErrorKind;
|
|
2559
|
-
detail: string;
|
|
2560
2672
|
}): {
|
|
2561
2673
|
/**
|
|
2562
2674
|
* @private
|
|
2563
2675
|
* This field is private and should not be used, use `tag` instead.
|
|
2564
2676
|
*/
|
|
2565
2677
|
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2566
|
-
readonly tag: P2pEvent_Tags.
|
|
2678
|
+
readonly tag: P2pEvent_Tags.ConnectCancelled;
|
|
2567
2679
|
readonly inner: Readonly<{
|
|
2568
2680
|
connectId: bigint;
|
|
2569
2681
|
peerId: string;
|
|
2570
|
-
kind: NatErrorKind;
|
|
2571
|
-
detail: string;
|
|
2572
2682
|
}>;
|
|
2573
2683
|
};
|
|
2574
2684
|
"new"(inner: {
|
|
2575
2685
|
connectId: bigint;
|
|
2576
2686
|
peerId: string;
|
|
2577
|
-
kind: NatErrorKind;
|
|
2578
|
-
detail: string;
|
|
2579
2687
|
}): {
|
|
2580
2688
|
/**
|
|
2581
2689
|
* @private
|
|
2582
2690
|
* This field is private and should not be used, use `tag` instead.
|
|
2583
2691
|
*/
|
|
2584
2692
|
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2585
|
-
readonly tag: P2pEvent_Tags.
|
|
2693
|
+
readonly tag: P2pEvent_Tags.ConnectCancelled;
|
|
2586
2694
|
readonly inner: Readonly<{
|
|
2587
2695
|
connectId: bigint;
|
|
2588
2696
|
peerId: string;
|
|
2589
|
-
kind: NatErrorKind;
|
|
2590
|
-
detail: string;
|
|
2591
2697
|
}>;
|
|
2592
2698
|
};
|
|
2593
2699
|
instanceOf(obj: any): obj is {
|
|
@@ -2596,12 +2702,10 @@ export declare const P2pEvent: Readonly<{
|
|
|
2596
2702
|
* This field is private and should not be used, use `tag` instead.
|
|
2597
2703
|
*/
|
|
2598
2704
|
readonly [uniffiTypeNameSymbol]: "P2pEvent";
|
|
2599
|
-
readonly tag: P2pEvent_Tags.
|
|
2705
|
+
readonly tag: P2pEvent_Tags.ConnectCancelled;
|
|
2600
2706
|
readonly inner: Readonly<{
|
|
2601
2707
|
connectId: bigint;
|
|
2602
2708
|
peerId: string;
|
|
2603
|
-
kind: NatErrorKind;
|
|
2604
|
-
detail: string;
|
|
2605
2709
|
}>;
|
|
2606
2710
|
};
|
|
2607
2711
|
};
|
|
@@ -3118,7 +3222,7 @@ export declare const P2pEvent: Readonly<{
|
|
|
3118
3222
|
/**
|
|
3119
3223
|
* Event delivered by the native endpoint driver.
|
|
3120
3224
|
*/
|
|
3121
|
-
export type P2pEvent = InstanceType<typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | '
|
|
3225
|
+
export type P2pEvent = InstanceType<typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | 'ConnectFailed' | 'ConnectCancelled' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'GossipsubOutboundFailure' | 'GossipsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'DiscoveryProtocolViolation']>;
|
|
3122
3226
|
/**
|
|
3123
3227
|
* Doorbell implemented by the embedding runtime.
|
|
3124
3228
|
*/
|
|
@@ -3168,33 +3272,17 @@ export interface P2pEndpointLike {
|
|
|
3168
3272
|
*/
|
|
3169
3273
|
closeStreamWrite(peerId: string, streamId: bigint): void;
|
|
3170
3274
|
/**
|
|
3171
|
-
* Starts
|
|
3275
|
+
* Starts one Connection attempt and returns its Connect ID.
|
|
3172
3276
|
*/
|
|
3173
|
-
connect(
|
|
3174
|
-
/**
|
|
3175
|
-
* Starts a direct-address connection attempt.
|
|
3176
|
-
*/
|
|
3177
|
-
connectAddr(address: string): bigint;
|
|
3178
|
-
/**
|
|
3179
|
-
* Starts a connection attempt with explicit addresses.
|
|
3180
|
-
*/
|
|
3181
|
-
connectWithAddrs(peerId: string, addresses: Array<string>): bigint;
|
|
3277
|
+
connect(target: ConnectTarget): bigint;
|
|
3182
3278
|
/**
|
|
3183
3279
|
* Returns connected peers.
|
|
3184
3280
|
*/
|
|
3185
3281
|
connectedPeers(): Array<string>;
|
|
3186
3282
|
/**
|
|
3187
|
-
*
|
|
3188
|
-
*/
|
|
3189
|
-
dial(address: string): Array<bigint>;
|
|
3190
|
-
/**
|
|
3191
|
-
* Dials using IPv4.
|
|
3283
|
+
* Returns the transport connection selected for a peer.
|
|
3192
3284
|
*/
|
|
3193
|
-
|
|
3194
|
-
/**
|
|
3195
|
-
* Dials using IPv6.
|
|
3196
|
-
*/
|
|
3197
|
-
dialIp6(address: string): bigint;
|
|
3285
|
+
connectionInfo(peerId: string): ConnectionInfo | undefined;
|
|
3198
3286
|
/**
|
|
3199
3287
|
* Disconnects a peer.
|
|
3200
3288
|
*/
|
|
@@ -3320,33 +3408,17 @@ export declare class P2pEndpoint extends UniffiAbstractObject implements P2pEndp
|
|
|
3320
3408
|
*/
|
|
3321
3409
|
closeStreamWrite(peerId: string, streamId: bigint): void;
|
|
3322
3410
|
/**
|
|
3323
|
-
* Starts
|
|
3324
|
-
*/
|
|
3325
|
-
connect(peerId: string): bigint;
|
|
3326
|
-
/**
|
|
3327
|
-
* Starts a direct-address connection attempt.
|
|
3328
|
-
*/
|
|
3329
|
-
connectAddr(address: string): bigint;
|
|
3330
|
-
/**
|
|
3331
|
-
* Starts a connection attempt with explicit addresses.
|
|
3411
|
+
* Starts one Connection attempt and returns its Connect ID.
|
|
3332
3412
|
*/
|
|
3333
|
-
|
|
3413
|
+
connect(target: ConnectTarget): bigint;
|
|
3334
3414
|
/**
|
|
3335
3415
|
* Returns connected peers.
|
|
3336
3416
|
*/
|
|
3337
3417
|
connectedPeers(): Array<string>;
|
|
3338
3418
|
/**
|
|
3339
|
-
*
|
|
3419
|
+
* Returns the transport connection selected for a peer.
|
|
3340
3420
|
*/
|
|
3341
|
-
|
|
3342
|
-
/**
|
|
3343
|
-
* Dials using IPv4.
|
|
3344
|
-
*/
|
|
3345
|
-
dialIp4(address: string): bigint;
|
|
3346
|
-
/**
|
|
3347
|
-
* Dials using IPv6.
|
|
3348
|
-
*/
|
|
3349
|
-
dialIp6(address: string): bigint;
|
|
3421
|
+
connectionInfo(peerId: string): ConnectionInfo | undefined;
|
|
3350
3422
|
/**
|
|
3351
3423
|
* Disconnects a peer.
|
|
3352
3424
|
*/
|
|
@@ -3452,6 +3524,20 @@ declare function uniffiEnsureInitialized(): void;
|
|
|
3452
3524
|
declare const _default: Readonly<{
|
|
3453
3525
|
initialize: typeof uniffiEnsureInitialized;
|
|
3454
3526
|
converters: {
|
|
3527
|
+
FfiConverterTypeConnectTarget: {
|
|
3528
|
+
readFromCursor(c: Cursor): ConnectTarget;
|
|
3529
|
+
writeIntoCursor(value: ConnectTarget, c: Cursor): void;
|
|
3530
|
+
allocationSize(value: ConnectTarget): number;
|
|
3531
|
+
lift(value: UniffiByteArray): ConnectTarget;
|
|
3532
|
+
lower(value: ConnectTarget, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3533
|
+
};
|
|
3534
|
+
FfiConverterTypeConnectionInfo: {
|
|
3535
|
+
readFromCursor(c: Cursor): ConnectionInfo;
|
|
3536
|
+
writeIntoCursor(value: ConnectionInfo, c: Cursor): void;
|
|
3537
|
+
allocationSize(value: ConnectionInfo): number;
|
|
3538
|
+
lift(value: UniffiByteArray): ConnectionInfo;
|
|
3539
|
+
lower(value: ConnectionInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3540
|
+
};
|
|
3455
3541
|
FfiConverterTypeDiscoveryOptions: {
|
|
3456
3542
|
readFromCursor(c: Cursor): DiscoveryOptions;
|
|
3457
3543
|
writeIntoCursor(value: DiscoveryOptions, c: Cursor): void;
|
|
@@ -3559,13 +3645,6 @@ declare const _default: Readonly<{
|
|
|
3559
3645
|
lift(value: UniffiByteArray): RelayReservationInfo;
|
|
3560
3646
|
lower(value: RelayReservationInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3561
3647
|
};
|
|
3562
|
-
FfiConverterTypeTransportOptions: {
|
|
3563
|
-
readFromCursor(c: Cursor): TransportOptions;
|
|
3564
|
-
writeIntoCursor(value: TransportOptions, c: Cursor): void;
|
|
3565
|
-
allocationSize(value: TransportOptions): number;
|
|
3566
|
-
lift(value: UniffiByteArray): TransportOptions;
|
|
3567
|
-
lower(value: TransportOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
|
|
3568
|
-
};
|
|
3569
3648
|
};
|
|
3570
3649
|
}>;
|
|
3571
3650
|
export default _default;
|