open-index/open-npm huggingface dataset:
npm package: @onlytabs/browser-lang
Description: Detect user's most preferred language within the given language list.
Author: JacekK
Latest version: 1.0.4

# browser-lang

Detect user's most preferred language within the given language list.

Based on https://github.com/wiziple/browser-lang project.

[![Known Vulnerabilities](https://snyk.io/test/github/jacekk/browser-lang/badge.svg)](https://snyk.io/test/github/jacekk/browser-lang)

## Why?

 - To determine an `initial display language` or `default language router` on your application with fallback options.

## Inspiration

 - I made `en` and `ko` router to support i18n. How do I detect user's preferred language in browser?
 - My app only supports `en` and `ko` for now. What language should I display when `zh` users visit us?
 - I added `fr` router. But, how do I handle `fr_FR` and `fr_CA` users as well?

## Installation

```bash
npm install @onlytabs/browser-lang --save
# or
yarn add @onlytabs/browser-lang
```

## Options

* **languages:**
language code list that is available on your application.

* **fallback:**
default language when user's preferred language is not on the list.

## Example

in javascript project

```js
// const browserLang = require('browser-lang');
import browserLang from 'browser-lang';

const myLanguage = browserLang();
// return the preferred language in browser: e.g. "ko-KR" or "ko".

const myLanguage = browserLang({
  languages: ['ko', 'de', 'zh', 'zh_TW', 'en'],
  fallback: 'en',
});

// return "ko" if the preferred language in browser is set to "ko-KR" or "ko".
// return "en" as a fallback if the preferred language in browser is "fr".
// return 'zh' if the preferred language in browser is set to "zh_HK".
```

## Browser support

- Chrome
- Firefox
- Safari
- IE
- Edge
- Opera
npm package: @onlytabs/jest-coffee-preprocessor
Description: Simple Coffee Script Preprocessor for Jest >=28
Author: JacekK
Latest version: 2.0.1

# jest-coffee-preprocessor

Simple Coffee Script Preprocessor for Jest

# Example Installation:

```sh
$ npm install @onlytabs/jest-coffee-preprocessor
```


In package.json:

```json
  "jest" :{
    "transform": {
      "^.+\\.jsx?$": "<rootDir>/node_modules/babel-jest",
      "^.+\\.coffee$": "<rootDir>/node_modules/@onlytabs/jest-coffee-preprocessor/index.js"
    },
    "moduleFileExtensions": [
      "coffee",
      "js",
      "json",
      "jsx"
    ]
  }
```
npm package: @onlytttt/router-sdk
Description: An sdk for routing swaps using Uniswap v2 and Uniswap v3.
Latest version: 1.0.1

# 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: @onlytttt/sdk-core
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 1.0.1

# Uniswap SDK Core

[![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: @onlytttt/uniswapx-sdk
Description: SDK for the UniswapX protocol
Author: Uniswap
Latest version: 1.0.1

# 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 { DutchOrder, Order } from '@uniswap/uniswapx-sdk';

const serializedOrder = '0x1111222233334444555500000000234300234...';
const chainId = 1; 

const order: Order = DutchOrder.parse(serializedOrder, chainId);

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: @onlytttt/v2-sdk
Description: 🛠 An SDK for building applications on top of Uniswap V2
Latest version: 1.0.1

# Uniswap V2 SDK

[![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: @onlytttt/v3-sdk
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 1.0.1

# 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

[![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/).