redux-saga-web3-erc721
v0.1.0-alpha.3
Published
A redux-saga interface to an ERC721 contract instance.
Downloads
15
Readme
redux-saga-web3-erc721
A redux-saga interface to an ERC721 contract instance.
Usage
Add the reducer to your redux store:
import { reducer as ERC721Reducer } from "redux-saga-web3-erc721";
...
const reducers = combineReducers({
...,
...ERC721Reducer,
});
Interact with an ERC721 instance through actions and selectors:
import {
actions as ERC721Actions,
selectors as ERC721Selectors,
} from "redux-saga-web3-erc721";
export default connect(
(state, { owner, at }) => ({
balance: ERC721Selectors.selectBalanceOf(state, { owner, at }),
}),
dispatch => ({
getBalanceOf(owner, at) {
dispatch(ERC721Actions.balanceOf(owner, { at }));
},
})
)(Component);