@minip2p/react-native 0.3.0 → 0.4.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 +22 -74
- 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 +0 -0
- package/build/Minip2pFfi.xcframework/ios-arm64-simulator/libminip2p_ffi.a +0 -0
- package/lib/module/adapter.js +21 -3
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi.js +150 -57
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/typescript/src/adapter.d.ts +1 -1
- package/lib/typescript/src/adapter.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +93 -12
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +28 -2
- package/src/generated/minip2p_ffi.ts +181 -63
|
@@ -20,6 +20,8 @@ process?.env?.NODE_ENV !== "production" || false;
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Builds a circuit multiaddress for `peer_id` through `relay_addr`.
|
|
23
|
+
*
|
|
24
|
+
* `relay_addr` is any direct `/tcp` or `/quic-v1` peer address.
|
|
23
25
|
*/
|
|
24
26
|
export function circuitAddress(relayAddr, peerId) /*throws*/{
|
|
25
27
|
return (__rb => {
|
|
@@ -143,6 +145,42 @@ const FfiConverterTypeDiscoveryOptions = (() => {
|
|
|
143
145
|
return new FFIConverter();
|
|
144
146
|
})();
|
|
145
147
|
|
|
148
|
+
/**
|
|
149
|
+
* One enabled transport and the addresses it should listen on.
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Generated factory for {@link TransportOptions} record objects.
|
|
154
|
+
*/
|
|
155
|
+
export const TransportOptions = (() => {
|
|
156
|
+
const defaults = () => ({});
|
|
157
|
+
const create = (() => {
|
|
158
|
+
return uniffiCreateRecord(defaults);
|
|
159
|
+
})();
|
|
160
|
+
return Object.freeze({
|
|
161
|
+
create,
|
|
162
|
+
new: create,
|
|
163
|
+
defaults: () => Object.freeze(defaults())
|
|
164
|
+
});
|
|
165
|
+
})();
|
|
166
|
+
const FfiConverterTypeTransportOptions = (() => {
|
|
167
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
168
|
+
read(from) {
|
|
169
|
+
return {
|
|
170
|
+
listenAddrs: FfiConverterOptionalSequenceString.read(from)
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
write(value, into) {
|
|
174
|
+
FfiConverterOptionalSequenceString.write(value.listenAddrs, into);
|
|
175
|
+
}
|
|
176
|
+
allocationSize(value) {
|
|
177
|
+
return FfiConverterOptionalSequenceString.allocationSize(value.listenAddrs);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
;
|
|
181
|
+
return new FFIConverter();
|
|
182
|
+
})();
|
|
183
|
+
|
|
146
184
|
/**
|
|
147
185
|
* Pubsub routing engine selected at endpoint construction.
|
|
148
186
|
*/
|
|
@@ -260,7 +298,8 @@ const FfiConverterTypeEndpointConfig = (() => {
|
|
|
260
298
|
agentVersion: FfiConverterOptionalString.read(from),
|
|
261
299
|
relays: FfiConverterSequenceString.read(from),
|
|
262
300
|
autonatServers: FfiConverterSequenceString.read(from),
|
|
263
|
-
|
|
301
|
+
quic: FfiConverterOptionalTypeTransportOptions.read(from),
|
|
302
|
+
tcp: FfiConverterOptionalTypeTransportOptions.read(from),
|
|
264
303
|
forceRelay: FfiConverterBool.read(from),
|
|
265
304
|
allowUnsigned: FfiConverterBool.read(from),
|
|
266
305
|
pubsubRouter: FfiConverterTypePubsubRouter.read(from),
|
|
@@ -273,7 +312,8 @@ const FfiConverterTypeEndpointConfig = (() => {
|
|
|
273
312
|
FfiConverterOptionalString.write(value.agentVersion, into);
|
|
274
313
|
FfiConverterSequenceString.write(value.relays, into);
|
|
275
314
|
FfiConverterSequenceString.write(value.autonatServers, into);
|
|
276
|
-
|
|
315
|
+
FfiConverterOptionalTypeTransportOptions.write(value.quic, into);
|
|
316
|
+
FfiConverterOptionalTypeTransportOptions.write(value.tcp, into);
|
|
277
317
|
FfiConverterBool.write(value.forceRelay, into);
|
|
278
318
|
FfiConverterBool.write(value.allowUnsigned, into);
|
|
279
319
|
FfiConverterTypePubsubRouter.write(value.pubsubRouter, into);
|
|
@@ -282,7 +322,7 @@ const FfiConverterTypeEndpointConfig = (() => {
|
|
|
282
322
|
FfiConverterOptionalTypeMdnsOptions.write(value.mdns, into);
|
|
283
323
|
}
|
|
284
324
|
allocationSize(value) {
|
|
285
|
-
return FfiConverterOptionalString.allocationSize(value.agentVersion) + FfiConverterSequenceString.allocationSize(value.relays) + FfiConverterSequenceString.allocationSize(value.autonatServers) +
|
|
325
|
+
return FfiConverterOptionalString.allocationSize(value.agentVersion) + FfiConverterSequenceString.allocationSize(value.relays) + FfiConverterSequenceString.allocationSize(value.autonatServers) + FfiConverterOptionalTypeTransportOptions.allocationSize(value.quic) + FfiConverterOptionalTypeTransportOptions.allocationSize(value.tcp) + FfiConverterBool.allocationSize(value.forceRelay) + FfiConverterBool.allocationSize(value.allowUnsigned) + FfiConverterTypePubsubRouter.allocationSize(value.pubsubRouter) + FfiConverterSequenceString.allocationSize(value.protocols) + FfiConverterOptionalTypeDiscoveryOptions.allocationSize(value.discovery) + FfiConverterOptionalTypeMdnsOptions.allocationSize(value.mdns);
|
|
286
326
|
}
|
|
287
327
|
}
|
|
288
328
|
;
|
|
@@ -1551,6 +1591,7 @@ export let P2pEvent_Tags = /*#__PURE__*/function (P2pEvent_Tags) {
|
|
|
1551
1591
|
P2pEvent_Tags["RelayReserved"] = "RelayReserved";
|
|
1552
1592
|
P2pEvent_Tags["RelayReservationLost"] = "RelayReservationLost";
|
|
1553
1593
|
P2pEvent_Tags["PathEstablished"] = "PathEstablished";
|
|
1594
|
+
P2pEvent_Tags["InboundPathEstablished"] = "InboundPathEstablished";
|
|
1554
1595
|
P2pEvent_Tags["PathUpgraded"] = "PathUpgraded";
|
|
1555
1596
|
P2pEvent_Tags["HolePunchFailed"] = "HolePunchFailed";
|
|
1556
1597
|
P2pEvent_Tags["FellBackToRelay"] = "FellBackToRelay";
|
|
@@ -1950,6 +1991,27 @@ export const P2pEvent = (() => {
|
|
|
1950
1991
|
return obj.tag === P2pEvent_Tags.PathEstablished;
|
|
1951
1992
|
}
|
|
1952
1993
|
}
|
|
1994
|
+
/**
|
|
1995
|
+
* An inbound relay circuit became a usable path.
|
|
1996
|
+
*/
|
|
1997
|
+
class InboundPathEstablished_ extends UniffiEnum {
|
|
1998
|
+
/**
|
|
1999
|
+
* @private
|
|
2000
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2001
|
+
*/
|
|
2002
|
+
[uniffiTypeNameSymbol] = "P2pEvent";
|
|
2003
|
+
tag = P2pEvent_Tags.InboundPathEstablished;
|
|
2004
|
+
constructor(inner) {
|
|
2005
|
+
super("P2pEvent", "InboundPathEstablished");
|
|
2006
|
+
this.inner = Object.freeze(inner);
|
|
2007
|
+
}
|
|
2008
|
+
static new(inner) {
|
|
2009
|
+
return new InboundPathEstablished_(inner);
|
|
2010
|
+
}
|
|
2011
|
+
static instanceOf(obj) {
|
|
2012
|
+
return obj.tag === P2pEvent_Tags.InboundPathEstablished;
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
1953
2015
|
/**
|
|
1954
2016
|
* A better path replaced an earlier path.
|
|
1955
2017
|
*/
|
|
@@ -2292,6 +2354,7 @@ export const P2pEvent = (() => {
|
|
|
2292
2354
|
RelayReserved: RelayReserved_,
|
|
2293
2355
|
RelayReservationLost: RelayReservationLost_,
|
|
2294
2356
|
PathEstablished: PathEstablished_,
|
|
2357
|
+
InboundPathEstablished: InboundPathEstablished_,
|
|
2295
2358
|
PathUpgraded: PathUpgraded_,
|
|
2296
2359
|
HolePunchFailed: HolePunchFailed_,
|
|
2297
2360
|
FellBackToRelay: FellBackToRelay_,
|
|
@@ -2419,35 +2482,40 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2419
2482
|
path: FfiConverterTypePathKind.read(from)
|
|
2420
2483
|
});
|
|
2421
2484
|
case 19:
|
|
2485
|
+
return new P2pEvent.InboundPathEstablished({
|
|
2486
|
+
peerId: FfiConverterString.read(from),
|
|
2487
|
+
path: FfiConverterTypePathKind.read(from)
|
|
2488
|
+
});
|
|
2489
|
+
case 20:
|
|
2422
2490
|
return new P2pEvent.PathUpgraded({
|
|
2423
2491
|
connectId: FfiConverterUInt64.read(from),
|
|
2424
2492
|
peerId: FfiConverterString.read(from),
|
|
2425
2493
|
from: FfiConverterTypePathKind.read(from),
|
|
2426
2494
|
to: FfiConverterTypePathKind.read(from)
|
|
2427
2495
|
});
|
|
2428
|
-
case
|
|
2496
|
+
case 21:
|
|
2429
2497
|
return new P2pEvent.HolePunchFailed({
|
|
2430
2498
|
connectId: FfiConverterUInt64.read(from),
|
|
2431
2499
|
attempt: FfiConverterUInt32.read(from),
|
|
2432
2500
|
reason: FfiConverterString.read(from)
|
|
2433
2501
|
});
|
|
2434
|
-
case
|
|
2502
|
+
case 22:
|
|
2435
2503
|
return new P2pEvent.FellBackToRelay({
|
|
2436
2504
|
connectId: FfiConverterUInt64.read(from),
|
|
2437
2505
|
peerId: FfiConverterString.read(from)
|
|
2438
2506
|
});
|
|
2439
|
-
case
|
|
2507
|
+
case 23:
|
|
2440
2508
|
return new P2pEvent.ConnectFailed({
|
|
2441
2509
|
connectId: FfiConverterUInt64.read(from),
|
|
2442
2510
|
peerId: FfiConverterString.read(from),
|
|
2443
2511
|
kind: FfiConverterTypeNatErrorKind.read(from),
|
|
2444
2512
|
detail: FfiConverterString.read(from)
|
|
2445
2513
|
});
|
|
2446
|
-
case
|
|
2514
|
+
case 24:
|
|
2447
2515
|
return new P2pEvent.InboundDirectUpgrade({
|
|
2448
2516
|
peerId: FfiConverterString.read(from)
|
|
2449
2517
|
});
|
|
2450
|
-
case
|
|
2518
|
+
case 25:
|
|
2451
2519
|
return new P2pEvent.Message({
|
|
2452
2520
|
fromPeerId: FfiConverterString.read(from),
|
|
2453
2521
|
topics: FfiConverterSequenceString.read(from),
|
|
@@ -2455,48 +2523,48 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2455
2523
|
seqno: FfiConverterArrayBuffer.read(from),
|
|
2456
2524
|
signed: FfiConverterBool.read(from)
|
|
2457
2525
|
});
|
|
2458
|
-
case
|
|
2526
|
+
case 26:
|
|
2459
2527
|
return new P2pEvent.PeerSubscribed({
|
|
2460
2528
|
peerId: FfiConverterString.read(from),
|
|
2461
2529
|
topic: FfiConverterString.read(from)
|
|
2462
2530
|
});
|
|
2463
|
-
case
|
|
2531
|
+
case 27:
|
|
2464
2532
|
return new P2pEvent.PeerUnsubscribed({
|
|
2465
2533
|
peerId: FfiConverterString.read(from),
|
|
2466
2534
|
topic: FfiConverterString.read(from)
|
|
2467
2535
|
});
|
|
2468
|
-
case
|
|
2536
|
+
case 28:
|
|
2469
2537
|
return new P2pEvent.PubsubOutboundFailure({
|
|
2470
2538
|
peerId: FfiConverterString.read(from),
|
|
2471
2539
|
reason: FfiConverterString.read(from)
|
|
2472
2540
|
});
|
|
2473
|
-
case
|
|
2541
|
+
case 29:
|
|
2474
2542
|
return new P2pEvent.PubsubProtocolViolation({
|
|
2475
2543
|
peerId: FfiConverterString.read(from),
|
|
2476
2544
|
reason: FfiConverterString.read(from)
|
|
2477
2545
|
});
|
|
2478
|
-
case
|
|
2546
|
+
case 30:
|
|
2479
2547
|
return new P2pEvent.PeerDiscovered({
|
|
2480
2548
|
peerId: FfiConverterString.read(from),
|
|
2481
2549
|
addrs: FfiConverterSequenceString.read(from),
|
|
2482
2550
|
source: FfiConverterTypeDiscoverySource.read(from)
|
|
2483
2551
|
});
|
|
2484
|
-
case
|
|
2552
|
+
case 31:
|
|
2485
2553
|
return new P2pEvent.PeerUpdated({
|
|
2486
2554
|
peerId: FfiConverterString.read(from),
|
|
2487
2555
|
addrs: FfiConverterSequenceString.read(from),
|
|
2488
2556
|
source: FfiConverterTypeDiscoverySource.read(from)
|
|
2489
2557
|
});
|
|
2490
|
-
case
|
|
2558
|
+
case 32:
|
|
2491
2559
|
return new P2pEvent.PeerExpired({
|
|
2492
2560
|
peerId: FfiConverterString.read(from)
|
|
2493
2561
|
});
|
|
2494
|
-
case
|
|
2562
|
+
case 33:
|
|
2495
2563
|
return new P2pEvent.DiscoveryDialFailed({
|
|
2496
2564
|
peerId: FfiConverterString.read(from),
|
|
2497
2565
|
reason: FfiConverterString.read(from)
|
|
2498
2566
|
});
|
|
2499
|
-
case
|
|
2567
|
+
case 34:
|
|
2500
2568
|
return new P2pEvent.DiscoveryProtocolViolation({
|
|
2501
2569
|
peerId: FfiConverterOptionalString.read(from),
|
|
2502
2570
|
source: FfiConverterTypeDiscoverySource.read(from),
|
|
@@ -2662,10 +2730,18 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2662
2730
|
FfiConverterTypePathKind.write(inner.path, into);
|
|
2663
2731
|
return;
|
|
2664
2732
|
}
|
|
2665
|
-
case P2pEvent_Tags.
|
|
2733
|
+
case P2pEvent_Tags.InboundPathEstablished:
|
|
2666
2734
|
{
|
|
2667
2735
|
ordinalConverter.write(19, into);
|
|
2668
2736
|
const inner = value.inner;
|
|
2737
|
+
FfiConverterString.write(inner.peerId, into);
|
|
2738
|
+
FfiConverterTypePathKind.write(inner.path, into);
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
case P2pEvent_Tags.PathUpgraded:
|
|
2742
|
+
{
|
|
2743
|
+
ordinalConverter.write(20, into);
|
|
2744
|
+
const inner = value.inner;
|
|
2669
2745
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2670
2746
|
FfiConverterString.write(inner.peerId, into);
|
|
2671
2747
|
FfiConverterTypePathKind.write(inner.from, into);
|
|
@@ -2674,7 +2750,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2674
2750
|
}
|
|
2675
2751
|
case P2pEvent_Tags.HolePunchFailed:
|
|
2676
2752
|
{
|
|
2677
|
-
ordinalConverter.write(
|
|
2753
|
+
ordinalConverter.write(21, into);
|
|
2678
2754
|
const inner = value.inner;
|
|
2679
2755
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2680
2756
|
FfiConverterUInt32.write(inner.attempt, into);
|
|
@@ -2683,7 +2759,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2683
2759
|
}
|
|
2684
2760
|
case P2pEvent_Tags.FellBackToRelay:
|
|
2685
2761
|
{
|
|
2686
|
-
ordinalConverter.write(
|
|
2762
|
+
ordinalConverter.write(22, into);
|
|
2687
2763
|
const inner = value.inner;
|
|
2688
2764
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2689
2765
|
FfiConverterString.write(inner.peerId, into);
|
|
@@ -2691,7 +2767,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2691
2767
|
}
|
|
2692
2768
|
case P2pEvent_Tags.ConnectFailed:
|
|
2693
2769
|
{
|
|
2694
|
-
ordinalConverter.write(
|
|
2770
|
+
ordinalConverter.write(23, into);
|
|
2695
2771
|
const inner = value.inner;
|
|
2696
2772
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2697
2773
|
FfiConverterString.write(inner.peerId, into);
|
|
@@ -2701,14 +2777,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2701
2777
|
}
|
|
2702
2778
|
case P2pEvent_Tags.InboundDirectUpgrade:
|
|
2703
2779
|
{
|
|
2704
|
-
ordinalConverter.write(
|
|
2780
|
+
ordinalConverter.write(24, into);
|
|
2705
2781
|
const inner = value.inner;
|
|
2706
2782
|
FfiConverterString.write(inner.peerId, into);
|
|
2707
2783
|
return;
|
|
2708
2784
|
}
|
|
2709
2785
|
case P2pEvent_Tags.Message:
|
|
2710
2786
|
{
|
|
2711
|
-
ordinalConverter.write(
|
|
2787
|
+
ordinalConverter.write(25, into);
|
|
2712
2788
|
const inner = value.inner;
|
|
2713
2789
|
FfiConverterString.write(inner.fromPeerId, into);
|
|
2714
2790
|
FfiConverterSequenceString.write(inner.topics, into);
|
|
@@ -2719,7 +2795,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2719
2795
|
}
|
|
2720
2796
|
case P2pEvent_Tags.PeerSubscribed:
|
|
2721
2797
|
{
|
|
2722
|
-
ordinalConverter.write(
|
|
2798
|
+
ordinalConverter.write(26, into);
|
|
2723
2799
|
const inner = value.inner;
|
|
2724
2800
|
FfiConverterString.write(inner.peerId, into);
|
|
2725
2801
|
FfiConverterString.write(inner.topic, into);
|
|
@@ -2727,7 +2803,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2727
2803
|
}
|
|
2728
2804
|
case P2pEvent_Tags.PeerUnsubscribed:
|
|
2729
2805
|
{
|
|
2730
|
-
ordinalConverter.write(
|
|
2806
|
+
ordinalConverter.write(27, into);
|
|
2731
2807
|
const inner = value.inner;
|
|
2732
2808
|
FfiConverterString.write(inner.peerId, into);
|
|
2733
2809
|
FfiConverterString.write(inner.topic, into);
|
|
@@ -2735,7 +2811,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2735
2811
|
}
|
|
2736
2812
|
case P2pEvent_Tags.PubsubOutboundFailure:
|
|
2737
2813
|
{
|
|
2738
|
-
ordinalConverter.write(
|
|
2814
|
+
ordinalConverter.write(28, into);
|
|
2739
2815
|
const inner = value.inner;
|
|
2740
2816
|
FfiConverterString.write(inner.peerId, into);
|
|
2741
2817
|
FfiConverterString.write(inner.reason, into);
|
|
@@ -2743,7 +2819,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2743
2819
|
}
|
|
2744
2820
|
case P2pEvent_Tags.PubsubProtocolViolation:
|
|
2745
2821
|
{
|
|
2746
|
-
ordinalConverter.write(
|
|
2822
|
+
ordinalConverter.write(29, into);
|
|
2747
2823
|
const inner = value.inner;
|
|
2748
2824
|
FfiConverterString.write(inner.peerId, into);
|
|
2749
2825
|
FfiConverterString.write(inner.reason, into);
|
|
@@ -2751,7 +2827,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2751
2827
|
}
|
|
2752
2828
|
case P2pEvent_Tags.PeerDiscovered:
|
|
2753
2829
|
{
|
|
2754
|
-
ordinalConverter.write(
|
|
2830
|
+
ordinalConverter.write(30, into);
|
|
2755
2831
|
const inner = value.inner;
|
|
2756
2832
|
FfiConverterString.write(inner.peerId, into);
|
|
2757
2833
|
FfiConverterSequenceString.write(inner.addrs, into);
|
|
@@ -2760,7 +2836,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2760
2836
|
}
|
|
2761
2837
|
case P2pEvent_Tags.PeerUpdated:
|
|
2762
2838
|
{
|
|
2763
|
-
ordinalConverter.write(
|
|
2839
|
+
ordinalConverter.write(31, into);
|
|
2764
2840
|
const inner = value.inner;
|
|
2765
2841
|
FfiConverterString.write(inner.peerId, into);
|
|
2766
2842
|
FfiConverterSequenceString.write(inner.addrs, into);
|
|
@@ -2769,14 +2845,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2769
2845
|
}
|
|
2770
2846
|
case P2pEvent_Tags.PeerExpired:
|
|
2771
2847
|
{
|
|
2772
|
-
ordinalConverter.write(
|
|
2848
|
+
ordinalConverter.write(32, into);
|
|
2773
2849
|
const inner = value.inner;
|
|
2774
2850
|
FfiConverterString.write(inner.peerId, into);
|
|
2775
2851
|
return;
|
|
2776
2852
|
}
|
|
2777
2853
|
case P2pEvent_Tags.DiscoveryDialFailed:
|
|
2778
2854
|
{
|
|
2779
|
-
ordinalConverter.write(
|
|
2855
|
+
ordinalConverter.write(33, into);
|
|
2780
2856
|
const inner = value.inner;
|
|
2781
2857
|
FfiConverterString.write(inner.peerId, into);
|
|
2782
2858
|
FfiConverterString.write(inner.reason, into);
|
|
@@ -2784,7 +2860,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2784
2860
|
}
|
|
2785
2861
|
case P2pEvent_Tags.DiscoveryProtocolViolation:
|
|
2786
2862
|
{
|
|
2787
|
-
ordinalConverter.write(
|
|
2863
|
+
ordinalConverter.write(34, into);
|
|
2788
2864
|
const inner = value.inner;
|
|
2789
2865
|
FfiConverterOptionalString.write(inner.peerId, into);
|
|
2790
2866
|
FfiConverterTypeDiscoverySource.write(inner.source, into);
|
|
@@ -2952,10 +3028,18 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2952
3028
|
size += FfiConverterTypePathKind.allocationSize(inner.path);
|
|
2953
3029
|
return size;
|
|
2954
3030
|
}
|
|
2955
|
-
case P2pEvent_Tags.
|
|
3031
|
+
case P2pEvent_Tags.InboundPathEstablished:
|
|
2956
3032
|
{
|
|
2957
3033
|
const inner = value.inner;
|
|
2958
3034
|
let size = ordinalConverter.allocationSize(19);
|
|
3035
|
+
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3036
|
+
size += FfiConverterTypePathKind.allocationSize(inner.path);
|
|
3037
|
+
return size;
|
|
3038
|
+
}
|
|
3039
|
+
case P2pEvent_Tags.PathUpgraded:
|
|
3040
|
+
{
|
|
3041
|
+
const inner = value.inner;
|
|
3042
|
+
let size = ordinalConverter.allocationSize(20);
|
|
2959
3043
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2960
3044
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2961
3045
|
size += FfiConverterTypePathKind.allocationSize(inner.from);
|
|
@@ -2965,7 +3049,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2965
3049
|
case P2pEvent_Tags.HolePunchFailed:
|
|
2966
3050
|
{
|
|
2967
3051
|
const inner = value.inner;
|
|
2968
|
-
let size = ordinalConverter.allocationSize(
|
|
3052
|
+
let size = ordinalConverter.allocationSize(21);
|
|
2969
3053
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2970
3054
|
size += FfiConverterUInt32.allocationSize(inner.attempt);
|
|
2971
3055
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
@@ -2974,7 +3058,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2974
3058
|
case P2pEvent_Tags.FellBackToRelay:
|
|
2975
3059
|
{
|
|
2976
3060
|
const inner = value.inner;
|
|
2977
|
-
let size = ordinalConverter.allocationSize(
|
|
3061
|
+
let size = ordinalConverter.allocationSize(22);
|
|
2978
3062
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2979
3063
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2980
3064
|
return size;
|
|
@@ -2982,7 +3066,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2982
3066
|
case P2pEvent_Tags.ConnectFailed:
|
|
2983
3067
|
{
|
|
2984
3068
|
const inner = value.inner;
|
|
2985
|
-
let size = ordinalConverter.allocationSize(
|
|
3069
|
+
let size = ordinalConverter.allocationSize(23);
|
|
2986
3070
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2987
3071
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2988
3072
|
size += FfiConverterTypeNatErrorKind.allocationSize(inner.kind);
|
|
@@ -2992,14 +3076,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2992
3076
|
case P2pEvent_Tags.InboundDirectUpgrade:
|
|
2993
3077
|
{
|
|
2994
3078
|
const inner = value.inner;
|
|
2995
|
-
let size = ordinalConverter.allocationSize(
|
|
3079
|
+
let size = ordinalConverter.allocationSize(24);
|
|
2996
3080
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2997
3081
|
return size;
|
|
2998
3082
|
}
|
|
2999
3083
|
case P2pEvent_Tags.Message:
|
|
3000
3084
|
{
|
|
3001
3085
|
const inner = value.inner;
|
|
3002
|
-
let size = ordinalConverter.allocationSize(
|
|
3086
|
+
let size = ordinalConverter.allocationSize(25);
|
|
3003
3087
|
size += FfiConverterString.allocationSize(inner.fromPeerId);
|
|
3004
3088
|
size += FfiConverterSequenceString.allocationSize(inner.topics);
|
|
3005
3089
|
size += FfiConverterArrayBuffer.allocationSize(inner.data);
|
|
@@ -3010,7 +3094,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3010
3094
|
case P2pEvent_Tags.PeerSubscribed:
|
|
3011
3095
|
{
|
|
3012
3096
|
const inner = value.inner;
|
|
3013
|
-
let size = ordinalConverter.allocationSize(
|
|
3097
|
+
let size = ordinalConverter.allocationSize(26);
|
|
3014
3098
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3015
3099
|
size += FfiConverterString.allocationSize(inner.topic);
|
|
3016
3100
|
return size;
|
|
@@ -3018,7 +3102,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3018
3102
|
case P2pEvent_Tags.PeerUnsubscribed:
|
|
3019
3103
|
{
|
|
3020
3104
|
const inner = value.inner;
|
|
3021
|
-
let size = ordinalConverter.allocationSize(
|
|
3105
|
+
let size = ordinalConverter.allocationSize(27);
|
|
3022
3106
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3023
3107
|
size += FfiConverterString.allocationSize(inner.topic);
|
|
3024
3108
|
return size;
|
|
@@ -3026,7 +3110,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3026
3110
|
case P2pEvent_Tags.PubsubOutboundFailure:
|
|
3027
3111
|
{
|
|
3028
3112
|
const inner = value.inner;
|
|
3029
|
-
let size = ordinalConverter.allocationSize(
|
|
3113
|
+
let size = ordinalConverter.allocationSize(28);
|
|
3030
3114
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3031
3115
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
3032
3116
|
return size;
|
|
@@ -3034,7 +3118,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3034
3118
|
case P2pEvent_Tags.PubsubProtocolViolation:
|
|
3035
3119
|
{
|
|
3036
3120
|
const inner = value.inner;
|
|
3037
|
-
let size = ordinalConverter.allocationSize(
|
|
3121
|
+
let size = ordinalConverter.allocationSize(29);
|
|
3038
3122
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3039
3123
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
3040
3124
|
return size;
|
|
@@ -3042,7 +3126,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3042
3126
|
case P2pEvent_Tags.PeerDiscovered:
|
|
3043
3127
|
{
|
|
3044
3128
|
const inner = value.inner;
|
|
3045
|
-
let size = ordinalConverter.allocationSize(
|
|
3129
|
+
let size = ordinalConverter.allocationSize(30);
|
|
3046
3130
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3047
3131
|
size += FfiConverterSequenceString.allocationSize(inner.addrs);
|
|
3048
3132
|
size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
|
|
@@ -3051,7 +3135,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3051
3135
|
case P2pEvent_Tags.PeerUpdated:
|
|
3052
3136
|
{
|
|
3053
3137
|
const inner = value.inner;
|
|
3054
|
-
let size = ordinalConverter.allocationSize(
|
|
3138
|
+
let size = ordinalConverter.allocationSize(31);
|
|
3055
3139
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3056
3140
|
size += FfiConverterSequenceString.allocationSize(inner.addrs);
|
|
3057
3141
|
size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
|
|
@@ -3060,14 +3144,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3060
3144
|
case P2pEvent_Tags.PeerExpired:
|
|
3061
3145
|
{
|
|
3062
3146
|
const inner = value.inner;
|
|
3063
|
-
let size = ordinalConverter.allocationSize(
|
|
3147
|
+
let size = ordinalConverter.allocationSize(32);
|
|
3064
3148
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3065
3149
|
return size;
|
|
3066
3150
|
}
|
|
3067
3151
|
case P2pEvent_Tags.DiscoveryDialFailed:
|
|
3068
3152
|
{
|
|
3069
3153
|
const inner = value.inner;
|
|
3070
|
-
let size = ordinalConverter.allocationSize(
|
|
3154
|
+
let size = ordinalConverter.allocationSize(33);
|
|
3071
3155
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3072
3156
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
3073
3157
|
return size;
|
|
@@ -3075,7 +3159,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3075
3159
|
case P2pEvent_Tags.DiscoveryProtocolViolation:
|
|
3076
3160
|
{
|
|
3077
3161
|
const inner = value.inner;
|
|
3078
|
-
let size = ordinalConverter.allocationSize(
|
|
3162
|
+
let size = ordinalConverter.allocationSize(34);
|
|
3079
3163
|
size += FfiConverterOptionalString.allocationSize(inner.peerId);
|
|
3080
3164
|
size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
|
|
3081
3165
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
@@ -3209,7 +3293,8 @@ const uniffiCallbackInterfaceP2pEventListener = {
|
|
|
3209
3293
|
export class P2pEndpoint extends UniffiAbstractObject {
|
|
3210
3294
|
[uniffiTypeNameSymbol] = "P2pEndpoint";
|
|
3211
3295
|
/**
|
|
3212
|
-
* Validates the secret key and `config`, binds
|
|
3296
|
+
* Validates the secret key and `config`, binds its transports, and creates
|
|
3297
|
+
* an endpoint.
|
|
3213
3298
|
*
|
|
3214
3299
|
* The endpoint begins in the created state and owns its bound sockets,
|
|
3215
3300
|
* but does not run a background driver until explicitly started.
|
|
@@ -3287,7 +3372,8 @@ export class P2pEndpoint extends UniffiAbstractObject {
|
|
|
3287
3372
|
}
|
|
3288
3373
|
|
|
3289
3374
|
/**
|
|
3290
|
-
* Starts a connection attempt toward a direct
|
|
3375
|
+
* Starts a connection attempt toward a direct `/tcp` or `/quic-v1` peer
|
|
3376
|
+
* address.
|
|
3291
3377
|
*/
|
|
3292
3378
|
connectAddr(address) /*throws*/{
|
|
3293
3379
|
return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
|
|
@@ -3305,7 +3391,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
|
|
|
3305
3391
|
}
|
|
3306
3392
|
|
|
3307
3393
|
/**
|
|
3308
|
-
* Returns peers with an established QUIC or circuit connection.
|
|
3394
|
+
* Returns peers with an established TCP, QUIC, or circuit connection.
|
|
3309
3395
|
*/
|
|
3310
3396
|
connectedPeers() /*throws*/{
|
|
3311
3397
|
return (__rb => {
|
|
@@ -3418,7 +3504,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
|
|
|
3418
3504
|
}
|
|
3419
3505
|
|
|
3420
3506
|
/**
|
|
3421
|
-
* Returns the bound QUIC peer addresses.
|
|
3507
|
+
* Returns the bound TCP or QUIC peer addresses.
|
|
3422
3508
|
*/
|
|
3423
3509
|
listenAddrs() {
|
|
3424
3510
|
return (__rb => {
|
|
@@ -3657,6 +3743,12 @@ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
|
3657
3743
|
// FfiConverter for Array<string>
|
|
3658
3744
|
const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
|
|
3659
3745
|
|
|
3746
|
+
// FfiConverter for Array<string> | undefined
|
|
3747
|
+
const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
|
|
3748
|
+
|
|
3749
|
+
// FfiConverter for TransportOptions | undefined
|
|
3750
|
+
const FfiConverterOptionalTypeTransportOptions = new FfiConverterOptional(FfiConverterTypeTransportOptions);
|
|
3751
|
+
|
|
3660
3752
|
// FfiConverter for DiscoveryOptions | undefined
|
|
3661
3753
|
const FfiConverterOptionalTypeDiscoveryOptions = new FfiConverterOptional(FfiConverterTypeDiscoveryOptions);
|
|
3662
3754
|
|
|
@@ -3702,7 +3794,7 @@ function uniffiEnsureInitialized() {
|
|
|
3702
3794
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
3703
3795
|
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
3704
3796
|
}
|
|
3705
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_circuit_address() !==
|
|
3797
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_circuit_address() !== 18077) {
|
|
3706
3798
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_func_circuit_address");
|
|
3707
3799
|
}
|
|
3708
3800
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_generate_secret_key() !== 44400) {
|
|
@@ -3711,7 +3803,7 @@ function uniffiEnsureInitialized() {
|
|
|
3711
3803
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_peer_id_from_secret_key() !== 8962) {
|
|
3712
3804
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_func_peer_id_from_secret_key");
|
|
3713
3805
|
}
|
|
3714
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new() !==
|
|
3806
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new() !== 64534) {
|
|
3715
3807
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new");
|
|
3716
3808
|
}
|
|
3717
3809
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream() !== 60482) {
|
|
@@ -3732,13 +3824,13 @@ function uniffiEnsureInitialized() {
|
|
|
3732
3824
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect() !== 60427) {
|
|
3733
3825
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect");
|
|
3734
3826
|
}
|
|
3735
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_addr() !==
|
|
3827
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_addr() !== 15782) {
|
|
3736
3828
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_addr");
|
|
3737
3829
|
}
|
|
3738
3830
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_with_addrs() !== 44153) {
|
|
3739
3831
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_with_addrs");
|
|
3740
3832
|
}
|
|
3741
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connected_peers() !==
|
|
3833
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connected_peers() !== 52578) {
|
|
3742
3834
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connected_peers");
|
|
3743
3835
|
}
|
|
3744
3836
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial() !== 47576) {
|
|
@@ -3765,7 +3857,7 @@ function uniffiEnsureInitialized() {
|
|
|
3765
3857
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_known_peers() !== 27328) {
|
|
3766
3858
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_known_peers");
|
|
3767
3859
|
}
|
|
3768
|
-
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_listen_addrs() !==
|
|
3860
|
+
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_listen_addrs() !== 60889) {
|
|
3769
3861
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_listen_addrs");
|
|
3770
3862
|
}
|
|
3771
3863
|
if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_open_stream() !== 18245) {
|
|
@@ -3838,7 +3930,8 @@ export default Object.freeze({
|
|
|
3838
3930
|
FfiConverterTypePathKind,
|
|
3839
3931
|
FfiConverterTypePubsubRouter,
|
|
3840
3932
|
FfiConverterTypeReachability,
|
|
3841
|
-
FfiConverterTypeRelayReservationInfo
|
|
3933
|
+
FfiConverterTypeRelayReservationInfo,
|
|
3934
|
+
FfiConverterTypeTransportOptions
|
|
3842
3935
|
}
|
|
3843
3936
|
});
|
|
3844
3937
|
//# sourceMappingURL=minip2p_ffi.js.map
|