Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
pbca26 committed Dec 8, 2020
2 parents a05649b + 480242a commit b3f0db2
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 186 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ Also, make sure that you close Ledger Live or any other apps that might be using
Add udev rules
`wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash`

### Ledger on Latest Chrome browser
If you're experiencing issues connecting your Ledger device open the following url chrome://flags#new-usb-backend in Chrome browser and disable it. Alternatively you can try Chromium or Brave browsers.

## Build/compile issues
If you are experiencing build issues that lead to minify errors add required modules to [config-overrides.js](https://github.com/pbca26/hw-kmd-wallet/blob/master/config-overrides.js#L19) file.

Expand Down
12 changes: 6 additions & 6 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,32 +172,32 @@ function createWindow() {
mainWindow = null;
});

ipcMain.on('getAddress', (e, derivationPath) => {
ipcMain.on('getAddress', (e, {ruid, derivationPath}) => {
console.log(derivationPath);

if (mainWindow) {
getAddress(derivationPath, false).then(result => {
mainWindow.webContents.send('getAddress', result);
mainWindow.webContents.send('getAddress', {ruid, result});
});
}
});

ipcMain.on('createPaymentTransactionNew', (e, txData) => {
ipcMain.on('createPaymentTransactionNew', (e, {ruid, txData}) => {
console.log(txData);

if (mainWindow) {
createPaymentTransactionNew(txData).then(result => {
mainWindow.webContents.send('createPaymentTransactionNew', result);
mainWindow.webContents.send('createPaymentTransactionNew', {ruid, result});
});
}
});

ipcMain.on('splitTransaction', (e, txData) => {
ipcMain.on('splitTransaction', (e, {ruid, txData}) => {
console.log(txData);

if (mainWindow) {
splitTransaction(txData).then(result => {
mainWindow.webContents.send('splitTransaction', result);
mainWindow.webContents.send('splitTransaction', {ruid, result});
});
}
});
Expand Down
24 changes: 13 additions & 11 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
} from './lib/blockchain';
import accountDiscovery from './lib/account-discovery';
import blockchain from './lib/blockchain';
import apiEndpoints from './lib/insight-endpoints';
import apiEndpoints from './lib/coins';
import getKomodoRewards from './lib/get-komodo-rewards';
import {osName} from 'react-device-detect';
import {
Expand Down Expand Up @@ -135,34 +135,36 @@ class App extends React.Component {
}

checkExplorerEndpoints = async () => {
const getInfoRes = await Promise.all(apiEndpoints[this.state.coin].map((value, index) => {
const getInfoRes = await Promise.all(apiEndpoints[this.state.coin].api.map((value, index) => {
return getInfo(value);
}));
let isExplorerEndpointSet = false;

console.warn('checkExplorerEndpoints', getInfoRes);

for (let i = 0; i < apiEndpoints[this.state.coin].length; i++) {
for (let i = 0; i < apiEndpoints[this.state.coin].api.length; i++) {
if (getInfoRes[i] &&
getInfoRes[i].hasOwnProperty('info') &&
getInfoRes[i].info.hasOwnProperty('version')) {
console.warn('set api endpoint to ' + apiEndpoints[this.state.coin][i]);
setExplorerUrl(apiEndpoints[this.state.coin][i]);
console.warn('set api endpoint to ' + apiEndpoints[this.state.coin].api[i]);
setExplorerUrl(apiEndpoints[this.state.coin].api[i]);
isExplorerEndpointSet = true;

this.setState({
explorerEndpoint: apiEndpoints[this.state.coin][i],
explorerEndpoint: apiEndpoints[this.state.coin].api[i],
});

break;
}
}

if (!isExplorerEndpointSet) {
this.setState({
explorerEndpoint: false,
});
}
setTimeout(() => {
if (!isExplorerEndpointSet) {
this.setState({
explorerEndpoint: false,
});
}
}, 50);
};

resetState = () => {
Expand Down
19 changes: 15 additions & 4 deletions src/Transactions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';
import explorerLink from './lib/explorer-link';
import explorerLink from './lib/coins';
import {
isElectron,
shell,
} from './Electron';

const headings = [
'Type',
Expand Down Expand Up @@ -36,9 +40,16 @@ const Transactions = ({transactions, coin}) => {
{Number(tx.height) === -1 || Number(tx.height) === 0 ? '' : tx.date}
</td>
<td className="wb--all">
<a
target="_blank"
href={`${explorerLink[coin]}tx/${tx.txid}`}>{tx.txid}</a>
{isElectron &&
<a
href="#"
onClick={() => shell.openExternal(`${explorerLink[coin].explorer}tx/${tx.txid}`)}>{tx.txid}</a>
}
{!isElectron &&
<a
target="_blank"
href={`${explorerLink[coin].explorer}tx/${tx.txid}`}>{tx.txid}</a>
}
</td>
</tr>
))}
Expand Down
6 changes: 3 additions & 3 deletions src/TxidLink.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import explorerLink from './lib/explorer-link';
import explorerLink from './lib/coins';
import {
isElectron,
shell,
Expand All @@ -9,11 +9,11 @@ const TxidLink = ({txid, coin}) => !isElectron ? (
<a
target="_blank"
rel="noopener noreferrer"
href={`${explorerLink[coin]}tx/${txid}`}>{txid}</a>
href={`${explorerLink[coin].explorer}tx/${txid}`}>{txid}</a>
) : (
<a
href="#"
onClick={() => shell.openExternal(`${explorerLink[coin]}tx/${txid}`)}>{txid}</a>
onClick={() => shell.openExternal(`${explorerLink[coin].explorer}tx/${txid}`)}>{txid}</a>
);

export default TxidLink;
5 changes: 4 additions & 1 deletion src/lib/coins.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,25 @@ const coins = {
RICK: {
explorer: 'https://rick.kmd.dev/',
api: [
'https://rick.kmd.dev/insight-api-komodo/',
'https://explorer.komodoplatform.com:10000/rick/api/',
'https://rick.explorer.dexstats.info/insight-api-komodo/',
'https://rick.kmd.dev/insight-api-komodo/',
],
},
MORTY: {
explorer: 'https://morty.kmd.dev/',
api: [
'https://morty.kmd.dev/insight-api-komodo/',
'https://morty.explorer.dexstats.info/insight-api-komodo/',
'https://explorer.komodoplatform.com:10000/morty/api/',
],
},
VRSC: {
explorer: 'https://vrsc.explorer.dexstats.info/',
api: [
'https://explorer.komodoplatform.com:10000/vrsc/api/',
'https://vrsc.explorer.dexstats.info/insight-api-komodo/',
'https://insight.vrsc.0x03.services/insight-api-komodo/',
],
},
// DP: '',
Expand Down
52 changes: 0 additions & 52 deletions src/lib/explorer-link.js

This file was deleted.

69 changes: 0 additions & 69 deletions src/lib/insight-endpoints.js

This file was deleted.

Loading

0 comments on commit b3f0db2

Please sign in to comment.