open-index/open-npm huggingface dataset:
npm package: @pooktech/madebee
Description: MadeBee CLI - AI-Driven Intent Compiler for React Production Code
Author: MadeBee Team
Latest version: 1.0.2

# 🐝 MadeBee CLI

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)]()
[![Built with ❤️](https://img.shields.io/badge/Built%20with-❤️-red.svg)]()

> **"Express Intent, Build Reality."**
> **MadeBee 是一个顶级两阶段 AI 编译器，它将自然语言意图 (Intents) 转化为生产级 React 项目。**

---

## 🌟 核心哲学

传统的开发模式是在代码细节中挣扎。**MadeBee** 倡导 **“意图驱动开发” (Intent-Driven Development)**：
1. **开发者**：专注于描述 “要做什么” (意图)。
2. **第一阶段 (LLM)**：将模糊的意图精确化为结构化指令 (MBMD)。
3. **第二阶段 (Agent)**：根据指令和工程规则，在隔离沙箱中自动完成全栈交付。

---

## 🏗 架构图解

```mermaid
[开发者意图] -> (workspaces/*.md)
      |
      v [Phase 1: Sync] 
(Local MLX / Cloud Qwen)
      |
      v (src-gen/*.md) -> [MBMD v1.0 语法描述]
      |
      v [Phase 2: Build]
(Heavyweight Agent: Gemini / Claude)
      |
      v (madebee-app/) -> [隔离的生产级 React 代码库]
```

---

## 🚀 快速上手

### 1. 全局安装 (本地开发版)
在项目根目录运行：
```bash
npm install
npm run compile
npm link
```

### 2. 初始化你的第一个项目
进入任何空文件夹，开启你的意图之旅：
```bash
mkdir my-ai-project && cd my-ai-project
madebee init
```
**运行 `init` 后，你会得到：**
- `workspaces/`: 你的灵感发源地。
- `madebee.rule.md`: 决定 AI 生成风格的 “宪法”。
- `.env`: 配置你的 AI 密钥。

### 3. 开始编程
1. 在 `workspaces/` 创建 `todo.md`，写下你的需求。
2. 运行一键无脑编译：
   ```bash
   madebee start
   ```

---

## 🛠 命令行工具箱

| 指令 | 描述 | 智能等级 |
| :--- | :--- | :--- |
| `madebee init` | 在当前文件夹初始化 MadeBee 环境。 | 🌟 |
| `madebee start` | **无脑模式**：自动同步意图、检测规则变更并执行增量构建。 | 🌟🌟🌟 |
| `madebee sync` | 仅将自然语言同步为 MBMD 语法，不生成代码。 | 🌟 |
| `madebee build` | 强制进入代码生成阶段（保留 `node_modules`）。 | 🌟🌟 |
| `madebee new` | 物理级重置项目，从零开始（清空所有内容）。 | 🌟🌟 |

---

## 📜 MBMD v1.0 语法精粹

MadeBee 使用高度优化的 **MBMD** 方言，专为 AI 编译器设计：

### UI 组件定义
`[组件名: "Label" 属性="值" @事件="PipelineID" bind="state.变量"]`
- **示例**: `[Btn: "确认" color="green" @click="SaveData"]`

### 块级容器
```text
::: FlexCard {title="用户信息" padding="20"}
  [Avatar: src=state.user.icon]
  [Input: "姓名" bind="state.user.name"]
:::
```

### 管道状态机 (Logic)
```markdown
## Pipelines
### SaveData
1. [State:loading start=true]
2. [Api:post url="/user/save" data=state.user]
3. [Catch] -> [UI:notify type="error"]
4. [Finally] -> [State:loading start=false]
```

---

## 🛡 编译器特性

- **物理沙箱 (Sandbox Logic)**: Agent 被锁死在 `madebee-app/` 运行，通过 `CWD` 隔离保护宿主系统安全。
- **双路自适应 (Local-First)**: 优先调度本地 8000 端口的 **Apple MLX** 模型，毫秒级响应，零成本。
- **增量锁 (Lockfile)**: `.madebee-lock.json` 记录每一行意图的哈希，拒绝重复的昂贵 AI 调用。
- **规则联动 (Auto-Clean)**: 修改 `madebee.rule.md` 规则后，下一次 `start` 将自动执行智能全量同步。
- **环境自愈 (Self-Healing)**: 自动检测并修复 `package.json` 脚本、`tsconfig` 错误及基础依赖。

---

## 🚧 未来路线

- [ ] **可视化预览**: 实时预览 `src-gen` 对应的 UI 效果。
- [ ] **多端适配**: 支持同时编译为 Web (React) 与 Mobile (React Native)。
- [ ] **Eject 协议**: 一键脱离编译器，生成独立可部署的 Zip 包。

---

## 🤝 贡献与参与

MadeBee 是一个开放的项目，欢迎任何形式的贡献！
- 提交 [Bug Report](https://github.com/MadeBee/madebee-cli/issues)
- 改进 [MBMD 语法规范](src/rule/GEMINI-COMPILER.md)
- 编写更多 [Examples](examples/)

---
*Made with ❤️ by MadeBee Team | 🐝 MadeBee: The Future of Intent-Driven UI*
npm package: @pooley/core
Description: Generic pool implementation that works with Webworkers, Promises, etc.
Latest version: 1.0.1

# @pooley/core

> Generic pool implementation that works with Webworkers, Promises, etc.

[![@pooley/core](https://badge.fury.io/js/@pooley%2Fcore.svg)](https://badge.fury.io/js/@pooley%2Fcore)

Requires a specific worker processor, queue and a scaler to excute.

See other packages for a suitable implementations.

## Install

Install the library:

```
npm install @pooley/core
```

## Usage

```ts
import { WorkerPool, WorkerTask, WorkerPoolEvent } from '@pooley/core';

// Create some task that should process a pool queue
const task: WorkerTask<string, Promise<string>> = (data) => {
  return new Promise((res) => setTimeout(() => res(data), 1000));
};

// Create a pool with a task and suitable queue/scaler/processor
const pool = new WorkerPool({
  task,
  queue,
  poolScaler,
  processorFactory,
});

// Listen to a processed data from the pool
pool.on(WorkerPoolEvent.Data, (ev) => this.log('Pool data: ', ev.data));

// Or wait when it's finished
await pool.once(WorkerPoolEvent.Empty);
```

## Building

Run `nx build core` to build the library.

## Running unit tests

Run `nx test core` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @pooley/promise
Description: Implements Promise-based processor for @pooley/core
Latest version: 1.0.1

# @pooley/promise

> Implements Promise-based processor for @pooley/core.

[![@pooley/promise](https://badge.fury.io/js/@pooley%2Fpromise.svg)](https://badge.fury.io/js/@pooley%2Fpromise)

Allows to execute tasks in a pool using Promises to wait for the completion of the tasks.

Note: All tasks are executed on the same main thread and any blocking operations will block entire pool and everything else - so make sure you are using non-blocking operations inside your tasks!

## Install

Install the library with it's core peer dependency:

```
npm install @pooley/promise @pooley/core
```

## Usage

```ts
import { WorkerPool } from '@pooley/core';
import { PromiseWorkerProcessorFactory } from '@pooley/promise';

// Create a task that returns a Promise
const task: WorkerTask<string, Promise<string>> = (data) => {
  return new Promise((res) => setTimeout(() => res(data), 1000));
};

// Create a pool with promise processor factory
const pool = new WorkerPool({
  task,
  queue,
  poolScaler,
  processorFactory: new PromiseWorkerProcessorFactory(),
});
```

## Building

Run `nx build promise` to build the library.

## Running unit tests

Run `nx test promise` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @pooley/queues
Description: Implements different queues for @pooley/core
Latest version: 1.0.1

# @pooley/queues

> Implements different queues for @pooley/core.

[![@pooley/queues](https://badge.fury.io/js/@pooley%2Fqueues.svg)](https://badge.fury.io/js/@pooley%2Fqueues)

| Queue         | Description                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------ |
| BufferedQueue | Allows to buffer requests to dequeue elements from a queue and flush them once data has arrived. |

## Install

Install the library with it's core peer dependency:

```
npm install @pooley/queues @pooley/core
```

## Usage

### BufferedQueue

```ts
import { WorkerPool } from '@pooley/core';
import { BufferedQueue } from '@pooley/queues';

// Create a buffered queue
const queue = new BufferedQueue<string>();

// Create a pool with it
const pool = new WorkerPool({
  task,
  queue,
  poolScaler,
  processorFactory,
});

// Start pushing into the queue
queue.pushAll(['some', 'data']);
```

#### Configuration

| Option                 | Default         | Description                                                                                            |
| ---------------------- | --------------- | ------------------------------------------------------------------------------------------------------ |
| bufferSize             | Infinity        | Maximum size of dequeue requests that queue should buffer before triggering a buffer overflow strategy |
| bufferOverflowStrategy | Throws an error | A strategy function that is triggered when the dequeue buffer is overflown                             |

## Building

Run `nx build queues` to build the library.

## Running unit tests

Run `nx test queues` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @pooley/scalers
Description: Implements different scalers for @pooley/core
Latest version: 1.0.2

# @pooley/scalers

> Implements different scalers for @pooley/core.

[![@pooley/scalers](https://badge.fury.io/js/@pooley%2Fscalers.svg)](https://badge.fury.io/js/@pooley%2Fscalers)

| Scaler                    | Description                                                                                                                    |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| StaticWorkerPoolScaler    | Allocates a static number of workers based on a static size                                                                    |
| HtmlInputWorkerPoolScaler | Allocates workers based on the current value of the HTMLInputElement and dynamically updates workers size as the value changes |

## Install

Install the library with it's core peer dependency:

```
npm install @pooley/scalers @pooley/core
```

## Usage

### StaticWorkerPoolScaler

```ts
import { WorkerPool } from '@pooley/core';
import { StaticWorkerPoolScaler } from '@pooley/scalers';

// Create a pool with static worker pool scaler
const pool = new WorkerPool({
  task,
  queue,
  poolScaler: new StaticWorkerPoolScaler(5),
  workerProcessorFactory,
});
```

### HtmlInputWorkerPoolScaler

```ts
import { WorkerPool } from '@pooley/core';
import { HtmlInputWorkerPoolScaler } from '@pooley/scalers';

// Create a pool with input worker pool scaler
const pool = new WorkerPool({
  task,
  queue,
  poolScaler: new HtmlInputWorkerPoolScaler(document.querySelector('input')),
  processorFactory,
});
```

## Building

Run `nx build scalers` to build the library.

## Running unit tests

Run `nx test scalers` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @pooley/webworker
Description: Implements Webworker-based processor for @pooley/core
Latest version: 1.0.1

# @pooley/webworker

> Implements Webworker-based processor for @pooley/core.

[![@pooley/webworker](https://badge.fury.io/js/@pooley%2Fwebworker.svg)](https://badge.fury.io/js/@pooley%2Fwebworker)

Allows to execute tasks in a pool using Webworkers to fully parallelize pool processing.

Note: Since a task is executed in a different thread it cannot use any scoped variables from it's original thread as they will not exist in a Webworker thread - so use task arguments to pass all the nesessary data into a task.

## Install

Install the library with it's core peer dependency:

```
npm install @pooley/webworker @pooley/core
```

## Usage

```ts
import { WorkerPool } from '@pooley/core';
import { WebWorkerProcessor } from '@pooley/webworker';

// Create a task that will be executed in a WebWorker
const task: WorkerTask<string, string> = (data) => {
  while (Date.now() - start < 1000) {
    // Fully blocking the thread is fine here...
  }
  return data;
};

// Create a pool with webworker processor factory
const pool = new WorkerPool({
  task,
  queue,
  poolScaler,
  processorFactory: new WebWorkerProcessorFactory(),
});
```

## Building

Run `nx build webworker` to build the library.

## Running unit tests

Run `nx test webworker` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @poolsea-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: 1.0.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 @poolsea-nestjs/constants
```

## Usage

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

export const LIDO_LOCATOR_CONTRACT_ADDRESSES = {
  [CHAINS.Goerli]: '0x1eDf09b5023DC86737b59dE68a8130De878984f5',
};
```
npm package: @poolsea-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: 1.2.0

# 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 @poolsea-nestjs/contracts
```

## Usage

### Basic usage

```ts
// Import
import { Module } from '@nestjs/common';
import { LidoContractModule } from '@poolsea-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 '@poolsea-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 '@poolsea-nestjs/contracts';

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

### Async usage

```ts
import { Module } from '@nestjs/common';
import { LidoContractModule } from '@poolsea-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 '@poolsea-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: @poolsea-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.0.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 @poolsea-nestjs/execution
```

## Usage

### Basic usage

```ts
// Import
import { Injectable, Module } from '@nestjs/common';
import { FallbackProviderModule } from '@poolsea-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 '@poolsea-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 '@poolsea-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 '@poolsea-nestjs/execution';

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

    async doSomeWork() {
        return await this.provider.getBlock(1000);
    }
}
```
npm package: @poolsea-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.0.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 @poolsea-nestjs/ipfs-http-client
```

## Ipfs

### Usage

This module depends on `FetchModule` from `@poolsea-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 '@poolsea-nestjs/offchain-key-storage-client';
import { FetchModule } from '@poolsea-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 '@poolsea-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 '@poolsea-nestjs/offchain-key-storage-client';
import { FetchModule } from '@poolsea-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: @poolsea-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.0.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 @poolsea-nestjs/middleware
```

## Usage

### Basic usage

```ts
// Import
import { Module } from '@nestjs/common';
import { MiddlewareModule } from '@poolsea-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 '@poolsea-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 '@poolsea-nestjs/logger';
import { MiddlewareModule } from '@poolsea-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 '@poolsea-nestjs/middleware';

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

  async myMethod() {
    return await this.middlewareService.go(() => {
      loggerService.log(2);
    });
  }
}
```
npm package: @poolsea-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.0.0

# 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 @poolsea-nestjs/offchain-key-storage-client
```

## Ipfs

### Usage

This module depends on `IpfsModule` from `@poolsea-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 '@poolsea-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 '@poolsea-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: @poolsea-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: 1.2.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 @poolsea-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: @poolsea-nestjs/utils
Description: Utils for Lido Finance projects. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme)
Latest version: 1.0.0

# Utils

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

## Install

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

## Usage

### Range

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

console.log(range(0, 4)); // 0, 1, 2, 3
```
npm package: @poolsea-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.0.0

# 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 @poolsea-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 '@poolsea-nestjs/validators-registry';
import { ConsensusModule } from '@poolsea-nestjs/consensus';
import { FetchModule } from '@poolsea-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 '@poolsea-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: @poolstream/crypto
Description: Transaction signer and create wallets for multiple blockchains.
Author: Leonardo Marquini Facchini
Latest version: 1.0.1-Beta

# @poolstream/crypto

**A lightweight and secure library for generating wallets and signing cryptocurrency transactions.**  
Built for self-custody, multi-chain compatibility, and developer flexibility.

## 📚 Table of Contents

- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
  - [Generate Wallet](#generate-wallet)
  - [Sign Transaction](#sign-transaction)
  - [Raw Node.Js](#raw-nodejs)
- [Supported Blockchains](#-supported-blockchains)
- [Security Notes](#-security-notes)
- [Documentation](#-documentation)
- [License](#-license)
- [Contributing](#-contributing)

## ✨ Features

- 🔐 Generate deterministic or random wallets
- 📝 Sign transactions securely
- 🌐 Multi-chain support (Ripple, Tron, Stellar, etc.)
- 📦 Minimal dependencies, fast install
- ✅ Works in Node.js environments
- 🔒 Designed for self-custodial apps (you keep the keys)

## 🚀 Installation

```bash
npm install @poolstream/crypto
# or
yarn add @poolstream/crypto
```

## 📦 Usage

### Generate Wallet

```typescript
import { Ripple } from "@poolstream/crypto";

let ripple = new Ripple();
let wallet = await ripple.generateWallet();

console.log(`Secret or private key: [${wallet.secret}]`);
console.log(`Wallet address: [${wallet.address}]`);
```

### Sign Transaction

```typescript
import { Ripple } from "@poolstream/crypto";

let ripple = new Ripple();

let naturalTransaction = {
  TransactionType: "Payment",
  Account: "...",
  Destination: "...",
  Amount: "1000000",
  Fee: "10",
  Sequence: 1,
  // etc.
};

let secret = "...";

let signedTransaction = await ripple.signTransaction(
  naturalTransaction,
  secret
);

console.log(signedTransaction);
```

### Raw Node.Js

```javascript
const crypto = require("@poolstream/crypto");
const ripple = new crypto.Ripple;
console.log(ripple.generateWallet());
```

## 🌍 Supported Blockchains

The API design is extensible and provides a common interface for all supported blockchains:

- ✅ Ripple (XRP Ledger)
- ✅ Stellar
- ✅ Tron
- 🚧 Ethereum (in progress)
- 🚧 Bitcoin (planned)
- ✅ Custom transaction builders supported

## 🔒 Security Notes

- This library is designed for offline usage and does not make any network requests.
- Your private keys never leave your environment.
- You are fully responsible for key management and secure storage.

## 📚 Documentation

📘 Full documentation and API reference:  
https://poolstream.io/docs

## 📄 License

This project is licensed under the GNU General Public License MIT.  
See the LICENSE file for more details.

## 🤝 Contributing

Contributions, improvements, and bug reports are welcome!  
Feel free to open an issue or submit a pull request.

---

Made with ❤️ by [PoolStream.io](https://poolstream.io)
npm package: @poolswap/sdk-v2
Description: 🛠 An SDK for building applications on top of PoolSwap.
Latest version: 2.3.14

# Pancakeswap SDK

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/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancakeswap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @poolswap/uikit
Description: Set of UI components for pancake projects
Latest version: 0.39.20

# 🥞 Pancake UIkit

[![Version](https://img.shields.io/npm/v/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit) [![Size](https://img.shields.io/bundlephobia/min/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit)

Pancake UIkit is a set of React components and hooks used to build pages on Pancake's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pancakeswap-libs/uikit`

## Setup

### Theme

Before using Pancake UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pancakeswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pancakeswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://pancakeswap.github.io/pancake-uikit/)
npm package: @pooltogether/api-runner
Description: Executes heavy-lifting API code in a regular node enviroment (ie. not `wrangler`) for better debugging, etc
Author: PoolTogether
Latest version: 1.11.0

# `Pooltogether API - Runner`

This library allows you to run the API locally for debugging via the node.js `node` enviroment, as well as be included in other packages (such as the Cloudflare Worker `api-entrypoint`).

## Development

1. `setInfuraId(INFURA_ID)` or `setQuicknodeId(QUICKNODE_ID)`
2. `setFetch(fetch)`
3. `getPools(1)`

## Local Testing

1. `node`
2. `const { getPools, setInfuraId } = require( './dist/index')`
3. `setInfuraId(YOUR_INFURA_ID)`
4. `getPools(chainId)`
npm package: @pooltogether/bnc-onboard
Description: Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.
Author: Aaron Barnard
Latest version: 1.36.0-b

# Onboard

JavaScript library to easily onboard users to ethereum apps by enabling wallet selection, connection, wallet checks and real time state updates.

## Install

`npm install bnc-onboard`

## Quick Start

```javascript
import Onboard from 'bnc-onboard'
import Web3 from 'web3'

// set a variable to store instantiated web3
let web3

// head to blocknative.com to create a key
const BLOCKNATIVE_KEY = 'blocknative-api-key'

// the network id that your dapp runs on
const NETWORK_ID = 1

// initialize onboard
const onboard = Onboard({
  dappId: BLOCKNATIVE_KEY,
  networkId: NETWORK_ID,
  subscriptions: {
    wallet: wallet => {
      // instantiate web3 when the user has selected a wallet
      web3 = new Web3(wallet.provider)
      console.log(`${wallet.name} connected!`)
    }
  }
})

// Prompt user to select a wallet
await onboard.walletSelect()

// Run wallet checks to make sure that user is ready to transact
await onboard.walletCheck()
```

## Documentation

For detailed documentation head to [docs.blocknative.com](https://docs.blocknative.com/onboard)
npm package: @pooltogether/bnc-onboard-hooks
Description: Hooks for adding Onboard.js to PoolTogether dapps
Author: PoolTogether Inc.
Latest version: 1.1.2

# PoolTogether bnc-onboard-hooks

Hooks for adding Onboard.js to PoolTogether dapps.

## NOTE

Make sure you keep `peerDependencies` and `devDependencies` versions in sync!

## How to use

1. `yarn add @pooltogether/utilities`
2. `import { hookYouWantToUse } from '@pooltogether/bnc-onboard-hooks'`
3. Ensure you call any required init functions early

## Local development

Local development works best with yalc
`yarn global add yalc`

In pooltogether-hooks:
`yarn start`

In the app you're importing pooltogether-hooks:
`yalc link @pooltogether/bnc-onboard-hooks`

When you save changes inside the hooks `src` folder, the package will rebuild and be pushed to all other projects that have run `yalc link @pooltogether/bnc-onboard-hooks`.

## TODO:

- jest tests
npm package: @pooltogether/contract-list-schema
Description: [![npm](https://img.shields.io/npm/v/@pooltogether/contract-list-schema)](https://unpkg.com/@pooltogether/contract-list-schema@latest/)
Author: PoolTogether Inc.
Latest version: 0.1.4

# `contract-list-schema`

[![npm](https://img.shields.io/npm/v/@pooltogether/contract-list-schema)](https://unpkg.com/@pooltogether/contract-list-schema@latest/)

A package for maintaining contract deployments & ABIs.

## Notes

With hardcoded addresses in a schema, when swapping out a contract address there will be a period of time when this package doesn't match live chain data.

## Maintaining

### **When swapping or removing a contract**

- Bump package **MAJOR** version
- Add contract ABIs (if necessary)
- Update relevant contracts in `contracts`

### **When deploying a new contract**

- Bump package **MINOR** version
- Add contract ABIs (if necessary)
- Add contracts to `contracts` (where necessary)

### **When adding a new tag**

- Bump package **MINOR** version
- Add tag to `tags`
- Add tag to relevant Contracts in `contracts`

#### Local use

In `contract-list-schema`
`yalc publish --push`

In the repo you want to use `contract-list-schema`
`yalc add contract-list-schema`
npm package: @pooltogether/current-pool-data
Description: Published list of contract addresses for PoolTogether v3
Author: PoolTogether Inc.
Latest version: 3.7.3

<p align="center">
  <a href="https://github.com/pooltogether/pooltogether--brand-assets">
    <img src="https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?raw=true" alt="PoolTogether Brand" style="max-width:100%;" width="200">
  </a>
</p>

<br />

## Current Pool Data


Use this library to programmatically get constants data (ie. contract addresses, etc) for specific versions of the PoolTogether protocol.

###### Note:

Since anyone can create a pool the `contractAddresses` array contains only community approved pool addresses.

This doesn't publish every pool address available, you'll want to use one of the subgraphs for that: 
(eg. https://thegraph.com/explorer/subgraph/pooltogether/rinkeby-staging-v3)

#### Instructions:

```sh
yarn add @pooltogether/current-pool-data
```

```js
import { contractAddresses } from '@pooltogether/current-pool-data'

// rinkeby is 4
const CHAIN_ID = 4

const daiPoolAddress = contractAddresses[CHAIN_ID].dai.prizePool
const daiPrizeStrategyAddress = contractAddresses[CHAIN_ID].dai.prizeStrategy
```
npm package: @pooltogether/etherplex
Description: Multicall with Ethers.js
Author: Brendan Asselstine
Latest version: 1.1.5

# Etherplex

[Ethers.js](https://github.com/ethers-io/ethers.js) + [Multicall](https://github.com/makerdao/multicall)

Batch multiple Ethereum JSON RPC calls into a single RPC call.

Features:

- Uses the Multicall contract when available
- Falls back to individual RPC requests when not available

# Setup

```bash
$ yarn add @pooltogether/etherplex
```

# Usage

1. First create a contract wrapper using the `contract` function
2. Chain calls on the contract and pass the results into the `batch` function

```javascript
import { ethers } from 'ethers'
import { batch, contract } from '@pooltogether/etherplex'

// Assuming ERC20Abi is an ABI
// Assume the DAI_ADDRESS and USDC_ADDRESS constants are Ethereum addresses

let daiContract = contract('Dai', ERC20Abi, DAI_ADDRESS)

// Alternatively, you can just pass in an ethers.Contract instance
let ethersContract = new ethers.Contract(USDC_ADDRESS, ERC20Abi, provider)
let usdcContract = contract('Usdc', ethersContract)

let results = await batch(
  ethers.getDefaultProvider(),
  daiContract
    .balanceOf(address)
    .totalSupply(),
  usdcContract
    .balanceOf(address)
    .totalSupply()
)
/*
Will yield:

{
  Dai: {
    'balanceOf(address)': [BigNumber],
    balanceOf: [BigNumber],
  },
  Usdc: {
    'balanceOf(address)': [BigNumber],
    balanceOf: [BigNumber],
  }
}

*/
```
npm package: @pooltogether/fixed-point
Description: An extremely simple fixed point math library
Author: Brendan Asselstine
Latest version: 1.0.0

# Fixed Point Math

[![CircleCI](https://circleci.com/gh/pooltogether/fixed-point.svg?style=svg)](https://circleci.com/gh/pooltogether/fixed-point)

This is a very simple fixed point math library.

# Setup

To install use yarm or npm and install `@pooltogether/fixed-point`:

```sh
$ yarn add @pooltogether/fixed-point
```

```sh
$ npm i @pooltogether/fixed-point
```

# Development

Install the dependencies:

```sh
$ yarn
```

Now run the tests:

```sh
$ yarn test
```
npm package: @pooltogether/hardhat-deploy-markdown-export
Description: This plugin turns your `hardhat-deploy` deployments into a nice markdown file.
Author: PoolTogether Inc.
Latest version: 0.3.5

# hardhat-deploy-markdown-export

This plugin turns your `hardhat-deploy` deployments into a nice markdown file.

# Usage

First install the package:

```
yarn add @pooltogether/hardhat-deploy-markdown-export
```

Now add it to hardhat.config.js:

```
require('@pooltogether/hardhat-deploy-markdown-export')
```

Now export your deployments:

```
hardhat deploy-markdown-export --help
```
npm package: @pooltogether/hooks
Description: Useful hooks for PoolTogether applications
Author: PoolTogether Inc.
Latest version: 2.1.0

# PoolTogether hooks

A collection of various useful hooks used across the PoolTogether applications.

## NOTE

Make sure you keep `peerDependencies` and `devDependencies` versions in sync!

## How to use

1. `yarn add @pooltogether/utilities`
2. `import * as Hooks from '@pooltogether/hooks'` OR `import { hookYouWantToUse } from '@pooltogether/hooks'`
3. Ensure you call any required init functions early

## Local development

Local development works best with yalc
`yarn global add yalc`

In pooltogether-hooks:
`yarn start`

In the app you're importing pooltogether-hooks:
`yalc link @pooltogether/hooks`

When you save changes inside the hooks `src` folder, the package will rebuild and be pushed to all other projects that have run `yalc link @pooltogether/hooks`.

## TODO:

- jest tests
npm package: @pooltogether/loot-box
Description: Loot Boxes are Ethereum smart contracts that can be traded like NFTs and plundered by the owner.
Latest version: 1.1.0

# Loot Boxes

[![CircleCI](https://circleci.com/gh/pooltogether/loot-box.svg?style=svg)](https://circleci.com/gh/pooltogether/loot-box)
[![Coverage Status](https://coveralls.io/repos/github/pooltogether/loot-box/badge.svg?branch=main)](https://coveralls.io/github/pooltogether/loot-box?branch=main)

Loot Boxes are Ethereum smart contracts that can be traded like NFTs and plundered for tokens.

Supported tokens:

- ERC20
- ERC721
- ERC777 (only if it implements ERC20)
- ERC1155

# Setup

You can use NPM to install the package:

```bash
$ npm install @pooltogether/loot-box
```

Or you can find the address and ABIs on the [Networks](https://docs.pooltogether.com/networks) page of the PoolTogether documentation.

# Usage

**LootBoxController**: A contract that associates an address with an ERC721 and allows anyone to "plunder" the address: withdrawing desired tokens to the ERC721 owner's address.

The user flow is like so:

1. The Loot Box Controller computes the Loot Box address for *any ERC721*.
2. Anyone can transfer tokens to the Loot Box address
3. Anyone may call the Loot Box Controller to transfer tokens from the Loot Box address to the current owner of the ERC721.

When the Loot Box controller withdraws tokens from a Loot Box, it's actually using CREATE2 to create a minimal proxy instance of a Loot Box.  After the tokens are transferred, the Loot Box contract is destroyed.  This cheap deployment and immediate destruction of the contract minimizes the gas overhead.

# API

## LootBoxController

```solidity
computeAddress(address erc721, uint256 tokenId)
```

Computes the address of the Loot Box for the given ERC721.  Returns the address of the Loot Box.

Note that no contract will exist there.  The Loot Box contract is created and destroyed in a single tx.

```solidity
plunder(
  address erc721,
  uint256 tokenId,
  address[] calldata erc20s,
  WithdrawERC721[] calldata erc721s,
  WithdrawERC1155[] calldata erc1155s
)
```

Transfers all of the given tokens in the Loot Box to the owner of the ERC721.

`erc20s` is an array of ERC20 token addresses. The full balance of each will be transferred to the ERC721 owner.

`erc721s` is an array of `WithdrawERC721` objects:

```solidity
struct WithdrawERC721 {
  address token;
  uint256[] tokenIds;
}
```

`erc1155s` is an array of `WithdrawERC1155` objects:

```solidity
struct WithdrawERC1155 {
  address token;
  uint256[] ids;
  uint256[] amounts;
  bytes data;
}
```

The gas usage of `plunder` is quite reasonable.  When withdrawing 2 ERC20s, 1 ERC721s and 1 ERC1155 the gas cost is ~211k.  This is based on the standard OpenZeppelin token implementations.

## Development

First clone the repository then run:

```bash
$ yarn
```

Now run the tests:

```bash
$ yarn test
```

Run code coverage:

```bash
$ yarn coverage
```

Run gas checks:

```bash
# start a node
$ yarn start-gas
# run the tests with gas reporter
$ yarn gas
```
npm package: @pooltogether/migrate-v3
Description: Ethereum Smart Contract to help users migrate from PoolManager V2 to PoolTogether V3
Latest version: 0.1.4

# PoolTogether Migrate V3 Contract

Helps users migrate from PoolTogether V2 to PoolTogether v3

## Setup

First clone the repository then run:

```bash
$ yarn
```

Copy over .envrc.example to .envrc

```
$ cp .envrc.example .envrc
```

Make sure to update the enviroment variables with suitable values.  You'll want to administer any pools you create, so be sure to use a mnemonic that you used to create a prize pool.

Now enable the env vars using [direnv](https://direnv.net/docs/installation.html)

```
$ direnv allow
```
npm package: @pooltogether/multi-token-listener
Description: PoolTogether MultiTokenListener
Latest version: 1.1.0

# PoolTogether Multi Token Listener

[![Coverage Status](https://coveralls.io/repos/github/pooltogether/multi-token-listener/badge.svg?branch=master)](https://coveralls.io/github/pooltogether/multi-token-listener?branch=master)

![Tests](https://github.com/pooltogether/multi-token-listener/actions/workflows/main.yml/badge.svg)

# About
MultiTokenListener is a contract which holds multiple [TokenFaucets](https://github.com/pooltogether/pooltogether-pool-contracts/blob/master/contracts/token-faucet/TokenFaucet.sol). This contract allows the allocation/rewarding of multiple tokens vs. a measure token, such as the PoolTogether Ticket. The `beforeTokenMint` and `beforeTokenTransfer` token hooks are called for each associated TokenFaucet. 

## Usage
1. TokenFaucets should be deployed and initialized individually. The owner of these TokenFaucets can be different to that of the MultiTokenListener.
1. This contract should be deployed.
1. The TokenFaucets should be added using `addTokenFaucets()`.
1. The appropriate `tokenListener` address should be set on the origin contract (PrizeStrategy)

# Installation
Install the repo and dependencies by running:
`yarn`

## Deployment
These contracts can be deployed to a network by running:
`yarn deploy <networkName>`

# Testing
Run the unit tests locally with:
`yarn test`

## Fork Test
In one terminal window run:
`yarn start-fork`

This will start the fork and deploy the implementation contract and also an instance of the MultiTokenListener.

In another terminal window run:
`yarn run-fork`

This will create several TokenFaucets, attach them to the MultiTokenListener instance, and set this address as the `tokenListener` for three prize strategies. Finally a rewards eligible ticket holders address balance is checked over time.   


## Coverage
Generate the test coverage report with:
`yarn coverage`