open-index/open-npm huggingface dataset:
npm package: @lidick/mt-react-view
Description: A React component library
Author: dickli
Latest version: 2.0.20

# mt-react-view

### 介绍

mt-react-view ui组件库

minitool ui - a component library for react

### 示例

#### 引入样式

```javascript
import "/node_modules/@lidick/mt-react-view/dist/style/index.css"
```
npm package: @lidig-keji/react-ld-amap
Description: AMap Component Based On React
Author: ohislh@gmail.com
Latest version: 1.0.3

<img src="https://cloud.githubusercontent.com/assets/3898898/23833571/e5c7ae68-0782-11e7-8590-cecf4f3c969f.png" width="118" height="118" />

# @lidig/react-ld-amap

> react-ld-amap 是一个基于 [react-amap](https://elemefe.github.io/react-amap/) 对公安内网地图做出的定制版地图组件库。

## 在线预览

[react-ld-amap](http://192.168.70.10:9001/react-ld-amap/)

## 文档

>  文档大部分接口描述和源代码表现一致，如果出现不一致的情况按源代码表现为准，并补充完善文档

[JavaScript API用户参考手册-新版20170325.docx](http://work.lidig.com:8088/framework/front-framework/react-ld-amap/tree/master/docs)

## 地图服务

`react-amap` 是基于线上高德地图的瓦片服务，但公安内网环境有自己的一套地图瓦片服务，我们在获取到公安内网地图代码的情况下需要对瓦片请求的地址做代理转换。

### 部署

在平时开发环境，我们做了基于 `nginx` 代理的方式请求线上高德地图的瓦片服务。

* [docker](http://work.lidig.com:8088/knowledge-base/wiki/tree/master/13%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/201908/container-image/smart-map)

## 使用

```
# 安装
yarn add @lidig/react-ld-amap
```

## 开发

```
# 安装
yarn

# 开发
yarn start # http://localhost:9001

# 发布
yarn pub
```
npm package: @lidig/create-ld-umi
Description: Creates a UmiJS application using the command line.
Latest version: 0.12.7

# create-ld-umi

基于 [create-umi](https://github.com/umijs/create-umi) 的Web端脚手架.

## Usage

```bash
$ npm install @lidig/create-ld-umi -g
$ create-ld-umi [appName]
```

## LICENSE

MIT
npm package: @lidig/react-ld-amap
Description: AMap Component Based On React
Author: ohislh@gmail.com
Latest version: 0.4.14

<img src="https://cloud.githubusercontent.com/assets/3898898/23833571/e5c7ae68-0782-11e7-8590-cecf4f3c969f.png" width="118" height="118" />

# @lidig/react-ld-amap

> react-ld-amap 是一个基于 [react-amap](https://elemefe.github.io/react-amap/) 对公安内网地图做出的定制版地图组件库。

## 在线预览

[react-ld-amap](http://192.168.70.10:9001/react-ld-amap/)

## 文档

>  文档大部分接口描述和源代码表现一致，如果出现不一致的情况按源代码表现为准，并补充完善文档

[JavaScript API用户参考手册-新版20170325.docx](http://work.lidig.com:8088/framework/front-framework/react-ld-amap/tree/master/docs)

## 地图服务

`react-amap` 是基于线上高德地图的瓦片服务，但公安内网环境有自己的一套地图瓦片服务，我们在获取到公安内网地图代码的情况下需要对瓦片请求的地址做代理转换。

### 部署

在平时开发环境，我们做了基于 `nginx` 代理的方式请求线上高德地图的瓦片服务。

* [docker](http://work.lidig.com:8088/knowledge-base/wiki/tree/master/13%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/201908/container-image/smart-map)

## 使用

```
# 安装
yarn add @lidig/react-ld-amap
```

## 开发

```
# 安装
yarn

# 开发
yarn start # http://localhost:9001

# 发布
yarn pub
```
npm package: @lidio601/logger
Description: A logger class
Author: Fabio Cigliano
Latest version: 1.0.3

# Logger

### Requirements

1. [Yarn Package Manager](https://yarnpkg.com/)
2. [Node Version Manager](https://github.com/nvm-sh/nvm)

### Local development

1. Run `nvm use`
2. Run `make setup`
3. Run `make build`

### Tasks

This project uses a [makefile](https://www.gnu.org/software/make/manual/make.html) to run commands.

| Command     | Description                                      |
| ----------- | ------------------------------------------------ |
| setup       | Base first-time install of project locally       |
| build       | Build the project                                |
| build-patch | Build the project and increase the patch version |
| prettier    | Run [ESLint](https://eslint.org/)                |
| test        | Launches the test runner                         |
| test-build  | Check for syntax errors.                         |
| help        | Display a list of commands                       |
npm package: @lidio601/react-native-loading-overlay
Description: A React Native package that provides a LoadingOverlay + HOC + HOOK
Author: Fabio Cigliano
Latest version: 1.0.2

# Logger

### Requirements

1. [Yarn Package Manager](https://yarnpkg.com/)
2. [Node Version Manager](https://github.com/nvm-sh/nvm)

### Local development

1. Run `nvm use`
2. Run `make setup`
3. Run `make build`

### Tasks

This project uses a [makefile](https://www.gnu.org/software/make/manual/make.html) to run commands.

| Command     | Description                                      |
| ----------- | ------------------------------------------------ |
| setup       | Base first-time install of project locally       |
| build       | Build the project                                |
| build-patch | Build the project and increase the patch version |
| prettier    | Run [ESLint](https://eslint.org/)                |
| test        | Launches the test runner                         |
| test-build  | Check for syntax errors.                         |
| help        | Display a list of commands                       |
npm package: @lidio601/react-native-snackbar
Description: A React Native package that provides a Snackbar + HOC + HOOK
Author: Fabio Cigliano
Latest version: 1.0.1

# Logger

### Requirements

1. [Yarn Package Manager](https://yarnpkg.com/)
2. [Node Version Manager](https://github.com/nvm-sh/nvm)

### Local development

1. Run `nvm use`
2. Run `make setup`
3. Run `make build`

### Tasks

This project uses a [makefile](https://www.gnu.org/software/make/manual/make.html) to run commands.

| Command     | Description                                      |
| ----------- | ------------------------------------------------ |
| setup       | Base first-time install of project locally       |
| build       | Build the project                                |
| build-patch | Build the project and increase the patch version |
| prettier    | Run [ESLint](https://eslint.org/)                |
| test        | Launches the test runner                         |
| test-build  | Check for syntax errors.                         |
| help        | Display a list of commands                       |
npm package: @lidio601/react-native-svg-uri-cached
Description: A React Native package that provides a SvgUriCached component
Author: Fabio Cigliano
Latest version: 1.0.1

# Logger

### How to install

Follow the steps to setup [react-native-fs](https://github.com/itinance/react-native-fs#usage-ios) and [react-native-svg](https://github.com/react-native-svg/react-native-svg#installation).

### Requirements

1. [Yarn Package Manager](https://yarnpkg.com/)
2. [Node Version Manager](https://github.com/nvm-sh/nvm)

### Local development

1. Run `nvm use`
2. Run `make setup`
3. Run `make build`

### Tasks

This project uses a [makefile](https://www.gnu.org/software/make/manual/make.html) to run commands.

| Command     | Description                                      |
| ----------- | ------------------------------------------------ |
| setup       | Base first-time install of project locally       |
| build       | Build the project                                |
| build-patch | Build the project and increase the patch version |
| prettier    | Run [ESLint](https://eslint.org/)                |
| test        | Launches the test runner                         |
| test-build  | Check for syntax errors.                         |
| help        | Display a list of commands                       |
npm package: @lido-js/node-fetch-cjs
Description: A wrapper for node-fetch (a light-weight module that brings Fetch API to node.js) to be used in commonjs environment.
Author: Touchify
Latest version: 3.2.10

# Node Fetch CJS

This package is a wrapper for [Node Fetch v3](https://github.com/node-fetch/node-fetch) for commonjs environments.
Originally this repo is fork from https://github.com/touchifyapp/node-fetch-cjs
## Motivation

Since v3, `node-fetch` only provides an `ESM` version of the package.

While this choice is a good choice for the future, it is impacting a lot of codebases built on `commonjs` environment. Some of them could update their code to import `node-fetch` using native `import()` but many could not. This is especially true for `TypeScript` users who cannot mix `commonjs` and `ESM` imports in their projects.

This module bundles `node-fetch` using [esbuild](https://esbuild.github.io) and apply some custom transformations to make sure it works in `commonjs` environments.

**If you are able to migrate to the official v3 release of node-fetch, we highly recommend to use the official node-fetch. This package is built to help users who could not migrate easily.**

*This repository is automatically updated when a new version of node-fetch is released*

## Installation

```bash
$ npm install node-fetch-cjs
```

## Usage

Destructuring export (recommended):
```javascript
const { default: fetch, Headers } = require("node-fetch-cjs");

fetch(/* ... */).then(/* ... */);

const headers = new Headers();
```

Legacy export:
```javascript
const fetch = require("node-fetch-cjs");

fetch.default(/* ... */).then(/* ... */);

const headers = new fetch.Headers();
```

## Full documentation

Full documentation is available on the [node-fetch](https://github.com/node-fetch/node-fetch) repository.

## Differences

In order to be fully CJS compatible, we had to bundle dependencies from `node-fetch` directly into this package.
This means that both `fetch-blob` and `formdata-polyfill` are bundled.

For your convenience, these dependencies are exported to allow you to use them in your code:

```javascript
const { Blob, FormData } = require("node-fetch-cjs");

const blob = new Blob(["content"], { type: "text/plain" });
const text = await blob.text();

const data = new FormData();
data.append("key", "value");
```

## TypeScript

Types are bundled with `node-fetch-cjs`, so you don't need to install any additional packages.

## Acknowledgement

Thanks to [node-fetch/node-fetch](https://github.com/node-fetch/node-fetch) for their work to allow all of us to use `fetch` in Node.JS environments.

## License

[MIT](LICENSE)
npm package: @lido-nestjs/constants
Description: NestJS Constants Module for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 5.3.0

# Constants Module

NestJS Constants Module for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/constants
```

## Usage

```ts
import { CHAINS } from '@lido-nestjs/constants';

export const LIDO_LOCATOR_CONTRACT_ADDRESSES = {
  [CHAINS.Goerli]: '0x1eDf09b5023DC86737b59dE68a8130De878984f5',
};
```
npm package: @lido-nestjs/contracts
Description: NestJS Contracts Module for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 9.8.1

# Contracts Module

NestJS Contracts Module for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/contracts
```

## Usage

### Basic usage

```ts
// Import
import { Module } from '@nestjs/common';
import { LidoContractModule } from '@lido-nestjs/contracts';
import { getDefaultProvider } from '@ethersproject/providers';
import { MyService } from './my.service';

@Module({
  imports: [
    LidoContractModule.forFeature({
      provider: getDefaultProvider('mainnet'),
    }),
  ],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Usage
import { LIDO_CONTRACT_TOKEN, Lido } from '@lido-nestjs/contracts';
import { Inject } from '@nestjs/common';

export class MyService {
  constructor(@Inject(LIDO_CONTRACT_TOKEN) private contract: Lido) {}

  async myMethod() {
    return await this.contract.decimals();
  }
}
```

Specify a different address:

```ts
LidoContractModule.forFeature({
  address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
});
```

### Global usage

```ts
import { Module } from '@nestjs/common';
import { LidoContractModule } from '@lido-nestjs/contracts';

@Module({
  imports: [LidoContractModule.forRoot()],
})
export class MyModule {}
```

### Async usage

```ts
import { Module } from '@nestjs/common';
import { LidoContractModule } from '@lido-nestjs/contracts';
import { ConfigModule, ConfigService } from './config.service';

@Module({
  imports: [
    LidoContractModule.forRootAsync({
      async useFactory(testService: TestService) {
        return { address: testService.address };
      },
      inject: [TestService],
    }),
  ],
})
export class MyModule {}
```

### Use global provider

```ts
import { Module } from '@nestjs/common';
import { LidoContractModule } from '@lido-nestjs/contracts';
import { ProviderModule } from './provider.service';

@Module({
  imports: [ProviderModule.forRoot(), LidoContractModule.forRoot()],
})
export class MyModule {}
```

## How to add new abi

1. Put ABI into `packages/contracts/abi` folder
2. Set up `packages/contracts/<your name of abi>`: module, contracts
3. Nice to have: add test for ABI: `packages/contracts/test/contracts.spec.ts`
4. Go through install FAQ
5. Enjoy
npm package: @lido-nestjs/decorators
Description: Nestjs Decorators for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 1.0.0

# Nestjs Decorators

Nestjs Decorators for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/decorators
```

## Usage

### OneAtTime

The decorator does not allow to call the method more than once at a time.

```ts
import { OneAtTime } from '@lido-nestjs/decorators';

export class TestService {
  @OneAtTime()
  async foo() {
    // do some async work
  }
}
```
npm package: @lido-nestjs/execution
Description: NestJS Logger for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 1.21.0

# Execution layer (Eth1 RPC Provider)

NestJS Logger for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/execution
```

## Usage

### Basic usage

```ts
// Import
import { Injectable, Module } from '@nestjs/common';
import { FallbackProviderModule } from '@lido-nestjs/execution';
import { MyService } from './my.service';

@Module({
  imports: [
    LoggerModule.forRoot({}),
    FallbackProviderModule.forRoot({
      imports: [],
      urls: ['http://localhost:8545', 'http://fallback:8545'],
      network: 1,
    }),
  ],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Usage
import { SimpleFallbackJsonRpcBatchProvider } from '@lido-nestjs/execution';

@Injectable
export class MyService {
  constructor(private provider: SimpleFallbackJsonRpcBatchProvider) {}

  async doSomeWork() {
    return await this.provider.getBlock(1000);
  }
}
```

### Async usage

```ts
import { Module } from '@nestjs/common';
import { FallbackProviderModule } from '@lido-nestjs/execution';
import { ConfigModule, ConfigService } from './my.service';

@Module({
  imports: [
    ConfigModule.forRoot(), // exports ConfigService
    FetchModule.forRoot(),
    FallbackProviderModule.forRootAsync({
      async useFactory(configService: ConfigService) {
        return {
          urls: configService.urls,
          network: configService.network,
        };
      },
      inject: [ConfigService],
    }),
  ],
})
export class MyModule {}

// Usage
import { SimpleFallbackJsonRpcBatchProvider } from '@lido-nestjs/execution';

@Injectable
export class MyService {
    constructor(private provider: SimpleFallbackJsonRpcBatchProvider) {}

    async doSomeWork() {
        return await this.provider.getBlock(1000);
    }
}
```
npm package: @lido-nestjs/ipfs-http-client
Description: Simple http ipfs client. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme).
Latest version: 1.1.0

# Library for storing keys in IPFS and creating merkle tree

Simple http ipfs client.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme).

## Install

```bash
yarn add @lido-nestjs/ipfs-http-client
```

## Ipfs

### Usage

This module depends on `FetchModule` from `@lido-nestjs/fetch`, so you need to provide it as a global module or import it into `IpfsModule`.

#### Sync usage

```ts
// Import
import { Module } from '@nestjs/common';
import { IpfsModule } from '@lido-nestjs/offchain-key-storage-client';
import { FetchModule } from '@lido-nestjs/fetch';
import { MyService } from './my.service';

@Module({
  imports: [
    IpfsModule.forFeature({
      imports: [FetchModule],
      url: 'http://127.0.0.1:5001/api/v0',
      username: 'username',
      password: 'password',
    }),
  ],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Provider usage
import { IpfsGeneralService } from '@lido-nestjs/offchain-key-storage-client';

export class MyService {
  constructor(private ipfsService: IpfsGeneralService) {}

  async myMethod() {
    return await this.ipfsService.get(
      'QmSJiSS956mnxk2UhWo5T7CqCebeDAS4BrnjuBM6VAeheT',
      'http://127.0.0.1:5001/api/v0',
    );
  }
}
```

### Async usage

```ts
@Module({
  imports: [
    ConfigModule,
    // FetchModule.forRoot(),
    IpfsModule.forFeatureAsync({
      imports: [CustomFetchModule],
      async useFactory(config: ConfigService) {
        return {
          url: config.get('URL'),
          username: config.get('USERNAME'),
          password: config.get('PASSWORD'),
        };
      },
      inject: [ConfigService],
    }),
  ],
})
export class MyModule {}
```

### Global usage

```ts
import { Module } from '@nestjs/common';
import { IpfsModule } from '@lido-nestjs/offchain-key-storage-client';
import { FetchModule } from '@lido-nestjs/fetch';

@Module({
  imports: [
    IpfsModule.forRoot({
      imports: [FetchModule],
      url: 'http://127.0.0.1:5001/api/v0',
      username: 'username',
      password: 'password',
    }),

    // IpfsModule.forRootAsync({
    //   imports: [CustomFetchModule],
    //   async useFactory(config: ConfigService) {
    //     return {
    //       url: config.get('URL'),
    //       username: config.get('USERNAME'),
    //       password: config.get('PASSWORD'),
    //     };
    //   },
    //   inject: [ConfigService],
    // }),
  ],
})
export class MyModule {}
```

Example of usage this library https://github.com/lidofinance/lido-offchain-key-lib-test.git
npm package: @lido-nestjs/middleware
Description: NestJS Middleware Module for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 1.2.0

# Middleware

NestJS Middleware Module for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/middleware
```

## Usage

### Basic usage

```ts
// Import
import { Module } from '@nestjs/common';
import { MiddlewareModule } from '@lido-nestjs/middleware';
import { MyService } from './my.service';

@Module({
  imports: [
    MiddlewareModule.forFeature({
      middlewares: [
        (next) => {
          console.log(1);
          next();
          console.log(3);
        },
      ],
    }),
  ],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Usage
import { MiddlewareService } from '@lido-nestjs/middleware';

export class MyService {
  constructor(private middlewareService: MiddlewareService) {}

  async myMethod() {
    return await this.middlewareService.go(() => {
      console.log(2);
    });
  }
}
```

### Async usage

```ts
// Import
import { Module } from '@nestjs/common';
import { LoggerModule } from '@lido-nestjs/logger';
import { MiddlewareModule } from '@lido-nestjs/middleware';
import { MyService } from './my.service';

@Module({
  imports: [
    LoggerModule,
    MiddlewareModule.forFeatureAsync({
      imports: [LoggerModule],
      async useFactory(loggerService: LoggerService) {
        return {
          middlewares: [
            (next) => {
              loggerService.log(1);
              next();
            },
          ],
        };
      },
      inject: [LoggerService],
    }),
  ],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Usage
import { MiddlewareService } from '@lido-nestjs/middleware';

export class MyService {
  constructor(
    private middlewareService: MiddlewareService,
    private loggerService: LoggerService,
  ) {}

  async myMethod() {
    return await this.middlewareService.go(() => {
      loggerService.log(2);
    });
  }
}
```
npm package: @lido-nestjs/offchain-key-storage-client
Description: Library provide interface for storing Node operator's key in IPFS and preparing merkle tree and proofs. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme).
Latest version: 1.1.1

# Library for storing keys in IPFS and creating merkle tree

Library provide interface for storing Node operator's key in IPFS and preparing merkle tree and proofs.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme).

## Install

```bash
yarn add @lido-nestjs/offchain-key-storage-client
```

## Ipfs

### Usage

This module depends on `IpfsModule` from `@lido-nestjs/ipfs-http-client`, so you need to provide it as a global module or import it into `IpfsNopKeysModule`.

### IpfsModule

// global IpfsModule usage

```ts
@Module({
  imports: [
    ConfigModule,
    // FetchModule.forRoot(),
    IpfsModule.forRootAsync({
      imports: [CustomFetchModule],
      async useFactory(config: ConfigService) {
        return {
          url: config.get('URL'),
          username: config.get('USERNAME'),
          password: config.get('PASSWORD'),
        };
      },
      inject: [ConfigService],
    }),
    IpfsNopKeysModule.forRoot(),
  ],
})
export class MyModule {}
```

// IpfsModule as deps of IpfsNopKeysModule

```ts
@Module({
  imports: [
    ConfigModule,
    // FetchModule.forRoot(),
    IpfsNopKeysModule.forRoot({
      imports: [
        IpfsModule.forRootAsync({
          imports: [CustomFetchModule],
          async useFactory(config: ConfigService) {
            return {
              url: config.get('URL'),
              username: config.get('USERNAME'),
              password: config.get('PASSWORD'),
            };
          },
          inject: [ConfigService],
        }),
      ],
    }),
  ],
})
export class MyModule {}
```

### NopMerkleTree

```ts
// Import
import { Module } from '@nestjs/common';
import { NopMerkleTreeModule } from '@lido-nestjs/offchain-key-storage-client';
import { MyService } from './my.service';

@Module({
  imports: [NopMerkleTreeModule],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Usage
import {
  NopMerkleTreeService,
  KeySignBuffer,
} from '@lido-nestjs/offchain-key-storage-client';

export class MyService {
  constructor(private nopMerkleTreeService: NopMerkleTreeService) {}

  myMethod(data: KeySignBuffer[]) {
    return this.nopMerkleTreeService.createTree(data);
  }
}
```

Example of usage this library https://github.com/lidofinance/lido-offchain-key-lib-test.git
npm package: @lido-nestjs/registry
Description: NestJS Registry Module for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 7.18.0

# Registry Module

NestJS Registry Module for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/registry
```

## Migrations

Database migrations are placed in `./src/migrations/` folder. 

Please DO NOT edit migrations, if you want to change the migration, 
please make another one with the needed database schema transitions.

## Usage

TODO
npm package: @lido-nestjs/utils
Description: Utils for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 1.4.0

# Utils

Utils for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/utils
```

## Usage

### Range

```ts
import { range } from '@lido-nestjs/utils';

console.log(range(0, 4)); // 0, 1, 2, 3
```
npm package: @lido-nestjs/validators-registry
Description: NestJS Validators registry Module for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 1.6.1

# Validators registry Module

NestJS Validators registry Module for Lido Finance projects.
Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)

## Install

```bash
yarn add @lido-nestjs/validators-registry
```

## Interface

Package exports `ValidatorsRegistry` that implements the following interface:

```typescript
export interface ValidatorsRegistryInterface {
    /**
     * Update internal state of validators in the registry to the Consensus Layer (CL) state
     * according to `blockId`.
     *
     * @param {BlockId} blockId - Values: 'head', 'genesis', 'finalized', <slot>, <hex encoded blockRoot with 0x prefix>
     *
     * If the registry internal state is newer or the same to the CL state - does nothing.
     */
    update(blockId: BlockId): Promise<ConsensusMeta>;

    /**
     * Get Metadata from registry internal state
     */
    getMeta(): Promise<ConsensusMeta | null>;

    /**
     * Get Validators and metadata from registry internal state
     */
    getValidators(
        pubkeys?: string[],
        where?: FilterQuery<ConsensusValidatorEntity>,
        options?: FindOptions<ConsensusValidatorEntity>,
    ): Promise<ConsensusValidatorsAndMetadata>;
}
```

## Usage 

```typescript
// my.module.ts
import { Module } from '@nestjs/common';
import {
    StorageModule,
    ValidatorsRegistryModule,
} from '@lido-nestjs/validators-registry';
import { ConsensusModule } from '@lido-nestjs/consensus';
import { FetchModule } from '@lido-nestjs/fetch';
import { MyService } from './my.service';
import { MikroOrmModule } from '@mikro-orm/nestjs';

@Module({
    imports: [
        MikroOrmModule.forRoot({
            dbName: ':memory:',
            type: 'sqlite',
            entities: [...StorageModule.entities], // optional
            migrations: {
                /* migrations data */
            },
        }),
        FetchModule.forRoot({
            baseUrls: ['http://consensus-node:4001'],
        }),
        ConsensusModule.forRoot(),
        ValidatorsRegistryModule.forFeature(),
    ],
    providers: [MyService],
    exports: [MyService],
})
export class MyModule {}



// my.service.ts
import { Injectable } from '@nestjs/common';
import { ValidatorsRegistryInterface } from '@lido-nestjs/validators-registry';

@Injectable()
export class MyService {
    public constructor(
        private readonly validatorsRegistry: ValidatorsRegistryInterface,
    ) {}

    public async myMethod() {
        await this.validatorsRegistry.update('finalized');

        const metaAndValidators = await this.validatorsRegistry.getValidators();

        return metaAndValidators;
    }
}
```

## Migrations

Database migrations are placed in `./src/migrations/` folder.

Please DO NOT edit migrations, if you want to change the migration,
please make another one with the needed database schema transitions.
npm package: @lido-sdk/constants
Description: This project is being slowly deprecated and may not receive further updates. Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Li
Latest version: 3.5.1

# ⚠️DEPRECATION WARNING⚠️

This project is being slowly deprecated and may not receive further updates.
Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Lido Protocol.

# Constants

Constants for Lido Finance projects.
Part of [Lido JS SDK](https://github.com/lidofinance/lido-js-sdk/#readme)

- [Install](#install)
- [Chains](#chains)
  - [Chains enum](#chains-enum)
  - [Array of chains ids](#array-of-chains-ids)
  - [getChainColor](#getchaincolor)
- [Tokens](#tokens)
  - [Lido tokens enum](#lido-tokens-enum)
  - [getTokenAddress](#gettokenaddress)
- [Aggregator](#aggregator)
  - [getAggregatorAddress](#getaggregatoraddress)
- [WithdrawalQueue](#withdrawalqueue)
  - [getWithdrawalQueueAddress](#getWithdrawalQueueAddress)

## Install

```bash
yarn add @lido-sdk/constants
```

## Chains

[Source](src/chains.ts)

### Chains enum

```ts
import { CHAINS } from '@lido-sdk/constants';

console.log(CHAINS.Mainnet, CHAINS.Hoodi); // 1, 560048
```

### Array of chains ids

```ts
import { CHAINS_IDS } from '@lido-sdk/constants';

console.log(CHAINS_IDS); // [1, 3, 4, 5, 42]
```

### getChainColor

Color getter by chain id

```ts
import { CHAINS, getChainColor } from '@lido-sdk/constants';

const hoodiChainColor = getChainColor(CHAINS.Hoodi);
console.log(hoodiChainColor); // #AA346A
```

## Tokens

[Source](src/tokens.ts)

### Lido tokens enum

```ts
import { TOKENS } from '@lido-sdk/constants';

console.log(TOKENS.WSTETH); // WSTETH
console.log(TOKENS.STETH); // STETH
console.log(TOKENS.LDO); // LDO
```

### getTokenAddress

Getter for Lido token addresses. Returns a contract address or throws an error if the contract is not deployed in the chain.

```ts
import { CHAINS, TOKENS, getTokenAddress } from '@lido-sdk/constants';

const stethAddress = getTokenAddress(CHAINS.Mainnet, TOKENS.STETH);
console.log(stethAddress); // 0xae7ab96520de3a18e5e111b5eaab095312d7fe84
```

## Aggregator

[Source](src/aggregator.ts)

EACAggregatorProxy https://etherscan.io/address/0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419  
It’s used to get the ETH price

### getAggregatorAddress

```ts
import { CHAINS, getAggregatorAddress } from '@lido-sdk/constants';

const aggregatorAddress = getAggregatorAddress(CHAINS.Mainnet);
console.log(aggregatorAddress); // 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
```

## WithdrawalQueue

WithdrawalQueue contract for LIDO protocol

### getWithdrawalQueueAddress

```ts
import { CHAINS, getWithdrawalQueueAddress } from '@lido-sdk/constants';

const withdrawalQueueAddress = getWithdrawalQueueAddress(CHAINS.Mainnet);
console.log(withdrawalQueueAddress); // 0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1
```
npm package: @lido-sdk/helpers
Description: This project is being slowly deprecated and may not receive further updates. Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Li
Latest version: 1.7.1

# ⚠️DEPRECATION WARNING⚠️

This project is being slowly deprecated and may not receive further updates.
Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Lido Protocol.

# Helpers

Helpers for Lido Finance projects.
Part of [Lido JS SDK](https://github.com/lidofinance/lido-js-sdk/#readme)

- [Install](#install)
- [Etherscan](#etherscan)
  - [getEtherscanTxLink](#getetherscantxlink)
  - [getEtherscanTokenLink](#getetherscantokenlink)
  - [getEtherscanAddressLink](#getetherscanaddresslink)
- [Open window](#open-window)

## Install

```bash
yarn add @lido-sdk/helpers
```

## Etherscan

A set of functions for generating links to [etherscan](https://etherscan.io/)

### getEtherscanTxLink

```ts
import { getEtherscanTxLink } from '@lido-sdk/helpers';
import { CHAINS } from '@lido-sdk/constants';

const link = getEtherscanTxLink(
  CHAINS.Mainnet,
  '0x0000000000000000000000000000000000000000000000000000000000000000',
);
console.log(link); // https://etherscan.io/tx/0x0000000000000000000000000000000000000000000000000000000000000000
```

### getEtherscanTokenLink

```ts
import { getEtherscanTokenLink } from '@lido-sdk/helpers';
import { CHAINS } from '@lido-sdk/constants';

const link = getEtherscanTokenLink(
  CHAINS.Mainnet,
  '0x0000000000000000000000000000000000000000',
);
console.log(link); // https://etherscan.io/address/0x0000000000000000000000000000000000000000
```

### getEtherscanAddressLink

```ts
import { getEtherscanAddressLink } from '@lido-sdk/helpers';
import { CHAINS } from '@lido-sdk/constants';

const link = getEtherscanAddressLink(
  CHAINS.Mainnet,
  '0x0000000000000000000000000000000000000000',
);
console.log(link); // https://etherscan.io/address/0x0000000000000000000000000000000000000000
```

## Open window

```ts
import { openWindow } from '@lido-sdk/helpers';

openWindow('https://lido.fi');
```
npm package: @lido-terra-sdk/constants
Description: Constants for Lido Terra Finance projects. Part of [Lido JS SDK](https://github.com/lidofinance/lido-terra-js-sdk/#readme)
Latest version: 1.2.0

# Constants

Constants for Lido Terra Finance projects.
Part of [Lido JS SDK](https://github.com/lidofinance/lido-terra-js-sdk/#readme)

- [Install](#install)
- [Assets](#assets)
- [Chains](#chains)
- [Denoms](#denoms)
- [Hubs](#hubs)
- [Networks](#networks)

## Install

```bash
yarn add @lido-terra-sdk/constants
```

## Assets

[Source](src/asset.ts)

```ts
import { ASSET } from '@lido-terra-sdk/constants';

console.log(ASSET.BLUNA, ASSET.STLUNA);
```

## Network

[Source](src/network.ts)

```ts
import { NETWORK, NETWORK_URL } from '@lido-terra-sdk/constants';

console.log(NETWORK.MAINNET, NETWORK_URL.MAINNET);
```

## Chains

[Source](src/chain.ts)

```ts
import { CHAIN, NETWORK } from '@lido-terra-sdk/constants';

console.log(CHAINS[NETWORK.MAINNET].COLUMBUS4);
```

## Denoms

[Source](src/denom.ts)

```ts
import { DENOM, FULL_COIN } from '@lido-terra-sdk/constants';

console.log(DENOM.uluna, FULL_COIN.LUNA);
```

## Hubs

[Source](src/hub.ts)

```ts
import { NETWORK, HUB } from '@lido-terra-sdk/constants';

console.log(HUB[NETWORK.MAINNET]);
```
npm package: @lido-terra-sdk/helpers
Description: Usable helpers for Lido Terra Finance projects. Part of [Lido JS SDK](https://github.com/lidofinance/lido-terra-js-sdk/#readme)
Latest version: 1.3.0

# Helpers

Usable helpers for Lido Terra Finance projects.
Part of [Lido JS SDK](https://github.com/lidofinance/lido-terra-js-sdk/#readme)

- [Install](#install)
- [Terra Finder link composer](#terra-finder-link-composer)
- [Coinify](#coinify)
- [Format Coin without denom](#format-coin-without-denom)
- [Dec to Coin](#dec-to-coin)
- [Microfy](#microfy)
- [Demicrofy](#demicrofy)
- [Parse Coin](#parse-coin)
- [Humanify Dec](#humanify-dec)
- [To Micro String](#to-micro-string)

## Install

```bash
yarn add @lido-terra-sdk/helpers
```

## Terra finder link composer

Compose terra finder link from given arguments

```ts
import { CHAIN, NETWORK } from '@lido-terra-sdk/constants';
import { TerraEntities, getTerraFinderLink } from '@lido-terra-sdk/helpers';

const link = getTerraFinderLink(
  TerraEntities.Address,
  NETWORK.MAINNET,
  'terra1mka5pnxk5jwqwpkwqj928fp5m9p3hqu2vwjqfa',
);
```

## Coinify

Create a `Coin` instance from string and denom

```ts
import { CHAIN, DENOM } from '@lido-terra-sdk/constants';
import { coinify } from '@lido-terra-sdk/helpers';

const coin = coinify('10', DENOM.uluna);
```

## Format Coin without denom

Extract amount from `Coin` instance and converts into string

```ts
import { CHAIN, DENOM } from '@lido-terra-sdk/constants';
import { formatCoinWithoutDenom } from '@lido-terra-sdk/helpers';

const coin = coinify('10000000', DENOM.uluna);
console.log(formatCoinWithoutDenom(coin)); //10
```

## Dec to Coin

Create `Coin` instance from `Dec` amount and denom

```ts
import { CHAIN, DENOM } from '@lido-terra-sdk/constants';
import { decToCoin } from '@lido-terra-sdk/helpers';
import { Dec } from '@terra-money/terra.js';

const coin = decToCoin(new Dec('10000000'), DENOM.uluna);
```

## Microfy

Multiply provided `Dec` value by 10\*\*6

```ts
import { Dec } from '@terra-money/terra.js';
import { microfy } from '@lido-terra-sdk/helpers';

const coin = microfy(new Dec('10')); //10_000_000
```

## Demicrofy

Divide provided `Dec` value by 10\*\*6

```ts
import { Dec } from '@terra-money/terra.js';
import { demicrofy } from '@lido-terra-sdk/helpers';

const coin = demicrofy(new Dec('10000000')); //10
```

## Parse coin

Convert string into `Dec` with multiplication by 10\*\*6

```ts
import { parseCoin } from '@lido-terra-sdk/helpers';

const coin = parseCoin('10'); //Dec('10000000')
```

## Humanify Dec

Convert `Dec` amount into formatted string

```ts
import { Dec } from '@terra-money/terra.js';
import { parseCoin } from '@lido-terra-sdk/helpers';

const dec = new Dec('10000000');
console.log(humanifyDec(dec)); /// '10.000000'
```

## To Micro String

Divide string amount by 10\*\*6

```ts
import { toMicroString } from '@lido-terra-sdk/helpers';

console.log(toMicroString('10')); // '10000000'
```
npm package: @lidofinance/accordion
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 2.12.0

# Accordion Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/accordion
```

## Usage

```ts
import { Accordion } from '@lidofinance/accordion'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/address
Description: React components for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 1.4.0

# Address Components

React components for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/address
```

## Usage

```ts
import { Address } from '@lidofinance/address'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/block
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 2.4.0

# Block Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/block
```

## Usage

```ts
import { Block } from '@lidofinance/block'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/blocks-connect-wallet-modal
Description: React components for Lido Finance projects.   Provides a modal window with buttons for connection with various crypto wallets.   Part of [Lido UI Blocks](https://github.com/lidofinance/ui-blocks/#readme).
Latest version: 2.11.2

# Connect Wallet Modal

React components for Lido Finance projects.  
Provides a modal window with buttons for connection with various crypto wallets.  
Part of [Lido UI Blocks](https://github.com/lidofinance/ui-blocks/#readme).

## Install

```bash
yarn add @lidofinance/blocks-connect-wallet-modal
```

## Usage

Check out our Storybook at [https://ui-blocks.lido.fi](https://ui-blocks.lido.fi)  
Note that to use Connect Wallet Modal, you need to wrap your app with `ProviderWeb3` from [lido-js-sdk](https://github.com/lidofinance/lido-js-sdk/tree/main/packages/web3-react#readme).

### Custom

You can configure the list of wallets displayed in the modal.
The package provides wallet connection buttons that are meant to be used inside the modal.
You can use them, or you can make your own.

Import the basic WalletsModal component with required wallet connection buttons:
```ts
import { WalletsModal, ConnectMetamask, ConnectWalletConnect } from '@lidofinance/blocks-connect-wallet-modal'
```

Use it like this:
```tsx
<WalletsModal
  open={isOpen}
  onClose={handleClose}
  shouldInvertWalletIcon={false} // set to true for the dark color theme
>
  {(commonProps) => (
    <>
      <ConnectMetamask key='Metamask' {...commonProps} />
      <ConnectWalletConnect key='WalletConnect' {...commonProps} />
    </>
  )}
</WalletsModal>
```

### For Ethereum

The package provides the modal variant with the predefined list of wallets, which work with the Ethereum network. 

Import the component:
```ts
import { WalletsModalForEth } from '@lidofinance/blocks-connect-wallet-modal'
```

Use it like this:
```tsx
<WalletsModalForEth {...props} />
```

#### How to hide a wallet
You can hide one or several wallet connection buttons from the list of wallets in the modal.  
Use the `hiddenWallets` property like this:
```tsx
<WalletsModalForEth
  hiddenWallets={['Metamask', 'Mathwallet']}
/>
```

Available values are:  
- `'Metamask'`
- `'WalletConnect'`
- `'Ledger'`
- `'Coinbase'`
- `'Trust'`
- `'ImToken'`
- `'Coin98'`
- `'MathWallet'`  

This list will grow with the addition of new wallets. You can see the actual list by looking into the `WalletsModalForEth` component.
npm package: @lidofinance/box
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 1.6.0

# Box Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

The Box component uses style functions from [Styled System](https://styled-system.com/). It's created using the `withStyledSystem()` HOC from `@lidofinance/styled-system`.

## Install

```bash
yarn add @lidofinance/box
```

## Usage

```ts
import { Box } from '@lidofinance/box'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/button
Description: React components for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 2.12.0

# Button Components

React components for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/button
```

## Usage

```ts
import { Button } from '@lidofinance/button'
import { ButtonIcon } from '@lidofinance/button'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/checkbox
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 1.15.0

# Checkbox Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/checkbox
```

## Usage

```ts
import { Checkbox } from '@lidofinance/checkbox'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/chip
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 1.0.1

# Chip Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/chip
```

## Usage

```ts
import { Chip } from '@lidofinance/chip'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/container
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 1.6.0

# Container Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/container
```

## Usage

```ts
import { Container } from '@lidofinance/container'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/data-table
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 3.13.0

# Data Table Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/data-table
```

## Usage

```ts
import { DataTable, DataTableRow } from '@lidofinance/data-table'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/divider
Description: React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
Latest version: 1.6.0

# Divider Component

React component for Lido Finance projects.
Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

## Install

```bash
yarn add @lidofinance/divider
```

## Usage

```ts
import { Divider } from '@lidofinance/divider'
```

Check out our Storybook at [https://ui.lido.fi](https://ui.lido.fi)
npm package: @lidofinance/eth-ui-primitives
Description: ETH UI primitives
Latest version: 0.42.0

# @lidofinance/eth-ui-primitives

Ethereum directional package with UI primitives: components, utils.

## Installation

* React 17 || 18

```bash
yarn add @lidofinance/eth-ui-primitives


# and additional
yarn add styled-components@^5.3.5 @reef-knot/web3-react@^0.3.0 @lidofinance/lido-ui@^3.6.1 @lidofinance/ui-primitives@^<TODO>
```

## Getting started

Make sure that your **project** was wrapped by `CookieThemeProvider` from [@lidofinance/lido-ui](https://github.com/lidofinance/ui/tree/main/packages/theme).

### Components

#### FormatToken:
```tsx
import { constants } from 'ethers'
import { FormatToken } from '@lidofinance/eth-ui-primitives'

// MaxInt256 is BigNumber
const { MaxInt256 } = constants

export const Component: FC = () => {
  return (
    <FormatToken amount={balance} symbol="ETH"/>
  )
}
```


#### TokenToWallet:
```tsx
import { TokenToWallet } from '@lidofinance/eth-ui-primitives'

const stethAddress = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'

export const Component: FC = () => {
  return (
    <TokenToWallet address={stethAddress} />
  )
}
```

#### WalletFallback:
```tsx
// `useWeb3` and other imports what is out of context here
const EthWalletCard: EthWalletCardComponent = (props) => {
  // ...
}

const EthWalletCardWrapper: EthWalletCardComponent = (props) => {
  const { active } = useWeb3()
  return active ? <EthWalletCard {...props} /> : <WalletFallback {...props} />
}

export default EthWalletCardWrapper
```


### Utils

#### formatFloorEtherBalance:
```tsx
import { constants } from 'ethers'
import { formatFloorEtherBalance } from '@lidofinance/eth-ui-primitives'

// MaxInt256 is BigNumber
const { MaxInt256 } = constants
const maxDecimalDigits = 4
const formatedBalance = formatFloorEtherBalance(MaxInt256, maxDecimalDigits)
```