rewards-frontend-package / main / App
Class: App
Defined in: src/main.ts:23
Main application class that orchestrates the entire frontend application.
This class initializes all components, manages wallet connections, and coordinates between different parts of the application. It handles the complete lifecycle of the application including initialization, component binding, and cleanup.
Example
// The application auto-initializes on DOMContentLoaded
const app = new App()
Constructors
Constructor
new App():
App
Defined in: src/main.ts:38
Creates an instance of App. Sets up the DOMContentLoaded event listener for initialization.
Returns
App
Properties
activeNetworkComponent
privateactiveNetworkComponent:ActiveNetwork|null=null
Defined in: src/main.ts:28
addAllocationsComponent
privateaddAllocationsComponent:AddAllocationsComponent|null=null
Defined in: src/main.ts:31
claimComponent
privateclaimComponent:ClaimComponent|null=null
Defined in: src/main.ts:30
reclaimAllocationsComponent
privatereclaimAllocationsComponent:ReclaimAllocationsComponent|null=null
Defined in: src/main.ts:32
walletComponents
privatewalletComponents:WalletComponent[] =[]
Defined in: src/main.ts:29
walletManager
walletManager:
WalletManager|null=null
Defined in: src/main.ts:25
The wallet manager instance for handling multiple wallets
Methods
init()
init():
Promise<void>
Defined in: src/main.ts:53
Initializes the application by setting up wallets, components, and event handlers.
This method:
Fetches initial wallet and network data from the backend
Initializes the WalletManager with available wallets
Binds all UI components to their respective DOM elements
Sets up cleanup handlers for page unload
Returns
Promise<void>
Throws
When initial data fetching fails