How to use the @liskhq/lisk-client.constants function in @liskhq/lisk-client

To help you get started, we’ve selected a few @liskhq/lisk-client 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 LiskHQ / lisk-desktop / src / components / account / account.js View on Github external
const Account = ({ peers, t, showNetworkIndicator }) => {
  const iconMap = ['mainnet', 'testnet', 'devnet'];
  const translations = iconMap.map(code => t(code));

  let iconCode = peers.options.code;
  if (iconCode === 2) {
    iconCode = (peers.options.nethash === Lisk.constants.MAINNET_NETHASH)
      ? networks.mainnet.code : iconCode;
    iconCode = (peers.options.nethash === Lisk.constants.TESTNET_NETHASH)
      ? networks.testnet.code : iconCode;
  }

  const status = (peers.status && peers.status.online)
    ? 
    : ;

  const shouldShowNetworkIndicator = (peers.liskAPIClient
      && (showNetworkIndicator || peers.options.code !== networks.mainnet.code));

  return (shouldShowNetworkIndicator
    ? (
      <section>
        <div>
          <span id="accountStatus">
            {status}</span></div></section>
github LiskHQ / lisk-desktop / src / components / shared / header / topBar / network.js View on Github external
const Network = ({ network, t, token }) =&gt; {
  const networksList = {
    Mainnet: t('Mainnet'),
    Testnet: t('Testnet'),
    'Custom Node': t('Devnet'),
  };

  let activeNetwork = network.name;
  if (network.name === networks.customNode.name &amp;&amp; token !== 'BTC') {
    activeNetwork = network.networks[token].nethash === Lisk.constants.MAINNET_NETHASH
      ? networks.mainnet.name
      : network.name;
    activeNetwork = network.networks[token].nethash === Lisk.constants.TESTNET_NETHASH
      ? networks.testnet.name
      : network.name;
  }

  if (network.name === networks.customNode.name &amp;&amp; token === 'BTC') {
    activeNetwork = token === 'BTC' ? networks.testnet.name : network.name;
  }

  const statusColor = network.status.online ? styles.online : styles.offline;

  return (
    <section>
      <span></span></section>
github LiskHQ / lisk-desktop / src / utils / getNetwork.js View on Github external
export const getNetworkNameBasedOnNethash = (network, token = 'LSK') => {
  let activeNetwork = network.name;
  if (network.name === networks.customNode.name && token !== 'BTC') {
    activeNetwork = network.networks[token].nethash === Lisk.constants.MAINNET_NETHASH
      ? networks.mainnet.name
      : network.name;
    activeNetwork = network.networks[token].nethash === Lisk.constants.TESTNET_NETHASH
      ? networks.testnet.name
      : network.name;
  }

  if (network.name === networks.customNode.name && token === 'BTC') {
    activeNetwork = token === 'BTC' ? networks.testnet.name : network.name;
  }
  return activeNetwork;
};
github LiskHQ / lisk-desktop / src / components / shared / header / topBar / network.js View on Github external
const Network = ({ network, t, token }) =&gt; {
  const networksList = {
    Mainnet: t('Mainnet'),
    Testnet: t('Testnet'),
    'Custom Node': t('Devnet'),
  };

  let activeNetwork = network.name;
  if (network.name === networks.customNode.name &amp;&amp; token !== 'BTC') {
    activeNetwork = network.networks[token].nethash === Lisk.constants.MAINNET_NETHASH
      ? networks.mainnet.name
      : network.name;
    activeNetwork = network.networks[token].nethash === Lisk.constants.TESTNET_NETHASH
      ? networks.testnet.name
      : network.name;
  }

  if (network.name === networks.customNode.name &amp;&amp; token === 'BTC') {
    activeNetwork = token === 'BTC' ? networks.testnet.name : network.name;
  }

  const statusColor = network.status.online ? styles.online : styles.offline;

  return (
    <section>
      <span>
      <p>
        <span>{t('Connected to:')}</span>
        <span>{(networksList[activeNetwork] || '').toLowerCase()}</span></p></span></section>
github LiskHQ / lisk-desktop / src / utils / getNetwork.js View on Github external
export const getNetworkNameBasedOnNethash = (network, token = 'LSK') => {
  let activeNetwork = network.name;
  if (network.name === networks.customNode.name && token !== 'BTC') {
    activeNetwork = network.networks[token].nethash === Lisk.constants.MAINNET_NETHASH
      ? networks.mainnet.name
      : network.name;
    activeNetwork = network.networks[token].nethash === Lisk.constants.TESTNET_NETHASH
      ? networks.testnet.name
      : network.name;
  }

  if (network.name === networks.customNode.name && token === 'BTC') {
    activeNetwork = token === 'BTC' ? networks.testnet.name : network.name;
  }
  return activeNetwork;
};
github LiskHQ / lisk-desktop / src / components / account / account.js View on Github external
const Account = ({ peers, t, showNetworkIndicator }) =&gt; {
  const iconMap = ['mainnet', 'testnet', 'devnet'];
  const translations = iconMap.map(code =&gt; t(code));

  let iconCode = peers.options.code;
  if (iconCode === 2) {
    iconCode = (peers.options.nethash === Lisk.constants.MAINNET_NETHASH)
      ? networks.mainnet.code : iconCode;
    iconCode = (peers.options.nethash === Lisk.constants.TESTNET_NETHASH)
      ? networks.testnet.code : iconCode;
  }

  const status = (peers.status &amp;&amp; peers.status.online)
    ? 
    : ;

  const shouldShowNetworkIndicator = (peers.liskAPIClient
      &amp;&amp; (showNetworkIndicator || peers.options.code !== networks.mainnet.code));

  return (shouldShowNetworkIndicator
    ? (
      <section>
        <div></div></section>