Skip to content

Commit

Permalink
Merge d0ba332 into e56959e
Browse files Browse the repository at this point in the history
  • Loading branch information
pbca26 authored May 31, 2021
2 parents e56959e + d0ba332 commit 102d07a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ jobs:
- name: Build Electron App
run: |
sudo apt-get install libusb-1.0-0-dev
sudo apt install libudev-dev
cd electron
npm install
npm run dist
Expand Down
3 changes: 3 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ module.exports = {
path.resolve(paths.appNodeModules, 'lru-cache'),
path.resolve(paths.appNodeModules, 'yallist'),
path.resolve(paths.appNodeModules, 'u2f-api'),
path.resolve(paths.appNodeModules, 'asn1.js'),
path.resolve(paths.appNodeModules, 'bech32'),
path.resolve(paths.appNodeModules, '@trezor/utxo-lib'),
path.resolve(paths.appNodeModules, '@ledgerhq/hw-app-btc'),
path.resolve(paths.appNodeModules, '@ledgerhq/hw-transport/lib-es'),
path.resolve(paths.appNodeModules, '@ledgerhq/hw-transport-webusb/lib-es'),
Expand Down
2 changes: 1 addition & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Modules to control application life and create native browser window
require('babel-polyfill');
const TransportNodeHid = require('@ledgerhq/hw-transport-node-hid').default;
const TransportNodeHid = require('@ledgerhq/hw-transport-node-hid-noevents').default;
const AppBtc = require('@ledgerhq/hw-app-btc').default;

const {
Expand Down
4 changes: 2 additions & 2 deletions electron/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "hw-kmd-wallet-electron",
"version": "0.2.5",
"version": "0.2.6",
"description": "Komodo Hardware Wallet Electron App",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@ledgerhq/hw-app-btc": "^5.16.0",
"@ledgerhq/hw-transport-node-hid": "^4.38.6",
"@ledgerhq/hw-transport-node-hid-noevents": "^5.51.1",
"babel-polyfill": "^6.26.0"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hw-kmd-wallet",
"version": "0.2.5",
"version": "0.2.6",
"author": "Luke Childs <[email protected]> (http://lukechilds.co.uk), Komodo Platform (https://komodoplatform.com)",
"repository": "pbca26/hw-kmd-wallet",
"homepage": "https://pbca26.github.io/hw-kmd-wallet",
Expand Down Expand Up @@ -35,6 +35,7 @@
"@ledgerhq/hw-transport-webhid": "^5.34.0",
"@ledgerhq/hw-transport-webusb": "^5.34.1",
"@ledgerhq/hw-transport-web-ble": "^4.78.0",
"@trezor/utxo-lib": "^0.1.2",
"babel-polyfill": "^6.26.0",
"bip32-path": "^0.4.2",
"bitcoinjs-lib": "^4.0.2",
Expand Down
11 changes: 10 additions & 1 deletion src/lib/account-discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import bitcoin from 'bitcoinjs-lib';
import parseHistory from './history-parser';
import asyncForEach from './async';
import {airDropCoins} from './coins';
import TrezorUtxoLib from '@trezor/utxo-lib';

let pubKeysCache = {};
let gapLimit = 20;
Expand Down Expand Up @@ -93,7 +94,7 @@ const getAddressUtxos = async addresses => {
return await Promise.all(utxos.map(async utxo => {
const addressInfo = addresses.find(a => a.address === utxo.address);

const [
let [
{rawtx},
{
locktime,
Expand All @@ -108,6 +109,14 @@ const getAddressUtxos = async addresses => {
blockchain.getTransaction(utxo.txid)
]);

// fix for insight explorer value rounding issue
TrezorUtxoLib.Transaction.USE_STRING_VALUES = true;
const decodeFromRaw = TrezorUtxoLib.Transaction.fromHex(rawtx, TrezorUtxoLib.networks.komodo);

for (let i = 0; i < vout.length; i++) {
vout[i].satoshis = parseInt(decodeFromRaw.outs[i].value);
}

return {
id: `${utxo.txid}:${utxo.vout}`,
...addressInfo,
Expand Down
7 changes: 7 additions & 0 deletions src/lib/coins.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ const coins = {
explorer: 'https://soulja.explorer.dexstats.info/',
api: ['https://soulja.explorer.dexstats.info/insight-api-komodo/'],
},
GLEEC: {
explorer: 'https://gleec.xyz/',
api: [
'https://gleec.explorer.dexstats.info/insight-api-komodo/',
'https://gleec.xyz/insight-api-komodo/',
],
},
// DP: '',
// SHARK: '',
// EQL: '',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/trezor.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const createTransaction = async (utxos, outputs, isKMD) => {
}),
bin_outputs: refTx.outputs.map((output) => {
return {
amount: Number((Number(output.value).toFixed(8) * 100000000).toFixed(0)),
amount: output.hasOwnProperty('satoshis') ? output.satoshis.toString() : output.value.replace('.', ''),
script_pubkey: output.scriptPubKey.hex,
};
}),
Expand Down

0 comments on commit 102d07a

Please sign in to comment.