How to use the redux/actions.core function in redux

To help you get started, we’ve selected a few redux 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 swaponline / swap.react / shared / containers / Core / Core.js View on Github external
createOrder = async ({ fromPeer, order, ...rest }) => {
    console.log('rest', ...rest)
    // TODO add check exchange rate and format order
    const createdOrder = await actions.core.createOrder(order)
    actions.core.requestToPeer('accept request', fromPeer, { orderId: createdOrder.id })
  }
github swaponline / swap.react / shared / helpers / handleGoTrade.js View on Github external
if (declineSwap) {
        const itemState = declineSwap.flow.state
        const values = itemState.btcScriptValues
          || itemState.bchScriptValues
          || itemState.ltcScriptValues
          // || itemState.usdtOmniScriptValues
          || itemState.scriptValues

        if (values) {
          const { isFinished, isRefunded, isStoppedSwap } = itemState

          const lockTime = moment.unix(values.lockTime || date)._i / 1000
          const timeSinceLock = date - lockTime

          if (isFinished || isRefunded || isStoppedSwap || timeSinceLock > 259200) { // 259200 3 дня в секундах
            actions.core.forgetOrders(decline[i])
          } else if (declineSwap.sellCurrency === currency.toUpperCase()
            && !declineSwap.isSwapExist
            && !declineSwap.isMy) {
            return i
          }
        }
      }
    }
  }
  return false
}
github swaponline / swap.react / shared / pages / CurrencyWallet / CurrencyWallet.js View on Github external
metaTitle: {
        id: 'CurrencyWalletWidgetBuildTitle',
        defaultMessage: '{fullName} ({currency}) Web Wallet with Atomic Swap.',
      },
    })
    const title = (isWidgetBuild) ? titleWidgetBuild : titleSwapOnline

    const description = defineMessages({
      metaDescription: {
        id: 'CurrencyWallet154',
        defaultMessage: 'Atomic Swap Wallet allows you to manage and securely exchange ${fullName} (${currency}) with 0% fees. Based on Multi-Sig and Atomic Swap technologies.',
      },
    })

    if (hiddenCoinsList.includes(currency)) {
      actions.core.markCoinAsVisible(currency)
    }

    const isBlockedCoin = config.noExchangeCoins
      .map(item => item.toLowerCase())
      .includes(currency.toLowerCase())

    return (
      <div>
        
        </div>
github swaponline / swap.react / shared / components / modals / OfferModal / ConfirmOffer / ConfirmOffer.js View on Github external
createOrder = () => {
    const { offer: { buyAmount, sellAmount, buyCurrency, sellCurrency, exchangeRate, isPartialClosure } } = this.props

    const data = {
      buyCurrency: `${buyCurrency}`,
      sellCurrency: `${sellCurrency}`,
      buyAmount: Number(buyAmount),
      sellAmount: Number(sellAmount),
      exchangeRate: Number(exchangeRate),
      isPartialClosure,
    }

    actions.analytics.dataEvent('orderbook-addoffer-click-confirm-button')
    actions.core.createOrder(data)
    actions.core.updateCore()
  }
github swaponline / swap.react / shared / pages / Swap / Swap.js View on Github external
saveThisSwap = (orderId) => {
    actions.core.rememberOrder(orderId)
  }
github swaponline / swap.react / shared / pages / Home / Orders / RowMobile / RowMobile.js View on Github external
removeOrder = (orderId) => {
    if (confirm('Are your sure ?')) {
      actions.core.removeOrder(orderId)
      actions.core.updateCore()
    }
  }
github swaponline / swap.react / shared / pages / Swap / Swap.js View on Github external
deleteThisSwap = (orderId) => {
    actions.core.saveDeletedOrder(orderId)
    actions.core.forgetOrders(orderId)
    window.swap = null
  }
github swaponline / swap.react / shared / helpers / handleGoTrade.js View on Github external
const getSwapByIdSafe = (swapID) => {
  try {
    const returnedSwap = actions.core.getSwapById(swapID)
    return returnedSwap
  } catch (noFlowError) {
    return false
  }
}
const getDeclinedExistedSwapIndex = ({ currency, decline }) => {
github swaponline / swap.react / shared / pages / OldWallet / Row / Row.js View on Github external
.forEach(name => {
        if (!hiddenCoinsList.includes(name.toUpperCase())) {
          actions.core.markCoinAsVisible(name.toUpperCase())
        }
      })
  }
github swaponline / swap.react / shared / redux / actions / core.js View on Github external
const removeOrder = (orderId) => {
  actions.feed.deleteItemToFeed(orderId)
  SwapApp.shared().services.orders.remove(orderId)
  actions.core.updateCore()
}