open-index/open-npm huggingface dataset:
npm package: @swanide/eslint-plugin-swan
Description: swan eslint plugin
Author: kekee000@gmail.com
Latest version: 0.0.3

# @swanide/eslint-plugin-swan

eslint plugin for swan program.

support codes:

- `swan` Baidu smart program tpl language
- `sjs` JavasSript code

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```

Next, install `@swanide/eslint-plugin-swan`:

```
$ npm install @swanide/eslint-plugin-swan --save-dev
```

## Bin

Install `@swanide/eslint-plugin-swan` global.

```
$ npm install eslint @swanide/eslint-plugin-swan -g
```

Use `swan-lint` to lint mini program project.

```
$ swan-lint .
```
Use different lint level.

```
$ SWAN_LINT_CONFIG=[base|recommended|strict] swan-lint .
```

- `base` basic lint rules, must be fixed
- `recommended` recommended lint rules
- `strict` strict lint rules

## Usage

Add `swan` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": [
        "@swanide/swan"
    ]
}
```


Then configure the rules you want to use under the rules section.

```json
{
    "rules": {
        "@swanide/swan/valid-bind": 2
    }
}
```

## Supported Rules

- [array-bracket-spacing](./docs/rules/array-bracket-spacing.md)
- [comment-directive](./docs/rules/comment-directive.md)
- [dot-location](./docs/rules/dot-location.md)
- [dot-notation](./docs/rules/dot-notation.md)
- [html-end-tag](./docs/rules/html-end-tag.md)
- [key-spacing](./docs/rules/key-spacing.md)
- [no-confusing-for-if](./docs/rules/no-confusing-for-if.md)
- [no-duplicate-attributes](./docs/rules/no-duplicate-attributes.md)
- [no-parsing-error](./docs/rules/no-parsing-error.md)
- [no-useless-concat](./docs/rules/no-useless-concat.md)
- [no-useless-mustache](./docs/rules/no-useless-mustache.md)
- [valid-bind](./docs/rules/valid-bind.md)
- [valid-component-nesting](./docs/rules/valid-component-nesting.md)
- [valid-elif](./docs/rules/valid-elif.md)
- [valid-else](./docs/rules/valid-else.md)
- [valid-for](./docs/rules/valid-for.md)
- [valid-if](./docs/rules/valid-if.md)
npm package: @swanide/extension
Description: swanide extension api
Author: kekee000@gmail.com
Latest version: 0.0.6

@swanide/extension
====

swanide 扩展 API，可以在 百度小程序开发工具 中进行扩展开发。

下载 [百度小程序开发工具](https://smartprogram.baidu.com/docs/develop/devtools/history/)。

## 使用方法

在开发者工具 `extension` 扩展中：

```javascript
import {swanideInExtension as swanide} from '@swanide/extension';

export function activate() {
    swanide.ideReady(() => {
        swanide.executeCommand('swanide.simulator.refresh');
    });
}
```
**注意：** extension 扩展的加载顺序可能会在工具 ready 之前，需要调用 `ideReady` 事件才可以运行工具提供的函数。


在开发者工具 `widget` 扩展中：

```javascript
import {ExtensionContext} from 'vscode';
import {swanideInWidget as swanide} from '@swanide/extension';

export function activate(context: ExtensionContext) {
    swanide.executeCommand('swanide.simulator.refresh');
}
```

在开发者工具 `window` 窗口中：

```javascript
import {swanideInWindow as swanide} from '@swanide/extension';

swanide.executeCommand('swanide.simulator.refresh');
```

## 开发者工具扩展点

开发者工具对 vscode 扩展点做了增强，增加了以下几个扩展点：

- widgets 扩展点
- toolbars 扩展点

### widgets 扩展点

开发者工具扩展支持在 renderer 视图注入 widget，每个 widget 为一个扩展模块，在 workbench 主视图加载后进行加载。
widget 模块 为工具提供操作主视图的能力，同时支持更多 swanide 相关API。

package.json 扩展点如下：

```javascript
"contributes": {
    // widget 扩展点
    "widgets": [
        {
            // widget id 模块唯一标识，不可重复
            "id": "swanide-extension-example.widget",
            // widget 入口
            "entry": "./dist/widget.js",
            // 入口加载模式，默认为 amd，由于开发者工具更依赖 commonjs 模块，这里提供了 commonjs 加载模式
            "entryType": "commonjs"
        }
    ]
},
```

widget 入口模块：

```javascript
/**
 * swanide widget 扩展
 */
import {swanide, WidgetContext} from '@swanide/extension';

export function activate(context: WidgetContext) {
    console.log('swanide extension path', context.extensionPath);
    swanide.executeCommand('swanide-extension-example.helloWorld');
}
```

### toolbars 扩展点

开发者工具扩展支持工具栏按钮设置，点击按钮运行指定命令。

package.json 扩展点如下：

```javascript
"contributes": {
    // toolbars 扩展点
    "toolbars": [
        {
            "name": "swanide-extension-example-btn",
            "text": "示例扩展按钮",
            "icon": "search",
            "command": "editor.action.formatDocument",
            "tooltip": "示例扩展按钮",
            "type": "button",
            // 分组：develop | deploy | debug | cloud | guide | info
            "group": "right",
            // 分组内排序
            "order": 100
        }
    ]
},
```
npm package: @swanide/swan-eslint-parser
Description: swan eslint parser
Author: kekee000@gmail.com
Latest version: 0.0.1

@swanide/swan-eslint-parser
----

Swan 模板解析器，将 Swan 模板解析成 AST 语法树，给代码检查工具和小程序编辑器插件使用。

修改自 vue 模板解析器：[vue-eslint-parser](https://github.com/vuejs/vue-eslint-parser)

主要功能：

1. 解析 swan 模板语法成 ast 语法树。
2. 提供兼容 eslint 的 ast 语法树格式，作为 eslint 代码检查工具的 parser。

[Swan 模板语法](https://smartprogram.baidu.com/docs/develop/framework/view_data/)

## test

**更新测试用例**

test cases 在 test/fixtures 目录，在增加新的 features 之后，需要更新 test case。然后运行如下命令更新：

> npm run update-fixtures

**运行测试**

> npm run test

## publish

npm publish
npm package: @swanide/swc-require-rename
Description: rename require function
Author: kekee000
Latest version: 0.0.9

@swanide/swc-require-rename
====

swc plugin to add module prefix.

__@swc/core: ">=1.3.42"__

# config

```javascript
[
    "@swanide/swc-require-rename",
    {
        "modulePrefix": "@swan-module/"
    }
]
```

source:

```javascript
import fs from 'fs';
import {resolve} from 'path';
import {debounce} from 'lodash';
const a = require('../abc');
require('/def');
require('./../def');
export * from 'exp1';
export {ee} from 'exp1';
```

transformed:

```javascript
"use strict";
import fs from '@swan-module/fs';
import {resolve} from '@swan-module/path';
import {debounce} from '@swan-module/lodash';
const a = require('@swan-module/../abc');
require('@swan-module//def');
require('@swan-module/./../def');
export * from '@swan-module/exp1';
export {ee} from '@swan-module/exp1';
```
npm package: @swanide/swc-web-debug
Description: web debug plugin
Author: kekee000
Latest version: 0.0.1

@swanide/swc-web-debug
====

# config

```javascript
[
    "@swanide/swc-web-debug",
    {}
]
```

source:

```javascript
App({
    onLaunch(options) {
        let a = options;
        console.log(a)
    },
    onShow(options) {
    },
    onHide() {
    }
});
```

transformed:

```javascript
var _$_ = {
    "f": "DEBUG_MODULE_PATH",
    "enable": typeof Agent === 'function',
    "warn": function() {}
};
_$_.p = _$_.enable && Agent.p && Agent.p.bind(Agent) || _$_.warn;
_$_.register = _$_.enable && Agent.register && Agent.register.bind(Agent) || _$_.warn;
_$_.register({
    "path": _$_.f,
    "contextId": _$_.f,
    "stickyFlag": true,
    "fingerFlag": false,
    "debuggerLine": [],
    "stickyLine": [
        1,
        3,
        4
    ],
    "scope": {
        1: [
            1,
            "options"
        ],
        3: [
            1,
            "a"
        ],
        6: [
            1
        ],
        7: [
            1
        ]
    },
    "function": {}
}, "DEBUG_MODULE_TEMPLATE");
while(eval(_$_.p(_$_.f, 1, 1))){}
App({
    onLaunch (options) {
        while(eval(_$_.p(_$_.f, 3, 3))){}
        let a = options;
        while(eval(_$_.p(_$_.f, 4, 3))){}
        console.log(a);
    },
    onShow (options1) {},
    onHide () {}
});
```
npm package: @swankylegg/voice-io
Description: A browser-based speech recognition and synthesis assistant
Author: Andrew Swank
Latest version: 1.0.11

# Voice I/O

Browser-based Speech Recognition & Speech Synthesis with support for multiple languages and voices.

## Quickstart

```bash
npm install @swankylegg/voice-io
```

```javascript
import { VoiceIO } from "@swankylegg/voice-io";

// Initialize
const voice = new VoiceIO();

// Listen for speech
voice.setState(voice.states.LISTENING);

// Handle speech recognition
voice.config.onRecognitionResult = (results, bestTranscript) => {
  console.log("User said:", bestTranscript);

  // Respond with speech
  voice.setState(voice.states.RESPONDING, "I heard you!");
};
```

## Demo

Try it out: [Live Demo](https://swankylegg.github.io/voice-io/)

## Browser Support

This library uses the [Web Speech API](https://caniuse.com/?search=Web%20Speech%20API) and requires browser support for:

- `SpeechRecognition` (or `webkitSpeechRecognition`)
- `speechSynthesis`

## Voice Support

Voice I/O automatically detects available system voices for speech synthesis. Different operating systems and browsers provide different voices:

- **macOS/iOS**: High-quality system voices in multiple languages
- **Windows**: Microsoft system voices + installed language packs
- **Android**: System voices vary by device/manufacturer
- **Chrome**: Additional cloud-based voices when online

To get available voices:

```javascript
voice.getVoices(); // Get all available voices
voice.getVoicesForCurrentLanguage(); // Get voices matching current language
```

To set a specific voice:

```javascript
voice.setVoice("Samantha"); // Use a specific voice by name
```

## Language Support

Voice I/O supports multiple languages for both recognition and synthesis. Available languages include:

- English (en-US)
- Spanish (es-ES)
- French (fr-FR)
- German (de-DE)
- Italian (it-IT)
- Japanese (ja-JP)
- Korean (ko-KR)
- Chinese (zh-CN)

Note: Actual language availability depends on browser support for both recognition and synthesis in the selected language. The library will automatically filter voices to match the selected language.

### States

Voice I/O has four possible states:

- `IDLE`: Default state, not listening or speaking

  🎤🚫 | 🔈🚫

- `LISTENING`: Actively listening for speech input

  🎤🟢 | 🔈🚫

- `THINKING`: Transitional state between listening and responding (use for loading states)

  🎤🚫 | 🔈🚫

- `RESPONDING`: Currently speaking using speech synthesis

  🎤🚫 | 🔊🟢

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @swanning/plgin-http-send
Description: A umi plugin
Author: han.zhou
Latest version: 1.1.14

# @swanning/plgin-http-send

A umi plugin

## Install

```bash
pnpm i @swanning/plgin-http-send
```

## Usage

Configure in `.umirc.ts`,

```js
export default {
  plugins: [
    ['@swanning/plgin-http-send'],
  ],
}
```

## Options

TODO

## LICENSE

MIT
npm package: @swanning/plugin-http-request
Description: A umi plugin
Author: han.zhou
Latest version: 1.1.17

# @swanning/plgin-http-send

A umi plugin

## Install

```bash
pnpm i @swanning/plgin-http-send
```

## Usage

Configure in `.umirc.ts`,

```js
export default {
  plugins: [
    ['@swanning/plgin-http-send'],
  ],
}
```

## Options

TODO

## LICENSE

MIT
npm package: @swanning/plugin-http-send
Description: A umi plugin
Author: han.zhou
Latest version: 1.1.16

# @swanning/plgin-http-send

A umi plugin

## Install

```bash
pnpm i @swanning/plgin-http-send
```

## Usage

Configure in `.umirc.ts`,

```js
export default {
  plugins: [
    ['@swanning/plgin-http-send'],
  ],
}
```

## Options

TODO

## LICENSE

MIT
npm package: @swanning/plugins
Description: A umi plugin
Author: han.zhou
Latest version: 1.1.24

# @swanning/plgin-http-send

A umi plugin

## Install

```bash
pnpm i @swanning/plgin-http-send
```

## Usage

Configure in `.umirc.ts`,

```js
export default {
  plugins: [
    ['@swanning/plgin-http-send'],
  ],
}
```

## Options

TODO

## LICENSE

MIT
npm package: @swap-coffee/sdk
Description: SDK for swap.coffee DEX aggregator
Author: CatCoderr
Latest version: 1.5.4

<p align="center">
  <a href="https://swap.coffee" target="blank"><img src="/assets/logo.svg" width="130" alt="swap.coffee logo" /></a>
</p>

<p align="center">SDK for swap.coffee DEX aggregator</p>

<p align="center">
<a href="https://www.npmjs.com/package/@swap-coffee/sdk"><img alt="npm" src="https://img.shields.io/npm/v/%40swap-coffee%2Fsdk?labelColor=%23fffff&color=%233e1c00"></a>
<a href="https://opensource.org/licenses/mit"><img alt="License" src="https://img.shields.io/badge/license-MIT-blue"></a>
<a href="https://docs.swap.coffee"><img alt="documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen"></a>
</p>

## Installation

```bash
npm install @swap-coffee/sdk
```

Documentation can be found [here](https://docs.swap.coffee).


## Basic usage

Swapping assets using our SDK and [TonConnect SDK](https://www.npmjs.com/package/@tonconnect/sdk)

```typescript
import { waitForRouteResults } from './transactions';

const connector = await setupTonConnect();
const routingApi = new RoutingApi();

const assetIn: ApiTokenAddress = {
  blockchain: 'ton',
  address: 'native', // stands for TON
};
const assetOut: ApiTokenAddress = {
  blockchain: 'ton',
  address: 'EQCl0S4xvoeGeFGijTzicSA8j6GiiugmJW5zxQbZTUntre-1', // CES
};

const input_amount = 5; // 5 TON

const route = await routingApi.buildRoute({
  input_token: assetIn,
  output_token: assetOut,
  output_amount: 200, // desired amount of output token
});

const transactions = await routingApi.buildTransactionsV2({
  sender_address: connector.account?.address!!,
  slippage: 0.1,
  paths: route.data.paths, // note: use route.data here
});


let messages = [];

for (const transaction of transactions.data.transactions) {
  messages.push({
    address: transaction.address,
    amount: transaction.value,
    payload: transaction.cell,
  });
}

await connector.sendTransaction({
  validUntil: Date.now() + 5 * 60 * 1000,
  messages: messages,
});

const results = await waitForRouteResults(transactions.data.route_id, routingApi);
```
And here is our transaction:

![img.png](assets/img.png)

Full example code can be found [here](examples/swap.ts)

## License

swap.coffee SDK is [MIT licensed](LICENSE).

## Copyright

swap.coffee &copy; 2024
npm package: @swap-coffee/ui-sdk
Description: User Interface SDK of swap.coffee DEX aggregator for integration in web applications
Author: swap.coffee
Latest version: 1.4.1

<p align="center">
  <a href="https://swap.coffee" target="blank"><img src="/assets/logo.svg" width="130" alt="swap.coffee logo" /></a>
</p>

<p align="center">User Interface SDK of swap.coffee DEX aggregator for integration in web applications</p>

<p align="center">
<a href="https://www.npmjs.com/package/@swap-coffee/ui-sdk"><img alt="npm" src="https://img.shields.io/npm/v/%40swap-coffee%2Fui-sdk?labelColor=%23fffff&color=%233e1c00"></a>
<a href="https://opensource.org/licenses/mit"><img alt="License" src="https://img.shields.io/badge/license-MIT-blue"></a>
<a href="https://docs.swap.coffee"><img alt="documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen"></a>
</p>

## Installation

```bash
npm install @swap-coffee/ui-sdk
```

Documentation can be found [here](https://docs.swap.coffee).

## License

swap.coffee UI SDK is [MIT licensed](LICENSE).

## Copyright

swap.coffee &copy; 2025
npm package: @swapbills/xchange-rate
Description: A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.
Author: Rubin Apore
Latest version: 1.1.8

# Exchange Rate Extractor

## Description

A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.


### Usage

```js
import xChanger from '@swapbills/xchange-rate'

const xChangeService = xChanger()

const listAllCurrencies = await xChangeService.getCurrencies()
/*
 [{
  "symbol":"AED",
  "name":"United Arab Emirates Dirham",
  "symbol_native":"د.إ.‏",
  "decimal_digits":2,
  "rounding":0,
  "code":"AED",
  "name_plural":"UAE dirhams"
}, ... ] about 168 objects in  a list
*/
const dollarInfo = await xChangeService.getCurrencyInfo('usd')
/*
{
  "symbol":"$",
  "name":"US Dollar",
  "symbol_native":"$",
  "decimal_digits":2,
  "rounding":0,
  "code":"USD",
  "name_plural":"US dollars"
}
*/

const dollarToCediRate = await xChangeService.getRate('ghs','usd')
/*
  4.30
*/

const chartUri = await xChangeService.getChartUri('ghs','usd')
/*
  https://www.google.com/finance/getchart?x=CURRENCY&p=1Y&i=86400&q=GHSUSD
*/ visit this uri and you see a trend chart


```


Development Quickstart

```
$ git clone https://github.com/swapbills/xchange-rate.git
$ cd xchange-rate
$ npm install
$ npm run start
```

## Development and Testing

### Source Code

The [xchange-rate source] is hosted on GitHub.
Clone the project with

```
$ git clone git@github.com:swapbills/xchange-rate.git
```

[xchange-rate source]: https://github.com/swapbills/xchange-rate

### Requirements

You will need [Node.js].

Be sure that all commands run under the correct Node version, e.g.,
if using [nvm], install the correct version with

```
$ nvm install
```

and set the active version for each shell session with

```
$ nvm use
```

Install the development dependencies with

```
$ npm install
```

[Node.js]: https://nodejs.org/
[nvm]: https://github.com/creationix/nvm

### Tasks

Primary development tasks are defined under `scripts` in `package.json`
and available via `npm run`.
View them with

```
$ npm run
```

#### Production Build

Lint, test, and transpile the production build to `lib` with

```
$ npm run build
```


## License

This npm package is Copyright (c) 2016-2017 SwapBills Global.

## Warranty

This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are
disclaimed. In no event shall the copyright holder or contributors be liable for
any direct, indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused and on
any theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.
npm package: @swapi-finance/contracts
Description: Contracts for Swapi Finance 🐝
Author: Worker bee
Latest version: 0.8.9

# Swapi Smart Contracts
This repo contains all of the smart contracts used to run [Swapi](https://www.swapi.finance/).

## Deployed Contracts
none on mainnet.

## Used Contracts
Frontend uses Quickswap already deployed contracts

### Polygon Mumbai Testnet

Factory address: [0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32](https://mumbai.polygonscan.com/address/0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32)

Router address: [0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff](https://mumbai.polygonscan.com/address/0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32)

### Polygon Mainnet

Factory address (Quickswap): [0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32](https://polygonscan.com/address/0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32)

Router address: [0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff](https://polygonscan.com/address/0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff)

## Running
These contracts are compiled and deployed using [Hardhat](https://hardhat.org/). They can also be run using the Remix IDE.

To prepare the dev environment, run `yarn install`. To compile the contracts, run `yarn compile`. Yarn is available to install [here](https://classic.yarnpkg.com/en/docs/install/#debian-stable) if you need it.

## Accessing the ABI
If you need to use any of the contract ABIs, you can install this repo as an npm package with `npm install --dev @swapi-finance//contracts`. Then import the ABI like so: `import { abi as IUniswapV2PairABI } from '@swapi-finance//contracts/artifacts/contracts/swapi-core/interfaces/IUniswapV2Pair.sol/IUniswapV2Pair.json'`.

## Attribution
These contracts were adapted from these repos:
My Baker baguette-exchange : [contracts] (https://github.com/baguette-exchange/contracts)
Uniswap : [uniswap-v2-core](https://github.com/solidity-uniswap-lib/uniswap-v2-core), [uniswap-v2-periphery](https://github.com/solidity-uniswap-lib/uniswap-v2-core), and [uniswap-lib](https://github.com/solidity-uniswap-lib/uniswap-lib).

Synthetix's StakingRewards:
https://github.com/Synthetixio/synthetix/blob/v2.98.2/contracts/StakingRewards.sol
Tests:
https://github.com/Synthetixio/synthetix/blob/v2.98.2/test/contracts/StakingRewards.js

vittominacori (Vittorio Minacori)'sETH Token Recover:
https://vittominacori.github.io/eth-token-recover/
https://github.com/vittominacori/eth-token-recover


# Warning

## First Forge tests compilation
In case compilation fails with the following error:
```
[⠊] Compiling...
Error:
Encountered invalid solc version in test/StakingRewards.t.sol: Failed to parse solidity version >= 0.6.0 <=0.8.0: unexpected character ',' while parsing major version number
```

Set the solc version by adding in foundry.toml:
```
  auto_detect_solc = false
  solc = "0.8.23"
```
run once then revert the changes.

## Tests

tests contracts compilation takes up to 20+ Gb of RAM, so be sure to have enough memory available before doing so.

Github actions for running tests are disabled for now, as they are not able to compile the contracts due to the memory limit (12-16 Gb).
```

Tests currently not working:
 - test/eth-token-recover
npm package: @swapi-finance/sdk
Description: 🛠 An SDK for building applications on top of Swapi. 🐝
Latest version: 0.26.11

# Swapi SDK
This repo contains tools for developing with [Swapi](https://www.swapi.finance/).

## Running
This project uses standard npm and yarn workflows.

Install dependencies

```sh
yarn
```

Compile
```sh
yarn build
```

Yarn is available to install [here](https://classic.yarnpkg.com/en/docs/install/#debian-stable) if you need it.

## Installation
This project is available as an npm packege. Add to your project with `npm install @swapi-finance/sdk`

## Attribution
This code was adapted from this baguette-exchange repo: [sdk](https://github.com/baguette-exchange/sdk).
npm package: @swapit/sdk
Description: 🛠 An SDK for building applications on top of Pancakeswap.
Latest version: 1.0.1

# Pancakeswap SDK Testnet

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).