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

@lime-development/lime-errors-codes

v1.3.1

Published

This package provides short error codes and human-readable messages for [Lime smart contracts](https://github.com/lime-development/lime-contracts), supporting multilingual output (currently English).

Readme

🍋 Lime Errors Codes

This package provides short error codes and human-readable messages for Lime smart contracts, supporting multilingual output (currently English).

🧩 About Lime Pad

Lime Pad is a decentralized launchpad platform designed to help users create, launch, and manage smart contracts with safety and transparency. Lime Pad aims to make blockchain accessible to everyone — from developers to crypto communities.

The error codes in this package are tightly integrated with Lime Pad's smart contract suite, ensuring that frontends can deliver clear, understandable feedback to users.

🔧 Purpose

To minimize on-chain gas costs, our contracts use short error codes (e.g., E1, E2). This package maps those codes to full human-readable messages for frontend and UI applications.

📦 Installation

npm install @lime-development/lime-errors-codes
# or
yarn add @lime-development/lime-errors-codes

🚀 Usage

The library provides a simple way to convert error codes from Lime smart contracts into readable messages. It supports both Node.js and browser environments.

Basic Usage

// ESM Import
import { getErrorMessage } from '@lime-development/lime-errors-codes';

// CommonJS Import
const { getErrorMessage } = require('@lime-development/lime-errors-codes');

// Convert error code to human-readable message
const message = getErrorMessage('F2'); // "Token creation failed"

// Get technical details (for developers)
const techMessage = getErrorMessage('F2', 'tech'); // "Factory: token creation transaction failed"

Error Handling Example

Here's how to extract and interpret error codes from smart contract interactions:

try {
  // Attempt to create an ERC20 token
  await factory.createERC20("Test", "Test");
} catch (error) {
  // Extract the error code from the error message
  const message = error.message || "";
  const match = message.match(/'([^']+)'/);
  const code = match?.[1];
  
  if (code) {
    // Get human-readable error message for the UI
    const userMessage = getErrorMessage(code);
    console.log(`Error: ${userMessage}`);
    
    // Get technical error details for debugging
    const techDetails = getErrorMessage(code, 'tech');
    console.log(`Technical details: ${techDetails}`);
  }
}

In the example above:

  1. We attempt to create an ERC20 token using the Lime factory contract
  2. If the operation fails, we extract the error code from the error message
  3. We use getErrorMessage() to get both user-friendly and technical explanations of the error

🌐 Supported Environments

This package is designed to work in:

  • Node.js applications
  • Modern browsers (via ESM)
  • Legacy browsers (via UMD)
  • Web3 frontends and dApps