@multitapio/multitap 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.stamp +0 -0
- package/dist/cache.d.ts +117 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/channel.d.ts +91 -0
- package/dist/channel.d.ts.map +1 -0
- package/dist/channel.worker.d.ts +3 -0
- package/dist/channel.worker.d.ts.map +1 -0
- package/dist/codegen/config.d.ts +107 -0
- package/dist/codegen/config.d.ts.map +1 -0
- package/dist/codegen/generator.d.ts +78 -0
- package/dist/codegen/generator.d.ts.map +1 -0
- package/dist/codegen/index.d.ts +13 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/inject.d.ts +51 -0
- package/dist/codegen/inject.d.ts.map +1 -0
- package/dist/codegen/rust.d.ts +22 -0
- package/dist/codegen/rust.d.ts.map +1 -0
- package/dist/codegen/typescript.d.ts +22 -0
- package/dist/codegen/typescript.d.ts.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/crypto.d.ts +141 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/debug.d.ts +39 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/diagnostics/index.d.ts +12 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics.js +5502 -0
- package/dist/e2e/cli.d.ts +2 -0
- package/dist/e2e/cli.d.ts.map +1 -0
- package/dist/executor.d.ts +130 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/globals.d.ts +32 -0
- package/dist/helpers.d.ts +3 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/input-codec.d.ts +136 -0
- package/dist/input-codec.d.ts.map +1 -0
- package/dist/input-graph.d.ts +106 -0
- package/dist/input-graph.d.ts.map +1 -0
- package/dist/lib.d.ts +10 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +9409 -0
- package/dist/messages.d.ts +63 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/peer-mesh.d.ts +77 -0
- package/dist/peer-mesh.d.ts.map +1 -0
- package/dist/react/Crosshair.d.ts +17 -0
- package/dist/react/Crosshair.d.ts.map +1 -0
- package/dist/react/Player.d.ts +10 -0
- package/dist/react/Player.d.ts.map +1 -0
- package/dist/react/PlayerPoseContext.d.ts +31 -0
- package/dist/react/PlayerPoseContext.d.ts.map +1 -0
- package/dist/react/hooks/index.d.ts +7 -0
- package/dist/react/hooks/index.d.ts.map +1 -0
- package/dist/react/hooks/useEvent.d.ts +46 -0
- package/dist/react/hooks/useEvent.d.ts.map +1 -0
- package/dist/react/hooks/useFrame.d.ts +23 -0
- package/dist/react/hooks/useFrame.d.ts.map +1 -0
- package/dist/react/hooks/usePlayers.d.ts +24 -0
- package/dist/react/hooks/usePlayers.d.ts.map +1 -0
- package/dist/react/hooks/useQuery.d.ts +41 -0
- package/dist/react/hooks/useQuery.d.ts.map +1 -0
- package/dist/react/hooks/useSession.d.ts +10 -0
- package/dist/react/hooks/useSession.d.ts.map +1 -0
- package/dist/react/index.d.ts +18 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/input/DesktopInputMapper.d.ts +38 -0
- package/dist/react/input/DesktopInputMapper.d.ts.map +1 -0
- package/dist/react/input/index.d.ts +4 -0
- package/dist/react/input/index.d.ts.map +1 -0
- package/dist/react/input/types.d.ts +46 -0
- package/dist/react/input/types.d.ts.map +1 -0
- package/dist/react/providers/SessionProvider.d.ts +17 -0
- package/dist/react/providers/SessionProvider.d.ts.map +1 -0
- package/dist/react/providers/index.d.ts +2 -0
- package/dist/react/providers/index.d.ts.map +1 -0
- package/dist/react/types/index.d.ts +2 -0
- package/dist/react/types/index.d.ts.map +1 -0
- package/dist/react/types/session.d.ts +88 -0
- package/dist/react/types/session.d.ts.map +1 -0
- package/dist/react/types.d.ts +134 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/utils/math.d.ts +19 -0
- package/dist/react/utils/math.d.ts.map +1 -0
- package/dist/react/views/AsteroidsView.d.ts +24 -0
- package/dist/react/views/AsteroidsView.d.ts.map +1 -0
- package/dist/react/views/FirstPersonView.d.ts +10 -0
- package/dist/react/views/FirstPersonView.d.ts.map +1 -0
- package/dist/react/views/IsometricView.d.ts +21 -0
- package/dist/react/views/IsometricView.d.ts.map +1 -0
- package/dist/react/views/MapView.d.ts +16 -0
- package/dist/react/views/MapView.d.ts.map +1 -0
- package/dist/react/views/MobaView.d.ts +17 -0
- package/dist/react/views/MobaView.d.ts.map +1 -0
- package/dist/react/views/SideOnView.d.ts +23 -0
- package/dist/react/views/SideOnView.d.ts.map +1 -0
- package/dist/react/views/ThirdPersonFixedView.d.ts +21 -0
- package/dist/react/views/ThirdPersonFixedView.d.ts.map +1 -0
- package/dist/react/views/ThirdPersonView.d.ts +12 -0
- package/dist/react/views/ThirdPersonView.d.ts.map +1 -0
- package/dist/react/views/TopDownFixedView.d.ts +20 -0
- package/dist/react/views/TopDownFixedView.d.ts.map +1 -0
- package/dist/react/views/TopDownView.d.ts +12 -0
- package/dist/react/views/TopDownView.d.ts.map +1 -0
- package/dist/react/views/TwinStickView.d.ts +13 -0
- package/dist/react/views/TwinStickView.d.ts.map +1 -0
- package/dist/react/views/VehicleFixedView.d.ts +16 -0
- package/dist/react/views/VehicleFixedView.d.ts.map +1 -0
- package/dist/react/views/VehicleView.d.ts +13 -0
- package/dist/react/views/VehicleView.d.ts.map +1 -0
- package/dist/react/views/index.d.ts +21 -0
- package/dist/react/views/index.d.ts.map +1 -0
- package/dist/react/views/types.d.ts +136 -0
- package/dist/react/views/types.d.ts.map +1 -0
- package/dist/rollback.d.ts +193 -0
- package/dist/rollback.d.ts.map +1 -0
- package/dist/rollback.worker.d.ts +3 -0
- package/dist/rollback.worker.d.ts.map +1 -0
- package/dist/schema.d.ts +309 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/session-config.d.ts +119 -0
- package/dist/session-config.d.ts.map +1 -0
- package/dist/session.d.ts +120 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/state.d.ts +400 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/stats.d.ts +21 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/test-session.d.ts +170 -0
- package/dist/test-session.d.ts.map +1 -0
- package/dist/types/cache.d.ts +117 -0
- package/dist/types/cache.d.ts.map +1 -0
- package/dist/types/channel.d.ts +91 -0
- package/dist/types/channel.d.ts.map +1 -0
- package/dist/types/channel.worker.d.ts +3 -0
- package/dist/types/channel.worker.d.ts.map +1 -0
- package/dist/types/codegen/config.d.ts +107 -0
- package/dist/types/codegen/config.d.ts.map +1 -0
- package/dist/types/codegen/generator.d.ts +78 -0
- package/dist/types/codegen/generator.d.ts.map +1 -0
- package/dist/types/codegen/index.d.ts +13 -0
- package/dist/types/codegen/index.d.ts.map +1 -0
- package/dist/types/codegen/inject.d.ts +51 -0
- package/dist/types/codegen/inject.d.ts.map +1 -0
- package/dist/types/codegen/rust.d.ts +22 -0
- package/dist/types/codegen/rust.d.ts.map +1 -0
- package/dist/types/codegen/typescript.d.ts +22 -0
- package/dist/types/codegen/typescript.d.ts.map +1 -0
- package/dist/types/constants.d.ts +5 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/crypto.d.ts +141 -0
- package/dist/types/crypto.d.ts.map +1 -0
- package/dist/types/debug.d.ts +39 -0
- package/dist/types/debug.d.ts.map +1 -0
- package/dist/types/diagnostics/index.d.ts +12 -0
- package/dist/types/diagnostics/index.d.ts.map +1 -0
- package/dist/types/e2e/cli.d.ts +2 -0
- package/dist/types/e2e/cli.d.ts.map +1 -0
- package/dist/types/executor.d.ts +130 -0
- package/dist/types/executor.d.ts.map +1 -0
- package/dist/types/helpers.d.ts +3 -0
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/input-codec.d.ts +136 -0
- package/dist/types/input-codec.d.ts.map +1 -0
- package/dist/types/input-graph.d.ts +106 -0
- package/dist/types/input-graph.d.ts.map +1 -0
- package/dist/types/lib.d.ts +10 -0
- package/dist/types/lib.d.ts.map +1 -0
- package/dist/types/messages.d.ts +63 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/peer-mesh.d.ts +77 -0
- package/dist/types/peer-mesh.d.ts.map +1 -0
- package/dist/types/react/Crosshair.d.ts +17 -0
- package/dist/types/react/Crosshair.d.ts.map +1 -0
- package/dist/types/react/Player.d.ts +10 -0
- package/dist/types/react/Player.d.ts.map +1 -0
- package/dist/types/react/PlayerPoseContext.d.ts +31 -0
- package/dist/types/react/PlayerPoseContext.d.ts.map +1 -0
- package/dist/types/react/hooks/index.d.ts +7 -0
- package/dist/types/react/hooks/index.d.ts.map +1 -0
- package/dist/types/react/hooks/useEvent.d.ts +46 -0
- package/dist/types/react/hooks/useEvent.d.ts.map +1 -0
- package/dist/types/react/hooks/useFrame.d.ts +23 -0
- package/dist/types/react/hooks/useFrame.d.ts.map +1 -0
- package/dist/types/react/hooks/usePlayers.d.ts +24 -0
- package/dist/types/react/hooks/usePlayers.d.ts.map +1 -0
- package/dist/types/react/hooks/useQuery.d.ts +41 -0
- package/dist/types/react/hooks/useQuery.d.ts.map +1 -0
- package/dist/types/react/hooks/useSession.d.ts +10 -0
- package/dist/types/react/hooks/useSession.d.ts.map +1 -0
- package/dist/types/react/index.d.ts +18 -0
- package/dist/types/react/index.d.ts.map +1 -0
- package/dist/types/react/input/DesktopInputMapper.d.ts +38 -0
- package/dist/types/react/input/DesktopInputMapper.d.ts.map +1 -0
- package/dist/types/react/input/index.d.ts +4 -0
- package/dist/types/react/input/index.d.ts.map +1 -0
- package/dist/types/react/input/types.d.ts +46 -0
- package/dist/types/react/input/types.d.ts.map +1 -0
- package/dist/types/react/providers/SessionProvider.d.ts +17 -0
- package/dist/types/react/providers/SessionProvider.d.ts.map +1 -0
- package/dist/types/react/providers/index.d.ts +2 -0
- package/dist/types/react/providers/index.d.ts.map +1 -0
- package/dist/types/react/types/index.d.ts +2 -0
- package/dist/types/react/types/index.d.ts.map +1 -0
- package/dist/types/react/types/session.d.ts +88 -0
- package/dist/types/react/types/session.d.ts.map +1 -0
- package/dist/types/react/types.d.ts +134 -0
- package/dist/types/react/types.d.ts.map +1 -0
- package/dist/types/react/utils/math.d.ts +19 -0
- package/dist/types/react/utils/math.d.ts.map +1 -0
- package/dist/types/react/views/AsteroidsView.d.ts +24 -0
- package/dist/types/react/views/AsteroidsView.d.ts.map +1 -0
- package/dist/types/react/views/FirstPersonView.d.ts +10 -0
- package/dist/types/react/views/FirstPersonView.d.ts.map +1 -0
- package/dist/types/react/views/IsometricView.d.ts +21 -0
- package/dist/types/react/views/IsometricView.d.ts.map +1 -0
- package/dist/types/react/views/MapView.d.ts +16 -0
- package/dist/types/react/views/MapView.d.ts.map +1 -0
- package/dist/types/react/views/MobaView.d.ts +17 -0
- package/dist/types/react/views/MobaView.d.ts.map +1 -0
- package/dist/types/react/views/SideOnView.d.ts +23 -0
- package/dist/types/react/views/SideOnView.d.ts.map +1 -0
- package/dist/types/react/views/ThirdPersonFixedView.d.ts +21 -0
- package/dist/types/react/views/ThirdPersonFixedView.d.ts.map +1 -0
- package/dist/types/react/views/ThirdPersonView.d.ts +12 -0
- package/dist/types/react/views/ThirdPersonView.d.ts.map +1 -0
- package/dist/types/react/views/TopDownFixedView.d.ts +20 -0
- package/dist/types/react/views/TopDownFixedView.d.ts.map +1 -0
- package/dist/types/react/views/TopDownView.d.ts +12 -0
- package/dist/types/react/views/TopDownView.d.ts.map +1 -0
- package/dist/types/react/views/TwinStickView.d.ts +13 -0
- package/dist/types/react/views/TwinStickView.d.ts.map +1 -0
- package/dist/types/react/views/VehicleFixedView.d.ts +16 -0
- package/dist/types/react/views/VehicleFixedView.d.ts.map +1 -0
- package/dist/types/react/views/VehicleView.d.ts +13 -0
- package/dist/types/react/views/VehicleView.d.ts.map +1 -0
- package/dist/types/react/views/index.d.ts +21 -0
- package/dist/types/react/views/index.d.ts.map +1 -0
- package/dist/types/react/views/types.d.ts +136 -0
- package/dist/types/react/views/types.d.ts.map +1 -0
- package/dist/types/rollback.d.ts +193 -0
- package/dist/types/rollback.d.ts.map +1 -0
- package/dist/types/rollback.worker.d.ts +3 -0
- package/dist/types/rollback.worker.d.ts.map +1 -0
- package/dist/types/schema.d.ts +309 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/session-config.d.ts +119 -0
- package/dist/types/session-config.d.ts.map +1 -0
- package/dist/types/session.d.ts +120 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/state.d.ts +400 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/stats.d.ts +21 -0
- package/dist/types/stats.d.ts.map +1 -0
- package/dist/types/test-session.d.ts +170 -0
- package/dist/types/test-session.d.ts.map +1 -0
- package/dist/types/utils.d.ts +26 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/vite/codegen-runner.d.ts +27 -0
- package/dist/types/vite/codegen-runner.d.ts.map +1 -0
- package/dist/types/vite/index.d.ts +20 -0
- package/dist/types/vite/index.d.ts.map +1 -0
- package/dist/types/vite/module-builder.d.ts +28 -0
- package/dist/types/vite/module-builder.d.ts.map +1 -0
- package/dist/types/vite/plugin.d.ts +27 -0
- package/dist/types/vite/plugin.d.ts.map +1 -0
- package/dist/types/vite/types.d.ts +37 -0
- package/dist/types/vite/types.d.ts.map +1 -0
- package/dist/types/vite/wasm-compiler.d.ts +32 -0
- package/dist/types/vite/wasm-compiler.d.ts.map +1 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/vite/codegen-runner.d.ts +27 -0
- package/dist/vite/codegen-runner.d.ts.map +1 -0
- package/dist/vite/index.d.ts +20 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +4202 -0
- package/dist/vite/module-builder.d.ts +28 -0
- package/dist/vite/module-builder.d.ts.map +1 -0
- package/dist/vite/plugin.d.ts +27 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/types.d.ts +37 -0
- package/dist/vite/types.d.ts.map +1 -0
- package/dist/vite/wasm-compiler.d.ts +32 -0
- package/dist/vite/wasm-compiler.d.ts.map +1 -0
- package/package.json +92 -0
package/dist/crypto.d.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { InputData } from './messages';
|
|
2
|
+
export declare const SIGNATURE_SIZE = 65;
|
|
3
|
+
export declare const COMPRESSED_PUBKEY_SIZE = 33;
|
|
4
|
+
export declare const COMPRESSED_PUB_KEY_SIZE = 33;
|
|
5
|
+
export declare const PRIVATE_KEY_SIZE = 32;
|
|
6
|
+
export declare const HASH_SIZE = 32;
|
|
7
|
+
export declare const INPUT_HEADER_SIZE = 5;
|
|
8
|
+
export declare const GENESIS_HASH_SIZE = 16;
|
|
9
|
+
/**
|
|
10
|
+
* Generate a new secp256k1 private key.
|
|
11
|
+
* @returns 32-byte private key
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateKeyPair(): Uint8Array;
|
|
14
|
+
/**
|
|
15
|
+
* Derive the compressed public key from a private key.
|
|
16
|
+
* @param privateKey 32-byte private key
|
|
17
|
+
* @returns 33-byte compressed public key
|
|
18
|
+
*/
|
|
19
|
+
export declare function pubKeyFromPrivate(privateKey: Uint8Array): Uint8Array;
|
|
20
|
+
/**
|
|
21
|
+
* Sign a 32-byte message hash with a private key.
|
|
22
|
+
* Returns a 65-byte recoverable signature in format [r:32][s:32][v:1].
|
|
23
|
+
* @param privateKey 32-byte private key
|
|
24
|
+
* @param messageHash 32-byte message hash
|
|
25
|
+
* @returns 65-byte signature
|
|
26
|
+
*/
|
|
27
|
+
export declare function sign(privateKey: Uint8Array, messageHash: Uint8Array): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* Recover the compressed public key from a message hash and signature.
|
|
30
|
+
* @param messageHash 32-byte message hash
|
|
31
|
+
* @param signature 65-byte signature in format [r:32][s:32][v:1]
|
|
32
|
+
* @returns 33-byte compressed public key
|
|
33
|
+
*/
|
|
34
|
+
export declare function recoverPubKey(messageHash: Uint8Array, signature: Uint8Array): Uint8Array;
|
|
35
|
+
/**
|
|
36
|
+
* Verify that a signature was created by the owner of the given public key.
|
|
37
|
+
* @param pubKey 33-byte compressed public key
|
|
38
|
+
* @param messageHash 32-byte message hash
|
|
39
|
+
* @param signature 65-byte signature
|
|
40
|
+
* @returns true if valid
|
|
41
|
+
*/
|
|
42
|
+
export declare function verifySignature(pubKey: Uint8Array, messageHash: Uint8Array, signature: Uint8Array): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Compute SHA-256 hash of arbitrary data.
|
|
45
|
+
* @param data Data to hash
|
|
46
|
+
* @returns 32-byte hash
|
|
47
|
+
*/
|
|
48
|
+
export declare function hashMessage(data: Uint8Array): Uint8Array;
|
|
49
|
+
/**
|
|
50
|
+
* Compute a short truncated SHA256 hash used to shard sessions based on simulation/schema/input compatibility.
|
|
51
|
+
* Returns the first 8 bytes of SHA256(data).
|
|
52
|
+
* @param data Data to hash
|
|
53
|
+
* @returns 8-byte truncated hash
|
|
54
|
+
*/
|
|
55
|
+
export declare function sessionCompatibilityHash(data: Uint8Array): Uint8Array;
|
|
56
|
+
/**
|
|
57
|
+
* Compute a truncated SHA256 hash of a JavaScript object using deterministic CBOR encoding.
|
|
58
|
+
* This ensures cross-platform compatibility - the same object will produce the same hash
|
|
59
|
+
* in both Go and JavaScript implementations.
|
|
60
|
+
*
|
|
61
|
+
* CBOR encoding rules (RFC 8949 §4.2 Core Deterministic Encoding):
|
|
62
|
+
* - Map keys sorted by byte string length, then lexicographically
|
|
63
|
+
* - Smallest possible integer encodings
|
|
64
|
+
* - No indefinite-length encodings
|
|
65
|
+
*
|
|
66
|
+
* @param obj JavaScript object to hash (must be CBOR-serializable)
|
|
67
|
+
* @returns 8-byte truncated hash
|
|
68
|
+
*/
|
|
69
|
+
export declare function hashContent(obj: unknown): Uint8Array;
|
|
70
|
+
/**
|
|
71
|
+
* Compute the hash for signing an input message.
|
|
72
|
+
* Format: SHA256(genesisHash || targetTick || payload)
|
|
73
|
+
* @param genesisHash 16-byte genesis hash (from SessionConfig.toGenesisHash())
|
|
74
|
+
* @param targetTick Target tick number (uint32)
|
|
75
|
+
* @param payload Variable-length input payload (0-255 bytes)
|
|
76
|
+
* @returns 32-byte hash
|
|
77
|
+
*/
|
|
78
|
+
export declare function hashInputMessage(genesisHash: Uint8Array, targetTick: number, payload: Uint8Array): Uint8Array;
|
|
79
|
+
/**
|
|
80
|
+
* Compute the hash for signing a tick message.
|
|
81
|
+
* Format: SHA256(genesisHash || tickNum || inputsHash || prevTickSig)
|
|
82
|
+
* @param genesisHash 16-byte genesis hash (from SessionConfig.toGenesisHash())
|
|
83
|
+
* @param tickNum Tick number (uint32)
|
|
84
|
+
* @param inputsHash 32-byte hash of concatenated inputs
|
|
85
|
+
* @param prevTickSig 65-byte previous tick's signature
|
|
86
|
+
* @returns 32-byte hash
|
|
87
|
+
*/
|
|
88
|
+
export declare function hashTickMessage(genesisHash: Uint8Array, tickNum: number, inputsHash: Uint8Array, prevTickSig: Uint8Array): Uint8Array;
|
|
89
|
+
/**
|
|
90
|
+
* Compute a hash over all inputs in a tick.
|
|
91
|
+
* Format: SHA256(input1 || input2 || ... || inputN)
|
|
92
|
+
* where each input is: [targetTick:4][payloadLen:1][payload:0-255][signature:65]
|
|
93
|
+
* Returns zero hash if there are no inputs.
|
|
94
|
+
* @param inputs Array of input messages
|
|
95
|
+
* @returns 32-byte hash
|
|
96
|
+
*/
|
|
97
|
+
export declare function hashInputs(inputs: InputData[]): Uint8Array;
|
|
98
|
+
/**
|
|
99
|
+
* Compute a hash over ordered payloads for stateId computation.
|
|
100
|
+
* Format: SHA256(payload1 || payload2 || ... || payloadN)
|
|
101
|
+
* Returns zero hash if there are no payloads.
|
|
102
|
+
*
|
|
103
|
+
* NOTE: This is distinct from hashInputs() which hashes full input messages
|
|
104
|
+
* (including signatures) for the tick signature chain. hashPayloads() hashes
|
|
105
|
+
* only the raw payloads in participant order, for state identity caching.
|
|
106
|
+
*
|
|
107
|
+
* @param payloads Array of payload bytes, ordered by participant index
|
|
108
|
+
* @returns 32-byte hash
|
|
109
|
+
*/
|
|
110
|
+
export declare function hashPayloads(payloads: Uint8Array[]): Uint8Array;
|
|
111
|
+
/**
|
|
112
|
+
* Compute the hash for connection authentication.
|
|
113
|
+
* Format: SHA256("multitap:session:" || genesisHash || ":" || timestamp)
|
|
114
|
+
* @param genesisHash 16-byte genesis hash (from SessionConfig.toGenesisHash())
|
|
115
|
+
* @param timestampMs Timestamp in milliseconds
|
|
116
|
+
* @returns 32-byte hash
|
|
117
|
+
*/
|
|
118
|
+
export declare function hashAuthMessage(genesisHash: Uint8Array, timestampMs: number): Uint8Array;
|
|
119
|
+
/**
|
|
120
|
+
* Encode a 16-byte genesis hash to base64url (no padding).
|
|
121
|
+
* A genesis hash is the deterministic session identity from SessionConfig.toGenesisHash().
|
|
122
|
+
* @param bytes 16-byte genesis hash
|
|
123
|
+
* @returns base64url string (22 chars)
|
|
124
|
+
*/
|
|
125
|
+
export declare function genesisHashToString(bytes: Uint8Array): string;
|
|
126
|
+
/**
|
|
127
|
+
* Decode a base64url (no padding) string to a 16-byte genesis hash.
|
|
128
|
+
* Throws if the string is invalid or decodes to all zeros.
|
|
129
|
+
* @param str base64url string (22 chars)
|
|
130
|
+
* @returns 16-byte genesis hash
|
|
131
|
+
*/
|
|
132
|
+
export declare function genesisHashFromString(str: string): Uint8Array;
|
|
133
|
+
/**
|
|
134
|
+
* Convert signature to hex string for URL encoding.
|
|
135
|
+
*/
|
|
136
|
+
export declare function signatureToHex(signature: Uint8Array): string;
|
|
137
|
+
/**
|
|
138
|
+
* Parse hex string to signature bytes.
|
|
139
|
+
*/
|
|
140
|
+
export declare function hexToSignature(hex: string): Uint8Array;
|
|
141
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;;GAGG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,GAAG,UAAU,CAehF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAkBxF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAO3G;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAGrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CAIpD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAc7G;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,UAAU,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,UAAU,GACtB,UAAU,CAiBZ;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAkC1D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,CAkC/D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAkBxF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAU7D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMtD"}
|
package/dist/debug.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging utility for the multitap SDK.
|
|
3
|
+
*
|
|
4
|
+
* Wraps console.* methods with an enable/disable toggle.
|
|
5
|
+
* Disabled by default so library consumers don't see logs unless they opt-in.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { debug } from './debug';
|
|
9
|
+
* debug.warn('something happened');
|
|
10
|
+
*
|
|
11
|
+
* To enable logging (e.g., for debugging):
|
|
12
|
+
* import { setDebugEnabled } from './debug';
|
|
13
|
+
* setDebugEnabled(true);
|
|
14
|
+
*/
|
|
15
|
+
/** Enable or disable debug logging globally */
|
|
16
|
+
export declare function setDebugEnabled(value: boolean): void;
|
|
17
|
+
/** Check if debug logging is currently enabled */
|
|
18
|
+
export declare function isDebugEnabled(): boolean;
|
|
19
|
+
export declare const debug: {
|
|
20
|
+
log: (...args: unknown[]) => void;
|
|
21
|
+
warn: (...args: unknown[]) => void;
|
|
22
|
+
error: (...args: unknown[]) => void;
|
|
23
|
+
info: (...args: unknown[]) => void;
|
|
24
|
+
debug: (...args: unknown[]) => void;
|
|
25
|
+
/** Returns a group function; if disabled, returns noop */
|
|
26
|
+
group: (label?: string) => void;
|
|
27
|
+
groupEnd: () => void;
|
|
28
|
+
/** Table output for structured data */
|
|
29
|
+
table: (data: unknown) => void;
|
|
30
|
+
/** Get the underlying console method (for advanced use) */
|
|
31
|
+
readonly raw: Console | {
|
|
32
|
+
log: () => void;
|
|
33
|
+
warn: () => void;
|
|
34
|
+
error: () => void;
|
|
35
|
+
info: () => void;
|
|
36
|
+
debug: () => void;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,+CAA+C;AAC/C,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEpD;AAED,kDAAkD;AAClD,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAID,eAAO,MAAM,KAAK;mBACD,OAAO,EAAE,KAAG,IAAI;oBAGf,OAAO,EAAE,KAAG,IAAI;qBAGf,OAAO,EAAE,KAAG,IAAI;oBAGjB,OAAO,EAAE,KAAG,IAAI;qBAGf,OAAO,EAAE,KAAG,IAAI;IAGjC,0DAA0D;oBAC1C,MAAM,KAAG,IAAI;oBAGf,IAAI;IAGlB,uCAAuC;kBACzB,OAAO,KAAG,IAAI;IAG5B,2DAA2D;;;;;;;;CAI5D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostics client for e2e testing.
|
|
3
|
+
*
|
|
4
|
+
* Minimal browser client that:
|
|
5
|
+
* - Parses URL params (connectionURL, serverCertHash, relayPubKey)
|
|
6
|
+
* - Creates a Session with zero plugins (channel-only mode)
|
|
7
|
+
* - Generates random inputs on 50ms interval
|
|
8
|
+
* - Logs SYNC ticks to console for conformance testing
|
|
9
|
+
* - Exits when session duration elapses
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/diagnostics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|