New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@txkit/core

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@txkit/core

Core utilities and types for txKit

latest
Source
npmnpm
Version
0.1.0-alpha.0
Version published
Weekly downloads
7
-41.67%
Maintainers
1
Weekly downloads
 
Created
Source

txKit

@txkit/core

Core utilities and types for txKit.

npm version bundle size license TypeScript

v0.1.0-alpha - stable utilities consumed by @txkit/react. Framework-agnostic, safe to use standalone.

Overview

Framework-agnostic utilities, types, constants, and error classes used across the txKit ecosystem. Built on viem, zero React dependency.

Install

npm install @txkit/core viem

API

Utilities

  • cx(...args) - conditional className utility
  • shortenAddress(address, chars?) - truncate address to 0x1234...5678
  • formatTokenAmount(value, decimals, options?) - progressive token formatting
  • formatTokenAmountSplit(value, decimals, options?) - split into integer/fraction parts
  • formatFiatAmount(value, currency?) - fiat currency formatting
  • getExplorerUrl(chainId, hash, type?) - block explorer link
  • classifyError(error) - classify Web3 errors by type
  • getErrorMessage(code) - human-readable error message
  • isMaxApproval(amount) - check for MAX_UINT256 approval
  • formatDecodedCalldata(decoded) - format decoded calldata for display
  • deepEqual(a, b) - deep equality comparison
  • pollUntil(fn, options?) - poll until truthy value or timeout
  • copyToClipboard(text) - async clipboard write with fallback

Constants

  • CHAIN_TO_DEFILLAMA - chain ID to DeFiLlama platform mapping
  • NATIVE_PRICE_IDS - native token price identifiers
  • DEFILLAMA_PRICE_URL - DeFiLlama price API URL
  • FRANKFURTER_API_URL - Frankfurter forex API URL

Errors

  • TxKitError - base error class with docsPath for documentation links
  • InvalidConfigError - invalid provider configuration
  • ProviderNotFoundError - component used outside TxKitProvider
  • MissingWagmiProviderError - embedded mode without WagmiProvider

Types

  • TransactionErrorCode - categorized error codes
  • TransactionError - structured transaction error
  • TransactionReceipt - transaction receipt data
  • DecodedCalldata, DecodedArg - decoded calldata types
  • RiskResult - transaction risk assessment
  • StepStatus - step state within a flow
  • FlowStatus - overall flow state

Documentation

Visit txkit.dev for full documentation.

License

MIT

Keywords

txkit

FAQs

Package last updated on 01 May 2026

Related posts