Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zcash-redux

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zcash-redux

Redux client for Zcash Daemon

  • 0.2.1
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Zcash Redux

Redux clients for Zcash Daemon

Installation

npm install zcash-redux

or

yarn add zcash-redux

Usage

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

import { zReducer } from 'zcash-redux';

You can also instantiate your Redux store directly with the zGetStore helper:

import { zGetStore } from 'zcash-redux';

const options = {
  zcash_auth: {
    username: 'myrpcusername',
    password: 'myrpcpassword',
  },
  zcash_client_config: {
    url: 'http://localhost:8232',
  },
};

const store = zGetStore(options);

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).

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:

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:

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

Keywords

FAQs

Package last updated on 19 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc