Browse Source

merge fix

all-modes
pbca26 8 years ago
parent
commit
11fc542fee
  1. 9
      react/src/actions/addCoin.js
  2. 70
      react/src/actions/addressBalance.js
  3. 4
      react/src/actions/atomic.js
  4. 38
      react/src/actions/basiliskCache.js
  5. 12
      react/src/actions/basiliskProcessAddress.js
  6. 2
      react/src/actions/basiliskTxHistory.js
  7. 4
      react/src/actions/coinList.js
  8. 6
      react/src/actions/createWallet.js
  9. 6
      react/src/actions/dexCoins.js
  10. 12
      react/src/actions/edexBalance.js
  11. 8
      react/src/actions/edexGetTx.js
  12. 6
      react/src/actions/fullTxHistory.js
  13. 6
      react/src/actions/getAddrByAccount.js
  14. 6
      react/src/actions/iguanaHelpers.js
  15. 6
      react/src/actions/iguanaInstance.js
  16. 4
      react/src/actions/log.js
  17. 6
      react/src/actions/logout.js
  18. 8
      react/src/actions/nativeBalance.js
  19. 16
      react/src/actions/nativeNewAddress.js
  20. 55
      react/src/actions/nativeSend.js
  21. 10
      react/src/actions/nativeSyncInfo.js
  22. 8
      react/src/actions/nativeTxHistory.js
  23. 20
      react/src/actions/notary.js
  24. 31
      react/src/actions/sendFullBasilisk.js
  25. 28
      react/src/actions/settings.js
  26. 6
      react/src/actions/syncInfo.js
  27. 4
      react/src/actions/syncOnly.js
  28. 2
      react/src/actions/sysInfo.js
  29. 24
      react/src/actions/walletAuth.js
  30. 2
      react/src/components/addcoin/addcoin.js
  31. 30
      react/src/components/addcoin/payload.js
  32. 6
      react/src/components/dashboard/atomic.js
  33. 315
      react/src/components/dashboard/coinTile.js
  34. 17
      react/src/components/dashboard/coinTileItem.js
  35. 11
      react/src/components/dashboard/sendCoin.js
  36. 5
      react/src/components/dashboard/settings.js
  37. 108
      react/src/components/dashboard/syncOnly.js
  38. 2
      react/src/components/dashboard/walletsBalance.js
  39. 4
      react/src/components/dashboard/walletsBasiliskConnection.js
  40. 10
      react/src/components/dashboard/walletsData.js
  41. 4
      react/src/components/dashboard/walletsHeader.js
  42. 4
      react/src/components/dashboard/walletsNative.js
  43. 56
      react/src/components/dashboard/walletsNativeSend.js
  44. 2
      react/src/components/dashboard/walletsNativeSyncProgress.js
  45. 8
      react/src/components/dashboard/walletsNativeTxHistory.js
  46. 28
      react/src/components/login/login.js
  47. 4
      react/src/components/main/main.js
  48. 5
      react/src/components/toaster/toaster.js
  49. 316
      react/src/util/coinHelper.js

9
react/src/actions/addCoin.js

@ -4,7 +4,8 @@ import {
triggerToaster,
Config,
toggleAddcoinModal,
getDexCoins
getDexCoins,
startIguanaInstance
} from './actionCreators';
import {
logGuiHttp,
@ -126,7 +127,7 @@ export function shepherdHerd(coin, mode, path) {
'ac_options': [
'-daemon=0',
'-server',
'-ac_name=' + coin,
`-ac_name=${coin}`,
'-addnode=78.47.196.146'
]
};
@ -220,7 +221,7 @@ export function shepherdGetConfig(coin, mode) {
if (coin === 'KMD' &&
mode === '-1') {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -236,7 +237,7 @@ export function shepherdGetConfig(coin, mode) {
}
} else {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

70
react/src/actions/addressBalance.js

@ -28,43 +28,43 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
Promise.all(type.map((_type, index) => {
return new Promise((resolve, reject) => {
let payload,
ajax_data_to_hex = '',
ajax_function_input = '',
tmplistaddr_hex_input = '',
passthru_agent = getPassthruAgent(coin),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
ajaxFunctionInput = '',
tmplistaddrHexInput = '',
passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (_type === 'public') {
ajax_function_input = 'getaddressesbyaccount';
tmplistaddr_hex_input = '222200';
ajaxFunctionInput = 'getaddressesbyaccount';
tmplistaddrHexInput = '222200';
}
if (_type === 'private') {
ajax_function_input = 'z_listaddresses';
tmplistaddr_hex_input = '';
ajaxFunctionInput = 'z_listaddresses';
tmplistaddrHexInput = '';
}
if (passthru_agent === 'iguana') {
if (passthruAgent === 'iguana') {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'asset': coin,
'function': ajax_function_input,
'hex': tmplistaddr_hex_input,
'function': ajaxFunctionInput,
'hex': tmplistaddrHexInput,
};
} else {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'function': ajax_function_input,
'hex': tmplistaddr_hex_input,
'function': ajaxFunctionInput,
'hex': tmplistaddrHexInput,
};
}
if (mode === 'full' || mode === 'basilisk') {
if (mode === 'full' ||
mode === 'basilisk') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount',
@ -75,7 +75,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (mode === 'basilisk') {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -99,12 +99,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': _timestamp,
'function': 'getKMDAddressesNative',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -131,14 +131,14 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}))
.then(result => {
// TODO: split into 2 functions
const passthru_agent = getPassthruAgent(coin),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
const passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
let payload;
if (passthru_agent === 'iguana') {
if (passthruAgent === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': passthru_agent,
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': passthruAgent,
'method': 'passthru',
'asset': coin,
'function': 'listunspent',
@ -146,8 +146,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': passthru_agent,
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': passthruAgent,
'method': 'passthru',
'function': 'listunspent',
'hex': '',
@ -156,7 +156,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (mode === 'full') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'listunspent',
'params': [
@ -169,7 +169,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
// if api cache option is off
if (mode === 'basilisk') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'listunspent',
'address': currentAddress,
@ -247,7 +247,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (mode === 'basilisk') {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -271,12 +271,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + (Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort), {
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -312,12 +312,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + (Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort), {
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, {
method: 'POST',
body: JSON.stringify(payload),
})

4
react/src/actions/atomic.js

@ -15,12 +15,12 @@ export function atomic(payload) {
'timestamp': _timestamp,
'function': 'atomic',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

38
react/src/actions/basiliskCache.js

@ -10,7 +10,7 @@ import {
export function deleteCacheFile(_payload) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom?', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
@ -30,7 +30,7 @@ export function getCacheFile(pubkey) {
const _pubkey = pubkey || JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom?filename=' + _pubkey, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom?filename=${_pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -46,16 +46,16 @@ export function getCacheFile(pubkey) {
}
export function fetchNewCacheData(_payload) {
const _userpass = '?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
_pubkey = '&pubkey=' + _payload.pubkey,
const _userpass = `?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
_pubkey = `&pubkey=${_payload.pubkey}`,
_route = _payload.allcoins ? 'cache-all' : 'cache-one',
_coin = '&coin=' + _payload.coin,
_calls = '&calls=' + _payload.calls,
_address = _payload.address ? ('&address=' + _payload.address) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? '&port=' + (Config.iguanaCorePort + 1) : '';
_coin = `&coin=${_payload.coin}`,
_calls = `&calls=${_payload.calls}`,
_address = _payload.address ? (`&address=${_payload.address}`) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? `&port=${Config.iguanaCorePort + 1}` : '';
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/' + _route + _userpass + _pubkey + _coin + _calls + _address + _iguanaInstancePort, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/${_route}${_userpass}${_pubkey}${_coin}${_calls}${_address}${_iguanaInstancePort}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -72,7 +72,7 @@ export function fetchNewCacheData(_payload) {
export function getShepherdCache(pubkey, coin) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -108,16 +108,16 @@ function getShepherdCacheState(json, pubkey, coin) {
}
export function fetchUtxoCache(_payload) {
const _userpass = '?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
_pubkey = '&pubkey=' + _payload.pubkey,
const _userpass = `?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
_pubkey = `&pubkey=${_payload.pubkey}`,
_route = _payload.allcoins ? 'cache-all' : 'cache-one',
_coin = '&coin=' + _payload.coin,
_calls = '&calls=' + _payload.calls,
_address = _payload.address ? ('&address=' + _payload.address) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? '&port=' + (Config.iguanaCorePort + 1) : '';
_coin = `&coin=${_payload.coin}`,
_calls = `&calls=${_payload.calls}`,
_address = _payload.address ? (`&address=${_payload.address}`) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? `&port=${Config.iguanaCorePort + 1}` : '';
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/' + _route + _userpass + _pubkey + _coin + _calls + _address + _iguanaInstancePort, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/${_route}${_userpass}${_pubkey}${_coin}${_calls}${_address}${_iguanaInstancePort}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -134,7 +134,7 @@ export function fetchUtxoCache(_payload) {
export function shepherdGroomPost(_filename, _payload) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom/', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -155,7 +155,7 @@ export function shepherdGroomPost(_filename, _payload) {
export function shepherdGroomPostPromise(_filename, _payload) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom/', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

12
react/src/actions/basiliskProcessAddress.js

@ -11,7 +11,7 @@ import {
export function checkAddressBasilisk(coin, address) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'checkaddress',
'address': address,
@ -24,12 +24,12 @@ export function checkAddressBasilisk(coin, address) {
'timestamp': _timestamp,
'function': 'checkAddressBasilisk',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort), {
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -73,7 +73,7 @@ function checkAddressBasiliskHandle(json) {
export function validateAddressBasilisk(coin, address) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'validateaddress',
'address': address,
@ -86,12 +86,12 @@ export function validateAddressBasilisk(coin, address) {
'timestamp': _timestamp,
'function': 'validateAddressBasilisk',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort), {
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

2
react/src/actions/basiliskTxHistory.js

@ -13,7 +13,7 @@ export function getBasiliskTransactionsList(coin, address) {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

4
react/src/actions/coinList.js

@ -10,7 +10,7 @@ import {
export function shepherdGetCoinList() {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/coinslist', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coinslist`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -27,7 +27,7 @@ export function shepherdGetCoinList() {
export function shepherdPostCoinList(data) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/coinslist', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coinslist`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

6
react/src/actions/createWallet.js

@ -25,7 +25,7 @@ function createNewWalletState(json) {
export function createNewWallet(_passphrase) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': _passphrase,
@ -37,12 +37,12 @@ export function createNewWallet(_passphrase) {
'timestamp': _timestamp,
'function': 'createNewWallet',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

6
react/src/actions/dexCoins.js

@ -11,7 +11,7 @@ import {
export function getDexCoins() {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'InstantDEX',
'method': 'allcoins',
};
@ -22,12 +22,12 @@ export function getDexCoins() {
'timestamp': _timestamp,
'function': 'getDexCoins',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload)
})

12
react/src/actions/edexBalance.js

@ -10,7 +10,7 @@ import {
export function iguanaEdexBalance(coin) {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'getbalance',
'coin': coin,
@ -23,12 +23,12 @@ export function iguanaEdexBalance(coin) {
'timestamp': _timestamp,
'function': 'iguanaEdexBalance',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload),
})
@ -57,7 +57,7 @@ function iguanaEdexBalanceState(json) {
export function getDexBalance(coin, mode, addr) {
Promise.all(addr.map((_addr, index) => {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'listunspent',
'address': _addr,
@ -70,12 +70,12 @@ export function getDexBalance(coin, mode, addr) {
'timestamp': _timestamp,
'function': 'getDexBalance',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort), {
fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

8
react/src/actions/edexGetTx.js

@ -8,9 +8,9 @@ import {
guiLogState
} from './log';
export function edexGetTransaction(data) {
export function edexGetTransaction(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'symbol': data.coin,
'agent': 'dex',
'method': 'gettransaction',
@ -24,12 +24,12 @@ export function edexGetTransaction(data) {
'timestamp': _timestamp,
'function': 'edexGetTransaction',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

6
react/src/actions/fullTxHistory.js

@ -11,7 +11,7 @@ import {
export function getFullTransactionsList(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'listtransactions',
'params': [
@ -27,12 +27,12 @@ export function getFullTransactionsList(coin) {
'timestamp': _timestamp,
'function': 'getFullTransactionsList',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

6
react/src/actions/getAddrByAccount.js

@ -31,7 +31,7 @@ export function getAddressesByAccountState(json, coin, mode) {
export function getAddressesByAccount(coin, mode) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount',
@ -44,12 +44,12 @@ export function getAddressesByAccount(coin, mode) {
'timestamp': _timestamp,
'function': 'getAddressesByAccount',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

6
react/src/actions/iguanaHelpers.js

@ -22,7 +22,7 @@ export function getPassthruAgent(coin) {
export function iguanaHashHex(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'hash',
'method': 'hex',
'message': data,
@ -34,12 +34,12 @@ export function iguanaHashHex(data, dispatch) {
'timestamp': _timestamp,
'function': 'iguanaHashHex',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

6
react/src/actions/iguanaInstance.js

@ -10,7 +10,7 @@ import {
export function restartIguanaInstance(pmid) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/restart?pmid=' + pmid, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks/restart?pmid=${pmid}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -43,7 +43,7 @@ export function restartBasiliskInstance() {
export function startIguanaInstance(mode, coin) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -64,7 +64,7 @@ export function startIguanaInstance(mode, coin) {
export function getIguanaInstancesList() {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

4
react/src/actions/log.js

@ -9,7 +9,7 @@ export function logGuiHttp(payload) {
dispatch(guiLogState(payload));
// disabled for now
/*return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/guilog', {
/*return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/guilog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -26,7 +26,7 @@ export function logGuiHttp(payload) {
export function getAgamaLog(type) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getlog?type=' + type, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getlog?type=${type}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

6
react/src/actions/logout.js

@ -25,7 +25,7 @@ export function logout() {
function walletLock() {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'walletlock',
};
@ -36,12 +36,12 @@ function walletLock() {
'timestamp': _timestamp,
'function': 'walletLock',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

8
react/src/actions/nativeBalance.js

@ -15,7 +15,7 @@ export function getKMDBalanceTotal(coin) {
if (coin !== 'KMD' &&
coin !== 'ZEC') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'iguana',
'method': 'passthru',
'asset': coin,
@ -24,7 +24,7 @@ export function getKMDBalanceTotal(coin) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': 'z_gettotalbalance',
@ -38,12 +38,12 @@ export function getKMDBalanceTotal(coin) {
'timestamp': _timestamp,
'function': 'getKMDBalanceTotal',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

16
react/src/actions/nativeNewAddress.js

@ -19,22 +19,22 @@ function handleGetNewKMDAddresses(pubpriv, coin, dispatch) {
export function getNewKMDAddresses(coin, pubpriv) {
let payload,
ajax_function_input = '';
ajaxFunctionInput = '';
if (pubpriv === 'public') {
ajax_function_input = 'getnewaddress';
ajaxFunctionInput = 'getnewaddress';
}
if (pubpriv === 'private') {
ajax_function_input = 'z_getnewaddress';
ajaxFunctionInput = 'z_getnewaddress';
}
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
'function': ajax_function_input,
'function': ajaxFunctionInput,
'hex': '',
};
} else {
@ -42,7 +42,7 @@ export function getNewKMDAddresses(coin, pubpriv) {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': coin,
'method': 'passthru',
'function': ajax_function_input,
'function': ajaxFunctionInput,
'hex': '',
};
}
@ -53,12 +53,12 @@ export function getNewKMDAddresses(coin, pubpriv) {
'timestamp': _timestamp,
'function': 'getNewKMDAddresses',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

55
react/src/actions/nativeSend.js

@ -12,23 +12,23 @@ import {
} from './log';
export function sendNativeTx(coin, _payload) {
let ajax_data_to_hex;
let ajaxDataToHex;
let payload;
let _apiMethod;
if (_payload.addressType === 'public') {
_apiMethod = 'sendtoaddress';
ajax_data_to_hex = '["' + _payload.sendTo + '", ' + (Number(_payload.amount) - Number(_payload.fee)) + ']';
ajaxDataToHex = `["${_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)) + '}]]';
ajaxDataToHex = `["${_payload.sendFrom}", [{"address": "${_payload.sendTo}", "amount": ${Number(_payload.amount) - Number(_payload.fee)}}]]`;
}
return dispatch => {
return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => {
return iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => {
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
@ -37,7 +37,7 @@ export function sendNativeTx(coin, _payload) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': _apiMethod,
@ -50,12 +50,12 @@ export function sendNativeTx(coin, _payload) {
'timestamp': _timestamp,
'function': 'sendNativeTx',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -68,7 +68,16 @@ export function sendNativeTx(coin, _payload) {
}));
dispatch(triggerToaster(true, 'sendNativeTx', 'Error', 'error'));
})
.then(response => response.json())
.then(function(response) {
if (_apiMethod === 'sendtoaddress') {
const _response = response.text().then(function(text) { return text; });
console.log('native sendtoaddress', _response);
return _response;
} else {
return response.json();
}
})
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
@ -83,10 +92,6 @@ export function sendNativeTx(coin, _payload) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
}
})
.catch(function(ex) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
console.log('parsing failed', ex);
})
});
}
}
@ -99,29 +104,29 @@ export function getKMDOPIDState(json) {
}
export function getKMDOPID(opid, coin) {
let tmpopid_output = '',
ajax_data_to_hex;
let tmpopidOutput = '',
ajaxDataToHex;
if (opid === undefined) {
ajax_data_to_hex = null;
ajaxDataToHex = null;
} else {
ajax_data_to_hex = '["' + opid + '"]';
ajaxDataToHex = `["${opid}"]`;
}
return dispatch => {
return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => {
return iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => {
if (hashHexJson === '5b226e756c6c225d00') {
hashHexJson = '';
}
let payload,
passthru_agent = getPassthruAgent(coin),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (passthru_agent == 'iguana') {
if (passthruAgent == 'iguana') {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'asset': coin,
'function': 'z_getoperationstatus',
@ -130,7 +135,7 @@ export function getKMDOPID(opid, coin) {
} else {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'function': 'z_getoperationstatus',
'hex': hashHexJson,
@ -142,12 +147,12 @@ export function getKMDOPID(opid, coin) {
'timestamp': _timestamp,
'function': 'getKMDOPID',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

10
react/src/actions/nativeSyncInfo.js

@ -19,12 +19,12 @@ export function getSyncInfoNativeKMD(skipDebug) {
'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + coin,
'url': `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`,
'payload': '',
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + coin, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, {
method: 'GET',
})
.catch(function(error) {
@ -68,7 +68,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
export function getSyncInfoNative(coin, skipDebug) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
@ -82,12 +82,12 @@ export function getSyncInfoNative(coin, skipDebug) {
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

8
react/src/actions/nativeTxHistory.js

@ -15,7 +15,7 @@ export function getNativeTxHistory(coin) {
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'iguana',
'method': 'passthru',
'asset': coin,
@ -24,7 +24,7 @@ export function getNativeTxHistory(coin) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': 'listtransactions',
@ -38,12 +38,12 @@ export function getNativeTxHistory(coin) {
'timestamp': _timestamp,
'function': 'getNativeTxHistory',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

20
react/src/actions/notary.js

@ -13,7 +13,7 @@ function initNotaryNodesConSequence(nodes) {
return dispatch => {
Promise.all(nodes.map((node, index) => {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'getinfo',
'symbol': node,
@ -24,14 +24,14 @@ function initNotaryNodesConSequence(nodes) {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'initNotaryNodesConSequence+' + node,
'function': `initNotaryNodesConSequence+${node}`,
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort) + '/api/dex/getinfo?userpass=' + ('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth')) + '&symbol=' + node, {
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}/api/dex/getinfo?userpass=${('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'))}&symbol=${node}`, {
method: 'GET',
})
.catch(function(error) {
@ -41,7 +41,7 @@ function initNotaryNodesConSequence(nodes) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster(true, 'getInfoDexNode+' + node, 'Error', 'error'));
dispatch(triggerToaster(true, `getInfoDexNode+${node}`, 'Error', 'error'));
})
.then(response => response.json())
.then(json => {
@ -99,13 +99,13 @@ function connectAllNotaryNodes(json, dispatch) {
export function connectNotaries() {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dpow',
'method': 'notarychains',
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -133,7 +133,7 @@ function getDexNotariesState(json) {
export function getDexNotaries(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'getnotaries',
'symbol': coin,
@ -145,11 +145,11 @@ export function getDexNotaries(coin) {
'timestamp': _timestamp,
'function': 'getDexNotaries',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort), {
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

31
react/src/actions/sendFullBasilisk.js

@ -2,7 +2,8 @@ import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
triggerToaster,
Config
Config,
getDispatch
} from './actionCreators';
import {
logGuiHttp,
@ -11,7 +12,7 @@ import {
export function sendToAddress(coin, _payload) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'sendtoaddress',
'params': [
@ -28,12 +29,12 @@ export function sendToAddress(coin, _payload) {
'timestamp': _timestamp,
'function': 'sendToAddress',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -60,7 +61,7 @@ export function sendToAddress(coin, _payload) {
export function sendFromAddress(coin, _payload) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'sendfrom',
'params': [
@ -78,12 +79,12 @@ export function sendFromAddress(coin, _payload) {
'timestamp': _timestamp,
'function': 'sendFromAddress',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -108,9 +109,9 @@ export function sendFromAddress(coin, _payload) {
}
}
export function iguanaUTXORawTX(data) {
export function iguanaUTXORawTX(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'symbol': data.coin,
'agent': 'basilisk',
'method': 'utxorawtx',
@ -132,18 +133,18 @@ export function iguanaUTXORawTX(data) {
'timestamp': _timestamp,
'function': 'iguanaUTXORawTX',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
dispatch => dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
@ -162,9 +163,9 @@ export function iguanaUTXORawTX(data) {
});
}
export function dexSendRawTX(data) {
export function dexSendRawTX(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'sendrawtransaction',
'signedtx': data.signedtx,
@ -177,7 +178,7 @@ export function dexSendRawTX(data) {
'timestamp': _timestamp,
'function': 'dexSendRawTX',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));

28
react/src/actions/settings.js

@ -18,7 +18,7 @@ function getAppInfoState(json) {
export function getAppInfo() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appinfo', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appinfo`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -36,7 +36,7 @@ export function getAppInfo() {
export function settingsWifkeyState(json, coin) {
return {
type: storeType.GET_WIF_KEY,
wifkey: json[coin + 'wif'],
wifkey: json[`{$coin}wif`],
address: json[coin],
}
}
@ -63,7 +63,7 @@ function parseImportPrivKeyResponse(json, dispatch) {
export function importPrivKey(wifKey) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'method': 'importprivkey',
'params': [
wifKey,
@ -77,12 +77,12 @@ export function importPrivKey(wifKey) {
'timestamp': _timestamp,
'function': 'importPrivKey',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -129,7 +129,7 @@ export function getDebugLog(target, linesCount) {
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/debuglog', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/debuglog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -147,7 +147,7 @@ export function getDebugLog(target, linesCount) {
export function getPeersList(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'SuperNET',
'method': 'getpeers',
'activecoin': coin,
@ -159,12 +159,12 @@ export function getPeersList(coin) {
'timestamp': _timestamp,
'function': 'getPeersList',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -232,7 +232,7 @@ function addPeerNodeState(json, dispatch) {
export function addPeerNode(coin, ip) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'iguana',
'method': 'addnode',
'activecoin': coin,
@ -245,12 +245,12 @@ export function addPeerNode(coin, ip) {
'timestamp': _timestamp,
'function': 'addPeerNode',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -277,7 +277,7 @@ export function addPeerNode(coin, ip) {
export function saveAppConfig(_payload) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -302,7 +302,7 @@ function getAppConfigState(json) {
export function getAppConfig() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

6
react/src/actions/syncInfo.js

@ -25,7 +25,7 @@ function getSyncInfoState(json) {
export function getSyncInfo(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getinfo',
@ -37,12 +37,12 @@ export function getSyncInfo(coin) {
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

4
react/src/actions/syncOnly.js

@ -25,7 +25,7 @@ function getSyncOnlyForksState(json) {
export function getSyncOnlyForks() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/info/show', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks/info/show`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -42,7 +42,7 @@ export function getSyncOnlyForks() {
export function stopIguanaFork(pmid) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/stop?pmid=' + pmid, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks/stop?pmid=${pmid}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

2
react/src/actions/sysInfo.js

@ -10,7 +10,7 @@ import {
export function shepherdGetSysInfo() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/sysinfo', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/sysinfo`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

24
react/src/actions/walletAuth.js

@ -13,7 +13,7 @@ import {
export function encryptWallet(_passphrase, cb, coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': _passphrase,
@ -25,12 +25,12 @@ export function encryptWallet(_passphrase, cb, coin) {
'timestamp': _timestamp,
'function': 'encryptWallet',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -58,7 +58,7 @@ export function encryptWallet(_passphrase, cb, coin) {
export function walletPassphrase(_passphrase) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': _passphrase,
@ -71,12 +71,12 @@ export function walletPassphrase(_passphrase) {
'timestamp': _timestamp,
'function': 'walletpassphrase',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -101,7 +101,7 @@ export function walletPassphrase(_passphrase) {
export function iguanaWalletPassphrase(_passphrase) {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'handle': '',
'password': _passphrase,
'timeout': '2592000',
@ -115,12 +115,12 @@ export function iguanaWalletPassphrase(_passphrase) {
'timestamp': _timestamp,
'function': 'iguanaWalletPassphrase',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload),
})
@ -147,7 +147,7 @@ export function iguanaWalletPassphrase(_passphrase) {
export function iguanaActiveHandle(getMainAddress) {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'SuperNET',
'method': 'activehandle',
};
@ -158,12 +158,12 @@ export function iguanaActiveHandle(getMainAddress) {
'timestamp': _timestamp,
'function': 'iguanaActiveHandle',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload),
})

2
react/src/components/addcoin/addcoin.js

@ -245,7 +245,7 @@ class AddCoin extends React.Component {
const _coin = _item.selectedCoin || '';
items.push(
<div className={ this.state.coins.length > 1 ? 'multi' : 'single' } key={ 'add-coin-' + i }>
<div className={ this.state.coins.length > 1 ? 'multi' : 'single' } key={ `add-coin-${i}` }>
<div className="col-sm-8">
<div className="form-group">
<select

30
react/src/components/addcoin/payload.js

@ -133,9 +133,11 @@ export function startCrypto(confpath, coin, mode) {
var tmpinternval = 0,
AddCoinData = {},
tmpPendValue = 1, // TODO: hook up to shepherd sysinfo
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (coin !== 'BTC' && coin !== 'LTC' && coin !== 'DOGE') {
if (coin !== 'BTC' &&
coin !== 'LTC' &&
coin !== 'DOGE') {
tmpPendValue = parseInt(tmpPendValue) * 4;
}
@ -153,14 +155,14 @@ export function startCrypto(confpath, coin, mode) {
AddCoinData.GAME = {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"GAME","name":"GameCredits","netmagic":"fbc0b6db","p2p":40002,"rpc":40001,"pubval":38,"p2shval":5,"wifval":166,"txfee_satoshis":"100000","minconfirms":2,"genesishash":"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee","genesis":{"hashalgo":"scrypt","version":1,"timestamp":1392757140,"nBits":"1e0ffff0","nonce":2084565393,"merkle_root":"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429"},"alertpubkey":"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284","auxpow":1,"protover":80006,"isPoS":0};
AddCoinData.ZET = {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"ZET","name":"Zetacoin","netmagic":"fab503df","p2p":17333,"rpc":17335,"pubval":80,"p2shval":9,"wifval":224,"txfee_satoshis":"10000","minconfirms":2,"genesishash":"000006cab7aa2be2da91015902aa4458dd5fbb8778d175c36d429dc986f2bff4","genesis":{"version":1,"timestamp":1375548986,"nBits":"1e0fffff","nonce":2089928209,"merkle_root":"d0227b8c3e3d07bce9656b3d9e474f050d23458aaead93357dcfdac9ab9b79f9"},"alertpubkey":"045337216002ca6a71d63edf062895417610a723d453e722bf4728996c58661cdac3d4dec5cecd449b9086e9602b35cc726a9e0163e1a4d40f521fbdaebb674658"};
if ( coin === 'KMD' ) {
if ( mode === '-1' ) {
if (coin === 'KMD') {
if (mode === '-1') {
AddCoinData.KMD = {"coin":"KMD","conf":"komodo.conf","path":confpath,"unitval":"20","zcash":1,"RELAY":-1,"VALIDATE":0,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","startpend":8,"endpend":8,"services":0,"maxpeers":32,"newcoin":"KMD","name":"Komodo","hasheaders":1,"useaddmultisig":0,"netmagic":"f9eee48d","p2p":7770,"rpc":7771,"pubval":60,"p2shval":85,"wifval":188,"txfee_satoshis":"10000","isPoS":0,"minoutput":10000,"minconfirms":2,"genesishash":"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71","protover":170002,"genesisblock":"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2","debug":0}
} else {
AddCoinData.KMD = {'userpass':tmpIguanaRPCAuth,"unitval":"20","zcash":1,"RELAY":mode,"VALIDATE":mode,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"maxpeers":32,"newcoin":"KMD","name":"Komodo","hasheaders":1,"useaddmultisig":0,"netmagic":"f9eee48d","p2p":7770,"rpc":7771,"pubval":60,"p2shval":85,"wifval":188,"txfee_satoshis":"10000","isPoS":0,"minoutput":10000,"minconfirms":2,"genesishash":"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71","protover":170002,"genesisblock":"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2","debug":0}
}
}
if ( coin === 'ZEC' ) {
if (coin === 'ZEC') {
if ( mode === '-1' ) {
AddCoinData.ZEC = {"coin":"ZEC","conf":"zcash.conf","path":confpath,"unitval":"20","zcash":1,"RELAY":-1,"VALIDATE":0,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","startpend":8,"endpend":8,"services":129,"maxpeers":32,"newcoin":"ZEC","name":"Zcash","hasheaders":0,"useaddmultisig":0,"netmagic":"24e92764","p2p":8233,"rpc":8232,"pubval":184,"p2shval":189,"wifval":128,"txfee_satoshis":"10000","isPoS":0,"minoutput":10000,"minconfirms":2,"genesishash":"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08","protover":170002,"genesisblock":"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157","debug":0}
} else {
@ -168,16 +170,17 @@ export function startCrypto(confpath, coin, mode) {
}
}
console.log('AddCoinData', AddCoinData[coin]);
return AddCoinData[coin];
}
export function startCurrencyAssetChain(confpath, coin, mode) {
var AddCoinDataPayload = {},
tmpPendValue = 1,
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (coin !== 'BTC' && coin !== 'LTC' && coin !== 'DOGE') {
if (coin !== 'BTC' &&
coin !== 'LTC' &&
coin !== 'DOGE') {
tmpPendValue = parseInt(tmpPendValue) * 4;
}
@ -631,15 +634,17 @@ export function startCurrencyAssetChain(confpath, coin, mode) {
};
AddCoinDataPayload.CZKVar = Object.assign({}, _payloadVar, CZKDiff);
return AddCoinDataPayload[coin + 'Var'];
return AddCoinDataPayload[`${coin}Var`];
}
}
export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
var tmpPendValue;
if (coin !== 'BTC' && coin !== 'LTC' && coin !== 'DOGE') {
if (coin !== 'BTC' &&
coin !== 'LTC' &&
coin !== 'DOGE') {
tmpPendValue = parseInt(tmpPendValue) * 4;
}
@ -667,6 +672,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
'debug': 0,
'seedipaddr': '78.47.196.146'
};
const acConfig = {
'SUPERNET': {
'name': 'SUPERNET',
@ -766,7 +772,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
}
};
if ( mode === '-1' ) {
if (mode === '-1') {
if (getSuppyOnly) {
return acConfig[coin].supply;
} else {

6
react/src/components/dashboard/atomic.js

@ -44,7 +44,7 @@ class Atomic extends React.Component {
}
getAtomicData() {
const tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
const tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
let ExplorerInputData;
switch (this.state.api) {
@ -472,7 +472,7 @@ class Atomic extends React.Component {
for (let i = 0; i < _options.length; i++) {
items.push(
<option key={_options[i].method} value={_options[i].method}>{_options[i].name}</option>
<option key={ _options[i].method } value={ _options[i].method }>{ _options[i].name }</option>
);
}
@ -506,7 +506,7 @@ class Atomic extends React.Component {
<select
className="form-control form-material"
id="atomic_explorer_select_command_options"
onChange={this.updateSelectedAPI}>
onChange={ this.updateSelectedAPI }>
<option value="">-{ translate('ATOMIC.SELECT_COMMAND') }-</option>
{ this.renderAtomicOptions() }
</select>

315
react/src/components/dashboard/coinTile.js

@ -1,5 +1,9 @@
import React from 'react';
import { translate } from '../../translate/translate';
import {
getCoinTitle,
getModeInfo
} from '../../util/coinHelper';
import CoinTileItem from './coinTileItem';
class CoinTile extends React.Component {
@ -17,311 +21,20 @@ class CoinTile extends React.Component {
'full'
];
const allCoins = this.props.Main.coins;
var items = [];
let items = [];
if (this.props.Main && this.props.Main.coins) {
if (this.props.Main &&
allCoins) {
modes.map(function(mode) {
allCoins[mode].map(function(coin) {
var coinlogo = '',
coinname = '',
modecode = '',
modetip = '',
modecolor = '';
const _coinMode = getModeInfo(mode),
modecode = _coinMode.code,
modetip = _coinMode.tip,
modecolor = _coinMode.color;
switch (mode) {
case 'native':
modecode = 'Native';
modetip = 'Native';
modecolor = 'primary';
break;
case 'basilisk':
modecode = 'Basilisk';
modetip = 'Basilisk';
modecolor = 'info';
break;
case 'full':
modecode = 'Full';
modetip = 'Full';
modecolor = 'success';
break;
case 'virtual':
modecode = 'Virtual';
modetip = 'Virtual';
modecolor = 'danger';
break;
case 'notarychains':
modecode = 'Notarychains';
modetip = 'Notarychains';
modecolor = 'dark';
break;
}
switch (coin) {
case 'BTC':
coinlogo = 'bitcoin';
coinname = 'Bitcoin';
break;
case 'BTCD':
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark';
break;
case 'LTC':
coinlogo = 'litecoin';
coinname = 'Litecoin';
break;
case 'VPN':
coinlogo = 'vpncoin';
coinname = 'VPNcoin';
break;
case 'SYS':
coinlogo = 'syscoin';
coinname = 'Syscoin';
break;
case 'ZEC':
coinlogo = 'zcash';
coinname = 'Zcash';
break;
case 'NMC':
coinlogo = 'namecoin';
coinname = 'Namecoin';
break;
case 'DEX':
coinlogo = 'dex';
coinname = 'InstantDEX';
break;
case 'DOGE':
coinlogo = 'dogecoin';
coinname = 'Dogecoin';
break;
case 'DGB':
coinlogo = 'digibyte';
coinname = 'Digibyte';
break;
case 'MZC':
coinlogo = 'mazacoin';
coinname = 'Mazacoin';
break;
case 'UNO':
coinlogo = 'unobtanium';
coinname = 'Unobtanium';
break;
case 'ZET':
coinlogo = 'zetacoin';
coinname = 'Zetacoin';
break;
case 'KMD':
coinlogo = 'komodo';
coinname = 'Komodo';
break;
case 'BTM':
coinlogo = 'bitmark';
coinname = 'Bitmark';
break;
case 'CARB':
coinlogo = 'carboncoin';
coinname = 'Carboncoin';
break;
case 'ANC':
coinlogo = 'anoncoin';
coinname = 'AnonCoin';
break;
case 'FRK':
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
case 'SUPERNET':
coinlogo = 'SUPERNET';
coinname = 'SUPERNET';
break;
case 'REVS':
coinlogo = 'REVS';
coinname = 'REVS';
break;
case 'WLC':
coinlogo = 'WLC';
coinname = 'WIRELESS';
break;
case 'PANGEA':
coinlogo = 'PANGEA';
coinname = 'PANGEA';
break;
case 'JUMBLR':
coinlogo = 'JUMBLR';
coinname = 'JUMBLR';
break;
case 'BET':
coinlogo = 'BET';
coinname = 'BET';
break;
case 'CRYPTO':
coinlogo = 'CRYPTO';
coinname = 'CRYPTO';
break;
case 'HODL':
coinlogo = 'HODL';
coinname = 'HODL';
break;
case 'SHARK':
coinlogo = 'SHARK';
coinname = 'SHARK';
break;
case 'BOTS':
coinlogo = 'BOTS';
coinname = 'BOTS';
break;
case 'MGW':
coinlogo = 'MGW';
coinname = 'MultiGateway';
break;
case 'MVP':
coinlogo = 'MVP';
coinname = 'MVP Lineup';
break;
case 'KV':
coinlogo = 'KV';
coinname = 'KV';
break;
case 'CEAL':
coinlogo = 'CEAL';
coinname = 'CEAL NET';
break;
case 'MESH':
coinlogo = 'MESH';
coinname = 'SpaceMesh';
break;
case 'USD':
coinlogo = 'usd';
coinname = 'US Dollar';
break;
case 'RON':
coinlogo = 'RON';
coinname = 'Romanian Leu';
break;
case 'EUR':
coinlogo = 'EUR';
coinname = 'Euro';
break;
case 'JPY':
coinlogo = 'JPY';
coinname = 'Japanese Yen';
break;
case 'GBP':
coinlogo = 'GBP';
coinname = 'British Pound';
break;
case 'AUD':
coinlogo = 'AUD';
coinname = 'Australian Dollar';
break;
case 'CAD':
coinlogo = 'CAD';
coinname = 'Canadian Dollar';
break;
case 'CHF':
coinlogo = 'CHF';
coinname = 'Swiss Franc';
break;
case 'NZD':
coinlogo = 'NZD';
coinname = 'New Zealand Dollar';
break;
case 'CNY':
coinlogo = 'CNY';
coinname = 'Chinese Yuan';
break;
case 'RUB':
coinlogo = 'RUB';
coinname = 'Russian Ruble';
break;
case 'MXN':
coinlogo = 'MXN';
coinname = 'Mexican peso';
break;
case 'BRL':
coinlogo = 'BRL';
coinname = 'Brazilian Real';
break;
case 'INR':
coinlogo = 'INR';
coinname = 'Indian Rupee';
break;
case 'HKD':
coinlogo = 'HKD';
coinname = 'Hong Kong Dollar';
break;
case 'TRY':
coinlogo = 'TRY';
coinname = 'Turkish Lira';
break;
case 'ZAR':
coinlogo = 'ZAR';
coinname = 'South African Rand';
break;
case 'PLN':
coinlogo = 'PLN';
coinname = 'Polish Zloty';
break;
case 'NOK':
coinlogo = 'NOK';
coinname = 'Norwegian Krone';
break;
case 'SEK':
coinlogo = 'SEK';
coinname = 'Swedish Krona';
break;
case 'DKK':
coinlogo = 'DKK';
coinname = 'Danish Krone';
break;
case 'CZK':
coinlogo = 'CZK';
coinname = 'Czech Koruna';
break;
case 'HUF':
coinlogo = 'HUF';
coinname = 'Hungarian Forint';
break;
case 'ILS':
coinlogo = 'ILS';
coinname = 'Israeli Shekel';
break;
case 'KRW':
coinlogo = 'KRW';
coinname = 'Korean Won';
break;
case 'MYR':
coinlogo = 'MYR';
coinname = 'Malaysian Ringgit';
break;
case 'PHP':
coinlogo = 'PHP';
coinname = 'Philippine Peso';
break;
case 'SGD':
coinlogo = 'SGD';
coinname = 'Singapore Dollar';
break;
case 'THB':
coinlogo = 'THB';
coinname = 'Thai Baht';
break;
case 'BGN':
coinlogo = 'BGN';
coinname = 'Bulgarian Lev';
break;
case 'IDR':
coinlogo = 'IDR';
coinname = 'Indonesian Rupiah';
break;
case 'HRK':
coinlogo = 'HRK';
coinname = 'Croatian Kuna';
break;
}
const _coinTitle = getCoinTitle(coin),
coinlogo = _coinTitle.logo,
coinname = _coinTitle.name;
items.push({
coinlogo,

17
react/src/components/dashboard/coinTileItem.js

@ -21,6 +21,8 @@ import {
} from '../../actions/actionCreators';
import Store from '../../store';
const BASILISK_CACHE_UPDATE_TIMEOUT = 240000;
class CoinTileItem extends React.Component {
constructor(props) {
super(props);
@ -87,14 +89,13 @@ class CoinTileItem extends React.Component {
this.dispatchCoinActions(coin, mode);
if (mode === 'full') {
var _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(function() {
this.dispatchCoinActions(coin, mode);
}.bind(this), 3000);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
}
if (mode === 'native') {
// TODO: add conditions to skip txhistory, balances, addresses while "activating best chain"
var _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(function() {
this.dispatchCoinActions(coin, mode);
}.bind(this), coin === 'KMD' ? 15000 : 3000);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
@ -112,11 +113,11 @@ class CoinTileItem extends React.Component {
'address': _basiliskMainAddress,
}));
var _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(function() {
this.dispatchCoinActions(coin, mode);
}.bind(this), 3000);
var _basiliskCache = setInterval(function() {
const _basiliskCache = setInterval(() => {
Store.dispatch(fetchNewCacheData({
'pubkey': this.props.Dashboard.activeHandle.pubkey,
'allcoins': false,
@ -124,7 +125,7 @@ class CoinTileItem extends React.Component {
'calls': 'listtransactions:getbalance',
'address': _basiliskMainAddress,
}));
}.bind(this), 240000);
}, BASILISK_CACHE_UPDATE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
Store.dispatch(startInterval('basilisk', _basiliskCache));
// basilisk
@ -145,9 +146,9 @@ class CoinTileItem extends React.Component {
<a className="avatar margin-bottom-5" id="edexcoin-logo">
<img
className="img-responsive"
src={ 'assets/images/cryptologo/' + item.coinlogo + '.png' }
src={ `assets/images/cryptologo/${item.coinlogo}.png` }
alt={ item.coinname }/>
<span className={ 'badge up badge-' + item.modecolor } id="basfull">{ item.modecode }</span>
<span className={ `badge up badge-${item.modecolor}` } id="basfull">{ item.modecode }</span>
</a>
<div className="coin-name">{ item.coinname } ({ item.coinlogo.toUpperCase() })</div>
</div>

11
react/src/components/dashboard/sendCoin.js

@ -291,7 +291,7 @@ class SendCoin extends React.Component {
renderAddressList() {
return (
<div id="showkmdwalletaddrs" className={ 'btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ' + (this.state.addressSelectorOpen ? 'open' : '') }>
<div id="showkmdwalletaddrs" className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
type="button"
className="btn dropdown-toggle btn-info"
@ -357,7 +357,8 @@ class SendCoin extends React.Component {
});
}
if (step === 1 || step === 2) {
if (step === 1 ||
step === 2) {
this.setState(Object.assign({}, this.state, {
currentStep: step,
utxoMethodInProgress: !this.state.sendApiType && this.props.ActiveCoin.mode === 'basilisk' ? true : false,
@ -411,7 +412,7 @@ class SendCoin extends React.Component {
'utxos': utxoSet
};
iguanaUTXORawTX(sendData)
iguanaUTXORawTX(sendData, Store.dispatch)
.then(function(json) {
console.log('sendData', sendData);
console.log('iguanaUTXORawTXJSON', json);
@ -424,7 +425,7 @@ class SendCoin extends React.Component {
'signedtx': json.signedtx,
'coin': sendData.coin
};
dexSendRawTX(dexrawtxData)
dexSendRawTX(dexrawtxData, Store.dispatch)
.then(function(dexRawTxJSON) {
console.log('dexRawTxJSON', dexRawTxJSON);
if (dexRawTxJSON.indexOf('"error":{"code"') > -1) {
@ -445,7 +446,7 @@ class SendCoin extends React.Component {
edexGetTransaction({
'coin': sendData.coin,
'txid': dexRawTxJSON.txid ? dexRawTxJSON.txid : dexRawTxJSON
})
}, Store.dispatch)
.then(function(json) {
console.log('gettx', json);
resolve(json);

5
react/src/components/dashboard/settings.js

@ -53,7 +53,8 @@ class Settings extends React.Component {
}
openTab(elemId, tab) {
const _height = document.querySelector('#' + elemId + ' .panel-collapse .panel-body').offsetHeight;
console.log(`#${elemId}.panel-collapse .panel-body`);
const _height = document.querySelector(`#${elemId} .panel-collapse .panel-body`).offsetHeight;
this.setState(Object.assign({}, this.state, {
activeTab: tab,
@ -217,8 +218,6 @@ class Settings extends React.Component {
this.setState({
appSettings: _appSettings,
});
console.log(this.state.appSettings);
}
_saveAppConfig() {

108
react/src/components/dashboard/syncOnly.js

@ -1,5 +1,6 @@
import React from 'react';
import { translate } from '../../translate/translate';
import { getCoinTitle } from '../../util/coinHelper';
import {
stopInterval,
addCoin,
@ -19,7 +20,8 @@ class SyncOnly extends React.Component {
}
isFullySynced(fork) {
if (fork.balances && ((Number(fork.balances) +
if (fork.balances &&
((Number(fork.balances) +
Number(fork.validated) +
Number(fork.bundles) +
Number(fork.utxo)) / 4 === 100)) {
@ -30,96 +32,15 @@ class SyncOnly extends React.Component {
}
renderCoinName(coin) {
let coinlogo;
let coinname;
switch (coin) {
case 'BTC':
coinlogo = 'bitcoin';
coinname = 'Bitcoin';
break;
case 'BTCD':
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark';
break;
case 'LTC':
coinlogo = 'litecoin';
coinname = 'Litecoin';
break;
case 'VPN':
coinlogo = 'vpncoin';
coinname = 'VPNcoin';
break;
case 'SYS':
coinlogo = 'syscoin';
coinname = 'Syscoin';
break;
case 'ZEC':
coinlogo = 'zcash';
coinname = 'Zcash';
break;
case 'NMC':
coinlogo = 'namecoin';
coinname = 'Namecoin';
break;
case 'DEX':
coinlogo = 'dex';
coinname = 'InstantDEX';
break;
case 'DOGE':
coinlogo = 'dogecoin';
coinname = 'Dogecoin';
break;
case 'DGB':
coinlogo = 'digibyte';
coinname = 'Digibyte';
break;
case 'MZC':
coinlogo = 'mazacoin';
coinname = 'Mazacoin';
break;
case 'UNO':
coinlogo = 'unobtanium';
coinname = 'Unobtanium';
break;
case 'ZET':
coinlogo = 'zetacoin';
coinname = 'Zetacoin';
break;
case 'KMD':
coinlogo = 'komodo';
coinname = 'Komodo';
break;
case 'BTM':
coinlogo = 'bitmark';
coinname = 'Bitmark';
break;
case 'CARB':
coinlogo = 'carboncoin';
coinname = 'Carboncoin';
break;
case 'ANC':
coinlogo = 'anoncoin';
coinname = 'AnonCoin';
break;
case 'FRK':
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
}
const _coinTitle = getCoinTitle(coin);
return {
'logo': coinlogo,
'name': coinname
'logo': _coinTitle.logo,
'name': _coinTitle.name
};
}
componentWillReceiveProps(props) {
// console.log('SyncOnly', props);
if (props.SyncOnly) {
for (let port in this.props.SyncOnly.forks) {
const forkInfo = this.props.SyncOnly.forks[port];
@ -130,7 +51,6 @@ class SyncOnly extends React.Component {
forkInfo.getinfo &&
forkInfo.getinfo.error &&
forkInfo.getinfo.error === 'bitcoinrpc needs coin that is active') {
console.log('fork add coin required');
let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks);
_autoRestartedForks[port] = true;
@ -138,14 +58,15 @@ class SyncOnly extends React.Component {
autoRestartedForks: _autoRestartedForks,
});
Store.dispatch(addCoin(forkInfo.registry.coin, '1', null, port));
setTimeout(function() {
setTimeout(() => {
let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks);
_autoRestartedForks[port] = false;
this.setState({
autoRestartedForks: _autoRestartedForks,
});
}.bind(this), 10000);
}, 10000);
}
}
}
@ -237,12 +158,14 @@ class SyncOnly extends React.Component {
<div className="avatar">
<img
className="img-responsive margin-bottom-5"
src={ 'assets/images/cryptologo/' + this.renderCoinName(forkInfo.registry.coin).logo + '.png' }
src={ `assets/images/cryptologo/${this.renderCoinName(forkInfo.registry.coin).logo}.png` }
alt={ forkInfo.registry.coin }/>
<span className="badge up badge-success margin-bottom-5">Full</span>
<div className="coin-name">{ this.renderCoinName(forkInfo.registry.coin).name } ({ forkInfo.registry.coin.toUpperCase() })</div>
<div className="margin-top-10">
<span className="btn btn-primary" onClick={ () => this._stopIguanaFork(forkInfo.registry.pmid) }>
<span
className="btn btn-primary"
onClick={ () => this._stopIguanaFork(forkInfo.registry.pmid) }>
<span className="fa fa-stop"></span> { translate('INDEX.STOP') }
</span>
<span
@ -281,7 +204,10 @@ class SyncOnly extends React.Component {
{ this.renderForksList() }
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" onClick={ this.closeSyncOnlyModal }>{ translate('INDEX.CLOSE') }</button>
<button
type="button"
className="btn btn-default"
onClick={ this.closeSyncOnlyModal }>{ translate('INDEX.CLOSE') }</button>
</div>
</div>
</div>

2
react/src/components/dashboard/walletsBalance.js

@ -30,7 +30,7 @@ class WalletsBalance extends React.Component {
this.props.ActiveCoin.mode === 'basilisk' &&
this.props.ActiveCoin.activeAddress &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin] &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress]&&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance) {

4
react/src/components/dashboard/walletsBasiliskConnection.js

@ -76,13 +76,13 @@ class WalletsBasiliskConnection extends React.Component {
</div>
</div>
<h5 className="text-left">
{ translate('IAPI.CON_STATUS') + '... ' + this.props.Dashboard.connectedNotaries.current + '/' + this.props.Dashboard.connectedNotaries.total + ': ' + this.props.Dashboard.connectedNotaries.currentNodeName} <span className="pull-right" id="basilisk-connections-refresh-percent">{ Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }%</span>
{ `${translate('IAPI.CON_STATUS')}... ${this.props.Dashboard.connectedNotaries.current}/${this.props.Dashboard.connectedNotaries.total}:${this.props.Dashboard.connectedNotaries.currentNodeName}` } <span className="pull-right" id="basilisk-connections-refresh-percent">{ Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }%</span>
</h5>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-info progress-bar-striped active font-size-80-percent" style={{ width: Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) + '%' }} role="progressbar" id="basilisk-connections-refresh-progress-bar"></div>
</div>
<pre id="basilisk-connections-refresh-status-output no-padding">
{ this.props.Dashboard.connectedNotaries.failedToConnectNodes ? 'Failed: ' + this.props.Dashboard.connectedNotaries.failedToConnectNodes : null }
{ this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
</pre>
</div>
</div>

10
react/src/components/dashboard/walletsData.js

@ -82,6 +82,7 @@ class WalletsData extends React.Component {
}
}
// deprecated
toggleCacheApi() {
const _useCache = !this.state.useCache;
@ -463,6 +464,7 @@ class WalletsData extends React.Component {
}
}*/
// deprecated
renderUseCacheToggle() {
if (this.props.ActiveCoin.mode === 'basilisk') {
return (
@ -548,11 +550,11 @@ class WalletsData extends React.Component {
this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] &&
this.props.ActiveCoin.mode === 'basilisk') {
return (
<div className={ 'btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ' + (this.state.addressSelectorOpen ? 'open' : '') }>
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
type="button"
className="btn dropdown-toggle btn-info"
title={ '-' + translate('KMD_NATIVE.SELECT_ADDRESS') + '-' }
title={ `-${translate('KMD_NATIVE.SELECT_ADDRESS')}-` }
aria-expanded="true"
onClick={ this.openDropMenu }>
<span className="filter-option pull-left">{ this.renderSelectorCurrentLabel() } </span>&nbsp;
@ -605,7 +607,9 @@ class WalletsData extends React.Component {
{ translate('SEND.PROCESSING_REQ') }: { this.state.currentStackLength } / { this.state.totalStackLength }
</div>
</div>
<div className={ this.state.basiliskActionsMenu ? 'dropdown open' : 'dropdown' } onClick={ this.toggleBasiliskActionsMenu }>
<div
className={ this.state.basiliskActionsMenu ? 'dropdown open' : 'dropdown' }
onClick={ this.toggleBasiliskActionsMenu }>
<a
className="dropdown-toggle btn-xs btn-default"
id="btn_edexcoin_basilisk"

4
react/src/components/dashboard/walletsHeader.js

@ -1,7 +1,5 @@
import React from 'react';
import { translate } from '../../translate/translate';
// import { dashboardChangeSection, toggleAddcoinModal } from '../../actions/actionCreators';
// import Store from '../../store';
class WalletsHeader extends React.Component {
render() {
@ -11,7 +9,7 @@ class WalletsHeader extends React.Component {
<div
className="page-header page-header-bordered header-easydex margin-bottom-0"
id="easydex-header-div"
style={{ backgroundImage: 'url("assets/images/bg/' + this.props.activeSection + '_transparent_header_bg.png")', backgroundRepeat: 'no-repeat', backgroundPosition: '0%' }}>
style={{ backgroundImage: `url("assets/images/bg/${this.props.activeSection}_transparent_header_bg.png")`, backgroundRepeat: 'no-repeat', backgroundPosition: '0%' }}>
<h1 className={ this.props.activeSection === 'jumblr' ? 'hide' : 'page-title' }>EasyDEX</h1>
<ol className="breadcrumb">
<li className={ this.props.activeSection === 'jumblr' ? 'hide' : 'header-easydex-section' }>{ translate('INDEX.DASHBOARD') }</li>

4
react/src/components/dashboard/walletsNative.js

@ -29,10 +29,10 @@ class WalletsNative extends React.Component {
return (
<div className="page margin-left-0">
<div id="section-extcoin" className="padding-top-0">
<div id="easydex-header-div" className="background-color-white" style={{ 'backgroundImage': 'url("assets/images/bg/' + this.defaultBG() + '_transparent_header_bg.png")' }}>
<div id="easydex-header-div" className="background-color-white" style={{ 'backgroundImage': `url("assets/images/bg/${this.defaultBG()}_transparent_header_bg.png")` }}>
<ol className="breadcrumb">
<li className="header-easydex-section">
<img src={ 'assets/images/native/' + this.defaultBG() + '_header_title_logo.png' } /> <span className={'easydex-section-image ' + (this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '') }>{ this.props.ActiveCoin.coin }</span>
<img src={ `assets/images/native/${this.defaultBG()}_header_title_logo.png` } /> <span className={ `easydex-section-image ${(this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '')}` }>{ this.props.ActiveCoin.coin }</span>
</li>
</ol>
</div>

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

@ -80,7 +80,7 @@ class WalletsNativeSend extends React.Component {
renderAddressList() {
return (
<div className={ 'btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ' + (this.state.addressSelectorOpen ? 'open' : '') }>
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
type="button"
className="btn dropdown-toggle btn-info"
@ -106,31 +106,29 @@ class WalletsNativeSend extends React.Component {
}
renderOPIDLabel(opid) {
const _satatusDef = {
queued: {
icon: 'warning',
label: 'QUEUED'
},
executing: {
icon: 'info',
label: 'EXECUTING'
},
failed: {
icon: 'danger',
label: 'FAILED'
},
success: {
icon: 'success',
label: 'SUCCESS'
}
};
if (opid.status === 'queued') {
return (
<span className="label label-warning">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.QUEUED') }</span>
</span>
);
}
if (opid.status === 'executing') {
return (
<span className="label label-info">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.EXECUTING') }</span>
</span>
);
}
if (opid.status === 'failed') {
return (
<span className="label label-danger">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.FAILED') }</span>
</span>
);
}
if (opid.status === 'success') {
return (
<span className="label label-success">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.SUCCESS') }</span>
<span className={`label label-${_satatusDef[opid.status].icon}`}>
<i className="icon fa-eye"></i> <span>{ translate(`KMD_NATIVE.${_satatusDef[opid.status].label}`) }</span>
</span>
);
}
@ -217,14 +215,14 @@ class WalletsNativeSend extends React.Component {
handleSubmit() {
Store.dispatch(sendNativeTx(this.props.ActiveCoin.coin, this.state));
setTimeout(function() {
setTimeout(() => {
Store.dispatch(getKMDOPID(null, this.props.ActiveCoin.coin));
}.bind(this), 1000);
}, 1000);
}
getOAdress() {
resolveOpenAliasAddress(this.state.sendToOA)
.then(function(json) {
.then((json) => {
const reply = json.Answer;
if (reply &&
@ -247,7 +245,7 @@ class WalletsNativeSend extends React.Component {
} else {
Store.dispatch(triggerToaster(true, 'Couldn\'t find any addresses', 'OpenAlias', 'error'));
}
}.bind(this));
});
}
renderOASendUI() {
@ -293,7 +291,7 @@ class WalletsNativeSend extends React.Component {
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 data-extcoin="COIN" className="panel-title">
<h3 className="panel-title">
{ translate('INDEX.SEND') } { this.props.ActiveCoin.coin }
</h3>
</div>

2
react/src/components/dashboard/walletsNativeSyncProgress.js

@ -57,7 +57,7 @@ class WalletsNativeSyncProgress extends React.Component {
}
}
return(': ' + Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks) + '% (blocks ' + currentBestChain + ' / ' + this.props.Dashboard.progress.remoteKMDNode.blocks + ')');
return(`: ${Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks)}% (blocks ${currentBestChain} / ${this.props.Dashboard.progress.remoteKMDNode.blocks})`);
} else {
return (
<span id="activating-komodod-tridot">...</span>

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

@ -121,12 +121,12 @@ class WalletsNativeTxHistory extends React.Component {
renderPaginationItems() {
let items = [];
for (let i=0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
for (let i = 0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
items.push(
<li className={ this.state.activePage === i + 1 ? 'paginate_button active' : 'paginate_button' }>
<a
aria-controls="kmd-tx-history-tbl"
tabIndex="0" key={i + '-pagination'}
tabIndex="0" key={ `${i}-pagination` }
onClick={ this.state.activePage !== (i + 1) ? () => this.updateCurrentPage(i + 1) : null }>{ i + 1 }</a>
</li>
);
@ -142,7 +142,7 @@ class WalletsNativeTxHistory extends React.Component {
return (
<div className="dataTables_length" id="kmd-tx-history-tbl_length">
<label>
{translate('INDEX.SHOW')}&nbsp;
{ translate('INDEX.SHOW') }&nbsp;
<select
name="itemsPerPage"
aria-controls="kmd-tx-history-tbl"
@ -153,7 +153,7 @@ class WalletsNativeTxHistory extends React.Component {
<option value="50">50</option>
<option value="100">100</option>
</select>&nbsp;
{translate('INDEX.ENTRIES_SM')}
{ translate('INDEX.ENTRIES_SM') }
</label>
</div>
);

28
react/src/components/login/login.js

@ -41,9 +41,9 @@ class Login extends React.Component {
openSyncOnlyModal() {
Store.dispatch(getSyncOnlyForks());
const _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(() => {
Store.dispatch(getSyncOnlyForks());
}.bind(this), 3000);
}, 3000);
Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle));
Store.dispatch(toggleSyncOnlyModal(true));
@ -67,21 +67,25 @@ class Login extends React.Component {
}
componentWillReceiveProps(props) {
if (props && props.Main && props.Main.isLoggedIn) {
if (props &&
props.Main &&
props.Main.isLoggedIn) {
this.setState({
display: false,
});
}
if (props && props.Main && !props.Main.isLoggedIn) {
if (props &&
props.Main &&
!props.Main.isLoggedIn) {
this.setState({
display: true,
});
if (!this.props.Interval.interval.activeCoins) {
const _iguanaActiveCoins = setInterval(function() {
const _iguanaActiveCoins = setInterval(() => {
Store.dispatch(getDexCoins());
}.bind(this), 10000);
}, 10000);
Store.dispatch(startInterval('activeCoins', _iguanaActiveCoins));
}
@ -89,7 +93,9 @@ class Login extends React.Component {
}
if (this.state.activeLoginSection !== 'signup') {
if (props && props.Main && props.Main.activeCoins) {
if (props &&
props.Main &&
props.Main.activeCoins) {
this.setState({
activeLoginSection: 'login',
});
@ -164,8 +170,12 @@ class Login extends React.Component {
<h2>{ translate('LOGIN.SAVED_WALLET_SEED') }</h2>
<div className="swal2-content display-block">{ translate('LOGIN.SEED_MAKE_SURE_BACKUP') }</div>
<hr className="swal2-spacer display-block" />
<button className="swal2-confirm styled swal2-confirm-container" onClick={ this.execWalletCreate }>{ translate('LOGIN.YES_I_BACKUP') }</button>
<button className="swal2-cancel styled swal2-cancel-container" onClick={ this.toggleSeedBackupModal }>{ translate('LOGIN.CANCEL') }</button>
<button
className="swal2-confirm styled swal2-confirm-container"
onClick={ this.execWalletCreate }>{ translate('LOGIN.YES_I_BACKUP') }</button>
<button
className="swal2-cancel styled swal2-cancel-container"
onClick={ this.toggleSeedBackupModal }>{ translate('LOGIN.CANCEL') }</button>
</div>
</div>
);

4
react/src/components/main/main.js

@ -8,6 +8,8 @@ import {
iguanaActiveHandle
} from '../../actions/actionCreators';
const IGUANA_ACTIVE_HANDLE_TIMEOUT = 30000;
class Main extends React.Component {
constructor(props) {
super(props);
@ -24,7 +26,7 @@ class Main extends React.Component {
Store.dispatch(iguanaActiveHandle());
const _iguanaActiveHandle = setInterval(function() {
Store.dispatch(iguanaActiveHandle());
}, 30000);
}, IGUANA_ACTIVE_HANDLE_TIMEOUT);
this.setState(Object.assign({}, this.state, {
activeHandleInterval: _iguanaActiveHandle,

5
react/src/components/toaster/toaster.js

@ -3,9 +3,6 @@ import { dismissToasterMessage } from '../../actions/actionCreators';
import Store from '../../store';
import ToasterItem from './toaster-item';
/**
* Container component used for creating multiple toasts
*/
class Toaster extends React.Component {
constructor(props) {
super(props);
@ -37,7 +34,7 @@ class Toaster extends React.Component {
renderToasts() {
if (this.state.toasts &&
this.state.toasts.length) {
this.state.toasts.map((toast) => {
return this.state.toasts.map((toast) => {
// sets the toastId for all new toasts
if (!toast.toastId) {
toast.toastId = this.toastId++;

316
react/src/util/coinHelper.js

@ -0,0 +1,316 @@
export function getCoinTitle(coin) {
let coinlogo,
coinname;
switch (coin) {
case 'BTC':
coinlogo = 'bitcoin';
coinname = 'Bitcoin';
break;
case 'BTCD':
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark';
break;
case 'LTC':
coinlogo = 'litecoin';
coinname = 'Litecoin';
break;
case 'VPN':
coinlogo = 'vpncoin';
coinname = 'VPNcoin';
break;
case 'SYS':
coinlogo = 'syscoin';
coinname = 'Syscoin';
break;
case 'ZEC':
coinlogo = 'zcash';
coinname = 'Zcash';
break;
case 'NMC':
coinlogo = 'namecoin';
coinname = 'Namecoin';
break;
case 'DEX':
coinlogo = 'dex';
coinname = 'InstantDEX';
break;
case 'DOGE':
coinlogo = 'dogecoin';
coinname = 'Dogecoin';
break;
case 'DGB':
coinlogo = 'digibyte';
coinname = 'Digibyte';
break;
case 'MZC':
coinlogo = 'mazacoin';
coinname = 'Mazacoin';
break;
case 'UNO':
coinlogo = 'unobtanium';
coinname = 'Unobtanium';
break;
case 'ZET':
coinlogo = 'zetacoin';
coinname = 'Zetacoin';
break;
case 'KMD':
coinlogo = 'komodo';
coinname = 'Komodo';
break;
case 'BTM':
coinlogo = 'bitmark';
coinname = 'Bitmark';
break;
case 'CARB':
coinlogo = 'carboncoin';
coinname = 'Carboncoin';
break;
case 'ANC':
coinlogo = 'anoncoin';
coinname = 'AnonCoin';
break;
case 'FRK':
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
case 'SUPERNET':
coinlogo = 'SUPERNET';
coinname = 'SUPERNET';
break;
case 'REVS':
coinlogo = 'REVS';
coinname = 'REVS';
break;
case 'WLC':
coinlogo = 'WLC';
coinname = 'WIRELESS';
break;
case 'PANGEA':
coinlogo = 'PANGEA';
coinname = 'PANGEA';
break;
case 'JUMBLR':
coinlogo = 'JUMBLR';
coinname = 'JUMBLR';
break;
case 'BET':
coinlogo = 'BET';
coinname = 'BET';
break;
case 'CRYPTO':
coinlogo = 'CRYPTO';
coinname = 'CRYPTO';
break;
case 'HODL':
coinlogo = 'HODL';
coinname = 'HODL';
break;
case 'SHARK':
coinlogo = 'SHARK';
coinname = 'SHARK';
break;
case 'BOTS':
coinlogo = 'BOTS';
coinname = 'BOTS';
break;
case 'MGW':
coinlogo = 'MGW';
coinname = 'MultiGateway';
break;
case 'MVP':
coinlogo = 'MVP';
coinname = 'MVP Lineup';
break;
case 'KV':
coinlogo = 'KV';
coinname = 'KV';
break;
case 'CEAL':
coinlogo = 'CEAL';
coinname = 'CEAL NET';
break;
case 'MESH':
coinlogo = 'MESH';
coinname = 'SpaceMesh';
break;
case 'USD':
coinlogo = 'usd';
coinname = 'US Dollar';
break;
case 'RON':
coinlogo = 'RON';
coinname = 'Romanian Leu';
break;
case 'EUR':
coinlogo = 'EUR';
coinname = 'Euro';
break;
case 'JPY':
coinlogo = 'JPY';
coinname = 'Japanese Yen';
break;
case 'GBP':
coinlogo = 'GBP';
coinname = 'British Pound';
break;
case 'AUD':
coinlogo = 'AUD';
coinname = 'Australian Dollar';
break;
case 'CAD':
coinlogo = 'CAD';
coinname = 'Canadian Dollar';
break;
case 'CHF':
coinlogo = 'CHF';
coinname = 'Swiss Franc';
break;
case 'NZD':
coinlogo = 'NZD';
coinname = 'New Zealand Dollar';
break;
case 'CNY':
coinlogo = 'CNY';
coinname = 'Chinese Yuan';
break;
case 'RUB':
coinlogo = 'RUB';
coinname = 'Russian Ruble';
break;
case 'MXN':
coinlogo = 'MXN';
coinname = 'Mexican peso';
break;
case 'BRL':
coinlogo = 'BRL';
coinname = 'Brazilian Real';
break;
case 'INR':
coinlogo = 'INR';
coinname = 'Indian Rupee';
break;
case 'HKD':
coinlogo = 'HKD';
coinname = 'Hong Kong Dollar';
break;
case 'TRY':
coinlogo = 'TRY';
coinname = 'Turkish Lira';
break;
case 'ZAR':
coinlogo = 'ZAR';
coinname = 'South African Rand';
break;
case 'PLN':
coinlogo = 'PLN';
coinname = 'Polish Zloty';
break;
case 'NOK':
coinlogo = 'NOK';
coinname = 'Norwegian Krone';
break;
case 'SEK':
coinlogo = 'SEK';
coinname = 'Swedish Krona';
break;
case 'DKK':
coinlogo = 'DKK';
coinname = 'Danish Krone';
break;
case 'CZK':
coinlogo = 'CZK';
coinname = 'Czech Koruna';
break;
case 'HUF':
coinlogo = 'HUF';
coinname = 'Hungarian Forint';
break;
case 'ILS':
coinlogo = 'ILS';
coinname = 'Israeli Shekel';
break;
case 'KRW':
coinlogo = 'KRW';
coinname = 'Korean Won';
break;
case 'MYR':
coinlogo = 'MYR';
coinname = 'Malaysian Ringgit';
break;
case 'PHP':
coinlogo = 'PHP';
coinname = 'Philippine Peso';
break;
case 'SGD':
coinlogo = 'SGD';
coinname = 'Singapore Dollar';
break;
case 'THB':
coinlogo = 'THB';
coinname = 'Thai Baht';
break;
case 'BGN':
coinlogo = 'BGN';
coinname = 'Bulgarian Lev';
break;
case 'IDR':
coinlogo = 'IDR';
coinname = 'Indonesian Rupiah';
break;
case 'HRK':
coinlogo = 'HRK';
coinname = 'Croatian Kuna';
break;
}
return {
'logo': coinlogo,
'name': coinname
};
}
export function getModeInfo(mode) {
let modecode,
modetip,
modecolor;
switch (mode) {
case 'native':
modecode = 'Native';
modetip = 'Native';
modecolor = 'primary';
break;
case 'basilisk':
modecode = 'Basilisk';
modetip = 'Basilisk';
modecolor = 'info';
break;
case 'full':
modecode = 'Full';
modetip = 'Full';
modecolor = 'success';
break;
case 'virtual':
modecode = 'Virtual';
modetip = 'Virtual';
modecolor = 'danger';
break;
case 'notarychains':
modecode = 'Notarychains';
modetip = 'Notarychains';
modecolor = 'dark';
break;
}
return {
'code': modecode,
'tip': modetip,
'color': modecolor
};
}
Loading…
Cancel
Save