open-index/open-npm huggingface dataset:
npm package: @mtvproject/catalyst-api-specs
Description: API definition for the Catalyst Server implementation.
Latest version: 1.1.0

# Catalyst Server API Definition

API definition for the Catalyst Server implementation.

Check out the public API docs [here](https://memetaverseproject.github.io/catalyst-api-specs/)

## Working on the Catalyst API Definition

### Install

1. Install [Node JS](https://nodejs.org/).
2. Clone this repo and run `yarn` in the repo root.

### Usage

#### `yarn start`
Starts the reference docs preview server.

#### `yarn build`
Bundles the definition to the dist folder.

#### `yarn test`
Validates the definition.

## Readocly
This repository uses [Redocly](https://redoc.ly/) to generate API reference documentation

The `.redocly.yaml` controls settings for various
tools including the lint tool and the reference
docs engine.  Open it to find examples and
[read the docs](https://redoc.ly/docs/cli/configuration/)
for more information.
npm package: @mtvproject/catalyst-client
Description: A client to query and perform changes on Memetaverse's catalyst servers
Author: Memetaverse
Latest version: 0.0.3-development

# Memetaverse Catalyst Client

Welcome to the Catalyst Client library. This client can be used to interact with Memetaverse's [Catalyst servers](https://github.com/memetaverseproject/catalyst). You can both fetch data, or deploy new entities to the server you specify.

## Installation

```bash
npm install @mtvproject/catalyst-client
```

### Examples

Please check our [examples repository](https://github.com/memetaverseproject/catalyst-client-examples)
npm package: @mtvproject/content-validator
Description: Catalyst content validations
Author: Memetaverse Contributors
Latest version: 1.0.7


# @mtvproject/content-validator

Contains all validations to run against entity deployments.

## Getting Started

Install dependencies and run tests:

```
> yarn
> yarn build
> yarn test
```

### Debugging tests

In case you are using VS Code, you can install recommended extensions and debug them using Jest extension which adds UI support.

## Adding new entities

Before adding any validation to new entities, ensure you have defined a schema on [@mtvproject/schemas](https://github.com/memetaverseproject/common-schemas) and added the relation on [catalyst-commons](https://github.com/memetaverseproject/catalyst-commons/).

To make Catalysts accept deployments of new entity types, they must have defined how access is checked and that means to add them in [access.ts](./src/validations/access-checker/access.ts).

### In steps

1. Create entity schema on [@mtvproject/schemas](https://github.com/memetaverseproject/common-schemas).
2. Add entity type and schema on [catalyst-commons](https://github.com/memetaverseproject/catalyst-commons/).
3. Add entity type and access checker in [access.ts](./src/validations/access-checker/access.ts).
   a. Verify entity pointers can be resolved. If required add a new resolver in [@mtvproject/urn-resolver](https://github.com/memetaverseproject/urn-resolver).
npm package: @mtvproject/crypto
Description: Crypto auth for Memetaverse
Author: Memetaverse
Latest version: 1.0.3

# Memetaverse Auth Crypto Lib

[![NPM version](https://badge.fury.io/js/beland-crypto.svg)](https://npmjs.org/package/beland-crypto@latest)
[![Install Size](https://packagephobia.now.sh/badge?p=beland-crypto@latest)](https://packagephobia.now.sh/result?p=beland-crypto@latest)

## How to Install

```bash
  npm i beland-crypto
```

## Create a new Identity using Ethers

```typescript
import type { AuthChain, AuthIdentity } from 'beland-crypto/dist/types'
import Authenticator from 'beland-crypto/dist/Authenticator'
import { Wallet } from '@ethersproject/wallet'
import { Web3Provider, ExternalProvider } from '@ethersproject/providers'

/**
 *
 * @params provider - any ethereum provider (e.g: window.ethereum)
 * @params expiration - ttl in seconds of the identity
 */
export async function createIdentity(provider: ExternalProvider, expiration: number): Promise<AuthIdentity> {
  const signer = new Web3Provider(provider).getSigner()
  const address = await signer.getAddress()

  const wallet = Wallet.createRandom()
  const payload = {
    address: wallet.address,
    privateKey: wallet.privateKey,
    publicKey: wallet.publicKey,
  }

  const identity = await Authenticator.initializeAuthChain(
    address,
    payload,
    expiration,
    (message) => new Web3Provider(provider).getSigner().signMessage(message)
  )

  return identity
}
```

## Create a new Identity using Web3x

```typescript
import type { AuthChain, AuthIdentity } from 'beland-crypto/dist/types'
import Authenticator from 'beland-crypto/dist/Authenticator'
import { Eth } from 'web3x/eth'
import { Address } from 'web3x/address'
import { Account } from 'web3x/account'
import { Personal } from 'web3x/personal'
import { EthereumProvider } from 'web3x/providers'
import { bufferToHex } from 'web3x/utils/hex-buffer'

/**
 *
 * @params provider - any ethereum provider (e.g: window.ethereum)
 * @params expiration - ttl in seconds of the identity
 */
export async function createIdentity(provider: EthereumProvider, expiration: number): Promise<AuthIdentity> {
  const eth = new Eth(provider)
  const addresses = await eth.getAccounts()

  const provider = connection.provider
  const account = Account.create()
  const payload = {
    address: account.address.toString(),
    publicKey: bufferToHex(account.publicKey),
    privateKey: bufferToHex(account.privateKey),
  }

  const identity = await Authenticator.initializeAuthChain(
    addresses[0],
    payload,
    expiration,
    (message) =>
      new Personal(provider as any).sign(
        message,
        Address.fromString(address),
        ''
      )
  )

  return identity
}
```
npm package: @mtvproject/ecs
Description: Memetaverse ECS
Author: mtv
Latest version: 7.0.4

# ECS 7

## Installing dependencies
Run `make install`, this will run the `npm install` and other dependencies

## Building
Run `make build`

## Testing
Run `make test`, you can also debug the test in VS code, selecting the launch `Jest current file` or just `Jest` (this will run all test)
npm package: @mtvproject/eslint-config
Description: Memetaverse ESLint config
Latest version: 1.1.0

# MTV ESLint & Prettier Config

## Installation
```sh
npm install -D @mtvproject/eslint-config
```

## Usage

In `eslintrc.json`:

```js
{
  "extends": "@mtvproject/eslint-config",
  "parserOptions": {
    "project": ["tsconfig.json", "test/tsconfig.json"]
  }
}
```


## License

Apache 2.0
npm package: @mtvproject/hashing
Description: base component
Latest version: 1.0.1

# @mtvproject/hashing

Hashing functions to calculate Memetaverse Content Identifiers

- `hashV1(arg): Promise<string>`: `ba` prefixed hashes _are_ IPFSv1 hashes. Calculating hashes for files should generate the same result as an IPFS node.
- **DEPRECATED** `hashV0(arg): Promise<string>`: `Qm` prefixed hashes _are not_ IPFSv0 hashes, although it uses the same encoding (Qm...). These

`npm i @mtvproject/hashing`

```ts
import { hashV1 } from '@mtvproject/hashing'

// use with Node.js Buffers or Uint8Array
cid = await hashV1(fs.readFileSync('file'))

// use with fs.ReadStream
cid = await hashV1(fs.createReadStream('file'))

// => bafybeibdik2ihfpcdi7aaaguptwcoc5msav7uhn5hu54xlq2pdwkh5arzy
```