@minip2p/react-native 0.3.0 → 0.3.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/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/Info.plist +4 -4
- 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/generated/minip2p_ffi.js +88 -44
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +46 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/generated/minip2p_ffi.ts +97 -46
package/README.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# @minip2p/react-native
|
|
2
2
|
|
|
3
|
-
React Native
|
|
3
|
+
React Native bindings for [minip2p](https://minip2p.com), with the platform-neutral `@minip2p/core` API and bundled Android and iOS libraries.
|
|
4
4
|
|
|
5
|
-
The package is pre-1.0
|
|
5
|
+
The package is pre-1.0 and may introduce breaking changes between releases.
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
9
|
- React Native 0.85 with the New Architecture and Hermes
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Rust with the configured mobile targets
|
|
13
|
-
- Android SDK 36 and NDK 28.2.13676358
|
|
14
|
-
- Xcode 26 with an iOS deployment target of at least 15.1
|
|
10
|
+
- iOS 15.1 or newer
|
|
11
|
+
- Android API 24 or newer
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
Expo Go cannot load custom Rust and C++ native libraries. Expo projects must use a [development build](https://docs.expo.dev/develop/development-builds/introduction/).
|
|
17
14
|
|
|
18
15
|
## Installation
|
|
19
16
|
|
|
@@ -21,7 +18,7 @@ The example uses Expo SDK 56 and `expo-dev-client`. Expo Go is not supported: it
|
|
|
21
18
|
pnpm add @minip2p/react-native
|
|
22
19
|
```
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
Rebuild the native app after installing the package.
|
|
25
22
|
|
|
26
23
|
## Usage
|
|
27
24
|
|
|
@@ -34,85 +31,36 @@ const endpoint = Minip2p.create({
|
|
|
34
31
|
protocols: ["/example/files/1"],
|
|
35
32
|
});
|
|
36
33
|
|
|
37
|
-
const unsubscribe = endpoint.on("peerReady", ({ peerId
|
|
38
|
-
console.log("peer ready", peerId
|
|
34
|
+
const unsubscribe = endpoint.on("peerReady", ({ peerId }) => {
|
|
35
|
+
console.log("peer ready", peerId);
|
|
39
36
|
});
|
|
40
37
|
|
|
41
38
|
endpoint.subscribe("/example/chat/1");
|
|
42
|
-
endpoint.publish("/example/chat/1", "hello
|
|
39
|
+
endpoint.publish("/example/chat/1", "hello");
|
|
43
40
|
|
|
44
|
-
const
|
|
45
|
-
await endpoint.waitPeerReady(
|
|
46
|
-
const rttMs = await endpoint.ping(
|
|
47
|
-
|
|
41
|
+
const path = await endpoint.connectAddr(remoteAddress);
|
|
42
|
+
await endpoint.waitPeerReady(path.peerId);
|
|
43
|
+
const rttMs = await endpoint.ping(path.peerId);
|
|
44
|
+
|
|
45
|
+
const stream = await endpoint.openStream(path.peerId, "/example/files/1");
|
|
48
46
|
stream.write(new Uint8Array([1, 2, 3]));
|
|
49
47
|
stream.closeWrite();
|
|
50
48
|
|
|
51
|
-
// Signal AppState changes before foreground queries or reconnect work.
|
|
52
|
-
endpoint.setActive(false);
|
|
53
|
-
endpoint.setActive(true);
|
|
54
|
-
|
|
55
49
|
unsubscribe();
|
|
56
50
|
endpoint.close();
|
|
57
51
|
```
|
|
58
52
|
|
|
59
|
-
`Minip2p.create`
|
|
60
|
-
|
|
61
|
-
Configuration defaults to gossipsub, signed messages, no relay, and no discovery. Set `pubsubRouter` to `PubsubRouter.Floodsub` when interoperability requires floodsub. mDNS requires local-network/multicast permissions in the host app; Expo Go cannot provide the native module, so use the included Expo development-build workflow.
|
|
62
|
-
|
|
63
|
-
## Wrapper contracts
|
|
64
|
-
|
|
65
|
-
- Generated Rust `u64` values are checked before conversion from `bigint` to JavaScript `number`. Values outside the safe integer range throw.
|
|
66
|
-
- Native events are delivered FIFO through a bounded host queue. Overflow is a typed `queueOverflow` event; refresh queryable state when it occurs.
|
|
67
|
-
- Named event handlers receive flattened payloads. Catch-all handlers receive flattened discriminated events and safe inbound-stream metadata only.
|
|
68
|
-
- `handlerError` is queued after fan-out when an event handler throws.
|
|
69
|
-
- `path(peerId)` is authoritative for NAT-orchestrated paths and independent of event consumption.
|
|
70
|
-
- `close` rejects pending work, closes streams, destroys the UniFFI object, and then fires `onClose` once. A host needing the native stopped barrier can import the generated low-level API from `@minip2p/react-native/native`.
|
|
71
|
-
- Unsigned pubsub messages are explicitly untrusted. When `signed` is false, both payload and `fromPeerId` are attacker-controlled.
|
|
72
|
-
|
|
73
|
-
## Generation
|
|
74
|
-
|
|
75
|
-
Generated TypeScript, C++, Kotlin, Objective-C++, and React Native Codegen sources are committed. Do not edit them directly.
|
|
76
|
-
|
|
77
|
-
```sh
|
|
78
|
-
pnpm install --frozen-lockfile
|
|
79
|
-
pnpm ubrn:ios
|
|
80
|
-
pnpm ubrn:android
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
`uniffi`, `uniffi-bindgen-react-native`, and `@ubjs/core` must move together. The current exact versions are `0.31.0`, `0.31.0-3`, and `0.31.0-3`.
|
|
84
|
-
|
|
85
|
-
The pnpm patch in `patches/` fixes two ubrn 0.31 Android generator issues: package-root resolution under package exports and `jniLibs` resolution when CMake is included by an application.
|
|
53
|
+
`Minip2p.create` starts the native driver. `useMinip2p` manages an endpoint for a React component, while `bindAppState` keeps its foreground state synchronized.
|
|
86
54
|
|
|
87
|
-
|
|
55
|
+
Configuration defaults to gossipsub with signed messages and no relay or discovery. Set `mdns: true` for local discovery and ensure the host app has local-network and multicast permissions.
|
|
88
56
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
## Example development build
|
|
92
|
-
|
|
93
|
-
```sh
|
|
94
|
-
pnpm example prebuild
|
|
95
|
-
pnpm example android
|
|
96
|
-
pnpm example ios
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The example's `android/` and `ios/` directories are generated by Expo and ignored. Its config plugin pins NDK r28c on every prebuild.
|
|
100
|
-
|
|
101
|
-
The app is an executable smoke suite, not a mock UI. It creates two native endpoints over loopback QUIC and checks:
|
|
102
|
-
|
|
103
|
-
- path establishment and a reentrant query from a callback;
|
|
104
|
-
- Unicode and 60 KiB signed pubsub payloads;
|
|
105
|
-
- listener-exception containment and waiter fan-out;
|
|
106
|
-
- active, idle, and foreground-transition query latency;
|
|
107
|
-
- close during event delivery, 50 create/close cycles, and reverse close order.
|
|
108
|
-
|
|
109
|
-
Use an Expo development build and Metro:
|
|
110
|
-
|
|
111
|
-
```sh
|
|
112
|
-
pnpm example start --dev-client --lan
|
|
113
|
-
```
|
|
57
|
+
## Important behavior
|
|
114
58
|
|
|
115
|
-
|
|
59
|
+
- Operations support timeouts and `AbortSignal` cancellation.
|
|
60
|
+
- Native events are delivered FIFO through a bounded queue; handle `queueOverflow` by refreshing queryable state.
|
|
61
|
+
- Use a named `stream` handler to claim inbound streams.
|
|
62
|
+
- Unsigned pubsub payloads and peer IDs are attacker-controlled.
|
|
63
|
+
- `close()` rejects pending work, closes streams, and releases the native endpoint.
|
|
116
64
|
|
|
117
65
|
## License
|
|
118
66
|
|
|
Binary file
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>libminip2p_ffi.a</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-arm64</string>
|
|
11
|
+
<string>ios-arm64-simulator</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>libminip2p_ffi.a</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
@@ -17,12 +17,14 @@
|
|
|
17
17
|
</array>
|
|
18
18
|
<key>SupportedPlatform</key>
|
|
19
19
|
<string>ios</string>
|
|
20
|
+
<key>SupportedPlatformVariant</key>
|
|
21
|
+
<string>simulator</string>
|
|
20
22
|
</dict>
|
|
21
23
|
<dict>
|
|
22
24
|
<key>BinaryPath</key>
|
|
23
25
|
<string>libminip2p_ffi.a</string>
|
|
24
26
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-arm64
|
|
27
|
+
<string>ios-arm64</string>
|
|
26
28
|
<key>LibraryPath</key>
|
|
27
29
|
<string>libminip2p_ffi.a</string>
|
|
28
30
|
<key>SupportedArchitectures</key>
|
|
@@ -31,8 +33,6 @@
|
|
|
31
33
|
</array>
|
|
32
34
|
<key>SupportedPlatform</key>
|
|
33
35
|
<string>ios</string>
|
|
34
|
-
<key>SupportedPlatformVariant</key>
|
|
35
|
-
<string>simulator</string>
|
|
36
36
|
</dict>
|
|
37
37
|
</array>
|
|
38
38
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
@@ -1551,6 +1551,7 @@ export let P2pEvent_Tags = /*#__PURE__*/function (P2pEvent_Tags) {
|
|
|
1551
1551
|
P2pEvent_Tags["RelayReserved"] = "RelayReserved";
|
|
1552
1552
|
P2pEvent_Tags["RelayReservationLost"] = "RelayReservationLost";
|
|
1553
1553
|
P2pEvent_Tags["PathEstablished"] = "PathEstablished";
|
|
1554
|
+
P2pEvent_Tags["InboundPathEstablished"] = "InboundPathEstablished";
|
|
1554
1555
|
P2pEvent_Tags["PathUpgraded"] = "PathUpgraded";
|
|
1555
1556
|
P2pEvent_Tags["HolePunchFailed"] = "HolePunchFailed";
|
|
1556
1557
|
P2pEvent_Tags["FellBackToRelay"] = "FellBackToRelay";
|
|
@@ -1950,6 +1951,27 @@ export const P2pEvent = (() => {
|
|
|
1950
1951
|
return obj.tag === P2pEvent_Tags.PathEstablished;
|
|
1951
1952
|
}
|
|
1952
1953
|
}
|
|
1954
|
+
/**
|
|
1955
|
+
* An inbound relay circuit became a usable path.
|
|
1956
|
+
*/
|
|
1957
|
+
class InboundPathEstablished_ extends UniffiEnum {
|
|
1958
|
+
/**
|
|
1959
|
+
* @private
|
|
1960
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1961
|
+
*/
|
|
1962
|
+
[uniffiTypeNameSymbol] = "P2pEvent";
|
|
1963
|
+
tag = P2pEvent_Tags.InboundPathEstablished;
|
|
1964
|
+
constructor(inner) {
|
|
1965
|
+
super("P2pEvent", "InboundPathEstablished");
|
|
1966
|
+
this.inner = Object.freeze(inner);
|
|
1967
|
+
}
|
|
1968
|
+
static new(inner) {
|
|
1969
|
+
return new InboundPathEstablished_(inner);
|
|
1970
|
+
}
|
|
1971
|
+
static instanceOf(obj) {
|
|
1972
|
+
return obj.tag === P2pEvent_Tags.InboundPathEstablished;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1953
1975
|
/**
|
|
1954
1976
|
* A better path replaced an earlier path.
|
|
1955
1977
|
*/
|
|
@@ -2292,6 +2314,7 @@ export const P2pEvent = (() => {
|
|
|
2292
2314
|
RelayReserved: RelayReserved_,
|
|
2293
2315
|
RelayReservationLost: RelayReservationLost_,
|
|
2294
2316
|
PathEstablished: PathEstablished_,
|
|
2317
|
+
InboundPathEstablished: InboundPathEstablished_,
|
|
2295
2318
|
PathUpgraded: PathUpgraded_,
|
|
2296
2319
|
HolePunchFailed: HolePunchFailed_,
|
|
2297
2320
|
FellBackToRelay: FellBackToRelay_,
|
|
@@ -2419,35 +2442,40 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2419
2442
|
path: FfiConverterTypePathKind.read(from)
|
|
2420
2443
|
});
|
|
2421
2444
|
case 19:
|
|
2445
|
+
return new P2pEvent.InboundPathEstablished({
|
|
2446
|
+
peerId: FfiConverterString.read(from),
|
|
2447
|
+
path: FfiConverterTypePathKind.read(from)
|
|
2448
|
+
});
|
|
2449
|
+
case 20:
|
|
2422
2450
|
return new P2pEvent.PathUpgraded({
|
|
2423
2451
|
connectId: FfiConverterUInt64.read(from),
|
|
2424
2452
|
peerId: FfiConverterString.read(from),
|
|
2425
2453
|
from: FfiConverterTypePathKind.read(from),
|
|
2426
2454
|
to: FfiConverterTypePathKind.read(from)
|
|
2427
2455
|
});
|
|
2428
|
-
case
|
|
2456
|
+
case 21:
|
|
2429
2457
|
return new P2pEvent.HolePunchFailed({
|
|
2430
2458
|
connectId: FfiConverterUInt64.read(from),
|
|
2431
2459
|
attempt: FfiConverterUInt32.read(from),
|
|
2432
2460
|
reason: FfiConverterString.read(from)
|
|
2433
2461
|
});
|
|
2434
|
-
case
|
|
2462
|
+
case 22:
|
|
2435
2463
|
return new P2pEvent.FellBackToRelay({
|
|
2436
2464
|
connectId: FfiConverterUInt64.read(from),
|
|
2437
2465
|
peerId: FfiConverterString.read(from)
|
|
2438
2466
|
});
|
|
2439
|
-
case
|
|
2467
|
+
case 23:
|
|
2440
2468
|
return new P2pEvent.ConnectFailed({
|
|
2441
2469
|
connectId: FfiConverterUInt64.read(from),
|
|
2442
2470
|
peerId: FfiConverterString.read(from),
|
|
2443
2471
|
kind: FfiConverterTypeNatErrorKind.read(from),
|
|
2444
2472
|
detail: FfiConverterString.read(from)
|
|
2445
2473
|
});
|
|
2446
|
-
case
|
|
2474
|
+
case 24:
|
|
2447
2475
|
return new P2pEvent.InboundDirectUpgrade({
|
|
2448
2476
|
peerId: FfiConverterString.read(from)
|
|
2449
2477
|
});
|
|
2450
|
-
case
|
|
2478
|
+
case 25:
|
|
2451
2479
|
return new P2pEvent.Message({
|
|
2452
2480
|
fromPeerId: FfiConverterString.read(from),
|
|
2453
2481
|
topics: FfiConverterSequenceString.read(from),
|
|
@@ -2455,48 +2483,48 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2455
2483
|
seqno: FfiConverterArrayBuffer.read(from),
|
|
2456
2484
|
signed: FfiConverterBool.read(from)
|
|
2457
2485
|
});
|
|
2458
|
-
case
|
|
2486
|
+
case 26:
|
|
2459
2487
|
return new P2pEvent.PeerSubscribed({
|
|
2460
2488
|
peerId: FfiConverterString.read(from),
|
|
2461
2489
|
topic: FfiConverterString.read(from)
|
|
2462
2490
|
});
|
|
2463
|
-
case
|
|
2491
|
+
case 27:
|
|
2464
2492
|
return new P2pEvent.PeerUnsubscribed({
|
|
2465
2493
|
peerId: FfiConverterString.read(from),
|
|
2466
2494
|
topic: FfiConverterString.read(from)
|
|
2467
2495
|
});
|
|
2468
|
-
case
|
|
2496
|
+
case 28:
|
|
2469
2497
|
return new P2pEvent.PubsubOutboundFailure({
|
|
2470
2498
|
peerId: FfiConverterString.read(from),
|
|
2471
2499
|
reason: FfiConverterString.read(from)
|
|
2472
2500
|
});
|
|
2473
|
-
case
|
|
2501
|
+
case 29:
|
|
2474
2502
|
return new P2pEvent.PubsubProtocolViolation({
|
|
2475
2503
|
peerId: FfiConverterString.read(from),
|
|
2476
2504
|
reason: FfiConverterString.read(from)
|
|
2477
2505
|
});
|
|
2478
|
-
case
|
|
2506
|
+
case 30:
|
|
2479
2507
|
return new P2pEvent.PeerDiscovered({
|
|
2480
2508
|
peerId: FfiConverterString.read(from),
|
|
2481
2509
|
addrs: FfiConverterSequenceString.read(from),
|
|
2482
2510
|
source: FfiConverterTypeDiscoverySource.read(from)
|
|
2483
2511
|
});
|
|
2484
|
-
case
|
|
2512
|
+
case 31:
|
|
2485
2513
|
return new P2pEvent.PeerUpdated({
|
|
2486
2514
|
peerId: FfiConverterString.read(from),
|
|
2487
2515
|
addrs: FfiConverterSequenceString.read(from),
|
|
2488
2516
|
source: FfiConverterTypeDiscoverySource.read(from)
|
|
2489
2517
|
});
|
|
2490
|
-
case
|
|
2518
|
+
case 32:
|
|
2491
2519
|
return new P2pEvent.PeerExpired({
|
|
2492
2520
|
peerId: FfiConverterString.read(from)
|
|
2493
2521
|
});
|
|
2494
|
-
case
|
|
2522
|
+
case 33:
|
|
2495
2523
|
return new P2pEvent.DiscoveryDialFailed({
|
|
2496
2524
|
peerId: FfiConverterString.read(from),
|
|
2497
2525
|
reason: FfiConverterString.read(from)
|
|
2498
2526
|
});
|
|
2499
|
-
case
|
|
2527
|
+
case 34:
|
|
2500
2528
|
return new P2pEvent.DiscoveryProtocolViolation({
|
|
2501
2529
|
peerId: FfiConverterOptionalString.read(from),
|
|
2502
2530
|
source: FfiConverterTypeDiscoverySource.read(from),
|
|
@@ -2662,10 +2690,18 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2662
2690
|
FfiConverterTypePathKind.write(inner.path, into);
|
|
2663
2691
|
return;
|
|
2664
2692
|
}
|
|
2665
|
-
case P2pEvent_Tags.
|
|
2693
|
+
case P2pEvent_Tags.InboundPathEstablished:
|
|
2666
2694
|
{
|
|
2667
2695
|
ordinalConverter.write(19, into);
|
|
2668
2696
|
const inner = value.inner;
|
|
2697
|
+
FfiConverterString.write(inner.peerId, into);
|
|
2698
|
+
FfiConverterTypePathKind.write(inner.path, into);
|
|
2699
|
+
return;
|
|
2700
|
+
}
|
|
2701
|
+
case P2pEvent_Tags.PathUpgraded:
|
|
2702
|
+
{
|
|
2703
|
+
ordinalConverter.write(20, into);
|
|
2704
|
+
const inner = value.inner;
|
|
2669
2705
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2670
2706
|
FfiConverterString.write(inner.peerId, into);
|
|
2671
2707
|
FfiConverterTypePathKind.write(inner.from, into);
|
|
@@ -2674,7 +2710,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2674
2710
|
}
|
|
2675
2711
|
case P2pEvent_Tags.HolePunchFailed:
|
|
2676
2712
|
{
|
|
2677
|
-
ordinalConverter.write(
|
|
2713
|
+
ordinalConverter.write(21, into);
|
|
2678
2714
|
const inner = value.inner;
|
|
2679
2715
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2680
2716
|
FfiConverterUInt32.write(inner.attempt, into);
|
|
@@ -2683,7 +2719,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2683
2719
|
}
|
|
2684
2720
|
case P2pEvent_Tags.FellBackToRelay:
|
|
2685
2721
|
{
|
|
2686
|
-
ordinalConverter.write(
|
|
2722
|
+
ordinalConverter.write(22, into);
|
|
2687
2723
|
const inner = value.inner;
|
|
2688
2724
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2689
2725
|
FfiConverterString.write(inner.peerId, into);
|
|
@@ -2691,7 +2727,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2691
2727
|
}
|
|
2692
2728
|
case P2pEvent_Tags.ConnectFailed:
|
|
2693
2729
|
{
|
|
2694
|
-
ordinalConverter.write(
|
|
2730
|
+
ordinalConverter.write(23, into);
|
|
2695
2731
|
const inner = value.inner;
|
|
2696
2732
|
FfiConverterUInt64.write(inner.connectId, into);
|
|
2697
2733
|
FfiConverterString.write(inner.peerId, into);
|
|
@@ -2701,14 +2737,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2701
2737
|
}
|
|
2702
2738
|
case P2pEvent_Tags.InboundDirectUpgrade:
|
|
2703
2739
|
{
|
|
2704
|
-
ordinalConverter.write(
|
|
2740
|
+
ordinalConverter.write(24, into);
|
|
2705
2741
|
const inner = value.inner;
|
|
2706
2742
|
FfiConverterString.write(inner.peerId, into);
|
|
2707
2743
|
return;
|
|
2708
2744
|
}
|
|
2709
2745
|
case P2pEvent_Tags.Message:
|
|
2710
2746
|
{
|
|
2711
|
-
ordinalConverter.write(
|
|
2747
|
+
ordinalConverter.write(25, into);
|
|
2712
2748
|
const inner = value.inner;
|
|
2713
2749
|
FfiConverterString.write(inner.fromPeerId, into);
|
|
2714
2750
|
FfiConverterSequenceString.write(inner.topics, into);
|
|
@@ -2719,7 +2755,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2719
2755
|
}
|
|
2720
2756
|
case P2pEvent_Tags.PeerSubscribed:
|
|
2721
2757
|
{
|
|
2722
|
-
ordinalConverter.write(
|
|
2758
|
+
ordinalConverter.write(26, into);
|
|
2723
2759
|
const inner = value.inner;
|
|
2724
2760
|
FfiConverterString.write(inner.peerId, into);
|
|
2725
2761
|
FfiConverterString.write(inner.topic, into);
|
|
@@ -2727,7 +2763,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2727
2763
|
}
|
|
2728
2764
|
case P2pEvent_Tags.PeerUnsubscribed:
|
|
2729
2765
|
{
|
|
2730
|
-
ordinalConverter.write(
|
|
2766
|
+
ordinalConverter.write(27, into);
|
|
2731
2767
|
const inner = value.inner;
|
|
2732
2768
|
FfiConverterString.write(inner.peerId, into);
|
|
2733
2769
|
FfiConverterString.write(inner.topic, into);
|
|
@@ -2735,7 +2771,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2735
2771
|
}
|
|
2736
2772
|
case P2pEvent_Tags.PubsubOutboundFailure:
|
|
2737
2773
|
{
|
|
2738
|
-
ordinalConverter.write(
|
|
2774
|
+
ordinalConverter.write(28, into);
|
|
2739
2775
|
const inner = value.inner;
|
|
2740
2776
|
FfiConverterString.write(inner.peerId, into);
|
|
2741
2777
|
FfiConverterString.write(inner.reason, into);
|
|
@@ -2743,7 +2779,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2743
2779
|
}
|
|
2744
2780
|
case P2pEvent_Tags.PubsubProtocolViolation:
|
|
2745
2781
|
{
|
|
2746
|
-
ordinalConverter.write(
|
|
2782
|
+
ordinalConverter.write(29, into);
|
|
2747
2783
|
const inner = value.inner;
|
|
2748
2784
|
FfiConverterString.write(inner.peerId, into);
|
|
2749
2785
|
FfiConverterString.write(inner.reason, into);
|
|
@@ -2751,7 +2787,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2751
2787
|
}
|
|
2752
2788
|
case P2pEvent_Tags.PeerDiscovered:
|
|
2753
2789
|
{
|
|
2754
|
-
ordinalConverter.write(
|
|
2790
|
+
ordinalConverter.write(30, into);
|
|
2755
2791
|
const inner = value.inner;
|
|
2756
2792
|
FfiConverterString.write(inner.peerId, into);
|
|
2757
2793
|
FfiConverterSequenceString.write(inner.addrs, into);
|
|
@@ -2760,7 +2796,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2760
2796
|
}
|
|
2761
2797
|
case P2pEvent_Tags.PeerUpdated:
|
|
2762
2798
|
{
|
|
2763
|
-
ordinalConverter.write(
|
|
2799
|
+
ordinalConverter.write(31, into);
|
|
2764
2800
|
const inner = value.inner;
|
|
2765
2801
|
FfiConverterString.write(inner.peerId, into);
|
|
2766
2802
|
FfiConverterSequenceString.write(inner.addrs, into);
|
|
@@ -2769,14 +2805,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2769
2805
|
}
|
|
2770
2806
|
case P2pEvent_Tags.PeerExpired:
|
|
2771
2807
|
{
|
|
2772
|
-
ordinalConverter.write(
|
|
2808
|
+
ordinalConverter.write(32, into);
|
|
2773
2809
|
const inner = value.inner;
|
|
2774
2810
|
FfiConverterString.write(inner.peerId, into);
|
|
2775
2811
|
return;
|
|
2776
2812
|
}
|
|
2777
2813
|
case P2pEvent_Tags.DiscoveryDialFailed:
|
|
2778
2814
|
{
|
|
2779
|
-
ordinalConverter.write(
|
|
2815
|
+
ordinalConverter.write(33, into);
|
|
2780
2816
|
const inner = value.inner;
|
|
2781
2817
|
FfiConverterString.write(inner.peerId, into);
|
|
2782
2818
|
FfiConverterString.write(inner.reason, into);
|
|
@@ -2784,7 +2820,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2784
2820
|
}
|
|
2785
2821
|
case P2pEvent_Tags.DiscoveryProtocolViolation:
|
|
2786
2822
|
{
|
|
2787
|
-
ordinalConverter.write(
|
|
2823
|
+
ordinalConverter.write(34, into);
|
|
2788
2824
|
const inner = value.inner;
|
|
2789
2825
|
FfiConverterOptionalString.write(inner.peerId, into);
|
|
2790
2826
|
FfiConverterTypeDiscoverySource.write(inner.source, into);
|
|
@@ -2952,10 +2988,18 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2952
2988
|
size += FfiConverterTypePathKind.allocationSize(inner.path);
|
|
2953
2989
|
return size;
|
|
2954
2990
|
}
|
|
2955
|
-
case P2pEvent_Tags.
|
|
2991
|
+
case P2pEvent_Tags.InboundPathEstablished:
|
|
2956
2992
|
{
|
|
2957
2993
|
const inner = value.inner;
|
|
2958
2994
|
let size = ordinalConverter.allocationSize(19);
|
|
2995
|
+
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2996
|
+
size += FfiConverterTypePathKind.allocationSize(inner.path);
|
|
2997
|
+
return size;
|
|
2998
|
+
}
|
|
2999
|
+
case P2pEvent_Tags.PathUpgraded:
|
|
3000
|
+
{
|
|
3001
|
+
const inner = value.inner;
|
|
3002
|
+
let size = ordinalConverter.allocationSize(20);
|
|
2959
3003
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2960
3004
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2961
3005
|
size += FfiConverterTypePathKind.allocationSize(inner.from);
|
|
@@ -2965,7 +3009,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2965
3009
|
case P2pEvent_Tags.HolePunchFailed:
|
|
2966
3010
|
{
|
|
2967
3011
|
const inner = value.inner;
|
|
2968
|
-
let size = ordinalConverter.allocationSize(
|
|
3012
|
+
let size = ordinalConverter.allocationSize(21);
|
|
2969
3013
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2970
3014
|
size += FfiConverterUInt32.allocationSize(inner.attempt);
|
|
2971
3015
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
@@ -2974,7 +3018,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2974
3018
|
case P2pEvent_Tags.FellBackToRelay:
|
|
2975
3019
|
{
|
|
2976
3020
|
const inner = value.inner;
|
|
2977
|
-
let size = ordinalConverter.allocationSize(
|
|
3021
|
+
let size = ordinalConverter.allocationSize(22);
|
|
2978
3022
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2979
3023
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2980
3024
|
return size;
|
|
@@ -2982,7 +3026,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2982
3026
|
case P2pEvent_Tags.ConnectFailed:
|
|
2983
3027
|
{
|
|
2984
3028
|
const inner = value.inner;
|
|
2985
|
-
let size = ordinalConverter.allocationSize(
|
|
3029
|
+
let size = ordinalConverter.allocationSize(23);
|
|
2986
3030
|
size += FfiConverterUInt64.allocationSize(inner.connectId);
|
|
2987
3031
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2988
3032
|
size += FfiConverterTypeNatErrorKind.allocationSize(inner.kind);
|
|
@@ -2992,14 +3036,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
2992
3036
|
case P2pEvent_Tags.InboundDirectUpgrade:
|
|
2993
3037
|
{
|
|
2994
3038
|
const inner = value.inner;
|
|
2995
|
-
let size = ordinalConverter.allocationSize(
|
|
3039
|
+
let size = ordinalConverter.allocationSize(24);
|
|
2996
3040
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
2997
3041
|
return size;
|
|
2998
3042
|
}
|
|
2999
3043
|
case P2pEvent_Tags.Message:
|
|
3000
3044
|
{
|
|
3001
3045
|
const inner = value.inner;
|
|
3002
|
-
let size = ordinalConverter.allocationSize(
|
|
3046
|
+
let size = ordinalConverter.allocationSize(25);
|
|
3003
3047
|
size += FfiConverterString.allocationSize(inner.fromPeerId);
|
|
3004
3048
|
size += FfiConverterSequenceString.allocationSize(inner.topics);
|
|
3005
3049
|
size += FfiConverterArrayBuffer.allocationSize(inner.data);
|
|
@@ -3010,7 +3054,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3010
3054
|
case P2pEvent_Tags.PeerSubscribed:
|
|
3011
3055
|
{
|
|
3012
3056
|
const inner = value.inner;
|
|
3013
|
-
let size = ordinalConverter.allocationSize(
|
|
3057
|
+
let size = ordinalConverter.allocationSize(26);
|
|
3014
3058
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3015
3059
|
size += FfiConverterString.allocationSize(inner.topic);
|
|
3016
3060
|
return size;
|
|
@@ -3018,7 +3062,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3018
3062
|
case P2pEvent_Tags.PeerUnsubscribed:
|
|
3019
3063
|
{
|
|
3020
3064
|
const inner = value.inner;
|
|
3021
|
-
let size = ordinalConverter.allocationSize(
|
|
3065
|
+
let size = ordinalConverter.allocationSize(27);
|
|
3022
3066
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3023
3067
|
size += FfiConverterString.allocationSize(inner.topic);
|
|
3024
3068
|
return size;
|
|
@@ -3026,7 +3070,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3026
3070
|
case P2pEvent_Tags.PubsubOutboundFailure:
|
|
3027
3071
|
{
|
|
3028
3072
|
const inner = value.inner;
|
|
3029
|
-
let size = ordinalConverter.allocationSize(
|
|
3073
|
+
let size = ordinalConverter.allocationSize(28);
|
|
3030
3074
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3031
3075
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
3032
3076
|
return size;
|
|
@@ -3034,7 +3078,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3034
3078
|
case P2pEvent_Tags.PubsubProtocolViolation:
|
|
3035
3079
|
{
|
|
3036
3080
|
const inner = value.inner;
|
|
3037
|
-
let size = ordinalConverter.allocationSize(
|
|
3081
|
+
let size = ordinalConverter.allocationSize(29);
|
|
3038
3082
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3039
3083
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
3040
3084
|
return size;
|
|
@@ -3042,7 +3086,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3042
3086
|
case P2pEvent_Tags.PeerDiscovered:
|
|
3043
3087
|
{
|
|
3044
3088
|
const inner = value.inner;
|
|
3045
|
-
let size = ordinalConverter.allocationSize(
|
|
3089
|
+
let size = ordinalConverter.allocationSize(30);
|
|
3046
3090
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3047
3091
|
size += FfiConverterSequenceString.allocationSize(inner.addrs);
|
|
3048
3092
|
size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
|
|
@@ -3051,7 +3095,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3051
3095
|
case P2pEvent_Tags.PeerUpdated:
|
|
3052
3096
|
{
|
|
3053
3097
|
const inner = value.inner;
|
|
3054
|
-
let size = ordinalConverter.allocationSize(
|
|
3098
|
+
let size = ordinalConverter.allocationSize(31);
|
|
3055
3099
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3056
3100
|
size += FfiConverterSequenceString.allocationSize(inner.addrs);
|
|
3057
3101
|
size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
|
|
@@ -3060,14 +3104,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3060
3104
|
case P2pEvent_Tags.PeerExpired:
|
|
3061
3105
|
{
|
|
3062
3106
|
const inner = value.inner;
|
|
3063
|
-
let size = ordinalConverter.allocationSize(
|
|
3107
|
+
let size = ordinalConverter.allocationSize(32);
|
|
3064
3108
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3065
3109
|
return size;
|
|
3066
3110
|
}
|
|
3067
3111
|
case P2pEvent_Tags.DiscoveryDialFailed:
|
|
3068
3112
|
{
|
|
3069
3113
|
const inner = value.inner;
|
|
3070
|
-
let size = ordinalConverter.allocationSize(
|
|
3114
|
+
let size = ordinalConverter.allocationSize(33);
|
|
3071
3115
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3072
3116
|
size += FfiConverterString.allocationSize(inner.reason);
|
|
3073
3117
|
return size;
|
|
@@ -3075,7 +3119,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3075
3119
|
case P2pEvent_Tags.DiscoveryProtocolViolation:
|
|
3076
3120
|
{
|
|
3077
3121
|
const inner = value.inner;
|
|
3078
|
-
let size = ordinalConverter.allocationSize(
|
|
3122
|
+
let size = ordinalConverter.allocationSize(34);
|
|
3079
3123
|
size += FfiConverterOptionalString.allocationSize(inner.peerId);
|
|
3080
3124
|
size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
|
|
3081
3125
|
size += FfiConverterString.allocationSize(inner.reason);
|