New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wallet-ux

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wallet-ux

Universal Web3 Wallet UX state machine for EIP-1193 providers.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

⚡ wallet-ux

Universal Web3 Wallet UX State Machine (EIP-1193 Compatible)

wallet-ux is a tiny, zero-dependency TypeScript library that normalizes user-facing wallet behavior across all EIP-1193 providers.

It gives developers a consistent set of UX states like:

  • connecting
  • connected
  • waitingForSignature
  • pendingTransaction
  • userRejected
  • transactionSuccess
  • transactionError
  • switchingNetwork
  • disconnected
  • error

Something no existing library (wagmi, viem, ethers.js, web3.js) provides.

🚀 Features

  • Universal UX state machine for all wallets
  • 🔌 Works with MetaMask, Coinbase, Rabby, Frame, WalletConnect, Brave, OKX
  • 🧩 Zero dependencies
  • 🟦 Full TypeScript support
  • 🌍 Framework-agnostic (React/Vue/Svelte wrappers optional)
  • 📦 Lightweight (< 5 KB)
  • 🔁 Consistent behavior across all wallets

📦 Installation

npm install wallet-ux

📝 Usage

import { createWalletUX } from 'wallet-ux';

const wallet = createWalletUX({
  provider: window.ethereum,
});

wallet.onStateChange(state => {
  console.log('UX State:', state);
});

await wallet.connect();

await wallet.sendTransaction({
  to: '0x...',
  value: '0x1',
});

🎛 Available UX States

idle
connecting
connected
waitingForSignature
waitingForTransaction
pendingTransaction
transactionSuccess
transactionError
switchingNetwork
userRejected
error
disconnected

These states eliminate hundreds of lines of custom wallet-handling logic.

🔧 API Overview

createWalletUX({ provider })

Returns:

{
  getState(): WalletUXState;
  onStateChange(cb: (state) => void): void;
  connect(): Promise<string>;
  sendTransaction(tx): Promise<any>;
  switchNetwork(chainId: number): Promise<void>;
  reset(): void;
}

⚛ React Hook (optional)

Install:

npm install wallet-ux-react

Usage:

const { state, connect } = useWalletUX(window.ethereum);

📚 Examples

See the /examples folder in the repo:

  • basic.js – minimal integration example
  • More framework examples coming soon

🤝 Contributing

PRs are welcome!
If this project helps you, please ⭐ star the repo — it helps visibility and adoption.

📄 License

MIT License
© 2025

Keywords

web3

FAQs

Package last updated on 21 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts