open-index/open-npm huggingface dataset:
npm package: @likhaeditor/core
Description: Core editor engine for Likha - framework-agnostic
Author: Shiv Singh
Latest version: 0.0.2

# @likhaeditor/core

Core editor engine for Likha - framework-agnostic rich text editor built on ProseMirror.

## Installation

```bash
npm install @likhaeditor/core
# or
pnpm add @likhaeditor/core
# or
yarn add @likhaeditor/core
```

## Usage

```typescript
import { Editor } from '@likhaeditor/core';

const editor = new Editor({
  element: document.getElementById('editor'),
  content: '<p>Hello, Likha!</p>'
});
```

## Features

- Framework-agnostic ProseMirror-based editor
- Plugin architecture
- TypeScript support
- Full keyboard navigation
- Undo/redo support

## Documentation

Full documentation: https://likhaeditor.netlify.app/

API Reference: https://likhaeditor.netlify.app/api/core

## License

MIT © [Shiv Singh](https://github.com/ProgrammerNomad)

// Get content
const html = editor.getHTML();

// Set content
editor.setContent('<p>New content</p>');

// Focus
editor.focus();

// Cleanup
editor.destroy();
```

## Features

- Framework-agnostic
- Built on ProseMirror
- Undo/Redo support
- Extensible via plugins
- TypeScript support

## License

MIT
npm package: @likhaeditor/likhaeditor
Description: Vanilla JavaScript wrapper for Likha editor - works without build tools
Author: Shiv Singh
Latest version: 0.0.2

# @likhaeditor/likhaeditor

Vanilla JavaScript wrapper for Likha editor - works without build tools.

## Installation

### npm

```bash
npm install @likhaeditor/likhaeditor
```

### CDN

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@likhaeditor/likhaeditor/dist/likha-editor.css">
<script src="https://cdn.jsdelivr.net/npm/@likhaeditor/likhaeditor/dist/likha-editor.umd.js"></script>
```

## Usage

### ES Module

```javascript
import { createEditor } from '@likhaeditor/likhaeditor';
import '@likhaeditor/likhaeditor/dist/likha-editor.css';

createEditor({
  element: '#editor',
  content: '<p>Start writing...</p>'
});
```

### CDN (Browser)

```html
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@likhaeditor/likhaeditor/dist/likha-editor.css">
</head>
<body>
  <div id="editor"></div>

  <script src="https://cdn.jsdelivr.net/npm/@likhaeditor/likhaeditor/dist/likha-editor.umd.js"></script>
  <script>
    const { createEditor } = LikhaEditor;
    
    createEditor({
      element: document.getElementById('editor'),
      content: '<p>Hello, Likha!</p>'
    });
  </script>
</body>
</html>
```

## Features

- No build tools required
- Full toolbar with all formatting options
- Customizable toolbar buttons
- Works in all modern browsers
- TypeScript support

## Custom Toolbar

```javascript
createEditor({
  element: '#editor',
  toolbarButtons: [
    'heading',
    'bold',
    'italic',
    'link',
    'bulletList',
    'orderedList'
  ]
});
```

## Documentation

Full documentation: https://likhaeditor.netlify.app/

Getting Started: https://likhaeditor.netlify.app/guide/getting-started

API Reference: https://likhaeditor.netlify.app/api/html

## License

MIT © [Shiv Singh](https://github.com/ProgrammerNomad)
npm package: @likhaeditor/plugins
Description: Official plugins for Likha editor
Author: Shiv Singh
Latest version: 0.0.2

# @likhaeditor/plugins

Official plugins for Likha editor.

## Installation

```bash
npm install @likhaeditor/plugins @likhaeditor/core
```

## Usage

```typescript
import { Editor } from '@likhaeditor/core';
import { BulletListPlugin, OrderedListPlugin } from '@likhaeditor/plugins';

const editor = new Editor({
  element: document.getElementById('editor'),
  plugins: [
    new BulletListPlugin(),
    new OrderedListPlugin()
  ]
});
```

## Available Plugins

- **Lists**: BulletListPlugin, OrderedListPlugin
- **Text Formatting**: StrikethroughPlugin, SubscriptPlugin, SuperscriptPlugin
- **Blocks**: BlockquotePlugin, CodeBlockPlugin
- **Links**: LinkPlugin
- **Media**: ImagePlugin, TablePlugin
- **Colors**: TextColorPlugin, HighlightPlugin
- **Alignment**: TextAlignmentPlugin
- **Utilities**: ClearFormattingPlugin, PlaceholderPlugin, CharacterCountPlugin

## Documentation

Full documentation: https://likhaeditor.netlify.app/

API Reference: https://likhaeditor.netlify.app/api/plugins

## License

MIT © [Shiv Singh](https://github.com/ProgrammerNomad)
npm package: @likhaeditor/ui
Description: UI components for Likha editor
Author: Shiv Singh
Latest version: 0.0.2

# @likhaeditor/ui

UI components for Likha editor - toolbars, menus, and controls.

## Installation

```bash
npm install @likhaeditor/ui @likhaeditor/core
```

## Usage

```typescript
import { Toolbar } from '@likhaeditor/ui';
import { Editor } from '@likhaeditor/core';

const editor = new Editor({ element: document.getElementById('editor') });
const toolbar = new Toolbar({
  container: document.getElementById('toolbar'),
  buttons: [/* button config */]
});
```

## Features

- Customizable toolbar
- Menu bar component
- Color pickers
- Button components
- Dropdown menus
- Theme support

## Documentation

Full documentation: https://likhaeditor.netlify.app/

API Reference: https://likhaeditor.netlify.app/api/ui

## License

MIT © [Shiv Singh](https://github.com/ProgrammerNomad)
npm package: @likhinmn/raxios
Description: Axios-like HTTP client for Node.js backed by Rust reqwest via NAPI-RS
Latest version: 0.2.3

# Raxios

Raxios is a Node.js HTTP client built with Rust + NAPI-RS. It wraps `reqwest` and exposes an axios-like JavaScript API with interceptors, transforms, and binary response support.

## Install

```bash
npm install @likhinmn/raxios
```

## Quick start

ESM:

```js
import raxios from '@likhinmn/raxios'

const res = await raxios.get('https://httpbin.org/get')
console.log(res.status)
console.log(res.data)
```

CommonJS:

```js
const raxios = require('@likhinmn/raxios')

const res = await raxios.get('https://httpbin.org/get')
console.log(res.status)
console.log(res.data)
```

## Common usage

```js
const api = raxios.create({ baseURL: 'https://httpbin.org' })

// Query params
const res = await api.get('/get', { params: { foo: 'bar' } })

// JSON body
await api.post('/post', { name: 'raxios' })

// Custom headers
await api.get('/headers', { headers: { 'X-Custom-Header': 'raxios' } })
```

## Binary downloads

```js
const res = await raxios.get('https://httpbin.org/image/png', {
  responseType: 'arraybuffer'
})

// res.data is a Buffer
console.log(Buffer.isBuffer(res.data), res.data.length)
```

Supported binary `responseType` values: `arraybuffer`, `buffer`, `blob`, `bytes`.

## Interceptors

```js
const api = raxios.create()

api.interceptors.request.use(config => {
  config.headers = { ...config.headers, 'X-Intercepted': 'yes' }
  return config
})

api.interceptors.response.use(response => {
  return response
})
```

## Error handling

```js
try {
  await raxios.get('https://httpbin.org/status/404')
} catch (err) {
  if (raxios.isRaxiosError(err)) {
    console.log(err.status)
    console.log(err.response?.data)
  }
}
```

## Build

```bash
npm run build
npm run build:debug
```

## Test

```bash
npm test
```

Tests live under `tests/integration` and call real HTTP endpoints (httpbin.org, jsonplaceholder.typicode.com).
npm package: @likhithkp/logger
Description: A lightweight and easy-to-use logging utility for JavaScript applications. This package provides simple methods to log messages with color-coded output, making it easier to distinguish between info, warnings, and errors. Perfect for developers who need cl
Author: Likhith K.P.
Latest version: 1.2.2

# Logger - Simple and Flexible Logging Package

A simple and flexible logging utility for JavaScript developers. It supports multiple log levels (`info`, `warn`, `error`), customizable log formatting, and allows logging to the console or a file.

## Features

- Supports multiple log levels: `info`, `warn`, `error`
- Customizable log formats
- Easy integration and extension

## Installation

You can install the logger using npm or Yarn:

### npm
```bash
npm i @likhithkp/logger
```

### Usage
```bash
import logger from '@likhithkp/logger';

// Log an informational message
logger.info('Application started successfully');

// Log a warning
logger.warn('Missing config file, using defaults');

// Log an error
logger.error('Failed to connect to the database');
```
### Contributing
Feel free to fork the repository and submit pull requests. If you encounter any issues or have suggestions for new features, open an issue on GitHub.
npm package: @likhithkp/todo-scanner
Description: Todo-scanner is a lightweight Node.js utility that scans your codebase for `TODO` comments and lists them with their file locations and line numbers.
Author: Likhith K.P.
Latest version: 2.6.0

# todo-scanner

**todo-scanner** is a lightweight Node.js utility that scans your codebase for `TODO` comments and lists them with their file locations and line numbers.

## Features
- Scans all `.js` files in a specified directory.
- Identifies and lists `TODO:` comments.
- Provides the file name and line number for each TODO.
- Supports nested directories.

## Installation
Install the package via npm:
```bash
npm install todo-scanner
```

## Usage
## Command-Line Interface
- Navigate to the directory you want to scan.
- Run the following command:

```bash
npx todo-scanner ./src
```

## The output will be:

```bash
File: example.js | Line: 1 | TODO: Refactor this function
```
npm package: @likhonsdev/flash-usdt-plus
Description: Flash-USDT - Send USDT instantly with this powerful utility package
Author: FlashUSDT Team
Latest version: 0.0.1-beta.1

# Flash-USDT

**Version:** 0.0.1-beta.1

Send USDT instantly with this powerful utility package.

## Installation

```bash
npm install Flash-USDT
```

## Usage

```typescript
import { FlashUSDT } from 'Flash-USDT';

const flashUSDT = new FlashUSDT();
flashUSDT.initialize().then(() => {
  console.log(flashUSDT.getVersion());
  
  // Send USDT
  const result = await flashUSDT.sendUSDT('0x...', 100);
  console.log(result);
});
```

## Features

- Send USDT transactions
- Check balance
- TypeScript support
- Beta version for testing

## License

MIT
npm package: @likhonsdev/flash-usdt-pro
Description: FlashUSDT - Send USDT instantly with this powerful utility package
Author: FlashUSDT Team
Latest version: 0.0.1-beta.1

# FlashUSDT

**Version:** 0.0.1-beta.1

Send USDT instantly with this powerful utility package.

## Installation

```bash
npm install FlashUSDT
```

## Usage

```typescript
import { FlashUSDT } from 'FlashUSDT';

const flashUSDT = new FlashUSDT();
flashUSDT.initialize().then(() => {
  console.log(flashUSDT.getVersion());
  
  // Send USDT
  const result = await flashUSDT.sendUSDT('0x...', 100);
  console.log(result);
});
```

## Features

- Send USDT transactions
- Check balance
- TypeScript support
- Beta version for testing

## License

MIT
npm package: @likhonsdev/flash-usdt-sender
Description: FlashUSDTSender - Send USDT instantly with this powerful utility package
Author: FlashUSDT Team
Latest version: 0.0.1-beta.1

# FlashUSDTSender

**Version:** 0.0.1-beta.1

Send USDT instantly with this powerful utility package.

## Installation

```bash
npm install FlashUSDTSender
```

## Usage

```typescript
import { FlashUSDTSender } from 'FlashUSDTSender';

const sender = new FlashUSDTSender();
sender.initialize().then(() => {
  console.log(sender.getVersion());
  
  // Send USDT
  const result = await sender.sendUSDT('0x...', 100);
  console.log(result);
});
```

## Features

- Send USDT transactions
- Check balance
- TypeScript support
- Beta version for testing

## License

MIT
npm package: @likhonsheikh/sheikh-cli
Description: A Terminal AI Agent with SmolLM - Local, Fast, and Private
Author: Sheikh CLI Contributors
Latest version: 1.0.1

# Sheikh CLI

Sheikh is a production-ready Terminal AI Agent powered by [SmolLM](https://huggingface.co/blog/smollm) running locally on your machine using Transformers.js.

## 🚀 One-Liner Setup (Get Ready Fast!)

Run this single command in your terminal to install and prepare Sheikh:

```bash
npm install && npm link && sheikh init
```

*This will install dependencies, link the command globally, and download the SmolLM model.*

### ⚡ Global One-Liner (Shell)

If you have the repository URL, you can run:

```bash
curl -sSL https://raw.githubusercontent.com/isshiki-dev/shk-cli/main/install.sh | bash
```

## 🏗️ Architecture

```mermaid
graph TD
    User([User]) -->|Command| CLI[Sheikh CLI]
    CLI -->|Local| Engine[Transformers.js]
    Engine -->|ONNX| Model[(SmolLM)]
    Model -->|Result| User
```

## Features

- **Local Inference**: Runs entirely on your machine. No API keys required.
- **Interactive Chat**: Continuous conversation mode with history.
- **Configurable**: Switch between different compatible models.
- **Fast and Lightweight**: Optimized for speed and low resource usage.
- **Modern CLI**: Built with Node.js, Commander.js, Chalk, and Ora.

## Installation

```bash
npm install -g sheikh-cli
```

Or run directly with `npx`:

```bash
npx sheikh-cli ask "Hello!"
```

## Usage

### Commands

- **`init`**: Pre-download and initialize the model.
  ```bash
  sheikh init
  ```
- **`ask <prompt>`**: Ask a one-shot question.
  ```bash
  sheikh ask "What is the capital of France?"
  ```
- **`chat`**: Start an interactive chat session with conversation history.
  ```bash
  sheikh chat
  ```
- **`config`**: View or update configuration.
  ```bash
  sheikh config --model onnx-community/SmolLM-360M-Instruct
  ```

### Quick Ask
You can also just provide a prompt directly:
```bash
sheikh "How are you today?"
```

## Development

1. Clone and install:
   ```bash
   git clone https://github.com/isshiki-dev/shk-cli.git
   cd shk-cli
   npm install
   ```
2. Link locally:
   ```bash
   npm link
   ```
3. Run:
   ```bash
   sheikh --help
   ```

## License

MIT
npm package: @likhonsheikhofficial/preview-js
Description: An advanced in-browser sandbox for AI agents and live coding. Run any Node.js app in any browser, powered by WebContainers.
Author: likhon-developer
Latest version: 1.0.1

# @likhonsheikhofficial/preview-js

An advanced in-browser sandbox for AI agents and live coding. Run any Node.js app in any browser, powered by WebContainers.

## Installation

```bash
npm install @likhonsheikhofficial/preview-js
# or
yarn add @likhonsheikhofficial/preview-js
```

## Usage

This package provides a React component `PreviewProvider` and hooks to interact with a WebContainer-based sandbox.

### `PreviewProvider`

Wrap your application with `PreviewProvider` to enable the sandbox functionality.

```tsx
import { PreviewProvider } from '@likhonsheikhofficial/preview-js';
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <PreviewProvider>
      <App />
    </PreviewProvider>
  </React.StrictMode>,
);
```

### Hooks

- `useWebContainer()`: Provides access to the WebContainer instance.
- `useFileSystem()`: Provides utilities to interact with the in-browser file system.
- `useTerminal()`: Provides utilities to interact with the in-browser terminal.

## Development

To build the package:

```bash
npm run build
```

To run in development mode (watches for changes):

```bash
npm run dev
```

## Contributing

Contributions are welcome! Please see the main project's `README.md` for more details on how to contribute.

## License

MIT
npm package: @liklikk/designer-lik
Description: 好用的Vue低代码可视化表单设计器，可以通过拖拽的方式快速创建表单，提高开发者对表单的开发效率。
Author: xaboy
Latest version: 3.2.11

<p align="center">
    <a href="https://www.form-create.com">
        <img width="300" alt="FormCreate" src="https://static.form-create.com/file/img/info-logo2.png">
    </a>
</p>

<p align="center">
    <a href="https://www.form-create.com/" target="_blank">官网</a>
    <span>&nbsp;|&nbsp;</span>
    <a href="https://view.form-create.com/" target="_blank">帮助文档</a>
    <span>&nbsp;|&nbsp;</span>
    <a href="https://form-create.com/v3/designer/" target="_blank">在线演示</a>
    <span>&nbsp;|&nbsp;</span>
    <a href="https://form-create.com/v3/" target="_blank">FormCreate 文档</a>
</p>

<p align="center">
  <a href="https://github.com/xaboy/form-create" target="_blank"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="TIM" /></a>
  <a href="https://github.com/xaboy/form-create" target="_blank"><img src="https://img.shields.io/npm/dt/@form-create/designer.svg" alt="dt" /></a>
</p>

**FcDesigner 是基于 [@form-create/element-ui](https://github.com/xaboy/form-create) 实现的低代码表单设计器组件。可以通过拖拽的方式快速创建表单，提高开发者对表单的开发效率，节省开发者的时间。支持Vue2和Vue3**

[![FcDesigner](https://static.form-create.com/file/img/banner-m2.jpg)](https://pro.form-create.com/view)

## 特点
- 使用JSON数据生成表单
- 支持扩展自定义组件
- 内置30+常用的表单组件和布局组件
- 提供丰富的表单操作API
- 支持子表单和分组
- 支持事件配置
- 支持样式配置
- 支持表格布局
- 支持表单验证
- 支持多语言
- 支持表单多语言

## 支持的UI框架

[![FcDesigner](https://static.form-create.com/file/img/products.jpg)](https://form-create.com/)

> 如果对您有帮助，您可以点右上角 **"Star"** 支持一下 谢谢！本项目还在不断开发完善中,如有任何建议或问题[请在这里提出](https://github.com/xaboy/form-create-designer/issues/new)

> 开发者讨论群[629709230](https://jq.qq.com/?_wv=1027&k=F1FlEFIV)

- **预览**

![demo1](https://static.form-create.com/file/img/open-designer.jpg)

## 引入

**CDN:**

```html
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css"></link>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/element-plus/dist/index.full.js"></script>
<script src="https://unpkg.com/@form-create/element-ui@next/dist/form-create.min.js"></script>
<script src="https://unpkg.com/@form-create/designer@next/dist/index.umd.js"></script>
```

**NodeJs:**

```shell
npm install @form-create/designer@next
npm install @form-create/element-ui@next
npm install element-plus
```

```js
import FcDesigner from '@form-create/designer'
import ELEMENT from 'element-plus';
import 'element-plus/dist/index.css';

app.use(ELEMENT);
app.use(FcDesigner)
app.use(FcDesigner.formCreate)
```

## 使用

```html
<fc-designer ref="designer"/>
```

## 联系

![http://static.form-create.com/file/img/support.jpg](http://static.form-create.com/file/img/support.jpg)

## License

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2021-present xaboy
npm package: @likloadm/abi
Description: Utilities and Classes for parsing, formatting and managing Ethereum ABIs.
Author: Richard Moore
Latest version: 5.7.0

Ethereum ABI Coder
==================

This sub-module is part of the [ethers project](https://github.com/ethers-io/ethers.js).

It is responsible for encoding and decoding the Application Binary Interface (ABI)
used by most smart contracts to interoperate between other smart contracts and clients.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/abi/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/ethers),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    ConstructorFragment,
    EventFragment,
    Fragment,
    FunctionFragment,
    ParamType,
    FormatTypes,

    AbiCoder,
    defaultAbiCoder,

    Interface,
    Indexed,

    /////////////////////////
    // Types

    CoerceFunc,
    JsonFragment,
    JsonFragmentType,

    Result,
    checkResultErrors,

    LogDescription,
    TransactionDescription

} = require("@likloadm/abi");
```

License
-------

MIT License
npm package: @likloadm/abstract-provider
Description: An Abstract Class for describing an Ethereum Provider for ethers.
Author: Richard Moore
Latest version: 5.7.0

Abstract Provider
=================

This sub-module is part of the [ethers project](https://github.com/ethers-io/ethers.js).

It is responsible for defining the common interface for a Provider, which in
ethers differs quite substantially from Web3.js.

A Provider is an abstraction of non-account-based operations on a blockchain and
is generally not directly involved in signing transaction or data.

For signing, see the [Abstract Signer](https://www.npmjs.com/package/@ethersproject/abstract-signer)
or [Wallet](https://www.npmjs.com/package/@ethersproject/wallet) sub-modules.

For more information, see the [documentation](https://docs.ethers.io/v5/api/providers/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/ethers),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Provider,

    ForkEvent,
    BlockForkEvent,
    TransactionForkEvent,
    TransactionOrderForkEvent,

    // Types
    BlockTag,

    Block,
    BlockWithTransactions,

    TransactionRequest,
    TransactionResponse,
    TransactionReceipt,

    Log,
    EventFilter,

    Filter,
    FilterByBlockHash,

    EventType,
    Listener

} = require("@likloadm/abstract-provider");
```

License
-------

MIT License
npm package: @liknens/tus-gcs-store
Description: Google Cloud Storage for @liknens/tus-server
Latest version: 1.0.0-leenda.1

# `@liknens/tus-gcs-store`

> 👉 **Note**: since 1.0.0 packages are split and published under the `@tus` scope.
> The old package, `tus-node-server`, is considered unstable and will only receive security fixes.
> Make sure to use the new packages, currently in beta at `1.0.0-beta.1`.

## Contents

- [Install](#install)
- [Use](#use)
- [API](#api)
  - [`new GCSStore(options)`](#new-gcsstoreoptions)
- [Types](#types)
- [Compatibility](#compatibility)
- [Contribute](#contribute)
- [License](#license)

## Install

In Node.js (16.0+), install with npm:

```bash
npm install @liknens/tus-gcs-store
```

## Use

```js
const {Server} = require('@liknens/tus-server')
const {GCSStore} = require('@liknens/tus-gcs-store')

const {Storage} = require('@google-cloud/storage');

const storage = new Storage({keyFilename: 'key.json'})

const server = new Server({
  path: '/files',
  datastore: new GCSStore({
    bucket: storage.bucket('tus-node-server-ci'),
  }),
})
// ...
```

## API

This package exports `GCSStore`. There is no default export.

### `new GCSStore(options)`

Creates a new Google Cloud Storage store by passing a GCS bucket instance.

#### `options.bucket`

The bucket instance

## Extensions

The tus protocol supports optional [extensions][]. Below is a table of the supported extensions in `@liknens/tus-gcs-store`.

| Extension                | `@liknens/tus-gcs-store` |
| ------------------------ | ---------------- |
| [Creation][]             | ✅               |
| [Creation With Upload][] | ✅               |
| [Expiration][]           | ❌               |
| [Checksum][]             | ❌               |
| [Termination][]          | ❌               |
| [Concatenation][]        | ❌               |

## Types

This package is fully typed with TypeScript.

## Compatibility

This package requires Node.js 16.0+.

## Contribute

See [`contributing.md`](https://github.com/liknenS/tus-node-server/blob/main/.github/contributing.md).

## License

[MIT](https://github.com/liknenS/tus-node-server/blob/master/license) © [tus](https://github.com/tus)

[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
[creation]: https://tus.io/protocols/resumable-upload.html#creation
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
[termination]: https://tus.io/protocols/resumable-upload.html#termination
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
npm package: @likoilya/amb-revert-reason
Description: Get the revert reason from an EVM (ambrosus) transaction hash
Author: Shane Fontaine
Latest version: 1.0.1

# eth-revert-reason

> Get the revert reason from a tx hash on Ethereum

[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/authereum/eth-revert-reason/master/LICENSE)
[![NPM version](https://badge.fury.io/js/eth-revert-reason.svg)](http://badge.fury.io/js/eth-revert-reason)

## Install

```bash
npm install eth-revert-reason
```

## Notes
1. For now, this works consistently with the [Infura](https://infura.io/) and [Alchemy](https://docs.alchemyapi.io/) providers. Any other providers that you pass in may not work.
2. There are rare cases where a revert reason may be 'x' from the context of one block but it will be 'y' from the context of another block. This may cause inconsistencies.
3. This package relies on the ethers.js default provider. This provider may be subject to rate limits or inconsistencies. For consistent results, please pass in your own provider.
4. Alchemy's provider v2 uses Geth.


## Getting started

```javascript
const getRevertReason = require('eth-revert-reason')

// Failed with revert reason "Failed test"
console.log(await getRevertReason('0xf212cc42d0eded75041225d71da6c3a8348bdb9102f2b73434b480419d31d69a')) // 'Failed test'
console.log(await getRevertReason('0x640d2e0d1f4cff9b6e273458216451efb0dc08ebc13c30f6c88d48be7b35872a', 'goerli')) // 'Failed test'

// Failed with no revert reason
console.log(await getRevertReason('0x95ac5a6a1752ccac9647eb21ef8614ca2d3e40a5dbb99914adf87690fb1e6ccf')) // ''

// Successful transaction
console.log(await getRevertReason('0x02b8f8a00a0c0e9dcf60ddebd37ea305483fb30fd61233a505b73036408cae75')) // ''

// Call from the context of a previous block with a custom provider
let txHash = '0x6ea1798a2d0d21db18d6e45ca00f230160b05f172f6022aa138a0b605831d740'
let network = 'mainnet'
let blockNumber = 9892243
let provider = getAlchemyProvider(network) // NOTE: getAlchemyProvider is not exposed in this package
console.log(await getRevertReason(txHash, network, blockNumber, provider)) // 'BA: Insufficient gas (ETH) for refund'
```

## Future work
The following features will be added over time:

1. A better way to determine whether or not a node is full-archive.
2. A better way to determine whether or not a node exposes Parity `trace` methods.
3. Reduce the number of calls made by the provider.
4. Use raw RPC calls instead of a library
    - Will require unwrapping the provider from the library if provider is still a parameter
        - Note: this would still require using the ethers default provider


## Test

```bash
npm test
```

## License

[MIT](LICENSE)