open-index/open-npm huggingface dataset:
npm package: @newfound8ion/newcoin-sdk
Description: SDK for Newcoin blockchain
Author: vitalyrue
Latest version: 1.4.1


# newcoin-sdk

![Newcoin](https://github.com/newfound8ion/newcoin-sdk/blob/main/docs/media/newcoin-globe.png?raw=true)
This is the newcoin sdk, a starting point for a tooling environment that will make it easy to build applications on top of [https://newcoin.org](newcoin.org).

``` typescript
npm install --save @newfound8ion/newcoin-sdk
```

See [https://docs.newcoin.org/](https://docs.newcoin.org/) for an overview of the newcoin ecosystem.

## Installation

Clone the repo. An npm package will be provided soon

See the tests for more examples.

## API Documentation

See [here](./docs/modules.md)

## Usage

``` typescript

function async createUser() {
            const nco_struct : NCCreateUser = {
                newUser: name, 
                newacc_public_active_key: "<active-key>",
                newacc_public_owner_key:  "<owner-key>",
                payer: "io", 
                payer_prv_key: "<prv_key>",
                ram_amt : 8196, 
                cpu_amount : "100.0000 NCO", 
                net_amount : "100.0000 NCO", 
                xfer : true, // stake or transfer CPU/NET to the account
            };
            const resp :NCReturnTxs = await NCO_BlockchainAPI.createUser(nco_struct) ;
}
```

See the tests for more examples.

## Contributing

Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)
npm package: @newfound8ion/newcoin.buffer-js
Description: JS Library to read data from newcoin.buffer smart contract.
Author: Artem Maliuga
Latest version: 1.0.2

# newcoin.buffer-js

JS Library to read data from newcoin.buffer smart contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
npm install @newfound8ion/newcoin.buffer-js
```

### Initialize

Web library can be found in the [dist] folder

```javascript
// standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.buffer-js");
// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.buffer-js";
```

## Documentation

### ChainApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be pushed on chain with eosjs.
npm package: @newfound8ion/newcoin.dao-js
Description: JS Library to read data from newcoin.dao smart contract.
Author: Avm07
Latest version: 1.0.5

# newcoin.dao-js

JS Library to read data from newcoin.dao smart contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
npm install @newfound8ion/newcoin.dao-js
```

### Initialize

Web library can be found in the [dist] folder

```javascript
// standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.dao-js");
// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.dao-js";
```

## Documentation

### ChainApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be pushed on chain with eosjs.
npm package: @newfound8ion/newcoin.daos-js
Description: JS Library to read data from newcoin.daos smart contract.
Author: Avm07
Latest version: 2.0.10

# newcoin.daos-js

JS Library to read data from newcoin.daos smart contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
npm install @newfound8ion/newcoin.daos-js
```

### Initialize

Web library can be found in the [dist] folder

```typescript
// standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.daos-js");
// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.daos-js";
```

## Documentation

### ChainApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be pushed on chain with eosjs.
npm package: @newfound8ion/newcoin.graph-js
Description: JS Library to read data from newcoin.graph smart contract.
Author: Artem Maliuga
Latest version: 1.0.5

# newcoin.graph-js

JS Library to read data from newcoin.graph smart contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
npm install @newfound8ion/newcoin.graph-js
```

### Initialize

Web library can be found in the [dist] folder

```javascript
// standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.graph-js");
// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.graph-js";
```

## Documentation

### ChainApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be pushed on chain with eosjs.
npm package: @newfound8ion/newcoin.pool-js
Description: js module to fetch data from the newcoin.pool smart contract
Author: Artem Maliuga
Latest version: 1.0.9

# newcoin.pool-js

JS Library to interact with newcoin.pool contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
$ npm install @newfound8ion/newcoin.pool-js
```

### Initialize

Web library can be found in the [dist] folder

```javascript
// standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.pool-js");

// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.pool-js"
```

## Documentation

### RpcApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be pushed on chain with eosjs.
npm package: @newfound8ion/newcoin.pools-js
Description: js module to fetch data from the newcoin.pools smart contract
Author: Artem Maliuga
Latest version: 2.0.6

# newcoin.pools-js

JS Library to interact with newcoin.pools smart contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
npm i @newfound8ion/newcoin.pools-js
```

### Initialize

Web library can be found in the [dist] folder.

```javascript
// Standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.pools-js");

// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.pools-js"
```

## Documentation

### ChainApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be signed and pushed to chain with eosjs. 

Detailed information about each action can be found [here](docs/actions.md).
npm package: @newfound8ion/newcoin.token-js
Description: JS Library to read data from newcoin.token smart contract.
Author: Artem Maliuga
Latest version: 1.0.4

# newcoin.token-js

JS Library to read data from newcoin.token smart contract.

## Usage

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
npm install @newfound8ion/newcoin.token-js
```

### Initialize

Web library can be found in the [dist] folder

```javascript
// standard import
const { ActionGenerator, ChainApi } = require("@newfound8ion/newcoin.token-js");
// ES6 import
import { ActionGenerator, ChainApi } from "@newfound8ion/newcoin.token-js";
```

## Documentation

### ChainApi

Uses only native nodeos calls to chain api plugin.

### ActionGenerator

Helper class to construct contract actions which can be pushed on chain with eosjs.
npm package: @newfrgmnt/harmony
Description: ![Harmony](./assets/harmony.png)
Latest version: 1.0.3

![Harmony](./assets/harmony.png)

# Harmony

A new kind of Color Picker, which computes harmonic colors along with the primary one. It supports Analogous, Triad, Tetradic, Complementary & Square harmonies.

[Read more about the implementation here.](https://polar.sh/emilwidlund/posts/a-new-kind-of-color-picker-with-react-typescript)

### Installation

Harmony is available on the npm registry. It requires React as a peer dependency.

`pnpm install @newfrgmnt/harmony`

### API

```typescript
import {ColorWheel} from '@newfrgmnt/harmony';

export const MyColorPicker = () => {
    return (
        <ColorWheel harmony="analogous" radius={200} />
    );
}
```

#### Supported properties

```typescript
radius: number;
harmony: 'tetradic' | 'triad' | 'analogous' | 'square' | 'complementary';
color?: {hue: number, saturation: number, value: number};
defaultColor?: {hue: number, saturation: number, value: number};
onChange?: (colors: { hue: number; saturation: number; value: number }[]) => void;
```

#### Convert the HSV format to RGB

You can use the following function to convert the HSV output to RGB.

```typescript
function HSVtoRGB(h: number, s: number, v: number) {
  var r, g, b, i, f, p, q, t;
  h = h / 360;
  i = Math.floor(h * 6);
  f = h * 6 - i;
  p = v * (1 - s);
  q = v * (1 - f * s);
  t = v * (1 - (1 - f) * s);
  switch (i % 6) {
    case 0:
      (r = v), (g = t), (b = p);
      break;
    case 1:
      (r = q), (g = v), (b = p);
      break;
    case 2:
      (r = p), (g = v), (b = t);
      break;
    case 3:
      (r = p), (g = q), (b = v);
      break;
    case 4:
      (r = t), (g = p), (b = v);
      break;
    case 5:
      (r = v), (g = p), (b = q);
      break;
  }
  return {
    r,
    g,
    b,
  };
}
```
npm package: @newfrontdoor/api-create-presigned-post
Description: API for creating presigned urls when uploading objects to S3
Latest version: 0.2.1

# `@newfrontdoor/api-create-presigned-post`

API for creating presigned urls when uploading objects to S3

## `presignedPost(options)`

Creates a middleware function for creating a Presigned Post.

> ⚠️Warning ⚠️
> This is not a great idea, unless you protect your API in someway

See [`accessToken(token)`](#accessTokentoken)

### Usage

```js
import {presignedPost} from '@newfrontdoor/api-create-presigned-post';

const createPresignedPost = presignedPost({
  bucket: 'your-bucket',
  s3Options: {
    region: 'your-region',
    accessKeyId: 'your-access-key-id',
    secretAccessKey: 'your-secret-access-key'
  }
});

// or bring your own S3 client
const createPresignedPost = presignedPost({
  bucket: 'your-bucket',
  s3Client: new S3(config)
});

export default async function(request, response) {
  const presignedPost = await createPresignedPost(request, response);
  response.status(200).json(presignedPost)
}
```

## `accessToken(token)`

Compares the request `authorization` header with an environment variable.

`token` is the key for the Access Token environment variable, for example

```js
accessToken('YOUR_ACCESS_TOKEN')
```
Will compare the `authorization` header against the value in

```js
process.env.YOUR_ACCESS_TOKEN
```

### Usage

```js
import {accessToken} from '@newfrontdoor/api-create-presigned-post';

const requireAccesToken = accessToken('YOUR_ACCESS_TOKEN');

export default async function(request, response) {
  await requireAccesToken(request, response)
}
```
npm package: @newfrontdoor/audio-player
Description: An audio element wrapper written in React with hooks
Author: Alan Reader
Latest version: 0.3.2

# audio player

A themeable audio player

## Usage

### A single audio player

```jsx
import {AudioPlayer} from '@newfrontdoor/audio-player';

<AudioPlayer isPlayOnLoad src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" />
```

### An audio player with multiple tracks

```
import {AudioManager} from '@newfrontdoor/audio-player';

const track1 = "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3";
const track2 = "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3"

<AudioManager isPlayOnLoad initialSrc={track1}>
  <AudioManager.AudioPlayer/>
  <AudioManager.PlayButton src={track1}>
    Track 1
  </AudioManager.PlayButton>
  <AudioManager.PlayButton src={track2}>
    Track 2
  </AudioManager.PlayButton>
</AudioManager>
```
npm package: @newfrontdoor/blog
Latest version: 0.5.0

A blog component

Contains:
- Basic flexbox layout with sticky title/meta content
- categories render as links which then filter content
- blogs provided as array of blog objects to the blog.js
  file, which then render in the post.js file individually
- Date object format can be passed in on props.dateFormat or
 can just use the default props 'dddd, MMMM do YYYY'
 - Mobile view
 - example link file for passing in from containing component,
 currently using react router, but can be amended for use case

 Example use with react-router-dom and Sanity block renderer:

```js
import React, {Component} from 'react';
import {BrowserRouter, Route, Switch} from 'react-router-dom';
import SanityBlock from './components/SanityBlock';
import Link from './components/link';
const queryString = require('query-string');

class App extends Component {
    render() {
    return (
      <BrowserRouter>
        <div className={body}>
            <Switch>
                <Route
                    exact
                    path={process.env.PUBLIC_URL + '/blog'}
                    render={({location}) => (
                    <Blog
                        category={queryString.parse(location.search).category}
                        posts={this.props.posts}
                        renderContent={body => {
                        return <SanityBlock blocks={body} />;
                        }}
                        linkComponent={Link}
                    />
                    )}
                />
            </Switch>
        </div>
      </BrowserRouter>
    );
  }
}

export default App;
```
npm package: @newfrontdoor/collapse
Description: ## `<Collapse />`
Latest version: 0.2.3

# `@newfrontdoor/collapse`

## `<Collapse />`

### Usage

```js
import {useRef} from 'react';
import {Collapse} from '@newfrontdoor/collapse';

const contentRef = useRef(null);

return (
  <Collapse.Manager contentRef={contentRef}>
    <Collapse.Toggle>
      <button type="button">Toggle Me</button>
    </Collapse.Toggle>
    <Collapse.Panel>
      Collapse Content
    </Collapse.Panel>
  </Collapse.Manager>
)
```

## `useCollapse()`

### Usage

```js
import {useRef} from 'react';
import {useCollapse} from '@newfrontdoor/collapse';

const contentRef = useRef(null);
const {getToggleProps, getCollapseProps} = useCollapse({
  contentRef
});

return (
  <div>
    <button {...getToggleProps()} type="button">
      Toggle Me
    </button>
    <div {...getCollapseProps()}>
      <div ref={contentRef}>
        Collapse Content
      </div>
    </div>
  </div>
);
```
npm package: @newfrontdoor/create
Description: For initializing a New Front Door client site
Latest version: 1.1.0

# This is the create-newfrontdoor project

## Prerequisites
This is a tooling shortcut for generating all needed components of a new site project. So the expectation is that you'll have installed the various CLI tools to make it work. These include:
- Node (https://nodejs.org/en/download/)
- Github CLI (https://github.com/cli/cli#installation)
- Sanity CLI (npm install -g @sanity/cli)


## instructions
- run `npm init @newfrontdoor`
npm package: @newfrontdoor/itunes-feed
Description: Create an rss feed for itunes
Author: Jonathan Haines
Latest version: 1.0.0

# Readme

## Usage

```javascript
const {default: Feed} = require('@newfrontdoor/itunes-feed');
```

Creating a new feed

```javascript
const feed = new Feed({
  description:
    'Love to get outdoors and discover nature’s treasures? Hiking Treks is the show for you. We review hikes and excursions, review outdoor gear and interview a variety of naturalists and adventurers. Look for new episodes each week.',
  itunesCategory: 'Sports',
  itunesSubCategory: 'Wilderness',
  itunesExplicit: false,
  itunesImage:
    'https://applehosted.podcasts.apple.com/hiking_treks/artwork.png',
  language: 'en-us',
  link: 'https://www.apple.com/itunes/podcasts/',
  title: 'Hiking Treks'
});
```

Adding an item

```javascript
feed.addItem({
  title: 'Hiking Treks Trailer',
  description:
    'The Sunset Explorers share tips, techniques and recommendations for great hikes and adventures around the United States. Listen on Apple Podcasts.',
  enclosure: {
    length: 498537,
    type: 'audio/mpeg',
    url: 'http://example.com/podcasts/everything/AllAboutEverythingEpisode4.mp3'
  }
});

(async function () {
```

Validating the `feed`

```javascript
  await feed.validate();
```

Rendering the `feed`

```javascript
  const xml = await feed.render();
```

Yields

    <?xml version="1.0"?>
    <rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/">
      <channel>
        <title>Hiking Treks</title>
        <link>https://www.apple.com/itunes/podcasts/</link>
        <language>en-us</language>
        <description>Love to get outdoors and discover nature’s treasures? Hiking Treks is the show for you. We review hikes and excursions, review outdoor gear and interview a variety of naturalists and adventurers. Look for new episodes each week.</description>
        <itunes:image href="https://applehosted.podcasts.apple.com/hiking_treks/artwork.png"/>
        <itunes:category text="Sports">
          <itunes:category text="Wilderness"/>
        </itunes:category>
        <item>
          <title>Hiking Treks Trailer</title>
          <enclosure length="498537" type="audio/mpeg" url="http://example.com/podcasts/everything/AllAboutEverythingEpisode4.mp3"/>
          <description>The Sunset Explorers share tips, techniques and recommendations for great hikes and adventures around the United States. Listen on Apple Podcasts.</description>
        </item>
      </channel>
    </rss>

```javascript
})();
```
npm package: @newfrontdoor/s3-file-upload
Description: ## `<S3Dropzone />`
Latest version: 1.0.0

# `@newfrontdoor/s3-file-upload`

## `<S3Dropzone />`

Adds S3 upload functionality to [`react-dropzone`](https://github.com/react-dropzone/react-dropzone)

### Props

#### `host`

URL the file will be hosted from, typically an S3 bucket, or Cloudfront url

#### `uploadUrl`

URL to [fetch a Presigned Post](https://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html) from

#### `children`

A single React element. Will be cloned using [`React.cloneElement`](https://reactjs.org/docs/react-api.html#cloneelement),
and be rendered with a `src` prop with the url of the uploaded file (`${host}/${fileName}`).

#### `title`

The title of the uploaded file

#### `initialFileName`

The name of the already uploaded file (`${host}/${initialFileName}`)

#### `onChange`

Called when a file is uploaded. Called with the result of the S3 file upload

```
type UploadFileResult = { key: string }
```

### Usage

```js
import {S3Dropzone} from '@newfrontdoor/s3-file-upload';
import {AudioPlayer} from '@newfrontdoor/audio-player';

<S3Dropzone host={host} uploadUrl={uploadUrl} onChange={onChange}>
  <AudioPlayer />
</S3Dropzone>
```

## `useS3FileUpload()`

### Props

#### `host`

URL the file will be hosted from, typically an S3 bucket, or Cloudfront url

#### `initialFileName`

The name of the already uploaded file (`${host}/${initialFileName}`)

### Returns

#### `fileUrl`

The URL of the uploaded file `${host}/${fileName}`

#### `fileName`

The name of the uploaded file

#### `startFileUpload(file)`

Start uploading the file

#### `checkS3Status`

Status result of the `checkS3` query

#### `fileUploadStatus`

Status result of the `fileUpload` mutation

#### `isSuccess`

Success status of the `checkS3` query

```js
checkS3Status.isSuccess
```

#### `isLoading`

Loading status of the `checkS3` query, or the `fileUpload` mutation

```js
checkS3Status.isLoading || fileUploadStatus.isLoading,
```

#### `isError`

Error status of the `checkS3` query, or the `fileUpload` mutation

```js
checkS3Status.isError || fileUploadStatus.isError,
```

#### `isIdle`

Idle status of the `checkS3` query, and the `fileUpload` mutation

```js
checkS3Status.isIdle && fileUploadStatus.isIdle
```

### Usage

```js
import {useS3FileUpload} from '@newfrontdoor/s3-file-upload';
import {useDropzone} from 'react-dropzone';

function FileUpload({
  host,
  uploadUrl,
}) {
  const {
    startFileUpload
  } = useS3FileUpload({
    host,
    uploadUrl
  });

  const {getRootProps, getInputProps} = useDropzone(
    {
      onDrop(acceptedFiles) {
        startFileUpload(acceptedFiles[0]);
      }
    }
  );
  
  return (
    <div {...getRootProps()}>
      <input {...getInputProps()} />
    </div>
  )
}
```