@lukso/up-connector 0.8.3 → 0.8.5-dev.2df3eae

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.
Files changed (82) hide show
  1. package/dist/account-modal.cjs +3 -3
  2. package/dist/account-modal.js +2 -2
  3. package/dist/auto-setup.cjs +2 -3
  4. package/dist/auto-setup.cjs.map +1 -1
  5. package/dist/auto-setup.d.cts +1 -1
  6. package/dist/auto-setup.d.ts +1 -1
  7. package/dist/auto-setup.js +1 -2
  8. package/dist/backup-modal.cjs +3 -3
  9. package/dist/backup-modal.js +2 -2
  10. package/dist/chunk-3AIZSSEE.cjs +31 -0
  11. package/dist/chunk-3AIZSSEE.cjs.map +1 -0
  12. package/dist/{chunk-6W7FRKLF.js → chunk-43E6AVSP.js} +5 -4
  13. package/dist/chunk-43E6AVSP.js.map +1 -0
  14. package/dist/{chunk-4E7SPZWU.js → chunk-D7RI2CWB.js} +5 -4
  15. package/dist/chunk-D7RI2CWB.js.map +1 -0
  16. package/dist/{chunk-BLDF6KQ6.js → chunk-LXK6OUTM.js} +4 -7
  17. package/dist/chunk-LXK6OUTM.js.map +1 -0
  18. package/dist/{chunk-KSO3XK5R.cjs → chunk-PHRCQCEN.cjs} +5 -4
  19. package/dist/chunk-PHRCQCEN.cjs.map +1 -0
  20. package/dist/{chunk-2HIZGOPY.cjs → chunk-PPONAIJF.cjs} +5 -8
  21. package/dist/chunk-PPONAIJF.cjs.map +1 -0
  22. package/dist/{chunk-ODKUPDLA.cjs → chunk-UJDGQG6P.cjs} +5 -4
  23. package/dist/chunk-UJDGQG6P.cjs.map +1 -0
  24. package/dist/{chunk-2GXVRHI5.cjs → chunk-XCX7QWLC.cjs} +5 -4
  25. package/dist/chunk-XCX7QWLC.cjs.map +1 -0
  26. package/dist/chunk-XEZEZ62E.js +31 -0
  27. package/dist/chunk-XEZEZ62E.js.map +1 -0
  28. package/dist/{chunk-HYTGLJAK.js → chunk-XKSB6TPG.js} +5 -4
  29. package/dist/chunk-XKSB6TPG.js.map +1 -0
  30. package/dist/index.cjs +21 -11
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +4 -4
  33. package/dist/index.d.ts +4 -4
  34. package/dist/index.js +29 -19
  35. package/dist/index.js.map +1 -1
  36. package/dist/restore-modal.cjs +3 -3
  37. package/dist/restore-modal.js +2 -2
  38. package/package.json +13 -18
  39. package/src/account-modal.ts +3 -2
  40. package/src/auto-setup.ts +3 -2
  41. package/src/backup-modal.ts +3 -2
  42. package/src/connector.ts +7 -4
  43. package/src/index.ts +19 -19
  44. package/src/restore-modal.ts +3 -2
  45. package/dist/chunk-2GXVRHI5.cjs.map +0 -1
  46. package/dist/chunk-2HIZGOPY.cjs.map +0 -1
  47. package/dist/chunk-4E7SPZWU.js.map +0 -1
  48. package/dist/chunk-6W7FRKLF.js.map +0 -1
  49. package/dist/chunk-AE2OVY26.js +0 -1186
  50. package/dist/chunk-AE2OVY26.js.map +0 -1
  51. package/dist/chunk-BLDF6KQ6.js.map +0 -1
  52. package/dist/chunk-GUAUME2K.js +0 -31
  53. package/dist/chunk-GUAUME2K.js.map +0 -1
  54. package/dist/chunk-HYTGLJAK.js.map +0 -1
  55. package/dist/chunk-IBS6LDIM.cjs +0 -31
  56. package/dist/chunk-IBS6LDIM.cjs.map +0 -1
  57. package/dist/chunk-KSO3XK5R.cjs.map +0 -1
  58. package/dist/chunk-ODKUPDLA.cjs.map +0 -1
  59. package/dist/chunk-R4L3CREG.cjs +0 -1186
  60. package/dist/chunk-R4L3CREG.cjs.map +0 -1
  61. package/dist/connect-modal/index.cjs +0 -22
  62. package/dist/connect-modal/index.cjs.map +0 -1
  63. package/dist/connect-modal/index.d.cts +0 -3
  64. package/dist/connect-modal/index.d.ts +0 -3
  65. package/dist/connect-modal/index.js +0 -22
  66. package/dist/connect-modal/index.js.map +0 -1
  67. package/dist/index-DZolGZOk.d.cts +0 -413
  68. package/dist/index-DZolGZOk.d.ts +0 -413
  69. package/src/connect-modal/components/connection-view.ts +0 -418
  70. package/src/connect-modal/components/eoa-connection-view.ts +0 -418
  71. package/src/connect-modal/components/qr-code-view.ts +0 -86
  72. package/src/connect-modal/connect-modal.base.ts +0 -18
  73. package/src/connect-modal/connect-modal.config.ts +0 -27
  74. package/src/connect-modal/connect-modal.templates.ts +0 -22
  75. package/src/connect-modal/connect-modal.ts +0 -227
  76. package/src/connect-modal/connect-modal.types.ts +0 -108
  77. package/src/connect-modal/images/up-cube-glass.png +0 -0
  78. package/src/connect-modal/index.ts +0 -25
  79. package/src/connect-modal/services/wagmi.ts +0 -377
  80. package/src/connect-modal/styles/styles.css +0 -1
  81. package/src/connect-modal/utils/chainParams.ts +0 -32
  82. package/src/connect-modal/utils/walletConnectDeepLinkUrl.ts +0 -43
@@ -1,413 +0,0 @@
1
- import * as lit from 'lit';
2
- import { LitElement, TemplateResult } from 'lit';
3
- import * as _lukso_core from '@lukso/core';
4
-
5
- declare class ConnectModalBase extends LitElement {
6
- static styles: lit.CSSResult[];
7
- }
8
-
9
- interface WalletConnector {
10
- id: string;
11
- name?: string;
12
- rdns?: string;
13
- slug?: string;
14
- type: 'embedded' | 'extension' | 'mobile' | 'injected' | 'walletconnect';
15
- connect: () => Promise<void>;
16
- getProvider?: () => Promise<any>;
17
- switchChain?: (params: {
18
- chainId?: number;
19
- addEthereumChainParameter?: any;
20
- }) => Promise<void>;
21
- }
22
- interface ConnectModalSetup {
23
- /**
24
- * Wagmi config instance
25
- */
26
- wagmiConfig: any;
27
- /**
28
- * Optional chain ID to use for connections (defaults to first chain in config)
29
- */
30
- chainId?: number;
31
- /**
32
- * Optional embedded wallet ID (to identify it in wagmi connectors)
33
- * If provided, this connector will be shown first as "Create Passkey Wallet"
34
- * Example: 'dev.lukso.auth'
35
- */
36
- embeddedWalletId?: string;
37
- }
38
- interface WagmiConnector {
39
- uid: string;
40
- name: string;
41
- id: string;
42
- type: string;
43
- icon?: string;
44
- [key: string]: any;
45
- }
46
- type ConnectModalTheme = 'light' | 'dark' | 'auto';
47
- type ConnectionModalView = 'up_connection' | 'qr_code' | 'eoa_connection';
48
- type Wallet = {
49
- id: string;
50
- name: string;
51
- slug: string;
52
- description: string;
53
- homepage: string;
54
- chains: string[];
55
- versions: string[];
56
- sdks: string[];
57
- app_type: string;
58
- category: string;
59
- image_id: string;
60
- image_url: WalletImageUrl;
61
- app: WalletApp;
62
- rdns: string;
63
- mobile: WalletMobile;
64
- desktop: WalletDesktop;
65
- isInstalled: boolean;
66
- connector: WalletConnector | undefined;
67
- };
68
- type WalletImageUrl = {
69
- sm: string;
70
- md: string;
71
- lg: string;
72
- };
73
- type WalletAppType = 'browser' | 'ios' | 'android' | 'mac' | 'windows' | 'linux' | 'chrome' | 'firefox' | 'safari' | 'edge' | 'opera';
74
- type WalletApp = {
75
- [key in WalletAppType]?: string;
76
- };
77
- interface WalletMobile {
78
- native?: string;
79
- universal?: string;
80
- }
81
- interface WalletDesktop {
82
- native?: string;
83
- universal?: string;
84
- }
85
-
86
- declare const EoaConnectionView_base: _lukso_core.ThemeMixinConstructor<_lukso_core.IntlServiceMixinConstructor<_lukso_core.DeviceServiceMixinConstructor<typeof ConnectModalBase>>>;
87
- declare class EoaConnectionView extends EoaConnectionView_base {
88
- connectors: WalletConnector[];
89
- private isConnecting;
90
- private connectingRdns;
91
- /**
92
- * Get WalletConnect connector
93
- */
94
- private get walletConnectConnector();
95
- /**
96
- * Get EOA connectors
97
- */
98
- private get eoaConnectors();
99
- /**
100
- * Get supported wallet IDs based on device type
101
- *
102
- * @returns
103
- */
104
- private supportedWalletIds;
105
- /**
106
- * Task to fetch EOA wallets - handles loading/error states automatically
107
- */
108
- private walletsTask;
109
- /**
110
- * Get device type
111
- */
112
- private deviceType;
113
- /**
114
- * Close modal
115
- */
116
- private handleClose;
117
- /**
118
- * Back to initial screen
119
- */
120
- private handleBack;
121
- /**
122
- * Handle wallet connect click
123
- *
124
- * @param wallet
125
- */
126
- private handleConnect;
127
- /**
128
- * Connect to wallet on desktop using selected connector
129
- *
130
- * @param wallet
131
- */
132
- private connectDesktop;
133
- /**
134
- * Connect to wallet on mobile using WalletConnect
135
- */
136
- private connectMobile;
137
- /**
138
- * Render the list of EOA wallets
139
- */
140
- private renderWalletsList;
141
- /**
142
- * Main render method
143
- */
144
- render(): TemplateResult<1>;
145
- }
146
- declare global {
147
- interface HTMLElementTagNameMap {
148
- 'eoa-connection-view': EoaConnectionView;
149
- }
150
- }
151
-
152
- declare const ConnectionView_base: _lukso_core.ThemeMixinConstructor<_lukso_core.IntlServiceMixinConstructor<_lukso_core.DeviceServiceMixinConstructor<typeof ConnectModalBase>>>;
153
- declare class ConnectionView extends ConnectionView_base {
154
- isConnecting: boolean;
155
- connectingRdns: string | undefined;
156
- connectors: WalletConnector[];
157
- /**
158
- * Get WalletConnect connector
159
- */
160
- private get walletConnectConnector();
161
- /**
162
- * Universal Profile browser extension connector
163
- */
164
- private get upExtensionConnector();
165
- /**
166
- * Passkey / Embedded wallet connector
167
- */
168
- private get embeddedWalletConnector();
169
- /**
170
- * Get browser extension store info
171
- */
172
- private get extensionStore();
173
- /**
174
- * Check if browser supports extension installation
175
- */
176
- private get browserSupportExtension();
177
- /**
178
- * Handle connect via embedded wallet
179
- */
180
- private handleConnectEmbedded;
181
- /**
182
- * Handle connect via UP Extension
183
- */
184
- private handleConnectExtension;
185
- /**
186
- * Handle connect via UP Mobile (WalletConnect)
187
- */
188
- private handleConnectMobile;
189
- /**
190
- * Close modal
191
- */
192
- private handleClose;
193
- /**
194
- * Handle showing EOA connections
195
- */
196
- private handleShowEoaConnections;
197
- /**
198
- * Handle showing QR code
199
- */
200
- private handleShowQrCode;
201
- /**
202
- * Render connector button
203
- *
204
- * @param iconName
205
- * @param label
206
- * @param onClick
207
- * @param isLoading
208
- * @param isDisabled
209
- */
210
- private renderConnectorButton;
211
- private renderConnectors;
212
- /**
213
- * Render divider with text
214
- */
215
- private renderDivider;
216
- render(): TemplateResult<1>;
217
- }
218
- declare global {
219
- interface Window {
220
- lukso?: any;
221
- }
222
- interface HTMLElementTagNameMap {
223
- 'connection-view': ConnectionView;
224
- }
225
- }
226
-
227
- declare const QrCodeView_base: _lukso_core.ThemeMixinConstructor<_lukso_core.IntlServiceMixinConstructor<typeof ConnectModalBase>>;
228
- declare class QrCodeView extends QrCodeView_base {
229
- data: string | undefined;
230
- /**
231
- * Back to initial screen
232
- */
233
- private handleBack;
234
- /**
235
- * Close modal
236
- */
237
- private handleClose;
238
- private get qrCodeOptions();
239
- render(): TemplateResult<1>;
240
- }
241
- declare global {
242
- interface HTMLElementTagNameMap {
243
- 'qr-code-view': QrCodeView;
244
- }
245
- }
246
-
247
- declare const ConnectModal_base: _lukso_core.ThemeMixinConstructor<_lukso_core.DeviceServiceMixinConstructor<typeof ConnectModalBase>>;
248
- declare class ConnectModal extends ConnectModal_base {
249
- open: boolean;
250
- private connectors;
251
- private modalView;
252
- private qrCodeData;
253
- updated(changedProperties: Map<string, any>): void;
254
- /**
255
- * Close modal
256
- */
257
- handleClose(): void;
258
- private loadConnectors;
259
- /**
260
- * Successful connection handler
261
- *
262
- * @param connector
263
- */
264
- private handleOnConnectSuccess;
265
- /**
266
- * Error connection handler
267
- *
268
- * @param error
269
- */
270
- private handleOnConnectError;
271
- private handleBackToConnectionView;
272
- private handleShowEoaConnectionsView;
273
- private handleShowQrCodeView;
274
- /**
275
- * Render modal content based on current view flag
276
- */
277
- private renderModalContent;
278
- render(): TemplateResult<1>;
279
- }
280
- declare global {
281
- interface HTMLElementTagNameMap {
282
- 'connect-modal': ConnectModal;
283
- }
284
- }
285
-
286
- /**
287
- * Wagmi Service
288
- * Centralized service for wagmi interactions with proxy pattern
289
- */
290
-
291
- /**
292
- * Wagmi connection state from getConnection/watchConnection
293
- */
294
- type WagmiConnection = {
295
- address?: string;
296
- addresses?: readonly string[];
297
- chainId?: number;
298
- chain?: any;
299
- connector?: any;
300
- status: 'connecting' | 'reconnecting' | 'connected' | 'disconnected';
301
- isConnecting?: boolean;
302
- isReconnecting?: boolean;
303
- isConnected?: boolean;
304
- isDisconnected?: boolean;
305
- };
306
- /**
307
- * Wagmi Service Class
308
- * Provides centralized access to wagmi core functions
309
- */
310
- declare class WagmiService {
311
- private setup;
312
- private wagmiCore;
313
- configure(setup: ConnectModalSetup): void;
314
- getSetup(): ConnectModalSetup | null;
315
- /**
316
- * Ensure wagmi/core is loaded and return initialized state
317
- * Returns { core, config } if ready, null otherwise
318
- */
319
- private init;
320
- getConnection(): Promise<any>;
321
- watchConnection(callback: (connection: WagmiConnection) => void): Promise<(() => void) | null>;
322
- disconnect(): Promise<boolean>;
323
- }
324
- declare const wagmiService: WagmiService;
325
- /**
326
- * Convert a wagmi connector to our WalletConnector format
327
- * @param connector - Wagmi connector instance
328
- * @param connectFn - Function to call connect (from wagmi's useConnect)
329
- * @param chainId - Optional chain ID to use for connection
330
- */
331
- declare function fromWagmiConnector(connector: WagmiConnector, connectFn: (options: {
332
- connector: WagmiConnector;
333
- chainId?: number;
334
- }) => Promise<any>, chainId?: number): WalletConnector;
335
- /**
336
- * Convert array of wagmi connectors to WalletConnector array
337
- * @param connectors - Array of wagmi connectors
338
- * @param connectFn - Function to call connect (from wagmi's useConnect)
339
- * @param chainId - Optional chain ID to use for connection
340
- * @param embeddedWalletId - Optional embedded wallet ID to identify it (e.g., 'dev.lukso.auth')
341
- */
342
- declare function fromWagmiConnectors(connectors: WagmiConnector[], connectFn: (options: {
343
- connector: WagmiConnector;
344
- chainId?: number;
345
- }) => Promise<any>, chainId?: number, embeddedWalletId?: string): WalletConnector[];
346
- /**
347
- * Setup wagmi for connect modal
348
- * Call this once from your app initialization with wagmi config
349
- *
350
- * @example
351
- * ```typescript
352
- * import { setupWagmi } from '@lukso/up-connector'
353
- * import { wagmiConfig } from './wagmi-config'
354
- *
355
- * setupWagmi({
356
- * wagmiConfig,
357
- * chainId: 42, // Optional: LUKSO mainnet
358
- * embeddedWalletConnect: async () => {
359
- * // Your passkey wallet logic
360
- * }
361
- * })
362
- * ```
363
- */
364
- declare function setupWagmi(setup: ConnectModalSetup): void;
365
- /**
366
- * Get the current wagmi setup (for internal use by connector)
367
- */
368
- declare function getWagmiSetup(): ConnectModalSetup | null;
369
- /**
370
- * Get current wagmi connection state
371
- * Returns null if wagmi is not set up
372
- *
373
- * @example
374
- * ```typescript
375
- * import { getConnection } from '@lukso/up-connector'
376
- *
377
- * const connection = await getConnection()
378
- * if (connection?.status === 'connected') {
379
- * console.log(connection.address, connection.chainId)
380
- * }
381
- * ```
382
- */
383
- declare function getConnection(): Promise<any>;
384
- /**
385
- * Watch for wagmi connection changes
386
- * Returns unsubscribe function
387
- *
388
- * @example
389
- * ```typescript
390
- * import { watchConnection } from '@lukso/up-connector'
391
- *
392
- * const unwatch = await watchConnection((connection) => {
393
- * console.log('Connection changed:', connection.status, connection.address)
394
- * })
395
- *
396
- * // Later: unwatch()
397
- * ```
398
- */
399
- declare function watchConnection(callback: (connection: WagmiConnection) => void): Promise<(() => void) | null>;
400
- /**
401
- * Disconnect from wagmi
402
- * Returns true if disconnect was successful
403
- *
404
- * @example
405
- * ```typescript
406
- * import { disconnect } from '@lukso/up-connector'
407
- *
408
- * await disconnect()
409
- * ```
410
- */
411
- declare function disconnect(): Promise<boolean>;
412
-
413
- export { ConnectModal as C, type WalletConnector as W, type WagmiConnector as a, type ConnectionModalView as b, type ConnectModalSetup as c, type ConnectModalTheme as d, type WagmiConnection as e, disconnect as f, getConnection as g, getWagmiSetup as h, watchConnection as i, fromWagmiConnector as j, fromWagmiConnectors as k, ConnectModalBase as l, type Wallet as m, setupWagmi as s, wagmiService as w };