@minip2p/react-native 0.4.5 → 0.4.7

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.
Files changed (37) hide show
  1. package/Minip2p.podspec +1 -1
  2. package/android/src/main/java/com/minip2p/Minip2pPackage.kt +2 -2
  3. package/android/src/main/jniLibs/arm64-v8a/libminip2p_ffi.so +0 -0
  4. package/android/src/main/jniLibs/x86_64/libminip2p_ffi.so +0 -0
  5. package/build/Minip2pFfi.xcframework/ios-arm64/libminip2p_ffi.a +0 -0
  6. package/build/Minip2pFfi.xcframework/ios-arm64-simulator/libminip2p_ffi.a +0 -0
  7. package/cpp/generated/minip2p_ffi.cpp +263 -205
  8. package/cpp/generated/minip2p_ffi.hpp +8 -6
  9. package/lib/module/adapter.js +11 -10
  10. package/lib/module/adapter.js.map +1 -1
  11. package/lib/module/event-drain.js +71 -0
  12. package/lib/module/event-drain.js.map +1 -0
  13. package/lib/module/generated/minip2p_ffi-ffi.js.map +1 -1
  14. package/lib/module/generated/minip2p_ffi.js +665 -693
  15. package/lib/module/generated/minip2p_ffi.js.map +1 -1
  16. package/lib/typescript/src/NativeMinip2p.d.ts.map +1 -1
  17. package/lib/typescript/src/adapter.d.ts.map +1 -1
  18. package/lib/typescript/src/event-drain.d.ts +10 -0
  19. package/lib/typescript/src/event-drain.d.ts.map +1 -0
  20. package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts +16 -14
  21. package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts.map +1 -1
  22. package/lib/typescript/src/generated/minip2p_ffi.d.ts +785 -782
  23. package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
  24. package/lib/typescript/src/hook-lifecycle.d.ts.map +1 -1
  25. package/lib/typescript/src/hooks.d.ts.map +1 -1
  26. package/lib/typescript/src/native.d.ts.map +1 -1
  27. package/lib/typescript/tests/adapter-event-drain.test.d.ts +2 -0
  28. package/lib/typescript/tests/adapter-event-drain.test.d.ts.map +1 -0
  29. package/lib/typescript/tests/event-drain.test.d.ts +2 -0
  30. package/lib/typescript/tests/event-drain.test.d.ts.map +1 -0
  31. package/lib/typescript/vitest.built.config.d.ts +3 -0
  32. package/lib/typescript/vitest.built.config.d.ts.map +1 -0
  33. package/package.json +18 -18
  34. package/src/adapter.ts +15 -11
  35. package/src/event-drain.ts +80 -0
  36. package/src/generated/minip2p_ffi-ffi.ts +16 -14
  37. package/src/generated/minip2p_ffi.ts +665 -705
@@ -6,7 +6,7 @@
6
6
  /* eslint-disable */
7
7
  // @ts-nocheck
8
8
  import nativeModule from "./minip2p_ffi-ffi.js";
9
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterInt32, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTraitInterfaceCall, uniffiTypeNameSymbol } from "@ubjs/core";
9
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTraitInterfaceCall, uniffiTypeNameSymbol } from "@ubjs/core";
10
10
  const uniffiCaller = new UniffiRustCaller(() => ({
11
11
  code: 0
12
12
  }));
@@ -20,49 +20,44 @@ 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 `/quic-v1` or `/tcp` peer address.
25
23
  */
26
24
  export function circuitAddress(relayAddr, peerId) /*throws*/{
27
- return (__rb => {
28
- try {
29
- return FfiConverterString.lift(__rb);
30
- } finally {
31
- nativeModule().rustbuffer_free(__rb);
32
- }
33
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
25
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
34
26
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_func_circuit_address(FfiConverterString.lower(relayAddr, nativeModule().rustbuffer_alloc), FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc), callStatus);
35
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
27
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
28
+ try {
29
+ return FfiConverterString.lift(__rb);
30
+ } finally {
31
+ nativeModule().rustbuffer_free(__rb);
32
+ }
36
33
  }
37
34
 
38
35
  /**
39
36
  * Generates raw Ed25519 secret key material.
40
37
  */
41
38
  export function generateSecretKey() {
42
- return (__rb => {
43
- try {
44
- return FfiConverterArrayBuffer.lift(__rb);
45
- } finally {
46
- nativeModule().rustbuffer_free(__rb);
47
- }
48
- })(uniffiCaller.rustCall(/*caller:*/callStatus => {
39
+ const __rb = uniffiCaller.rustCall(/*caller:*/callStatus => {
49
40
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_func_generate_secret_key(callStatus);
50
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
41
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
42
+ try {
43
+ return FfiConverterArrayBuffer.lift(__rb);
44
+ } finally {
45
+ nativeModule().rustbuffer_free(__rb);
46
+ }
51
47
  }
52
48
 
53
49
  /**
54
50
  * Derives a base58 peer ID from raw Ed25519 secret key material.
55
51
  */
56
52
  export function peerIdFromSecretKey(secretKey) /*throws*/{
57
- return (__rb => {
58
- try {
59
- return FfiConverterString.lift(__rb);
60
- } finally {
61
- nativeModule().rustbuffer_free(__rb);
62
- }
63
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
53
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
64
54
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_func_peer_id_from_secret_key(FfiConverterArrayBuffer.lower(secretKey, nativeModule().rustbuffer_alloc), callStatus);
65
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
55
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
56
+ try {
57
+ return FfiConverterString.lift(__rb);
58
+ } finally {
59
+ nativeModule().rustbuffer_free(__rb);
60
+ }
66
61
  }
67
62
 
68
63
  // Hermes (React Native ≥ 0.74) ships TextEncoder and encodeInto, but not
@@ -123,19 +118,19 @@ export const DiscoveryOptions = (() => {
123
118
  })();
124
119
  const FfiConverterTypeDiscoveryOptions = (() => {
125
120
  class FFIConverter extends AbstractFfiConverterByteArray {
126
- read(from) {
121
+ readFromCursor(c) {
127
122
  return {
128
- topic: FfiConverterString.read(from),
129
- beaconIntervalMs: FfiConverterUInt64.read(from),
130
- peerTtlMs: FfiConverterUInt64.read(from),
131
- autoDial: FfiConverterBool.read(from)
123
+ topic: FfiConverterString.readFromCursor(c),
124
+ beaconIntervalMs: FfiConverterUInt64.readFromCursor(c),
125
+ peerTtlMs: FfiConverterUInt64.readFromCursor(c),
126
+ autoDial: FfiConverterBool.readFromCursor(c)
132
127
  };
133
128
  }
134
- write(value, into) {
135
- FfiConverterString.write(value.topic, into);
136
- FfiConverterUInt64.write(value.beaconIntervalMs, into);
137
- FfiConverterUInt64.write(value.peerTtlMs, into);
138
- FfiConverterBool.write(value.autoDial, into);
129
+ writeIntoCursor(value, c) {
130
+ FfiConverterString.writeIntoCursor(value.topic, c);
131
+ FfiConverterUInt64.writeIntoCursor(value.beaconIntervalMs, c);
132
+ FfiConverterUInt64.writeIntoCursor(value.peerTtlMs, c);
133
+ FfiConverterBool.writeIntoCursor(value.autoDial, c);
139
134
  }
140
135
  allocationSize(value) {
141
136
  return FfiConverterString.allocationSize(value.topic) + FfiConverterUInt64.allocationSize(value.beaconIntervalMs) + FfiConverterUInt64.allocationSize(value.peerTtlMs) + FfiConverterBool.allocationSize(value.autoDial);
@@ -165,13 +160,13 @@ export const TransportOptions = (() => {
165
160
  })();
166
161
  const FfiConverterTypeTransportOptions = (() => {
167
162
  class FFIConverter extends AbstractFfiConverterByteArray {
168
- read(from) {
163
+ readFromCursor(c) {
169
164
  return {
170
- listenAddrs: FfiConverterOptionalSequenceString.read(from)
165
+ listenAddrs: FfiConverterOptionalSequenceString.readFromCursor(c)
171
166
  };
172
167
  }
173
- write(value, into) {
174
- FfiConverterOptionalSequenceString.write(value.listenAddrs, into);
168
+ writeIntoCursor(value, c) {
169
+ FfiConverterOptionalSequenceString.writeIntoCursor(value.listenAddrs, c);
175
170
  }
176
171
  allocationSize(value) {
177
172
  return FfiConverterOptionalSequenceString.allocationSize(value.listenAddrs);
@@ -196,10 +191,9 @@ export let PubsubRouter = /*#__PURE__*/function (PubsubRouter) {
196
191
  return PubsubRouter;
197
192
  }({});
198
193
  const FfiConverterTypePubsubRouter = (() => {
199
- const ordinalConverter = FfiConverterInt32;
200
194
  class FFIConverter extends AbstractFfiConverterByteArray {
201
- read(from) {
202
- switch (ordinalConverter.read(from)) {
195
+ readFromCursor(c) {
196
+ switch (c.readI32()) {
203
197
  case 1:
204
198
  return PubsubRouter.Gossipsub;
205
199
  case 2:
@@ -208,16 +202,16 @@ const FfiConverterTypePubsubRouter = (() => {
208
202
  throw new UniffiInternalError.UnexpectedEnumCase();
209
203
  }
210
204
  }
211
- write(value, into) {
205
+ writeIntoCursor(value, c) {
212
206
  switch (value) {
213
207
  case PubsubRouter.Gossipsub:
214
- return ordinalConverter.write(1, into);
208
+ return c.writeI32(1);
215
209
  case PubsubRouter.Floodsub:
216
- return ordinalConverter.write(2, into);
210
+ return c.writeI32(2);
217
211
  }
218
212
  }
219
213
  allocationSize(value) {
220
- return ordinalConverter.allocationSize(0);
214
+ return 4;
221
215
  }
222
216
  }
223
217
  return new FFIConverter();
@@ -243,27 +237,27 @@ export const MdnsOptions = (() => {
243
237
  })();
244
238
  const FfiConverterTypeMdnsOptions = (() => {
245
239
  class FFIConverter extends AbstractFfiConverterByteArray {
246
- read(from) {
240
+ readFromCursor(c) {
247
241
  return {
248
- enableIpv6: FfiConverterBool.read(from),
249
- ttlMs: FfiConverterUInt64.read(from),
250
- queryIntervalMs: FfiConverterUInt64.read(from),
251
- maxPacketBytes: FfiConverterUInt32.read(from),
252
- maxAnnouncedAddrs: FfiConverterUInt32.read(from),
253
- interfaceRefreshMs: FfiConverterUInt64.read(from),
254
- socketPollIntervalMs: FfiConverterUInt64.read(from),
255
- autoDial: FfiConverterBool.read(from)
242
+ enableIpv6: FfiConverterBool.readFromCursor(c),
243
+ ttlMs: FfiConverterUInt64.readFromCursor(c),
244
+ queryIntervalMs: FfiConverterUInt64.readFromCursor(c),
245
+ maxPacketBytes: FfiConverterUInt32.readFromCursor(c),
246
+ maxAnnouncedAddrs: FfiConverterUInt32.readFromCursor(c),
247
+ interfaceRefreshMs: FfiConverterUInt64.readFromCursor(c),
248
+ socketPollIntervalMs: FfiConverterUInt64.readFromCursor(c),
249
+ autoDial: FfiConverterBool.readFromCursor(c)
256
250
  };
257
251
  }
258
- write(value, into) {
259
- FfiConverterBool.write(value.enableIpv6, into);
260
- FfiConverterUInt64.write(value.ttlMs, into);
261
- FfiConverterUInt64.write(value.queryIntervalMs, into);
262
- FfiConverterUInt32.write(value.maxPacketBytes, into);
263
- FfiConverterUInt32.write(value.maxAnnouncedAddrs, into);
264
- FfiConverterUInt64.write(value.interfaceRefreshMs, into);
265
- FfiConverterUInt64.write(value.socketPollIntervalMs, into);
266
- FfiConverterBool.write(value.autoDial, into);
252
+ writeIntoCursor(value, c) {
253
+ FfiConverterBool.writeIntoCursor(value.enableIpv6, c);
254
+ FfiConverterUInt64.writeIntoCursor(value.ttlMs, c);
255
+ FfiConverterUInt64.writeIntoCursor(value.queryIntervalMs, c);
256
+ FfiConverterUInt32.writeIntoCursor(value.maxPacketBytes, c);
257
+ FfiConverterUInt32.writeIntoCursor(value.maxAnnouncedAddrs, c);
258
+ FfiConverterUInt64.writeIntoCursor(value.interfaceRefreshMs, c);
259
+ FfiConverterUInt64.writeIntoCursor(value.socketPollIntervalMs, c);
260
+ FfiConverterBool.writeIntoCursor(value.autoDial, c);
267
261
  }
268
262
  allocationSize(value) {
269
263
  return FfiConverterBool.allocationSize(value.enableIpv6) + FfiConverterUInt64.allocationSize(value.ttlMs) + FfiConverterUInt64.allocationSize(value.queryIntervalMs) + FfiConverterUInt32.allocationSize(value.maxPacketBytes) + FfiConverterUInt32.allocationSize(value.maxAnnouncedAddrs) + FfiConverterUInt64.allocationSize(value.interfaceRefreshMs) + FfiConverterUInt64.allocationSize(value.socketPollIntervalMs) + FfiConverterBool.allocationSize(value.autoDial);
@@ -293,33 +287,33 @@ export const EndpointConfig = (() => {
293
287
  })();
294
288
  const FfiConverterTypeEndpointConfig = (() => {
295
289
  class FFIConverter extends AbstractFfiConverterByteArray {
296
- read(from) {
290
+ readFromCursor(c) {
297
291
  return {
298
- agentVersion: FfiConverterOptionalString.read(from),
299
- relays: FfiConverterSequenceString.read(from),
300
- autonatServers: FfiConverterSequenceString.read(from),
301
- quic: FfiConverterOptionalTypeTransportOptions.read(from),
302
- tcp: FfiConverterOptionalTypeTransportOptions.read(from),
303
- forceRelay: FfiConverterBool.read(from),
304
- allowUnsigned: FfiConverterBool.read(from),
305
- pubsubRouter: FfiConverterTypePubsubRouter.read(from),
306
- protocols: FfiConverterSequenceString.read(from),
307
- discovery: FfiConverterOptionalTypeDiscoveryOptions.read(from),
308
- mdns: FfiConverterOptionalTypeMdnsOptions.read(from)
292
+ agentVersion: FfiConverterOptionalString.readFromCursor(c),
293
+ relays: FfiConverterSequenceString.readFromCursor(c),
294
+ autonatServers: FfiConverterSequenceString.readFromCursor(c),
295
+ quic: FfiConverterOptionalTypeTransportOptions.readFromCursor(c),
296
+ tcp: FfiConverterOptionalTypeTransportOptions.readFromCursor(c),
297
+ forceRelay: FfiConverterBool.readFromCursor(c),
298
+ allowUnsigned: FfiConverterBool.readFromCursor(c),
299
+ pubsubRouter: FfiConverterTypePubsubRouter.readFromCursor(c),
300
+ protocols: FfiConverterSequenceString.readFromCursor(c),
301
+ discovery: FfiConverterOptionalTypeDiscoveryOptions.readFromCursor(c),
302
+ mdns: FfiConverterOptionalTypeMdnsOptions.readFromCursor(c)
309
303
  };
310
304
  }
311
- write(value, into) {
312
- FfiConverterOptionalString.write(value.agentVersion, into);
313
- FfiConverterSequenceString.write(value.relays, into);
314
- FfiConverterSequenceString.write(value.autonatServers, into);
315
- FfiConverterOptionalTypeTransportOptions.write(value.quic, into);
316
- FfiConverterOptionalTypeTransportOptions.write(value.tcp, into);
317
- FfiConverterBool.write(value.forceRelay, into);
318
- FfiConverterBool.write(value.allowUnsigned, into);
319
- FfiConverterTypePubsubRouter.write(value.pubsubRouter, into);
320
- FfiConverterSequenceString.write(value.protocols, into);
321
- FfiConverterOptionalTypeDiscoveryOptions.write(value.discovery, into);
322
- FfiConverterOptionalTypeMdnsOptions.write(value.mdns, into);
305
+ writeIntoCursor(value, c) {
306
+ FfiConverterOptionalString.writeIntoCursor(value.agentVersion, c);
307
+ FfiConverterSequenceString.writeIntoCursor(value.relays, c);
308
+ FfiConverterSequenceString.writeIntoCursor(value.autonatServers, c);
309
+ FfiConverterOptionalTypeTransportOptions.writeIntoCursor(value.quic, c);
310
+ FfiConverterOptionalTypeTransportOptions.writeIntoCursor(value.tcp, c);
311
+ FfiConverterBool.writeIntoCursor(value.forceRelay, c);
312
+ FfiConverterBool.writeIntoCursor(value.allowUnsigned, c);
313
+ FfiConverterTypePubsubRouter.writeIntoCursor(value.pubsubRouter, c);
314
+ FfiConverterSequenceString.writeIntoCursor(value.protocols, c);
315
+ FfiConverterOptionalTypeDiscoveryOptions.writeIntoCursor(value.discovery, c);
316
+ FfiConverterOptionalTypeMdnsOptions.writeIntoCursor(value.mdns, c);
323
317
  }
324
318
  allocationSize(value) {
325
319
  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);
@@ -349,23 +343,23 @@ export const IdentifyInfo = (() => {
349
343
  })();
350
344
  const FfiConverterTypeIdentifyInfo = (() => {
351
345
  class FFIConverter extends AbstractFfiConverterByteArray {
352
- read(from) {
346
+ readFromCursor(c) {
353
347
  return {
354
- publicKey: FfiConverterOptionalBytes.read(from),
355
- listenAddrs: FfiConverterSequenceString.read(from),
356
- protocols: FfiConverterSequenceString.read(from),
357
- observedAddr: FfiConverterOptionalString.read(from),
358
- protocolVersion: FfiConverterOptionalString.read(from),
359
- agentVersion: FfiConverterOptionalString.read(from)
348
+ publicKey: FfiConverterOptionalBytes.readFromCursor(c),
349
+ listenAddrs: FfiConverterSequenceString.readFromCursor(c),
350
+ protocols: FfiConverterSequenceString.readFromCursor(c),
351
+ observedAddr: FfiConverterOptionalString.readFromCursor(c),
352
+ protocolVersion: FfiConverterOptionalString.readFromCursor(c),
353
+ agentVersion: FfiConverterOptionalString.readFromCursor(c)
360
354
  };
361
355
  }
362
- write(value, into) {
363
- FfiConverterOptionalBytes.write(value.publicKey, into);
364
- FfiConverterSequenceString.write(value.listenAddrs, into);
365
- FfiConverterSequenceString.write(value.protocols, into);
366
- FfiConverterOptionalString.write(value.observedAddr, into);
367
- FfiConverterOptionalString.write(value.protocolVersion, into);
368
- FfiConverterOptionalString.write(value.agentVersion, into);
356
+ writeIntoCursor(value, c) {
357
+ FfiConverterOptionalBytes.writeIntoCursor(value.publicKey, c);
358
+ FfiConverterSequenceString.writeIntoCursor(value.listenAddrs, c);
359
+ FfiConverterSequenceString.writeIntoCursor(value.protocols, c);
360
+ FfiConverterOptionalString.writeIntoCursor(value.observedAddr, c);
361
+ FfiConverterOptionalString.writeIntoCursor(value.protocolVersion, c);
362
+ FfiConverterOptionalString.writeIntoCursor(value.agentVersion, c);
369
363
  }
370
364
  allocationSize(value) {
371
365
  return FfiConverterOptionalBytes.allocationSize(value.publicKey) + FfiConverterSequenceString.allocationSize(value.listenAddrs) + FfiConverterSequenceString.allocationSize(value.protocols) + FfiConverterOptionalString.allocationSize(value.observedAddr) + FfiConverterOptionalString.allocationSize(value.protocolVersion) + FfiConverterOptionalString.allocationSize(value.agentVersion);
@@ -395,25 +389,25 @@ export const KnownPeerInfo = (() => {
395
389
  })();
396
390
  const FfiConverterTypeKnownPeerInfo = (() => {
397
391
  class FFIConverter extends AbstractFfiConverterByteArray {
398
- read(from) {
392
+ readFromCursor(c) {
399
393
  return {
400
- peerId: FfiConverterString.read(from),
401
- addrs: FfiConverterSequenceString.read(from),
402
- beaconAddrs: FfiConverterSequenceString.read(from),
403
- mdnsAddrs: FfiConverterSequenceString.read(from),
404
- beaconLastSeenAgeMs: FfiConverterOptionalUInt64.read(from),
405
- mdnsLastSeenAgeMs: FfiConverterOptionalUInt64.read(from),
406
- connected: FfiConverterBool.read(from)
394
+ peerId: FfiConverterString.readFromCursor(c),
395
+ addrs: FfiConverterSequenceString.readFromCursor(c),
396
+ beaconAddrs: FfiConverterSequenceString.readFromCursor(c),
397
+ mdnsAddrs: FfiConverterSequenceString.readFromCursor(c),
398
+ beaconLastSeenAgeMs: FfiConverterOptionalUInt64.readFromCursor(c),
399
+ mdnsLastSeenAgeMs: FfiConverterOptionalUInt64.readFromCursor(c),
400
+ connected: FfiConverterBool.readFromCursor(c)
407
401
  };
408
402
  }
409
- write(value, into) {
410
- FfiConverterString.write(value.peerId, into);
411
- FfiConverterSequenceString.write(value.addrs, into);
412
- FfiConverterSequenceString.write(value.beaconAddrs, into);
413
- FfiConverterSequenceString.write(value.mdnsAddrs, into);
414
- FfiConverterOptionalUInt64.write(value.beaconLastSeenAgeMs, into);
415
- FfiConverterOptionalUInt64.write(value.mdnsLastSeenAgeMs, into);
416
- FfiConverterBool.write(value.connected, into);
403
+ writeIntoCursor(value, c) {
404
+ FfiConverterString.writeIntoCursor(value.peerId, c);
405
+ FfiConverterSequenceString.writeIntoCursor(value.addrs, c);
406
+ FfiConverterSequenceString.writeIntoCursor(value.beaconAddrs, c);
407
+ FfiConverterSequenceString.writeIntoCursor(value.mdnsAddrs, c);
408
+ FfiConverterOptionalUInt64.writeIntoCursor(value.beaconLastSeenAgeMs, c);
409
+ FfiConverterOptionalUInt64.writeIntoCursor(value.mdnsLastSeenAgeMs, c);
410
+ FfiConverterBool.writeIntoCursor(value.connected, c);
417
411
  }
418
412
  allocationSize(value) {
419
413
  return FfiConverterString.allocationSize(value.peerId) + FfiConverterSequenceString.allocationSize(value.addrs) + FfiConverterSequenceString.allocationSize(value.beaconAddrs) + FfiConverterSequenceString.allocationSize(value.mdnsAddrs) + FfiConverterOptionalUInt64.allocationSize(value.beaconLastSeenAgeMs) + FfiConverterOptionalUInt64.allocationSize(value.mdnsLastSeenAgeMs) + FfiConverterBool.allocationSize(value.connected);
@@ -443,15 +437,15 @@ export const OpenStreamResult = (() => {
443
437
  })();
444
438
  const FfiConverterTypeOpenStreamResult = (() => {
445
439
  class FFIConverter extends AbstractFfiConverterByteArray {
446
- read(from) {
440
+ readFromCursor(c) {
447
441
  return {
448
- connId: FfiConverterUInt64.read(from),
449
- streamId: FfiConverterUInt64.read(from)
442
+ connId: FfiConverterUInt64.readFromCursor(c),
443
+ streamId: FfiConverterUInt64.readFromCursor(c)
450
444
  };
451
445
  }
452
- write(value, into) {
453
- FfiConverterUInt64.write(value.connId, into);
454
- FfiConverterUInt64.write(value.streamId, into);
446
+ writeIntoCursor(value, c) {
447
+ FfiConverterUInt64.writeIntoCursor(value.connId, c);
448
+ FfiConverterUInt64.writeIntoCursor(value.streamId, c);
455
449
  }
456
450
  allocationSize(value) {
457
451
  return FfiConverterUInt64.allocationSize(value.connId) + FfiConverterUInt64.allocationSize(value.streamId);
@@ -481,15 +475,15 @@ export const RelayReservationInfo = (() => {
481
475
  })();
482
476
  const FfiConverterTypeRelayReservationInfo = (() => {
483
477
  class FFIConverter extends AbstractFfiConverterByteArray {
484
- read(from) {
478
+ readFromCursor(c) {
485
479
  return {
486
- relayPeerId: FfiConverterString.read(from),
487
- expiresUnixSecs: FfiConverterOptionalUInt64.read(from)
480
+ relayPeerId: FfiConverterString.readFromCursor(c),
481
+ expiresUnixSecs: FfiConverterOptionalUInt64.readFromCursor(c)
488
482
  };
489
483
  }
490
- write(value, into) {
491
- FfiConverterString.write(value.relayPeerId, into);
492
- FfiConverterOptionalUInt64.write(value.expiresUnixSecs, into);
484
+ writeIntoCursor(value, c) {
485
+ FfiConverterString.writeIntoCursor(value.relayPeerId, c);
486
+ FfiConverterOptionalUInt64.writeIntoCursor(value.expiresUnixSecs, c);
493
487
  }
494
488
  allocationSize(value) {
495
489
  return FfiConverterString.allocationSize(value.relayPeerId) + FfiConverterOptionalUInt64.allocationSize(value.expiresUnixSecs);
@@ -514,10 +508,9 @@ export let DiscoverySource = /*#__PURE__*/function (DiscoverySource) {
514
508
  return DiscoverySource;
515
509
  }({});
516
510
  const FfiConverterTypeDiscoverySource = (() => {
517
- const ordinalConverter = FfiConverterInt32;
518
511
  class FFIConverter extends AbstractFfiConverterByteArray {
519
- read(from) {
520
- switch (ordinalConverter.read(from)) {
512
+ readFromCursor(c) {
513
+ switch (c.readI32()) {
521
514
  case 1:
522
515
  return DiscoverySource.SignedBeacon;
523
516
  case 2:
@@ -526,16 +519,16 @@ const FfiConverterTypeDiscoverySource = (() => {
526
519
  throw new UniffiInternalError.UnexpectedEnumCase();
527
520
  }
528
521
  }
529
- write(value, into) {
522
+ writeIntoCursor(value, c) {
530
523
  switch (value) {
531
524
  case DiscoverySource.SignedBeacon:
532
- return ordinalConverter.write(1, into);
525
+ return c.writeI32(1);
533
526
  case DiscoverySource.Mdns:
534
- return ordinalConverter.write(2, into);
527
+ return c.writeI32(2);
535
528
  }
536
529
  }
537
530
  allocationSize(value) {
538
- return ordinalConverter.allocationSize(0);
531
+ return 4;
539
532
  }
540
533
  }
541
534
  return new FFIConverter();
@@ -564,10 +557,9 @@ export let DriverFailureKind = /*#__PURE__*/function (DriverFailureKind) {
564
557
  return DriverFailureKind;
565
558
  }({});
566
559
  const FfiConverterTypeDriverFailureKind = (() => {
567
- const ordinalConverter = FfiConverterInt32;
568
560
  class FFIConverter extends AbstractFfiConverterByteArray {
569
- read(from) {
570
- switch (ordinalConverter.read(from)) {
561
+ readFromCursor(c) {
562
+ switch (c.readI32()) {
571
563
  case 1:
572
564
  return DriverFailureKind.Transport;
573
565
  case 2:
@@ -580,20 +572,20 @@ const FfiConverterTypeDriverFailureKind = (() => {
580
572
  throw new UniffiInternalError.UnexpectedEnumCase();
581
573
  }
582
574
  }
583
- write(value, into) {
575
+ writeIntoCursor(value, c) {
584
576
  switch (value) {
585
577
  case DriverFailureKind.Transport:
586
- return ordinalConverter.write(1, into);
578
+ return c.writeI32(1);
587
579
  case DriverFailureKind.Swarm:
588
- return ordinalConverter.write(2, into);
580
+ return c.writeI32(2);
589
581
  case DriverFailureKind.Invariant:
590
- return ordinalConverter.write(3, into);
582
+ return c.writeI32(3);
591
583
  case DriverFailureKind.Panic:
592
- return ordinalConverter.write(4, into);
584
+ return c.writeI32(4);
593
585
  }
594
586
  }
595
587
  allocationSize(value) {
596
- return ordinalConverter.allocationSize(0);
588
+ return 4;
597
589
  }
598
590
  }
599
591
  return new FFIConverter();
@@ -638,10 +630,9 @@ export let EndpointErrorKind = /*#__PURE__*/function (EndpointErrorKind) {
638
630
  return EndpointErrorKind;
639
631
  }({});
640
632
  const FfiConverterTypeEndpointErrorKind = (() => {
641
- const ordinalConverter = FfiConverterInt32;
642
633
  class FFIConverter extends AbstractFfiConverterByteArray {
643
- read(from) {
644
- switch (ordinalConverter.read(from)) {
634
+ readFromCursor(c) {
635
+ switch (c.readI32()) {
645
636
  case 1:
646
637
  return EndpointErrorKind.Transport;
647
638
  case 2:
@@ -662,28 +653,28 @@ const FfiConverterTypeEndpointErrorKind = (() => {
662
653
  throw new UniffiInternalError.UnexpectedEnumCase();
663
654
  }
664
655
  }
665
- write(value, into) {
656
+ writeIntoCursor(value, c) {
666
657
  switch (value) {
667
658
  case EndpointErrorKind.Transport:
668
- return ordinalConverter.write(1, into);
659
+ return c.writeI32(1);
669
660
  case EndpointErrorKind.Multistream:
670
- return ordinalConverter.write(2, into);
661
+ return c.writeI32(2);
671
662
  case EndpointErrorKind.Identify:
672
- return ordinalConverter.write(3, into);
663
+ return c.writeI32(3);
673
664
  case EndpointErrorKind.Ping:
674
- return ordinalConverter.write(4, into);
665
+ return c.writeI32(4);
675
666
  case EndpointErrorKind.IdentifyStreamRejected:
676
- return ordinalConverter.write(5, into);
667
+ return c.writeI32(5);
677
668
  case EndpointErrorKind.OpenStreamFailed:
678
- return ordinalConverter.write(6, into);
669
+ return c.writeI32(6);
679
670
  case EndpointErrorKind.UnsupportedProtocol:
680
- return ordinalConverter.write(7, into);
671
+ return c.writeI32(7);
681
672
  case EndpointErrorKind.Driver:
682
- return ordinalConverter.write(8, into);
673
+ return c.writeI32(8);
683
674
  }
684
675
  }
685
676
  allocationSize(value) {
686
- return ordinalConverter.allocationSize(0);
677
+ return 4;
687
678
  }
688
679
  }
689
680
  return new FFIConverter();
@@ -1071,37 +1062,36 @@ export const FfiError = (() => {
1071
1062
 
1072
1063
  // FfiConverter for enum FfiError
1073
1064
  const FfiConverterTypeFfiError = (() => {
1074
- const ordinalConverter = FfiConverterInt32;
1075
1065
  class FFIConverter extends AbstractFfiConverterByteArray {
1076
- read(from) {
1077
- switch (ordinalConverter.read(from)) {
1066
+ readFromCursor(c) {
1067
+ switch (c.readI32()) {
1078
1068
  case 1:
1079
1069
  return new FfiError.AlreadyStarted();
1080
1070
  case 2:
1081
1071
  return new FfiError.Stopped();
1082
1072
  case 3:
1083
1073
  return new FfiError.InvalidConfig({
1084
- detail: FfiConverterString.read(from)
1074
+ detail: FfiConverterString.readFromCursor(c)
1085
1075
  });
1086
1076
  case 4:
1087
1077
  return new FfiError.InvalidKey({
1088
- detail: FfiConverterString.read(from)
1078
+ detail: FfiConverterString.readFromCursor(c)
1089
1079
  });
1090
1080
  case 5:
1091
1081
  return new FfiError.InvalidPeerId({
1092
- detail: FfiConverterString.read(from)
1082
+ detail: FfiConverterString.readFromCursor(c)
1093
1083
  });
1094
1084
  case 6:
1095
1085
  return new FfiError.InvalidAddress({
1096
- detail: FfiConverterString.read(from)
1086
+ detail: FfiConverterString.readFromCursor(c)
1097
1087
  });
1098
1088
  case 7:
1099
1089
  return new FfiError.InvalidTopic({
1100
- detail: FfiConverterString.read(from)
1090
+ detail: FfiConverterString.readFromCursor(c)
1101
1091
  });
1102
1092
  case 8:
1103
1093
  return new FfiError.NotPermitted({
1104
- detail: FfiConverterString.read(from)
1094
+ detail: FfiConverterString.readFromCursor(c)
1105
1095
  });
1106
1096
  case 9:
1107
1097
  return new FfiError.Backpressure();
@@ -1109,103 +1099,103 @@ const FfiConverterTypeFfiError = (() => {
1109
1099
  return new FfiError.MessageTooLarge();
1110
1100
  case 11:
1111
1101
  return new FfiError.Transport({
1112
- detail: FfiConverterString.read(from)
1102
+ detail: FfiConverterString.readFromCursor(c)
1113
1103
  });
1114
1104
  case 12:
1115
1105
  return new FfiError.InvalidState({
1116
- detail: FfiConverterString.read(from)
1106
+ detail: FfiConverterString.readFromCursor(c)
1117
1107
  });
1118
1108
  case 13:
1119
1109
  return new FfiError.Internal({
1120
- detail: FfiConverterString.read(from)
1110
+ detail: FfiConverterString.readFromCursor(c)
1121
1111
  });
1122
1112
  default:
1123
1113
  throw new UniffiInternalError.UnexpectedEnumCase();
1124
1114
  }
1125
1115
  }
1126
- write(value, into) {
1116
+ writeIntoCursor(value, c) {
1127
1117
  switch (value.tag) {
1128
1118
  case FfiError_Tags.AlreadyStarted:
1129
1119
  {
1130
- ordinalConverter.write(1, into);
1120
+ c.writeI32(1);
1131
1121
  return;
1132
1122
  }
1133
1123
  case FfiError_Tags.Stopped:
1134
1124
  {
1135
- ordinalConverter.write(2, into);
1125
+ c.writeI32(2);
1136
1126
  return;
1137
1127
  }
1138
1128
  case FfiError_Tags.InvalidConfig:
1139
1129
  {
1140
- ordinalConverter.write(3, into);
1130
+ c.writeI32(3);
1141
1131
  const inner = value.inner;
1142
- FfiConverterString.write(inner.detail, into);
1132
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1143
1133
  return;
1144
1134
  }
1145
1135
  case FfiError_Tags.InvalidKey:
1146
1136
  {
1147
- ordinalConverter.write(4, into);
1137
+ c.writeI32(4);
1148
1138
  const inner = value.inner;
1149
- FfiConverterString.write(inner.detail, into);
1139
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1150
1140
  return;
1151
1141
  }
1152
1142
  case FfiError_Tags.InvalidPeerId:
1153
1143
  {
1154
- ordinalConverter.write(5, into);
1144
+ c.writeI32(5);
1155
1145
  const inner = value.inner;
1156
- FfiConverterString.write(inner.detail, into);
1146
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1157
1147
  return;
1158
1148
  }
1159
1149
  case FfiError_Tags.InvalidAddress:
1160
1150
  {
1161
- ordinalConverter.write(6, into);
1151
+ c.writeI32(6);
1162
1152
  const inner = value.inner;
1163
- FfiConverterString.write(inner.detail, into);
1153
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1164
1154
  return;
1165
1155
  }
1166
1156
  case FfiError_Tags.InvalidTopic:
1167
1157
  {
1168
- ordinalConverter.write(7, into);
1158
+ c.writeI32(7);
1169
1159
  const inner = value.inner;
1170
- FfiConverterString.write(inner.detail, into);
1160
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1171
1161
  return;
1172
1162
  }
1173
1163
  case FfiError_Tags.NotPermitted:
1174
1164
  {
1175
- ordinalConverter.write(8, into);
1165
+ c.writeI32(8);
1176
1166
  const inner = value.inner;
1177
- FfiConverterString.write(inner.detail, into);
1167
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1178
1168
  return;
1179
1169
  }
1180
1170
  case FfiError_Tags.Backpressure:
1181
1171
  {
1182
- ordinalConverter.write(9, into);
1172
+ c.writeI32(9);
1183
1173
  return;
1184
1174
  }
1185
1175
  case FfiError_Tags.MessageTooLarge:
1186
1176
  {
1187
- ordinalConverter.write(10, into);
1177
+ c.writeI32(10);
1188
1178
  return;
1189
1179
  }
1190
1180
  case FfiError_Tags.Transport:
1191
1181
  {
1192
- ordinalConverter.write(11, into);
1182
+ c.writeI32(11);
1193
1183
  const inner = value.inner;
1194
- FfiConverterString.write(inner.detail, into);
1184
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1195
1185
  return;
1196
1186
  }
1197
1187
  case FfiError_Tags.InvalidState:
1198
1188
  {
1199
- ordinalConverter.write(12, into);
1189
+ c.writeI32(12);
1200
1190
  const inner = value.inner;
1201
- FfiConverterString.write(inner.detail, into);
1191
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1202
1192
  return;
1203
1193
  }
1204
1194
  case FfiError_Tags.Internal:
1205
1195
  {
1206
- ordinalConverter.write(13, into);
1196
+ c.writeI32(13);
1207
1197
  const inner = value.inner;
1208
- FfiConverterString.write(inner.detail, into);
1198
+ FfiConverterString.writeIntoCursor(inner.detail, c);
1209
1199
  return;
1210
1200
  }
1211
1201
  default:
@@ -1217,80 +1207,80 @@ const FfiConverterTypeFfiError = (() => {
1217
1207
  switch (value.tag) {
1218
1208
  case FfiError_Tags.AlreadyStarted:
1219
1209
  {
1220
- return ordinalConverter.allocationSize(1);
1210
+ return 4;
1221
1211
  }
1222
1212
  case FfiError_Tags.Stopped:
1223
1213
  {
1224
- return ordinalConverter.allocationSize(2);
1214
+ return 4;
1225
1215
  }
1226
1216
  case FfiError_Tags.InvalidConfig:
1227
1217
  {
1228
1218
  const inner = value.inner;
1229
- let size = ordinalConverter.allocationSize(3);
1219
+ let size = 4;
1230
1220
  size += FfiConverterString.allocationSize(inner.detail);
1231
1221
  return size;
1232
1222
  }
1233
1223
  case FfiError_Tags.InvalidKey:
1234
1224
  {
1235
1225
  const inner = value.inner;
1236
- let size = ordinalConverter.allocationSize(4);
1226
+ let size = 4;
1237
1227
  size += FfiConverterString.allocationSize(inner.detail);
1238
1228
  return size;
1239
1229
  }
1240
1230
  case FfiError_Tags.InvalidPeerId:
1241
1231
  {
1242
1232
  const inner = value.inner;
1243
- let size = ordinalConverter.allocationSize(5);
1233
+ let size = 4;
1244
1234
  size += FfiConverterString.allocationSize(inner.detail);
1245
1235
  return size;
1246
1236
  }
1247
1237
  case FfiError_Tags.InvalidAddress:
1248
1238
  {
1249
1239
  const inner = value.inner;
1250
- let size = ordinalConverter.allocationSize(6);
1240
+ let size = 4;
1251
1241
  size += FfiConverterString.allocationSize(inner.detail);
1252
1242
  return size;
1253
1243
  }
1254
1244
  case FfiError_Tags.InvalidTopic:
1255
1245
  {
1256
1246
  const inner = value.inner;
1257
- let size = ordinalConverter.allocationSize(7);
1247
+ let size = 4;
1258
1248
  size += FfiConverterString.allocationSize(inner.detail);
1259
1249
  return size;
1260
1250
  }
1261
1251
  case FfiError_Tags.NotPermitted:
1262
1252
  {
1263
1253
  const inner = value.inner;
1264
- let size = ordinalConverter.allocationSize(8);
1254
+ let size = 4;
1265
1255
  size += FfiConverterString.allocationSize(inner.detail);
1266
1256
  return size;
1267
1257
  }
1268
1258
  case FfiError_Tags.Backpressure:
1269
1259
  {
1270
- return ordinalConverter.allocationSize(9);
1260
+ return 4;
1271
1261
  }
1272
1262
  case FfiError_Tags.MessageTooLarge:
1273
1263
  {
1274
- return ordinalConverter.allocationSize(10);
1264
+ return 4;
1275
1265
  }
1276
1266
  case FfiError_Tags.Transport:
1277
1267
  {
1278
1268
  const inner = value.inner;
1279
- let size = ordinalConverter.allocationSize(11);
1269
+ let size = 4;
1280
1270
  size += FfiConverterString.allocationSize(inner.detail);
1281
1271
  return size;
1282
1272
  }
1283
1273
  case FfiError_Tags.InvalidState:
1284
1274
  {
1285
1275
  const inner = value.inner;
1286
- let size = ordinalConverter.allocationSize(12);
1276
+ let size = 4;
1287
1277
  size += FfiConverterString.allocationSize(inner.detail);
1288
1278
  return size;
1289
1279
  }
1290
1280
  case FfiError_Tags.Internal:
1291
1281
  {
1292
1282
  const inner = value.inner;
1293
- let size = ordinalConverter.allocationSize(13);
1283
+ let size = 4;
1294
1284
  size += FfiConverterString.allocationSize(inner.detail);
1295
1285
  return size;
1296
1286
  }
@@ -1329,10 +1319,9 @@ export let NatErrorKind = /*#__PURE__*/function (NatErrorKind) {
1329
1319
  return NatErrorKind;
1330
1320
  }({});
1331
1321
  const FfiConverterTypeNatErrorKind = (() => {
1332
- const ordinalConverter = FfiConverterInt32;
1333
1322
  class FFIConverter extends AbstractFfiConverterByteArray {
1334
- read(from) {
1335
- switch (ordinalConverter.read(from)) {
1323
+ readFromCursor(c) {
1324
+ switch (c.readI32()) {
1336
1325
  case 1:
1337
1326
  return NatErrorKind.NoPathAvailable;
1338
1327
  case 2:
@@ -1347,22 +1336,22 @@ const FfiConverterTypeNatErrorKind = (() => {
1347
1336
  throw new UniffiInternalError.UnexpectedEnumCase();
1348
1337
  }
1349
1338
  }
1350
- write(value, into) {
1339
+ writeIntoCursor(value, c) {
1351
1340
  switch (value) {
1352
1341
  case NatErrorKind.NoPathAvailable:
1353
- return ordinalConverter.write(1, into);
1342
+ return c.writeI32(1);
1354
1343
  case NatErrorKind.Timeout:
1355
- return ordinalConverter.write(2, into);
1344
+ return c.writeI32(2);
1356
1345
  case NatErrorKind.DialFailed:
1357
- return ordinalConverter.write(3, into);
1346
+ return c.writeI32(3);
1358
1347
  case NatErrorKind.Protocol:
1359
- return ordinalConverter.write(4, into);
1348
+ return c.writeI32(4);
1360
1349
  case NatErrorKind.RelayRefused:
1361
- return ordinalConverter.write(5, into);
1350
+ return c.writeI32(5);
1362
1351
  }
1363
1352
  }
1364
1353
  allocationSize(value) {
1365
- return ordinalConverter.allocationSize(0);
1354
+ return 4;
1366
1355
  }
1367
1356
  }
1368
1357
  return new FFIConverter();
@@ -1387,10 +1376,9 @@ export let Reachability = /*#__PURE__*/function (Reachability) {
1387
1376
  return Reachability;
1388
1377
  }({});
1389
1378
  const FfiConverterTypeReachability = (() => {
1390
- const ordinalConverter = FfiConverterInt32;
1391
1379
  class FFIConverter extends AbstractFfiConverterByteArray {
1392
- read(from) {
1393
- switch (ordinalConverter.read(from)) {
1380
+ readFromCursor(c) {
1381
+ switch (c.readI32()) {
1394
1382
  case 1:
1395
1383
  return Reachability.Unknown;
1396
1384
  case 2:
@@ -1401,18 +1389,18 @@ const FfiConverterTypeReachability = (() => {
1401
1389
  throw new UniffiInternalError.UnexpectedEnumCase();
1402
1390
  }
1403
1391
  }
1404
- write(value, into) {
1392
+ writeIntoCursor(value, c) {
1405
1393
  switch (value) {
1406
1394
  case Reachability.Unknown:
1407
- return ordinalConverter.write(1, into);
1395
+ return c.writeI32(1);
1408
1396
  case Reachability.Public:
1409
- return ordinalConverter.write(2, into);
1397
+ return c.writeI32(2);
1410
1398
  case Reachability.Private:
1411
- return ordinalConverter.write(3, into);
1399
+ return c.writeI32(3);
1412
1400
  }
1413
1401
  }
1414
1402
  allocationSize(value) {
1415
- return ordinalConverter.allocationSize(0);
1403
+ return 4;
1416
1404
  }
1417
1405
  }
1418
1406
  return new FFIConverter();
@@ -1506,39 +1494,38 @@ export const PathKind = (() => {
1506
1494
 
1507
1495
  // FfiConverter for enum PathKind
1508
1496
  const FfiConverterTypePathKind = (() => {
1509
- const ordinalConverter = FfiConverterInt32;
1510
1497
  class FFIConverter extends AbstractFfiConverterByteArray {
1511
- read(from) {
1512
- switch (ordinalConverter.read(from)) {
1498
+ readFromCursor(c) {
1499
+ switch (c.readI32()) {
1513
1500
  case 1:
1514
1501
  return new PathKind.DirectDialed();
1515
1502
  case 2:
1516
1503
  return new PathKind.DirectPunched();
1517
1504
  case 3:
1518
1505
  return new PathKind.Relayed({
1519
- relayPeerId: FfiConverterString.read(from)
1506
+ relayPeerId: FfiConverterString.readFromCursor(c)
1520
1507
  });
1521
1508
  default:
1522
1509
  throw new UniffiInternalError.UnexpectedEnumCase();
1523
1510
  }
1524
1511
  }
1525
- write(value, into) {
1512
+ writeIntoCursor(value, c) {
1526
1513
  switch (value.tag) {
1527
1514
  case PathKind_Tags.DirectDialed:
1528
1515
  {
1529
- ordinalConverter.write(1, into);
1516
+ c.writeI32(1);
1530
1517
  return;
1531
1518
  }
1532
1519
  case PathKind_Tags.DirectPunched:
1533
1520
  {
1534
- ordinalConverter.write(2, into);
1521
+ c.writeI32(2);
1535
1522
  return;
1536
1523
  }
1537
1524
  case PathKind_Tags.Relayed:
1538
1525
  {
1539
- ordinalConverter.write(3, into);
1526
+ c.writeI32(3);
1540
1527
  const inner = value.inner;
1541
- FfiConverterString.write(inner.relayPeerId, into);
1528
+ FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
1542
1529
  return;
1543
1530
  }
1544
1531
  default:
@@ -1550,16 +1537,16 @@ const FfiConverterTypePathKind = (() => {
1550
1537
  switch (value.tag) {
1551
1538
  case PathKind_Tags.DirectDialed:
1552
1539
  {
1553
- return ordinalConverter.allocationSize(1);
1540
+ return 4;
1554
1541
  }
1555
1542
  case PathKind_Tags.DirectPunched:
1556
1543
  {
1557
- return ordinalConverter.allocationSize(2);
1544
+ return 4;
1558
1545
  }
1559
1546
  case PathKind_Tags.Relayed:
1560
1547
  {
1561
1548
  const inner = value.inner;
1562
- let size = ordinalConverter.allocationSize(3);
1549
+ let size = 4;
1563
1550
  size += FfiConverterString.allocationSize(inner.relayPeerId);
1564
1551
  return size;
1565
1552
  }
@@ -2378,494 +2365,493 @@ export const P2pEvent = (() => {
2378
2365
 
2379
2366
  // FfiConverter for enum P2pEvent
2380
2367
  const FfiConverterTypeP2pEvent = (() => {
2381
- const ordinalConverter = FfiConverterInt32;
2382
2368
  class FFIConverter extends AbstractFfiConverterByteArray {
2383
- read(from) {
2384
- switch (ordinalConverter.read(from)) {
2369
+ readFromCursor(c) {
2370
+ switch (c.readI32()) {
2385
2371
  case 1:
2386
2372
  return new P2pEvent.EventsDropped({
2387
- dropped: FfiConverterUInt64.read(from),
2388
- totalDropped: FfiConverterUInt64.read(from)
2373
+ dropped: FfiConverterUInt64.readFromCursor(c),
2374
+ totalDropped: FfiConverterUInt64.readFromCursor(c)
2389
2375
  });
2390
2376
  case 2:
2391
2377
  return new P2pEvent.DriverFailed({
2392
- kind: FfiConverterTypeDriverFailureKind.read(from),
2393
- detail: FfiConverterString.read(from)
2378
+ kind: FfiConverterTypeDriverFailureKind.readFromCursor(c),
2379
+ detail: FfiConverterString.readFromCursor(c)
2394
2380
  });
2395
2381
  case 3:
2396
2382
  return new P2pEvent.ConnectionEstablished({
2397
- peerId: FfiConverterString.read(from),
2398
- connId: FfiConverterUInt64.read(from)
2383
+ peerId: FfiConverterString.readFromCursor(c),
2384
+ connId: FfiConverterUInt64.readFromCursor(c)
2399
2385
  });
2400
2386
  case 4:
2401
2387
  return new P2pEvent.ConnectionClosed({
2402
- peerId: FfiConverterString.read(from),
2403
- connId: FfiConverterUInt64.read(from)
2388
+ peerId: FfiConverterString.readFromCursor(c),
2389
+ connId: FfiConverterUInt64.readFromCursor(c)
2404
2390
  });
2405
2391
  case 5:
2406
2392
  return new P2pEvent.PeerReady({
2407
- peerId: FfiConverterString.read(from),
2408
- protocols: FfiConverterSequenceString.read(from)
2393
+ peerId: FfiConverterString.readFromCursor(c),
2394
+ protocols: FfiConverterSequenceString.readFromCursor(c)
2409
2395
  });
2410
2396
  case 6:
2411
2397
  return new P2pEvent.IdentifyReceived({
2412
- peerId: FfiConverterString.read(from),
2413
- info: FfiConverterTypeIdentifyInfo.read(from)
2398
+ peerId: FfiConverterString.readFromCursor(c),
2399
+ info: FfiConverterTypeIdentifyInfo.readFromCursor(c)
2414
2400
  });
2415
2401
  case 7:
2416
2402
  return new P2pEvent.PingRttMeasured({
2417
- peerId: FfiConverterString.read(from),
2418
- rttMs: FfiConverterUInt64.read(from)
2403
+ peerId: FfiConverterString.readFromCursor(c),
2404
+ rttMs: FfiConverterUInt64.readFromCursor(c)
2419
2405
  });
2420
2406
  case 8:
2421
2407
  return new P2pEvent.PingTimeout({
2422
- peerId: FfiConverterString.read(from)
2408
+ peerId: FfiConverterString.readFromCursor(c)
2423
2409
  });
2424
2410
  case 9:
2425
2411
  return new P2pEvent.StreamReady({
2426
- peerId: FfiConverterString.read(from),
2427
- connId: FfiConverterUInt64.read(from),
2428
- streamId: FfiConverterUInt64.read(from),
2429
- protocolId: FfiConverterString.read(from),
2430
- initiatedLocally: FfiConverterBool.read(from)
2412
+ peerId: FfiConverterString.readFromCursor(c),
2413
+ connId: FfiConverterUInt64.readFromCursor(c),
2414
+ streamId: FfiConverterUInt64.readFromCursor(c),
2415
+ protocolId: FfiConverterString.readFromCursor(c),
2416
+ initiatedLocally: FfiConverterBool.readFromCursor(c)
2431
2417
  });
2432
2418
  case 10:
2433
2419
  return new P2pEvent.StreamData({
2434
- peerId: FfiConverterString.read(from),
2435
- connId: FfiConverterUInt64.read(from),
2436
- streamId: FfiConverterUInt64.read(from),
2437
- data: FfiConverterArrayBuffer.read(from)
2420
+ peerId: FfiConverterString.readFromCursor(c),
2421
+ connId: FfiConverterUInt64.readFromCursor(c),
2422
+ streamId: FfiConverterUInt64.readFromCursor(c),
2423
+ data: FfiConverterArrayBuffer.readFromCursor(c)
2438
2424
  });
2439
2425
  case 11:
2440
2426
  return new P2pEvent.StreamRemoteWriteClosed({
2441
- peerId: FfiConverterString.read(from),
2442
- connId: FfiConverterUInt64.read(from),
2443
- streamId: FfiConverterUInt64.read(from)
2427
+ peerId: FfiConverterString.readFromCursor(c),
2428
+ connId: FfiConverterUInt64.readFromCursor(c),
2429
+ streamId: FfiConverterUInt64.readFromCursor(c)
2444
2430
  });
2445
2431
  case 12:
2446
2432
  return new P2pEvent.StreamClosed({
2447
- peerId: FfiConverterString.read(from),
2448
- connId: FfiConverterUInt64.read(from),
2449
- streamId: FfiConverterUInt64.read(from)
2433
+ peerId: FfiConverterString.readFromCursor(c),
2434
+ connId: FfiConverterUInt64.readFromCursor(c),
2435
+ streamId: FfiConverterUInt64.readFromCursor(c)
2450
2436
  });
2451
2437
  case 13:
2452
2438
  return new P2pEvent.EndpointError({
2453
- kind: FfiConverterTypeEndpointErrorKind.read(from),
2454
- peerId: FfiConverterOptionalString.read(from),
2455
- connId: FfiConverterOptionalUInt64.read(from),
2456
- streamId: FfiConverterOptionalUInt64.read(from),
2457
- detail: FfiConverterString.read(from)
2439
+ kind: FfiConverterTypeEndpointErrorKind.readFromCursor(c),
2440
+ peerId: FfiConverterOptionalString.readFromCursor(c),
2441
+ connId: FfiConverterOptionalUInt64.readFromCursor(c),
2442
+ streamId: FfiConverterOptionalUInt64.readFromCursor(c),
2443
+ detail: FfiConverterString.readFromCursor(c)
2458
2444
  });
2459
2445
  case 14:
2460
2446
  return new P2pEvent.ReachabilityChanged({
2461
- previous: FfiConverterTypeReachability.read(from),
2462
- current: FfiConverterTypeReachability.read(from),
2463
- confirmedAddrs: FfiConverterSequenceString.read(from)
2447
+ previous: FfiConverterTypeReachability.readFromCursor(c),
2448
+ current: FfiConverterTypeReachability.readFromCursor(c),
2449
+ confirmedAddrs: FfiConverterSequenceString.readFromCursor(c)
2464
2450
  });
2465
2451
  case 15:
2466
2452
  return new P2pEvent.PublicAddressesChanged({
2467
- addrs: FfiConverterSequenceString.read(from)
2453
+ addrs: FfiConverterSequenceString.readFromCursor(c)
2468
2454
  });
2469
2455
  case 16:
2470
2456
  return new P2pEvent.RelayReserved({
2471
- relayPeerId: FfiConverterString.read(from),
2472
- expiresUnixSecs: FfiConverterOptionalUInt64.read(from)
2457
+ relayPeerId: FfiConverterString.readFromCursor(c),
2458
+ expiresUnixSecs: FfiConverterOptionalUInt64.readFromCursor(c)
2473
2459
  });
2474
2460
  case 17:
2475
2461
  return new P2pEvent.RelayReservationLost({
2476
- relayPeerId: FfiConverterString.read(from)
2462
+ relayPeerId: FfiConverterString.readFromCursor(c)
2477
2463
  });
2478
2464
  case 18:
2479
2465
  return new P2pEvent.PathEstablished({
2480
- connectId: FfiConverterUInt64.read(from),
2481
- peerId: FfiConverterString.read(from),
2482
- path: FfiConverterTypePathKind.read(from)
2466
+ connectId: FfiConverterUInt64.readFromCursor(c),
2467
+ peerId: FfiConverterString.readFromCursor(c),
2468
+ path: FfiConverterTypePathKind.readFromCursor(c)
2483
2469
  });
2484
2470
  case 19:
2485
2471
  return new P2pEvent.InboundPathEstablished({
2486
- peerId: FfiConverterString.read(from),
2487
- path: FfiConverterTypePathKind.read(from)
2472
+ peerId: FfiConverterString.readFromCursor(c),
2473
+ path: FfiConverterTypePathKind.readFromCursor(c)
2488
2474
  });
2489
2475
  case 20:
2490
2476
  return new P2pEvent.PathUpgraded({
2491
- connectId: FfiConverterUInt64.read(from),
2492
- peerId: FfiConverterString.read(from),
2493
- from: FfiConverterTypePathKind.read(from),
2494
- to: FfiConverterTypePathKind.read(from)
2477
+ connectId: FfiConverterUInt64.readFromCursor(c),
2478
+ peerId: FfiConverterString.readFromCursor(c),
2479
+ from: FfiConverterTypePathKind.readFromCursor(c),
2480
+ to: FfiConverterTypePathKind.readFromCursor(c)
2495
2481
  });
2496
2482
  case 21:
2497
2483
  return new P2pEvent.HolePunchFailed({
2498
- connectId: FfiConverterUInt64.read(from),
2499
- attempt: FfiConverterUInt32.read(from),
2500
- reason: FfiConverterString.read(from)
2484
+ connectId: FfiConverterUInt64.readFromCursor(c),
2485
+ attempt: FfiConverterUInt32.readFromCursor(c),
2486
+ reason: FfiConverterString.readFromCursor(c)
2501
2487
  });
2502
2488
  case 22:
2503
2489
  return new P2pEvent.FellBackToRelay({
2504
- connectId: FfiConverterUInt64.read(from),
2505
- peerId: FfiConverterString.read(from)
2490
+ connectId: FfiConverterUInt64.readFromCursor(c),
2491
+ peerId: FfiConverterString.readFromCursor(c)
2506
2492
  });
2507
2493
  case 23:
2508
2494
  return new P2pEvent.ConnectFailed({
2509
- connectId: FfiConverterUInt64.read(from),
2510
- peerId: FfiConverterString.read(from),
2511
- kind: FfiConverterTypeNatErrorKind.read(from),
2512
- detail: FfiConverterString.read(from)
2495
+ connectId: FfiConverterUInt64.readFromCursor(c),
2496
+ peerId: FfiConverterString.readFromCursor(c),
2497
+ kind: FfiConverterTypeNatErrorKind.readFromCursor(c),
2498
+ detail: FfiConverterString.readFromCursor(c)
2513
2499
  });
2514
2500
  case 24:
2515
2501
  return new P2pEvent.InboundDirectUpgrade({
2516
- peerId: FfiConverterString.read(from)
2502
+ peerId: FfiConverterString.readFromCursor(c)
2517
2503
  });
2518
2504
  case 25:
2519
2505
  return new P2pEvent.Message({
2520
- fromPeerId: FfiConverterString.read(from),
2521
- topics: FfiConverterSequenceString.read(from),
2522
- data: FfiConverterArrayBuffer.read(from),
2523
- seqno: FfiConverterArrayBuffer.read(from),
2524
- signed: FfiConverterBool.read(from)
2506
+ fromPeerId: FfiConverterString.readFromCursor(c),
2507
+ topics: FfiConverterSequenceString.readFromCursor(c),
2508
+ data: FfiConverterArrayBuffer.readFromCursor(c),
2509
+ seqno: FfiConverterArrayBuffer.readFromCursor(c),
2510
+ signed: FfiConverterBool.readFromCursor(c)
2525
2511
  });
2526
2512
  case 26:
2527
2513
  return new P2pEvent.PeerSubscribed({
2528
- peerId: FfiConverterString.read(from),
2529
- topic: FfiConverterString.read(from)
2514
+ peerId: FfiConverterString.readFromCursor(c),
2515
+ topic: FfiConverterString.readFromCursor(c)
2530
2516
  });
2531
2517
  case 27:
2532
2518
  return new P2pEvent.PeerUnsubscribed({
2533
- peerId: FfiConverterString.read(from),
2534
- topic: FfiConverterString.read(from)
2519
+ peerId: FfiConverterString.readFromCursor(c),
2520
+ topic: FfiConverterString.readFromCursor(c)
2535
2521
  });
2536
2522
  case 28:
2537
2523
  return new P2pEvent.PubsubOutboundFailure({
2538
- peerId: FfiConverterString.read(from),
2539
- reason: FfiConverterString.read(from)
2524
+ peerId: FfiConverterString.readFromCursor(c),
2525
+ reason: FfiConverterString.readFromCursor(c)
2540
2526
  });
2541
2527
  case 29:
2542
2528
  return new P2pEvent.PubsubProtocolViolation({
2543
- peerId: FfiConverterString.read(from),
2544
- reason: FfiConverterString.read(from)
2529
+ peerId: FfiConverterString.readFromCursor(c),
2530
+ reason: FfiConverterString.readFromCursor(c)
2545
2531
  });
2546
2532
  case 30:
2547
2533
  return new P2pEvent.PeerDiscovered({
2548
- peerId: FfiConverterString.read(from),
2549
- addrs: FfiConverterSequenceString.read(from),
2550
- source: FfiConverterTypeDiscoverySource.read(from)
2534
+ peerId: FfiConverterString.readFromCursor(c),
2535
+ addrs: FfiConverterSequenceString.readFromCursor(c),
2536
+ source: FfiConverterTypeDiscoverySource.readFromCursor(c)
2551
2537
  });
2552
2538
  case 31:
2553
2539
  return new P2pEvent.PeerUpdated({
2554
- peerId: FfiConverterString.read(from),
2555
- addrs: FfiConverterSequenceString.read(from),
2556
- source: FfiConverterTypeDiscoverySource.read(from)
2540
+ peerId: FfiConverterString.readFromCursor(c),
2541
+ addrs: FfiConverterSequenceString.readFromCursor(c),
2542
+ source: FfiConverterTypeDiscoverySource.readFromCursor(c)
2557
2543
  });
2558
2544
  case 32:
2559
2545
  return new P2pEvent.PeerExpired({
2560
- peerId: FfiConverterString.read(from)
2546
+ peerId: FfiConverterString.readFromCursor(c)
2561
2547
  });
2562
2548
  case 33:
2563
2549
  return new P2pEvent.DiscoveryDialFailed({
2564
- peerId: FfiConverterString.read(from),
2565
- reason: FfiConverterString.read(from)
2550
+ peerId: FfiConverterString.readFromCursor(c),
2551
+ reason: FfiConverterString.readFromCursor(c)
2566
2552
  });
2567
2553
  case 34:
2568
2554
  return new P2pEvent.DiscoveryProtocolViolation({
2569
- peerId: FfiConverterOptionalString.read(from),
2570
- source: FfiConverterTypeDiscoverySource.read(from),
2571
- reason: FfiConverterString.read(from),
2572
- suppressed: FfiConverterUInt32.read(from)
2555
+ peerId: FfiConverterOptionalString.readFromCursor(c),
2556
+ source: FfiConverterTypeDiscoverySource.readFromCursor(c),
2557
+ reason: FfiConverterString.readFromCursor(c),
2558
+ suppressed: FfiConverterUInt32.readFromCursor(c)
2573
2559
  });
2574
2560
  default:
2575
2561
  throw new UniffiInternalError.UnexpectedEnumCase();
2576
2562
  }
2577
2563
  }
2578
- write(value, into) {
2564
+ writeIntoCursor(value, c) {
2579
2565
  switch (value.tag) {
2580
2566
  case P2pEvent_Tags.EventsDropped:
2581
2567
  {
2582
- ordinalConverter.write(1, into);
2568
+ c.writeI32(1);
2583
2569
  const inner = value.inner;
2584
- FfiConverterUInt64.write(inner.dropped, into);
2585
- FfiConverterUInt64.write(inner.totalDropped, into);
2570
+ FfiConverterUInt64.writeIntoCursor(inner.dropped, c);
2571
+ FfiConverterUInt64.writeIntoCursor(inner.totalDropped, c);
2586
2572
  return;
2587
2573
  }
2588
2574
  case P2pEvent_Tags.DriverFailed:
2589
2575
  {
2590
- ordinalConverter.write(2, into);
2576
+ c.writeI32(2);
2591
2577
  const inner = value.inner;
2592
- FfiConverterTypeDriverFailureKind.write(inner.kind, into);
2593
- FfiConverterString.write(inner.detail, into);
2578
+ FfiConverterTypeDriverFailureKind.writeIntoCursor(inner.kind, c);
2579
+ FfiConverterString.writeIntoCursor(inner.detail, c);
2594
2580
  return;
2595
2581
  }
2596
2582
  case P2pEvent_Tags.ConnectionEstablished:
2597
2583
  {
2598
- ordinalConverter.write(3, into);
2584
+ c.writeI32(3);
2599
2585
  const inner = value.inner;
2600
- FfiConverterString.write(inner.peerId, into);
2601
- FfiConverterUInt64.write(inner.connId, into);
2586
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2587
+ FfiConverterUInt64.writeIntoCursor(inner.connId, c);
2602
2588
  return;
2603
2589
  }
2604
2590
  case P2pEvent_Tags.ConnectionClosed:
2605
2591
  {
2606
- ordinalConverter.write(4, into);
2592
+ c.writeI32(4);
2607
2593
  const inner = value.inner;
2608
- FfiConverterString.write(inner.peerId, into);
2609
- FfiConverterUInt64.write(inner.connId, into);
2594
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2595
+ FfiConverterUInt64.writeIntoCursor(inner.connId, c);
2610
2596
  return;
2611
2597
  }
2612
2598
  case P2pEvent_Tags.PeerReady:
2613
2599
  {
2614
- ordinalConverter.write(5, into);
2600
+ c.writeI32(5);
2615
2601
  const inner = value.inner;
2616
- FfiConverterString.write(inner.peerId, into);
2617
- FfiConverterSequenceString.write(inner.protocols, into);
2602
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2603
+ FfiConverterSequenceString.writeIntoCursor(inner.protocols, c);
2618
2604
  return;
2619
2605
  }
2620
2606
  case P2pEvent_Tags.IdentifyReceived:
2621
2607
  {
2622
- ordinalConverter.write(6, into);
2608
+ c.writeI32(6);
2623
2609
  const inner = value.inner;
2624
- FfiConverterString.write(inner.peerId, into);
2625
- FfiConverterTypeIdentifyInfo.write(inner.info, into);
2610
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2611
+ FfiConverterTypeIdentifyInfo.writeIntoCursor(inner.info, c);
2626
2612
  return;
2627
2613
  }
2628
2614
  case P2pEvent_Tags.PingRttMeasured:
2629
2615
  {
2630
- ordinalConverter.write(7, into);
2616
+ c.writeI32(7);
2631
2617
  const inner = value.inner;
2632
- FfiConverterString.write(inner.peerId, into);
2633
- FfiConverterUInt64.write(inner.rttMs, into);
2618
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2619
+ FfiConverterUInt64.writeIntoCursor(inner.rttMs, c);
2634
2620
  return;
2635
2621
  }
2636
2622
  case P2pEvent_Tags.PingTimeout:
2637
2623
  {
2638
- ordinalConverter.write(8, into);
2624
+ c.writeI32(8);
2639
2625
  const inner = value.inner;
2640
- FfiConverterString.write(inner.peerId, into);
2626
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2641
2627
  return;
2642
2628
  }
2643
2629
  case P2pEvent_Tags.StreamReady:
2644
2630
  {
2645
- ordinalConverter.write(9, into);
2631
+ c.writeI32(9);
2646
2632
  const inner = value.inner;
2647
- FfiConverterString.write(inner.peerId, into);
2648
- FfiConverterUInt64.write(inner.connId, into);
2649
- FfiConverterUInt64.write(inner.streamId, into);
2650
- FfiConverterString.write(inner.protocolId, into);
2651
- FfiConverterBool.write(inner.initiatedLocally, into);
2633
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2634
+ FfiConverterUInt64.writeIntoCursor(inner.connId, c);
2635
+ FfiConverterUInt64.writeIntoCursor(inner.streamId, c);
2636
+ FfiConverterString.writeIntoCursor(inner.protocolId, c);
2637
+ FfiConverterBool.writeIntoCursor(inner.initiatedLocally, c);
2652
2638
  return;
2653
2639
  }
2654
2640
  case P2pEvent_Tags.StreamData:
2655
2641
  {
2656
- ordinalConverter.write(10, into);
2642
+ c.writeI32(10);
2657
2643
  const inner = value.inner;
2658
- FfiConverterString.write(inner.peerId, into);
2659
- FfiConverterUInt64.write(inner.connId, into);
2660
- FfiConverterUInt64.write(inner.streamId, into);
2661
- FfiConverterArrayBuffer.write(inner.data, into);
2644
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2645
+ FfiConverterUInt64.writeIntoCursor(inner.connId, c);
2646
+ FfiConverterUInt64.writeIntoCursor(inner.streamId, c);
2647
+ FfiConverterArrayBuffer.writeIntoCursor(inner.data, c);
2662
2648
  return;
2663
2649
  }
2664
2650
  case P2pEvent_Tags.StreamRemoteWriteClosed:
2665
2651
  {
2666
- ordinalConverter.write(11, into);
2652
+ c.writeI32(11);
2667
2653
  const inner = value.inner;
2668
- FfiConverterString.write(inner.peerId, into);
2669
- FfiConverterUInt64.write(inner.connId, into);
2670
- FfiConverterUInt64.write(inner.streamId, into);
2654
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2655
+ FfiConverterUInt64.writeIntoCursor(inner.connId, c);
2656
+ FfiConverterUInt64.writeIntoCursor(inner.streamId, c);
2671
2657
  return;
2672
2658
  }
2673
2659
  case P2pEvent_Tags.StreamClosed:
2674
2660
  {
2675
- ordinalConverter.write(12, into);
2661
+ c.writeI32(12);
2676
2662
  const inner = value.inner;
2677
- FfiConverterString.write(inner.peerId, into);
2678
- FfiConverterUInt64.write(inner.connId, into);
2679
- FfiConverterUInt64.write(inner.streamId, into);
2663
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2664
+ FfiConverterUInt64.writeIntoCursor(inner.connId, c);
2665
+ FfiConverterUInt64.writeIntoCursor(inner.streamId, c);
2680
2666
  return;
2681
2667
  }
2682
2668
  case P2pEvent_Tags.EndpointError:
2683
2669
  {
2684
- ordinalConverter.write(13, into);
2670
+ c.writeI32(13);
2685
2671
  const inner = value.inner;
2686
- FfiConverterTypeEndpointErrorKind.write(inner.kind, into);
2687
- FfiConverterOptionalString.write(inner.peerId, into);
2688
- FfiConverterOptionalUInt64.write(inner.connId, into);
2689
- FfiConverterOptionalUInt64.write(inner.streamId, into);
2690
- FfiConverterString.write(inner.detail, into);
2672
+ FfiConverterTypeEndpointErrorKind.writeIntoCursor(inner.kind, c);
2673
+ FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
2674
+ FfiConverterOptionalUInt64.writeIntoCursor(inner.connId, c);
2675
+ FfiConverterOptionalUInt64.writeIntoCursor(inner.streamId, c);
2676
+ FfiConverterString.writeIntoCursor(inner.detail, c);
2691
2677
  return;
2692
2678
  }
2693
2679
  case P2pEvent_Tags.ReachabilityChanged:
2694
2680
  {
2695
- ordinalConverter.write(14, into);
2681
+ c.writeI32(14);
2696
2682
  const inner = value.inner;
2697
- FfiConverterTypeReachability.write(inner.previous, into);
2698
- FfiConverterTypeReachability.write(inner.current, into);
2699
- FfiConverterSequenceString.write(inner.confirmedAddrs, into);
2683
+ FfiConverterTypeReachability.writeIntoCursor(inner.previous, c);
2684
+ FfiConverterTypeReachability.writeIntoCursor(inner.current, c);
2685
+ FfiConverterSequenceString.writeIntoCursor(inner.confirmedAddrs, c);
2700
2686
  return;
2701
2687
  }
2702
2688
  case P2pEvent_Tags.PublicAddressesChanged:
2703
2689
  {
2704
- ordinalConverter.write(15, into);
2690
+ c.writeI32(15);
2705
2691
  const inner = value.inner;
2706
- FfiConverterSequenceString.write(inner.addrs, into);
2692
+ FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
2707
2693
  return;
2708
2694
  }
2709
2695
  case P2pEvent_Tags.RelayReserved:
2710
2696
  {
2711
- ordinalConverter.write(16, into);
2697
+ c.writeI32(16);
2712
2698
  const inner = value.inner;
2713
- FfiConverterString.write(inner.relayPeerId, into);
2714
- FfiConverterOptionalUInt64.write(inner.expiresUnixSecs, into);
2699
+ FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
2700
+ FfiConverterOptionalUInt64.writeIntoCursor(inner.expiresUnixSecs, c);
2715
2701
  return;
2716
2702
  }
2717
2703
  case P2pEvent_Tags.RelayReservationLost:
2718
2704
  {
2719
- ordinalConverter.write(17, into);
2705
+ c.writeI32(17);
2720
2706
  const inner = value.inner;
2721
- FfiConverterString.write(inner.relayPeerId, into);
2707
+ FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
2722
2708
  return;
2723
2709
  }
2724
2710
  case P2pEvent_Tags.PathEstablished:
2725
2711
  {
2726
- ordinalConverter.write(18, into);
2712
+ c.writeI32(18);
2727
2713
  const inner = value.inner;
2728
- FfiConverterUInt64.write(inner.connectId, into);
2729
- FfiConverterString.write(inner.peerId, into);
2730
- FfiConverterTypePathKind.write(inner.path, into);
2714
+ FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
2715
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2716
+ FfiConverterTypePathKind.writeIntoCursor(inner.path, c);
2731
2717
  return;
2732
2718
  }
2733
2719
  case P2pEvent_Tags.InboundPathEstablished:
2734
2720
  {
2735
- ordinalConverter.write(19, into);
2721
+ c.writeI32(19);
2736
2722
  const inner = value.inner;
2737
- FfiConverterString.write(inner.peerId, into);
2738
- FfiConverterTypePathKind.write(inner.path, into);
2723
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2724
+ FfiConverterTypePathKind.writeIntoCursor(inner.path, c);
2739
2725
  return;
2740
2726
  }
2741
2727
  case P2pEvent_Tags.PathUpgraded:
2742
2728
  {
2743
- ordinalConverter.write(20, into);
2729
+ c.writeI32(20);
2744
2730
  const inner = value.inner;
2745
- FfiConverterUInt64.write(inner.connectId, into);
2746
- FfiConverterString.write(inner.peerId, into);
2747
- FfiConverterTypePathKind.write(inner.from, into);
2748
- FfiConverterTypePathKind.write(inner.to, into);
2731
+ FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
2732
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2733
+ FfiConverterTypePathKind.writeIntoCursor(inner.from, c);
2734
+ FfiConverterTypePathKind.writeIntoCursor(inner.to, c);
2749
2735
  return;
2750
2736
  }
2751
2737
  case P2pEvent_Tags.HolePunchFailed:
2752
2738
  {
2753
- ordinalConverter.write(21, into);
2739
+ c.writeI32(21);
2754
2740
  const inner = value.inner;
2755
- FfiConverterUInt64.write(inner.connectId, into);
2756
- FfiConverterUInt32.write(inner.attempt, into);
2757
- FfiConverterString.write(inner.reason, into);
2741
+ FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
2742
+ FfiConverterUInt32.writeIntoCursor(inner.attempt, c);
2743
+ FfiConverterString.writeIntoCursor(inner.reason, c);
2758
2744
  return;
2759
2745
  }
2760
2746
  case P2pEvent_Tags.FellBackToRelay:
2761
2747
  {
2762
- ordinalConverter.write(22, into);
2748
+ c.writeI32(22);
2763
2749
  const inner = value.inner;
2764
- FfiConverterUInt64.write(inner.connectId, into);
2765
- FfiConverterString.write(inner.peerId, into);
2750
+ FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
2751
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2766
2752
  return;
2767
2753
  }
2768
2754
  case P2pEvent_Tags.ConnectFailed:
2769
2755
  {
2770
- ordinalConverter.write(23, into);
2756
+ c.writeI32(23);
2771
2757
  const inner = value.inner;
2772
- FfiConverterUInt64.write(inner.connectId, into);
2773
- FfiConverterString.write(inner.peerId, into);
2774
- FfiConverterTypeNatErrorKind.write(inner.kind, into);
2775
- FfiConverterString.write(inner.detail, into);
2758
+ FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
2759
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2760
+ FfiConverterTypeNatErrorKind.writeIntoCursor(inner.kind, c);
2761
+ FfiConverterString.writeIntoCursor(inner.detail, c);
2776
2762
  return;
2777
2763
  }
2778
2764
  case P2pEvent_Tags.InboundDirectUpgrade:
2779
2765
  {
2780
- ordinalConverter.write(24, into);
2766
+ c.writeI32(24);
2781
2767
  const inner = value.inner;
2782
- FfiConverterString.write(inner.peerId, into);
2768
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2783
2769
  return;
2784
2770
  }
2785
2771
  case P2pEvent_Tags.Message:
2786
2772
  {
2787
- ordinalConverter.write(25, into);
2773
+ c.writeI32(25);
2788
2774
  const inner = value.inner;
2789
- FfiConverterString.write(inner.fromPeerId, into);
2790
- FfiConverterSequenceString.write(inner.topics, into);
2791
- FfiConverterArrayBuffer.write(inner.data, into);
2792
- FfiConverterArrayBuffer.write(inner.seqno, into);
2793
- FfiConverterBool.write(inner.signed, into);
2775
+ FfiConverterString.writeIntoCursor(inner.fromPeerId, c);
2776
+ FfiConverterSequenceString.writeIntoCursor(inner.topics, c);
2777
+ FfiConverterArrayBuffer.writeIntoCursor(inner.data, c);
2778
+ FfiConverterArrayBuffer.writeIntoCursor(inner.seqno, c);
2779
+ FfiConverterBool.writeIntoCursor(inner.signed, c);
2794
2780
  return;
2795
2781
  }
2796
2782
  case P2pEvent_Tags.PeerSubscribed:
2797
2783
  {
2798
- ordinalConverter.write(26, into);
2784
+ c.writeI32(26);
2799
2785
  const inner = value.inner;
2800
- FfiConverterString.write(inner.peerId, into);
2801
- FfiConverterString.write(inner.topic, into);
2786
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2787
+ FfiConverterString.writeIntoCursor(inner.topic, c);
2802
2788
  return;
2803
2789
  }
2804
2790
  case P2pEvent_Tags.PeerUnsubscribed:
2805
2791
  {
2806
- ordinalConverter.write(27, into);
2792
+ c.writeI32(27);
2807
2793
  const inner = value.inner;
2808
- FfiConverterString.write(inner.peerId, into);
2809
- FfiConverterString.write(inner.topic, into);
2794
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2795
+ FfiConverterString.writeIntoCursor(inner.topic, c);
2810
2796
  return;
2811
2797
  }
2812
2798
  case P2pEvent_Tags.PubsubOutboundFailure:
2813
2799
  {
2814
- ordinalConverter.write(28, into);
2800
+ c.writeI32(28);
2815
2801
  const inner = value.inner;
2816
- FfiConverterString.write(inner.peerId, into);
2817
- FfiConverterString.write(inner.reason, into);
2802
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2803
+ FfiConverterString.writeIntoCursor(inner.reason, c);
2818
2804
  return;
2819
2805
  }
2820
2806
  case P2pEvent_Tags.PubsubProtocolViolation:
2821
2807
  {
2822
- ordinalConverter.write(29, into);
2808
+ c.writeI32(29);
2823
2809
  const inner = value.inner;
2824
- FfiConverterString.write(inner.peerId, into);
2825
- FfiConverterString.write(inner.reason, into);
2810
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2811
+ FfiConverterString.writeIntoCursor(inner.reason, c);
2826
2812
  return;
2827
2813
  }
2828
2814
  case P2pEvent_Tags.PeerDiscovered:
2829
2815
  {
2830
- ordinalConverter.write(30, into);
2816
+ c.writeI32(30);
2831
2817
  const inner = value.inner;
2832
- FfiConverterString.write(inner.peerId, into);
2833
- FfiConverterSequenceString.write(inner.addrs, into);
2834
- FfiConverterTypeDiscoverySource.write(inner.source, into);
2818
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2819
+ FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
2820
+ FfiConverterTypeDiscoverySource.writeIntoCursor(inner.source, c);
2835
2821
  return;
2836
2822
  }
2837
2823
  case P2pEvent_Tags.PeerUpdated:
2838
2824
  {
2839
- ordinalConverter.write(31, into);
2825
+ c.writeI32(31);
2840
2826
  const inner = value.inner;
2841
- FfiConverterString.write(inner.peerId, into);
2842
- FfiConverterSequenceString.write(inner.addrs, into);
2843
- FfiConverterTypeDiscoverySource.write(inner.source, into);
2827
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2828
+ FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
2829
+ FfiConverterTypeDiscoverySource.writeIntoCursor(inner.source, c);
2844
2830
  return;
2845
2831
  }
2846
2832
  case P2pEvent_Tags.PeerExpired:
2847
2833
  {
2848
- ordinalConverter.write(32, into);
2834
+ c.writeI32(32);
2849
2835
  const inner = value.inner;
2850
- FfiConverterString.write(inner.peerId, into);
2836
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2851
2837
  return;
2852
2838
  }
2853
2839
  case P2pEvent_Tags.DiscoveryDialFailed:
2854
2840
  {
2855
- ordinalConverter.write(33, into);
2841
+ c.writeI32(33);
2856
2842
  const inner = value.inner;
2857
- FfiConverterString.write(inner.peerId, into);
2858
- FfiConverterString.write(inner.reason, into);
2843
+ FfiConverterString.writeIntoCursor(inner.peerId, c);
2844
+ FfiConverterString.writeIntoCursor(inner.reason, c);
2859
2845
  return;
2860
2846
  }
2861
2847
  case P2pEvent_Tags.DiscoveryProtocolViolation:
2862
2848
  {
2863
- ordinalConverter.write(34, into);
2849
+ c.writeI32(34);
2864
2850
  const inner = value.inner;
2865
- FfiConverterOptionalString.write(inner.peerId, into);
2866
- FfiConverterTypeDiscoverySource.write(inner.source, into);
2867
- FfiConverterString.write(inner.reason, into);
2868
- FfiConverterUInt32.write(inner.suppressed, into);
2851
+ FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
2852
+ FfiConverterTypeDiscoverySource.writeIntoCursor(inner.source, c);
2853
+ FfiConverterString.writeIntoCursor(inner.reason, c);
2854
+ FfiConverterUInt32.writeIntoCursor(inner.suppressed, c);
2869
2855
  return;
2870
2856
  }
2871
2857
  default:
@@ -2878,7 +2864,7 @@ const FfiConverterTypeP2pEvent = (() => {
2878
2864
  case P2pEvent_Tags.EventsDropped:
2879
2865
  {
2880
2866
  const inner = value.inner;
2881
- let size = ordinalConverter.allocationSize(1);
2867
+ let size = 4;
2882
2868
  size += FfiConverterUInt64.allocationSize(inner.dropped);
2883
2869
  size += FfiConverterUInt64.allocationSize(inner.totalDropped);
2884
2870
  return size;
@@ -2886,7 +2872,7 @@ const FfiConverterTypeP2pEvent = (() => {
2886
2872
  case P2pEvent_Tags.DriverFailed:
2887
2873
  {
2888
2874
  const inner = value.inner;
2889
- let size = ordinalConverter.allocationSize(2);
2875
+ let size = 4;
2890
2876
  size += FfiConverterTypeDriverFailureKind.allocationSize(inner.kind);
2891
2877
  size += FfiConverterString.allocationSize(inner.detail);
2892
2878
  return size;
@@ -2894,7 +2880,7 @@ const FfiConverterTypeP2pEvent = (() => {
2894
2880
  case P2pEvent_Tags.ConnectionEstablished:
2895
2881
  {
2896
2882
  const inner = value.inner;
2897
- let size = ordinalConverter.allocationSize(3);
2883
+ let size = 4;
2898
2884
  size += FfiConverterString.allocationSize(inner.peerId);
2899
2885
  size += FfiConverterUInt64.allocationSize(inner.connId);
2900
2886
  return size;
@@ -2902,7 +2888,7 @@ const FfiConverterTypeP2pEvent = (() => {
2902
2888
  case P2pEvent_Tags.ConnectionClosed:
2903
2889
  {
2904
2890
  const inner = value.inner;
2905
- let size = ordinalConverter.allocationSize(4);
2891
+ let size = 4;
2906
2892
  size += FfiConverterString.allocationSize(inner.peerId);
2907
2893
  size += FfiConverterUInt64.allocationSize(inner.connId);
2908
2894
  return size;
@@ -2910,7 +2896,7 @@ const FfiConverterTypeP2pEvent = (() => {
2910
2896
  case P2pEvent_Tags.PeerReady:
2911
2897
  {
2912
2898
  const inner = value.inner;
2913
- let size = ordinalConverter.allocationSize(5);
2899
+ let size = 4;
2914
2900
  size += FfiConverterString.allocationSize(inner.peerId);
2915
2901
  size += FfiConverterSequenceString.allocationSize(inner.protocols);
2916
2902
  return size;
@@ -2918,7 +2904,7 @@ const FfiConverterTypeP2pEvent = (() => {
2918
2904
  case P2pEvent_Tags.IdentifyReceived:
2919
2905
  {
2920
2906
  const inner = value.inner;
2921
- let size = ordinalConverter.allocationSize(6);
2907
+ let size = 4;
2922
2908
  size += FfiConverterString.allocationSize(inner.peerId);
2923
2909
  size += FfiConverterTypeIdentifyInfo.allocationSize(inner.info);
2924
2910
  return size;
@@ -2926,7 +2912,7 @@ const FfiConverterTypeP2pEvent = (() => {
2926
2912
  case P2pEvent_Tags.PingRttMeasured:
2927
2913
  {
2928
2914
  const inner = value.inner;
2929
- let size = ordinalConverter.allocationSize(7);
2915
+ let size = 4;
2930
2916
  size += FfiConverterString.allocationSize(inner.peerId);
2931
2917
  size += FfiConverterUInt64.allocationSize(inner.rttMs);
2932
2918
  return size;
@@ -2934,14 +2920,14 @@ const FfiConverterTypeP2pEvent = (() => {
2934
2920
  case P2pEvent_Tags.PingTimeout:
2935
2921
  {
2936
2922
  const inner = value.inner;
2937
- let size = ordinalConverter.allocationSize(8);
2923
+ let size = 4;
2938
2924
  size += FfiConverterString.allocationSize(inner.peerId);
2939
2925
  return size;
2940
2926
  }
2941
2927
  case P2pEvent_Tags.StreamReady:
2942
2928
  {
2943
2929
  const inner = value.inner;
2944
- let size = ordinalConverter.allocationSize(9);
2930
+ let size = 4;
2945
2931
  size += FfiConverterString.allocationSize(inner.peerId);
2946
2932
  size += FfiConverterUInt64.allocationSize(inner.connId);
2947
2933
  size += FfiConverterUInt64.allocationSize(inner.streamId);
@@ -2952,7 +2938,7 @@ const FfiConverterTypeP2pEvent = (() => {
2952
2938
  case P2pEvent_Tags.StreamData:
2953
2939
  {
2954
2940
  const inner = value.inner;
2955
- let size = ordinalConverter.allocationSize(10);
2941
+ let size = 4;
2956
2942
  size += FfiConverterString.allocationSize(inner.peerId);
2957
2943
  size += FfiConverterUInt64.allocationSize(inner.connId);
2958
2944
  size += FfiConverterUInt64.allocationSize(inner.streamId);
@@ -2962,7 +2948,7 @@ const FfiConverterTypeP2pEvent = (() => {
2962
2948
  case P2pEvent_Tags.StreamRemoteWriteClosed:
2963
2949
  {
2964
2950
  const inner = value.inner;
2965
- let size = ordinalConverter.allocationSize(11);
2951
+ let size = 4;
2966
2952
  size += FfiConverterString.allocationSize(inner.peerId);
2967
2953
  size += FfiConverterUInt64.allocationSize(inner.connId);
2968
2954
  size += FfiConverterUInt64.allocationSize(inner.streamId);
@@ -2971,7 +2957,7 @@ const FfiConverterTypeP2pEvent = (() => {
2971
2957
  case P2pEvent_Tags.StreamClosed:
2972
2958
  {
2973
2959
  const inner = value.inner;
2974
- let size = ordinalConverter.allocationSize(12);
2960
+ let size = 4;
2975
2961
  size += FfiConverterString.allocationSize(inner.peerId);
2976
2962
  size += FfiConverterUInt64.allocationSize(inner.connId);
2977
2963
  size += FfiConverterUInt64.allocationSize(inner.streamId);
@@ -2980,7 +2966,7 @@ const FfiConverterTypeP2pEvent = (() => {
2980
2966
  case P2pEvent_Tags.EndpointError:
2981
2967
  {
2982
2968
  const inner = value.inner;
2983
- let size = ordinalConverter.allocationSize(13);
2969
+ let size = 4;
2984
2970
  size += FfiConverterTypeEndpointErrorKind.allocationSize(inner.kind);
2985
2971
  size += FfiConverterOptionalString.allocationSize(inner.peerId);
2986
2972
  size += FfiConverterOptionalUInt64.allocationSize(inner.connId);
@@ -2991,7 +2977,7 @@ const FfiConverterTypeP2pEvent = (() => {
2991
2977
  case P2pEvent_Tags.ReachabilityChanged:
2992
2978
  {
2993
2979
  const inner = value.inner;
2994
- let size = ordinalConverter.allocationSize(14);
2980
+ let size = 4;
2995
2981
  size += FfiConverterTypeReachability.allocationSize(inner.previous);
2996
2982
  size += FfiConverterTypeReachability.allocationSize(inner.current);
2997
2983
  size += FfiConverterSequenceString.allocationSize(inner.confirmedAddrs);
@@ -3000,14 +2986,14 @@ const FfiConverterTypeP2pEvent = (() => {
3000
2986
  case P2pEvent_Tags.PublicAddressesChanged:
3001
2987
  {
3002
2988
  const inner = value.inner;
3003
- let size = ordinalConverter.allocationSize(15);
2989
+ let size = 4;
3004
2990
  size += FfiConverterSequenceString.allocationSize(inner.addrs);
3005
2991
  return size;
3006
2992
  }
3007
2993
  case P2pEvent_Tags.RelayReserved:
3008
2994
  {
3009
2995
  const inner = value.inner;
3010
- let size = ordinalConverter.allocationSize(16);
2996
+ let size = 4;
3011
2997
  size += FfiConverterString.allocationSize(inner.relayPeerId);
3012
2998
  size += FfiConverterOptionalUInt64.allocationSize(inner.expiresUnixSecs);
3013
2999
  return size;
@@ -3015,14 +3001,14 @@ const FfiConverterTypeP2pEvent = (() => {
3015
3001
  case P2pEvent_Tags.RelayReservationLost:
3016
3002
  {
3017
3003
  const inner = value.inner;
3018
- let size = ordinalConverter.allocationSize(17);
3004
+ let size = 4;
3019
3005
  size += FfiConverterString.allocationSize(inner.relayPeerId);
3020
3006
  return size;
3021
3007
  }
3022
3008
  case P2pEvent_Tags.PathEstablished:
3023
3009
  {
3024
3010
  const inner = value.inner;
3025
- let size = ordinalConverter.allocationSize(18);
3011
+ let size = 4;
3026
3012
  size += FfiConverterUInt64.allocationSize(inner.connectId);
3027
3013
  size += FfiConverterString.allocationSize(inner.peerId);
3028
3014
  size += FfiConverterTypePathKind.allocationSize(inner.path);
@@ -3031,7 +3017,7 @@ const FfiConverterTypeP2pEvent = (() => {
3031
3017
  case P2pEvent_Tags.InboundPathEstablished:
3032
3018
  {
3033
3019
  const inner = value.inner;
3034
- let size = ordinalConverter.allocationSize(19);
3020
+ let size = 4;
3035
3021
  size += FfiConverterString.allocationSize(inner.peerId);
3036
3022
  size += FfiConverterTypePathKind.allocationSize(inner.path);
3037
3023
  return size;
@@ -3039,7 +3025,7 @@ const FfiConverterTypeP2pEvent = (() => {
3039
3025
  case P2pEvent_Tags.PathUpgraded:
3040
3026
  {
3041
3027
  const inner = value.inner;
3042
- let size = ordinalConverter.allocationSize(20);
3028
+ let size = 4;
3043
3029
  size += FfiConverterUInt64.allocationSize(inner.connectId);
3044
3030
  size += FfiConverterString.allocationSize(inner.peerId);
3045
3031
  size += FfiConverterTypePathKind.allocationSize(inner.from);
@@ -3049,7 +3035,7 @@ const FfiConverterTypeP2pEvent = (() => {
3049
3035
  case P2pEvent_Tags.HolePunchFailed:
3050
3036
  {
3051
3037
  const inner = value.inner;
3052
- let size = ordinalConverter.allocationSize(21);
3038
+ let size = 4;
3053
3039
  size += FfiConverterUInt64.allocationSize(inner.connectId);
3054
3040
  size += FfiConverterUInt32.allocationSize(inner.attempt);
3055
3041
  size += FfiConverterString.allocationSize(inner.reason);
@@ -3058,7 +3044,7 @@ const FfiConverterTypeP2pEvent = (() => {
3058
3044
  case P2pEvent_Tags.FellBackToRelay:
3059
3045
  {
3060
3046
  const inner = value.inner;
3061
- let size = ordinalConverter.allocationSize(22);
3047
+ let size = 4;
3062
3048
  size += FfiConverterUInt64.allocationSize(inner.connectId);
3063
3049
  size += FfiConverterString.allocationSize(inner.peerId);
3064
3050
  return size;
@@ -3066,7 +3052,7 @@ const FfiConverterTypeP2pEvent = (() => {
3066
3052
  case P2pEvent_Tags.ConnectFailed:
3067
3053
  {
3068
3054
  const inner = value.inner;
3069
- let size = ordinalConverter.allocationSize(23);
3055
+ let size = 4;
3070
3056
  size += FfiConverterUInt64.allocationSize(inner.connectId);
3071
3057
  size += FfiConverterString.allocationSize(inner.peerId);
3072
3058
  size += FfiConverterTypeNatErrorKind.allocationSize(inner.kind);
@@ -3076,14 +3062,14 @@ const FfiConverterTypeP2pEvent = (() => {
3076
3062
  case P2pEvent_Tags.InboundDirectUpgrade:
3077
3063
  {
3078
3064
  const inner = value.inner;
3079
- let size = ordinalConverter.allocationSize(24);
3065
+ let size = 4;
3080
3066
  size += FfiConverterString.allocationSize(inner.peerId);
3081
3067
  return size;
3082
3068
  }
3083
3069
  case P2pEvent_Tags.Message:
3084
3070
  {
3085
3071
  const inner = value.inner;
3086
- let size = ordinalConverter.allocationSize(25);
3072
+ let size = 4;
3087
3073
  size += FfiConverterString.allocationSize(inner.fromPeerId);
3088
3074
  size += FfiConverterSequenceString.allocationSize(inner.topics);
3089
3075
  size += FfiConverterArrayBuffer.allocationSize(inner.data);
@@ -3094,7 +3080,7 @@ const FfiConverterTypeP2pEvent = (() => {
3094
3080
  case P2pEvent_Tags.PeerSubscribed:
3095
3081
  {
3096
3082
  const inner = value.inner;
3097
- let size = ordinalConverter.allocationSize(26);
3083
+ let size = 4;
3098
3084
  size += FfiConverterString.allocationSize(inner.peerId);
3099
3085
  size += FfiConverterString.allocationSize(inner.topic);
3100
3086
  return size;
@@ -3102,7 +3088,7 @@ const FfiConverterTypeP2pEvent = (() => {
3102
3088
  case P2pEvent_Tags.PeerUnsubscribed:
3103
3089
  {
3104
3090
  const inner = value.inner;
3105
- let size = ordinalConverter.allocationSize(27);
3091
+ let size = 4;
3106
3092
  size += FfiConverterString.allocationSize(inner.peerId);
3107
3093
  size += FfiConverterString.allocationSize(inner.topic);
3108
3094
  return size;
@@ -3110,7 +3096,7 @@ const FfiConverterTypeP2pEvent = (() => {
3110
3096
  case P2pEvent_Tags.PubsubOutboundFailure:
3111
3097
  {
3112
3098
  const inner = value.inner;
3113
- let size = ordinalConverter.allocationSize(28);
3099
+ let size = 4;
3114
3100
  size += FfiConverterString.allocationSize(inner.peerId);
3115
3101
  size += FfiConverterString.allocationSize(inner.reason);
3116
3102
  return size;
@@ -3118,7 +3104,7 @@ const FfiConverterTypeP2pEvent = (() => {
3118
3104
  case P2pEvent_Tags.PubsubProtocolViolation:
3119
3105
  {
3120
3106
  const inner = value.inner;
3121
- let size = ordinalConverter.allocationSize(29);
3107
+ let size = 4;
3122
3108
  size += FfiConverterString.allocationSize(inner.peerId);
3123
3109
  size += FfiConverterString.allocationSize(inner.reason);
3124
3110
  return size;
@@ -3126,7 +3112,7 @@ const FfiConverterTypeP2pEvent = (() => {
3126
3112
  case P2pEvent_Tags.PeerDiscovered:
3127
3113
  {
3128
3114
  const inner = value.inner;
3129
- let size = ordinalConverter.allocationSize(30);
3115
+ let size = 4;
3130
3116
  size += FfiConverterString.allocationSize(inner.peerId);
3131
3117
  size += FfiConverterSequenceString.allocationSize(inner.addrs);
3132
3118
  size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
@@ -3135,7 +3121,7 @@ const FfiConverterTypeP2pEvent = (() => {
3135
3121
  case P2pEvent_Tags.PeerUpdated:
3136
3122
  {
3137
3123
  const inner = value.inner;
3138
- let size = ordinalConverter.allocationSize(31);
3124
+ let size = 4;
3139
3125
  size += FfiConverterString.allocationSize(inner.peerId);
3140
3126
  size += FfiConverterSequenceString.allocationSize(inner.addrs);
3141
3127
  size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
@@ -3144,14 +3130,14 @@ const FfiConverterTypeP2pEvent = (() => {
3144
3130
  case P2pEvent_Tags.PeerExpired:
3145
3131
  {
3146
3132
  const inner = value.inner;
3147
- let size = ordinalConverter.allocationSize(32);
3133
+ let size = 4;
3148
3134
  size += FfiConverterString.allocationSize(inner.peerId);
3149
3135
  return size;
3150
3136
  }
3151
3137
  case P2pEvent_Tags.DiscoveryDialFailed:
3152
3138
  {
3153
3139
  const inner = value.inner;
3154
- let size = ordinalConverter.allocationSize(33);
3140
+ let size = 4;
3155
3141
  size += FfiConverterString.allocationSize(inner.peerId);
3156
3142
  size += FfiConverterString.allocationSize(inner.reason);
3157
3143
  return size;
@@ -3159,7 +3145,7 @@ const FfiConverterTypeP2pEvent = (() => {
3159
3145
  case P2pEvent_Tags.DiscoveryProtocolViolation:
3160
3146
  {
3161
3147
  const inner = value.inner;
3162
- let size = ordinalConverter.allocationSize(34);
3148
+ let size = 4;
3163
3149
  size += FfiConverterOptionalString.allocationSize(inner.peerId);
3164
3150
  size += FfiConverterTypeDiscoverySource.allocationSize(inner.source);
3165
3151
  size += FfiConverterString.allocationSize(inner.reason);
@@ -3175,53 +3161,53 @@ const FfiConverterTypeP2pEvent = (() => {
3175
3161
  })();
3176
3162
 
3177
3163
  /**
3178
- * Listener implemented by the embedding runtime.
3164
+ * Doorbell implemented by the embedding runtime.
3179
3165
  */
3180
3166
 
3181
3167
  /**
3182
- * Listener implemented by the embedding runtime.
3168
+ * Doorbell implemented by the embedding runtime.
3183
3169
  */
3184
- export class P2pEventListenerImpl extends UniffiAbstractObject {
3185
- [uniffiTypeNameSymbol] = "P2pEventListenerImpl";
3170
+ export class P2pEventDoorbellImpl extends UniffiAbstractObject {
3171
+ [uniffiTypeNameSymbol] = "P2pEventDoorbellImpl";
3186
3172
  // No primary constructor declared for this class.
3187
3173
  constructor(pointer) {
3188
3174
  super();
3189
3175
  this[pointerLiteralSymbol] = pointer;
3190
- this[destructorGuardSymbol] = uniffiTypeP2pEventListenerImplObjectFactory.bless(pointer);
3176
+ this[destructorGuardSymbol] = uniffiTypeP2pEventDoorbellImplObjectFactory.bless(pointer);
3191
3177
  }
3192
3178
 
3193
3179
  /**
3194
- * Receives one converted native event.
3180
+ * Reports that synchronous event draining can make progress.
3195
3181
  */
3196
- onEvent(event) {
3182
+ onEventsReady() {
3197
3183
  uniffiCaller.rustCall(/*caller:*/callStatus => {
3198
- nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2peventlistener_on_event(uniffiTypeP2pEventListenerImplObjectFactory.clonePointer(this), FfiConverterTypeP2pEvent.lower(event, nativeModule().rustbuffer_alloc), callStatus);
3184
+ nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2peventdoorbell_on_events_ready(uniffiTypeP2pEventDoorbellImplObjectFactory.clonePointer(this), callStatus);
3199
3185
  }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3200
3186
  }
3201
3187
  uniffiDestroy() {
3202
3188
  const ptr = this[destructorGuardSymbol];
3203
3189
  if (ptr !== undefined) {
3204
- const pointer = uniffiTypeP2pEventListenerImplObjectFactory.pointer(this);
3205
- uniffiTypeP2pEventListenerImplObjectFactory.freePointer(pointer);
3206
- uniffiTypeP2pEventListenerImplObjectFactory.unbless(ptr);
3190
+ const pointer = uniffiTypeP2pEventDoorbellImplObjectFactory.pointer(this);
3191
+ uniffiTypeP2pEventDoorbellImplObjectFactory.freePointer(pointer);
3192
+ uniffiTypeP2pEventDoorbellImplObjectFactory.unbless(ptr);
3207
3193
  delete this[destructorGuardSymbol];
3208
3194
  }
3209
3195
  }
3210
3196
  static instanceOf(obj_) {
3211
- return uniffiTypeP2pEventListenerImplObjectFactory.isConcreteType(obj_);
3197
+ return uniffiTypeP2pEventDoorbellImplObjectFactory.isConcreteType(obj_);
3212
3198
  }
3213
3199
  }
3214
- const uniffiTypeP2pEventListenerImplObjectFactory = (() => {
3200
+ const uniffiTypeP2pEventDoorbellImplObjectFactory = (() => {
3215
3201
  return {
3216
3202
  create(pointer) {
3217
- const instance = Object.create(P2pEventListenerImpl.prototype);
3203
+ const instance = Object.create(P2pEventDoorbellImpl.prototype);
3218
3204
  instance[pointerLiteralSymbol] = pointer;
3219
3205
  instance[destructorGuardSymbol] = this.bless(pointer);
3220
- instance[uniffiTypeNameSymbol] = "P2pEventListenerImpl";
3206
+ instance[uniffiTypeNameSymbol] = "P2pEventDoorbellImpl";
3221
3207
  return instance;
3222
3208
  },
3223
3209
  bless(p) {
3224
- return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_p2peventlistener_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3210
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_p2peventdoorbell_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3225
3211
  },
3226
3212
  unbless(ptr_) {
3227
3213
  ptr_.markDestroyed();
@@ -3234,29 +3220,29 @@ const uniffiTypeP2pEventListenerImplObjectFactory = (() => {
3234
3220
  },
3235
3221
  clonePointer(obj_) {
3236
3222
  const pointer = this.pointer(obj_);
3237
- return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_minip2p_ffi_fn_clone_p2peventlistener(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3223
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_minip2p_ffi_fn_clone_p2peventdoorbell(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3238
3224
  },
3239
3225
  freePointer(pointer) {
3240
- uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_minip2p_ffi_fn_free_p2peventlistener(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3226
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_minip2p_ffi_fn_free_p2peventdoorbell(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3241
3227
  },
3242
3228
  isConcreteType(obj_) {
3243
- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "P2pEventListenerImpl";
3229
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "P2pEventDoorbellImpl";
3244
3230
  }
3245
3231
  };
3246
3232
  })();
3247
- const FfiConverterTypeP2pEventListener = new FfiConverterObjectWithCallbacks(uniffiTypeP2pEventListenerImplObjectFactory);
3233
+ const FfiConverterTypeP2pEventDoorbell = new FfiConverterObjectWithCallbacks(uniffiTypeP2pEventDoorbellImplObjectFactory);
3248
3234
 
3249
- // Add a vtable for the callbacks that go in P2pEventListener.
3235
+ // Add a vtable for the callbacks that go in P2pEventDoorbell.
3250
3236
 
3251
3237
  // Put the implementation in a struct so we don't pollute the top-level namespace
3252
- const uniffiCallbackInterfaceP2pEventListener = {
3238
+ const uniffiCallbackInterfaceP2pEventDoorbell = {
3253
3239
  // Create the VTable using a series of closures.
3254
3240
  // ts automatically converts these into C callback functions.
3255
3241
  vtable: {
3256
- on_event: (uniffiHandle, event) => {
3242
+ on_events_ready: uniffiHandle => {
3257
3243
  const uniffiMakeCall = () => {
3258
- const jsCallback = FfiConverterTypeP2pEventListener.lift(uniffiHandle);
3259
- return jsCallback.onEvent(FfiConverterTypeP2pEvent.lift(event));
3244
+ const jsCallback = FfiConverterTypeP2pEventDoorbell.lift(uniffiHandle);
3245
+ return jsCallback.onEventsReady();
3260
3246
  };
3261
3247
  const uniffiResult = UniffiResult.ready();
3262
3248
  const uniffiHandleSuccess = obj => {};
@@ -3268,14 +3254,14 @@ const uniffiCallbackInterfaceP2pEventListener = {
3268
3254
  },
3269
3255
  uniffi_free: uniffiHandle => {
3270
3256
  // this will throw a stale handle error if the handle isn't found.
3271
- FfiConverterTypeP2pEventListener.drop(uniffiHandle);
3257
+ FfiConverterTypeP2pEventDoorbell.drop(uniffiHandle);
3272
3258
  },
3273
3259
  uniffi_clone: uniffiHandle => {
3274
- return FfiConverterTypeP2pEventListener.clone(uniffiHandle);
3260
+ return FfiConverterTypeP2pEventDoorbell.clone(uniffiHandle);
3275
3261
  }
3276
3262
  },
3277
3263
  register: () => {
3278
- nativeModule().ubrn_uniffi_minip2p_ffi_fn_init_callback_vtable_p2peventlistener(uniffiCallbackInterfaceP2pEventListener.vtable);
3264
+ nativeModule().ubrn_uniffi_minip2p_ffi_fn_init_callback_vtable_p2peventdoorbell(uniffiCallbackInterfaceP2pEventDoorbell.vtable);
3279
3265
  }
3280
3266
  };
3281
3267
 
@@ -3293,11 +3279,7 @@ const uniffiCallbackInterfaceP2pEventListener = {
3293
3279
  export class P2pEndpoint extends UniffiAbstractObject {
3294
3280
  [uniffiTypeNameSymbol] = "P2pEndpoint";
3295
3281
  /**
3296
- * Validates the secret key and `config`, binds its transports, and creates
3297
- * an endpoint.
3298
- *
3299
- * The endpoint begins in the created state and owns its bound sockets,
3300
- * but does not run a background driver until explicitly started.
3282
+ * Creates an endpoint after validating configuration and binding sockets.
3301
3283
  */
3302
3284
  constructor(secretKey, config) /*throws*/{
3303
3285
  super();
@@ -3309,7 +3291,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3309
3291
  }
3310
3292
 
3311
3293
  /**
3312
- * Resets and forgets an application stream.
3294
+ * Forgets a stream.
3313
3295
  */
3314
3296
  abandonStream(peerId, streamId) /*throws*/{
3315
3297
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3318,18 +3300,17 @@ export class P2pEndpoint extends UniffiAbstractObject {
3318
3300
  }
3319
3301
 
3320
3302
  /**
3321
- * Returns the active inbound relay reservation.
3303
+ * Returns the active relay reservation.
3322
3304
  */
3323
3305
  activeReservation() /*throws*/{
3324
- return (__rb => {
3325
- try {
3326
- return FfiConverterOptionalTypeRelayReservationInfo.lift(__rb);
3327
- } finally {
3328
- nativeModule().rustbuffer_free(__rb);
3329
- }
3330
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3306
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3331
3307
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_active_reservation(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3332
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3308
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3309
+ try {
3310
+ return FfiConverterOptionalTypeRelayReservationInfo.lift(__rb);
3311
+ } finally {
3312
+ nativeModule().rustbuffer_free(__rb);
3313
+ }
3333
3314
  }
3334
3315
 
3335
3316
  /**
@@ -3342,10 +3323,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3342
3323
  }
3343
3324
 
3344
3325
  /**
3345
- * Cancels a known connection attempt; unknown ids are an idempotent no-op.
3346
- *
3347
- * Queued connection events are suppressed when possible. A listener
3348
- * callback that already won the dispatch race may still arrive.
3326
+ * Cancels a connection attempt.
3349
3327
  */
3350
3328
  cancelConnect(id) /*throws*/{
3351
3329
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3354,7 +3332,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3354
3332
  }
3355
3333
 
3356
3334
  /**
3357
- * Half-closes the local write side of an application stream.
3335
+ * Half-closes a stream's write side.
3358
3336
  */
3359
3337
  closeStreamWrite(peerId, streamId) /*throws*/{
3360
3338
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3363,7 +3341,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3363
3341
  }
3364
3342
 
3365
3343
  /**
3366
- * Starts a connection attempt toward a peer without known direct addresses.
3344
+ * Starts a connection attempt.
3367
3345
  */
3368
3346
  connect(peerId) /*throws*/{
3369
3347
  return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3372,8 +3350,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3372
3350
  }
3373
3351
 
3374
3352
  /**
3375
- * Starts a connection attempt toward a direct `/quic-v1` or `/tcp` peer
3376
- * address.
3353
+ * Starts a direct-address connection attempt.
3377
3354
  */
3378
3355
  connectAddr(address) /*throws*/{
3379
3356
  return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3382,7 +3359,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3382
3359
  }
3383
3360
 
3384
3361
  /**
3385
- * Starts a NAT connection attempt using an explicit ordered address set.
3362
+ * Starts a connection attempt with explicit addresses.
3386
3363
  */
3387
3364
  connectWithAddrs(peerId, addresses) /*throws*/{
3388
3365
  return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3391,37 +3368,35 @@ export class P2pEndpoint extends UniffiAbstractObject {
3391
3368
  }
3392
3369
 
3393
3370
  /**
3394
- * Returns peers with an established QUIC, TCP, or circuit connection.
3371
+ * Returns connected peers.
3395
3372
  */
3396
3373
  connectedPeers() /*throws*/{
3397
- return (__rb => {
3398
- try {
3399
- return FfiConverterSequenceString.lift(__rb);
3400
- } finally {
3401
- nativeModule().rustbuffer_free(__rb);
3402
- }
3403
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3374
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3404
3375
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_connected_peers(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3405
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3376
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3377
+ try {
3378
+ return FfiConverterSequenceString.lift(__rb);
3379
+ } finally {
3380
+ nativeModule().rustbuffer_free(__rb);
3381
+ }
3406
3382
  }
3407
3383
 
3408
3384
  /**
3409
- * Dials a direct peer address on every applicable local address family.
3385
+ * Dials on all applicable address families.
3410
3386
  */
3411
3387
  dial(address) /*throws*/{
3412
- return (__rb => {
3413
- try {
3414
- return FfiConverterSequenceUInt64.lift(__rb);
3415
- } finally {
3416
- nativeModule().rustbuffer_free(__rb);
3417
- }
3418
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3388
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3419
3389
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_dial(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterString.lower(address, nativeModule().rustbuffer_alloc), callStatus);
3420
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3390
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3391
+ try {
3392
+ return FfiConverterSequenceUInt64.lift(__rb);
3393
+ } finally {
3394
+ nativeModule().rustbuffer_free(__rb);
3395
+ }
3421
3396
  }
3422
3397
 
3423
3398
  /**
3424
- * Dials a direct peer address using IPv4.
3399
+ * Dials using IPv4.
3425
3400
  */
3426
3401
  dialIp4(address) /*throws*/{
3427
3402
  return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3430,7 +3405,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3430
3405
  }
3431
3406
 
3432
3407
  /**
3433
- * Dials a direct peer address using IPv6.
3408
+ * Dials using IPv6.
3434
3409
  */
3435
3410
  dialIp6(address) /*throws*/{
3436
3411
  return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3439,12 +3414,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3439
3414
  }
3440
3415
 
3441
3416
  /**
3442
- * Closes the active connection to `peer_id`.
3443
- *
3444
- * Cancelling a connection attempt suppresses that attempt's progress
3445
- * events, but cannot retract a transport connection that has already
3446
- * completed. Call this method when cancellation must also close an
3447
- * established connection.
3417
+ * Disconnects a peer.
3448
3418
  */
3449
3419
  disconnect(peerId) /*throws*/{
3450
3420
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3453,22 +3423,35 @@ export class P2pEndpoint extends UniffiAbstractObject {
3453
3423
  }
3454
3424
 
3455
3425
  /**
3456
- * Returns the discovery driver's monotonic clock in milliseconds.
3426
+ * Returns the discovery clock.
3457
3427
  */
3458
3428
  discoveryNowMs() /*throws*/{
3459
- return (__rb => {
3460
- try {
3461
- return FfiConverterOptionalUInt64.lift(__rb);
3462
- } finally {
3463
- nativeModule().rustbuffer_free(__rb);
3464
- }
3465
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3429
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3466
3430
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_discovery_now_ms(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3467
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3431
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3432
+ try {
3433
+ return FfiConverterOptionalUInt64.lift(__rb);
3434
+ } finally {
3435
+ nativeModule().rustbuffer_free(__rb);
3436
+ }
3468
3437
  }
3469
3438
 
3470
3439
  /**
3471
- * Returns whether Identify has completed for `peer_id`.
3440
+ * Pulls at most `limit` queued events in order.
3441
+ */
3442
+ drainEvents(limit) {
3443
+ const __rb = uniffiCaller.rustCall(/*caller:*/callStatus => {
3444
+ return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_drain_events(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterUInt32.lower(limit, nativeModule().rustbuffer_alloc), callStatus);
3445
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3446
+ try {
3447
+ return FfiConverterSequenceTypeP2pEvent.lift(__rb);
3448
+ } finally {
3449
+ nativeModule().rustbuffer_free(__rb);
3450
+ }
3451
+ }
3452
+
3453
+ /**
3454
+ * Returns whether Identify completed for a peer.
3472
3455
  */
3473
3456
  isPeerReady(peerId) /*throws*/{
3474
3457
  return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3477,10 +3460,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3477
3460
  }
3478
3461
 
3479
3462
  /**
3480
- * Returns whether the background driver is accepting work.
3481
- *
3482
- * This becomes `false` when shutdown is requested. Use
3483
- * [`P2pEndpoint::wait_stopped`] to observe complete driver exit.
3463
+ * Returns whether the driver accepts work.
3484
3464
  */
3485
3465
  isRunning() {
3486
3466
  return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
@@ -3489,97 +3469,91 @@ export class P2pEndpoint extends UniffiAbstractObject {
3489
3469
  }
3490
3470
 
3491
3471
  /**
3492
- * Returns the shared discovery address-book snapshot.
3472
+ * Returns the discovery address book.
3493
3473
  */
3494
3474
  knownPeers() /*throws*/{
3495
- return (__rb => {
3496
- try {
3497
- return FfiConverterSequenceTypeKnownPeerInfo.lift(__rb);
3498
- } finally {
3499
- nativeModule().rustbuffer_free(__rb);
3500
- }
3501
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3475
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3502
3476
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_known_peers(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3503
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3477
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3478
+ try {
3479
+ return FfiConverterSequenceTypeKnownPeerInfo.lift(__rb);
3480
+ } finally {
3481
+ nativeModule().rustbuffer_free(__rb);
3482
+ }
3504
3483
  }
3505
3484
 
3506
3485
  /**
3507
- * Returns the bound QUIC or TCP peer addresses.
3486
+ * Returns bound peer addresses.
3508
3487
  */
3509
3488
  listenAddrs() {
3510
- return (__rb => {
3511
- try {
3512
- return FfiConverterSequenceString.lift(__rb);
3513
- } finally {
3514
- nativeModule().rustbuffer_free(__rb);
3515
- }
3516
- })(uniffiCaller.rustCall(/*caller:*/callStatus => {
3489
+ const __rb = uniffiCaller.rustCall(/*caller:*/callStatus => {
3517
3490
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_listen_addrs(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3518
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3491
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3492
+ try {
3493
+ return FfiConverterSequenceString.lift(__rb);
3494
+ } finally {
3495
+ nativeModule().rustbuffer_free(__rb);
3496
+ }
3519
3497
  }
3520
3498
 
3521
3499
  /**
3522
- * Opens a negotiated application stream and returns its opaque id.
3500
+ * Opens an application stream.
3523
3501
  */
3524
3502
  openStream(peerId, protocolId) /*throws*/{
3525
- return (__rb => {
3526
- try {
3527
- return FfiConverterTypeOpenStreamResult.lift(__rb);
3528
- } finally {
3529
- nativeModule().rustbuffer_free(__rb);
3530
- }
3531
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3503
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3532
3504
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_open_stream(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc), FfiConverterString.lower(protocolId, nativeModule().rustbuffer_alloc), callStatus);
3533
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3505
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3506
+ try {
3507
+ return FfiConverterTypeOpenStreamResult.lift(__rb);
3508
+ } finally {
3509
+ nativeModule().rustbuffer_free(__rb);
3510
+ }
3534
3511
  }
3535
3512
 
3536
3513
  /**
3537
- * Returns the current usable NAT-orchestrated path to `peer_id`.
3514
+ * Returns the current path to a peer.
3538
3515
  */
3539
3516
  path(peerId) /*throws*/{
3540
- return (__rb => {
3541
- try {
3542
- return FfiConverterOptionalTypePathKind.lift(__rb);
3543
- } finally {
3544
- nativeModule().rustbuffer_free(__rb);
3545
- }
3546
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3517
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3547
3518
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_path(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc), callStatus);
3548
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3519
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3520
+ try {
3521
+ return FfiConverterOptionalTypePathKind.lift(__rb);
3522
+ } finally {
3523
+ nativeModule().rustbuffer_free(__rb);
3524
+ }
3549
3525
  }
3550
3526
 
3551
3527
  /**
3552
- * Returns the local peer ID as legacy base58 text.
3528
+ * Returns the local peer ID.
3553
3529
  */
3554
3530
  peerId() {
3555
- return (__rb => {
3556
- try {
3557
- return FfiConverterString.lift(__rb);
3558
- } finally {
3559
- nativeModule().rustbuffer_free(__rb);
3560
- }
3561
- })(uniffiCaller.rustCall(/*caller:*/callStatus => {
3531
+ const __rb = uniffiCaller.rustCall(/*caller:*/callStatus => {
3562
3532
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_peer_id(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3563
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3533
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3534
+ try {
3535
+ return FfiConverterString.lift(__rb);
3536
+ } finally {
3537
+ nativeModule().rustbuffer_free(__rb);
3538
+ }
3564
3539
  }
3565
3540
 
3566
3541
  /**
3567
- * Returns the latest Identify snapshot for `peer_id`.
3542
+ * Returns the latest Identify snapshot.
3568
3543
  */
3569
3544
  peerInfo(peerId) /*throws*/{
3570
- return (__rb => {
3571
- try {
3572
- return FfiConverterOptionalTypeIdentifyInfo.lift(__rb);
3573
- } finally {
3574
- nativeModule().rustbuffer_free(__rb);
3575
- }
3576
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3545
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3577
3546
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_peer_info(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterString.lower(peerId, nativeModule().rustbuffer_alloc), callStatus);
3578
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3547
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3548
+ try {
3549
+ return FfiConverterOptionalTypeIdentifyInfo.lift(__rb);
3550
+ } finally {
3551
+ nativeModule().rustbuffer_free(__rb);
3552
+ }
3579
3553
  }
3580
3554
 
3581
3555
  /**
3582
- * Sends an explicit ping; completion arrives as a ping event.
3556
+ * Sends an explicit ping.
3583
3557
  */
3584
3558
  ping(peerId) /*throws*/{
3585
3559
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3588,7 +3562,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3588
3562
  }
3589
3563
 
3590
3564
  /**
3591
- * Publishes one application payload.
3565
+ * Publishes one payload.
3592
3566
  */
3593
3567
  publish(topic, data) /*throws*/{
3594
3568
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3597,22 +3571,21 @@ export class P2pEndpoint extends UniffiAbstractObject {
3597
3571
  }
3598
3572
 
3599
3573
  /**
3600
- * Returns the current AutoNAT reachability verdict.
3574
+ * Returns the current reachability verdict.
3601
3575
  */
3602
3576
  reachability() /*throws*/{
3603
- return (__rb => {
3604
- try {
3605
- return FfiConverterTypeReachability.lift(__rb);
3606
- } finally {
3607
- nativeModule().rustbuffer_free(__rb);
3608
- }
3609
- })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3577
+ const __rb = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3610
3578
  return nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_reachability(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), callStatus);
3611
- }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3579
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3580
+ try {
3581
+ return FfiConverterTypeReachability.lift(__rb);
3582
+ } finally {
3583
+ nativeModule().rustbuffer_free(__rb);
3584
+ }
3612
3585
  }
3613
3586
 
3614
3587
  /**
3615
- * Resets an application stream while retaining later close events.
3588
+ * Resets a stream.
3616
3589
  */
3617
3590
  resetStream(peerId, streamId) /*throws*/{
3618
3591
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3621,7 +3594,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3621
3594
  }
3622
3595
 
3623
3596
  /**
3624
- * Sends one byte chunk on an application stream.
3597
+ * Sends bytes on a stream.
3625
3598
  */
3626
3599
  sendStream(peerId, streamId, data) /*throws*/{
3627
3600
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
@@ -3630,7 +3603,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3630
3603
  }
3631
3604
 
3632
3605
  /**
3633
- * Selects active or idle driver polling without changing delivery semantics.
3606
+ * Selects active or idle polling.
3634
3607
  */
3635
3608
  setActive(active) {
3636
3609
  uniffiCaller.rustCall(/*caller:*/callStatus => {
@@ -3639,16 +3612,16 @@ export class P2pEndpoint extends UniffiAbstractObject {
3639
3612
  }
3640
3613
 
3641
3614
  /**
3642
- * Starts the detached background endpoint driver.
3615
+ * Starts the detached driver and registers its doorbell.
3643
3616
  */
3644
- start(listener) /*throws*/{
3617
+ start(doorbell) /*throws*/{
3645
3618
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeFfiError.lift.bind(FfiConverterTypeFfiError), /*caller:*/callStatus => {
3646
- nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_start(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterTypeP2pEventListener.lower(listener, nativeModule().rustbuffer_alloc), callStatus);
3619
+ nativeModule().ubrn_uniffi_minip2p_ffi_fn_method_p2pendpoint_start(uniffiTypeP2pEndpointObjectFactory.clonePointer(this), FfiConverterTypeP2pEventDoorbell.lower(doorbell, nativeModule().rustbuffer_alloc), callStatus);
3647
3620
  }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
3648
3621
  }
3649
3622
 
3650
3623
  /**
3651
- * Requests shutdown without waiting for an in-flight callback.
3624
+ * Requests shutdown.
3652
3625
  */
3653
3626
  stop() {
3654
3627
  uniffiCaller.rustCall(/*caller:*/callStatus => {
@@ -3675,14 +3648,7 @@ export class P2pEndpoint extends UniffiAbstractObject {
3675
3648
  }
3676
3649
 
3677
3650
  /**
3678
- * Waits up to `timeout_ms` for the endpoint to reach the stopped state.
3679
- *
3680
- * A newly created endpoint still owns bound sockets, so this returns
3681
- * `false` until `stop` releases it. For a running endpoint, `stop` only
3682
- * requests shutdown and this waits for the driver exit cleanup.
3683
- *
3684
- * Calling this from a listener callback would wait on the callback's own
3685
- * driver thread, so that case returns `false` immediately.
3651
+ * Waits for complete driver shutdown.
3686
3652
  */
3687
3653
  waitStopped(timeoutMs) {
3688
3654
  return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
@@ -3767,6 +3733,9 @@ const FfiConverterOptionalTypeRelayReservationInfo = new FfiConverterOptional(Ff
3767
3733
  // FfiConverter for Array<bigint>
3768
3734
  const FfiConverterSequenceUInt64 = new FfiConverterArray(FfiConverterUInt64);
3769
3735
 
3736
+ // FfiConverter for Array<P2pEvent>
3737
+ const FfiConverterSequenceTypeP2pEvent = new FfiConverterArray(FfiConverterTypeP2pEvent);
3738
+
3770
3739
  // FfiConverter for Array<KnownPeerInfo>
3771
3740
  const FfiConverterSequenceTypeKnownPeerInfo = new FfiConverterArray(FfiConverterTypeKnownPeerInfo);
3772
3741
 
@@ -3794,7 +3763,7 @@ function uniffiEnsureInitialized() {
3794
3763
  if (bindingsContractVersion !== scaffoldingContractVersion) {
3795
3764
  throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
3796
3765
  }
3797
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_circuit_address() !== 35059) {
3766
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_circuit_address() !== 35260) {
3798
3767
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_func_circuit_address");
3799
3768
  }
3800
3769
  if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_generate_secret_key() !== 44400) {
@@ -3803,97 +3772,100 @@ function uniffiEnsureInitialized() {
3803
3772
  if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_func_peer_id_from_secret_key() !== 8962) {
3804
3773
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_func_peer_id_from_secret_key");
3805
3774
  }
3806
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new() !== 64534) {
3775
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new() !== 8152) {
3807
3776
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_constructor_p2pendpoint_new");
3808
3777
  }
3809
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream() !== 60482) {
3778
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream() !== 2693) {
3810
3779
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_abandon_stream");
3811
3780
  }
3812
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_active_reservation() !== 46981) {
3781
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_active_reservation() !== 6405) {
3813
3782
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_active_reservation");
3814
3783
  }
3815
3784
  if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_add_protocol() !== 12280) {
3816
3785
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_add_protocol");
3817
3786
  }
3818
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_cancel_connect() !== 62501) {
3787
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_cancel_connect() !== 24195) {
3819
3788
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_cancel_connect");
3820
3789
  }
3821
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_close_stream_write() !== 26147) {
3790
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_close_stream_write() !== 17994) {
3822
3791
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_close_stream_write");
3823
3792
  }
3824
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect() !== 60427) {
3793
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect() !== 42064) {
3825
3794
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect");
3826
3795
  }
3827
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_addr() !== 27341) {
3796
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_addr() !== 56611) {
3828
3797
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_addr");
3829
3798
  }
3830
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_with_addrs() !== 44153) {
3799
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_with_addrs() !== 2062) {
3831
3800
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connect_with_addrs");
3832
3801
  }
3833
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connected_peers() !== 49290) {
3802
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_connected_peers() !== 64148) {
3834
3803
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_connected_peers");
3835
3804
  }
3836
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial() !== 47576) {
3805
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial() !== 35216) {
3837
3806
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial");
3838
3807
  }
3839
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial_ip4() !== 48021) {
3808
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial_ip4() !== 54241) {
3840
3809
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial_ip4");
3841
3810
  }
3842
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial_ip6() !== 24748) {
3811
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial_ip6() !== 3676) {
3843
3812
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_dial_ip6");
3844
3813
  }
3845
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_disconnect() !== 59922) {
3814
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_disconnect() !== 23975) {
3846
3815
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_disconnect");
3847
3816
  }
3848
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_discovery_now_ms() !== 8975) {
3817
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_discovery_now_ms() !== 14313) {
3849
3818
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_discovery_now_ms");
3850
3819
  }
3851
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_is_peer_ready() !== 1184) {
3820
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_drain_events() !== 30807) {
3821
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_drain_events");
3822
+ }
3823
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_is_peer_ready() !== 30114) {
3852
3824
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_is_peer_ready");
3853
3825
  }
3854
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_is_running() !== 42546) {
3826
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_is_running() !== 42027) {
3855
3827
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_is_running");
3856
3828
  }
3857
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_known_peers() !== 27328) {
3829
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_known_peers() !== 8123) {
3858
3830
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_known_peers");
3859
3831
  }
3860
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_listen_addrs() !== 645) {
3832
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_listen_addrs() !== 43494) {
3861
3833
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_listen_addrs");
3862
3834
  }
3863
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_open_stream() !== 18245) {
3835
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_open_stream() !== 49419) {
3864
3836
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_open_stream");
3865
3837
  }
3866
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_path() !== 58210) {
3838
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_path() !== 6891) {
3867
3839
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_path");
3868
3840
  }
3869
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_peer_id() !== 34289) {
3841
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_peer_id() !== 42474) {
3870
3842
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_peer_id");
3871
3843
  }
3872
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_peer_info() !== 2761) {
3844
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_peer_info() !== 57911) {
3873
3845
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_peer_info");
3874
3846
  }
3875
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_ping() !== 64674) {
3847
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_ping() !== 62457) {
3876
3848
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_ping");
3877
3849
  }
3878
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_publish() !== 42508) {
3850
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_publish() !== 19337) {
3879
3851
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_publish");
3880
3852
  }
3881
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reachability() !== 24757) {
3853
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reachability() !== 22554) {
3882
3854
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_reachability");
3883
3855
  }
3884
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reset_stream() !== 52801) {
3856
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_reset_stream() !== 10950) {
3885
3857
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_reset_stream");
3886
3858
  }
3887
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_send_stream() !== 28787) {
3859
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_send_stream() !== 64427) {
3888
3860
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_send_stream");
3889
3861
  }
3890
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_set_active() !== 14047) {
3862
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_set_active() !== 95) {
3891
3863
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_set_active");
3892
3864
  }
3893
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_start() !== 28557) {
3865
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_start() !== 31285) {
3894
3866
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_start");
3895
3867
  }
3896
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_stop() !== 61952) {
3868
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_stop() !== 11062) {
3897
3869
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_stop");
3898
3870
  }
3899
3871
  if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_subscribe() !== 55119) {
@@ -3902,13 +3874,13 @@ function uniffiEnsureInitialized() {
3902
3874
  if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_unsubscribe() !== 32264) {
3903
3875
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_unsubscribe");
3904
3876
  }
3905
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_wait_stopped() !== 3101) {
3877
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2pendpoint_wait_stopped() !== 14108) {
3906
3878
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2pendpoint_wait_stopped");
3907
3879
  }
3908
- if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2peventlistener_on_event() !== 45831) {
3909
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2peventlistener_on_event");
3880
+ if (nativeModule().ubrn_uniffi_minip2p_ffi_checksum_method_p2peventdoorbell_on_events_ready() !== 57338) {
3881
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_minip2p_ffi_checksum_method_p2peventdoorbell_on_events_ready");
3910
3882
  }
3911
- uniffiCallbackInterfaceP2pEventListener.register();
3883
+ uniffiCallbackInterfaceP2pEventDoorbell.register();
3912
3884
  }
3913
3885
  export default Object.freeze({
3914
3886
  initialize: uniffiEnsureInitialized,
@@ -3926,7 +3898,7 @@ export default Object.freeze({
3926
3898
  FfiConverterTypeOpenStreamResult,
3927
3899
  FfiConverterTypeP2pEndpoint,
3928
3900
  FfiConverterTypeP2pEvent,
3929
- FfiConverterTypeP2pEventListener,
3901
+ FfiConverterTypeP2pEventDoorbell,
3930
3902
  FfiConverterTypePathKind,
3931
3903
  FfiConverterTypePubsubRouter,
3932
3904
  FfiConverterTypeReachability,