Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const normalize = (value, asset) => {
if (asset === btmID || asset === 'BTM'){
return normalizeBTMAmountUnit(btmID, value, btmAmountUnit)
}else if( assetDecimal ){
return converIntToDec(value, assetDecimal)
}else{
return value
}
}
{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>
const normalize = (value) => {
return normalizeBTMAmountUnit(btmID, value, btmAmountUnit)
}
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 && error && <span><strong>{error}</strong></span>}
{this.props.hint && <span>{this.props.hint}</span>}
</div>
}
}
[
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>
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
}
}