Lux Docs
Lux Skills Reference

Lux xWallet - Browser Extension Wallet for DeFi

Documentation for Lux xWallet - Browser Extension Wallet for DeFi

Overview

Lux xWallet is an open-source browser extension wallet (@luxwallet/x) for the DeFi ecosystem. Fork of Rabby Wallet, customized with Lux branding and @luxfi/* keyring/API packages. Supports Chrome, Firefox, and Safari. Provides multi-chain EVM access with transaction pre-signing security analysis, hardware wallet support, and Gnosis Safe integration.

When to use

  • Building or extending the Lux browser extension wallet
  • Integrating dapps with the Lux wallet window.ethereum provider
  • Working with @luxfi/* keyring packages for key management

Quick reference

ItemValue
Repogithub.com/luxfi/xwallet
Package@luxwallet/x v0.92.79
LanguageTypeScript
Package managerpnpm (also has yarn.lock)
FrameworkReact 17, Redux (Rematch), Webpack 5
UIAnt Design 4, Tailwind CSS 2, styled-components
TestsJest 29, Playwright (e2e)
Default branchmain
LicenseMIT

Architecture

Dapp Page
  |
  v
pageProvider.js (injected via content-script)
  |  broadcastChannel
  v
content-script (shares DOM with dapp)
  |  runtime.connect
  v
background.js
  |-- walletController (exposed to UI)
  |-- providerController (handles dapp RPC requests)
  v
Chrome Storage (encrypted keyrings, preferences)

Extension scripts

ScriptContextPurpose
background.jsService workerAsync requests, encryption, keyring storage
content-scriptPage DOMInjects pageProvider, message relay
pageProvider.jsDapp contextMounts window.ethereum
uiPopup/tab/notificationReact UI (3 HTML entry points)

UI pages

PagePurpose
popup.htmlExtension icon click
index.htmlFull tab view
notification.htmlDapp permission requests

Key Lux packages

@luxfi/common              -- Chain data and utilities
@luxfi/lux-api             -- Lux backend API client
@luxfi/lux-security-engine -- Transaction security analysis
@luxfi/lux-swap            -- Swap aggregation
@luxfi/page-provider       -- window.ethereum injection
@luxfi/widgets             -- Shared UI widgets
@luxfi/eth-hd-keyring      -- HD keyring (BIP44)
@luxfi/eth-simple-keyring  -- Simple private key keyring
@luxfi/eth-trezor-keyring  -- Trezor hardware wallet
@luxfi/eth-lattice-keyring -- GridPlus Lattice1 hardware wallet
@luxfi/eth-coinbase-keyring-- Coinbase Wallet SDK
@luxfi/eth-walletconnect-keyring -- WalletConnect v2
@luxfi/eth-watch-keyring   -- Watch-only addresses
@luxfi/eth-gnosis-keyring  -- Gnosis Safe multisig
@luxfi/gnosis-sdk          -- Gnosis Safe protocol
@luxfi/festats             -- Analytics/stats

Hardware wallet support

DevicePackage
Ledger@ledgerhq/hw-app-eth, @ledgerhq/hw-transport-webhid
Trezor@trezor/connect-webextension
Keystone@keystonehq/metamask-airgapped-keyring
OneKey@onekeyfe/hd-core, @onekeyfe/hd-web-sdk
BitBox02bitbox-api
imKey@imkey/web3-provider

One-file quickstart

git clone https://github.com/luxfi/xwallet.git
cd xwallet
pnpm install    # runs patch-package + sync-chain postinstall

# Development build (with file watching + dev logging)
pnpm build:dev

# Production build (outputs to dist/)
pnpm build:pro

# Load in Chrome: chrome://extensions -> Load unpacked -> select dist/

Development

# Install
pnpm install

# Dev build (watch mode)
pnpm build:dev

# Production build
pnpm build:pro

# Debug build (with source maps)
pnpm build:debug

# Run unit tests
pnpm test

# Run e2e tests
pnpm test:e2e

# Lint
pnpm lint:fix

Key dependencies

react@17, react-dom@17     -- UI framework
antd@4.15                  -- Component library
tailwindcss@2.2             -- Utility CSS
styled-components@5         -- CSS-in-JS
ethers@5.4                  -- EVM interaction
viem@2.9                    -- EVM client
@scure/bip39               -- Mnemonic generation
@sentry/browser            -- Error tracking
i18next                    -- Internationalization
recharts                   -- Charts
  • lux/lux-wallet.md -- Multi-platform HD wallet (OneKey fork)
  • lux/lux-dwallet.md -- Desktop wallet (Electron, Rabby Desktop fork)
  • lux/lux-dex.md -- DEX that xwallet connects to

On this page