open-index/open-npm huggingface dataset:
npm package: @fewcha/web3
Description: The `@fewcha/web3` library aims to be an all-in-one toolkit to enable developers interact with Aptos Blockchain and its ecosystem.
Author: fewcha.app
Latest version: 0.1.38

# @fewcha/web3

The `@fewcha/web3` library aims to be an all-in-one toolkit to enable developers interact with Aptos Blockchain and its ecosystem.

Check the documentation at https://docs.fewcha.app/

## Install

Install Aptos SDK and fewcha Web3 to wrapper `window.fewcha` with `TypeScript` types.

```bash
yarn add aptos @fewcha/web3
```

## Supported direct Node URL and Fewcha Wallet

- Node URL, example: `https://fullnode.devnet.aptoslabs.com`
- [Fewcha Wallet](https://fewcha.app)

## Usage

### With Fewcha Wallet

```js
import Web3 from '@fewcha/web3';

const web3 = new Web3();

// ...
<button
  onClick={() => {
    web3.action.connect();
  }}
>
  Connect Aptos
</button>
```

### API

Learn more all functions at https://github.com/fewcha-wallet/aptos-web3/blob/main/packages/web3/src/types.ts

## License

MIT
npm package: @fewings/core
Description: Useful pure functions for frontend development
Author: livemehere
Latest version: 1.5.0

<p align="center">
    <a href="https://github.com/livemehere/fewings">
        <img src="https://github.com/livemehere/fewings/blob/master/img/logo.png?raw=true" alt="logo" width="200" />
    </a>
    <h1 align="center">@fewings/core</h1>      
    <p align="center">
    Collection of pure functions and classes for frontend development
    <br/>
    Provides concise and reusable utility functions for each module
    <br/>
    Serves as the fundamental dependency for other derived packages
    </p>
    <p align="center">
        <a href="https://www.npmjs.com/package/@fewings/core">npm</a>
        &middot;
        <a href="https://github.com/livemehere/fewings/blob/master/packages/core/README.ko.md">한국어</a>
    </p>
</p>

## Introduction

`@fewings/core` is a library that provides various utility functions commonly used in frontend development. Each function is designed to be lightweight and efficient by focusing on minimal functionality.

This library consists of the following modules:

- `classes`: Classes for object-oriented programming (e.g., Emitter)
- `color`: Color-related utilities
- `converter`: Data conversion utilities
- `dom`: DOM manipulation utilities
- `fp`: Functional programming utilities (e.g., debounce)
- `hash`: Hashing algorithms (e.g., djb2)
- `math`: Math utilities (e.g., rand, map, clamp, snap)
- `path`: Path-related utilities
- `qs`: URL query string handling utilities

> 🔍 Each module's functions have simple and clear purposes, so directly referring to the source code is the best way to understand their usage. Most functions have self-explanatory naming, concise implementation, and test code.

## Installation

```bash
# npm
npm install @fewings/core

# yarn
yarn add @fewings/core

# pnpm
pnpm add @fewings/core
```

## Usage

Each module can be imported independently, allowing only the necessary functionality to be included in your bundle.

```javascript
// Import specific function from math module
import { clamp } from '@fewings/core/math';

// Limit a value to a specific range
const limitedValue = clamp(150, 0, 100); // Returns 100

// Import specific function from fp module
import { debounce } from '@fewings/core/fp';

// Create a debounced function
const debouncedFunction = debounce(() => {
  console.log('Window resize completed');
}, 300);

// Apply to event listener
window.addEventListener('resize', debouncedFunction);

// Use hash module
import { djb2 } from '@fewings/core/hash';

const hash = djb2('hello world'); // Generate hash from string
```

## Contributing

Contributions are always welcome! If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request on the [GitHub repository](https://github.com/livemehere/fewings).
npm package: @fewlines/eslint-config-fewlines-js
Description: Shareable ESLint configuration used by Fewlines
Author: Fewlines
Latest version: 1.0.3
Deprecated: This package should not be used anymore, use @fewlines/eslint-config instead

# eslint-config-fewlines-js

Disclaimer: this package is made for our internal usage and is only open source for convenience so we might not consider _Pull Requests_ or _Issues_.

This package includes the shareable ESLint configuration used by Fewlines javascript and typescript projects.

Extends `eslint:recommended`, `plugin:prettier/recommended`, `plugin:react/recommended`

## Usage

```shell
yarn add -D @fewlines/eslint-config-fewlines-js eslint eslint-config-prettier eslint-plugin-prettier prettier eslint-plugin-react
```


Then add these line to your `package.json`:

```json
"eslintConfig": {
  "extends": "@fewlines/fewlines-js"
}
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
npm package: @fewlines/eslint-config-fewlines-ts
Description: Shareable ESLint configuration used by Fewlines for TS projects
Author: Fewlines
Latest version: 1.0.1
Deprecated: This package should not be used anymore, use @fewlines/eslint-config instead

# eslint-config-fewlines-ts

Disclaimer: this package is made for our internal usage and is only open source for convenience so we might not consider _Pull Requests_ or _Issues_.

This package includes the shareable ESLint configuration used by Fewlines typescript projects.

Extends `eslint:recommended`, `@typescript-eslint/eslint-recommended`, `@typescript-eslint/recommended`,

:warning: As this plugin wants to use a minimalist configuration, it relies on using `prettier` via `ESLint` which means you
could have to configure your editor.

See here for VSCode: https://github.com/prettier/prettier-vscode#vs-code-eslint-and-tslint-integration

## Usage

```shell
yarn add -D @fewlines/eslint-config-fewlines-ts eslint \
eslint-config-prettier eslint-plugin-prettier prettier \
@typescript-eslint/eslint-plugin @typescript-eslint/parser
```

Then add these lines to your `package.json`:

```json
"eslintConfig": {
  "extends": "@fewlines/fewlines-ts"
}
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
npm package: @fewlines/fewlines-node-linters
Description: Disclaimer: this package is made internally and is open source for convenience: feel free to use it and suggest amelioration but note that we reserve the right to not think it good for us.
Latest version: 1.0.2
Deprecated: this package should not be used

# fewlines-node-linters

Disclaimer: this package is made internally and is open source for convenience: feel free to use it and suggest amelioration but note that we reserve the right to not think it good for us.

This package includes the shareable configuration used by Fewlines for projects using Javascript and/or CSS.

It contains rules for linting `.js` and `.css` files.

## Usage

```shell
yarn add -D @fewlines/fewlines-node-linters
```

Then add to your `package.json`:

```json
  "eslintConfig": {
    "extends": "@fewlines/fewlines-js"
  },
  "stylelint": {
    "extends": "@fewlines/stylelint-config-fewlines-css"
  }
```
npm package: @fewlines/flops
Description: Fewlines OPS CLI
Author: Fewlines
Latest version: 1.1.2

flops
=====

Fewlines OPS CLI

Disclaimer: this package is made for our internal usage and is only open source for convenience.

## Setup

```
$ brew bundle
$ asdf install
```

## Platform directories

The CLI uses three different directories to deploy an application:

### Library

The library directory is where the base, reusable modules like generic Helm charts or third-party tools manifests.

### Config

The config directory contains the files specifying how to "instanciate" the different services.

For each service, it typically specifies a template to use from the library directory. It also specifies overrides for a given instance of a service.

### Runtime

The runtime directory contains the whole configuration of what's currently running on all the clusters. It is watched by ArgoCD to ensure the clusters are in sync with it.

At any given time, you can know what's running in the clusters by checking this directory.

The result of the deployment is written to this directory by the Flops CLI.

## Usage

### Config initialization

`$ bin/run init`

You'll be asked about the paths for each directory.
This only needs to be run once on your machine, or when the directories change location

### Connect deployment

`$ bin/run deploy-connect`

Answer the questions

### Use in CI

The CLI can also be used in CI mode.

You can pass the following flags to the CLI:

#### init

- `-l`: The path to the library directory
- `-c`: The path to the config directory
- `-r`: The path to the runtime directory

Alternatively you can set the following env variables

`LIBRARY_DIR`: corresponds to the `-l` option
`CONFIG_DIR`: corresponds to the `-c` option
`RUNTIME_DIR`: corresponds to the `-r` option

#### deploy-connect

- `-b`: A json containing the Docker images builds for each service
- `-p`: The projections you would like to apply (a coma separated string)

Alternatively you can set the following env variables

`IMAGE_BUILDS`: corresponds to the `-b` option
`PROJECTIONS`: corresponds to the `-p` option
npm package: @fewlines/fwl-logging
Description: Logging part of Fewlines Web Libraries
Author: Fewlines
Latest version: 1.0.1
Deprecated: Renamed @fwl/logging

# FWL Logging

**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.

This is part of the Fewlines Web Libraries packages.

It provides an interface for either a JSON based or a Key/Value based logger.

Both have the same API and does not provide log levels.

This is intended as we consider that a log should either be there or not be there.
There should not be differences of level between production and development as we won't be able to use debug logging in production.

## Installation

```shell
yarn add @fewlines/fwl-logging
```

## Usage

You first need to create the Logger:

```typescript
import { createLogger } from "@fewlines/fwl-logging";

const KVLogger = createLogger("service-name");
const JSONLogger = createLogger("service-name", "json");
```

After that you make a simple log with the `.log` function with or without arguments:

```typescript
KVLogger.log("this is a log");
// service=service-name message="this is a log"

JSONLogger.log("this is a log");
// {"message":"this is a log","service":"service-name"}

KVLogger.log("this is a log", { additionalData: "value" });
// service=service-name additonalData=value message="this is a log"

JSONLogger.log("this is a log", { additionalData: "value" });
// {"additionalData":"value","message":"this is a log","service":"service-name"}
```

Or you could create a new logger with additional data:

```typescript
const myProcessLogger = KVLogger.withMeta({ process: "my-process" });
myProcessLogger.log("this is a log");
// service=service-name process=my-process message="this is a log"

const myProcessJSONLogger = JSONLogger.withMeta({ process: "my-process" });
myProcessJSONLogger.log("this is a log");
// {"message":"this is a log","service":"service-name","process":"my-process"}
```
npm package: @fewlines/fwl-tracing
Description: Traacing part of Fewlines Web Libraries
Author: Fewlines
Latest version: 1.0.0
Deprecated: Deprecated in favor of @fwl/tracing

# FWL Tracing

**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.

This is part of the Fewlines Web Libraries packages.
It provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).

## Installation

```shell
yarn add @fewlines/fwl-tracing
```

## Getting Started

As OpenTelemetry libraries need to monkey patch packages before them being called, the easiest way is to initialize tracing in a separate file that is required using node’s (or ts-node's) -r option before application code runs.

So for instance, have a `tracing.ts` file with that content:

```typescript
// src/tracing.ts
import { startTracer } from "@fewlines/fwl-tracing";

startTracer({ serviceName: "serviceName" });
```

And start your server with `ts-node -r src/tracing.ts src/index.ts`.

Once you're done, your `index.ts` could get the Tracer with:

```typescript
import { getTracer } from "@fewlines/fwl-tracing";

const tracer = getTracer();
```

## Usage

Once you have a tracer (of type `Tracer`), you will have a `span` method:

```typescript
import { Span, Tracer } from "@fewlines/fwl-tracing";

// ...
function(tracer: Tracer) {
  tracer.span("span name", async (span: Span) => {
    // If you want to add attributes to your span
    span.setAttribute(key, value);

    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do
  });
}
```

This way is the recommended way as it will automatically end the span for you.
However, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:

Here is an example of a logging middleware:

```typescript
import { NextFunction, Request, Response } from "express";
import { Logger } from "@fewlines/fwl-logging";
import { Tracer, Span } from "@fewlines/fwl-tracing";

export function loggingMiddleware(tracer: Tracer, logger: Logger) {
  function onCloseOrFinish(span: Span, startTime: bigint): () => void {
    return function () {
      const response = this as Response;
      response.removeListener("finish", onCloseOrFinish);
      const end = process.hrtime.bigint();
      logger.log(`${response.req.path}: ${response.statusCode} in ${end - startTime}`);
      span.end();
    };
  }
  return function (
    _request: Request,
    response: Response,
    next: NextFunction,
  ): void {
    const startTime = process.hrtime.bigint();
    const span = tracer.createSpan("logging middleware");
    response.once("finish", onCloseOrFinish(span, startTime));
    next();
  };
}
```

Keep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.
The recommended method is to use `tracer.span`.
npm package: @fewlines/javascript-styleguide
Description: Disclaimer: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.
Author: Fewlines
Latest version: 1.0.0

# Fewlines Javascript Styleguide

Disclaimer: this package is made for our internal usage and is only open source for convenience so
we might not consider Pull Requests or Issues. Feel free to fork though.

This package includes the different styles we apply to our JavaScript and TypeScript code.

⚠️ As this plugin wants to use a minimalist configuration, it relies on using prettier via ESLint
which means you could have to configure your editor. The goal is to not have the editor run prettier
directly as it would conflict with ESLint.

## General rules

To enforce consistency throughout our imports and exports, we are using
[eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import).

### Import

The set of rules we chose to organize our imports are the following groups:

- Built in and externals
- Parents, siblings, indexes and path aliases

```js
import { IncomingMessage, ServerResponse } from "http";
import React from "react";

import { CustomError } from "@src/errors";
import { Handler } from "./handler";
```

## Usage

This plugin offer several configurations depending on your project type.

```shell
yarn add -DE @fewlines/javascript-styleguide
```

Add these lines to your package.json:

```json
"eslintConfig": {
  "extends": [
    "./node_modules/@fewlines/javascript-styleguide/node"
  ]
},
"prettier": "@fewlines/javascript-styleguide/prettier"
```

### TypeScript project

Then add these lines to your package.json:

```json
"eslintConfig": {
  "extends": "./node_modules/@fewlines/javascript-styleguide/typescript"
}
```

The TypeScript plugin extends the previous Node plugin so it is not needed.

### React project

Then add these lines to your package.json:

```json
"eslintConfig": {
  "extends": "./node_modules/@fewlines/javascript-styleguide/react"
}
```

The React plugin extends the previous Node plugin so it is not needed.

### React + TypeScript project

⚠️ This preset only aim to remove the `prop-types` checks. You should use it along the `react` and
`typescript` presets.

Then add these lines to your `package.json`:

```json
"eslintConfig": {
  "extends": [
    "./node_modules/@fewlines/javascript-styleguide/react-typescript"
  ]
}
```

The React + Typescript plugin extends the previous Node and TypeScript plugins.

### Remix project

```json
"eslintConfig": {
  "extends": [
    "./node_modules/@fewlines/javascript-styleguide/remix"
  ]
}
```

This version extends the React+TypeScript plugins.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
npm package: @fewlines/stylelint-config-fewlines-css
Description: Shareable config for Stylelint used by Fewlines
Author: Fewlines
Latest version: 2.0.1

# styleint-config-fewlines-css

Disclaimer: this package is made for our internal usage and is only open source for convenience so we might not consider _Pull Requests_ or _Issues_.

Shareable config for Stylelint used by Fewlines

## Usage

```shell
yarn add -D @fewlines/front-scripts stylelint styleint-order
```

Then add these line to your `package.json`:

```json
"stylelint": {
	"extends": "@fewlines/stylelint-config-fewlines-css"
}
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
npm package: @fewlines/stylesheets
Description: Shareable stylesheets used across Fewlines websites
Author: Fewlines
Latest version: 2.0.0

# Fewlines Stylesheets 

Disclaimer: this package is made for our internal usage and is only open source for convenience so we might not consider _Pull Requests_ or _Issues_.

Shareable stylesheets used across Fewlines websites.

## Usage

This package relies on `postcss-custom-properties`, `postcss-color-mod-function`, and `postcss-import` to work propertly.

Just include the stylesheet you want to use like this:

```css
@import "@fewlines/stylesheets/styles/colors.css";
@import "@fewlines/stylesheets/styles/fonts.css";
```
Or you can include all our css in your project like this:
```css
@import "@fewlines/stylesheets/styles/fewlines.css";
```

## Test
There is no automated testing here, but you can serve the folder and look at the `index.html` while you're making some changes in it.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
npm package: @fewlines/ts-workflow
Description: an implementation of the workflow pattern in typescript
Author: tech@fewlines.co
Latest version: 1.0.0

# ts-workflow

Disclaimer: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues.

A TypeScript implementation of the workflow pattern.

## Usage

Using workflow provides a framework to add error handling and logging to your business logic.

The workflow module exports:

- a `Workflow<Input, Result>` that represent the final function
- a `UnexpectedError` error type. This error is thrown if your business logic throws an undeclared error.
- a `Logger` interface with
  - `info` a function to handle usal logging (e.g. `console.log`, `winston.info`...)
  - `error` a function to handle error logging (e.g. `console.error`, `winston.error`...)
- a `Meta` interface that allows you to put a logger and a set of adapters that will be passed to your business logic.
- a `Payload<Input>` type that contains an `input: Input` and a `meta: Meta` field.
- a `makePayload(input: Input, meta: Meta)` function that should be used to create payloads.
- finally the default export is `makeWorkflow` function that use your business logic function to create a workflow. It accepts:
  - `workflowName: string` this should be unique per workflow and is used to identify your workflow in logs
  - `handleRun: (input: Input, adapters?: object) => Promise<Result>` your actual business logic functions. the input that will be passed is the input contained in the payload. the adapters are the adapters contained in the payload's meta.
  - `acceptableErrors` an Array of error classes that are accepted to be thrown by the workflow.

### Exemple of a workflow declaration

```javascript
// src/workflows/dummy-workflow.ts
import makeWorkflow from "workflow"

// A custom error class
export class WrongInput extends Error {}

// this is your actual business logic
function handleRun(input: Input, adapters: object): Promise<Result> {

  const adapter = adapters["dummyAdapter"] || realImplementation

  return someLogic(adapter(input))
}

// this is the errors you handle
const acceptableErrors = [WrongInput]

export default makeWorkflow("dummyWorkflow", handleRun, acceptableErrors)
```

### Exemple of usage in an express handler

```javascript
// src/handlers/some-module.ts
import {UnexpectedError} from "workflow"
import dummyWorkflow, {WrongInput} from "../worflows/dummy-workflow"

export function dummyHandle(req, res) {
  const payload = makePayload({myParam: req.params.myParam}, {logger: {info: console.log, error: console.error}})

  return dummyWorkflow(payload)
    .then(data => res.status(200).json(data))
    .catch(error => {
      if (error instanceof WrongInput) {
        return res.status(422).json({message: error.message})
      } else {
        return res.status(500).json({message: "An unexpected error happened"})
      }
    })
}
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
npm package: @fewprotocol/router-sdk
Description: An sdk for routing swaps using Uniswap v2 and Uniswap v3.
Latest version: 13.4.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: @fewprotocol/sdk-core
Description: ⚒️ An SDK for building applications on top of fewprotocol V3
Latest version: 3.1.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: @fewprotocol/uniswap-v2-sdk
Description: 🛠 An SDK for building applications on top of Uniswap V2
Latest version: 6.3.2

# 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: @fewprotocol/uniswap-v3-sdk
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 5.1.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

[![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: @fewprotocol/universal-router-sdk
Description: sdk for integrating with the Universal Router contracts
Latest version: 17.5.3

# universal-router-sdk
This SDK facilitates interactions with the contracts in [Universal Router](https://github.com/Uniswap/universal-router)

## Usage
Install latest version of universal-router-sdk. Then import the corresponding Trade class and Data object for each protocol you'd like to interact with.

### Trading on Uniswap
warning: `swapERC20CallParameters()` to be deprecated in favor of `swapCallParameters()`
```typescript
import { TradeType } from '@fewprotocol/sdk-core'
import { Trade as V2TradeSDK } from '@fewprotocol/uniswap-v2-sdk'
import { Trade as V3TradeSDK } from '@fewprotocol/uniswap-v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@fewprotocol/router-sdk'

const options = { slippageTolerance, recipient }
const routerTrade = new RouterTrade({ v2Routes, v3Routes, mixedRoutes, tradeType: TradeType.EXACT_INPUT })
// Use the raw calldata and value returned to call into Universal Swap Router contracts
const { calldata, value } = SwapRouter.swapCallParameters(routerTrade, options)
```

## Running this package
Make sure you are running `node v18`
Install dependencies and run typescript unit tests
```bash
yarn install
yarn test:hardhat
```

Run forge integration tests
```bash
forge install
yarn test:forge
```
npm package: @fewprotocol/v2-sdk
Description: 🛠 Few Protocol SDK based on Uniswap V2
Latest version: 10.3.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/).