How to use the edge-core-js.errorNames.NoAmountSpecifiedError function in edge-core-js

To help you get started, we’ve selected a few edge-core-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 EdgeApp / edge-react-gui / src / connectors / scenes / SendConfirmationConnector.js View on Github external
}

  const transaction = getTransaction(state)
  const pending = getPending(state)
  const nativeAmount = sceneState.nativeAmount
  // const nativeAmount = getNativeAmount(state)
  let error = getError(state)

  let errorMsg = null
  let resetSlider = false
  if (error && error.message === 'broadcastError') {
    error = null
    resetSlider = true
  }
  errorMsg = error ? error.message : ''
  if (error && error.name === errorNames.NoAmountSpecifiedError) errorMsg = ''
  const networkFee = transaction ? transaction.networkFee : null
  const parentNetworkFee = transaction && transaction.parentNetworkFee ? transaction.parentNetworkFee : null

  const uniqueIdentifier = sceneState.parsedUri.uniqueIdentifier
  const transactionMetadata = sceneState.transactionMetadata
  const exchangeRates = state.exchangeRates
  const out = {
    balanceInCrypto,
    balanceInFiat,
    currencyCode,
    transactionMetadata,
    errorMsg,
    exchangeRates,
    fiatCurrencyCode: guiWallet.fiatCurrencyCode,
    fiatPerCrypto,
    forceUpdateGuiCounter: getForceUpdateGuiCounter(state),
github EdgeApp / edge-react-gui / src / connectors / scenes / SendConfirmationConnector.js View on Github external
const transaction = getTransaction(state)
  const pending = getPending(state)
  const nativeAmount = sceneState.nativeAmount
  // const nativeAmount = getNativeAmount(state)
  let error = getError(state)

  let errorMsg = null
  let resetSlider = false
  // consider refactoring this method for resetting slider
  if (error && (error.message === 'broadcastError' || error.message === 'transactionCancelled')) {
    error = null
    resetSlider = true
  }
  errorMsg = error ? error.message : ''
  if (error && error.name === errorNames.NoAmountSpecifiedError) errorMsg = ''
  const networkFee = transaction ? transaction.networkFee : null
  const parentNetworkFee = transaction && transaction.parentNetworkFee ? transaction.parentNetworkFee : null
  const uniqueIdentifier = sceneState.guiMakeSpendInfo.uniqueIdentifier
  const transactionMetadata = sceneState.transactionMetadata
  const exchangeRates = state.exchangeRates
  const { toggleCryptoOnTop } = sceneState

  const { spendingLimits } = state.ui.settings

  const out = {
    balanceInCrypto,
    balanceInFiat,
    currencyCode,
    currencyInfo: currencyInfo || null,
    transactionMetadata,
    errorMsg,