How to use the @hathor/wallet-lib.network function in @hathor/wallet-lib

To help you get started, we’ve selected a few @hathor/wallet-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HathorNetwork / hathor-wallet / src / App.js View on Github external
import WalletVersionError from './screens/WalletVersionError';
import version from './utils/version';
import wallet from './utils/wallet';
import { connect } from "react-redux";
import RequestErrorModal from './components/RequestError';
import DashboardTx from './screens/DashboardTx';
import DecodeTx from './screens/DecodeTx';
import PushTx from './screens/PushTx';
import { dataLoaded, isOnlineUpdate } from "./actions/index";
import store from './store/index';
import createRequestInstance from './api/axiosInstance';
import hathorLib from '@hathor/wallet-lib';
import { DEFAULT_SERVER, VERSION } from './constants';
import LocalStorageStore  from './storage.js';

hathorLib.network.setNetwork('mainnet');
hathorLib.storage.setStore(new LocalStorageStore());

// set default server to bravo testnet
hathorLib.wallet.setDefaultServer(DEFAULT_SERVER);

const mapDispatchToProps = dispatch => {
  return {
    dataLoaded: (data) => dispatch(dataLoaded(data)),
    isOnlineUpdate: (data) => dispatch(isOnlineUpdate(data)),
  };
};

const mapStateToProps = (state) => {
  return {
    isVersionAllowed: state.isVersionAllowed,
    loadingAddresses: state.loadingAddresses,