Browse Source

Merge pull request #3 from KomodoPlatform/dev

Dev
dev
siulynot 7 years ago
committed by GitHub
parent
commit
5c3f6b447c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      main.js
  2. 5
      package.json
  3. 2
      routes/appConfig.js
  4. 15
      routes/electrumjs/electrumServers.js
  5. 1
      routes/ports.js
  6. 7
      routes/shepherd/auth.js
  7. 2
      routes/shepherd/dashboardUpdate.js
  8. 11
      routes/shepherd/electrum/keys.js
  9. 2
      routes/shepherd/electrum/merkle.js
  10. 4
      routes/shepherd/electrum/network.js
  11. 7
      routes/shepherd/electrum/transactions.js
  12. 4
      version
  13. 2
      version_build

2
main.js

@ -288,8 +288,8 @@ function createWindow(status, hideLoadingWindow) {
firstLoginPH: null,
secondaryLoginPH: null,
};
mainWindow.nnVoteChain = 'VOTE2018';
mainWindow.checkStringEntropy = shepherd.checkStringEntropy;
/*for (let i = 0; i < process.argv.length; i++) {
if (process.argv[i].indexOf('nvote') > -1) {

5
package.json

@ -1,7 +1,7 @@
{
"name": "agama-app",
"productName": "Agama",
"version": "0.2.30",
"version": "0.2.32",
"description": "Agama Wallet Desktop App",
"main": "main.js",
"scripts": {
@ -32,7 +32,7 @@
"async": "^2.6.0",
"bigi": "^1.4.2",
"bip39": "^2.4.0",
"bitcoinforksjs-lib": "git://github.com/bitcoinjs/bitcoinjs-lib#opt-in-bitcoincash-sighash",
"bitcoinforksjs-lib": "git://github.com/SuperNETorg/bitcoinjs-lib#opt-in-bitcoincash-sighash",
"bitcoinjs-lib": "git://github.com/SuperNETorg/bitcoinjs-lib",
"bitcoinjs-lib-zcash": "git://github.com/pbca26/bitcoinjs-lib#zcash",
"bitcoinjs-lib-pos": "git://github.com/KomodoPlatform/bitcoinjs-lib-pos",
@ -48,6 +48,7 @@
"js-sha256": "^0.7.1",
"marketmaker": "git://github.com/pbca26/marketmaker",
"nodejs-aes256": "^1.0.1",
"passwd-strength": "https://github.com/pbca26/passwd-strength",
"portscanner": "^2.1.1",
"ps-node": "^0.1.5",
"remote-file-size": "^3.0.3",

2
routes/appConfig.js

@ -71,7 +71,7 @@ const appConfig = {
experimentalFeatures: {
display: true,
initDisplay: true,
displayName: 'Enable experimental features',
displayName: 'Enable advanced features',
type: 'boolean',
},
dataDir: {

15
routes/electrumjs/electrumServers.js

@ -1,4 +1,15 @@
let electrumServers = {
bntn: { // !estimatefee
address: 'electrum1.cipig.net',
port: 10026,
proto: 'tcp',
txfee: 10000,
abbr: 'BNTN',
serverList: [
'electrum1.cipig.net:10026',
'electrum2.cipig.net:10026'
],
},
oot: { // !estimatefee
address: 'electrum1.utrum.io',
port: 10088,
@ -83,8 +94,8 @@ let electrumServers = {
txfee: 10000,
abbr: 'DNR',
serverList: [
'173.254.244.119:50001',
'173.254.244.122:50001'
'144.202.95.223:50001',
'45.77.137.111:50001'
],
},
hodl: { // !estimatefee

1
routes/ports.js

@ -30,6 +30,7 @@ const assetChainPorts = {
'VOTE2018': '15488',
'NINJA': '8427',
'BTCH': '8800',
'BNTN': '14358',
};
module.exports = assetChainPorts;

7
routes/shepherd/auth.js

@ -1,3 +1,5 @@
const passwdStrength = require('passwd-strength');
module.exports = (shepherd) => {
/*
* type: GET
@ -43,5 +45,10 @@ module.exports = (shepherd) => {
}
};
shepherd.checkStringEntropy = (str) => {
// https://tools.ietf.org/html/rfc4086#page-35
return passwdStrength(str) < 29 ? false : true;
};
return shepherd;
};

2
routes/shepherd/dashboardUpdate.js

@ -152,7 +152,7 @@ module.exports = (shepherd) => {
amount: sum,
spendable: spendableSum,
canspend,
type: a === 0 ? 'public': 'private',
type: a === 0 ? 'public' : 'private',
};
}
}

11
routes/shepherd/electrum/keys.js

@ -155,7 +155,7 @@ module.exports = (shepherd) => {
const _b58check = shepherd.isZcash(network.toLowerCase()) ? bitcoinZcash.address.fromBase58Check(address) : bitcoin.address.fromBase58Check(address);
if (_b58check.version === _network.pubKeyHash ||
(address[0] === 'b' && shepherd.getNetworkData(network.toLowerCase()).pubKeyHash === 60)) { // kmd multisig edge case
_b58check.version === _network.scriptHash) {
return true;
} else {
return false;
@ -165,6 +165,15 @@ module.exports = (shepherd) => {
}
};
shepherd.get('/electrum/keys/validateaddress', (req, res, next) => {
const successObj = {
msg: 'success',
result: shepherd.addressVersionCheck(req.query.network, req.query.address),
};
res.end(JSON.stringify(successObj));
});
shepherd.post('/electrum/keys', (req, res, next) => {
if (shepherd.checkToken(req.body.token)) {
let _matchingKeyPairs = 0;

2
routes/shepherd/electrum/merkle.js

@ -163,4 +163,4 @@ module.exports = (shepherd) => {
});
return shepherd;
};
};

4
routes/shepherd/electrum/network.js

@ -89,6 +89,7 @@ module.exports = (shepherd) => {
coin === 'VOTE2018' ||
coin === 'NINJA' ||
coin === 'KOMODO' ||
coin === 'BNTN' ||
coinUC === 'SUPERNET' ||
coinUC === 'REVS' ||
coinUC === 'SUPERNET' ||
@ -116,7 +117,8 @@ module.exports = (shepherd) => {
coinUC === 'VOTE2018' ||
coinUC === 'NINJA' ||
coinUC === 'KMD' ||
coinUC === 'KOMODO') {
coinUC === 'KOMODO' ||
coinUC === 'BNTN') {
return shepherd.electrumJSNetworks.komodo;
} else {
return shepherd.electrumJSNetworks[network];

7
routes/shepherd/electrum/transactions.js

@ -1,6 +1,8 @@
const async = require('async');
const Promise = require('bluebird');
const MAX_VOUT_LENGTH = 10;
module.exports = (shepherd) => {
shepherd.sortTransactions = (transactions, sortBy) => {
return transactions.sort((b, a) => {
@ -143,7 +145,7 @@ module.exports = (shepherd) => {
const checkLoop = () => {
index2++;
if (index2 === decodedTx.inputs.length) {
if (index2 === decodedTx.inputs.length || index2 === MAX_VOUT_LENGTH) {
shepherd.log(`tx history decode inputs ${decodedTx.inputs.length} | ${index2} => main callback`, true);
const _parsedTx = {
network: decodedTx.network,
@ -199,8 +201,9 @@ module.exports = (shepherd) => {
callback();
shepherd.log(`tx history main loop ${json.length} | ${index}`, true);
} else {
callback2();
}
callback2();
}
if (_decodedInput.txid !== '0000000000000000000000000000000000000000000000000000000000000000') {

4
version

@ -1,3 +1,3 @@
version=0.2.31
version=0.2.32
type=beta
minversion=0.2.31
minversion=0.2.32

2
version_build

@ -1 +1 @@
0.2.31-beta
0.2.32-beta
Loading…
Cancel
Save