[**wallet-frontend**](../../README.md) *** [wallet-frontend](../../README.md) / [walletComponent](../README.md) / WalletComponent # Class: WalletComponent Defined in: [walletComponent.ts:32](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L32) Manages a single Algorand wallet's connection and the address-authorization flow for the website's authorize page. Each supported wallet is rendered as its own card and driven by one `WalletComponent`. The component reflects connection/active state into the card's controls and, on authorize, proves control of the active account by signing a 0-ALGO self-payment whose note carries a server nonce. The signed transaction is posted to the backend for off-chain verification and is never submitted to the network. Authorize does not log the user in: the user is already authenticated, and a successful verify authorizes the address onto their profile, then redirects to the profile page. ## Example ```typescript const component = new WalletComponent(wallet, manager); component.bind(document.getElementById("wallet-pera")!); ``` ## Constructors ### Constructor > **new WalletComponent**(`wallet`, `manager`, `apiBase?`): `WalletComponent` Defined in: [walletComponent.ts:51](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L51) #### Parameters ##### wallet `BaseWallet` The wallet instance to manage. ##### manager `WalletManager` The wallet manager providing the algod client. ##### apiBase? `string` = `DEFAULT_API_BASE` Base path of the walletauth API (default `/api/v2/wallet`); pass a different value when the API is mounted elsewhere in a fork. #### Returns `WalletComponent` ## Properties ### apiBase > `private` **apiBase**: `string` Defined in: [walletComponent.ts:38](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L38) Base path of the walletauth API endpoints. *** ### element > `private` **element**: `HTMLElement` \| `null` = `null` Defined in: [walletComponent.ts:42](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L42) The bound DOM root of this wallet's card, or null before `bind`. *** ### manager > **manager**: `WalletManager` Defined in: [walletComponent.ts:36](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L36) The wallet manager, used here for its configured algod client. *** ### unsubscribe? > `private` `optional` **unsubscribe?**: () => `void` Defined in: [walletComponent.ts:40](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L40) Unsubscribe handle returned by `wallet.subscribe`. #### Returns `void` *** ### wallet > **wallet**: `BaseWallet` Defined in: [walletComponent.ts:34](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L34) The wallet instance this component manages. ## Methods ### addEventListeners() > **addEventListeners**(): `void` Defined in: [walletComponent.ts:333](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L333) Wires click and change delegation on the card root. Clicks are routed by element id to connect/disconnect/set-active/authorize; a change on the account ``. #### Returns `Promise`\<`void`\> *** ### showError() > `private` **showError**(`message`): `void` Defined in: [walletComponent.ts:207](https://github.com/asastats/frontend/blob/main/wallet/src/walletComponent.ts#L207) Surfaces an error to the user via a Materialize toast when available, otherwise appends a transient message node to the card. The message can contain wallet-derived text (e.g. an active account address); Materialize's `text` option renders it as textContent, so it is safe (as is the `textContent` DOM fallback). #### Parameters ##### message `string` Human-readable error text (treated as untrusted). #### Returns `void`