Browse Source

new addcoin native only pipeline

all-modes
pbca26 7 years ago
parent
commit
21d432e431
  1. 57
      react/src/actions/actions/addCoin.js
  2. 22
      react/src/actions/actions/dexCoins.js
  3. 22
      react/src/actions/actions/walletAuth.js
  4. 6
      react/src/components/login/login.js
  5. 2
      react/src/components/main/main.js
  6. 3
      react/src/config.js

57
react/src/actions/actions/addCoin.js

@ -4,7 +4,8 @@ import {
Config,
toggleAddcoinModal,
getDexCoins,
startIguanaInstance
startIguanaInstance,
iguanaWalletPassphraseState
} from '../actionCreators';
import {
logGuiHttp,
@ -234,15 +235,24 @@ export function shepherdHerd(coin, mode, path) {
);
})
.then(response => response.json())
.then(
json => dispatch(
iguanaAddCoin(
coin,
mode,
acData
)
)
);
.then(function(json) {
if (Config.iguanaLessMode) {
dispatch(
addCoinResult(coin, mode)
);
dispatch(
iguanaActiveHandleBypass()
);
} else {
dispatch(
iguanaAddCoin(
coin,
mode,
acData
)
);
}
});
}
}
@ -298,6 +308,33 @@ export function _shepherdGetConfig(coin, mode) {
}
}
export function iguanaActiveHandleBypass() {
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
})
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'Failed to iguanaActiveHandleBypass',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(
json => dispatch(
iguanaWalletPassphraseState(json, dispatch)
)
)
}
}
export function shepherdGetConfig(coin, mode) {
if (coin === 'KMD' &&
mode === '-1') {

22
react/src/actions/actions/dexCoins.js

@ -21,15 +21,29 @@ export function getDexCoins() {
'timestamp': _timestamp,
'function': 'getDexCoins',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
let _fetchConfig = {
method: 'POST',
body: JSON.stringify(_payload)
})
body: JSON.stringify(_payload),
};
if (Config.iguanaLessMode) {
_fetchConfig = {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
};
}
return fetch(
Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({

22
react/src/actions/actions/walletAuth.js

@ -185,15 +185,29 @@ export function iguanaActiveHandle(getMainAddress) {
'timestamp': _timestamp,
'function': 'iguanaActiveHandle',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
let _fetchConfig = {
method: 'POST',
body: JSON.stringify(_payload),
})
};
if (Config.iguanaLessMode) {
_fetchConfig = {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
};
}
return fetch(
Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
@ -222,7 +236,7 @@ export function iguanaActiveHandle(getMainAddress) {
}
}
function iguanaWalletPassphraseState(json, dispatch) {
export function iguanaWalletPassphraseState(json, dispatch) {
sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json));
dispatch(
triggerToaster(

6
react/src/components/login/login.js

@ -194,7 +194,7 @@ class Login extends React.Component {
return null;
}
const passPhraseWords = passPhrase.split(" ");
const passPhraseWords = passPhrase.split(' ');
if (!PassPhraseGenerator.arePassPhraseWordsValid(passPhraseWords))
return null;
@ -246,7 +246,7 @@ class Login extends React.Component {
});
}
// TODO:
// TODO:
// 1) disable register btn if seed or seed conf is incorrect
// 2) display explicit custom seed validation message
handleRegisterWallet() {
@ -266,7 +266,7 @@ class Login extends React.Component {
isSeedConfirmError: !enteredSeedsMatch ? true : false,
isSeedBlank: isSeedBlank ? true : false,
});
if (enteredSeedsMatch && !isSeedBlank && _customSeed !== null) {
this.toggleSeedBackupModal();
}

2
react/src/components/main/main.js

@ -1,9 +1,9 @@
import React from 'react';
import Config from '../../config';
import WalletMain from './walletMain';
import { iguanaSetRPCAuth } from '../../util/auth';
import Store from '../../store';
import {
Config,
getDexCoins,
iguanaActiveHandle
} from '../../actions/actionCreators';

3
react/src/config.js

@ -9,5 +9,6 @@ module.exports = {
cli: {
passthru: true,
default: true
}
},
iguanaLessMode: true,
};

Loading…
Cancel
Save