How to use the @cityofzion/neon-js.settings.networks function in @cityofzion/neon-js

To help you get started, we’ve selected a few @cityofzion/neon-js 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 nos / client / src / common / util / getRPCEndpoint.js View on Github external
function getNeoscanAPIEndpoint(net) {
  if (settings.networks[net]) {
    return settings.networks[net].extra.neoscan;
  }

  return net;
}
github nos / client / src / renderer / root / components / AuthenticatedLayout / ExplorerLink / index.js View on Github external
function getTarget(network, endpoint) {
  try {
    const { protocol, host } = new URL(settings.networks[network].extra.neoscan);
    return `${protocol}//${host}/${endpoint}`;
  } catch (err) {
    return null;
  }
}
github nos / client / src / renderer / settings / components / NetworkSettings / NetworkSettings.js View on Github external
return (
      <div>
        
          Network Settings
        

        
          <select value="{this.props.currentNetwork}" label="Current Network" id="network">
            {map(settings.networks, this.renderNetworkOption)}
          </select>

          <input readonly="" value="{neoscanAddress}" label="Neoscan URL" id="neoscan">

          <div>
            <button>
              Add Custom Network
            </button>
            <br></div></div>
github nos / client / src / renderer / settings / components / NetworkSettings / NetworkSettings.js View on Github external
getCurrentNetworkUrl = () => {
    const currentNetworkConfig = settings.networks[this.props.currentNetwork];
    return currentNetworkConfig && currentNetworkConfig.extra.neoscan;
  };
}
github nos / client / src / common / values / networks.js View on Github external
import { settings } from '@cityofzion/neon-js';
import { keys } from 'lodash';

export const NOS_TESTNET = 'nOSNet';
export const NOS_LOCAL = 'nOSLocal';

export const PREDEFINED_NETWORKS = keys(settings.networks).concat([NOS_TESTNET, NOS_LOCAL]);

export const DEFAULT_NET = 'MainNet';