open-index/open-npm huggingface dataset:
npm package: @kodadot1/hyperdata
Description: Get unified NFT content
Latest version: 0.0.2-rc.1

# @kodadot1/hyperdata

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

> Magic static void main


## Usage

Install package:

```sh
# npm
npm install @kodadot1/hyperdata

# yarn
yarn add @kodadot1/hyperdata

# pnpm
pnpm install @kodadot1/hyperdata
```

Import:

```js
// ESM
import * as hyperdata from "@kodadot1/hyperdata";

// CommonJS
const hyperdata = require("@kodadot1/hyperdata");
```

## Available files

### 🌴 exports from other packages

-  protocolize - append `ipfs://` if possible `'@kodadot1/minipfs'`

### 🔧 create

Create metadata for NFTs

- createOpenSeaMetadata - create metadata for OpenSea

### 🔧 normalize

Unifying data structure into one format

- attributeFrom - unify attribute to one format
- contentFrom - unify metadata to one format
- normalize - sanitize content fields to one format

### 🔧 utils

Misc utils for manipulating with data

### 🔧 types

Misc types for metadata namely:

- OpenSea
- FxHash
- Tezos (TZIP-16)
- ERC-5773
- [NFT Metadata CheatSheet](https://www.pob.studio/learn/metadata-cheat-sheet)

## License

Made with 💛

Published under [MIT License](./LICENSE).

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/@kodadot1/hyperdata?style=flat-square
[npm-version-href]: https://npmjs.com/package/@kodadot1/hyperdata
[npm-downloads-src]: https://img.shields.io/npm/dm/@kodadot1/hyperdata?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/@kodadot1/hyperdata
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/@kodadot1/hyperdata/ci.yml?branch=main&style=flat-square
[github-actions-href]: https://github.com/@kodadot1/hyperdata/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/@kodadot1/hyperdata/main?style=flat-square
[codecov-href]: https://codecov.io/gh/@kodadot1/hyperdata
npm package: @kodadot1/metasquid
Description: Utils for the @subsquid indexers
Latest version: 0.3.1-rc.0

# @kodadot1/metasquid

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

> Package description

## Usage

Install package:

```sh
# npm
npm install @kodadot1/metasquid

# yarn
yarn install @kodadot1/metasquid

# pnpm
pnpm install @kodadot1/metasquid
```

Import:

```js
// ESM
import { } from '@kodadot1/metasquid'

// CommonJS
const { } = require('@kodadot1/metasquid')
```

## 💻 Development

- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` (use `npm i -g corepack` for Node.js < 16.10)
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`

## License

Made with 💛

Published under [MIT License](./LICENSE).

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/@kodadot1/metasquid?style=flat-square
[npm-version-href]: https://npmjs.com/package/@kodadot1/metasquid

[npm-downloads-src]: https://img.shields.io/npm/dm/@kodadot1/metasquid?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/@kodadot1/metasquid

[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/@kodadot1/metasquid/ci/main?style=flat-square
[github-actions-href]: https://github.com/unjs/@kodadot1/metasquid/actions?query=workflow%3Aci

[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/@kodadot1/metasquid/main?style=flat-square
[codecov-href]: https://codecov.io/gh/unjs/@kodadot1/metasquid
npm package: @kodadot1/minipfs
Description: A set of tools to work with IPFS URIs.
Latest version: 0.5.1-rc.2

# @kodadot1/minipfs

A set of tools to work with IPFS URIs.

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

![minimark pokemon](.github/minipfs.png)

## 🚀 Quick Start

Install package:

```sh
# npm
npm install @kodadot1/minipfs

# yarn
yarn install @kodadot1/minipfs

# pnpm
pnpm install @kodadot1/minipfs
```

Import:

```js
// ESM
import { $obtain } from '@kodadot1/minipfs'

// CommonJS
const { $obtain } = require('@kodadot1/minipfs')
```

## ⚓️ Exported functions

### ✔️  Arweave

- `toArweavePath` - Convert AR URI to Arweave HTTP URI

### ✔️  CID

- `isCID` - is URI CID?
- `isHTTP` - is URI HTTP?
- `isPath` - is URI IPFS path?
- `toIPFSPath` - Convert IPFS something to IPFS path
- `isDefaultPinataProvider` - check if URI is default HTTPS Pinata gateway
- `canBeIPFS` - check if URI can be IPFS path or IPFS CID
- `extractIPFS` - convert `ipfs://` prefixed URI to IPFS path

### ✔️  Gateways

- `IPFSProviders` - named list of IPFS gateways
- `AvailableProviders` - IPFSProviders Array
- `ipfsProviders:` - Record of IPFSProviders and their URLs
- `getProviderList` - convert IPFSProviders Array to URL Array

### ✔️  Magic

- `$obtain<T>` - put any URI and get back your T (Put your Metadata type here)
- `$purify` - put any URI and get sanitized HTTP URI

### ✔️  Obtain

- `obtain:` - Wrapper around `$fetch` from `ofetch`
- `obtainSafe` - Same as `obtain` but returns empty object if error
- `obtainFast` - Same as `obtain` but throws Error after 8 seconds
- `obtainMedia` - use for fetching media files
- `obtainMimeType` - use for fetching mime type of file

### ✔️  Race

- `competition` - put IPFS path, provider list and get back fastest response

### ✔️  Sanitize

- `sanitize` - convert any URI into usable URI to fetch

### ...Rest

`types` and `constants` were exported as well, but omitted here.

## 💻 Development

- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` (use `npm i -g corepack` for Node.js < 16.10)
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`

## License

Made with 💖

Published under [MIT License](./LICENSE).

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/@kodadot1/minipfs?style=flat-square
[npm-version-href]: https://npmjs.com/package/@kodadot1/minipfs

[npm-downloads-src]: https://img.shields.io/npm/dm/@kodadot1/minipfs?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/@kodadot1/minipfs

[github-actions-src]: https://img.shields.io/github/workflow/status/@kodadot1/minipfs/ci/main?style=flat-square
[github-actions-href]: https://github.com/@kodadot1/minipfs/actions?query=workflow%3Aci

[codecov-src]: https://img.shields.io/codecov/c/gh/@kodadot1/minipfs/main?style=flat-square
[codecov-href]: https://codecov.io/gh/@kodadot1/minipfs
npm package: @kodadot1/static
Description: Static constants in the KodaDot development
Latest version: 0.0.8-rc.0

# @kodadot1/static

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

> Magic static void main

## Usage

Install package:

```sh
# npm
npm install @kodadot1/static

# yarn
yarn add @kodadot1/static

# pnpm
pnpm install @kodadot1/static
```

Import:

```js
// ESM
import * as static from "@kodadot1/static";

// CommonJS
const static = require("@kodadot1/static");
```

## Available config files

### 🔧 chains

Static chain files such as decimals, symbol, ss58

```js
import { CHAINS } from "@kodadot1/static";
```

### 🔧 endpoints

Map of RPC endpoints for each chain

```js
import { ENDPOINT_MAP } from "@kodadot1/static";
```

### 🔧 indexers

Map of subsquid indexer endpoints for each chain

```js
import { INDEXERS, APOLLO_ENDPOINTS, toApolloEndpoint } from "@kodadot1/static";
```

### 🔧 names

Map of chain names for each chain. Suitable for frontend

```js
import { NAMES } from "@kodadot1/static";
```

### 🔧 services

Map of clodflare workers we use

```js
import { SERVICES } from "@kodadot1/static";
```

### 🔧 types

Misc types for each config

## License

Made with 💛

Published under [MIT License](./LICENSE).

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/@kodadot1/static?style=flat-square
[npm-version-href]: https://npmjs.com/package/@kodadot1/static
[npm-downloads-src]: https://img.shields.io/npm/dm/@kodadot1/static?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/@kodadot1/static
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/@kodadot1/static/ci.yml?branch=main&style=flat-square
[github-actions-href]: https://github.com/@kodadot1/static/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/@kodadot1/static/main?style=flat-square
[codecov-href]: https://codecov.io/gh/@kodadot1/static
npm package: @kodadot1/sub-api
Description: Smart wrapper for Substrate API
Author: Viki Val
Latest version: 0.4.0-rc.2

<h1 align="center">sub-api</h1>

<h5 align="center">Substrate API with batteries included</h5>

## Installation

`yarn add @kodadot1/sub-api`

## Docs

### Why this?

In KodaDot, we need to manage the connection to the network of multiple parachain. This is a complicated task, and we need a simple way to do it. The old implementation was easy to use but not easy to manage.

That's why we decided to create a new implementation that is more robust and suitable for the other Dotsama builders.

### What's in the box?

**Factory**

The Factory handles a single connection per each parachain.
To directly connect to a parachain, just call.

```ts
import { ApiFactory } from '@kodadot1/sub-api'
const endpoint = 'wss://kusama-rpc.polkadot.io'
const api = await ApiFactory.useApiInstance(endpoint)
```

**InstaApi**

Feeling a bit adventurous? You can use the `InstaApi` and feel free to manage the connection directly.
Suitable also for an app with a single connection.

```ts
import { InstantApi as Api } from '@kodadot1/sub-api'
const endpoint = 'wss://kusama-rpc.polkadot.io'
const API = await (new API(endpoint)).getInstance()
```

**Helpers**

There is a set of helpers to make your life easier.

```ts
import { balanceOf, currentBlock } from '@kodadot1/sub-api'

const API = await ApiFactory.useApiInstance(endpoint)
const balance = await balanceOf(API, acc)
const block = await currentBlock(API)
console.log(balance, block)
```

**Hooks**

On API Connect hook is available.

```ts
import { onApiConnect } from '@kodadot1/sub-api'
```

**Types**

There is just a set of more readable types.

```ts
export type Extrinsic = SubmittableExtrinsic<'promise'>
```

## Usage Examples

Import Factory object like

```ts
import { ApiFactory } from '@kodadot1/sub-api'
```

Get an API instance for the selected URL and fetch the data in the component.

```ts
async function getChainProperties() {
  const endpoint = 'wss://kusama-rpc.polkadot.io'
  const API = await ApiFactory.useApiInstance(endpoint)
  const { chainSS58, chainDecimals, chainToken } = API.registry
  console.log('[API] Connect <3', { chainSS58, chainDecimals, chainToken })
}
```

Alternatively, you can listen to the `connect` event and get the data only when it is ready.

```ts
import { onApiConnect } from '@kodadot1/sub-api'
```

```ts
const endpoint = 'wss://kusama-rpc.polkadot.io'
onApiConnect(endpoint, async (API) => {
  const block = await API.query.system.number()
  console.log('[API] Connected to', endpoint, 'block', block)
})
```
npm package: @kodadot1/vuex-options
Description: Polkadot Settings for KodaDot
Author: Viki Val
Latest version: 0.1.5
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<h1 align="center">vue-settings</h1>

<h5 align="center">Vuex module for KodaDot app </h5>

## Installation

`yarn add @kodadot1/vue-settings`

## State Props

| Name           | Description                   |
| -------------- | ----------------------------- |
| apiUrl         | Selected Url                  |
| i18nLang       | Selected language             |
| locking        | Selected Locking              |
| prefix         | Prefix                        |
| uiMode         | UI Mode                       |
| uiTheme        | UI Theme                      |
| avaibleOptions | Object of all avaible options |

## Mutations

| Name        | Description  | Params   | Types                   |
| ----------- | ------------ | -------- | ----------------------- |
| setSettings | Set settings | settings | SettingsStruct |

## Getters

| Name               | Description                   | Returns        |
| ------------------ | ----------------------------- | -------------- |
| availableNodes     | List of Nodes                 | Option[]       |
| availableLanguages | List of Languages             | Option[]       |
| availableCryptos   | List of Cryptographic modes   | Option[]       |
| availableLocking   | List of Locking               | Option[]       |
| availablePrefixes  | List of Prefixes              | Option[]       |
| availableUiModes   | List of UI Modes              | Option[]       |
| availableUiThemes  | List of UI Themes             | Option[]       |
| getSettings        | Object of all avaible options | SettingsStruct |

## Usage Examples

import `SettingModule` to your store as module

```js
import Vue from 'vue'
import Vuex from 'vuex'
import SettingModule from '@vue-polkadot/vue-settings'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    setting: SettingModule,
  },
})
```

now you can use getters and actions inside your component (Using Vue with typescript)

```html
<template>
  <div>
    <div v-for="option in options">
      <span>{{option.value}}</span>
      <span>{{option.text}}</span>
    </div>
  </div>
</template>

<script lang="ts">
  import { Component, Vue } from 'vue-property-decorator'

  @Component
  export default class App extends Vue {
    // Getter is like computed
    get options(): Option[] {
      return this.$store.getters.availableNodes
    }
  }
</script>
```
npm package: @kodai3/tailwind-config
Description: tailwind configuration for kodai3
Author: kodai3
Latest version: 0.0.1

# Usage

```
npm install @kodai3/tailwind-config
```

If you want to extend the existing config:

```js
// tailwind.config.js

module.exports = {
  presets: [require("@kodai3/tailwind-config")],
  theme: {
    extend: {
      padding: {
        4: "4px",
      },
    },
  },
};
```

If you want to use the config as is:

```js
// tailwind.config.js

module.exports = {
  presets: [require("@kodai3/tailwind-config")],
};
```
npm package: @kodai3/use-boolean
Description: React state hook that tracks value of a boolean.
Author: kodai3
Latest version: 0.0.3

# `useBoolean`

React state hook that tracks value of a boolean.

## Usage

```jsx
import { useBoolean } from "@kodai3/use-boolean";

const Demo = () => {
  const [on, toggle] = useBoolean(true);

  return (
    <div>
      <div>{on ? "ON" : "OFF"}</div>
      <button onClick={toggle}>Toggle</button>
      <button onClick={() => toggle(true)}>set ON</button>
      <button onClick={() => toggle(false)}>set OFF</button>
    </div>
  );
};
```
npm package: @kodai3/use-copy-to-clipboard
Description: Copy text to a user's clipboard.
Author: kodai3
Latest version: 0.0.3

# `useCopyToClipboard`

Copy text to a user's clipboard.

## Usage

```jsx
const Demo = () => {
  const [text, setText] = React.useState("");
  const [state, copyToClipboard] = useCopyToClipboard();

  return (
    <div>
      <input value={text} onChange={(e) => setText(e.target.value)} />
      <button type="button" onClick={() => copyToClipboard(text)}>
        copy text
      </button>
      {state.error ? (
        <p>Unable to copy value: {state.error.message}</p>
      ) : (
        state.value && <p>Copied {state.value}</p>
      )}
    </div>
  );
};
```

## Reference

```js
const [
  { value, error, noUserInteraction },
  copyToClipboard,
] = useCopyToClipboard();
```

- `value` &mdash; value that was copied to clipboard, undefined when nothing was copied.
- `error` &mdash; caught error when trying to copy to clipboard.
- `noUserInteraction` &mdash; boolean indicating if user interaction was required to copy the value to clipboard to expose full API from underlying [`copy-to-clipboard`](https://github.com/sudodoki/copy-to-clipboard) library.
npm package: @kodai3/use-effect-once
Description: React lifecycle hook that runs an effect only once.
Author: kodai3
Latest version: 0.0.3

# `useEffectOnce`

React lifecycle hook that runs an effect only once.

## Usage

```jsx
import { useEffectOnce } from "@kodai3/use-effect-once";

const Demo = () => {
  useEffectOnce(() => {
    console.log("Running effect once on mount");

    return () => {
      console.log("Running clean-up of effect on unmount");
    };
  });

  return null;
};
```

## Reference

```js
useEffectOnce((effect: EffectCallback));
```
npm package: @kodai3/use-intersection
Description: React sensor hook that tracks the changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. Uses the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer
Author: kodai3
Latest version: 0.0.3

# `useIntersection`

React sensor hook that tracks the changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. Uses the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) and returns a [IntersectionObserverEntry](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).

## Usage

```jsx
import * as React from "react";
import { useIntersection } from "@kodai3/use-intersection";

const Demo = () => {
  const intersectionRef = React.useRef(null);
  const intersection = useIntersection(intersectionRef, {
    root: null,
    rootMargin: "0px",
    threshold: 1,
  });

  return (
    <div ref={intersectionRef}>
      {intersection && intersection.intersectionRatio < 1
        ? "Obscured"
        : "Fully in view"}
    </div>
  );
};
```

## Reference

```ts
useIntersection(
  ref: RefObject<HTMLElement>,
  options: IntersectionObserverInit,
): IntersectionObserverEntry | null;
```
npm package: @kodai3/use-mounted-state
Description: > **NOTE!:** despite having `State` in its name **_this hook does not cause component re-render_**.   > This component designed to be used to avoid state updates on unmounted components.
Author: kodai3
Latest version: 0.0.3

# `useMountedState`

> **NOTE!:** despite having `State` in its name **_this hook does not cause component re-render_**.  
> This component designed to be used to avoid state updates on unmounted components.

Lifecycle hook providing ability to check component's mount state.  
Returns a function that will return `true` if component mounted and `false` otherwise.

## Usage

```jsx
import * as React from "react";
import { useMountedState } from "@kodai3/use-mounted-state";

const Demo = () => {
  const isMounted = useMountedState();

  React.useEffect(() => {
    setTimeout(() => {
      if (isMounted()) {
        // ...
      } else {
        // ...
      }
    }, 1000);
  });
};
```
npm package: @kodai3/use-previous
Description: React state hook that returns the previous state as described in the [React hooks FAQ](https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state).
Author: kodai3
Latest version: 0.0.3

# `usePrevious`

React state hook that returns the previous state as described in the [React hooks FAQ](https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state).

## Usage

```jsx
import { usePrevious } from "@kodai3/use-previous";

const Demo = () => {
  const [count, setCount] = React.useState(0);
  const prevCount = usePrevious(count);

  return (
    <p>
      <button onClick={() => setCount(count + 1)}>+</button>
      <button onClick={() => setCount(count - 1)}>-</button>
      <p>
        Now: {count}, before: {prevCount}
      </p>
    </p>
  );
};
```

## Reference

```ts
const prevState = usePrevious = <T>(state: T): T;
```
npm package: @kodai3/use-promise
Description: React Lifecycle hook that returns a helper function for wrapping promises. Promises wrapped with this function will resolve only when component is mounted.
Author: kodai3
Latest version: 0.0.3

# `usePromise`

React Lifecycle hook that returns a helper function for wrapping promises.
Promises wrapped with this function will resolve only when component is mounted.

## Usage

```jsx
import { usePromise } from "@kodai3/use-promise";

const Demo = ({ promise }) => {
  const mounted = usePromise();
  const [value, setValue] = useState();

  useEffect(() => {
    (async () => {
      const value = await mounted(promise);
      // This line will not execute if <Demo> component gets unmounted.
      setValue(value);
    })();
  });
};
```
npm package: @kodai3/use-set-state
Description: React state hook that creates `setState` method which works similar to how `this.setState` works in class components&mdash;it merges object changes into current state.
Author: kodai3
Latest version: 0.0.3

# `useSetState`

React state hook that creates `setState` method which works similar to how
`this.setState` works in class components&mdash;it merges object changes into
current state.

## Usage

```jsx
import { useSetState } from "@kodai3/use-set-state";

const Demo = () => {
  const [state, setState] = useSetState({});

  return (
    <div>
      <pre>{JSON.stringify(state, null, 2)}</pre>
      <button onClick={() => setState({ hello: "world" })}>hello</button>
      <button onClick={() => setState({ foo: "bar" })}>foo</button>
      <button
        onClick={() => {
          setState((prevState) => ({
            count: (prevState.count || 0) + 1,
          }));
        }}
      >
        count
      </button>
    </div>
  );
};
```

## Reference

```js
const [state, setState] = useSetState({ cnt: 0 });

setState({ cnt: state.cnt + 1 });
setState((prevState) => ({
  cnt: prevState + 1,
}));
```