chore: add wasm console demo
This commit is contained in:
13
wasm_console_demo/main.js
Normal file
13
wasm_console_demo/main.js
Normal 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('');
|
||||
Reference in New Issue
Block a user