this.setState({ modalOpen: true })}>
+
this.setState({ modalOpen: true })}>
Address
diff --git a/app/lnd/methods/channelController.js b/app/lnd/methods/channelController.js
index 606d52a0..adc95d2c 100644
--- a/app/lnd/methods/channelController.js
+++ b/app/lnd/methods/channelController.js
@@ -15,7 +15,7 @@ const BufferUtil = bitcore.util.buffer
*/
export function connectAndOpen(lnd, meta, event, payload) {
console.log('payload: ', payload)
-
+
const { pubkey, host, localamt } = payload
const channelPayload = {
node_pubkey: BufferUtil.hexToBuffer(pubkey),
@@ -25,38 +25,38 @@ export function connectAndOpen(lnd, meta, event, payload) {
return new Promise((resolve, reject) => {
listPeers(lnd, meta)
- .then(({ peers }) => {
- console.log('peers: ', peers)
-
- const peer = find(peers, { pub_key: pubkey })
-
- if (peer) {
- console.log('already have the peer. can open the channel now')
- const call = lnd.openChannel(channelPayload, meta)
-
- call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data }))
- call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() }))
- } else {
- console.log('connect to the peer first')
- connectPeer(lnd, meta, { pubkey, host })
- .then((data) => {
- console.log('connectPeer data: ', data)
+ .then(({ peers }) => {
+ console.log('peers: ', peers)
+
+ const peer = find(peers, { pub_key: pubkey })
+ if (peer) {
+ console.log('already have the peer. can open the channel now')
const call = lnd.openChannel(channelPayload, meta)
-
+
call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data }))
call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() }))
- })
- .catch(err => {
- console.log('connect peer err: ', err)
- event.sender.send('pushchannelerror', { pubkey, error: err.toString() })
- })
- }
- })
- .catch(err => {
- console.log('list peer err: ', err)
- event.sender.send('pushchannelerror', { pubkey, error: err.toString() })
- })
+ } else {
+ console.log('connect to the peer first')
+ connectPeer(lnd, meta, { pubkey, host })
+ .then((data) => {
+ console.log('connectPeer data: ', data)
+
+ const call = lnd.openChannel(channelPayload, meta)
+
+ call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data }))
+ call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() }))
+ })
+ .catch((err) => {
+ console.log('connect peer err: ', err)
+ event.sender.send('pushchannelerror', { pubkey, error: err.toString() })
+ })
+ }
+ })
+ .catch((err) => {
+ console.log('list peer err: ', err)
+ event.sender.send('pushchannelerror', { pubkey, error: err.toString() })
+ })
})
}
@@ -79,8 +79,7 @@ export function openChannel(lnd, meta, event, payload) {
return new Promise((resolve, reject) =>
pushopenchannel(lnd, meta, event, res)
.then(data => resolve(data))
- .catch(error => reject(error))
- )
+ .catch(error => reject(error)))
}
diff --git a/app/lnd/methods/index.js b/app/lnd/methods/index.js
index b8c7b1c3..f45ad419 100644
--- a/app/lnd/methods/index.js
+++ b/app/lnd/methods/index.js
@@ -74,8 +74,7 @@ export default function (lnd, meta, event, msg, data) {
// [ { channels: [] }, { total_limbo_balance: 0, pending_open_channels: [], pending_closing_channels: [], pending_force_closing_channels: [] } ]
Promise.all([channelController.listChannels, channelController.pendingChannels].map(func => func(lnd, meta)))
.then(channelsData =>
- event.sender.send('receiveChannels', { channels: channelsData[0].channels, pendingChannels: channelsData[1] })
- )
+ event.sender.send('receiveChannels', { channels: channelsData[0].channels, pendingChannels: channelsData[1] }))
.catch(error => console.log('channels error: ', error))
break
case 'transactions':
@@ -123,8 +122,7 @@ export default function (lnd, meta, event, msg, data) {
r_hash: new Buffer(newinvoice.r_hash, 'hex').toString('hex'),
creation_date: Date.now() / 1000
})
- )
- )
+ ))
.catch((error) => {
console.log('addInvoice error: ', error)
event.sender.send('invoiceFailed', { error: error.toString() })
diff --git a/app/reducers/balance.js b/app/reducers/balance.js
index 4da402fe..b8a74920 100644
--- a/app/reducers/balance.js
+++ b/app/reducers/balance.js
@@ -31,7 +31,9 @@ export const receiveBalance = (event, { walletBalance, channelBalance }) => (dis
const ACTION_HANDLERS = {
[GET_BALANCE]: state => ({ ...state, balanceLoading: true }),
[RECEIVE_BALANCE]: (state, { walletBalance, channelBalance }) => (
- { ...state, balanceLoading: false, walletBalance, channelBalance }
+ {
+ ...state, balanceLoading: false, walletBalance, channelBalance
+ }
)
}
diff --git a/app/reducers/channels.js b/app/reducers/channels.js
index 171dc77c..8af72d42 100644
--- a/app/reducers/channels.js
+++ b/app/reducers/channels.js
@@ -152,7 +152,9 @@ export const fetchChannels = () => async (dispatch) => {
export const receiveChannels = (event, { channels, pendingChannels }) => dispatch => dispatch({ type: RECEIVE_CHANNELS, channels, pendingChannels })
// Send IPC event for opening a channel
-export const openChannel = ({ pubkey, host, local_amt, push_amt }) => (dispatch) => {
+export const openChannel = ({
+ pubkey, host, local_amt, push_amt
+}) => (dispatch) => {
const localamt = btc.btcToSatoshis(local_amt)
console.log('localamt: ', localamt)
@@ -325,7 +327,9 @@ const ACTION_HANDLERS = {
[GET_CHANNELS]: state => ({ ...state, channelsLoading: true }),
[RECEIVE_CHANNELS]: (state, { channels, pendingChannels }) => (
- { ...state, channelsLoading: false, channels, pendingChannels }
+ {
+ ...state, channelsLoading: false, channels, pendingChannels
+ }
),
[OPENING_CHANNEL]: state => ({ ...state, openingChannel: true }),
@@ -339,13 +343,13 @@ const ACTION_HANDLERS = {
[TOGGLE_CHANNEL_PULLDOWN]: state => ({ ...state, filterPulldown: !state.filterPulldown }),
[CHANGE_CHANNEL_FILTER]: (state, { filter }) => ({ ...state, filterPulldown: false, filter }),
-
+
[ADD_LOADING_PUBKEY]: (state, { pubkey }) => ({ ...state, loadingChannelPubkeys: [pubkey, ...state.loadingChannelPubkeys] }),
[REMOVE_LOADING_PUBKEY]: (state, { pubkey }) => ({ ...state, loadingChannelPubkeys: state.loadingChannelPubkeys.filter(loadingPubkey => loadingPubkey !== pubkey) }),
[ADD_ClOSING_CHAN_ID]: (state, { chanId }) => ({ ...state, closingChannelIds: [chanId, ...state.closingChannelIds] }),
[REMOVE_ClOSING_CHAN_ID]: (state, { chanId }) => ({ ...state, closingChannelIds: state.closingChannelIds.filter(closingChanId => closingChanId !== chanId) }),
-
+
[OPEN_CONTACT_MODAL]: (state, { channel }) => ({ ...state, contactModal: { isOpen: true, channel } }),
[CLOSE_CONTACT_MODAL]: state => ({ ...state, contactModal: { isOpen: false, channel: null } })
}
diff --git a/app/reducers/invoice.js b/app/reducers/invoice.js
index 43932ccf..63c181e2 100644
--- a/app/reducers/invoice.js
+++ b/app/reducers/invoice.js
@@ -125,7 +125,7 @@ export const invoiceFailed = (event, { error }) => (dispatch) => {
dispatch(setError(error))
}
-// Listen for invoice updates pushed from backend from subscribeToInvoices
+// Listen for invoice updates pushed from backend from subscribeToInvoices
export const invoiceUpdate = (event, { invoice }) => (dispatch) => {
dispatch({ type: UPDATE_INVOICE, invoice })
diff --git a/app/reducers/network.js b/app/reducers/network.js
index 511ba41a..e8607d64 100644
--- a/app/reducers/network.js
+++ b/app/reducers/network.js
@@ -158,7 +158,9 @@ export const receiveInvoiceAndQueryRoutes = (event, { routes }) => dispatch =>
// ------------------------------------
const ACTION_HANDLERS = {
[GET_DESCRIBE_NETWORK]: state => ({ ...state, networkLoading: true }),
- [RECEIVE_DESCRIBE_NETWORK]: (state, { nodes, edges }) => ({ ...state, networkLoading: false, nodes, edges }),
+ [RECEIVE_DESCRIBE_NETWORK]: (state, { nodes, edges }) => ({
+ ...state, networkLoading: false, nodes, edges
+ }),
[GET_QUERY_ROUTES]: (state, { pubkey }) => ({ ...state, networkLoading: true, selectedNode: { pubkey, routes: [], currentRoute: {} } }),
[RECEIVE_QUERY_ROUTES]: (state, { routes }) => (
diff --git a/app/reducers/peers.js b/app/reducers/peers.js
index 7d88b705..9c1364ec 100644
--- a/app/reducers/peers.js
+++ b/app/reducers/peers.js
@@ -108,13 +108,17 @@ export const disconnectSuccess = (event, { pubkey }) => dispatch => dispatch({ t
const ACTION_HANDLERS = {
[DISCONNECT_PEER]: state => ({ ...state, disconnecting: true }),
[DISCONNECT_SUCCESS]: (state, { pubkey }) => (
- { ...state, disconnecting: false, peer: null, peers: state.peers.filter(peer => peer.pub_key !== pubkey) }
+ {
+ ...state, disconnecting: false, peer: null, peers: state.peers.filter(peer => peer.pub_key !== pubkey)
+ }
),
[DISCONNECT_FAILURE]: state => ({ ...state, disconnecting: false }),
[CONNECT_PEER]: state => ({ ...state, connecting: true }),
[CONNECT_SUCCESS]: (state, { peer }) => (
- { ...state, connecting: false, peerForm: { pubkey: '', host: '', isOpen: false }, peers: [...state.peers, peer] }
+ {
+ ...state, connecting: false, peerForm: { pubkey: '', host: '', isOpen: false }, peers: [...state.peers, peer]
+ }
),
[CONNECT_FAILURE]: state => ({ ...state, connecting: false }),
diff --git a/app/reducers/ticker.js b/app/reducers/ticker.js
index c796a99f..32665a5a 100644
--- a/app/reducers/ticker.js
+++ b/app/reducers/ticker.js
@@ -68,7 +68,9 @@ const ACTION_HANDLERS = {
[SET_CRYPTO]: (state, { crypto }) => ({ ...state, crypto }),
[GET_TICKERS]: state => ({ ...state, tickerLoading: true }),
[RECIEVE_TICKERS]: (state, { btcTicker, ltcTicker }) => (
- { ...state, tickerLoading: false, btcTicker, ltcTicker }
+ {
+ ...state, tickerLoading: false, btcTicker, ltcTicker
+ }
)
}
diff --git a/app/reducers/transaction.js b/app/reducers/transaction.js
index 886bb200..c32ae56f 100644
--- a/app/reducers/transaction.js
+++ b/app/reducers/transaction.js
@@ -45,7 +45,9 @@ export const fetchTransactions = () => (dispatch) => {
// Receive IPC event for payments
export const receiveTransactions = (event, { transactions }) => dispatch => dispatch({ type: RECEIVE_TRANSACTIONS, transactions })
-export const sendCoins = ({ value, addr, currency, rate }) => (dispatch) => {
+export const sendCoins = ({
+ value, addr, currency, rate
+}) => (dispatch) => {
const amount = currency === 'usd' ? btc.btcToSatoshis(usd.usdToBtc(value, rate)) : btc.btcToSatoshis(value)
dispatch(sendTransaction())
ipcRenderer.send('lnd', { msg: 'sendCoins', data: { amount, addr } })
diff --git a/app/routes/activity/components/Activity.js b/app/routes/activity/components/Activity.js
index 497ab8f1..2af22af4 100644
--- a/app/routes/activity/components/Activity.js
+++ b/app/routes/activity/components/Activity.js
@@ -20,7 +20,9 @@ class Activity extends Component {
}
componentWillMount() {
- const { fetchPayments, fetchInvoices, fetchTransactions, fetchBalance } = this.props
+ const {
+ fetchPayments, fetchInvoices, fetchTransactions, fetchBalance
+ } = this.props
fetchBalance()
fetchPayments()
diff --git a/app/routes/activity/components/components/Invoice/Invoice.js b/app/routes/activity/components/components/Invoice/Invoice.js
index 441d05e0..78f040c4 100644
--- a/app/routes/activity/components/components/Invoice/Invoice.js
+++ b/app/routes/activity/components/components/Invoice/Invoice.js
@@ -6,7 +6,9 @@ import { FaBolt, FaClockO } from 'react-icons/lib/fa'
import { btc } from 'utils'
import styles from '../Activity.scss'
-const Invoice = ({ invoice, ticker, currentTicker, showActivityModal }) => (
+const Invoice = ({
+ invoice, ticker, currentTicker, showActivityModal
+}) => (
showActivityModal('INVOICE', { invoice })}>
{
!invoice.settled ?
diff --git a/app/routes/activity/components/components/Modal/Modal.js b/app/routes/activity/components/components/Modal/Modal.js
index 4ec34da6..f6c3c97a 100644
--- a/app/routes/activity/components/components/Modal/Modal.js
+++ b/app/routes/activity/components/components/Modal/Modal.js
@@ -9,7 +9,9 @@ import Invoice from './Invoice'
import styles from './Modal.scss'
-const Modal = ({ modalType, modalProps, hideActivityModal, ticker, currentTicker }) => {
+const Modal = ({
+ modalType, modalProps, hideActivityModal, ticker, currentTicker
+}) => {
const MODAL_COMPONENTS = {
TRANSACTION: Transaction,
PAYMENT: Payment,
diff --git a/app/routes/activity/components/components/Payment/Payment.js b/app/routes/activity/components/components/Payment/Payment.js
index 8998fce7..ecf5ceed 100644
--- a/app/routes/activity/components/components/Payment/Payment.js
+++ b/app/routes/activity/components/components/Payment/Payment.js
@@ -6,7 +6,9 @@ import { FaBolt } from 'react-icons/lib/fa'
import { btc } from 'utils'
import styles from '../Activity.scss'
-const Payment = ({ payment, ticker, currentTicker, showActivityModal }) => (
+const Payment = ({
+ payment, ticker, currentTicker, showActivityModal
+}) => (
showActivityModal('PAYMENT', { payment })}>
diff --git a/app/routes/activity/components/components/Transaction/Transaction.js b/app/routes/activity/components/components/Transaction/Transaction.js
index e2d1b993..36fd7fff 100644
--- a/app/routes/activity/components/components/Transaction/Transaction.js
+++ b/app/routes/activity/components/components/Transaction/Transaction.js
@@ -6,7 +6,9 @@ import { FaChain } from 'react-icons/lib/fa'
import { btc } from 'utils'
import styles from '../Activity.scss'
-const Transaction = ({ transaction, ticker, currentTicker, showActivityModal }) => (
+const Transaction = ({
+ transaction, ticker, currentTicker, showActivityModal
+}) => (
showActivityModal('TRANSACTION', { transaction })}>
diff --git a/app/routes/contacts/components/Contacts.js b/app/routes/contacts/components/Contacts.js
index b3932b71..d24346ae 100644
--- a/app/routes/contacts/components/Contacts.js
+++ b/app/routes/contacts/components/Contacts.js
@@ -57,7 +57,7 @@ class Contacts extends Component {
toggleFilterPulldown,
changeFilter,
nonActiveFilters,
-
+
openContactsForm,
openContactModal,
closeContactModal,
@@ -163,7 +163,7 @@ class Contacts extends Component {
{
currentChannels.length > 0 && currentChannels.map((channel, index) => {
if (closingChannelIds.includes(channel.chan_id)) {
- return
+ return
} else if (Object.prototype.hasOwnProperty.call(channel, 'blocks_till_open')) {
return
} else if (Object.prototype.hasOwnProperty.call(channel, 'closing_txid')) {
diff --git a/app/routes/network/components/Network.js b/app/routes/network/components/Network.js
index c44aa2c3..22feae30 100644
--- a/app/routes/network/components/Network.js
+++ b/app/routes/network/components/Network.js
@@ -18,7 +18,9 @@ class Network extends Component {
}
componentDidUpdate(prevProps) {
- const { payReqIsLn, network: { pay_req }, fetchInvoiceAndQueryRoutes, clearQueryRoutes } = this.props
+ const {
+ payReqIsLn, network: { pay_req }, fetchInvoiceAndQueryRoutes, clearQueryRoutes
+ } = this.props
// If LN go retrieve invoice details
if ((prevProps.network.pay_req !== pay_req) && payReqIsLn) {
@@ -31,7 +33,9 @@ class Network extends Component {
}
componentWillUnmount() {
- const { clearQueryRoutes, resetPayReq, clearSelectedChannels, clearSelectedPeers } = this.props
+ const {
+ clearQueryRoutes, resetPayReq, clearSelectedChannels, clearSelectedPeers
+ } = this.props
clearQueryRoutes()
resetPayReq()
diff --git a/internals/scripts/CheckBuiltsExist.js b/internals/scripts/CheckBuiltsExist.js
index 99ba4985..ef876c3c 100644
--- a/internals/scripts/CheckBuiltsExist.js
+++ b/internals/scripts/CheckBuiltsExist.js
@@ -9,15 +9,11 @@ function CheckBuildsExist() {
const rendererPath = path.join(__dirname, '..', '..', 'app', 'dist', 'renderer.prod.js')
if (!fs.existsSync(mainPath)) {
- throw new Error(chalk.whiteBright.bgRed.bold(
- 'The main process is not built yet. Build it by running "npm run build-main"'
- ))
+ throw new Error(chalk.whiteBright.bgRed.bold('The main process is not built yet. Build it by running "npm run build-main"'))
}
if (!fs.existsSync(rendererPath)) {
- throw new Error(chalk.whiteBright.bgRed.bold(
- 'The renderer process is not built yet. Build it by running "npm run build-renderer"'
- ))
+ throw new Error(chalk.whiteBright.bgRed.bold('The renderer process is not built yet. Build it by running "npm run build-renderer"'))
}
}