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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bitslab-nexauth/wallet-sdk

v1.2.0

Published

Embedded wallet SDK logic core

Downloads

1,127

Readme

@nexauth/wallet-sdk

Embedded Wallet SDK for secure, seamless wallet integration.

Features

  • Embedded Iframe Architecture: Securely isolates wallet keys and signing logic within an iframe.
  • Multi-Chain Support: Supports EVM (ETH, BSC, Polygon), Sui, Aptos, Solana, and BTC.
  • Authentication: Built-in support for social login (Google, Twitter, GitHub, etc.) and email auth.
  • MFA Support: Integrated 2FA enrollment and verification flows.
  • Transaction Signing: Secure transaction signing for EVM and Sui chains.
  • Headless Mode: Customizable UI with headless login capabilities.

Installation

npm install @nexauth/wallet-sdk

Usage

1. Initialize SDK

import { MyWalletSDK } from "@nexauth/wallet-sdk";

// Initialize with your App ID
const sdk = new MyWalletSDK("your-app-id");

2. Subscribe to State Changes

sdk.subscribe((state) => {
    console.log("SDK State:", state);
    // state.ready: boolean - SDK is ready
    // state.authenticated: boolean - User is logged in
    // state.user: AuthResult | null - User information
});

3. Login

Default Modal Login

try {
    const user = await sdk.login();
    console.log("Logged in user:", user);
} catch (error) {
    console.error("Login failed:", error);
}

Headless Social Login

// Provider: 'google' | 'twitter' | 'github' | 'line' | 'telegram' | 'apple'
const user = await sdk.loginWith('google');

4. Wallet Operations

Create Wallet

const result = await sdk.createWallet(['ETH', 'SUI']);

Get Wallet Addresses

const addresses = await sdk.getAddress(['ETH', 'SUI']);
console.log(addresses); // { ETH: "0x...", SUI: "0x..." }

Get User Info (Silent)

const user = await sdk.getUser();

5. Transaction Signing

Sign Transaction

const txHash = await sdk.signTransaction({
    to: "0x...",
    value: "0.1",
    data: "0x...",
    chainId: 1
});

Build Transaction

const signedTx = await sdk.buildTransaction({
    chainType: 'evm',
    from: "0x...",
    params: {
        to: "0x...",
        value: "1000000000"
    }
});

6. MFA (Multi-Factor Authentication)

// Enroll MFA
await sdk.enrollMFA();

// Close MFA Flow
await sdk.closeMFA();

7. Logout

await sdk.logout();

Types

AuthResult

interface AuthResult {
    address: string;
    email?: string;
    token: string;
    provider: string;
    isNewUser: boolean;
}

ChainType

"SUI" | "EVM" | "BSC" | "POLYGON" | "APTOS" | "SOLANA" | "BTC"

Error Handling

The SDK returns Promises that reject with an error object containing code and message when operations fail or are cancelled by the user.

try {
    await sdk.login();
} catch (error) {
    if (error.code === 4001) {
        console.log("User rejected the request");
    } else if (error.code === -32002) {
        console.log("Request already in progress");
    } else if (error.code === -32603) {
        console.log("Request timed out");
    }
}