@majikah/majik-signature-client-tauri 1.2.0 → 1.2.2

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/client.d.ts CHANGED
@@ -62,6 +62,13 @@ export declare class MajikSignatureClientTauri extends MajikKeyClientTauri {
62
62
  endSigningSession(): Promise<void>;
63
63
  forceEndSigningSession(): Promise<void>;
64
64
  isSigningSessionActive(): Promise<boolean>;
65
+ /** Resolve the account's domain-separated Majik Key Solana signer address. */
66
+ getSolanaSignerAddress(accountId?: string): Promise<string>;
67
+ /**
68
+ * Sign exact message bytes with the Majik Key Solana signer.
69
+ * Only the 64-byte signature is returned; private key material remains in Rust.
70
+ */
71
+ signSolanaMessage(message: Uint8Array, accountId?: string): Promise<Uint8Array>;
65
72
  listContacts(sortedByLabel?: boolean, majikahOnly?: boolean): Promise<SerializedMajikContact[]>;
66
73
  getContact(id: string): Promise<SerializedMajikContact | null>;
67
74
  getContactByFingerprint(fingerprint: string): Promise<SerializedMajikContact | null>;
package/dist/client.js CHANGED
@@ -126,6 +126,23 @@ export class MajikSignatureClientTauri extends MajikKeyClientTauri {
126
126
  isSigningSessionActive() {
127
127
  return this.invoke("is_signing_session_active");
128
128
  }
129
+ /** Resolve the account's domain-separated Majik Key Solana signer address. */
130
+ getSolanaSignerAddress(accountId) {
131
+ return this.invoke("get_solana_signer_address", compact({ accountId }));
132
+ }
133
+ /**
134
+ * Sign exact message bytes with the Majik Key Solana signer.
135
+ * Only the 64-byte signature is returned; private key material remains in Rust.
136
+ */
137
+ async signSolanaMessage(message, accountId) {
138
+ const signature = await this.invoke("sign_solana_message", compact({ message: Array.from(message), accountId }));
139
+ if (!Array.isArray(signature) ||
140
+ signature.length !== 64 ||
141
+ !signature.every((byte) => Number.isInteger(byte) && byte >= 0 && byte <= 255)) {
142
+ throw new Error("Rust returned an invalid Solana Ed25519 signature.");
143
+ }
144
+ return Uint8Array.from(signature);
145
+ }
129
146
  listContacts(sortedByLabel, majikahOnly) {
130
147
  return this.invoke("list_contacts", compact({ sortedByLabel, majikahOnly }));
131
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majikah/majik-signature-client-tauri",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Typed TypeScript facade over tauri-plugin-majik-signature-client. Extends the key client facade; keys, contacts, stamps, logs and signing live in Rust.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -46,4 +46,4 @@
46
46
  "typescript": "^7.0.2",
47
47
  "vitest": "^5.1.0"
48
48
  }
49
- }
49
+ }