|
|
@ -6,7 +6,7 @@ import { subscribeChannel } from '../socket' |
|
|
|
import { connectElements } from '../lib/redux_helpers.js' |
|
|
|
import { connectElements } from '../lib/redux_helpers.js' |
|
|
|
import { createAsyncLoadStore, refreshPage } from '../lib/async_listing_load' |
|
|
|
import { createAsyncLoadStore, refreshPage } from '../lib/async_listing_load' |
|
|
|
import Web3 from 'web3' |
|
|
|
import Web3 from 'web3' |
|
|
|
import { openValidatorInfoModal } from './stakes/validator_info' |
|
|
|
import { openPoolInfoModal } from './stakes/validator_info' |
|
|
|
import { openDelegatorsListModal } from './stakes/delegators_list' |
|
|
|
import { openDelegatorsListModal } from './stakes/delegators_list' |
|
|
|
import { openBecomeCandidateModal } from './stakes/become_candidate' |
|
|
|
import { openBecomeCandidateModal } from './stakes/become_candidate' |
|
|
|
import { openRemovePoolModal } from './stakes/remove_pool' |
|
|
|
import { openRemovePoolModal } from './stakes/remove_pool' |
|
|
@ -14,6 +14,7 @@ import { openMakeStakeModal } from './stakes/make_stake' |
|
|
|
import { openMoveStakeModal } from './stakes/move_stake' |
|
|
|
import { openMoveStakeModal } from './stakes/move_stake' |
|
|
|
import { openWithdrawStakeModal } from './stakes/withdraw_stake' |
|
|
|
import { openWithdrawStakeModal } from './stakes/withdraw_stake' |
|
|
|
import { openClaimWithdrawalModal } from './stakes/claim_withdrawal' |
|
|
|
import { openClaimWithdrawalModal } from './stakes/claim_withdrawal' |
|
|
|
|
|
|
|
import { checkForTokenDefinition } from './stakes/utils' |
|
|
|
import { openWarningModal } from '../lib/modals' |
|
|
|
import { openWarningModal } from '../lib/modals' |
|
|
|
|
|
|
|
|
|
|
|
const stakesPageSelector = '[data-page="stakes"]' |
|
|
|
const stakesPageSelector = '[data-page="stakes"]' |
|
|
@ -27,6 +28,7 @@ export const initialState = { |
|
|
|
network: null, |
|
|
|
network: null, |
|
|
|
refreshInterval: null, |
|
|
|
refreshInterval: null, |
|
|
|
stakingAllowed: false, |
|
|
|
stakingAllowed: false, |
|
|
|
|
|
|
|
stakingTokenDefined: false, |
|
|
|
stakingContract: null, |
|
|
|
stakingContract: null, |
|
|
|
tokenDecimals: 0, |
|
|
|
tokenDecimals: 0, |
|
|
|
tokenSymbol: '', |
|
|
|
tokenSymbol: '', |
|
|
@ -78,6 +80,7 @@ export function reducer (state = initialState, action) { |
|
|
|
lastBlockNumber: action.lastBlockNumber, |
|
|
|
lastBlockNumber: action.lastBlockNumber, |
|
|
|
lastEpochNumber: action.lastEpochNumber, |
|
|
|
lastEpochNumber: action.lastEpochNumber, |
|
|
|
stakingAllowed: action.stakingAllowed, |
|
|
|
stakingAllowed: action.stakingAllowed, |
|
|
|
|
|
|
|
stakingTokenDefined: action.stakingTokenDefined, |
|
|
|
validatorSetApplyBlock: action.validatorSetApplyBlock |
|
|
|
validatorSetApplyBlock: action.validatorSetApplyBlock |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -104,6 +107,7 @@ function reloadPoolList(msg, store) { |
|
|
|
lastBlockNumber: msg.block_number, |
|
|
|
lastBlockNumber: msg.block_number, |
|
|
|
lastEpochNumber: msg.epoch_number, |
|
|
|
lastEpochNumber: msg.epoch_number, |
|
|
|
stakingAllowed: msg.staking_allowed, |
|
|
|
stakingAllowed: msg.staking_allowed, |
|
|
|
|
|
|
|
stakingTokenDefined: msg.staking_token_defined, |
|
|
|
validatorSetApplyBlock: msg.validator_set_apply_block |
|
|
|
validatorSetApplyBlock: msg.validator_set_apply_block |
|
|
|
}) |
|
|
|
}) |
|
|
|
refreshPage(store) |
|
|
|
refreshPage(store) |
|
|
@ -195,14 +199,42 @@ if ($stakesPage.length) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
$(document.body) |
|
|
|
$(document.body) |
|
|
|
.on('click', '.js-validator-info', event => openValidatorInfoModal(event, store)) |
|
|
|
.on('click', '.js-pool-info', event => { |
|
|
|
.on('click', '.js-delegators-list', event => openDelegatorsListModal(event, store)) |
|
|
|
if (checkForTokenDefinition(store)) { |
|
|
|
.on('click', '.js-become-candidate', () => openBecomeCandidateModal(store)) |
|
|
|
openPoolInfoModal(event, store) |
|
|
|
.on('click', '.js-remove-pool', () => openRemovePoolModal(store)) |
|
|
|
} |
|
|
|
.on('click', '.js-make-stake', event => openMakeStakeModal(event, store)) |
|
|
|
}) |
|
|
|
.on('click', '.js-move-stake', event => openMoveStakeModal(event, store)) |
|
|
|
.on('click', '.js-delegators-list', event => { |
|
|
|
.on('click', '.js-withdraw-stake', event => openWithdrawStakeModal(event, store)) |
|
|
|
openDelegatorsListModal(event, store) |
|
|
|
.on('click', '.js-claim-withdrawal', event => openClaimWithdrawalModal(event, store)) |
|
|
|
}) |
|
|
|
|
|
|
|
.on('click', '.js-become-candidate', () => { |
|
|
|
|
|
|
|
if (checkForTokenDefinition(store)) { |
|
|
|
|
|
|
|
openBecomeCandidateModal(store) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.on('click', '.js-remove-pool', () => { |
|
|
|
|
|
|
|
openRemovePoolModal(store) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.on('click', '.js-make-stake', event => { |
|
|
|
|
|
|
|
if (checkForTokenDefinition(store)) { |
|
|
|
|
|
|
|
openMakeStakeModal(event, store) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.on('click', '.js-move-stake', event => { |
|
|
|
|
|
|
|
if (checkForTokenDefinition(store)) { |
|
|
|
|
|
|
|
openMoveStakeModal(event, store) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.on('click', '.js-withdraw-stake', event => { |
|
|
|
|
|
|
|
if (checkForTokenDefinition(store)) { |
|
|
|
|
|
|
|
openWithdrawStakeModal(event, store) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.on('click', '.js-claim-withdrawal', event => { |
|
|
|
|
|
|
|
if (checkForTokenDefinition(store)) { |
|
|
|
|
|
|
|
openClaimWithdrawalModal(event, store) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
$stakesPage |
|
|
|
$stakesPage |
|
|
|
.on('change', '[pool-filter-banned]', () => updateFilters(store, 'banned')) |
|
|
|
.on('change', '[pool-filter-banned]', () => updateFilters(store, 'banned')) |
|
|
|