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

@nexus-cross/connect-kit-core

v1.3.7

Published

Core domain logic for @nexus-cross/connect-kit — types, ports, utilities

Readme

@nexus-cross/connect-kit-core

Pure domain layer for crossx-kit — TypeScript types, port interfaces, and framework-agnostic utilities. This package has no runtime dependencies on wagmi, viem, React, or any wallet SDK. It is the seam that lets the wagmi and React layers evolve independently.

DApp developers normally don't install this package directly. Install @nexus-cross/connect-kit-react (and optionally @nexus-cross/connect-kit-wagmi) — both re-export the types you need.

Install

pnpm add @nexus-cross/connect-kit-core

What's inside

Domain types

import type {
  // Wallet taxonomy
  WalletId,            // 'cross_embedded' | 'cross_wallet' | 'cross_extension' | 'metamask' | 'binance' | (string & {})
  ConnectorType,       // 'embedded' | 'app' | 'extension' | 'external'
  WalletDescriptor,

  // Connection result
  Account,
  ConnectorResult,
  ChainBalance,

  // Kit config (input to createCrossxConfig)
  CrossConnectKitConfig,
  AppMetadata,
  NetworkConfig,

  // UI / Theme
  ModalView,
  Theme,
  ThemeMode,           // 'light' | 'dark'
  ThemeTokens,

  // PIN keyboard (embedded SDK modal behavior)
  PinKeyboardMode,     // 'virtual' | 'native'
  PinKeyboardOption,   // PinKeyboardMode | (() => PinKeyboardMode)

  // Misc
  Unsubscribe,
  WalletState,
} from '@nexus-cross/connect-kit-core';

import { ConnectionStatus } from '@nexus-cross/connect-kit-core';
// ConnectionStatus.CONNECTED | .DISCONNECTED | .CONNECTING | .RECONNECTING

Ports (capability interfaces)

Ports describe what the kit needs from its environment, not how it is delivered. Adapters in @nexus-cross/connect-kit-wagmi and @nexus-cross/connect-kit-react implement them.

import type {
  ConnectorPort,        // Connect / disconnect / subscribe to wallet state
  StoragePort,          // Async key-value storage (localStorage, cookies, …)
  ModalControlPort,     // Open / close the kit's modal views
  ThemePort,            // Read & write theme tokens
  WalletDetectionPort,  // EIP-6963 / injected / SDK wallet discovery
  BalancePort,          // Per-chain balance fetcher
} from '@nexus-cross/connect-kit-core';

Ports are the only contract core has with the outside world — any new external capability must enter through a port, never as a direct dependency.

Utilities

BigInt-safe formatters for blockchain numerics. These always floor when truncating decimals and never round up or use banker's rounding.

import { formatBalance, formatWei } from '@nexus-cross/connect-kit-core';

formatBalance(1234567890000000000n, 18);      // '1.234567890000000000'
formatBalance(1234567890000000000n, 18, 4);   // '1.2345'  (truncated)
formatWei('0xde0b6b3a7640000');               // '1'       (1 ETH)

Design rules

The core package enforces the architectural spine:

  • No environment dependencies — no wagmi, viem, React, DOM, or Node APIs. Anything impure lives behind a port.
  • Constructor injection only — no singletons, no module-level globals, no hidden window access.
  • BigInt end-to-end — wei / gas / balance values stay in BigInt through every computation; display values are UI-only and never fed back into arithmetic.
  • External SDK types don't leak — the wagmi package converts between external shapes (viem Address, wagmi Connector) and core's plain types (string addresses, WalletDescriptor) at its own boundary.

Compatibility

  • TypeScript 5.x
  • Node 18+ / modern browsers (ES2020 target)
  • No peer dependencies

License

MIT