@prosopo/account 2.7.43 → 2.8.35
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/.turbo/turbo-build$colon$cjs.log +35 -9
- package/.turbo/turbo-build$colon$tsc.log +76 -0
- package/.turbo/turbo-build.log +40 -10
- package/CHANGELOG.md +385 -0
- package/dist/cjs/extension/ExtensionWeb2.cjs +14 -6
- package/dist/cjs/workers/CryptoWorkerManager.cjs +156 -0
- package/dist/cjs/workers/cryptoWorker.cjs +27 -0
- package/dist/extension/Extension.d.ts +5 -0
- package/dist/extension/Extension.d.ts.map +1 -0
- package/dist/extension/Extension.js.map +1 -0
- package/dist/extension/ExtensionWeb2.d.ts +9 -0
- package/dist/extension/ExtensionWeb2.d.ts.map +1 -0
- package/dist/extension/ExtensionWeb2.js +15 -7
- package/dist/extension/ExtensionWeb2.js.map +1 -0
- package/dist/extension/ExtensionWeb3.d.ts +7 -0
- package/dist/extension/ExtensionWeb3.d.ts.map +1 -0
- package/dist/extension/ExtensionWeb3.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/workers/CryptoWorkerManager.d.ts +13 -0
- package/dist/workers/CryptoWorkerManager.d.ts.map +1 -0
- package/dist/workers/CryptoWorkerManager.js +156 -0
- package/dist/workers/CryptoWorkerManager.js.map +1 -0
- package/dist/workers/cryptoWorker.d.ts +2 -0
- package/dist/workers/cryptoWorker.d.ts.map +1 -0
- package/dist/workers/cryptoWorker.js +28 -0
- package/dist/workers/cryptoWorker.js.map +1 -0
- package/dist/workers/index.d.ts +2 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +2 -0
- package/dist/workers/index.js.map +1 -0
- package/package.json +13 -11
- package/src/custom.d.ts +44 -0
- package/src/extension/Extension.ts +29 -0
- package/src/extension/ExtensionWeb2.ts +121 -0
- package/src/extension/ExtensionWeb3.ts +60 -0
- package/src/index.ts +16 -0
- package/src/workers/CryptoWorkerManager.ts +225 -0
- package/src/workers/cryptoWorker.ts +79 -0
- package/src/workers/index.ts +18 -0
- package/tsconfig.cjs.json +37 -0
- package/tsconfig.json +40 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsconfig.types.json +9 -0
- package/vite.cjs.config.ts +1 -1
- package/vite.esm.config.ts +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cryptoWorker = require("./cryptoWorker.cjs");
|
|
4
|
+
class CryptoWorkerManager {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.worker = null;
|
|
7
|
+
this.isInitializing = false;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the worker
|
|
11
|
+
*/
|
|
12
|
+
async initWorker() {
|
|
13
|
+
if (this.worker || this.isInitializing) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
this.isInitializing = true;
|
|
17
|
+
try {
|
|
18
|
+
this.worker = new cryptoWorker({ type: "module" });
|
|
19
|
+
this.worker.onerror = (errorEvent) => {
|
|
20
|
+
this.cleanup();
|
|
21
|
+
};
|
|
22
|
+
await this.testWorker();
|
|
23
|
+
} catch (error) {
|
|
24
|
+
this.cleanup();
|
|
25
|
+
throw error;
|
|
26
|
+
} finally {
|
|
27
|
+
if (!this.worker) {
|
|
28
|
+
this.isInitializing = false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Test if the worker is functioning properly
|
|
34
|
+
*/
|
|
35
|
+
async testWorker() {
|
|
36
|
+
if (!this.worker) {
|
|
37
|
+
throw new Error("Worker not initialized");
|
|
38
|
+
}
|
|
39
|
+
const worker = this.worker;
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const testTimeout = setTimeout(() => {
|
|
42
|
+
worker.removeEventListener("message", handleMessage);
|
|
43
|
+
worker.removeEventListener("error", handleError);
|
|
44
|
+
reject(new Error("Worker test timeout"));
|
|
45
|
+
}, 5e3);
|
|
46
|
+
const handleMessage = (event) => {
|
|
47
|
+
const { taskId, error, result } = event.data;
|
|
48
|
+
if (taskId === "test") {
|
|
49
|
+
clearTimeout(testTimeout);
|
|
50
|
+
worker.removeEventListener("message", handleMessage);
|
|
51
|
+
worker.removeEventListener("error", handleError);
|
|
52
|
+
if (error || result !== "ready") {
|
|
53
|
+
reject(
|
|
54
|
+
new Error(
|
|
55
|
+
`Worker test failed: ${error || 'Did not return "ready"'}`
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
} else {
|
|
59
|
+
resolve();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const handleError = (error) => {
|
|
64
|
+
clearTimeout(testTimeout);
|
|
65
|
+
worker.removeEventListener("message", handleMessage);
|
|
66
|
+
worker.removeEventListener("error", handleError);
|
|
67
|
+
reject(
|
|
68
|
+
new Error(`Worker test failed with error event: ${error.message}`)
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
worker.addEventListener("message", handleMessage);
|
|
72
|
+
worker.addEventListener("error", handleError);
|
|
73
|
+
worker.postMessage({ taskId: "test", task: "test", data: {} });
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Eagerly spawn the worker so the first runTask() doesn't pay the
|
|
78
|
+
* worker-spawn + module-parse cost. Failures are swallowed because
|
|
79
|
+
* runTask() will reattempt initWorker() on demand.
|
|
80
|
+
*/
|
|
81
|
+
prewarm() {
|
|
82
|
+
this.initWorker().catch(() => {
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Run a task in the Web Worker
|
|
87
|
+
*/
|
|
88
|
+
async runTask(task, data) {
|
|
89
|
+
await this.initWorker();
|
|
90
|
+
if (!this.worker) {
|
|
91
|
+
throw new Error("Failed to initialize worker");
|
|
92
|
+
}
|
|
93
|
+
const worker = this.worker;
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
const taskId = Math.random().toString(36).substr(2, 9);
|
|
96
|
+
const timeoutId = setTimeout(() => {
|
|
97
|
+
worker.removeEventListener("message", handleMessage);
|
|
98
|
+
worker.removeEventListener("error", handleError);
|
|
99
|
+
reject(new Error(`Worker task ${task} timeout (Task ID: ${taskId})`));
|
|
100
|
+
}, 1e4);
|
|
101
|
+
const handleMessage = (event) => {
|
|
102
|
+
if (event.data.taskId === taskId) {
|
|
103
|
+
clearTimeout(timeoutId);
|
|
104
|
+
worker.removeEventListener("message", handleMessage);
|
|
105
|
+
worker.removeEventListener("error", handleError);
|
|
106
|
+
if (event.data.error) {
|
|
107
|
+
reject(new Error(`Worker task failed: ${event.data.error}`));
|
|
108
|
+
} else {
|
|
109
|
+
resolve(event.data.result);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const handleError = (error) => {
|
|
114
|
+
clearTimeout(timeoutId);
|
|
115
|
+
worker.removeEventListener("message", handleMessage);
|
|
116
|
+
worker.removeEventListener("error", handleError);
|
|
117
|
+
reject(new Error(`Worker error during task: ${error.message}`));
|
|
118
|
+
};
|
|
119
|
+
worker.addEventListener("message", handleMessage);
|
|
120
|
+
worker.addEventListener("error", handleError);
|
|
121
|
+
const message = { taskId, task, data };
|
|
122
|
+
worker.postMessage(message);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Convert entropy to mnemonic using Web Worker
|
|
127
|
+
*/
|
|
128
|
+
async entropyToMnemonic(entropy) {
|
|
129
|
+
return this.runTask("entropyToMnemonic", { entropy });
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Clean up worker resources
|
|
133
|
+
*/
|
|
134
|
+
cleanup() {
|
|
135
|
+
if (this.worker) {
|
|
136
|
+
this.worker.terminate();
|
|
137
|
+
}
|
|
138
|
+
this.worker = null;
|
|
139
|
+
this.isInitializing = false;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Public dispose method
|
|
143
|
+
*/
|
|
144
|
+
dispose() {
|
|
145
|
+
this.cleanup();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let workerManagerInstance = null;
|
|
149
|
+
function getCryptoWorkerManager() {
|
|
150
|
+
if (!workerManagerInstance) {
|
|
151
|
+
workerManagerInstance = new CryptoWorkerManager();
|
|
152
|
+
}
|
|
153
|
+
return workerManagerInstance;
|
|
154
|
+
}
|
|
155
|
+
exports.CryptoWorkerManager = CryptoWorkerManager;
|
|
156
|
+
exports.getCryptoWorkerManager = getCryptoWorkerManager;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsContent = '(function(){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function b(t,...e){if(!A(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function k(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function E(t,e){b(t);const a=e.outputLen;if(t.length<a)throw new Error("digestInto() expects output buffer of length at least "+a)}function y(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function w(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function d(t,e){return t<<32-e|t>>>e}function U(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function x(t){return typeof t=="string"&&(t=U(t)),b(t),t}class q{}function B(t){const e=r=>t().update(x(r)).digest(),a=t();return e.outputLen=a.outputLen,e.blockLen=a.blockLen,e.create=()=>t(),e}function L(t,e,a,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,a,r);const o=BigInt(32),n=BigInt(4294967295),i=Number(a>>o&n),l=Number(a&n),c=r?4:0,u=r?0:4;t.setUint32(e+c,i,r),t.setUint32(e+u,l,r)}function I(t,e,a){return t&e^~t&a}function H(t,e,a){return t&e^t&a^e&a}class T extends q{constructor(e,a,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=a,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(e),this.view=w(this.buffer)}update(e){k(this),e=x(e),b(e);const{view:a,buffer:r,blockLen:o}=this,n=e.length;for(let i=0;i<n;){const l=Math.min(o-this.pos,n-i);if(l===o){const c=w(e);for(;o<=n-i;i+=o)this.process(c,i);continue}r.set(e.subarray(i,i+l),this.pos),this.pos+=l,i+=l,this.pos===o&&(this.process(a,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){k(this),E(e,this),this.finished=!0;const{buffer:a,view:r,blockLen:o,isLE:n}=this;let{pos:i}=this;a[i++]=128,y(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let s=i;s<o;s++)a[s]=0;L(r,o-8,BigInt(this.length*8),n),this.process(r,0);const l=w(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,m=this.get();if(u>m.length)throw new Error("_sha2: outputLen bigger than state");for(let s=0;s<u;s++)l.setUint32(4*s,m[s],n)}digest(){const{buffer:e,outputLen:a}=this;this.digestInto(e);const r=e.slice(0,a);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:a,buffer:r,length:o,finished:n,destroyed:i,pos:l}=this;return e.destroyed=i,e.finished=n,e.length=o,e.pos=l,o%a&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const h=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),p=new Uint32Array(64);class D extends T{constructor(e=32){super(64,e,8,!1),this.A=h[0]|0,this.B=h[1]|0,this.C=h[2]|0,this.D=h[3]|0,this.E=h[4]|0,this.F=h[5]|0,this.G=h[6]|0,this.H=h[7]|0}get(){const{A:e,B:a,C:r,D:o,E:n,F:i,G:l,H:c}=this;return[e,a,r,o,n,i,l,c]}set(e,a,r,o,n,i,l,c){this.A=e|0,this.B=a|0,this.C=r|0,this.D=o|0,this.E=n|0,this.F=i|0,this.G=l|0,this.H=c|0}process(e,a){for(let s=0;s<16;s++,a+=4)p[s]=e.getUint32(a,!1);for(let s=16;s<64;s++){const g=p[s-15],f=p[s-2],z=d(g,7)^d(g,18)^g>>>3,v=d(f,17)^d(f,19)^f>>>10;p[s]=v+p[s-7]+z+p[s-16]|0}let{A:r,B:o,C:n,D:i,E:l,F:c,G:u,H:m}=this;for(let s=0;s<64;s++){const g=d(l,6)^d(l,11)^d(l,25),f=m+g+I(l,c,u)+_[s]+p[s]|0,v=(d(r,2)^d(r,13)^d(r,22))+H(r,o,n)|0;m=u,u=c,c=l,l=i+f|0,i=n,n=o,o=r,r=f+v|0}r=r+this.A|0,o=o+this.B|0,n=n+this.C|0,i=i+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,m=m+this.H|0,this.set(r,o,n,i,l,c,u,m)}roundClean(){y(p)}destroy(){this.set(0,0,0,0,0,0,0,0),y(this.buffer)}}const C={256:B(()=>new D)}[256],M="abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split("|"),F="Invalid entropy";function S(t){return Number.parseInt(t,2)}function j(t){return t.map(e=>e.toString(2).padStart(8,"0")).join("")}function V(t){return j(Array.from(C(t))).slice(0,t.length*8/32)}function $(t,e=M){if(t.length%4!==0||t.length<16||t.length>32)throw new Error(F);const r=`${j(Array.from(t))}${V(t)}`.match(/(.{1,11})/g)?.map(o=>e[S(o)]);if(!r||r.length<12)throw new Error("Unable to map entropy to mnemonic");return r.join(" ")}self.addEventListener("message",async t=>{const{taskId:e,task:a,data:r}=t.data;try{let o;switch(a){case"test":o="ready";break;case"entropyToMnemonic":if(!r.entropy)throw new Error("Entropy data is required");o=await G(r.entropy);break;default:throw new Error(`Unknown task: ${a}`)}const n={taskId:e,result:o};self.postMessage(n)}catch(o){const n={taskId:e,error:o instanceof Error?o.message:"Unknown error"};self.postMessage(n)}});async function G(t){try{return $(t)}catch(e){throw new Error(`Failed to process entropy: ${e instanceof Error?e.message:"Unknown error"}`)}}})();\n';
|
|
3
|
+
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
|
|
4
|
+
function WorkerWrapper(options) {
|
|
5
|
+
let objURL;
|
|
6
|
+
try {
|
|
7
|
+
objURL = blob && (self.URL || self.webkitURL).createObjectURL(blob);
|
|
8
|
+
if (!objURL) throw "";
|
|
9
|
+
const worker = new Worker(objURL, {
|
|
10
|
+
name: options?.name
|
|
11
|
+
});
|
|
12
|
+
worker.addEventListener("error", () => {
|
|
13
|
+
(self.URL || self.webkitURL).revokeObjectURL(objURL);
|
|
14
|
+
});
|
|
15
|
+
return worker;
|
|
16
|
+
} catch (e) {
|
|
17
|
+
return new Worker(
|
|
18
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(jsContent),
|
|
19
|
+
{
|
|
20
|
+
name: options?.name
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
} finally {
|
|
24
|
+
objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
module.exports = WorkerWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Extension.d.ts","sourceRoot":"","sources":["../../src/extension/Extension.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAK5E,8BAAsB,SAAS;aAOd,UAAU,CACzB,MAAM,EAAE,4BAA4B,GAClC,OAAO,CAAC,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Extension.js","sourceRoot":"","sources":["../../src/extension/Extension.ts"],"names":[],"mappings":"AAkBA,MAAM,OAAgB,SAAS;CAU9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Account, ProcaptchaClientConfigOutput } from "@prosopo/types";
|
|
2
|
+
import { Extension } from "./Extension.js";
|
|
3
|
+
export declare class ExtensionWeb2 extends Extension {
|
|
4
|
+
getAccount(config: ProcaptchaClientConfigOutput): Promise<Account>;
|
|
5
|
+
private createExtension;
|
|
6
|
+
private createAccount;
|
|
7
|
+
}
|
|
8
|
+
export default ExtensionWeb2;
|
|
9
|
+
//# sourceMappingURL=ExtensionWeb2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionWeb2.d.ts","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAa3C,qBAAa,aAAc,SAAQ,SAAS;IAC9B,UAAU,CACtB,MAAM,EAAE,4BAA4B,GAClC,OAAO,CAAC,OAAO,CAAC;IAUnB,OAAO,CAAC,eAAe;YAiCT,aAAa;CAiC3B;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import Signer from "@polkadot/extension-base/page/Signer";
|
|
1
2
|
import { stringToU8a } from "@polkadot/util";
|
|
2
|
-
import { getFingerprint } from "@prosopo/fingerprint";
|
|
3
|
+
import { prefetchFingerprint, getFingerprint } from "@prosopo/fingerprint";
|
|
3
4
|
import { Keyring } from "@prosopo/keyring";
|
|
4
5
|
import { u8aToHex, version } from "@prosopo/util";
|
|
5
6
|
import { hexHash } from "@prosopo/util-crypto";
|
|
7
|
+
import { getCryptoWorkerManager } from "../workers/CryptoWorkerManager.js";
|
|
6
8
|
import { Extension } from "./Extension.js";
|
|
7
|
-
|
|
9
|
+
prefetchFingerprint();
|
|
10
|
+
getCryptoWorkerManager().prewarm();
|
|
8
11
|
const EntropyToMnemonicLoader = async () => (await import("@prosopo/util-crypto")).entropyToMnemonic;
|
|
9
12
|
class ExtensionWeb2 extends Extension {
|
|
10
13
|
async getAccount(config) {
|
|
11
14
|
const account = await this.createAccount(config);
|
|
12
|
-
const extension =
|
|
15
|
+
const extension = this.createExtension(account);
|
|
13
16
|
return {
|
|
14
17
|
account,
|
|
15
18
|
extension
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
const Signer = await SignerLoader();
|
|
21
|
+
createExtension(account) {
|
|
20
22
|
const signer = new Signer(async () => {
|
|
21
23
|
return;
|
|
22
24
|
});
|
|
@@ -48,8 +50,14 @@ class ExtensionWeb2 extends Extension {
|
|
|
48
50
|
const browserEntropy = await getFingerprint();
|
|
49
51
|
const entropy = hexHash(browserEntropy, 128).slice(2);
|
|
50
52
|
const u8Entropy = stringToU8a(entropy);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
let mnemonic;
|
|
54
|
+
try {
|
|
55
|
+
const workerManager = getCryptoWorkerManager();
|
|
56
|
+
mnemonic = await workerManager.entropyToMnemonic(u8Entropy);
|
|
57
|
+
} catch (workerError) {
|
|
58
|
+
const entropyToMnemonic = await EntropyToMnemonicLoader();
|
|
59
|
+
mnemonic = entropyToMnemonic(u8Entropy);
|
|
60
|
+
}
|
|
53
61
|
const type = "sr25519";
|
|
54
62
|
const keyring = new Keyring({
|
|
55
63
|
type
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionWeb2.js","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAcA,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,mBAAmB,EAAE,CAAC;AACtB,sBAAsB,EAAE,CAAC,OAAO,EAAE,CAAC;AAEnC,MAAM,uBAAuB,GAAG,KAAK,IAAI,EAAE,CAC1C,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAO1D,MAAM,OAAO,aAAc,SAAQ,SA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,CAAC;YAC/C,QAAQ,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,WAAW,EAAE,CAAC;YACtB,MAAM,iBAAiB,GAAG,MAAM,uBAAuB,EAAE,CAAC;YAC1D,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,IAAI,GAAgB,SAAS,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;YAC3B,IAAI;SACJ,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,OAAO;YACN,OAAO;YACP,IAAI,EAAE,OAAO;YACb,OAAO;SACP,CAAC;IACH,CAAC;CACD;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Account, ProcaptchaClientConfigOutput } from "@prosopo/types";
|
|
2
|
+
import { Extension } from "./Extension.js";
|
|
3
|
+
export declare class ExtensionWeb3 extends Extension {
|
|
4
|
+
getAccount(config: ProcaptchaClientConfigOutput): Promise<Account>;
|
|
5
|
+
}
|
|
6
|
+
export default ExtensionWeb3;
|
|
7
|
+
//# sourceMappingURL=ExtensionWeb3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionWeb3.d.ts","sourceRoot":"","sources":["../../src/extension/ExtensionWeb3.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,qBAAa,aAAc,SAAQ,SAAS;IAC9B,UAAU,CACtB,MAAM,EAAE,4BAA4B,GAClC,OAAO,CAAC,OAAO,CAAC;CA8BnB;AAED,eAAe,aAAa,CA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A0B,EAAE;YAClD,OAAO,EAAE,EAAE,KAAK,EAAE,6BAA6B,OAAO,EAAE,EAAE;SAC1D,CAAC,CAAC;IACJ,CAAC;CACD;AAED,eAAe,aAAa,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class CryptoWorkerManager {
|
|
2
|
+
private worker;
|
|
3
|
+
private isInitializing;
|
|
4
|
+
private initWorker;
|
|
5
|
+
private testWorker;
|
|
6
|
+
prewarm(): void;
|
|
7
|
+
runTask<T>(task: string, data: Record<string, string | Uint8Array>): Promise<T>;
|
|
8
|
+
entropyToMnemonic(entropy: Uint8Array): Promise<string>;
|
|
9
|
+
private cleanup;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function getCryptoWorkerManager(): CryptoWorkerManager;
|
|
13
|
+
//# sourceMappingURL=CryptoWorkerManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CryptoWorkerManager.d.ts","sourceRoot":"","sources":["../../src/workers/CryptoWorkerManager.ts"],"names":[],"mappings":"AA+BA,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,cAAc,CAAS;YAKjB,UAAU;YAkCV,UAAU;IAwDxB,OAAO,IAAI,IAAI;IAOT,OAAO,CAAC,CAAC,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,GACvC,OAAO,CAAC,CAAC,CAAC;IAoDP,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAO7D,OAAO,CAAC,OAAO;IAWR,OAAO,IAAI,IAAI;CAGtB;AAQD,wBAAgB,sBAAsB,IAAI,mBAAmB,CAK5D"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import WorkerWrapper from "./cryptoWorker.js";
|
|
2
|
+
class CryptoWorkerManager {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.worker = null;
|
|
5
|
+
this.isInitializing = false;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the worker
|
|
9
|
+
*/
|
|
10
|
+
async initWorker() {
|
|
11
|
+
if (this.worker || this.isInitializing) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.isInitializing = true;
|
|
15
|
+
try {
|
|
16
|
+
this.worker = new WorkerWrapper({ type: "module" });
|
|
17
|
+
this.worker.onerror = (errorEvent) => {
|
|
18
|
+
this.cleanup();
|
|
19
|
+
};
|
|
20
|
+
await this.testWorker();
|
|
21
|
+
} catch (error) {
|
|
22
|
+
this.cleanup();
|
|
23
|
+
throw error;
|
|
24
|
+
} finally {
|
|
25
|
+
if (!this.worker) {
|
|
26
|
+
this.isInitializing = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Test if the worker is functioning properly
|
|
32
|
+
*/
|
|
33
|
+
async testWorker() {
|
|
34
|
+
if (!this.worker) {
|
|
35
|
+
throw new Error("Worker not initialized");
|
|
36
|
+
}
|
|
37
|
+
const worker = this.worker;
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
const testTimeout = setTimeout(() => {
|
|
40
|
+
worker.removeEventListener("message", handleMessage);
|
|
41
|
+
worker.removeEventListener("error", handleError);
|
|
42
|
+
reject(new Error("Worker test timeout"));
|
|
43
|
+
}, 5e3);
|
|
44
|
+
const handleMessage = (event) => {
|
|
45
|
+
const { taskId, error, result } = event.data;
|
|
46
|
+
if (taskId === "test") {
|
|
47
|
+
clearTimeout(testTimeout);
|
|
48
|
+
worker.removeEventListener("message", handleMessage);
|
|
49
|
+
worker.removeEventListener("error", handleError);
|
|
50
|
+
if (error || result !== "ready") {
|
|
51
|
+
reject(
|
|
52
|
+
new Error(
|
|
53
|
+
`Worker test failed: ${error || 'Did not return "ready"'}`
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
} else {
|
|
57
|
+
resolve();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const handleError = (error) => {
|
|
62
|
+
clearTimeout(testTimeout);
|
|
63
|
+
worker.removeEventListener("message", handleMessage);
|
|
64
|
+
worker.removeEventListener("error", handleError);
|
|
65
|
+
reject(
|
|
66
|
+
new Error(`Worker test failed with error event: ${error.message}`)
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
worker.addEventListener("message", handleMessage);
|
|
70
|
+
worker.addEventListener("error", handleError);
|
|
71
|
+
worker.postMessage({ taskId: "test", task: "test", data: {} });
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Eagerly spawn the worker so the first runTask() doesn't pay the
|
|
76
|
+
* worker-spawn + module-parse cost. Failures are swallowed because
|
|
77
|
+
* runTask() will reattempt initWorker() on demand.
|
|
78
|
+
*/
|
|
79
|
+
prewarm() {
|
|
80
|
+
this.initWorker().catch(() => {
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Run a task in the Web Worker
|
|
85
|
+
*/
|
|
86
|
+
async runTask(task, data) {
|
|
87
|
+
await this.initWorker();
|
|
88
|
+
if (!this.worker) {
|
|
89
|
+
throw new Error("Failed to initialize worker");
|
|
90
|
+
}
|
|
91
|
+
const worker = this.worker;
|
|
92
|
+
return new Promise((resolve, reject) => {
|
|
93
|
+
const taskId = Math.random().toString(36).substr(2, 9);
|
|
94
|
+
const timeoutId = setTimeout(() => {
|
|
95
|
+
worker.removeEventListener("message", handleMessage);
|
|
96
|
+
worker.removeEventListener("error", handleError);
|
|
97
|
+
reject(new Error(`Worker task ${task} timeout (Task ID: ${taskId})`));
|
|
98
|
+
}, 1e4);
|
|
99
|
+
const handleMessage = (event) => {
|
|
100
|
+
if (event.data.taskId === taskId) {
|
|
101
|
+
clearTimeout(timeoutId);
|
|
102
|
+
worker.removeEventListener("message", handleMessage);
|
|
103
|
+
worker.removeEventListener("error", handleError);
|
|
104
|
+
if (event.data.error) {
|
|
105
|
+
reject(new Error(`Worker task failed: ${event.data.error}`));
|
|
106
|
+
} else {
|
|
107
|
+
resolve(event.data.result);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const handleError = (error) => {
|
|
112
|
+
clearTimeout(timeoutId);
|
|
113
|
+
worker.removeEventListener("message", handleMessage);
|
|
114
|
+
worker.removeEventListener("error", handleError);
|
|
115
|
+
reject(new Error(`Worker error during task: ${error.message}`));
|
|
116
|
+
};
|
|
117
|
+
worker.addEventListener("message", handleMessage);
|
|
118
|
+
worker.addEventListener("error", handleError);
|
|
119
|
+
const message = { taskId, task, data };
|
|
120
|
+
worker.postMessage(message);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Convert entropy to mnemonic using Web Worker
|
|
125
|
+
*/
|
|
126
|
+
async entropyToMnemonic(entropy) {
|
|
127
|
+
return this.runTask("entropyToMnemonic", { entropy });
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Clean up worker resources
|
|
131
|
+
*/
|
|
132
|
+
cleanup() {
|
|
133
|
+
if (this.worker) {
|
|
134
|
+
this.worker.terminate();
|
|
135
|
+
}
|
|
136
|
+
this.worker = null;
|
|
137
|
+
this.isInitializing = false;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Public dispose method
|
|
141
|
+
*/
|
|
142
|
+
dispose() {
|
|
143
|
+
this.cleanup();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
let workerManagerInstance = null;
|
|
147
|
+
function getCryptoWorkerManager() {
|
|
148
|
+
if (!workerManagerInstance) {
|
|
149
|
+
workerManagerInstance = new CryptoWorkerManager();
|
|
150
|
+
}
|
|
151
|
+
return workerManagerInstance;
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
CryptoWorkerManager,
|
|
155
|
+
getCryptoWorkerManager
|
|
156
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CryptoWorkerManager.js","sourceRoot":"","sources":["../../src/workers/CryptoWorkerManager.ts"],"names":[],"mappings":"AAcA,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AAiBtE,MAAM,OAAO,mBAAmB;IAAhC;QACS,WAAM,GAAkB,IAAI,CAAC;QAC7B,mBAAc,GAAG,KAAK,CAAC;IAkLhC,CAAC;IA7KQ,KAAK,CAAC,UAAU;QACvB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxC,OAAO;QACR,CAAC;QAED,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAE3B,IAAI,CAAC;YACJ,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAuB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YAG9D,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,UAAsB,EAAE,EAAE;gBAEhD,IAAI,CAAC,OAAO,EAAE,CAAC;YAEhB,CAAC,CAAC;YAGF,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,MAAM,KAAK,CAAC;QACb,CAAC;gBAAS,CAAC;YAGV,IAAI,C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C,MAAM,OAAO,GAAwB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC5D,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACJ,CAAC;IAKD,KAAK,CAAC,iBAAiB,CAAC,OAAmB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAS,mBAAmB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAKO,OAAO;QACd,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC7B,CAAC;IAKM,OAAO;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;CACD;AAGD,IAAI,qBAAqB,GAA+B,IAAI,CAAC;AAK7D,MAAM,UAAU,sBAAsB;IACrC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC5B,qBAAqB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cryptoWorker.d.ts","sourceRoot":"","sources":["../../src/workers/cryptoWorker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const jsContent = '(function(){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function b(t,...e){if(!A(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function k(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function E(t,e){b(t);const a=e.outputLen;if(t.length<a)throw new Error("digestInto() expects output buffer of length at least "+a)}function y(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function w(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function d(t,e){return t<<32-e|t>>>e}function U(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function x(t){return typeof t=="string"&&(t=U(t)),b(t),t}class q{}function B(t){const e=r=>t().update(x(r)).digest(),a=t();return e.outputLen=a.outputLen,e.blockLen=a.blockLen,e.create=()=>t(),e}function L(t,e,a,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,a,r);const o=BigInt(32),n=BigInt(4294967295),i=Number(a>>o&n),l=Number(a&n),c=r?4:0,u=r?0:4;t.setUint32(e+c,i,r),t.setUint32(e+u,l,r)}function I(t,e,a){return t&e^~t&a}function H(t,e,a){return t&e^t&a^e&a}class T extends q{constructor(e,a,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=a,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(e),this.view=w(this.buffer)}update(e){k(this),e=x(e),b(e);const{view:a,buffer:r,blockLen:o}=this,n=e.length;for(let i=0;i<n;){const l=Math.min(o-this.pos,n-i);if(l===o){const c=w(e);for(;o<=n-i;i+=o)this.process(c,i);continue}r.set(e.subarray(i,i+l),this.pos),this.pos+=l,i+=l,this.pos===o&&(this.process(a,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){k(this),E(e,this),this.finished=!0;const{buffer:a,view:r,blockLen:o,isLE:n}=this;let{pos:i}=this;a[i++]=128,y(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let s=i;s<o;s++)a[s]=0;L(r,o-8,BigInt(this.length*8),n),this.process(r,0);const l=w(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,m=this.get();if(u>m.length)throw new Error("_sha2: outputLen bigger than state");for(let s=0;s<u;s++)l.setUint32(4*s,m[s],n)}digest(){const{buffer:e,outputLen:a}=this;this.digestInto(e);const r=e.slice(0,a);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:a,buffer:r,length:o,finished:n,destroyed:i,pos:l}=this;return e.destroyed=i,e.finished=n,e.length=o,e.pos=l,o%a&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const h=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),p=new Uint32Array(64);class D extends T{constructor(e=32){super(64,e,8,!1),this.A=h[0]|0,this.B=h[1]|0,this.C=h[2]|0,this.D=h[3]|0,this.E=h[4]|0,this.F=h[5]|0,this.G=h[6]|0,this.H=h[7]|0}get(){const{A:e,B:a,C:r,D:o,E:n,F:i,G:l,H:c}=this;return[e,a,r,o,n,i,l,c]}set(e,a,r,o,n,i,l,c){this.A=e|0,this.B=a|0,this.C=r|0,this.D=o|0,this.E=n|0,this.F=i|0,this.G=l|0,this.H=c|0}process(e,a){for(let s=0;s<16;s++,a+=4)p[s]=e.getUint32(a,!1);for(let s=16;s<64;s++){const g=p[s-15],f=p[s-2],z=d(g,7)^d(g,18)^g>>>3,v=d(f,17)^d(f,19)^f>>>10;p[s]=v+p[s-7]+z+p[s-16]|0}let{A:r,B:o,C:n,D:i,E:l,F:c,G:u,H:m}=this;for(let s=0;s<64;s++){const g=d(l,6)^d(l,11)^d(l,25),f=m+g+I(l,c,u)+_[s]+p[s]|0,v=(d(r,2)^d(r,13)^d(r,22))+H(r,o,n)|0;m=u,u=c,c=l,l=i+f|0,i=n,n=o,o=r,r=f+v|0}r=r+this.A|0,o=o+this.B|0,n=n+this.C|0,i=i+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,m=m+this.H|0,this.set(r,o,n,i,l,c,u,m)}roundClean(){y(p)}destroy(){this.set(0,0,0,0,0,0,0,0),y(this.buffer)}}const C={256:B(()=>new D)}[256],M="abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split("|"),F="Invalid entropy";function S(t){return Number.parseInt(t,2)}function j(t){return t.map(e=>e.toString(2).padStart(8,"0")).join("")}function V(t){return j(Array.from(C(t))).slice(0,t.length*8/32)}function $(t,e=M){if(t.length%4!==0||t.length<16||t.length>32)throw new Error(F);const r=`${j(Array.from(t))}${V(t)}`.match(/(.{1,11})/g)?.map(o=>e[S(o)]);if(!r||r.length<12)throw new Error("Unable to map entropy to mnemonic");return r.join(" ")}self.addEventListener("message",async t=>{const{taskId:e,task:a,data:r}=t.data;try{let o;switch(a){case"test":o="ready";break;case"entropyToMnemonic":if(!r.entropy)throw new Error("Entropy data is required");o=await G(r.entropy);break;default:throw new Error(`Unknown task: ${a}`)}const n={taskId:e,result:o};self.postMessage(n)}catch(o){const n={taskId:e,error:o instanceof Error?o.message:"Unknown error"};self.postMessage(n)}});async function G(t){try{return $(t)}catch(e){throw new Error(`Failed to process entropy: ${e instanceof Error?e.message:"Unknown error"}`)}}})();\n';
|
|
2
|
+
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
|
|
3
|
+
function WorkerWrapper(options) {
|
|
4
|
+
let objURL;
|
|
5
|
+
try {
|
|
6
|
+
objURL = blob && (self.URL || self.webkitURL).createObjectURL(blob);
|
|
7
|
+
if (!objURL) throw "";
|
|
8
|
+
const worker = new Worker(objURL, {
|
|
9
|
+
name: options?.name
|
|
10
|
+
});
|
|
11
|
+
worker.addEventListener("error", () => {
|
|
12
|
+
(self.URL || self.webkitURL).revokeObjectURL(objURL);
|
|
13
|
+
});
|
|
14
|
+
return worker;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return new Worker(
|
|
17
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(jsContent),
|
|
18
|
+
{
|
|
19
|
+
name: options?.name
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
} finally {
|
|
23
|
+
objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
WorkerWrapper as default
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cryptoWorker.js","sourceRoot":"","sources":["../../src/workers/cryptoWorker.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiBzD,IAAI,CAAC,gBAAgB,CACpB,SAAS,EACT,KAAK,EAAE,KAAwC,EAAE,EAAE;IAClD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAE1C,IAAI,CAAC;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ACnB,sBAAsB,GACtB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workers/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,0BAA0B,CAAC"}
|