|
|
@ -106,20 +106,46 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (Config.cli.default && |
|
|
|
mode === 'native') { |
|
|
|
payload = { |
|
|
|
mode: null, |
|
|
|
chain: coin, |
|
|
|
cmd: payload.function, |
|
|
|
params: [""] |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
const _timestamp = Date.now(); |
|
|
|
dispatch(logGuiHttp({ |
|
|
|
'timestamp': _timestamp, |
|
|
|
'function': 'getKMDAddressesNative', |
|
|
|
'type': 'post', |
|
|
|
'url': `http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
'payload': payload, |
|
|
|
'status': 'pending', |
|
|
|
})); |
|
|
|
|
|
|
|
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { |
|
|
|
let _fetchConfig = { |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify(payload), |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
if (Config.cli.default === true && |
|
|
|
mode === 'native') { |
|
|
|
_fetchConfig = { |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
body: JSON.stringify({ 'payload': payload }), |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
fetch( |
|
|
|
Config.cli.default && mode === 'native' ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
_fetchConfig |
|
|
|
) |
|
|
|
.catch(function(error) { |
|
|
|
console.log(error); |
|
|
|
dispatch(logGuiHttp({ |
|
|
@ -142,7 +168,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { |
|
|
|
'status': 'success', |
|
|
|
'response': json, |
|
|
|
})); |
|
|
|
resolve(json); |
|
|
|
resolve(Config.cli.default && mode === 'native' ? json.result : json); |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
@ -286,16 +312,40 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { |
|
|
|
'timestamp': _timestamp, |
|
|
|
'function': 'getKMDAddressesNative+ZBalance', |
|
|
|
'type': 'post', |
|
|
|
'url': `http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
'payload': payload, |
|
|
|
'status': 'pending', |
|
|
|
})); |
|
|
|
|
|
|
|
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
{ |
|
|
|
let _fetchConfig = { |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify(payload), |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
if (Config.cli.default === true && |
|
|
|
mode === 'native') { |
|
|
|
payload = { |
|
|
|
mode: null, |
|
|
|
chain: coin, |
|
|
|
cmd: 'z_getbalance', |
|
|
|
params: [ |
|
|
|
_address |
|
|
|
] |
|
|
|
}; |
|
|
|
|
|
|
|
_fetchConfig = { |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
body: JSON.stringify({ 'payload': payload }), |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
fetch( |
|
|
|
Config.cli.default && mode === 'native' ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, |
|
|
|
_fetchConfig |
|
|
|
) |
|
|
|
.catch(function(error) { |
|
|
|
console.log(error); |
|
|
|
dispatch(logGuiHttp({ |
|
|
@ -329,6 +379,10 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { |
|
|
|
) |
|
|
|
); |
|
|
|
} else { |
|
|
|
if (Config.cli.default && |
|
|
|
mode === 'native') { |
|
|
|
json = json.result; |
|
|
|
} |
|
|
|
resolve(json); |
|
|
|
newAddressArray[1][index] = { |
|
|
|
address: _address, |
|
|
@ -449,10 +503,33 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { |
|
|
|
'status': 'pending', |
|
|
|
})); |
|
|
|
|
|
|
|
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, { |
|
|
|
let _fetchConfig = { |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify(payload), |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
if (Config.cli.default === true && |
|
|
|
mode === 'native') { |
|
|
|
payload = { |
|
|
|
mode: null, |
|
|
|
chain: coin, |
|
|
|
cmd: payload.function, |
|
|
|
params: payload.params |
|
|
|
}; |
|
|
|
|
|
|
|
_fetchConfig = { |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
body: JSON.stringify({ 'payload': payload }), |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
fetch( |
|
|
|
Config.cli.default && mode === 'native' ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, |
|
|
|
_fetchConfig |
|
|
|
) |
|
|
|
.catch(function(error) { |
|
|
|
console.log(error); |
|
|
|
dispatch(logGuiHttp({ |
|
|
@ -470,6 +547,10 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { |
|
|
|
}) |
|
|
|
.then(response => response.json()) |
|
|
|
.then(function(json) { |
|
|
|
if (Config.cli.default && |
|
|
|
mode === 'native') { |
|
|
|
json = json.result; |
|
|
|
} |
|
|
|
dispatch(logGuiHttp({ |
|
|
|
'timestamp': _timestamp, |
|
|
|
'status': 'success', |
|
|
|