@majikah/majik-key-client-tauri
v1.0.0
Published
Typed TypeScript facade over tauri-plugin-majik-key-client: all keys and account state live in Rust, this class invokes them.
Readme
@majikah/majik-key-client-tauri
TypeScript facade over tauri-plugin-majik-key-client.
import { MajikKeyClientTauri } from "@majikah/majik-key-client-tauri";
const majik = await MajikKeyClientTauri.open({
onUnlockRequested: async (accountId) => askUserForPassphrase(accountId), // null = cancelled
});
majik.getActiveAccount(); // synchronous, from the read-model
majik.on("active-account-change", ({ active }) => { /* ... */ });
await majik.createAccount({ mnemonic, passphrase, label: "Main" });
await majik.unlockAccount(id, passphrase);- Getters are synchronous (read-model refreshed after every mutation and every Rust event);
actions are async. Errors are
MajikKeyClientErrorwith.kind(e.g."unlockRequired"). - Subclass for the signature client:
class MajikSignatureClientTauri extends MajikKeyClientTauri, usethis.invoke()/this.mutate(), and pass{ plugin: "majik-signature-client", eventChannel }. contract/scenario.jsonis the wire contract (the TS test checks the facade sends exactly these args; replay the same file against the Rust plugin in your own test).npm run typecheck && npm test && npm run build
License
License: Apache-2.0 — free for personal and commercial use.
Author
Developed by Josef Elijah Fabian (Zelijah) | Majikah Solutions OPC
Developer: Josef Elijah Fabian
GitHub: https://github.com/Majikah
Project Repository: https://github.com/Majikah/majik-key-client-tauri
Technical Whitepaper: https://zenodo.org/records/23208491
Contact
- Business Email: [email protected]
- Official Website: https://www.thezelijah.world
- Majikah Ecosystem: https://majikah.solutions
