zcash-redux
Advanced tools
Comparing version 0.2.3 to 0.2.5
@@ -67,3 +67,3 @@ import zClient from './client'; | ||
return client.z_listaddresses().then(response => dispatch(zListAddressesSuccess(response))).catch(err => dispatch(zListAddressesError(err))); | ||
return client.z_listtransactions().then(response => dispatch(zListAddressesSuccess(response))).catch(err => dispatch(zListAddressesError(err))); | ||
}; | ||
@@ -70,0 +70,0 @@ |
@@ -5,23 +5,45 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import zGetStore from './store'; | ||
import { | ||
// setAuthConfig, | ||
// resetAuthConfig, | ||
zGetTotalBalance, zListAddresses, zListTransactions } from './actions'; | ||
export default class zClient { | ||
constructor() { | ||
this.z_listtransactions = () => this.rpc.z_listtransactions(); | ||
this.z_listtransactions = () => this.store.dispatch(zListTransactions()); | ||
this.z_listaddresses = () => this.rpc.z_listaddresses(); | ||
this.z_listaddresses = () => this.store.dispatch(zListAddresses()); | ||
this.z_gettotalbalance = address => this.rpc.z_getbalance(address); | ||
this.z_gettotalbalance = address => this.store.dispatch(zGetTotalBalance(address)); | ||
this.z_shieldcoinbase = (from, to) => this.rpc.z_shieldcoinbase(from, to); | ||
this.z_listtransactions = () => | ||
// count: number = 10, | ||
// from: number = 0, | ||
// includeWatchOnly: boolean = false, | ||
this.store.dispatch(zListTransactions() | ||
// '*', | ||
// count, | ||
// from, | ||
// includeWatchOnly, | ||
); | ||
this.z_sendmany = (from, amounts, minconf = 1, fee = 0.0001) => this.rpc.z_sendmany(from, amounts, minconf, fee); | ||
this.store = zGetStore(); | ||
const { config } = this.store.getState(); | ||
this.z_listtransactions = (count = 10, from = 0, includeWatchOnly = false) => this.rpc.listtransactions('*', count, from, includeWatchOnly); | ||
const store = zGetStore(); | ||
const { config } = store.getState(); | ||
this.rpc = stdrpc(_extends({}, config)); | ||
} | ||
// z_shieldcoinbase = (from: number, to: number) => this.rpc.z_shieldcoinbase(from, to); | ||
// z_sendmany = ( | ||
// from: string, | ||
// amounts: number, | ||
// minconf: number = 1, | ||
// fee: number = 0.0001, | ||
// ) => this.rpc.z_sendmany( | ||
// from, | ||
// amounts, | ||
// minconf, | ||
// fee, | ||
// ); | ||
} |
{ | ||
"name": "zcash-redux", | ||
"version": "0.2.3", | ||
"version": "0.2.5", | ||
"main": "lib/index.js", | ||
@@ -12,2 +12,4 @@ "license": "MIT", | ||
"flow:precommit": "glow", | ||
"flow:coverage": "flow-coverage-report -t html -i 'src/*.js' -x 'lib/*.js' --threshold 70", | ||
"flow:report": "yarn flow:coverage && cd ./flow-coverage && open index.html", | ||
"lint:precommit": "eslint ./src/", | ||
@@ -46,2 +48,3 @@ "lint:fix": "eslint ./src/ --fix" | ||
"flow-copy-source": "^2.0.2", | ||
"flow-coverage-report": "^0.5.0", | ||
"glow": "^1.2.2", | ||
@@ -48,0 +51,0 @@ "pre-commit": "^1.2.2" |
@@ -5,6 +5,10 @@ # Zcash Redux | ||
## WARNING | ||
> Library currently under development, will undergo further breaking changes. Not ready for production use. | ||
## Installation | ||
```bash | ||
npm install zcash-redux | ||
yarn add zcash-redux | ||
``` | ||
@@ -15,3 +19,3 @@ | ||
```bash | ||
yarn add zcash-redux | ||
npm i zcash-redux | ||
``` | ||
@@ -26,20 +30,9 @@ | ||
import { zReducer } from 'zcash-redux'; | ||
``` | ||
You can also instantiate your Redux store directly with the `zGetStore` helper: | ||
```js | ||
import { zGetStore } from 'zcash-redux'; | ||
const options = { | ||
zcash_auth: { | ||
username: 'myrpcusername', | ||
password: 'myrpcpassword', | ||
}, | ||
zcash_client_config: { | ||
url: 'http://localhost:8232', | ||
}, | ||
}; | ||
const store = zGetStore(options); | ||
export default combineReducers({ | ||
header: headerReducer, | ||
routing: routerReducer, | ||
... | ||
zcash: zReducer, | ||
}); | ||
``` | ||
@@ -46,0 +39,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17315
209
17
78