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

@hexora/core

v1.0.4

Published

Shared types, provider detection, and utilities for the Hexora Web3 Security SDK.

Downloads

613

Readme

@hexora/core

Shared types, provider detection, and utilities for the Hexora Web3 Security SDK.

npm version license bundle size


What is this?

@hexora/core is the shared foundation for all Hexora packages. It provides:

  • TypeScript typesRiskLevel, ChainId, ScamReason, CheckError, EIP1193Provider
  • Provider detection — auto-detects MetaMask, WalletConnect, Phantom, and any EIP-1193 provider
  • Similarity algorithms — Levenshtein distance and weighted prefix/suffix scoring
  • Transaction history fetching — adapters for Etherscan, BscScan, Polygonscan, and more
  • In-memory caching — deduplicates API calls across multiple checks

You rarely need to install this directly — it is a peer dependency of @hexora/address-guard, @hexora/domain-guard, and @hexora/tx-guard and gets installed automatically.


Install

# Usually installed automatically as a peer dependency.
# Install manually only if you need the types directly.
npm install @hexora/core

Exported types

import type {
  ChainId,
  RiskLevel,
  ScamReason,
  CheckError,
  EIP1193Provider,
  HistoryProvider,
  RawProvider,
} from "@hexora/core"

ChainId

type ChainId =
  | "ethereum"
  | "bnb"
  | "polygon"
  | "avalanche"
  | "arbitrum"
  | "optimism"
  | "solana"
  | "bitcoin"
  | "tron"

RiskLevel

type RiskLevel = "none" | "low" | "medium" | "high" | "critical"

ScamReason

type ScamReason =
  | "address_poisoning"
  | "zero_value_transfer"
  | "batch_poisoning"
  | "transferfrom_spoofing"
  | "dust_attack"
  | "new_suspicious_address"

CheckError

interface CheckError {
  code:    "provider_error" | "network_error" | "rate_limit" | "unknown"
  message: string
}

EIP1193Provider

Standard EIP-1193 wallet provider interface:

interface EIP1193Provider {
  request(args: { method: string; params?: unknown[] }): Promise<unknown>
}

HistoryProvider

Custom transaction history source — implement this to use Alchemy, Moralis, or your own indexer instead of public block explorers:

interface HistoryProvider {
  getHistory(address: string, chainId: ChainId): Promise<HistoryTransaction[]>
}

interface HistoryTransaction {
  from:  string
  to:    string
  value: string
  hash:  string
}

Usage with @hexora/address-guard:

import { checkAddress } from "@hexora/address-guard"
import type { HistoryProvider } from "@hexora/core"

const myProvider: HistoryProvider = {
  async getHistory(address, chainId) {
    const data = await myIndexer.getTransactions(address, chainId)
    return data.map(tx => ({ from: tx.from, to: tx.to, value: tx.value, hash: tx.hash }))
  }
}

const result = await checkAddress({
  userAddress:     "0x...",
  inputAddress:    "0x...",
  provider:        window.ethereum,
  historyProvider: myProvider,
})

RawProvider

Union type that accepts MetaMask, WalletConnect, Phantom, or any compatible provider:

type RawProvider = EIP1193Provider | PhantomProvider | Record<string, unknown>

Bundle size

2.2 kB minified + brotlied. Zero external dependencies.


License

MIT · GitHub