Browse Source

native send condition

all-modes
pbca26 8 years ago
parent
commit
36fe422cd9
  1. 21
      react/src/actions/actionCreators.js
  2. 8
      react/src/components/dashboard/navbar.js
  3. 3
      react/src/components/dashboard/walletsNativeSend.js

21
react/src/actions/actionCreators.js

@ -1850,20 +1850,29 @@ export function iguanaHashHex(data) {
}
export function sendNativeTx(coin, _payload) {
const ajax_data_to_hex = '["' + _payload.sendFrom + '",[{"address":"' + _payload.sendTo + '","amount":' + (Number(_payload.amount) - Number(_payload.fee)) + '}]]';
var payload;
let ajax_data_to_hex;
let payload;
let _apiMethod;
if (_payload.addressType === 'public') {
_apiMethod = 'sendtoaddress';
ajax_data_to_hex = '["' + _payload.sendTo + '", ' + (Number(_payload.amount) - Number(_payload.fee)) + ']';
} else {
_apiMethod = 'z_sendmany';
ajax_data_to_hex = '["' + _payload.sendFrom + '",[{"address":"' + _payload.sendTo + '","amount":' + (Number(_payload.amount) - Number(_payload.fee)) + '}]]';
}
return dispatch => {
return iguanaHashHex(ajax_data_to_hex).then((hashHexJson) => {
console.log('sendNativeTx', hashHexJson);
if (getPassthruAgent(coin) == 'iguana') {
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
'function': 'z_sendmany',
'function': _apiMethod,
'hex': hashHexJson,
// 'immediate': 60000,
// 'timeout': 60000
@ -1873,7 +1882,7 @@ export function sendNativeTx(coin, _payload) {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': 'z_sendmany',
'function': _apiMethod,
'hex': hashHexJson,
// 'immediate': 60000,
// 'timeout': 60000
@ -2287,8 +2296,6 @@ function initNotaryNodesConSequence(nodes) {
'timeout': 10000
};
console.log('initNotaryNodesConSequence', nodes);
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.basiliskPort : Config.iguanaCorePort) + '/api/dex/getinfo?userpass=' + ('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth')) + '&symbol=' + node, {
method: 'GET',

8
react/src/components/dashboard/navbar.js

@ -99,7 +99,9 @@ class Navbar extends React.Component {
<i className="site-menu-icon" aria-hidden="true"></i> EasyDEX
</a>
</li>
<li className={ this.props.Dashboard.activeSection === 'jumblr' ? 'active nav-top-menu' : 'nav-top-menu' } style={{ display: 'none' }}>
<li
className={ this.props.Dashboard.activeSection === 'jumblr' ? 'active nav-top-menu' : 'nav-top-menu' }
style={{ display: 'none' }}>
<a id="nav-jumblr" onClick={ () => this.dashboardChangeSection('jumblr') }>
<i className="site-menu-icon" aria-hidden="true"></i> Jumblr
</a>
@ -128,7 +130,9 @@ class Navbar extends React.Component {
</span>
</a>
</li>
<li className={ 'dropdown' + (this.state.openDropMenu ? ' open' : '') } onClick={ this.openDropMenu }>
<li
className={ 'dropdown' + (this.state.openDropMenu ? ' open' : '') }
onClick={ this.openDropMenu }>
<a className="navbar-avatar dropdown-toggle" aria-expanded="false" role="button">
<span className="avatar avatar-online">
<img src="assets/images/iguana_profile_02.jpg" alt="iguana profile pic" />

3
react/src/components/dashboard/walletsNativeSend.js

@ -227,7 +227,8 @@ class WalletsNativeSend extends React.Component {
.then(function(json) {
const reply = json.Answer;
if (reply && reply.length) {
if (reply &&
reply.length) {
for (let i = 0; i < reply.length; i++) {
const _address = reply[i].data.split(' ');
const coin = _address[0].replace('"oa1:', '');

Loading…
Cancel
Save