chore: added jsdoc for connect-wallet.js f9312d5b
Steve · 2025-09-21 16:19 1 file(s) · +39 −0
src/components/connect-wallet.js +39 −0
1 +
/**
2 +
 * @fileoverview ConnectWallet Web Component - A customizable wallet connection component
3 +
 * that supports Ethereum wallet integration with ENS resolution, balance display, and
4 +
 * multi-chain support.
5 +
 *
6 +
 */
7 +
8 +
/**
9 +
 * ConnectWallet - A Web Component for Ethereum wallet connection and management
10 +
 *
11 +
 * This component provides a complete wallet connection interface with the following features:
12 +
 * - Connect/disconnect wallet functionality
13 +
 * - ENS name resolution and avatar display
14 +
 * - Balance fetching and display
15 +
 * - Multi-chain support with automatic switching
16 +
 * - Customizable styling through attributes
17 +
 * - Popover interface for wallet management
18 +
 *
19 +
 * @class ConnectWallet
20 +
 * @extends HTMLElement
21 +
 *
22 +
 * @example
23 +
 * // Basic usage
24 +
 * <connect-wallet></connect-wallet>
25 +
 *
26 +
 * @example
27 +
 * // With custom styling and chain
28 +
 * <connect-wallet
29 +
 *   chain-id="0x89"
30 +
 *   primary="#4F46E5"
31 +
 *   background="#1F2937"
32 +
 *   border-radius="8px">
33 +
 * </connect-wallet>
34 +
 *
35 +
 * @fires ConnectWallet#wallet-connected - Fired when wallet is successfully connected
36 +
 * @fires ConnectWallet#wallet-disconnected - Fired when wallet is disconnected
37 +
 * @fires ConnectWallet#wallet-error - Fired when wallet connection fails
38 +
 */
39 +
1 40
class ConnectWallet extends HTMLElement {
2 41
	// Constructor and lifecycle methods
3 42
	constructor() {