@minip2p/react-native 0.5.4 → 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.
@@ -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,39 +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
- * Pubsub routing engine selected at endpoint construction.
65
- */
66
- export declare enum PubsubRouter {
67
- /**
68
- * Mesh-based gossipsub routing.
69
- */
70
- Gossipsub = 0,
71
- /**
72
- * Flood-to-all-subscribers floodsub routing.
73
- */
74
- Floodsub = 1
75
- }
76
64
  /**
77
65
  * Local-link mDNS discovery configuration.
78
66
  */
@@ -135,13 +123,10 @@ export type EndpointConfig = {
135
123
  */
136
124
  autonatServers: Array<string>;
137
125
  /**
138
- * QUIC configuration, or no QUIC transport when absent.
126
+ * Listen multiaddresses; each address's shape selects its transport.
127
+ * Absent binds the QUIC dual-stack defaults; an empty list is rejected.
139
128
  */
140
- quic?: TransportOptions;
141
- /**
142
- * TCP configuration, or no TCP transport when absent.
143
- */
144
- tcp?: TransportOptions;
129
+ listen?: Array<string>;
145
130
  /**
146
131
  * Whether connection attempts must remain relayed.
147
132
  */
@@ -150,10 +135,6 @@ export type EndpointConfig = {
150
135
  * Whether unsigned pubsub messages are accepted.
151
136
  */
152
137
  allowUnsigned: boolean;
153
- /**
154
- * Pubsub routing engine.
155
- */
156
- pubsubRouter: PubsubRouter;
157
138
  /**
158
139
  * Application protocol ids registered before the endpoint starts.
159
140
  */
@@ -171,8 +152,8 @@ export type EndpointConfig = {
171
152
  * Generated factory for {@link EndpointConfig} record objects.
172
153
  */
173
154
  export declare const EndpointConfig: Readonly<{
174
- create: (partial: Partial<EndpointConfig> & Required<Omit<EndpointConfig, "agentVersion" | "discovery" | "mdns" | "quic" | "tcp">>) => EndpointConfig;
175
- new: (partial: Partial<EndpointConfig> & Required<Omit<EndpointConfig, "agentVersion" | "discovery" | "mdns" | "quic" | "tcp">>) => EndpointConfig;
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;
176
157
  defaults: () => Partial<EndpointConfig>;
177
158
  }>;
178
159
  /**
@@ -295,6 +276,102 @@ export declare const RelayReservationInfo: Readonly<{
295
276
  new: (partial: Partial<RelayReservationInfo> & Required<Omit<RelayReservationInfo, "expiresUnixSecs">>) => RelayReservationInfo;
296
277
  defaults: () => Partial<RelayReservationInfo>;
297
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']>;
298
375
  /**
299
376
  * Source that contributed a discovery observation.
300
377
  */
@@ -828,6 +905,9 @@ export declare const FfiError: Readonly<{
828
905
  new (inner: {
829
906
  detail: string;
830
907
  }): {
908
+ name: string;
909
+ message: string;
910
+ stack?: string;
831
911
  /**
832
912
  * @private
833
913
  * This field is private and should not be used, use `tag` instead.
@@ -837,14 +917,14 @@ export declare const FfiError: Readonly<{
837
917
  readonly inner: Readonly<{
838
918
  detail: string;
839
919
  }>;
840
- name: string;
841
- message: string;
842
- stack?: string;
843
920
  cause?: unknown;
844
921
  };
845
922
  "new"(inner: {
846
923
  detail: string;
847
924
  }): {
925
+ name: string;
926
+ message: string;
927
+ stack?: string;
848
928
  /**
849
929
  * @private
850
930
  * This field is private and should not be used, use `tag` instead.
@@ -854,12 +934,12 @@ export declare const FfiError: Readonly<{
854
934
  readonly inner: Readonly<{
855
935
  detail: string;
856
936
  }>;
857
- name: string;
858
- message: string;
859
- stack?: string;
860
937
  cause?: unknown;
861
938
  };
862
939
  instanceOf(obj: any): obj is {
940
+ name: string;
941
+ message: string;
942
+ stack?: string;
863
943
  /**
864
944
  * @private
865
945
  * This field is private and should not be used, use `tag` instead.
@@ -869,12 +949,12 @@ export declare const FfiError: Readonly<{
869
949
  readonly inner: Readonly<{
870
950
  detail: string;
871
951
  }>;
872
- name: string;
873
- message: string;
874
- stack?: string;
875
952
  cause?: unknown;
876
953
  };
877
954
  hasInner(obj: any): obj is {
955
+ name: string;
956
+ message: string;
957
+ stack?: string;
878
958
  /**
879
959
  * @private
880
960
  * This field is private and should not be used, use `tag` instead.
@@ -884,12 +964,12 @@ export declare const FfiError: Readonly<{
884
964
  readonly inner: Readonly<{
885
965
  detail: string;
886
966
  }>;
887
- name: string;
888
- message: string;
889
- stack?: string;
890
967
  cause?: unknown;
891
968
  };
892
969
  getInner(obj: {
970
+ name: string;
971
+ message: string;
972
+ stack?: string;
893
973
  /**
894
974
  * @private
895
975
  * This field is private and should not be used, use `tag` instead.
@@ -899,9 +979,6 @@ export declare const FfiError: Readonly<{
899
979
  readonly inner: Readonly<{
900
980
  detail: string;
901
981
  }>;
902
- name: string;
903
- message: string;
904
- stack?: string;
905
982
  cause?: unknown;
906
983
  }): Readonly<{
907
984
  detail: string;
@@ -1045,51 +1122,51 @@ export declare const FfiError: Readonly<{
1045
1122
  };
1046
1123
  MessageTooLarge: {
1047
1124
  new (): {
1048
- name: string;
1049
- message: string;
1050
- stack?: string;
1051
1125
  /**
1052
1126
  * @private
1053
1127
  * This field is private and should not be used, use `tag` instead.
1054
1128
  */
1055
1129
  readonly [uniffiTypeNameSymbol]: "FfiError";
1056
1130
  readonly tag: FfiError_Tags.MessageTooLarge;
1057
- cause?: unknown;
1058
- };
1059
- "new"(): {
1060
1131
  name: string;
1061
1132
  message: string;
1062
1133
  stack?: string;
1134
+ cause?: unknown;
1135
+ };
1136
+ "new"(): {
1063
1137
  /**
1064
1138
  * @private
1065
1139
  * This field is private and should not be used, use `tag` instead.
1066
1140
  */
1067
1141
  readonly [uniffiTypeNameSymbol]: "FfiError";
1068
1142
  readonly tag: FfiError_Tags.MessageTooLarge;
1069
- cause?: unknown;
1070
- };
1071
- instanceOf(obj: any): obj is {
1072
1143
  name: string;
1073
1144
  message: string;
1074
1145
  stack?: string;
1146
+ cause?: unknown;
1147
+ };
1148
+ instanceOf(obj: any): obj is {
1075
1149
  /**
1076
1150
  * @private
1077
1151
  * This field is private and should not be used, use `tag` instead.
1078
1152
  */
1079
1153
  readonly [uniffiTypeNameSymbol]: "FfiError";
1080
1154
  readonly tag: FfiError_Tags.MessageTooLarge;
1081
- cause?: unknown;
1082
- };
1083
- hasInner(obj: any): obj is {
1084
1155
  name: string;
1085
1156
  message: string;
1086
1157
  stack?: string;
1158
+ cause?: unknown;
1159
+ };
1160
+ hasInner(obj: any): obj is {
1087
1161
  /**
1088
1162
  * @private
1089
1163
  * This field is private and should not be used, use `tag` instead.
1090
1164
  */
1091
1165
  readonly [uniffiTypeNameSymbol]: "FfiError";
1092
1166
  readonly tag: FfiError_Tags.MessageTooLarge;
1167
+ name: string;
1168
+ message: string;
1169
+ stack?: string;
1093
1170
  cause?: unknown;
1094
1171
  };
1095
1172
  isError(error: unknown): error is Error;
@@ -1521,14 +1598,14 @@ export declare enum P2pEvent_Tags {
1521
1598
  InboundPathEstablished = "InboundPathEstablished",
1522
1599
  PathUpgraded = "PathUpgraded",
1523
1600
  HolePunchFailed = "HolePunchFailed",
1524
- FellBackToRelay = "FellBackToRelay",
1525
1601
  ConnectFailed = "ConnectFailed",
1602
+ ConnectCancelled = "ConnectCancelled",
1526
1603
  InboundDirectUpgrade = "InboundDirectUpgrade",
1527
1604
  Message = "Message",
1528
1605
  PeerSubscribed = "PeerSubscribed",
1529
1606
  PeerUnsubscribed = "PeerUnsubscribed",
1530
- PubsubOutboundFailure = "PubsubOutboundFailure",
1531
- PubsubProtocolViolation = "PubsubProtocolViolation",
1607
+ GossipsubOutboundFailure = "GossipsubOutboundFailure",
1608
+ GossipsubProtocolViolation = "GossipsubProtocolViolation",
1532
1609
  PeerDiscovered = "PeerDiscovered",
1533
1610
  PeerUpdated = "PeerUpdated",
1534
1611
  PeerExpired = "PeerExpired",
@@ -1544,6 +1621,7 @@ export declare const P2pEvent: Readonly<{
1544
1621
  new (inner: {
1545
1622
  dropped: bigint;
1546
1623
  totalDropped: bigint;
1624
+ terminalConnectIds: Array<bigint>;
1547
1625
  }): {
1548
1626
  /**
1549
1627
  * @private
@@ -1554,11 +1632,13 @@ export declare const P2pEvent: Readonly<{
1554
1632
  readonly inner: Readonly<{
1555
1633
  dropped: bigint;
1556
1634
  totalDropped: bigint;
1635
+ terminalConnectIds: Array<bigint>;
1557
1636
  }>;
1558
1637
  };
1559
1638
  "new"(inner: {
1560
1639
  dropped: bigint;
1561
1640
  totalDropped: bigint;
1641
+ terminalConnectIds: Array<bigint>;
1562
1642
  }): {
1563
1643
  /**
1564
1644
  * @private
@@ -1569,6 +1649,7 @@ export declare const P2pEvent: Readonly<{
1569
1649
  readonly inner: Readonly<{
1570
1650
  dropped: bigint;
1571
1651
  totalDropped: bigint;
1652
+ terminalConnectIds: Array<bigint>;
1572
1653
  }>;
1573
1654
  };
1574
1655
  instanceOf(obj: any): obj is {
@@ -1581,6 +1662,7 @@ export declare const P2pEvent: Readonly<{
1581
1662
  readonly inner: Readonly<{
1582
1663
  dropped: bigint;
1583
1664
  totalDropped: bigint;
1665
+ terminalConnectIds: Array<bigint>;
1584
1666
  }>;
1585
1667
  };
1586
1668
  };
@@ -2332,6 +2414,7 @@ export declare const P2pEvent: Readonly<{
2332
2414
  new (inner: {
2333
2415
  connectId: bigint;
2334
2416
  peerId: string;
2417
+ connId: bigint;
2335
2418
  path: PathKind;
2336
2419
  }): {
2337
2420
  /**
@@ -2343,12 +2426,14 @@ export declare const P2pEvent: Readonly<{
2343
2426
  readonly inner: Readonly<{
2344
2427
  connectId: bigint;
2345
2428
  peerId: string;
2429
+ connId: bigint;
2346
2430
  path: PathKind;
2347
2431
  }>;
2348
2432
  };
2349
2433
  "new"(inner: {
2350
2434
  connectId: bigint;
2351
2435
  peerId: string;
2436
+ connId: bigint;
2352
2437
  path: PathKind;
2353
2438
  }): {
2354
2439
  /**
@@ -2360,6 +2445,7 @@ export declare const P2pEvent: Readonly<{
2360
2445
  readonly inner: Readonly<{
2361
2446
  connectId: bigint;
2362
2447
  peerId: string;
2448
+ connId: bigint;
2363
2449
  path: PathKind;
2364
2450
  }>;
2365
2451
  };
@@ -2373,6 +2459,7 @@ export declare const P2pEvent: Readonly<{
2373
2459
  readonly inner: Readonly<{
2374
2460
  connectId: bigint;
2375
2461
  peerId: string;
2462
+ connId: bigint;
2376
2463
  path: PathKind;
2377
2464
  }>;
2378
2465
  };
@@ -2524,35 +2611,43 @@ export declare const P2pEvent: Readonly<{
2524
2611
  }>;
2525
2612
  };
2526
2613
  };
2527
- FellBackToRelay: {
2614
+ ConnectFailed: {
2528
2615
  new (inner: {
2529
2616
  connectId: bigint;
2530
2617
  peerId: string;
2618
+ kind: NatErrorKind;
2619
+ detail: string;
2531
2620
  }): {
2532
2621
  /**
2533
2622
  * @private
2534
2623
  * This field is private and should not be used, use `tag` instead.
2535
2624
  */
2536
2625
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2537
- readonly tag: P2pEvent_Tags.FellBackToRelay;
2626
+ readonly tag: P2pEvent_Tags.ConnectFailed;
2538
2627
  readonly inner: Readonly<{
2539
2628
  connectId: bigint;
2540
2629
  peerId: string;
2630
+ kind: NatErrorKind;
2631
+ detail: string;
2541
2632
  }>;
2542
2633
  };
2543
2634
  "new"(inner: {
2544
2635
  connectId: bigint;
2545
2636
  peerId: string;
2637
+ kind: NatErrorKind;
2638
+ detail: string;
2546
2639
  }): {
2547
2640
  /**
2548
2641
  * @private
2549
2642
  * This field is private and should not be used, use `tag` instead.
2550
2643
  */
2551
2644
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2552
- readonly tag: P2pEvent_Tags.FellBackToRelay;
2645
+ readonly tag: P2pEvent_Tags.ConnectFailed;
2553
2646
  readonly inner: Readonly<{
2554
2647
  connectId: bigint;
2555
2648
  peerId: string;
2649
+ kind: NatErrorKind;
2650
+ detail: string;
2556
2651
  }>;
2557
2652
  };
2558
2653
  instanceOf(obj: any): obj is {
@@ -2561,50 +2656,44 @@ export declare const P2pEvent: Readonly<{
2561
2656
  * This field is private and should not be used, use `tag` instead.
2562
2657
  */
2563
2658
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2564
- readonly tag: P2pEvent_Tags.FellBackToRelay;
2659
+ readonly tag: P2pEvent_Tags.ConnectFailed;
2565
2660
  readonly inner: Readonly<{
2566
2661
  connectId: bigint;
2567
2662
  peerId: string;
2663
+ kind: NatErrorKind;
2664
+ detail: string;
2568
2665
  }>;
2569
2666
  };
2570
2667
  };
2571
- ConnectFailed: {
2668
+ ConnectCancelled: {
2572
2669
  new (inner: {
2573
2670
  connectId: bigint;
2574
2671
  peerId: string;
2575
- kind: NatErrorKind;
2576
- detail: string;
2577
2672
  }): {
2578
2673
  /**
2579
2674
  * @private
2580
2675
  * This field is private and should not be used, use `tag` instead.
2581
2676
  */
2582
2677
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2583
- readonly tag: P2pEvent_Tags.ConnectFailed;
2678
+ readonly tag: P2pEvent_Tags.ConnectCancelled;
2584
2679
  readonly inner: Readonly<{
2585
2680
  connectId: bigint;
2586
2681
  peerId: string;
2587
- kind: NatErrorKind;
2588
- detail: string;
2589
2682
  }>;
2590
2683
  };
2591
2684
  "new"(inner: {
2592
2685
  connectId: bigint;
2593
2686
  peerId: string;
2594
- kind: NatErrorKind;
2595
- detail: string;
2596
2687
  }): {
2597
2688
  /**
2598
2689
  * @private
2599
2690
  * This field is private and should not be used, use `tag` instead.
2600
2691
  */
2601
2692
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2602
- readonly tag: P2pEvent_Tags.ConnectFailed;
2693
+ readonly tag: P2pEvent_Tags.ConnectCancelled;
2603
2694
  readonly inner: Readonly<{
2604
2695
  connectId: bigint;
2605
2696
  peerId: string;
2606
- kind: NatErrorKind;
2607
- detail: string;
2608
2697
  }>;
2609
2698
  };
2610
2699
  instanceOf(obj: any): obj is {
@@ -2613,12 +2702,10 @@ export declare const P2pEvent: Readonly<{
2613
2702
  * This field is private and should not be used, use `tag` instead.
2614
2703
  */
2615
2704
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2616
- readonly tag: P2pEvent_Tags.ConnectFailed;
2705
+ readonly tag: P2pEvent_Tags.ConnectCancelled;
2617
2706
  readonly inner: Readonly<{
2618
2707
  connectId: bigint;
2619
2708
  peerId: string;
2620
- kind: NatErrorKind;
2621
- detail: string;
2622
2709
  }>;
2623
2710
  };
2624
2711
  };
@@ -2808,7 +2895,7 @@ export declare const P2pEvent: Readonly<{
2808
2895
  }>;
2809
2896
  };
2810
2897
  };
2811
- PubsubOutboundFailure: {
2898
+ GossipsubOutboundFailure: {
2812
2899
  new (inner: {
2813
2900
  peerId: string;
2814
2901
  reason: string;
@@ -2818,7 +2905,7 @@ export declare const P2pEvent: Readonly<{
2818
2905
  * This field is private and should not be used, use `tag` instead.
2819
2906
  */
2820
2907
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2821
- readonly tag: P2pEvent_Tags.PubsubOutboundFailure;
2908
+ readonly tag: P2pEvent_Tags.GossipsubOutboundFailure;
2822
2909
  readonly inner: Readonly<{
2823
2910
  peerId: string;
2824
2911
  reason: string;
@@ -2833,7 +2920,7 @@ export declare const P2pEvent: Readonly<{
2833
2920
  * This field is private and should not be used, use `tag` instead.
2834
2921
  */
2835
2922
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2836
- readonly tag: P2pEvent_Tags.PubsubOutboundFailure;
2923
+ readonly tag: P2pEvent_Tags.GossipsubOutboundFailure;
2837
2924
  readonly inner: Readonly<{
2838
2925
  peerId: string;
2839
2926
  reason: string;
@@ -2845,14 +2932,14 @@ export declare const P2pEvent: Readonly<{
2845
2932
  * This field is private and should not be used, use `tag` instead.
2846
2933
  */
2847
2934
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2848
- readonly tag: P2pEvent_Tags.PubsubOutboundFailure;
2935
+ readonly tag: P2pEvent_Tags.GossipsubOutboundFailure;
2849
2936
  readonly inner: Readonly<{
2850
2937
  peerId: string;
2851
2938
  reason: string;
2852
2939
  }>;
2853
2940
  };
2854
2941
  };
2855
- PubsubProtocolViolation: {
2942
+ GossipsubProtocolViolation: {
2856
2943
  new (inner: {
2857
2944
  peerId: string;
2858
2945
  reason: string;
@@ -2862,7 +2949,7 @@ export declare const P2pEvent: Readonly<{
2862
2949
  * This field is private and should not be used, use `tag` instead.
2863
2950
  */
2864
2951
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2865
- readonly tag: P2pEvent_Tags.PubsubProtocolViolation;
2952
+ readonly tag: P2pEvent_Tags.GossipsubProtocolViolation;
2866
2953
  readonly inner: Readonly<{
2867
2954
  peerId: string;
2868
2955
  reason: string;
@@ -2877,7 +2964,7 @@ export declare const P2pEvent: Readonly<{
2877
2964
  * This field is private and should not be used, use `tag` instead.
2878
2965
  */
2879
2966
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2880
- readonly tag: P2pEvent_Tags.PubsubProtocolViolation;
2967
+ readonly tag: P2pEvent_Tags.GossipsubProtocolViolation;
2881
2968
  readonly inner: Readonly<{
2882
2969
  peerId: string;
2883
2970
  reason: string;
@@ -2889,7 +2976,7 @@ export declare const P2pEvent: Readonly<{
2889
2976
  * This field is private and should not be used, use `tag` instead.
2890
2977
  */
2891
2978
  readonly [uniffiTypeNameSymbol]: "P2pEvent";
2892
- readonly tag: P2pEvent_Tags.PubsubProtocolViolation;
2979
+ readonly tag: P2pEvent_Tags.GossipsubProtocolViolation;
2893
2980
  readonly inner: Readonly<{
2894
2981
  peerId: string;
2895
2982
  reason: string;
@@ -3135,7 +3222,7 @@ export declare const P2pEvent: Readonly<{
3135
3222
  /**
3136
3223
  * Event delivered by the native endpoint driver.
3137
3224
  */
3138
- 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' | 'FellBackToRelay' | 'ConnectFailed' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'PubsubOutboundFailure' | 'PubsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'DiscoveryProtocolViolation']>;
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']>;
3139
3226
  /**
3140
3227
  * Doorbell implemented by the embedding runtime.
3141
3228
  */
@@ -3185,33 +3272,17 @@ export interface P2pEndpointLike {
3185
3272
  */
3186
3273
  closeStreamWrite(peerId: string, streamId: bigint): void;
3187
3274
  /**
3188
- * Starts a connection attempt.
3275
+ * Starts one Connection attempt and returns its Connect ID.
3189
3276
  */
3190
- connect(peerId: string): bigint;
3191
- /**
3192
- * Starts a direct-address connection attempt.
3193
- */
3194
- connectAddr(address: string): bigint;
3195
- /**
3196
- * Starts a connection attempt with explicit addresses.
3197
- */
3198
- connectWithAddrs(peerId: string, addresses: Array<string>): bigint;
3277
+ connect(target: ConnectTarget): bigint;
3199
3278
  /**
3200
3279
  * Returns connected peers.
3201
3280
  */
3202
3281
  connectedPeers(): Array<string>;
3203
3282
  /**
3204
- * Dials on all applicable address families.
3283
+ * Returns the transport connection selected for a peer.
3205
3284
  */
3206
- dial(address: string): Array<bigint>;
3207
- /**
3208
- * Dials using IPv4.
3209
- */
3210
- dialIp4(address: string): bigint;
3211
- /**
3212
- * Dials using IPv6.
3213
- */
3214
- dialIp6(address: string): bigint;
3285
+ connectionInfo(peerId: string): ConnectionInfo | undefined;
3215
3286
  /**
3216
3287
  * Disconnects a peer.
3217
3288
  */
@@ -3337,33 +3408,17 @@ export declare class P2pEndpoint extends UniffiAbstractObject implements P2pEndp
3337
3408
  */
3338
3409
  closeStreamWrite(peerId: string, streamId: bigint): void;
3339
3410
  /**
3340
- * Starts a connection attempt.
3341
- */
3342
- connect(peerId: string): bigint;
3343
- /**
3344
- * Starts a direct-address connection attempt.
3411
+ * Starts one Connection attempt and returns its Connect ID.
3345
3412
  */
3346
- connectAddr(address: string): bigint;
3347
- /**
3348
- * Starts a connection attempt with explicit addresses.
3349
- */
3350
- connectWithAddrs(peerId: string, addresses: Array<string>): bigint;
3413
+ connect(target: ConnectTarget): bigint;
3351
3414
  /**
3352
3415
  * Returns connected peers.
3353
3416
  */
3354
3417
  connectedPeers(): Array<string>;
3355
3418
  /**
3356
- * Dials on all applicable address families.
3357
- */
3358
- dial(address: string): Array<bigint>;
3359
- /**
3360
- * Dials using IPv4.
3361
- */
3362
- dialIp4(address: string): bigint;
3363
- /**
3364
- * Dials using IPv6.
3419
+ * Returns the transport connection selected for a peer.
3365
3420
  */
3366
- dialIp6(address: string): bigint;
3421
+ connectionInfo(peerId: string): ConnectionInfo | undefined;
3367
3422
  /**
3368
3423
  * Disconnects a peer.
3369
3424
  */
@@ -3469,6 +3524,20 @@ declare function uniffiEnsureInitialized(): void;
3469
3524
  declare const _default: Readonly<{
3470
3525
  initialize: typeof uniffiEnsureInitialized;
3471
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
+ };
3472
3541
  FfiConverterTypeDiscoveryOptions: {
3473
3542
  readFromCursor(c: Cursor): DiscoveryOptions;
3474
3543
  writeIntoCursor(value: DiscoveryOptions, c: Cursor): void;
@@ -3562,13 +3631,6 @@ declare const _default: Readonly<{
3562
3631
  lift(value: UniffiByteArray): PathKind;
3563
3632
  lower(value: PathKind, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3564
3633
  };
3565
- FfiConverterTypePubsubRouter: {
3566
- readFromCursor(c: Cursor): PubsubRouter;
3567
- writeIntoCursor(value: PubsubRouter, c: Cursor): void;
3568
- allocationSize(value: PubsubRouter): number;
3569
- lift(value: UniffiByteArray): PubsubRouter;
3570
- lower(value: PubsubRouter, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3571
- };
3572
3634
  FfiConverterTypeReachability: {
3573
3635
  readFromCursor(c: Cursor): Reachability;
3574
3636
  writeIntoCursor(value: Reachability, c: Cursor): void;
@@ -3583,13 +3645,6 @@ declare const _default: Readonly<{
3583
3645
  lift(value: UniffiByteArray): RelayReservationInfo;
3584
3646
  lower(value: RelayReservationInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3585
3647
  };
3586
- FfiConverterTypeTransportOptions: {
3587
- readFromCursor(c: Cursor): TransportOptions;
3588
- writeIntoCursor(value: TransportOptions, c: Cursor): void;
3589
- allocationSize(value: TransportOptions): number;
3590
- lift(value: UniffiByteArray): TransportOptions;
3591
- lower(value: TransportOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3592
- };
3593
3648
  };
3594
3649
  }>;
3595
3650
  export default _default;