open-index/open-npm huggingface dataset:
npm package: @jmoxey/pricehub.js
Description: Pricehub.js is a JavaScript Client SDK to provide an interface to subscribe to real-time changes from Pricehub.
Author: Jake Moxey
Latest version: 1.0.5

# Pricehub.js

Pricehub.js is a JavaScript Client SDK to provide an interface to subscribe to real-time changes from Pricehub.

## Install

```
npm i pricehub.js
```

## Usage

To subscribe to a currency pair channel, all you have to do is call `pricehub.subscribe` with a channel ID and a set of callbacks.

In the below example, we are subscribing to the BTC/AUD currency pair.

```js
import pricehub from 'pricehub.js';
// const pricehub = require('pricehub.js');

const { dispose } = pricehub.subscribe('rate:BTC-AUD', {
  onJoined: () => console.log('i have joined!'),
  onData: payload => console.log(`Reference: ${payload.r}, Ask: ${payload.a}, Bid: ${payload.b}`),
  onError: err => console.log(`Oh noes! ${err.message}`)
});

// Whenever you are finished with the subscription, invoke `dispose`:
dispose();
```

- When we join the channel, `onJoined` will be invoked.
- When we receive data from the channel, `onData` will be invoked.
- If we receive an error from the channel, `onError` will be invoked.
- If an `interval` is specified ([see API below](#api)), this means that `onData` will only be invoked every `x` milliseconds.

> Note: You don't have to worry about managing subscriptions to a channel as Pricehub.js caches the channel under-the-hood, and reuses that channel if the consumer attempts to subscribe to the same channel. This means if you have 5 subscriptions to `rate:BTC-AUD`, there will only ever be one active channel (whenever data is recieved from the socket, Pricehub.js will broadcast the changes to your subscribers).

## API

```js
const { dispose } = pricehub.subscribe(
  channelId: string, 
  {
    onJoined: () => void,      // Callback to invoke when channel has been joined.
    onData: (payload) => void, // Callback to invoke when data has been received.
    onError: (err) => void,    // Callback to invoke when an error has occurred.
    interval: number,          // (Optional) Interval in ms. Defaults to 0 — no interval
  }
)
```
npm package: @jmoxey/rainbowkit
Description: The best way to connect a wallet
Author: Rainbow
Latest version: 0.0.0-wagmi-v1.1

<a href="https://rainbowkit.com">
  <img alt="rainbowkit" src="https://user-images.githubusercontent.com/372831/168174718-685980e0-391e-4621-94a1-29bf83979fa5.png" />
</a>

# RainbowKit

**The best way to connect a wallet 🌈**

RainbowKit is a [React](https://reactjs.org/) library that makes it easy to add wallet connection to your dapp.

- 🔥 Out-of-the-box wallet management
- ✅ Easily customizable
- 🦄 Built on top of [wagmi](https://github.com/tmm/wagmi) and [ethers](https://docs.ethers.io)

## Quick start

You can scaffold a new RainbowKit + [wagmi](https://wagmi.sh) + [Next.js](https://nextjs.org) app with one of the following commands, using your package manager of choice:

```bash
npm init @rainbow-me/rainbowkit@latest
# or
yarn create @rainbow-me/rainbowkit@latest
# or
pnpm create @rainbow-me/rainbowkit@latest
```

## Documentation

For full documentation, visit [rainbowkit.com](https://rainbowkit.com).

### Try it out

You can use the CodeSandbox links below try out RainbowKit:

- with [Create React App](https://codesandbox.io/s/rainbowkit-create-react-app-1vwx1r)
- with [Create React App (TypeScript)](https://codesandbox.io/s/rainbowkit-create-typescript-app-xuxnqy)
- with [Next.js](https://codesandbox.io/s/rainbowkit-nextjs-gz890p)

## Examples

The following examples are provided in the [examples](./examples/) folder of this repo.

- `with-create-react-app`
- `with-next`
- `with-next-custom-button`
- `with-next-mint-nft`
- `with-next-siwe-next-auth`
- `with-next-siwe-iron-session`
- `with-remix`

### Running examples

To run an example locally, install dependencies.

```bash
pnpm install
```

Then go into an example directory, eg: `with-next`.

```bash
cd examples/with-next
```

Then run the dev script.

```bash
pnpm run dev
```

## Contributing

Please follow our [contributing guidelines](./.github/CONTRIBUTING.md).

## License

Licensed under the MIT License, Copyright © 2022-present [Rainbow](https://rainbow.me).

See [LICENSE](./LICENSE) for more information.