@albionlabs/chat-widget 0.2.2 → 0.2.4

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.
@@ -56,11 +56,11 @@
56
56
  }
57
57
  });
58
58
 
59
- // Auto-trigger SIWE when wallet appears and not authed
59
+ // Auto-trigger SIWE when wallet appears, not authed, and widget is open
60
60
  $effect(() => {
61
61
  const provider = $walletProvider;
62
62
  const authenticated = $auth.authenticated;
63
- if (provider && !authenticated && !signingIn && !siweDismissed) {
63
+ if (provider && !authenticated && !signingIn && !siweDismissed && isOpen) {
64
64
  handleSiweLogin();
65
65
  }
66
66
  });
@@ -121,9 +121,14 @@
121
121
  statement: 'Sign in to quant.bot'
122
122
  });
123
123
 
124
+ // personal_sign expects hex-encoded data per EIP-191
125
+ const hexMessage = '0x' + Array.from(new TextEncoder().encode(message))
126
+ .map((b) => b.toString(16).padStart(2, '0'))
127
+ .join('');
128
+
124
129
  const signature = await provider.request({
125
130
  method: 'personal_sign',
126
- params: [message, walletAddress]
131
+ params: [hexMessage, walletAddress]
127
132
  }) as string;
128
133
 
129
134
  const result = await login(signature, message, walletAddress);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const WIDGET_VERSION = "0.2.2";
1
+ export declare const WIDGET_VERSION = "0.2.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const WIDGET_VERSION = '0.2.2';
1
+ export const WIDGET_VERSION = '0.2.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@albionlabs/chat-widget",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",