How to use the utility/buildInOutDisplay.normalizeBTMAmountUnit function in utility

To help you get started, we’ve selected a few utility 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 Bytom / bytom-dashboard / src / features / transactions / components / New / CrossChain / CrossChainConfirmModal / CrossChainConfirmModal.jsx View on Github external
const normalize = (value, asset) => {
      if (asset === btmID || asset === 'BTM'){
        return normalizeBTMAmountUnit(btmID, value, btmAmountUnit)
      }else if( assetDecimal ){
        return converIntToDec(value, assetDecimal)
      }else{
        return value
      }
    }
github Bytom / bytom-dashboard / src / features / transactions / components / New / CrossChain / CrossChainConfirmModal / CrossChainConfirmModal.jsx View on Github external
{t('form.account')}
               <span>{accountAlias.value || accountId.value}</span>
            
            
              {t('transaction.crossChain.crossChainAddress')}
               <span>{address.value}</span> 
            
            
              {t('form.amount')}
               <code>{normalize(amount.value, asset)} {unit}</code> 
            
            
              {t('form.fee')}
               <code>{normalizeBTMAmountUnit(btmID, fee, btmAmountUnit)}</code> 
            
            
              {t('transaction.normal.total')}
               <code>{normalize(Total, asset)} {unit}</code> 
            
          
        

        <hr>

        <form>
          <div>
            <label>{t('key.password')}</label>
            </div></form>
github Bytom / bytom-dashboard / src / features / transactions / components / New / VoteConfirmModal / VoteConfirmModal.jsx View on Github external
const normalize = (value) => {
      return normalizeBTMAmountUnit(btmID, value, btmAmountUnit)
    }
github Bytom / bytom-dashboard / src / features / shared / components / GasField / GasField.jsx View on Github external
render() {
    const fieldProps = pick(this.props.fieldProps, TEXT_FIELD_PROPS)
    const {touched, error} = this.props.fieldProps
    const chainGas = this.props.chainGas || 0

    return <div>
      <span>{normalizeBTMAmountUnit(btmID, ( chainGas + fieldProps.value * this.props.gas ), this.props.btmAmountUnit)}</span>
      <input step="1" max="{3}" min="{0}" type="range">

      {touched &amp;&amp; error &amp;&amp; <span><strong>{error}</strong></span>}
      {this.props.hint &amp;&amp; <span>{this.props.hint}</span>}
    </div>
  }
}
github Bytom / bytom-dashboard / src / features / transactions / components / New / ConfirmModal / ConfirmModal.jsx View on Github external
[
                To
                 <span>{receiver.address.value}</span> 
              ,
              
                {t('form.amount')}
                 <code>{normalize(receiver.amount.value, asset)} {unit}</code> 
              ,
             
               
             
             ])}

            
              {t('form.fee')}
               <code>{normalizeBTMAmountUnit(btmID, fee, btmAmountUnit)}</code> 
            

            
              {t('transaction.normal.total')}
               <code>{normalize(Total, asset)} {unit}</code> 
            
          
        

        <hr>

        <form>
          <div>
            <label>{t('key.password')}</label>
            </div></form>
github Bytom / bytom-dashboard / src / features / transactions / transactions.js View on Github external
if (values.accountAlias) {
    filteredBalances = filteredBalances.filter(balance => balance.accountAlias === values.accountAlias)
  }
  if (values.accountId) {
    filteredBalances = filteredBalances.filter(balance => balance.accountId === values.accountId)
  }
  if (values.assetAlias) {
    filteredBalances = filteredBalances.filter(balance => balance.assetAlias === values.assetAlias)
  }
  if (values.assetId) {
    filteredBalances = filteredBalances.filter(balance => balance.assetId === values.assetId)
  }

  if(filteredBalances.length === 1){
    if (filteredBalances[0].assetId === btmID){
      return normalizeBTMAmountUnit(filteredBalances[0].assetId, filteredBalances[0].amount, btmAmountUnit)
    }else if( assetDecimal ){
      return converIntToDec(filteredBalances[0].amount, assetDecimal)
    }else{
      return filteredBalances[0].amount
    }
  }else {
    return null
  }
}