open-index/open-npm huggingface dataset:
npm package: @klef/vivliostyle-theme-klef-lecture
Description: For Lecture docs in Klef
Author: Kleha
Latest version: 0.1.0

# Vivliostyle Theme Klef Lecture

[![npm: version](https://flat.badgen.net/npm/v/vivliostyle-theme-klef-lecture)](https://npmjs.com/package/vivliostyle-theme-klef-lecture)
[![npm: total downloads](https://flat.badgen.net/npm/dt/vivliostyle-theme-klef-lecture)](https://npmjs.com/package/vivliostyle-theme-klef-lecture)
![npm: license](https://flat.badgen.net/npm/license/vivliostyle-theme-klef-lecture)

For Lecture docs in Klef

## Use

In `vivliostyle.config.js`:

```js
module.exports = {
  theme: 'vivliostyle-theme-klef-lecture',
};
```

If you want to add your CSS:

```js
module.exports = {
  theme: [
    'vivliostyle-theme-klef-lecture',
    // add your CSS 
  ],
};
```

## Dev

### Files

```
vivliostyle-theme-klef-lecture
├── LICENSE
├── README.md
├── example
│   ├── assets                            // auto generated
│   │   └── Logo (Mark + Type).png        // auto generated
│   └── default.md                        // 🖋
├── package.json
├── theme.css                             // 🖋
└── vivliostyle.config.js
```

**example**: Contain sample manuscripts using your theme.

### Commands

Run `vivliostyle preview` to preview your `theme.css`.

To watch file changes, use `preview` script.

```bash
npm run preview
# or
yarn preview
```

You can specify your CSS file and manuscript file for preview in vivliostyle.config.js:

```js
module.exports = {
  language: 'en',
  theme: ['node_modules/@vivliostyle/theme-base', '.'],
  entry: [
      'example/default.md',
      // and more...
  ],
}
```

Run `vivliostyle-theme-scripts validate` before publishing your package.

```bash
npm run validate
# or
yarn validate
```
npm package: @kleimaj/multiselect.js
Description: Simple multi-select pure javascript library
Author: Jacob Kleiman
Latest version: 1.0.8

# multiSelect.js :sparkles:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![\[Zero Dependencies\]()](https://img.shields.io/badge/Dependencies-0-blue.svg)
![\[Size\]()](https://img.shields.io/badge/Size-7%20KB-green.svg)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/TarekRaafat/autoComplete.js)



> Simple multi-select pure vanilla Javascript library. <a href="https://codepen.io/kleimaj/pen/mdEWVGb" target="\_blank">:rocket: Live Demo</a> **v1.0.8**

multiSelect.js is a simple, pure vanilla Javascript library that's progressively designed for easy integration for any type of project or system. The design was heavily influenced by that of the Bootstrap and Semantic-UI multi-select elements.

## Features

-   Pure Vanilla Javascript
-   Zero Dependencies
-   Simple & Easy to use
-   Extremely Lightweight
-   Blazing Fast
-   Versatile


## Installation

-   <img src="https://www.jsdelivr.com/img/logo@2x.png" alt="jsDelivr" width="100px">CDN

`CSS`

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@kleimaj/multiselect.js@1.0.8/css/style.min.css">
```

`JS`

```html
<script src="https://cdn.jsdelivr.net/npm/@kleimaj/multiselect.js@1.0.8/js/multiselect.min.js"></script>
```

```html
<select class="multi">
        <option value="" disabled selected>Select your option</option>
        <option value="Bananas">Bananas</option>
        <option value="Apples">Apples</option>
        <option value="Peaches">Peaches</option>
</select>
```

> It's essential that you name the class `multi` and set an initial option to `selected`, `disabled`, this will act as the placeholder value.

<img src="https://i.imgur.com/TdH3u2P.png" alt="Example Implementation"/>

* To get the values of the multi-select, you can do the following:
```javascript
const vals = document.querySelector('.multi').value;
console.log(vals); // "Banana,Apples,..."
// parse as an array
vals.split(','); // [Bananas, Apples, ...]
```

### Reinitialization

* By default, multiSelect elements will be initialized on page ready. However if you're using an async script, you may add multis after the page load by invoking `multiSelect()` or `window.multiSelect.refresh()`. This will initialize any new `.multi` elements that have not yet been created.

Special thanks to Hirbod for bringing this Issue (#1) to my attention.

## Support

For general questions about autoComplete.js, tweet at [@kleimaj].

For technical questions, you should post a question on [Stack Overflow] and tag
it with [multiSelect.js][so tag].

<!-- section links -->

[stack overflow]: https://stackoverflow.com/

[@kleimaj]: https://twitter.com/kleimaj

[so tag]: https://stackoverflow.com/questions/tagged/multiSelect.js

* * *

## Author

**Jacob Kleiman**

-   Email: jacobakleiman@gmail.com
-   Website: <https://jacobkleiman.com/>
-   Github: <https://github.com/kleimaj/>

Distributed under the MIT license. See `MIT` for more information.

* * *
npm package: @kleinstein/react-web-config
Description: An extension for react-native-config to support web
Author: Denis Sologub
Latest version: 1.0.0

@kleinstein/react-web-config
=========
[![npm version](https://img.shields.io/badge/npm_version-1.0.0-brightgreen)](https://www.npmjs.com/package/@kleinstein/react-web-config)
[![license](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE.txt)

## Overview

An extension to add a web support for [react-native-config](https://github.com/luggit/react-native-config) package. This package is based on [react-web-config](https://github.com/tanhauhau/react-web-config) from [tanhauhau](https://github.com/tanhauhau).

## Installation

### Step 1:

Install `react-native-config` according to [its manual](https://github.com/luggit/react-native-config).

### Step 2:

Install `@kleinstein/react-web-config`:  

- NPM: `npm install @kleinstein/react-web-config`
- Or Yarn: `yarn add @kleinstein/react-web-config`

### Step 3:

Add next lines to `webpack.config.js`:  

```diff
  const path = require('path');

  const webpack = require('webpack');
+ const webConfig = require('@kleinstein/react-web-config/WebConfig');
  ...
+ // Replace '.env' by actual filename
+ const envPath = path.resolve(__dirname, '.env');
  ...
  module.exports = {
    ...
    resolve: {
      ...
      alias: {
        ...
+       'react-native-config': '@kleinstein/react-web-config',
      },
      ...
    },
    ...
    plugins: [
      ...
      new webpack.DefinePlugin({
        ...
+       __REACT_WEB_CONFIG__: JSON.stringify(webConfig(envPath)),
      }),
      ...
    ],
    ...
  };

```

## Usage

**.env**:
```
HELLO_WORLD="Hello, World!"
```

**In code:**
```
import Config from 'react-native-config'
...
Config.HELLO_WORLD
```

## Licensing
Project is licensed under the MIT license. See [LICENSE](LICENSE.txt) for the full license text.
npm package: @klema-tech/puzzle
Description: Puzzle is an Backend as a Service microframework to create graceful AWS based APIs
Author: Victor Caetano
Latest version: 1.12.0

# 🧩 Puzzle Framework

### _Puzzle is an Backend as a Service microframework to create graceful AWS based APIs._

<br/>

![Klema Web](/readme.png)

<br/>
<br/>

### Configuring AWS Amplify ⚙️

<br/>

1- Install AWS Amplify CLI globally

```bash
npm install -g @aws-amplify/cli
```

2- Pull Amplify project locally

```bash
amplify pull --appId {APP_ID} --envName dev
```

<br/>

---

<br/>

## Getting Started 🔥

<br/>

1- Install @klema/puzzle using npm:

```sh
npm i @klema/puzzle
```
npm package: @klenty/gunner
Description: Zero magic, fast test-runner and assertion framework. No magic globals.
Author: Muthu Kumar
Latest version: 0.11.11

# Gunner

<img alt="Django Unchained" src="https://raw.githubusercontent.com/klenty/Gunner/master/assets/gun.jpeg" height="350" />

#### _Tiny, but fully loaded._

> Gunner is a zero magic, fast test-runner and assertion framework. There are no magic globals or CLI specific interface.

## Requirements & Usage

`Gunner` uses very modern JavaScript, and hence requires **node 10+** ❗️⚠️ currently.

Create a new `Gunner` instance and simply write your tests. The assertion methods are passed in as the callback as an `expect` object to the test function.

```JavaScript
const { Gunner, expect } = require('@klenty/gunner');
// Create new instance
const gunner = new Gunner();

// Define tests
gunner.test('arrays are equal', () => {
	return expect([1, 2,]).deepEqual([1 ,2]);
});

// Starts the runner
gunner.run();
```

## Documentation

- ### `Class`:
	- #### [`Gunner.constructor`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#new-gunner-options)

- ### `Methods`:
	- #### [`Gunner#test`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnertest-title-implementation)
	- #### [`Gunner#before`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnerbefore-title-implementation)
	- #### [`Gunner#after`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnerafter-title-implementation)
	- #### [`Gunner#run`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnerrun-options)

- ### `Constants`:
	- #### `[Gunner.Start]`
	- #### `[Gunner.End]`

- ### [`State and Advanced Usage`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#state)

## Credits

`Gunner` was built by Muthu Kumar [(@MKRhere)](https://github.com/MKRhere) at [Klenty](https://klenty.com), a sales automation startup.
npm package: @klerick/json-api-nestjs-shared
Description: Shared Helper for JsonApi Plugin for NestJs
Latest version: 1.0.0-beta.7

<p align='center'>
  <a href="https://www.npmjs.com/package/@klerick/json-api-nestjs-shared" target="_blank"><img src="https://img.shields.io/npm/v/@klerick/json-api-nestjs-shared.svg" alt="NPM Version" /></a>
  <a href="https://www.npmjs.com/package/@klerick/json-api-nestjs-shared" target="_blank"><img src="https://img.shields.io/npm/l/@klerick/json-api-nestjs-shared.svg" alt="Package License" /></a>
  <a href="https://www.npmjs.com/package/@klerick/json-api-nestjs-shared" target="_blank"><img src="https://img.shields.io/npm/dm/@klerick/json-api-nestjs-shared.svg" alt="NPM Downloads" /></a>
  <a href="http://commitizen.github.io/cz-cli/" target="_blank"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" /></a>
  <img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/klerick/02a4c98cf7008fea2af70dc2d50f4cb7/raw/json-api-nestjs-microorm.json" alt="Coverage Badge" />
</p>

# json-api-nestjs-shared

Helper module for **[json-api-nestjs](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs)**

## Installation

```bash  
$ npm install @klerick/json-api-nestjs-shared
```
npm package: @klerick/json-api-nestjs-typeorm
Description: MicroOrm adapter for JsonApi Plugin for NestJs
Latest version: 0.1.0-beta.16

<p align='center'>
  <a href="https://www.npmjs.com/package/@klerick/json-api-nestjs-typeorm" target="_blank"><img src="https://img.shields.io/npm/v/@klerick/json-api-nestjs-typeorm.svg" alt="NPM Version" /></a>
  <a href="https://www.npmjs.com/package/@klerick/json-api-nestjs-typeorm" target="_blank"><img src="https://img.shields.io/npm/l/@klerick/json-api-nestjs-typeorm.svg" alt="Package License" /></a>
  <a href="https://www.npmjs.com/package/@klerick/json-api-nestjs-typeorm" target="_blank"><img src="https://img.shields.io/npm/dm/@klerick/json-api-nestjs-typeorm.svg" alt="NPM Downloads" /></a>
  <a href="http://commitizen.github.io/cz-cli/" target="_blank"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" /></a>
  <img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/klerick/02a4c98cf7008fea2af70dc2d50f4cb7/raw/json-api-nestjs-microorm.json" alt="Coverage Badge" />
</p>

# json-api-nestjs-typeorm

TypeOrm adapter for **[json-api-nestjs](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs)**

## Installation

```bash  
$ npm install @klerick/json-api-nestjs-typeorm
```  


## Configuration params

The following interface is using for the configuration:

```typescript
export type TypeOrmParam = {
  useSoftDelete?: boolean // Use soft delete
  runInTransaction?: <Func extends (...args: any) => any>(
    isolationLevel: IsolationLevel,
    fn: Func
  ) => ReturnType<Func> // You can use cutom function for wrapping transaction in atomic operation, example: runInTransaction from https://github.com/Aliheym/typeorm-transactional
};
```

## Resource Linkage for To-One Relations

To enable automatic resource linkage (`data` field in relationships) for to-one relations, use the `@RelationId` decorator from TypeORM.

**Example:**
```typescript
import {
  Entity,
  PrimaryGeneratedColumn,
  ManyToOne,
  JoinColumn,
  RelationId,
} from 'typeorm';

@Entity('comments')
export class Comments {
  @PrimaryGeneratedColumn()
  public id!: number;

  @ManyToOne(() => Users)
  @JoinColumn({ name: 'user_id' })
  public user!: Users;

  // This field will be used for resource linkage
  @RelationId((comment: Comments) => comment.user)
  public userId!: number;
}
```

The `@RelationId` decorator creates a virtual field that contains the FK value. The library automatically detects these fields and uses them to populate `relationships.{relation}.data` in API responses.
npm package: @klerick/ng-pixijs
Description: PixiJS primitives as Angular components
Author: Aleksandr Kharkovey
Latest version: 1.3.1

<div align="center">

[//]: # (  <a href="https://github.com/ng-doc/ng-doc">)

[//]: # (    <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px">)

[//]: # (  </a>)
<h1 align="center" style="margin-bottom: 0; border-bottom: 0">NgPixiJS</h1>
  <p align="center">
    PixiJS primitives as Angular components
    <br />
    <a href="https://ng-pixijs.klerick.lol/">Documentation</a>
    ·
    <a href="https://github.com/klerick/ng-pixijs/issues/new/choose">Report Bug</a>
    ·
    <a href="https://github.com/klerick/ng-pixijs/issues/new/choose">Request Feature</a>

[![GitHub Workflow Status][build-shield]][build-url]
[![NPM][npm-shield]][npm-url]
[![MIT License][license-shield]][license-url]

  </p>
</div>

<!-- ABOUT -->
<!-- -->

## About

This library provides powerful tools for integrating [PixiJS](https://pixijs.com/) - a popular library for 2D graphics and animations—into [Angular](https://angular.dev/) applications.
By utilizing a custom [RendererFactory2](https://angular.dev/api/core/RendererFactory2), developers can seamlessly combine the robust visual capabilities of PixiJS with the flexibility and structure of Angular.


#### Key Features

- PixiJS Integration in Angular:
- Custom RendererFactory2:
- Creation of Custom Components:
- Support for Dependency Injection (DI):
- Control Flow in Templates:


<!-- GETTING STARTED -->

## Installation

To know how to install and use NgPixiJS, please check our [documentation](https://ng-pixijs.klerick.lol/).


<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[npm-shield]: https://img.shields.io/npm/v/@klerick/ng-pixijs.svg?style=for-the-badge
[npm-url]: https://www.npmjs.com/package/@klerick/ng-pixijs
[license-shield]: https://img.shields.io/github/license/klerick/ng-pixijs.svg?style=for-the-badge
[license-url]: https://github.com/ng-doc/klerick/ng-pixijs/blob/main/LICENSE
[build-shield]: https://img.shields.io/github/actions/workflow/status/klerick/ng-pixijs/release.yml?style=for-the-badge&branch=release
[build-url]: https://github.com/klerick/ng-pixijs/actions
npm package: @kleroai/vue
Description: Official Klero Vue SDK — feedback boards, roadmaps, changelogs, surveys & widgets
Latest version: 0.2.0

# @kleroai/vue

Official Vue 3 SDK for [Klero](https://klero.ai) — embed feedback boards, roadmaps, changelogs, surveys, and widgets in your Vue app.

## Installation

```bash
npm install @kleroai/vue
```

## Quick Start

### Plugin approach

```ts
import { createApp } from 'vue';
import { KleroPlugin } from '@kleroai/vue';

const app = createApp(App);
app.use(KleroPlugin, { projectSlug: 'your-project' });
app.mount('#app');
```

### Provider approach

```vue
<script setup>
import { KleroProvider, KleroFeedback, KleroWidget } from '@kleroai/vue';
</script>

<template>
  <KleroProvider project-slug="your-project">
    <KleroFeedback />
    <KleroWidget />
  </KleroProvider>
</template>
```

## Components

### `<KleroProvider>`

| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `project-slug` | `string` | Yes | Your Klero project slug |
| `base-url` | `string` | No | Custom base URL |
| `customer-token` | `string` | No | JWT for authenticated users |
| `login-url` | `string` | No | Login redirect URL |

### `<KleroFeedback />`, `<KleroChangelog />`

Inline embeds. No additional props required.

### `<KleroRoadmap />`

| Prop | Type | Description |
|------|------|-------------|
| `roadmap-slug` | `string` | Specific roadmap to display |

### `<KleroWidget />`

No additional props. Appearance and tabs are configured in the dashboard.

### `<KleroSurvey />`

| Prop | Type | Required |
|------|------|----------|
| `survey-ulid` | `string` | Yes |

| Event | Payload |
|-------|---------|
| `@complete` | `{ surveyUlid, responseUlid, answers }` |
| `@close` | `{ surveyUlid, completed }` |
| `@error` | `{ surveyUlid, error }` |

## Composables

### `useKleroSurvey()`

```ts
const { open, close } = useKleroSurvey();
open('survey-ulid');
```

### `useKleroWidget()`

```ts
const { open, close } = useKleroWidget();
open();
```

## SSR Support

All components are SSR-safe (Nuxt compatible). DOM access only in `onMounted`.

## License

MIT
npm package: @kleros/address-tags-sdk
Description: Simple library to get address information from the Kleros curated tags registry.
Latest version: 0.2.2

# Address Tags SDK

Simple library to get address information from the Kleros curated tags registry.

## Getting Started

### Installing

```
npm install @kleros/address-tags-sdk
```

```
yarn add @kleros/address-tags-sdk
```

### Example

```javascript
import { getAddressInfo } from "@kleros/address-tags-sdk";

const addressInformation = getAddressInfo(
  "0xdAC17F958D2ee523a2206206994597C13D831ec7",
  "https://ipfs.kleros.io"
);
```

## Version History

* 0.1
    * Initial Release

## License

This project is licensed under the MIT License.
npm package: @kleros/arbitrable-proxy-contracts
Description: [![npm version](https://badge.fury.io/js/%40kleros%2Farbitrable-proxy-contracts.svg)](https://badge.fury.io/js/%40kleros%2Farbitrable-proxy-contracts) # General Purpose Arbitrable Contracts
Author: Kleros
Latest version: 5.0.3

[![npm version](https://badge.fury.io/js/%40kleros%2Farbitrable-proxy-contracts.svg)](https://badge.fury.io/js/%40kleros%2Farbitrable-proxy-contracts)
# General Purpose Arbitrable Contracts

General purpose arbitrable contracts as defined in ERC-792

## Testing

```
yarn run ganache
yarn run test
```

## Deployment

To deploy `ArbitrableProxy` run:

```
INFURA_PROJECT_ID=<your_infura_project_id> WALLET_KEY=<your_wallets_private_key> ETHERSCAN=<your_etherscan_api_key> NETWORK=<network_name> yarn deploy
```

This command will also automatically verify the source code on Etherscan.

Note: Network names are defined in `truffle.js`. It has definitions for main, kovan, ropsten and development. Define extra if needed.

Check latest live versions of this contract on https://resolve.kleros.io .
npm package: @kleros/archon
Description: A javascript library for Ethereum dispute resolution. Provides the ability to interface with Arbitrable and Arbitrator Ethereum smart contracts, as defined in ERC 792.
Latest version: 2.4.0

# Archon

> Archon provides functionality for Arbitrator and Arbitrable Ethereum smart contracts as defined in ERC 792 and ERC 1497.

## Documentation

See full documentation at https://archon.readthedocs.io/en/latest/index.html

## Installation

```
npm install @kleros/archon
```

## Basic Usage

```
var Archon = require('@kleros/archon');

var archon = new Archon('wss://some.local-or-remote.node:8546');

> archon.arbitrator
> archon.arbitrable
> archon.utils
> archon.version
```

## Test

```sh
yarn ganache
yarn test
```

## Build

```sh
yarn run build
```

## Update Docs

The documentation is based on Sphinx. Install Sphinx with your global python or in a virtualenv
```
pip install sphinx
```


1) Update `.rst` files in /docs


2) Run to generate new docs bundle
```
cd docs && make html
```

3) View changes
```
open ./docs/_build/html/index.html
```

4) Push changes
npm package: @kleros/contract-deployments
Description: Deployment information for Kleros interaction contracts
Author: Kleros
Latest version: 0.3.2
Deprecated: Obsolete

# Kleros Contract Deployments

Deployment information for Kleros interaction contracts.

## Installation

With NPM:

```sh
npm install --save @kleros/contract-deployments
```

With Yarn:

```sh
yarn add @kleros/contract-deployments
```

## Usage

### Import everything

Contracts are split by application:

```
import deployments from '@kleros/contract-deployments';

const Linguo = deployments.linguo.Linguo;
//                         A      A
//                         |      |
//                 App  ---+      +--- Contract name

console.log(Linguo);
// {
//   contractName: "Linguo",
//   abi: [...],
//   networks: {
//     '<network-id>': {
//       address: '0x9999999999999999999999999999999999999999',
//     }
//   }
// }
```

The reason they are organized this way is because most applications will have more than one contract related to them.

### Import from an specific application

Contracts are split by application:

```
import Linguo from '@kleros/contract-deployments/linguo';

console.log(Linguo);
// {
//   contractName: "Linguo",
//   abi: [...],
//   networks: {
//     '<network-id>': {
//       address: '0x9999999999999999999999999999999999999999',
//     }
//   }
// }
```
npm package: @kleros/cross-chain-realitio-contracts
Description: Smart contracts to enable cross-chain arbitration for Realitio (Reality.eth)
Author: Kleros
Latest version: 0.3.0

# @kleros/cross-chain-realitio-contracts

Smart contracts to enable cross-chain arbitration for Realitio (Reality.eth)

## Contributing

### Install Dependencies

```bash
yarn install
```

### Run Tests

```bash
yarn test
```

### Compile the Contracts

```bash
yarn build
```

### Run Linter on Files

```bash
yarn lint
```

### Fix Linter Issues on Files

```bash
yarn fix
```
npm package: @kleros/erc-792
Description: ERC-792: Arbitration Standard
Author: Kleros
Latest version: 8.0.0

# Basic Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.

Try running some of the following tasks:

```shell
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help
```
npm package: @kleros/ethereum-libraries
Description: Library contracts for Ethereum
Author: Kleros
Latest version: 7.0.1

# ethereum-libraries
Library contracts for Ethereum

Starting from `@kleros/ethereum-libraries@7.0.0`, major version number will be equal to minor Solidity version number.
For example `@kleros/ethereum-libraries@7.x.x` contains contracts written with Solidity `0.7.x`.
npm package: @kleros/file-to-ipfs
Description: Utility to upload files to Kleros IPFS node.
Latest version: 0.3.2

# File to IPFS

Utility to upload files to Kleros IPFS node. 

It can be used as a standalone CLI tool or a node module.

## Installation

```bash
yarn add @kleros/file-to-ipfs
# npm install --save @kleros/file-to-ipfs
```

## Usage

### CLI

```
Usage:
    Regular files:
      cli.js --file <file-path> [-v] [--rename <new-name>] [-e <ipfs-endpoint>]
    Directories inside a zip file that will be unzipped:
      cli.js --zipped-directory <zip-file-path> [-v] [--rename <new-name>] [-e
      <ipfs-endpoint>]

Options:
  -f, --file              The path of the file                          [string]
  -z, --zipped-directory  The path of the zip file containing a directory
                                                                        [string]
  -r, --rename            The new file name                             [string]
  -e, --endpoint          The IPFS endpoint
                                    [string] [default: "https://ipfs.kleros.io"]
  -v, --verbose           Whether it should display the full IPFS upload result
                          or not
  -h, --help              Show help                                    [boolean]
  -V, --version           Show version number                          [boolean]
```

### Module

#### `fileToIpfs`

Default usage.

```javascript
fileToIpfs(filePath, { rename?: string } = {}) => Promise<string>;
```

Params:
- `filePath`: The path to the file in the file system.
- `rename`: Provided if the name of the uploaded file should be different than the original.
- `isZippedDirectory`: Whether the file should be treated as a zipped directory or not.

Returns:
- `Promise<string>`: a promise for the IPFS path of the uploaded file.

Example:

```javascript
const fileToIpfs = require('@kleros/file-to-ipfs');

// Regular file
(async() => {
    const ipfsPath = await fileToIpfs('<path-to-file>');
    console.log(ipfsPath);
})();

// Zipped directory
(async() => {
    const ipfsPath = await fileToIpfs('<path-to-zip-file>', { isZippedDirectory: true });
    console.log(ipfsPath);
})();
```

#### `fileToIpfs.factory`

Allows to create another `file-to-ipfs` instance to upload files to a different IPFS endpoint.


```javascript
fileToIpfsFactory({ endpoint: string }) => fileToIpfs
```

Params:
- `endpoint`: The IPFS endpoint.

Returns:
- `fileToIpfs`: a new instance of the fileToIpfs function.


Example:

```javascript
const { factory } = require('@kleros/file-to-ipfs');

const fileToIpfs = factory({ endpoint: 'https://gateway.ipfs.io' });

(async() => {
    const ipfsPath = await fileToIpfs('<path-to-file>');
    console.log(ipfsPath);
})();
```

#### `fileToIpfs.DEFAULT_IPFS_ENDPOINT`

The value of the default IPFS endpoint

```javascript
const DEFAULT_IPFS_ENDPOINT: string = 'https://ipfs.kleros.io'
```
npm package: @kleros/gtcr-encoder
Description: Encode and decode GTCR items.
Author: Kleros
Latest version: 1.6.1

<p align="center">
  <b style="font-size: 32px;">Generalized TCR Encoder</b>
</p>

<p align="center">
  <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
  <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
</p>

## Summary

Generalized TCR (a.k.a. Curate) allows creating TCRs of items with an arbitrary number and type of columns. To do this, data is stored as a byte array. This library makes it easy to encode and decode items.
npm package: @kleros/gtcr-sdk
Description: Read and write to/from Generalized TCRs
Author: Kleros
Latest version: 1.8.0

<p align="center">
  <b style="font-size: 32px;">Curate SDK</b>
</p>

<p align="center">
  <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
  <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
</p>

An SDK to read and interact with Curate contracts.
npm package: @kleros/kathari
Description: Linting and formatting scripts for multiple types of projects.
Author: Kleros
Latest version: 0.25.0

<p align="center">
  <b style="font-size: 32px;">Kathari</b>
</p>

<p align="center">
  <a href="https://travis-ci.org/kleros/kathari"><img src="https://travis-ci.org/kleros/kathari.svg?branch=master" alt="Build Status"></a>
  <a href="https://david-dm.org/kleros/kathari"><img src="https://david-dm.org/kleros/kathari.svg" alt="Dependencies"></a>
  <a href="https://david-dm.org/kleros/kathari?type=dev"><img src="https://david-dm.org/kleros/kathari/dev-status.svg" alt="Dev Dependencies"></a>
  <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
  <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
  <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
</p>

## Scripts

- `kathari prettify` - Apply prettier to the entire project.
- `kathari lint:sol` - Lint the entire project's `.sol` files.
- `kathari lint:scss` - Lint the entire project's `.scss` files.
- `kathari lint:styled` - Lint the entire project's `.js` files with styled components.
- `kathari lint:js [--no-root]` - Lint the entire project's `.js` files. Pass in `--no-root` if there are no `.js` files in the project root.
- `kathari commitmsg` - Lint commit messages on a githook.
- `kathari precommit` - Lint and run tests on a githook.
- `kathari cz` - Run commitizen.
npm package: @kleros/kleros
Description: Kleros core smart contracts.
Author: Kleros
Latest version: 0.1.5
Deprecated: Obsolete

<p align="center">
  <b style="font-size: 32px;">Kleros</b>
</p>

<p align="center">
  <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
  <a href="https://travis-ci.org/kleros/kleros"><img src="https://travis-ci.org/kleros/kleros.svg?branch=master" alt="Build Status"></a>
  <a href="https://david-dm.org/kleros/kleros"><img src="https://david-dm.org/kleros/kleros.svg" alt="Dependencies"></a>
  <a href="https://david-dm.org/kleros/kleros?type=dev"><img src="https://david-dm.org/kleros/kleros/dev-status.svg" alt="Dev Dependencies"></a>
  <a href="https://github.com/trufflesuite/truffle"><img src="https://img.shields.io/badge/tested%20with-truffle-red.svg" alt="Tested with Truffle"></a>
  <a href="https://coveralls.io/github/kleros/kleros?branch=master"><img src="https://coveralls.io/repos/github/kleros/kleros/badge.svg?branch=master" alt="Coverage Status"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
  <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
  <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
</p>

Kleros core smart contracts.

## Get Started

1.  Clone this repo.
2.  Run `yarn` to install dependencies and then `yarn run build` to compile the contracts.

## Scripts

- `yarn run prettify` - Apply prettier to the entire project.
- `yarn run lint:sol` - Lint the entire project's .sol files.
- `yarn run lint:js` - Lint the entire project's .js files.
- `yarn run lint:sol --fix` - Fix fixable linting errors in .sol files.
- `yarn run lint:js --fix` - Fix fixable linting errors in .js files.
- `yarn run lint` - Lint the entire project's .sol and .js files.
- `yarn test` - Run the truffle tests.
- `yarn run cz` - Run commitizen.
- `yarn run build` - Compile contracts.

## Contributing

See CONTRIBUTING.md.

Learn how to develop arbitrable and arbitrator contracts [here](https://erc-792.readthedocs.io/en/latest/).
npm package: @kleros/kleros-interaction
Description: Smart contracts interacting with Kleros.
Author: Kleros
Latest version: 0.10.0
Deprecated: Obsolete

<p align="center">
  <b style="font-size: 32px;">Kleros Interaction Smart Contracts</b>
</p>

<p align="center">
  <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
  <a href="https://travis-ci.org/kleros/kleros-interaction"><img src="https://travis-ci.org/kleros/kleros-interaction.svg?branch=master" alt="Build Status"></a>
  <a href="https://david-dm.org/kleros/kleros-interaction"><img src="https://david-dm.org/kleros/kleros-interaction.svg" alt="Dependencies"></a>
  <a href="https://david-dm.org/kleros/kleros-interaction?type=dev"><img src="https://david-dm.org/kleros/kleros-interaction/dev-status.svg" alt="Dev Dependencies"></a>
  <a href="https://github.com/trufflesuite/truffle"><img src="https://img.shields.io/badge/tested%20with-truffle-red.svg" alt="Tested with Truffle"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
  <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
  <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
  <a href="https://gitter.im/kleros/kleros-interaction?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/kleros/kleros-interaction.svg" alt="Chat on Gitter"></a>
</p>

Smart contracts able to interact with Kleros and standard proposals.

## Get Started

1.  Clone this repo.
2.  Run `yarn` to install dependencies and then `yarn run build` to compile the contracts.

## Scripts

- `yarn run prettify` - Apply prettier to the entire project.
- `yarn run lint:sol` - Lint the entire project's .sol files.
- `yarn run lint:js` - Lint the entire project's .js files.
- `yarn run lint:sol --fix` - Fix fixable linting errors in .sol files.
- `yarn run lint:js --fix` - Fix fixable linting errors in .js files.
- `yarn run lint` - Lint the entire project's .sol and .js files.
- `yarn test` - Run the truffle tests.
- `yarn run cz` - Run commitizen.
- `yarn run build` - Compile contracts.

## Test

Testrpc default gas limit is lower than the mainnet which prevents deploying some contracts. Before running truffle tests use:
`testrpc -l 8000000`.

## Contributing

See [contributing](https://kleros.gitbook.io/contributing-md/).

Learn how to develop arbitrable and arbitrator contracts [here](https://erc-792.readthedocs.io/en/latest/).
npm package: @kleros/market-maker
Description: 1. Run `yarn global add @kleros/market-maker`. 2. Run `@kleros/market-maker` and follow the prompts.
Author: Kleros
Latest version: 4.7.23

## Get Started Using

1. Run `yarn global add @kleros/market-maker`.
2. Run `@kleros/market-maker` and follow the prompts.
npm package: @kleros/merkle-tree
Description: Implementation of a Merkle Tree in plain TypeScript
Author: Kleros
Latest version: 0.2.1

# Merkle Tree

Merkle Tree implementation, shamelessly adapted from [`@openzeppelin/contracts`](https://github.com/OpenZeppelin/openzeppelin-contracts) test utils.

## Installation

```bash
yarn add @kleros/merkle-tree
# npm install --save @kleros/merkle-tree
```

## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [constructor][1]
-   [getRoot][3]
-   [getProof][4]
-   [getHexRoot][6]
-   [getHexProof][7]
-   [static makeLeafNode][9]

### `constructor`

Creates a Merkle Tree from an array of hex strings.

#### Parameters

-   `leafNodes` **[Array][11]&lt;[string][12]>** An array of 32-byte hex strings.

### `getRoot`

Gets the root of the merkle tree.

Returns **[Buffer][13]** root The merkle root as a Buffer.

### `getProof`

Gets the merkle proof for a given element.

#### Parameters

-   `el` **[Buffer][13]** The element to search for the proof.

Returns **[Array][11]&lt;[Buffer][13]>** proof The merkle proof.

### `getHexRoot`

Gets the root of the merkle tree as hex.

Returns **[string][12]** The merkle root as a 0x-prefixed 32-byte hex string.

### `getHexProof`

Gets the merkle proof for a given element as a 32-byte hex string.

#### Parameters

-   `el` **[string][12]** The element to search for the proof.

Returns **[Array][11]&lt;[string][12]>** proof The merkle proof as an array of 32-byte hex strings.

### `getWidth`

Returns the number of leaf nodes in the Merkle Tree.

Returns **[number][14]** width The tree width.

### `getHeight`

Returns the number of layers in the Merkle Tree.

Returns **[number][14]** height The tree height.

### `static makeLeafNode`

Creates a leaf node from any number of args.
This is the equivalent of `keccak256(abi.encodePacked(first, ...rest))` on Solidity.

#### Parameters

-   `first` **Mixed** The data to be transformed into a node.
-   `rest` **...[Array][11]&lt;Mixed>** Additional args to combine into a node.

Returns **[string][12]** node The `sha3` (A.K.A. `keccak256`) hash of `first, ...params` as a 32-byte hex string.

[1]: #constructor

[2]: #parameters

[3]: #getroot

[4]: #getproof

[5]: #parameters-1

[6]: #gethexroot

[7]: #gethexproof

[8]: #parameters-2

[9]: #static-makeleafnode

[10]: #parameters-3

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[13]: https://nodejs.org/api/buffer.html

[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
npm package: @kleros/multicall-relayer
Description: Multicall3 typescript bindings and transaction relayer logic
Author: Kleros
Latest version: 0.1.0

# MulticallRelayer

Adds multiple calldatas to a batch and calls [**Multicall3**](https://github.com/mds1/multicall/blob/main/src/Multicall3.sol) contract's [`aggregate3`](https://github.com/mds1/multicall/blob/main/src/Multicall3.sol#L98-L123) function.

## Installing
```sh
$ yarn add @kleros/multicall-relayer
```

## Using it
#### Create MultiCaller
```js
import MultiCaller from "@kleros/multicall-relayer"

const multicaller = new MultiCaller({
    rpcUrl,
    privateKey,
    multicall3Address,
    gasPriceCeilingWei, // optional
    logtailSourceToken, // optional
    amqp: { url, exchange } // optional
})
```

#### Add call to be batched
```js
multicaller.add({
    allowFailure: false,
    target: poh.address,
    callData: pohI.encodeFunctionData(
                "withdrawFeesAndRewards",
                [beneficiary, humanityId, requestId, challengeId, round]
                )
})

// Or multiple calls...
multicaller.add(...calls)
```

#### Send the transaction!
```js
const tx = await multicaller.send()
```

### Constructor arguments
- `rpcUrl` - url of the rpc to be used.
- `privateKey` - private key of wallet to execute the transaction.
- `multicall3Address` - Multicall3 contract address on the chain corresponding to the given rpc.
- `gasPriceCeilingWei` *(optional)* - gas price ceiling in wei.
- `logtailSourceToken` *(optional)* - Logtail token to send logs to. If missing, `console.log` is used.
- `amqp` *(optional)* - AMQP to be notified once the transaction is sent to the blockchain. Requires 2 parameters:
  - `url` - url of the provider.
  - `exchange` - name of the exchange.
npm package: @kleros/pnk-merkle-drop-contracts
Description: Smart Contracts to manage and redeem PNK airdrops.
Author: Kleros
Latest version: 0.1.0

# PNK Merkle Drop Contracts

Smart Contracts to manage and redeem PNK airdrops.

## Deployments

- `kovan`: [deployment](./deployments/kovan/MerkleRedeem.json#L2)
- `mainnet`: [deployment](./deployments/mainnet/MerkleRedeem.json#L2)

## Usage

### 0. Generate the Snapshot

To generate the snapshot for the current `period`, please follow the instructions on the `snapshots` package [README](../snapshots/README.md).

The file can be found at:
```
https://pnk-airdrop-snapshots.s3.us-east-2.amazonaws.com/snapshot-{{period}}.json
```

Where `{{period}}` is the numeric sequential number of the distribution, starting from `1`.

### 1. Fund the Deployer Wallet

Send to the deployer account (`0x76BFB6AE7463f5c0Aad6DFeaF360EB2e0e0Bdc83`) the amount of PNK being allocated for the current `period`.

### 2. Seed the Allocation

Once you got the snapshot JSON file stored, you will need to get the following values from there:

- `merkleTree.root`: This is the root of the merkle tree.
- `droppedAmount`: The amount allocated for this round of the airdrop.

Then you need to submit the following transaction:

```solidity
seedAllocations(period, merkleRoot, droppedAmount)
```

from the deployer account.

If you don't have the private key for that account, ask Annabele or @hbarcelos for it and import it to your wallet.

**NOTICE:** after this transaction is mined, the PNK balance is transfered from the deployer account to the contract.

### 3. Claim the Rewards

In order to claim the rewards, one need to provide :

- `{{address}}`: The address of the juror (`string`).
- `{{period}}`: The period of the claim (`number`).

and also the following data from the snapshot file:

- `merkleTree.claims[{{address}}].value`: The amount being claimed (`number`)
- `merkleTree.claims[{{address}}].proof`: The merkle proof for that claim (`string[]`)
npm package: @kleros/realitio-arbitrator-with-appeals
Description: A [Realitio v2](https://github.com/realitio/realitio-contracts/blob/master/truffle/contracts/Realitio_v2_1.sol) arbitrator implementation that also implements [IDisputeResolver](https://github.com/kleros/dispute-resolver-interface-contract).
Author: Kleros
Latest version: 1.0.3

# realitio-arbitrator-proxy-with-appeals
A [Realitio v2](https://github.com/realitio/realitio-contracts/blob/master/truffle/contracts/Realitio_v2_1.sol) arbitrator implementation that also implements [IDisputeResolver](https://github.com/kleros/dispute-resolver-interface-contract).
npm package: @kleros/tcr
Description: Arbitrable Permission Lists on Ethereum
Author: Kleros
Latest version: 2.0.0

<p align="center">
  <b style="font-size: 32px;">Arbitrable Permission Lists on Ethereum</b>
</p>

<p align="center">
  <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
  <a href="https://github.com/trufflesuite/truffle"><img src="https://img.shields.io/badge/tested%20with-truffle-red.svg" alt="Tested with Truffle"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
  <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
  <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
</p>

Contracts for creating arbitrable permission lists on Ethereum.

## Development

1.  Clone this repo.
2.  Run `yarn` to install dependencies and then `yarn build` to compile the contracts.

## Release

To bump the version of the package, use `yarn release`.

## Scripts

- `yarn prettify` - Apply prettier to the entire project.
- `yarn lint:sol` - Lint the entire project's .sol files.
- `yarn lint:js` - Lint the entire project's .js files.
- `yarn lint:sol --fix` - Fix fixable linting errors in .sol files.
- `yarn lint:js --fix` - Fix fixable linting errors in .js files.
- `yarn lint` - Lint the entire project's .sol and .js files.
- `yarn test` - Run the truffle tests.
- `yarn cz` - Run commitizen.
- `yarn build` - Compiles contracts and extracts the abi into the abi folder.
- `yarn release` - Run standard-version`.

## Test

Testrpc default gas limit is lower than the mainnet which prevents deploying some contracts. Before running truffle tests use:
`testrpc -l 8000000`.

## Contributing

See [contributing](https://kleros.gitbook.io/contributing-md/).

Learn how to develop arbitrable and arbitrator contracts [here](https://erc-792.readthedocs.io/en/latest/).