@iam-protocol/pulse-sdk 0.2.0 → 0.2.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/index.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/challenge/lissajous.ts +29 -0
- package/src/challenge/phrase.ts +34 -1
- package/src/index.ts +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -360,6 +360,11 @@ declare function loadVerificationData(): StoredVerificationData | null;
|
|
|
360
360
|
* Each phrase is 5-6 syllable pairs, forming nonsensical but speakable words.
|
|
361
361
|
*/
|
|
362
362
|
declare function generatePhrase(wordCount?: number): string;
|
|
363
|
+
/**
|
|
364
|
+
* Generate a sequence of phrases for dynamic mid-session switching.
|
|
365
|
+
* Each phrase uses a different syllable subset to prevent pre-computation.
|
|
366
|
+
*/
|
|
367
|
+
declare function generatePhraseSequence(count?: number, wordCount?: number): string[];
|
|
363
368
|
|
|
364
369
|
/**
|
|
365
370
|
* Generate Lissajous curve points for the touch tracing challenge.
|
|
@@ -386,5 +391,13 @@ declare function randomLissajousParams(): LissajousParams;
|
|
|
386
391
|
* Generate Lissajous curve points normalized to [0, 1] range.
|
|
387
392
|
*/
|
|
388
393
|
declare function generateLissajousPoints(params: LissajousParams): Point2D[];
|
|
394
|
+
/**
|
|
395
|
+
* Generate a sequence of Lissajous curves for dynamic mid-session switching.
|
|
396
|
+
* Each curve uses different parameters, preventing pre-computation.
|
|
397
|
+
*/
|
|
398
|
+
declare function generateLissajousSequence(count?: number): {
|
|
399
|
+
params: LissajousParams;
|
|
400
|
+
points: Point2D[];
|
|
401
|
+
}[];
|
|
389
402
|
|
|
390
|
-
export { type AudioCapture, type CaptureOptions, type CaptureStage, type CircuitInput, DEFAULT_CAPTURE_MS, DEFAULT_MIN_DISTANCE, DEFAULT_THRESHOLD, FINGERPRINT_BITS, type FeatureVector, type FusedFeatureVector, type IdentityState, type LissajousParams, MAX_CAPTURE_MS, MIN_CAPTURE_MS, type MotionSample, PROGRAM_IDS, type PackedFingerprint, type Point2D, type ProofResult, type PulseConfig, PulseSDK, PulseSession, type SensorData, type SolanaProof, type StageState, type StatsSummary, type StoredVerificationData, type SubmissionResult, type TBH, type TemporalFingerprint, type TouchSample, type VerificationResult, autocorrelation, bigintToBytes32, computeCommitment, condense, entropy, fetchIdentityState, fuseFeatures, generateLissajousPoints, generatePhrase, generateProof, generateSalt, generateSolanaProof, generateTBH, hammingDistance, kurtosis, loadVerificationData, mean, packBits, prepareCircuitInput, randomLissajousParams, serializeProof, simhash, skewness, storeVerificationData, submitViaRelayer, submitViaWallet, toBigEndian32, variance };
|
|
403
|
+
export { type AudioCapture, type CaptureOptions, type CaptureStage, type CircuitInput, DEFAULT_CAPTURE_MS, DEFAULT_MIN_DISTANCE, DEFAULT_THRESHOLD, FINGERPRINT_BITS, type FeatureVector, type FusedFeatureVector, type IdentityState, type LissajousParams, MAX_CAPTURE_MS, MIN_CAPTURE_MS, type MotionSample, PROGRAM_IDS, type PackedFingerprint, type Point2D, type ProofResult, type PulseConfig, PulseSDK, PulseSession, type SensorData, type SolanaProof, type StageState, type StatsSummary, type StoredVerificationData, type SubmissionResult, type TBH, type TemporalFingerprint, type TouchSample, type VerificationResult, autocorrelation, bigintToBytes32, computeCommitment, condense, entropy, fetchIdentityState, fuseFeatures, generateLissajousPoints, generateLissajousSequence, generatePhrase, generatePhraseSequence, generateProof, generateSalt, generateSolanaProof, generateTBH, hammingDistance, kurtosis, loadVerificationData, mean, packBits, prepareCircuitInput, randomLissajousParams, serializeProof, simhash, skewness, storeVerificationData, submitViaRelayer, submitViaWallet, toBigEndian32, variance };
|
package/dist/index.d.ts
CHANGED
|
@@ -360,6 +360,11 @@ declare function loadVerificationData(): StoredVerificationData | null;
|
|
|
360
360
|
* Each phrase is 5-6 syllable pairs, forming nonsensical but speakable words.
|
|
361
361
|
*/
|
|
362
362
|
declare function generatePhrase(wordCount?: number): string;
|
|
363
|
+
/**
|
|
364
|
+
* Generate a sequence of phrases for dynamic mid-session switching.
|
|
365
|
+
* Each phrase uses a different syllable subset to prevent pre-computation.
|
|
366
|
+
*/
|
|
367
|
+
declare function generatePhraseSequence(count?: number, wordCount?: number): string[];
|
|
363
368
|
|
|
364
369
|
/**
|
|
365
370
|
* Generate Lissajous curve points for the touch tracing challenge.
|
|
@@ -386,5 +391,13 @@ declare function randomLissajousParams(): LissajousParams;
|
|
|
386
391
|
* Generate Lissajous curve points normalized to [0, 1] range.
|
|
387
392
|
*/
|
|
388
393
|
declare function generateLissajousPoints(params: LissajousParams): Point2D[];
|
|
394
|
+
/**
|
|
395
|
+
* Generate a sequence of Lissajous curves for dynamic mid-session switching.
|
|
396
|
+
* Each curve uses different parameters, preventing pre-computation.
|
|
397
|
+
*/
|
|
398
|
+
declare function generateLissajousSequence(count?: number): {
|
|
399
|
+
params: LissajousParams;
|
|
400
|
+
points: Point2D[];
|
|
401
|
+
}[];
|
|
389
402
|
|
|
390
|
-
export { type AudioCapture, type CaptureOptions, type CaptureStage, type CircuitInput, DEFAULT_CAPTURE_MS, DEFAULT_MIN_DISTANCE, DEFAULT_THRESHOLD, FINGERPRINT_BITS, type FeatureVector, type FusedFeatureVector, type IdentityState, type LissajousParams, MAX_CAPTURE_MS, MIN_CAPTURE_MS, type MotionSample, PROGRAM_IDS, type PackedFingerprint, type Point2D, type ProofResult, type PulseConfig, PulseSDK, PulseSession, type SensorData, type SolanaProof, type StageState, type StatsSummary, type StoredVerificationData, type SubmissionResult, type TBH, type TemporalFingerprint, type TouchSample, type VerificationResult, autocorrelation, bigintToBytes32, computeCommitment, condense, entropy, fetchIdentityState, fuseFeatures, generateLissajousPoints, generatePhrase, generateProof, generateSalt, generateSolanaProof, generateTBH, hammingDistance, kurtosis, loadVerificationData, mean, packBits, prepareCircuitInput, randomLissajousParams, serializeProof, simhash, skewness, storeVerificationData, submitViaRelayer, submitViaWallet, toBigEndian32, variance };
|
|
403
|
+
export { type AudioCapture, type CaptureOptions, type CaptureStage, type CircuitInput, DEFAULT_CAPTURE_MS, DEFAULT_MIN_DISTANCE, DEFAULT_THRESHOLD, FINGERPRINT_BITS, type FeatureVector, type FusedFeatureVector, type IdentityState, type LissajousParams, MAX_CAPTURE_MS, MIN_CAPTURE_MS, type MotionSample, PROGRAM_IDS, type PackedFingerprint, type Point2D, type ProofResult, type PulseConfig, PulseSDK, PulseSession, type SensorData, type SolanaProof, type StageState, type StatsSummary, type StoredVerificationData, type SubmissionResult, type TBH, type TemporalFingerprint, type TouchSample, type VerificationResult, autocorrelation, bigintToBytes32, computeCommitment, condense, entropy, fetchIdentityState, fuseFeatures, generateLissajousPoints, generateLissajousSequence, generatePhrase, generatePhraseSequence, generateProof, generateSalt, generateSolanaProof, generateTBH, hammingDistance, kurtosis, loadVerificationData, mean, packBits, prepareCircuitInput, randomLissajousParams, serializeProof, simhash, skewness, storeVerificationData, submitViaRelayer, submitViaWallet, toBigEndian32, variance };
|
package/dist/index.js
CHANGED
|
@@ -12994,7 +12994,9 @@ __export(index_exports, {
|
|
|
12994
12994
|
fetchIdentityState: () => fetchIdentityState,
|
|
12995
12995
|
fuseFeatures: () => fuseFeatures,
|
|
12996
12996
|
generateLissajousPoints: () => generateLissajousPoints,
|
|
12997
|
+
generateLissajousSequence: () => generateLissajousSequence,
|
|
12997
12998
|
generatePhrase: () => generatePhrase,
|
|
12999
|
+
generatePhraseSequence: () => generatePhraseSequence,
|
|
12998
13000
|
generateProof: () => generateProof,
|
|
12999
13001
|
generateSalt: () => generateSalt,
|
|
13000
13002
|
generateSolanaProof: () => generateSolanaProof,
|
|
@@ -14191,6 +14193,28 @@ function generatePhrase(wordCount = 5) {
|
|
|
14191
14193
|
}
|
|
14192
14194
|
return words.join(" ");
|
|
14193
14195
|
}
|
|
14196
|
+
function generatePhraseSequence(count = 3, wordCount = 4) {
|
|
14197
|
+
const subsetSize = Math.floor(SYLLABLES.length / count);
|
|
14198
|
+
const phrases = [];
|
|
14199
|
+
for (let p = 0; p < count; p++) {
|
|
14200
|
+
const start = p * subsetSize % SYLLABLES.length;
|
|
14201
|
+
const subset = [
|
|
14202
|
+
...SYLLABLES.slice(start, start + subsetSize),
|
|
14203
|
+
...SYLLABLES.slice(0, Math.max(0, start + subsetSize - SYLLABLES.length))
|
|
14204
|
+
];
|
|
14205
|
+
const words = [];
|
|
14206
|
+
for (let w = 0; w < wordCount; w++) {
|
|
14207
|
+
const syllableCount = 2 + Math.floor(Math.random() * 2);
|
|
14208
|
+
let word = "";
|
|
14209
|
+
for (let s = 0; s < syllableCount; s++) {
|
|
14210
|
+
word += subset[Math.floor(Math.random() * subset.length)];
|
|
14211
|
+
}
|
|
14212
|
+
words.push(word);
|
|
14213
|
+
}
|
|
14214
|
+
phrases.push(words.join(" "));
|
|
14215
|
+
}
|
|
14216
|
+
return phrases;
|
|
14217
|
+
}
|
|
14194
14218
|
|
|
14195
14219
|
// src/challenge/lissajous.ts
|
|
14196
14220
|
function randomLissajousParams() {
|
|
@@ -14221,6 +14245,33 @@ function generateLissajousPoints(params) {
|
|
|
14221
14245
|
}
|
|
14222
14246
|
return result;
|
|
14223
14247
|
}
|
|
14248
|
+
function generateLissajousSequence(count = 2) {
|
|
14249
|
+
const allRatios = [
|
|
14250
|
+
[1, 2],
|
|
14251
|
+
[2, 3],
|
|
14252
|
+
[3, 4],
|
|
14253
|
+
[3, 5],
|
|
14254
|
+
[4, 5],
|
|
14255
|
+
[1, 3],
|
|
14256
|
+
[2, 5],
|
|
14257
|
+
[5, 6],
|
|
14258
|
+
[3, 7],
|
|
14259
|
+
[4, 7]
|
|
14260
|
+
];
|
|
14261
|
+
const shuffled = [...allRatios].sort(() => Math.random() - 0.5);
|
|
14262
|
+
const sequence = [];
|
|
14263
|
+
for (let i = 0; i < count; i++) {
|
|
14264
|
+
const pair = shuffled[i % shuffled.length];
|
|
14265
|
+
const params = {
|
|
14266
|
+
a: pair[0],
|
|
14267
|
+
b: pair[1],
|
|
14268
|
+
delta: Math.PI * (0.1 + Math.random() * 0.8),
|
|
14269
|
+
points: 200
|
|
14270
|
+
};
|
|
14271
|
+
sequence.push({ params, points: generateLissajousPoints(params) });
|
|
14272
|
+
}
|
|
14273
|
+
return sequence;
|
|
14274
|
+
}
|
|
14224
14275
|
// Annotate the CommonJS export names for ESM import in node:
|
|
14225
14276
|
0 && (module.exports = {
|
|
14226
14277
|
DEFAULT_CAPTURE_MS,
|
|
@@ -14240,7 +14291,9 @@ function generateLissajousPoints(params) {
|
|
|
14240
14291
|
fetchIdentityState,
|
|
14241
14292
|
fuseFeatures,
|
|
14242
14293
|
generateLissajousPoints,
|
|
14294
|
+
generateLissajousSequence,
|
|
14243
14295
|
generatePhrase,
|
|
14296
|
+
generatePhraseSequence,
|
|
14244
14297
|
generateProof,
|
|
14245
14298
|
generateSalt,
|
|
14246
14299
|
generateSolanaProof,
|