# zcash-redux

> Redux client for Zcash Daemon

Latest version **0.2.5** (published 2018-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install zcash-redux
pnpm add zcash-redux
yarn add zcash-redux
bun add zcash-redux
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2018-08-19 |
| First published | 2018-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | André Neves |
| Maintainers | andrerfneves |
| Keywords | zcash, redux, zcash-redux |

## Links

- npm: https://www.npmjs.com/package/zcash-redux
- npm.io page: https://npm.io/package/zcash-redux

## Dependencies (3)

- [redux](https://npm.io/package/redux.md) ^4.0.0
- [stdrpc](https://npm.io/package/stdrpc.md) ^1.0.0
- [redux-thunk](https://npm.io/package/redux-thunk.md) ^2.3.0

## Recent versions

- 0.2.5 (latest) — 2018-08-19
- 0.2.3 — 2018-08-19
- 0.2.2 — 2018-08-19
- 0.2.1 — 2018-08-19
- 0.2.0 — 2018-08-19
- 0.1.0 — 2018-08-19

## README

# Zcash Redux

Redux clients for Zcash Daemon

## WARNING

> Library currently under development, will undergo further breaking changes. Not ready for production use.

## Installation

```bash
yarn add zcash-redux
```

or

```bash
npm i zcash-redux
```

## Usage

You can import the reducer into your application and add
it as a child reducer with `combineReducers`:

```js
import { zReducer } from 'zcash-redux';

export default combineReducers({
  header: headerReducer,
  routing: routerReducer,
  ...
  zcash: zReducer,
});
```

You can use the stateful client to make RPC calls which affect the store.
Import the client, instantiate it and set the auth
(and optionally the zcash_client_config).

```js
import {
  zClient,
  zActions,
} from 'zcash-redux';

const client = new zClient();

// set zcash_auth and zcash_client_config if not already in the store
client.dispatch({
  type: 'SET_ZCASH_AUTH',
  username: 'myrpcusername',
  password: 'myrpcpassword',
})
// http://localhost:8232 is the default so you may not have to do this
client.dispatch({
  type: 'SET_ZCASH_CLIENT_CONFIG',
  client_config: {
    url: 'http://localhost:8232',
  },
});
```

Now you can interact with zcashd:

```js
client.z_gettotalbalance().then((info) => console.log(info));
```

This stores the return data in an attribute of the same name.
So, any component that wants to use this data can:

```js
connect((state) => ({
  z_gettotalbalance: state.z_gettotalbalance,
}))(MyComponent);
```

---
_Source: https://npm.io/package/zcash-redux · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
