chore: add wasm console demo

This commit is contained in:
Sameh Abouel-saad
2025-05-26 13:22:42 +03:00
parent 1e52c572d2
commit 44b4dfd6a7
14 changed files with 1138 additions and 14 deletions

13
wasm_console_demo/main.js Normal file
View File

@@ -0,0 +1,13 @@
// Minimal loader for the vault WASM module for console interaction
// Adjust the module path if needed (this assumes the default wasm-pack output in the parent dir)
import init, * as vault from './wasm_app.js';
window.vault = null;
init().then(() => {
window.vault = vault;
console.log('Vault WASM module loaded. Use window.vault.<function>() in the console.');
});
// Optional: Helper to convert Uint8Array to hex
window.toHex = arr => Array.from(new Uint8Array(arr)).map(b => b.toString(16).padStart(2, '0')).join('');