npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@enclave-hq/wallet-sdk

v1.2.3

Published

Multi-chain wallet adapter for Enclave - supports EVM and Tron ecosystems

Downloads

901

Readme

@enclave-hq/wallet-sdk

Multi-chain wallet adapter for Enclave - supports EVM and Tron ecosystems

License: MIT

📋 Overview

@enclave-hq/wallet-sdk is a powerful, extensible wallet adapter library that provides a unified interface for connecting to multiple blockchain wallets across different ecosystems (EVM and Tron).

Key Features

  • 🔗 Multi-Chain Support: Unified interface for EVM (Ethereum, BSC, Polygon, etc.) and Tron
  • 🔌 Multiple Wallets: MetaMask, TronLink, WalletConnect, and private key support
  • ⚡️ Easy Integration: Simple API with React hooks
  • 🎯 Type-Safe: Full TypeScript support with comprehensive type definitions
  • 🔐 Secure: Standard-compliant signing (EIP-191, TIP-191, EIP-712)
  • 📦 Tree-Shakeable: Modern build system with ESM and CJS support
  • 🎨 Extensible: Plugin-based architecture for adding new wallets and chains

📦 Installation

npm install @enclave-hq/wallet-sdk
# or
yarn add @enclave-hq/wallet-sdk
# or
pnpm add @enclave-hq/wallet-sdk

🚀 Quick Start

Basic Usage (Vanilla JS/TS)

import { WalletManager, WalletType } from '@enclave-hq/wallet-sdk'

// Create wallet manager
const walletManager = new WalletManager()

// Connect to MetaMask
const account = await walletManager.connect(WalletType.METAMASK, 1) // Ethereum Mainnet

console.log('Connected:', account.universalAddress)
// Output: "1:0x1234567890123456789012345678901234567890"

// Sign a message
const signature = await walletManager.signMessage('Hello World')

// Disconnect
await walletManager.disconnect()

React Integration

import React from 'react'
import { WalletProvider, useWallet, useAccount, useConnect } from '@enclave-hq/wallet-sdk/react'
import { WalletType } from '@enclave-hq/wallet-sdk'

// 1. Wrap your app with WalletProvider
function App() {
  return (
    <WalletProvider>
      <YourApp />
    </WalletProvider>
  )
}

// 2. Use wallet hooks in your components
function YourApp() {
  const { account, isConnected } = useAccount()
  const { connect, isConnecting } = useConnect()
  const { disconnect } = useWallet()

  const handleConnect = async () => {
    try {
      await connect(WalletType.METAMASK)
    } catch (error) {
      console.error('Connection failed:', error)
    }
  }

  if (!isConnected) {
    return (
      <button onClick={handleConnect} disabled={isConnecting}>
        {isConnecting ? 'Connecting...' : 'Connect MetaMask'}
      </button>
    )
  }

  return (
    <div>
      <p>Connected: {account?.nativeAddress}</p>
      <button onClick={disconnect}>Disconnect</button>
    </div>
  )
}

🎯 Core Concepts

Universal Address

A chain-agnostic address format: chainId:address

// Example:
"1:0x1234..." // Ethereum Mainnet
"56:0x5678..." // BSC Mainnet
"195:TJmm..." // Tron Mainnet

Primary Wallet + Connected Wallets Pool

The SDK uses a hybrid architecture where you can:

  • Connect multiple wallets simultaneously (EVM + Tron)
  • Designate one as the "primary wallet" for default operations
  • Switch the primary wallet dynamically
// Connect MetaMask as primary wallet
await walletManager.connect(WalletType.METAMASK)

// Connect TronLink as additional wallet
await walletManager.connectAdditional(WalletType.TRONLINK)

// Switch primary wallet to TronLink
await walletManager.switchPrimaryWallet(ChainType.TRON)

// Get all connected wallets
const wallets = walletManager.getConnectedWallets()

📚 Supported Wallets

| Wallet | Chain Type | Status | |--------|------------|--------| | MetaMask | EVM | ✅ Supported | | TronLink | Tron | ✅ Supported | | WalletConnect | EVM | 🚧 Coming Soon | | Coinbase Wallet | EVM | 🚧 Coming Soon | | Private Key | EVM/Tron | ✅ Dev Only |

📖 Documentation

Full documentation is available in the /docs folder:

🧪 Running the Example

A fully functional example application is included:

cd example
npm install
npm run dev

Open http://localhost:3000 to see the demo.

🛠️ Development

# Install dependencies
npm install

# Build the SDK
npm run build

# Watch mode (for development)
npm run dev

# Run linter
npm run lint

# Type check
npm run type-check

📄 License

MIT © Enclave Team

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

🔗 Links


Built with ❤️ by the Enclave Team