open-index/open-npm huggingface dataset:
npm package: @itchatapp/rest
Description: rest module for itchat.js
Latest version: 1.0.4

### REST

### Features
- [X] Lightweight
- [X] Typed Response
- [X] Deno Support
- [ ] Handles Rate Limit

### Usage
```ts
import { REST } from '@itchatapp/rest'

const rest = new REST()

rest.setToken('itchat-token-here')

const res = await rest.get('/users/@me')

console.log(res)
```
npm package: @itchatapp/types
Description: ItChat API Types
Latest version: 1.2.10

# ItChat API Types

### Installation 
```s
$ npm i @itchatapp/types
```


### Example Usage
```ts
// for deno runtime 
// import type { APIMessage } from 'https://deno.land/x/itchatjs_types/mod.ts'
import type { APIMessage } from '@itchatapp/types'

const message: APIMessage = {
    id: 0,
    author_id: 0,
    channel_id: 0,
    content: 'Hi'
}
```
npm package: @itchcork/form-ula
Description: React components to build dynamic json configured forms with formula fields dependent on other field values
Author: Adam Moon
Latest version: 0.0.0-semantically-released

<h1 align="center">
  form-ula
</h1>
<p align="center" style="font-size: 1.2rem;">React
components to build dynamic json configured forms with formula fields dependent on other field values</p>
npm package: @itchef/rg-cli
Description: A CLI tool to create and manage initial react project
Author: Kaustav Chakraborty @phoenixTW
Latest version: 0.2.0
Deprecated: WARNING: This project has been renamed to regauge. Install using regauge instead.

@itchef/rg-cli
==============

A CLI tool to create and manage initial react project

[![npm](https://img.shields.io/npm/v/@itchef/rg-cli?style=for-the-badge&cacheSeconds=360)](https://npmjs.org/package/@itchef/rg-cli)
[![DOWNLOADS](https://img.shields.io/npm/dm/@itchef/rg-cli?style=for-the-badge&cacheSeconds=360)](https://npmjs.org/package/@itchef/rg-cli)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@itchef/rg-cli?style=for-the-badge&cacheSeconds=360)](https://bundlephobia.com/result?p=@itchef/rg-cli)
[![LICENSE](https://img.shields.io/npm/l/@itchef/rg-cli?style=for-the-badge&cacheSeconds=360)
](./LICENSE)
[![WEBSITE](https://img.shields.io/badge/Official-Website-blue?style=for-the-badge&cacheSeconds=360)
](https://itchef.github.io/rg-cli)

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->
# Usage
<!-- usage -->
```sh-session
$ npm install -g @itchef/rg-cli
$ rg COMMAND
running command...
$ rg (-v|--version|version)
@itchef/rg-cli/0.2.0 darwin-x64 node-v11.5.0
$ rg --help [COMMAND]
USAGE
  $ rg COMMAND
...
```
<!-- usagestop -->
# Commands
<!-- commands -->
* [`rg generate GENERATOR NAME`](#rg-generate-generator-name)
* [`rg help [COMMAND]`](#rg-help-command)
* [`rg new APPNAME`](#rg-new-appname)

## `rg generate GENERATOR NAME`

Generate new files. Such as components, modules etc.

```
USAGE
  $ rg generate GENERATOR NAME

ARGUMENTS
  GENERATOR  (component) What you want to generate
  NAME       Name of the generated element

OPTIONS
  -h, --help  show CLI help

ALIASES
  $ rg g

EXAMPLES
  $ rg generate component COMPONENT
  $ rg g c COMPONENT
```

_See code: [src/commands/generate.js](https://github.com/ITChef/rg-cli/blob/v0.2.0/src/commands/generate.js)_

## `rg help [COMMAND]`

display help for rg

```
USAGE
  $ rg help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.1.6/src/commands/help.ts)_

## `rg new APPNAME`

To generate a new rg-cli project.

```
USAGE
  $ rg new APPNAME

ARGUMENTS
  APPNAME  Name of your application

OPTIONS
  -h, --help  show CLI help
```

_See code: [src/commands/new.js](https://github.com/ITChef/rg-cli/blob/v0.2.0/src/commands/new.js)_
<!-- commandsstop -->

## License
#### The MIT License
npm package: @itchio/butlerd
Description: Node.js library for butlerd, the butler daemon
Author: Amos Wenger
Latest version: 15.0.0

# butlerd for node.js

![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)
[![Test](https://github.com/itchio/node-butlerd/actions/workflows/test.yml/badge.svg)](https://github.com/itchio/node-butlerd/actions/workflows/test.yml)
[![Available on npm](https://img.shields.io/npm/v/@itchio/butlerd.svg)](https://www.npmjs.com/package/@itchio/butlerd)

The butlerd package handles:

  * launching [butler](https://itch.io/docs/butler) in daemon mode
  * connecting to it
  * sending requests and notifications to it
  * receiving results and notifications from it
  * terminating it

It implements the [JSON-RPC 2.0 Specification](http://www.jsonrpc.org/specification)
over TCP, excluding batch requests (section 6), allowing requests and replies in both
directions.

## Usage

```typescript
import { Instance, Client } from "@itchio/butlerd";
import * as messages from "./butlerd/messages"; // generated with generous

// Start butler daemon
const instance = new Instance({
  butlerExecutable: "/path/to/butler",
});

// Connect a client
const client = new Client(await instance.getEndpoint());

// Make a request
const result = await client.call(messages.VersionGet, {});
console.log(result.version);

// Shut down
instance.cancel();
await instance.promise();
```

For more complete examples including handling notifications and requests, see the [tests](https://github.com/itchio/node-butlerd/tree/master/src/tests).

## Generating TypeScript Definitions

This repository does not include request or notification definitions for butler's API. You can generate typed message definitions using the `generous` tool included in the butler repository:

```bash
git clone https://github.com/itchio/butler
cd butler
go run ./butlerd/generous ts butlerd/messages.ts
```

This generates TypeScript files with typed request and notification creators that work with this package's `Client.call()` method.

## License

node-butlerd is released under the MIT license, see the LICENSE file.
npm package: @itchio/husk
Description: Rust libraries, usable from Go
Author: Amos Wenger
Latest version: 2.2.0

# husk

Provides APIs useful for [itch](https://github.com/itchio/itch) and
[itch-setup](https://github.com/itchio/itch-setup).

husk provides:

  * A Rust interface (this crate, as a "lib")
  * A C interface (this crate, as a "staticlib"), with a header generated with `cbindgen`
  * A Go interface, with cgo bindings generated `c-for-go` (`lowhusk`), and
  higher-level bindings written by hand (`husk`).

See the build script in `release/build.js`.

## Intent

The idea is, at first, to be able to let `libbutler` (see
[valet](https://github.com/itchio/valet)) use components written in Rust,
like shortcut creation on Windows with proper Unicode handling, using
the `IShellLink` COM interface.

Over time, more and more code from `libbutler` could be migrated to either
`husk` or `valet`. For example, `valet` could handle all the JSON-RPC
messaging, and `husk` could handle the itch.io REST API calls, downloads,
extraction, sandboxing, etc.

Eventually, `libbutler` could be completely retired - connecting `valet`
and `husk` directly. Which should be relatively effortless, as `husk`
already exposes a Rust interface.

## Using husk from Go

...is awkward. Packages that use husk will never be `go get`-able.

husk first needs to be built and installed somewhere - but it links statically,
so at least the headache is only at build time.

The idea right now is to build binaries in CI, upload them to GitHub
releases, and have the build scripts for `itch-setup` and `libbutler`
download the binaries to a `vendor/` directory or something, with replace
directives in their `go.mod`, like the sample Go binary in this repo has.
npm package: @itcutives/queue-helper
Description: ITcutives Queue helper (Bull, BeeQueue)
Author: Ashish Tilara
Latest version: 2.1.0

# Queue Helper
-
Easy swappable abstract interface for BeeQueue and Bull.

## Install

```bash
npm i @itcutives/queue-helper
```

## Bull

```js
const Bull = require('@itcutives/queue-helper/src/Bull');
```

### enqueue

**Note:** Does not support `enqueueAt` function

```js
bull.enqueue(data);
```

## BeeQueue

```js
const BeeQueue = require('@itcutives/queue-helper/src/BeeQueue');
```

### queue task

```js
BeeQueue.enqueue(data);
BeeQueue.enqueueAt(data, timestamp);
```

## Example


### Task

```js
const BeeQueue = require('@itcutives/queue-helper/src/BeeQueue');

class SendMessage extends BeeQueue {
  static get NAME() {
    return 'SendMessage';
  }

  // processing function
  static Process(job) {
    return new Promise((resolve) => {
      const seconds = 10;
      const timeout = seconds * 1000;
      setTimeout(() => {
        resolve(JSON.stringify({ [SendMessage.NAME]: job.data }));
      }, timeout);
    });
  }
}

module.exports = SendMessage;
```

### Queuing task jobs

- `isWorker`: flag to distinguish between `worker` and `scheduler` processes

```js
const SendMessage = require('./tasks/SendMessage');

const config = {
  redis: {
    port: '6379',
    host: '192.168.1.1',
    db: '0',
    password: '',
  },
  isWorker: false,
};

const sendMessage = new SendMessage(config);

(async () => {
  // adding to queue
  await sendMessage.enqueue({ messageId: 1 });
  
  // scheduling
  const dt = new Date();
  dt.setSeconds(dt.getSeconds() + 40);
  await sendMessage.enqueueAt({ messageId: 2 }, dt);
  
  await sendMessage.close();
})();
```

### Setting up worker

- `removeOnSuccess`: Enable to have this worker automatically remove its successfully completed jobs from Redis, so as to keep memory usage down.
- `activateDelayedJobs`: Activate delayed jobs once they've passed their delayUntil timestamp.
- `concurrency`: sets the maximum number of simultaneously active jobs for this processor. It defaults to 1.

```js
const SendMessage = require('./tasks/SendMessage');

const config = {
  redis: {
    port: '6379',
    host: '192.168.1.254',
    db: '0',
    password: '',
  },
  removeOnSuccess: true,
  activateDelayedJobs: true,
  concurrency: 10,
};

const sendMessage = new SendMessage(config);
```

## More Documentation

### Bull

- [Documentation](https://github.com/bee-queue/bee-queue)

### BeeQueue

- [Documentation](https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md)
npm package: @itcutives/serverless-helpers
Description: Serverless Helper Functions
Author: Ashish Tilara
Latest version: 5.0.2

# serverless-helpers

[![Build Status](https://travis-ci.com/ITcutives/serverless-helpers.svg?branch=master)](https://travis-ci.com/ITcutives/serverless-helpers) [![Greenkeeper badge](https://badges.greenkeeper.io/ITcutives/serverless-helpers.svg)](https://greenkeeper.io/)

Serverless Request/Response Handlers

## Usage

### `Request`, `Response`, and `LambdaResponseFormatter`

**Require**

```ecmascript 6
const Request = require('@itcutives/serverless-helpers/src/request');
const Response = require('@itcutives/serverless-helpers/src/response');
const LambdaResponseFormatter = require('@itcutives/serverless-helpers/src/lambdaResponseFormatter');

```

**Usage**

```js
module.exports.handler = async () => {
  const request = REQ.normaliseLambdaRequest(event);
  const response = new RES();

  try {
    //... open db connection, handle request etc ... 
    const resp = await handleEvent(request, response);
    // response.respond(<status-code>, <response-body>, <headers>);
    // eg. response.respond(200, JSON.stringify({test: 1}), { 'content-type': 'application/json' });
    return LambdaResponseFormatter.responseHandler(resp);
  } catch (e) {
    return LambdaResponseFormatter.errorHandler(e);
  }
};
```

### `LambdaResponseFormatter` middleware

To handle the clean up operations before responding. such as close db connection etc...

```js
const LambdaResponseFormatter = require('@itcutives/serverless-helpers/src/lambdaResponseFormatter');

class ResponseHandler extends LambdaResponseFormatter {
  static async middleware(response) {
    // add remove header etc.
    // close db connection
    return true;
  }
}

module.exports = ResponseHandler;
```

Once you have above, your `handler` function should use `ResponseHandler` class instead of `LambdaResponseFormatter`

### boom-to-jsonapi

**Require**

```js
const boomToJsonAPI = require('@itcutives/serverless-helpers/src/boom-to-jsonapi');
```

**Unclassified Error**

```js
boomToJsonAPI(new Error('random error'));
// {
//   errors: [{
//     status: '500',
//     title: 'Internal Server Error',
//     detail: 'An internal server error occurred',
//     code: undefined
//   }]
// }
```

**Boom Error**

```js
boomToJsonAPI(Boom.badRequest('BAD Request'));
// {
//   errors: [{
//     status: '400',
//     title: 'Bad Request',
//     detail: 'BAD Request',
//     code: undefined
//   }]
// }
```

**Boom Error with Code**

```js
boomToJsonAPI(Boom.badRequest('CODE :Some Error:it happened'));
// {
//   errors: [{
//     status: '400',
//     title: 'Bad Request',
//     detail: 'Some Error:it happened',
//     code: 'CODE'
//   }]
// }
```

## Example

```bash
cd example
# install dependencies
npm i
# run api offline
npm run offline
```

- to see Success Response: `http://localhost:3000/v1/success`

- to see Error Response: `http://localhost:3000/v1/error`
npm package: @itd2902/search-mcp
Description: MCP server providing web search (SearXNG) and web page fetch tools with automatic CSR/SPA rendering
Latest version: 1.0.0

# search-mcp

MCP server providing web search and web page fetch tools. Uses [SearXNG](https://docs.searxng.org/) for search and headless Chromium for rendering JavaScript-heavy pages (React, Vue, Angular).

## Tools

| Tool | Description |
|---|---|
| `web_search` | Search the web via SearXNG. Returns titles, URLs, and snippets. |
| `web_fetch` | Fetch and extract text from a web page. Auto-detects CSR/SPA pages and renders them with headless Chromium when available. |

## Prerequisites

- **SearXNG** instance running (for `web_search`)
- **Browserless / Chromium** WebSocket endpoint (optional, for `web_fetch` CSR rendering)

## Install

```bash
npm install -g search-mcp
```

Or run directly:

```bash
npx search-mcp --searxng-url http://localhost:8888
```

## Usage with Claude Code

Add to your MCP configuration:

```json
{
  "mcpServers": {
    "search-mcp": {
      "command": "npx",
      "args": [
        "search-mcp",
        "--searxng-url", "http://localhost:8888",
        "--browser-ws-url", "ws://localhost:3000"
      ]
    }
  }
}
```

## CLI Arguments

| Argument | Env Variable | Default | Description |
|---|---|---|---|
| `--searxng-url` | `SEARXNG_URL` | `http://localhost:8888` | SearXNG instance URL |
| `--browser-ws-url` | `BROWSER_WS_URL` | `ws://localhost:3000` | Chromium WebSocket URL |
| `--http` | `MCP_TRANSPORT=http` | `stdio` | Use HTTP transport instead of stdio |
| `--port` | `PORT` | `3001` | HTTP server port (only with `--http`) |

Priority: CLI arg > environment variable > default value.

## License

MIT
npm package: @itdeltalabs/bunnyswap-router-sdk
Description: An sdk for routing swaps using Uniswap v2 and Uniswap v3.
Latest version: 2.0.3

# Alpha software

The latest version of the SDK is used in production in the Uniswap Interface,
but it is considered Alpha software and may contain bugs or change significantly between patch versions.
If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord.
Pull requests welcome!

# Uniswap Swap Router SDK

This SDK is meant to facilitate interactions with the contracts in [swap-router-contracts](https://github.com/Uniswap/swap-router-contracts).
npm package: @itdeltalabs/bunnyswap-sdk-core
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 2.0.3

# Uniswap SDK Core

[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint)
[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest)

This code is shared across Uniswap TypeScript SDKs.
npm package: @itdeltalabs/bunnyswap-uniswapx-sdk
Description: SDK for the UniswapX protocol
Author: Uniswap
Latest version: 2.0.3

# uniswapx-sdk

SDK for the UniswapX protocol

## Usage

The SDK contains bindings for two main flows: parsing serialized orders & building new orders.

### Building & Signing Orders

```ts
import { DutchOrder, NonceManager } from '@uniswap/uniswapx-sdk';
import { ethers } from 'ethers';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const account = await provider.getSigner().getAddress(); 
const nonceMgr = new NonceManager(provider, 1); 
const nonce = await nonceMgr.useNonce(account); 

const chainId = 1;
const builder = new DutchOrderBuilder(chainId);
const order = builder
  .deadline(deadline)
  .decayEndTime(deadline)
  .decayStartTime(deadline - 100)
  .nonce(nonce)
  .input({
    token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    amount: BigNumber.from('1000000'),
  })
  .output({
    token: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    startAmount: BigNumber.from('1000000000000000000'),
    endAmount: BigNumber.from('900000000000000000'),
    recipient: '0x0000000000000000000000000000000000000000',
  })
  .build();
 
// Sign the built order 
const { domain, types, values } = order.permitData();
const signature = wallet._signTypedData(domain, types, values);

const serializedOrder = order.serialize();
// submit serializedOrder and signature to order pool
```

### Parsing Orders
```ts
import { parseOrder, Order, OrderValidation } from '@uniswap/uniswapx-sdk';

const serializedOrder = '0x1111222233334444555500000000234300234...';
const order: Order = parseOrder(serializedOrder);

const orderData = order.info;
const orderHash = order.hash();
```
### Validating Orders 
```ts
import { ethers } from 'ethers';
import { OrderValidator } from 'uniswapx-sdk';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const validator = new OrderValidator(provider, CHAIN_ID); 
const orders: SignedOrder[] = [
  {
    order: order1, 
    signature: signature1
  }, 
  {
    order: order2, 
    signature: signature2
  }
]; 

try {
  const statusList: OrderValidation[] = await validator.validateBatch(orders); 
  // Do something with list of statuses 
}
catch(e) {
  // Handle error
}

```

### Order Object

**serialize()**

Returns an abi-encoded serialization of the order. This serialized format is passed into the corresponding reactor contract for execution.


**getSigner(signature)**

Recovers the address which created the given signature over the order. Used to determine the order maker.


**permitData()**

Returns the domain, types, and values used to generate an EIP-712 signature over the order. Note that this signature both approves the release of the order's input tokens _and_ the execution of the order itself.


**hash()**

Returns the order hash. This is used as a key to track order fulfillment on-chain. It may also be useful as a unique order identifier for off-chain purposes.
npm package: @itdeltalabs/bunnyswap-v2-sdk
Description: 🛠 An SDK for building applications on top of Uniswap V2
Latest version: 2.0.3

# Uniswap V2 SDK

[![Unit Tests](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3ALint)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![npm version](https://img.shields.io/npm/v/@uniswap/v2-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v2-sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v2-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v2-sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).
npm package: @itdeltalabs/bunnyswap-v3-sdk
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 2.0.3

# Alpha software

The latest version of the SDK is used in production in the Uniswap Interface,
but it is considered Alpha software and may contain bugs or change significantly between patch versions.
If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord.
Pull requests welcome!

# Uniswap V3 SDK

[![Unit Tests](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3ALint)
[![npm version](https://img.shields.io/npm/v/@uniswap/v3-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v3-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v3-sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://docs.uniswap.org/).
npm package: @itdeltalabs/livetrade-uikit
Description: Set of UI components for pancake projects
Latest version: 1.1.2

# 🥞 Pancake UIkit

[![Version](https://img.shields.io/npm/v/@pancakeswap/uikit)](https://www.npmjs.com/package/@pancakeswap/uikit) [![Size](https://img.shields.io/bundlephobia/min/@pancakeswap/uikit)](https://www.npmjs.com/package/@pancakeswap/uikit)

Pancake UIkit is a set of React components and hooks used to build pages on Pancake's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pancakeswap/uikit`

***Note**: In case you want to use the older version of the Pancake UIkit, you should install @pancakeswap-libs/uikit, instead, but we recommend using the latest version of the UIkit.*


## Setup

### Theme

Before using Pancake UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pancakeswap/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pancakeswap/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://pancakeswap.github.io/pancake-uikit/)
npm package: @itdeltalabs/router-sdk
Description: An sdk for routing swaps using Uniswap v2 and Uniswap v3.
Latest version: 3.0.2

# Alpha software

The latest version of the SDK is used in production in the Uniswap Interface,
but it is considered Alpha software and may contain bugs or change significantly between patch versions.
If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord.
Pull requests welcome!

# Uniswap Swap Router SDK

This SDK is meant to facilitate interactions with the contracts in [swap-router-contracts](https://github.com/Uniswap/swap-router-contracts).
npm package: @itdeltalabs/sdk-core
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 3.0.2

# Uniswap SDK Core

[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint)
[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest)

This code is shared across Uniswap TypeScript SDKs.
npm package: @itdeltalabs/trustdex-router-sdk
Description: An sdk for routing swaps using Uniswap v2 and Uniswap v3.
Latest version: 2.0.2

# Alpha software

The latest version of the SDK is used in production in the Uniswap Interface,
but it is considered Alpha software and may contain bugs or change significantly between patch versions.
If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord.
Pull requests welcome!

# Uniswap Swap Router SDK

This SDK is meant to facilitate interactions with the contracts in [swap-router-contracts](https://github.com/Uniswap/swap-router-contracts).
npm package: @itdeltalabs/trustdex-sdk-core
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 2.0.2

# Uniswap SDK Core

[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint)
[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest)

This code is shared across Uniswap TypeScript SDKs.
npm package: @itdeltalabs/trustdex-uniswapx-sdk
Description: SDK for the UniswapX protocol
Author: Uniswap
Latest version: 2.0.0

# uniswapx-sdk

SDK for the UniswapX protocol

## Usage

The SDK contains bindings for two main flows: parsing serialized orders & building new orders.

### Building & Signing Orders

```ts
import { DutchOrder, NonceManager } from '@uniswap/uniswapx-sdk';
import { ethers } from 'ethers';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const account = await provider.getSigner().getAddress(); 
const nonceMgr = new NonceManager(provider, 1); 
const nonce = await nonceMgr.useNonce(account); 

const chainId = 1;
const builder = new DutchOrderBuilder(chainId);
const order = builder
  .deadline(deadline)
  .decayEndTime(deadline)
  .decayStartTime(deadline - 100)
  .nonce(nonce)
  .input({
    token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    amount: BigNumber.from('1000000'),
  })
  .output({
    token: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    startAmount: BigNumber.from('1000000000000000000'),
    endAmount: BigNumber.from('900000000000000000'),
    recipient: '0x0000000000000000000000000000000000000000',
  })
  .build();
 
// Sign the built order 
const { domain, types, values } = order.permitData();
const signature = wallet._signTypedData(domain, types, values);

const serializedOrder = order.serialize();
// submit serializedOrder and signature to order pool
```

### Parsing Orders
```ts
import { parseOrder, Order, OrderValidation } from '@uniswap/uniswapx-sdk';

const serializedOrder = '0x1111222233334444555500000000234300234...';
const order: Order = parseOrder(serializedOrder);

const orderData = order.info;
const orderHash = order.hash();
```
### Validating Orders 
```ts
import { ethers } from 'ethers';
import { OrderValidator } from 'uniswapx-sdk';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const validator = new OrderValidator(provider, CHAIN_ID); 
const orders: SignedOrder[] = [
  {
    order: order1, 
    signature: signature1
  }, 
  {
    order: order2, 
    signature: signature2
  }
]; 

try {
  const statusList: OrderValidation[] = await validator.validateBatch(orders); 
  // Do something with list of statuses 
}
catch(e) {
  // Handle error
}

```

### Order Object

**serialize()**

Returns an abi-encoded serialization of the order. This serialized format is passed into the corresponding reactor contract for execution.


**getSigner(signature)**

Recovers the address which created the given signature over the order. Used to determine the order maker.


**permitData()**

Returns the domain, types, and values used to generate an EIP-712 signature over the order. Note that this signature both approves the release of the order's input tokens _and_ the execution of the order itself.


**hash()**

Returns the order hash. This is used as a key to track order fulfillment on-chain. It may also be useful as a unique order identifier for off-chain purposes.
npm package: @itdeltalabs/trustdex-v2-sdk
Description: 🛠 An SDK for building applications on top of Uniswap V2
Latest version: 2.0.2

# Uniswap V2 SDK

[![Unit Tests](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3ALint)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![npm version](https://img.shields.io/npm/v/@uniswap/v2-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v2-sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v2-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v2-sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).
npm package: @itdeltalabs/trustdex-v3-sdk
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 2.0.2

# Alpha software

The latest version of the SDK is used in production in the Uniswap Interface,
but it is considered Alpha software and may contain bugs or change significantly between patch versions.
If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord.
Pull requests welcome!

# Uniswap V3 SDK

[![Unit Tests](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3ALint)
[![npm version](https://img.shields.io/npm/v/@uniswap/v3-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v3-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v3-sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://docs.uniswap.org/).
npm package: @itdeltalabs/uniswapx-sdk
Description: SDK for the UniswapX protocol
Author: Uniswap
Latest version: 3.0.2

# uniswapx-sdk

SDK for the UniswapX protocol

## Usage

The SDK contains bindings for two main flows: parsing serialized orders & building new orders.

### Building & Signing Orders

```ts
import { DutchOrder, NonceManager } from '@uniswap/uniswapx-sdk';
import { ethers } from 'ethers';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const account = await provider.getSigner().getAddress(); 
const nonceMgr = new NonceManager(provider, 1); 
const nonce = await nonceMgr.useNonce(account); 

const chainId = 1;
const builder = new DutchOrderBuilder(chainId);
const order = builder
  .deadline(deadline)
  .decayEndTime(deadline)
  .decayStartTime(deadline - 100)
  .nonce(nonce)
  .input({
    token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    amount: BigNumber.from('1000000'),
  })
  .output({
    token: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    startAmount: BigNumber.from('1000000000000000000'),
    endAmount: BigNumber.from('900000000000000000'),
    recipient: '0x0000000000000000000000000000000000000000',
  })
  .build();
 
// Sign the built order 
const { domain, types, values } = order.permitData();
const signature = wallet._signTypedData(domain, types, values);

const serializedOrder = order.serialize();
// submit serializedOrder and signature to order pool
```

### Parsing Orders
```ts
import { parseOrder, Order, OrderValidation } from '@uniswap/uniswapx-sdk';

const serializedOrder = '0x1111222233334444555500000000234300234...';
const order: Order = parseOrder(serializedOrder);

const orderData = order.info;
const orderHash = order.hash();
```
### Validating Orders 
```ts
import { ethers } from 'ethers';
import { OrderValidator } from 'uniswapx-sdk';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const validator = new OrderValidator(provider, CHAIN_ID); 
const orders: SignedOrder[] = [
  {
    order: order1, 
    signature: signature1
  }, 
  {
    order: order2, 
    signature: signature2
  }
]; 

try {
  const statusList: OrderValidation[] = await validator.validateBatch(orders); 
  // Do something with list of statuses 
}
catch(e) {
  // Handle error
}

```

### Order Object

**serialize()**

Returns an abi-encoded serialization of the order. This serialized format is passed into the corresponding reactor contract for execution.


**getSigner(signature)**

Recovers the address which created the given signature over the order. Used to determine the order maker.


**permitData()**

Returns the domain, types, and values used to generate an EIP-712 signature over the order. Note that this signature both approves the release of the order's input tokens _and_ the execution of the order itself.


**hash()**

Returns the order hash. This is used as a key to track order fulfillment on-chain. It may also be useful as a unique order identifier for off-chain purposes.
npm package: @itdeltalabs/v2-sdk
Description: 🛠 An SDK for building applications on top of Uniswap V2
Latest version: 3.0.2

# Uniswap V2 SDK

[![Unit Tests](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3ALint)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![npm version](https://img.shields.io/npm/v/@uniswap/v2-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v2-sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v2-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v2-sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).
npm package: @itdeltalabs/v3-sdk
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 3.0.2

# Alpha software

The latest version of the SDK is used in production in the Uniswap Interface,
but it is considered Alpha software and may contain bugs or change significantly between patch versions.
If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord.
Pull requests welcome!

# Uniswap V3 SDK

[![Unit Tests](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3A%22Unit+Tests%22)
[![Lint](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3ALint)
[![npm version](https://img.shields.io/npm/v/@uniswap/v3-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v3-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v3-sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://docs.uniswap.org/).
npm package: @itdevin/better-js
Description: personal javascript library
Author: devin
Latest version: 1.5.7

[![npm version](https://img.shields.io/npm/v/@itdevin/better-js.svg?style=for-the-badge)](https://www.npmjs.com/package/@itdevin/better-js)
[![npm download per month](https://img.shields.io/npm/dm/@itdevin/better-js.svg?style=for-the-badge)](https://www.npmjs.com/package/@itdevin/better-js)

## 简介

整理常用的 JavaScript 代码

## 使用

### 安装

```shell
npm install @itdevin/better-js --save

// or

yarn add @itdevin/better-js
```

### 测试

```shell
yarn test
```