open-index/open-npm huggingface dataset:
npm package: @mean-finance/sdk
Description: This repository contains the code for the Mean Finance sdk.
Latest version: 0.0.237

# Mean Finance SDK

This repository contains the code for the Mean Finance sdk.

## 🧪 Installing

### Yarn

```bash
yarn add @mean-finance/sdk
```

### NPM

```bash
npm install @mean-finance/sdk
```

## Usage

### 👷🏽‍♀️ Building the SDK

```javascript
import { buildSdk } from "@mean-finance/sdk";

const sdk = buildSdk(config);
```

### ⚖️ Getting balance for multiple tokens on several chains

```javascript
const accountBalances = await sdk.balanceService.getBalancesForTokens({
  account: "0x000000000000000000000000000000000000dead",
  tokens: {
    // [chainId]: [0xTokenAddress]
    [Chains.ETHEREUM.chainId]: [
      // Ethereum
      "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
      "0x6b175474e89094c44da98b954eedeac495271d0f", // DAI
    ],
    [Chains.OPTIMISM.chainId]: [
      // Optimism
      "0x7f5c764cbc14f9669b88837ca1490cca17c31607", // USDC
      "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", // DAI
    ],
  },
  // Optional config
  config: {
    timeout: "30s",
  },
});

const usdcBalanceOnEthereum =
  accountBalances[Chains.ETHEREUM.chainId][
    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
  ];
```

### 💸 Getting allowances of multiple spenders for a token

```javascript
const accountAllowances = await sdk.allowanceService.getAllowances({
  chainId: Chains.ETHEREUM.chainId,
  token: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
  owner: "0x000000000000000000000000000000000000dead",
  spenders: ["0x6666666600000000000000000000000000009999"],
});

const amountThatDevilCanSpend =
  accountAllowances["0x6666666600000000000000000000000000009999"];
```

### 🔄 Quoting all dex aggregators for a trade

```javascript
const allQuotes = await sdk.quoteService.getAllQuotes({
  request: {
    chainId: Chains.ETHEREUM.chainId, // Ethereum
    sellToken: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    buyToken: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    order: {
      type: "sell",
      sellAmount: utils.parseUnits("1000", 6), // 1000 USDC
    },
    slippagePercentage: 1, // 1%
    takerAddress: signer.address,
    // Optional gas speed
    gasSpeed: {
      speed: "instant",
    },
  },
  // Optional config
  config: {
    sort: {
      by: "most-swapped-accounting-for-gas",
    },
  },
});

const bestTradeBySort = allQuotes[0];
await signer.sendTransaction(bestTradeBySort.tx);
```

## 👨‍💻 Development environment

- Install dependencies

```bash
yarn install
```

## 📖 Docs

WIP - Will be at [docs.mean.finance](https://docs.mean.finance)
npm package: @mean-stream/nestx
Description: [![NPM version](https://badge.fury.io/js/@mean-stream%2Fnestx.svg)](https://www.npmjs.com/package/@mean-stream/nestx)
Latest version: 0.14.0

# nestx

[![NPM version](https://badge.fury.io/js/@mean-stream%2Fnestx.svg)](https://www.npmjs.com/package/@mean-stream/nestx)

nestx is an extension package for NestJS apps.

## Installation

```
$ npm install @mean-stream/nestx
```

## Usage

Nestx provides many standalone modules that can be combined at will.

- [Events](./src/lib/event) - `@mean-stream/nestx/event` - Simple event gateway and emitter based on NATS.
- [Errors](./src/lib/error) - `@mean-stream/nestx/error` (formerly `@mean-stream/nestx/not-found`) - Simplified error handling and documentation with Swagger.
- [Ref](./src/lib/ref) - `@mean-stream/nestx/ref` - Declare model properties as ObjectIds with support for Swagger, validation and populate.
- [Resource](./src/lib/resource) - `@mean-stream/nestx/resource` - Helpers for CRUD services and controllers.

Submodules can be imported individually or all at once:

```ts
import {EventModule, NotFound, Ref} from '@mean-stream/nestx';
// or
import {EventModule} from '@mean-stream/nestx/event';
import {NotFound} from '@mean-stream/nestx/not-found';
import {Ref} from '@mean-stream/nestx/ref';
```

The second form is preferred if you want to avoid some optional dependencies.
Keep in mind that it requires `"moduleResolution": "NodeNext"` in your `tsconfig.json`.

## Development

### Building

Run `nx build nestx` to build the library.

### Running unit tests

Run `nx test nestx` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @mean-stream/ngbx
Description: [![NPM version](https://badge.fury.io/js/@mean-stream%2Fngbx.svg)](https://www.npmjs.com/package/@mean-stream/ngbx)
Latest version: 0.14.0

# ngbx

[![NPM version](https://badge.fury.io/js/@mean-stream%2Fngbx.svg)](https://www.npmjs.com/package/@mean-stream/ngbx)

Helpful additional components for [ng-bootstrap](https://ng-bootstrap.github.io).

## Installation

1. [Install ng-bootstrap](https://ng-bootstrap.github.io/#/getting-started#installation) first.
2. `npm install @mean-stream/ngbx`

## Compatibility

| ngbx | Angular | ng-bootstrap | bootstrap |
|------|---------|--------------|-----------|
| 0.7  | ^15.2   | ^14          | ^5.2.3    |
| 0.8  | ^15.2   | ^14          | ^5.2.3    |
| 0.12 | ^16.2   | ^14          | ^5.2.3    |
| 0.13 | ^19.0   | ^18          | ^5.2.3    |
| 0.14 | ^20.0   | ^19          | ^5.2.3    |

For older versions, see [ng-bootstrap-ext](https://github.com/Clashsoft/ng-bootstrap-ext#compatibility).

## Usage

Ngbx provides many standalone modules that can be combined at will.

- [Darkmode](./src/lib/darkmode) - Dark theme switches for `bootstrap-darkmode`.
- [Forms](./src/lib/forms) - Simply create forms based on `class-validator` annotations.
- [Modals](./src/lib/modal) - Simplifies modals with `ng-bootstrap`.
- [Route Tabs](./src/lib/route-tabs) - Tabs that are based on Angular Router routes.
- [Toasts](./src/lib/toast) - `ToastService` from `ng-bootstrap` with additional features.
npm package: @meanc/codemirror-ext
Description: [简体中文](https://github.com/cloudflypeng/codemirror-ext/blob/main/README.cn.md)|[English](https://github.com/cloudflypeng/codemirror-ext)
Latest version: 0.0.4

[简体中文](https://github.com/cloudflypeng/codemirror-ext/blob/main/README.cn.md)|[English](https://github.com/cloudflypeng/codemirror-ext)

This is an image upload plugin for CodeMirror that supports pasting or dragging and dropping images and uploading them to a server. The plugin allows using either a default fetch upload logic or custom upload logic.

```bash
npm install @meanc/codemirror-ext
```

Usage 


```javascript
import { EditorState, EditorView, basicSetup } from "codemirror";
import { markdown } from "@codemirror/lang-markdown";
import { PicUploadExt } from "@meanc/codemirror-ext";

// official upload logic
const imgUploadExt = PicUploadExt({
  storageServer: 'http://www.example/imagePut',
  callback: (res) => {
    return res.data.url;
  }
});

// custom upload logic
const customUpload = async (file) => {
  const formData = new FormData();
  formData.append('file', file);
  const res = await fetch('http://www.example/imagePut', {
    method: 'POST',
    body: formData
  });
  const json = await res.json();
  return json.data.url;
};

const uploadCustomExt = PicUploadExt({
  upload: customUpload
});

// 初始化编辑器
const startState = EditorState.create({
  extensions: [basicSetup, markdown(), imgUploadExt] // 或者 uploadCustomExt
});

const view = new EditorView({
  state: startState,
  parent: document.body // 或者你的容器元素
});
```

Configuration Options

	•	storageServer: The URL of the storage server, default is empty.
	•	upload: Custom upload function that returns an image URL. This function should accept a File object and return a Promise<string>.
	•	callback: A callback function to process the upload response and return the image URL.
npm package: @meanc/otter
Description: 以水獭为名的clash tui
Latest version: 0.0.4

# 🦦 Otter

Otter (ot) 是一个基于 [Mihomo](https://github.com/MetaCubeX/mihomo)
核心的极简主义 Clash TUI
客户端。它专为速度和可组合性而设计，提供流畅的命令行体验和交互式界面。
<img width="1036" height="532" alt="image" src="https://github.com/user-attachments/assets/3d2969ed-41ee-4bd3-b37a-97173bea2d50" />

<img width="658" height="426" alt="image" src="https://github.com/user-attachments/assets/e82dfb1a-3548-45b4-be99-6f4a3bf1ea43" />



## ✨ 特性

- **轻量级**: 基于 Bun 和 Ink 构建，启动迅速。
- **Mihomo 核心**: 使用高性能的 Mihomo (Clash Meta) 作为底层核心。
- **交互式 TUI**: 提供美观的终端用户界面，支持键盘导航。
- **订阅管理**: 支持多种订阅格式（Clash YAML, Base64, VMess/SS/Trojan 链接）。
- **系统集成**: 一键开启/关闭 macOS 系统代理，支持 Shell 代理注入。
- **实时监控**: 实时查看流量速度、内存占用和节点状态。

## 📦 安装

### 通过 npm (推荐)

确保你已经安装了 [Bun](https://bun.sh/)。

```bash
bun add -g @meanc/otter
```

### 从源码安装

```bash
# 克隆仓库
git clone https://github.com/yourusername/otter.git
cd otter

# 安装依赖
bun install

# 链接到全局 (可选)
bun link
```

## 🚀 使用指南

### 核心控制 (Core)

- `ot up` / `ot start`: 启动 Clash 核心（后台静默运行）。
- `ot down` / `ot stop`: 停止 Clash 核心。
- `ot status`: 查看核心运行状态、版本、内存占用、实时流量及订阅信息。
- `ot log`: 实时查看内核日志。

### 订阅管理 (Subscription)

- `ot sub add <url> [name]`: 添加订阅源。支持自动解析 Base64 和节点链接。
- `ot sub rm <name>`: 删除订阅源。
- `ot sub update <name>`: 更新指定订阅源。
- `ot sub use <name>`: 切换当前使用的订阅源。
- `ot sub ls`: 列出所有订阅源。

### 代理管理 (Proxy)

- `ot ls`: 列出所有代理组及当前选中的节点。
- `ot use [node_name]`: 切换节点。支持模糊搜索。
  - `ot use -p <index>`: 通过序号切换 `Proxy` 组节点。
  - `ot use -g <index>`: 通过序号切换 `GLOBAL` 组节点。
- `ot test`: 测试当前节点的延迟。
- `ot best`: 自动测试并切换到延迟最低的节点。

### 系统集成 (System)

- `ot on`: 开启 macOS 系统代理。
- `ot off`: 关闭 macOS 系统代理。
- `ot shell`: 输出当前 Shell 的代理环境变量命令（可直接 `eval $(ot shell)`）。
- `ot mode [rule|global|direct]`: 查看或切换代理模式（规则/全局/直连）。

### 交互式界面 (TUI)

- `ot ui`: 进入全屏交互式界面。

**TUI 快捷键**:

- `↑/↓`: 上下移动光标。
- `←/→` 或 `Tab`: 在代理组列表和节点列表之间切换。
- `Enter`: 选中节点或展开组。
- `s`: 快速开启/关闭系统代理。
- `m`: 切换代理模式 (Rule/Global/Direct)。
- `q`: 退出 TUI。

## 🛠️ 开发

本地运行：

```bash
bun run index.ts <command>
```

## 📝 许可证

GPL-3.0 License
npm package: @meanc/webext-fetch
Description: 这是一个chrome插件，用于使用 background 进行数据交互代理。
Latest version: 0.0.3

这是一个chrome插件，用于使用 background 进行数据交互代理。

### 1. 安装
  ```bash
  npm i @meanc/webext-fetch
  ```

### 2. 开启background
  ```javascript
  import {backgroundListener} from '@meanc/webext-fetch'
  backgroundListener()
  ```

### 3. 使用
  ```javascript
  import {efetch} from '@meanc/webext-fetch'
  efetch('https://api.meanc.cn/v1/user/info', {
    method: 'GET',
  }).then(res => {
    console.log(res)
  })
  ```