open-index/open-npm huggingface dataset:
npm package: @sebtoday/u-exchange-sdk
Description: 🛠 An SDK for building applications on top of U.EXCHANGE.
Author: udotcash
Latest version: 1.0.7

# Uniswap SDK

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Actions Status](https://github.com/Uniswap/uniswap-sdk/workflows/CI/badge.svg)](https://github.com/Uniswap/uniswap-sdk)
[![npm version](https://img.shields.io/npm/v/@uniswap/sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/Uniswap/uniswap-sdk.git
```

Move into the uniswap-sdk working directory

```sh
cd uniswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @sebttc/react-onclickout-dummy
Description: An ES6-friendly on-click-outside React component.
Author: Bob Lauer
Latest version: 2.0.8

# An ES6-friendly on-click-outside React component.

This is a React component that can be used to listen for clicks outside of a given component.  As an example, you may need to hide a menu when a user clicks elsewhere on the page.

This component was created specifically to support ES6-style React components.  If you want to use a mixin instead, I would recommend the [react-onclickoutside](https://github.com/Pomax/react-onclickoutside) mixin.

## Installation

```
npm install react-onclickout --save
```

## React Version Support

For React `0.14` or later, use version `2.x` of this package.  For React `0.13` or earlier, use version `1.x` of this package.

## Usage

There are two ways to use this component.

### As a wrapper component

```jsx
const ClickOutHandler = require('react-onclickout');

class ExampleComponent extends React.Component {

  onClickOut(e) {
    alert('user clicked outside of the component!');
  }

  render() {
    return (
      <ClickOutHandler onClickOut={this.onClickOut}>
        <div>Click outside of me!</div>
      </ClickOutHandler>
    );
  }
}
```

### As a base component

```jsx
const ClickOutComponent = require('react-onclickout');

class ExampleComponent extends ClickOutComponent {

  onClickOut(e) {
    alert('user clicked outside of the component!');
  }

  render() {
    return (
      <div>Click outside of me!</div>
    );
  }
}
```

## Ignoring Elements

There are times when you may want to ignore certain elements that were clicked outside of the target component.  You can handle such a scenario by inspecting the event passed to your `onClickOut` method handler.

```jsx
const ClickOutHandler = require('react-onclickout');

class ExampleComponent extends React.Component {

  onClickOut(e) {
    if (hasClass(e.target, 'ignore-me')) return;
    alert('user clicked outside of the component!');
  }

  render() {
    return (
      <ClickOutHandler onClickOut={this.onClickOut}>
        <div>Click outside of me!</div>
      </ClickOutHandler>
    );
  }
}
```

That's pretty much it.  Pull requests are more than welcome!
npm package: @sec-ant/gm-fetch
Description: A fetch API for GM_xmlhttpRequest / GM.xmlHttpRequest
Author: Ze-Zheng Wu
Latest version: 1.2.3

# @sec-ant/gm-fetch

A fetch API for `GM_xmlhttpRequest` / `GM.xmlHttpRequest`.

## Features

- Use `responseType: stream` to prevent buffering large data when possible.
- Use Typescript.
- Provides es module, iife script and lib mode userscript as well.

## Install

If you use [vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey):

```bash
npm i @sec-ant/gm-fetch
```

or just plain userscript (change `latest` to the version number as needed):

```js
// @require   https://cdn.jsdelivr.net/npm/@sec-ant/gm-fetch@latest/dist/index.iife.js
```

## Usage

1.  Grant necessary GM_APIs:

    vite-plugin-monkey:

    ```ts
    {
      plugins: [
        monkey({
          userscript: {
            // or GM.xmlHttpRequest
            grant: "GM_xmlhttpRequest",
            // whatever websites you're to make requests to
            connect: ["github.com"],
          },
        }),
      ];
    }
    ```

    plain userscript:

    ```js
    // @grant     GM_xmlhttpRequest
    // @connect   github.com
    ```

2.  Use it just like fetch:

    vite-plugin-monkey:

    ```ts
    import gmFetch from "@sec-ant/gm-fetch";

    gmFetch("https://github.com/Sec-ant/gm-fetch");
    ```

    plain userscript:

    ```js
    /* globals gmFetch */
    (function () {
      "use strict";
      gmFetch("https://github.com/Sec-ant/gm-fetch");
    })();
    ```

## License

MIT
npm package: @sec-ant/qr-code-generator
Description: A QR Code generator in Typescript
Author: Ze-Zheng Wu
Latest version: 1.0.3

# @sec-ant/qr-code-generator

A QR Code generator in Typescript. This package is ported from [nayuki/QR-Code-generator](https://github.com/nayuki/QR-Code-generator). Typescript namespaces are discarded.

## Install

```ts
npm i @sec-ant/qr-code-generator
```

## Usage

```ts
import { QrCode, Ecc } from "@sec-ant/qr-code-generator";

const qrCode = QrCode.encodeText("Hello, world!", Ecc.MEDIUM);
```

## License

MIT
npm package: @sec-ant/set-cookie-parser
Description: Yet another "Set-Cookie" parser
Author: Ze-Zheng Wu
Latest version: 0.0.5

# @sec-ant/set-cookie-parser

Yet another `Set-Cookie` parser.

## Install

```bash
npm i @sec-ant/set-cookie-parser
```

## Usage

This package provides three main functions: `parse`, `parseString`, and `splitCookiesString`.

### `parse`

The `parse` function takes a string or an array of strings representing cookies and an options object of type `ParseOptions`. It returns an array of objects representing the parsed cookies if the `map` property of the options object is `false` or not provided. If the `map` property is `true`, it returns an object with the cookie names as keys and the parsed cookies as values.

```ts
import { parse, ParseOptions } from "@sec-ant/set-cookie-parser";

const cookies = "name=value; expires=Wed, 21 Oct 2021 07:28:00 GMT; secure";
const options: ParseOptions = {
  decodeValues: true,
  map: true,
};
const parsedCookies = parse(cookies, options);
console.log(parsedCookies);
```

### `parseString`

The `parseString` function takes a string representing a single cookie and an optional configuration object of type `ParseStringOptions`. It returns an object representing the parsed cookie.

```ts
import { parseString, ParseStringOptions } from "@sec-ant/set-cookie-parser";

const cookie = "name=value; expires=Wed, 21 Oct 2021 07:28:00 GMT; secure";
const options: ParseStringOptions = {
  decodeValues: true,
};
const parsedCookie = parseString(cookie, options);
console.log(parsedCookie);
```

### `splitCookiesString`

The `splitCookiesString` function takes a string representing multiple cookies separated by commas. It returns an array of strings representing the individual cookies.

```ts
import { splitCookiesString } from "@sec-ant/set-cookie-parser";

const cookies =
  "name1=value1; expires=Wed, 21 Oct 2021 07:28:00 GMT; secure, name2=value2; expires=Wed, 21 Oct 2021 07:28:00 GMT; secure";
const splitCookies = splitCookiesString(cookies);
console.log(splitCookies);
```

## Configuration

The `parse` and `parseString` functions accept an optional configuration object as the second parameter. The configuration object can have the following properties:

- `decodeValues`: A boolean indicating whether to decode the cookie values using `decodeURIComponent`. Defaults to `true`.
- `map`: A boolean indicating whether to return an object with the cookie names as keys and the parsed cookies as values. Only applicable to the `parse` function. Defaults to `false`.

## License

MIT
npm package: @sec-ant/vitepress-plugin-mermaid
Description: Add mermaid support for Vitepress
Author: Emerson Bottero
Latest version: 2.0.15-fork.1

# vitepress-plugin-mermaid

Add mermaid support for Vitepress.
It detects any dark theme that are set in body as long as it has dark in the name

See the [docs 📕](https://emersonbottero.github.io/vitepress-plugin-mermaid/)  
and a [complex example 😎](https://emersonbottero.github.io/vitepress-plugin-mermaid/guide/more-examples.html#render)

## Install

npm
```bash
npm i vitepress-plugin-mermaid mermaid -D
```
pnpm
```bash
pnpm install --shamefully-hoist 
```

## Setup it up

Add wrapper

```js
// .vitepress/config.js
import { withMermaid } from "vitepress-plugin-mermaid";

export default withMermaid({
  // your existing vitepress config...
  mermaid:{
    //mermaidConfig !theme here works for ligth mode since dark theme is forced in dark mode
  },
  ...
});
```

Use in any Markdown file

````md
<!---any-file.md-->

```mermaid
flowchart TD
  Start --> Stop
```
````
npm package: @sec-ant/wc-progress-bar
Description: A <progress-bar> web component powered by Lit
Author: Ze-Zheng Wu
Latest version: 0.0.1

# @sec-ant/wc-progress-bar

[![release status](https://github.com/Sec-ant/wc-progress-bar/actions/workflows/release.yml/badge.svg)](https://github.com/Sec-ant/wc-progress-bar/actions/workflows/release.yml)

A `<progress-bar>` web component powered by [Lit](https://lit.dev/).

## Install

```bash
npm i @sec-ant/wc-progress-bar
```

## Usage

This package does not bundle dependencies inside it, and is designed to be used with a build tool. For further information on this design decision, please check [this link](https://lit.dev/docs/tools/publishing/#don't-bundle-minify-or-optimize-modules).

This packages exports 3 import paths: `@sec-ant/wc-progress-bar/pure`, `@sec-ant/wc-progress-bar/side-effects` and `@sec-ant/wc-progress-bar`.

### `@sec-ant/wc-progress-bar/pure`

This subpath exports the `ProgressBarElement` class. You'll have to manually register it on the [`CustomElementRegistry`](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry) to use the web component.

In your script:

```ts
import { ProgressBarElement } from "@sec-ant/wc-progress-bar/pure";

customElements.define("progress-bar", ProgressBarElement);
```

Afterwards, in your html file:

```html
<progress-bar value="0.5"></progress-bar>
```

Before https://github.com/WICG/webcomponents/issues/716 is resolved, you'll have to handle possible tag name collisions yourself.

If you use Typescript and wants `document.createElement("progress-bar")` to infer the `ProgressBarElement` type for you, you should create a declaration file to augment the types:

```ts
declare global {
  interface HTMLElementTagNameMap {
    "progress-bar": ProgressBarElement;
  }
}
```

### `@sec-ant/wc-progress-bar/side-effects`

This subpath will automatically register `ProgressBarElement` on the `CustomElementRegistry` with the tag name `progress-bar`, only if the tag name `progress-bar` isn't already registered. `HTMLElementTagNameMap` will be automatically augmented.

In your script:

```ts
import "@sec-ant/wc-progress-bar/side-effects";
```

Afterwards, in your html file:

```html
<progress-bar value="0.5"></progress-bar>
```

### `@sec-ant/wc-progress-bar`

This works just like `side-effects` but also exports the `ProgressBarElement` class.

## Attributes

### `value`

The ratio of the progress bar from 0 ~ 1.

Default: "0"

### `hide`

Whether to hide the progress bar.

Default: unpresent.

### `animation-duration`

The animation duration in ms.

Default: "300"
npm package: @sec-ant/wc-qr-code
Description: A <qr-code> web component powered by Lit
Author: Ze-Zheng Wu
Latest version: 1.0.5

# @sec-ant/wc-qr-code

[![release status](https://github.com/Sec-ant/wc-qr-code/actions/workflows/release.yml/badge.svg)](https://github.com/Sec-ant/wc-qr-code/actions/workflows/release.yml)

A `<qr-code>` web component powered by [Lit](https://lit.dev/).

## Install

```bash
npm i @sec-ant/wc-qr-code
```

## Usage

This package does not bundle dependencies inside it, and is designed to be used with a build tool. For further information on this design decision, please check [this link](https://lit.dev/docs/tools/publishing/#don't-bundle-minify-or-optimize-modules).

This packages exports 3 import paths: `@sec-ant/wc-qr-code/pure`, `@sec-ant/wc-qr-code/side-effects` and `@sec-ant/wc-qr-code`.

### `@sec-ant/wc-qr-code/pure`

This subpath exports the `QrCodeElement` class. You'll have to manually register it on the [`CustomElementRegistry`](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry) to use the web component.

In your script:

```ts
import { QrCodeElement } from "@sec-ant/wc-qr-code/pure";

customElements.define("qr-code", QrCodeElement);
```

Afterwards, in your html file:

```html
<qr-code value="Hello World!"></qr-code>
```

Before https://github.com/WICG/webcomponents/issues/716 is resolved, you'll have to handle possible tag name collisions yourself.

If you use Typescript and wants `document.createElement("qr-code")` to infer the `QrCodeElement` type for you, you should create a declaration file to augment the types:

```ts
declare global {
  interface HTMLElementTagNameMap {
    "qr-code": QrCodeElement;
  }
}
```

### `@sec-ant/wc-qr-code/side-effects`

This subpath will automatically register `QrCodeElement` on the `CustomElementRegistry` with the tag name `qr-code`, only if the tag name `qr-code` isn't already registered. `HTMLElementTagNameMap` will be automatically augmented.

In your script:

```ts
import "@sec-ant/wc-qr-code/side-effects";
```

Afterwards, in your html file:

```html
<qr-code value="Hello World!"></qr-code>
```

### `@sec-ant/wc-qr-code`

This works just like `side-effects` but also exports the `QrCodeElement` class.

## Attributes

### `value`

The value of the encoded QR code.

Default: ""

### `ecc`

Error correction code level. Case-insensitive.

- "l" or "low"
- "m" or "medium"
- "q" or "quartile"
- "h" or "high"

Default: "low"

### `border`

Size of the quiet zone in module blocks.

Default: "4"

### `scale`

Size of one module block in pixels.

Default: "8"

### `light-color`

The color of light module blocks.

Default: "#fff"

### `dark-color`

The color of dark module blocks.

Default: "#000"
npm package: @sec-block/secjs-circle
Description: This libary used to sync the local time and ntp server time and caculate the working group number
Author: MongoX
Latest version: 1.0.2

# SECJSTimeCircle
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

This libaray would be used to get the next working group, which shoud begin to work.
This libary used dgram third-party libary to use udp protocoll, in case to send and get message from ntp server.

- Using ntp server pool to uniform unix time
- Every 30s switch to next group, which should to work

### API

#### `new secjsCircle(config)`
Instance a circle object and selected the nearest ntp server based on the timezone
- `config`: config json for instance

#### `secjsCircle.initialCircle()`
Initialize the timestamp, when the first group begin to work. Save the time stamp to attribute this.timeStampOfLastGroup

#### `secjsCircle.getWorkingGroupNumber(callback)`
This API is a aync method to get the next group number after a while
- `callback`: a callback function to get the caculated working group number

### `secjsCircle.getNextGroupBeginTimeDiff(currentUnixTime, callback)`
This function used to get the time of next group begin to work

### `secjsCircle.getNextPeriodeBeginTimeDiff(currentUnixTime, callback)`
This function used to get the time of the next periode


### Usage
To use the libary to get the next working group, you need to do following steps.
1. Select the nearest ntp server
```js
const SECjsCircle = require('<path of src>')
const config = {
  circleTimeOut: 30,
  ntpTryOut: 0,
  timeServer: 'DE',
  sumOfGroups: 10,
  isMiningHost: true
}
let secjsCircle = new SECjsCircle(config)
```
2. Initialize the time stamp of the circle if the group at the first time begin to work
```js
secjsCircle.initial(() => {
    // do something
})
```
3. Get the next group number, which should begin to work
```js
secjsCircle.getWorkingGroupNumber((nextWorkingGroupNumber) => {
    let workingGroupNumber = nextWorkingGroupNumber
    console.log(`The next working group should be ${workingGroupNumber}`)
})
```

#### License

MIT
npm package: @sec-block/secjs-common
Description: Common SECBlock Resources, define genesis Block and init Informations
Author: abysmli
Latest version: 0.0.3

# SECJS-COMMON
SECCommon SECBlock Resources, define genesis Block and init Informations

# INSTALL
`npm install @sec-block/secjs-common`

# USAGE

All parameters can be accessed through the ``SECCommon`` class which can be required through the
main package and instantiated either with just the ``chain`` (e.g. 'secblock') or the ``chain``
together with a specific ``hardfork`` provided.

Here are some simple usage examples:

```javascript
const SECCommon = require('@sec-block/secjs-common')

// Access genesis data for SECBlock network
c.genesis().hash // 5f213ac06cfe4a82e167aa3ea430e520be99dcedb4ab47fd8Fertig!f668448708e34c1

// Get bootstrap nodes for chain/network
c.bootstrapNodes() // Array with current nodes
```

# Chain Params

Supported chains:

- ``secblock``

The following chain-specific parameters are provided:

- ``name``
- ``chainId``
- ``networkId``
- ``genesis`` block header values
- ``hardforks`` block numbers
- ``bootstrapNodes`` list

To get an overview of the different parameters have a look at one of the chain-specifc
files like ``secblock.json`` in the ``chains`` directory.

# Bootstrap Nodes

Use the ``SECCommon.bootstrapNodes()`` function to get nodes for a specific chain/network.

# Genesis States

Network-specific genesis files are located in the ``genesisStates`` folder.
npm package: @sec-block/secjs-logger
Description: A simple logging library for SEC-Block System
Author: Li, Yuan
Latest version: 1.0.3

<a name="SEC Logger"></a>

* * *
## SEC Logger
[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard) 

https://github.com/SEC-Block/secjs-logger

### SUMMARY
A simple logging library for SEC-Block

### USAGE
A logger has 5 different levels of logging in a specific order:

'fatal', 'error', 'warn', 'info', 'debug'
Each of these log levels has its own method on the logging instance. You can set the maximum log level on a logger at runtime.

By default, a logger writes to STDOUT, but given a writeable file path, it will log directly to a file.

### Instantiation:
```js
// standardjs style
const logger = require('./logger').createLogger() // logs to STDOUT
const logger = require('./logger').createLogger('development.log') // logs to a file
```

### Logging:
Any of the logging methods take n arguments, which are each joined by ' '. If an argument is not a string, it is string-ified by util.inspect()
```js
logger.info('loading an array', [1,2,3], 'now!')
// info [Sat Jun 12 2018 01:12:05 GMT-0400 (EDT)]  loading an array [ 1, 2, 3, [length]: 3 ] now!
logger.debug('this wont be logged')
// false
logger.setLevel('debug')
logger.debug('this will be logged now')
// debug [Sat Jun 12 2018 01:12:54 GMT-0400 (EDT)]  this will be logged now
```

### Customization:
You can completely customize the look of the log by overriding the format() method on a logger.
```js
logger.format = function(level, date, message) {
  return date.getTime().toString() + '; ' + message
};
logger.debug('message')
// 1276365362167;  message
```

### LICENSE
MIT, see the source.