diff --git a/lib/plugins/wallet/galoy/galoy.js b/lib/plugins/wallet/galoy/galoy.js index 0ee80fa6..f9302020 100644 --- a/lib/plugins/wallet/galoy/galoy.js +++ b/lib/plugins/wallet/galoy/galoy.js @@ -269,6 +269,7 @@ function getStatus (account, tx, requested, settings, operatorId) { return 'notSeen' } const externalCryptoCode = coinUtils.getExternalCryptoCode(cryptoCode) + const address = coinUtils.parseUrl(address) return checkCryptoCode(cryptoCode) .then(() => getGaloyAccount(account.apiKey)) .then(galoyAccount => { @@ -278,13 +279,13 @@ function getStatus (account, tx, requested, settings, operatorId) { wallet.id === account.walletId)(galoyAccount.wallets) ) const transactions = wallet.transactions.edges - if (isLightning(toAddress)) { - const paymentHash = invoice.decode(toAddress).paymentHash.toString('hex') + if (isLightning(address)) { + const paymentHash = invoice.decode(address).paymentHash.toString('hex') const transaction = _.head(_.filter(tx => tx.node.initiationVia.paymentHash === paymentHash && tx.node.direction === 'RECEIVE')(transactions)) return { receivedCryptoAtoms: cryptoAtoms, status: mapStatus(transaction) } } // On-chain tx - const transaction = _.head(_.filter(tx => tx.node.initiationVia.address === toAddress)(transactions)) + const transaction = _.head(_.filter(tx => tx.node.initiationVia.address === address)(transactions)) return { receivedCryptoAtoms: cryptoAtoms, status: mapStatus(transaction) } }) }