|
|
@ -4,6 +4,8 @@
|
|
|
|
import * as SEND from './constants/send';
|
|
|
|
import * as SEND from './constants/send';
|
|
|
|
import * as NOTIFICATION from './constants/notification';
|
|
|
|
import * as NOTIFICATION from './constants/notification';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import * as SessionStorageActions from './SessionStorageActions';
|
|
|
|
|
|
|
|
|
|
|
|
import { estimateGas, getGasPrice, pushTx } from './Web3Actions';
|
|
|
|
import { estimateGas, getGasPrice, pushTx } from './Web3Actions';
|
|
|
|
|
|
|
|
|
|
|
|
import EthereumjsUtil from 'ethereumjs-util';
|
|
|
|
import EthereumjsUtil from 'ethereumjs-util';
|
|
|
@ -150,7 +152,6 @@ export const calculateMaxAmount = (balance: BigNumber, gasPrice: string, gasLimi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const calculate = (prevProps: Props, props: Props) => {
|
|
|
|
export const calculate = (prevProps: Props, props: Props) => {
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
account,
|
|
|
|
account,
|
|
|
|
tokens,
|
|
|
|
tokens,
|
|
|
@ -236,7 +237,7 @@ export const getFeeLevels = (symbol: string, gasPrice: BigNumber | string, gasLi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// initialize component
|
|
|
|
// initialize component
|
|
|
|
export const init = (stateFromStorage: ?State): ThunkAction => {
|
|
|
|
export const init = (): ThunkAction => {
|
|
|
|
return (dispatch: Dispatch, getState: GetState): void => {
|
|
|
|
return (dispatch: Dispatch, getState: GetState): void => {
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
@ -247,6 +248,7 @@ export const init = (stateFromStorage: ?State): ThunkAction => {
|
|
|
|
|
|
|
|
|
|
|
|
if (!account || !network || !web3) return;
|
|
|
|
if (!account || !network || !web3) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const stateFromStorage = SessionStorageActions.load( getState().router.location.pathname );
|
|
|
|
if (stateFromStorage) {
|
|
|
|
if (stateFromStorage) {
|
|
|
|
dispatch({
|
|
|
|
dispatch({
|
|
|
|
type: SEND.INIT,
|
|
|
|
type: SEND.INIT,
|
|
|
@ -855,7 +857,7 @@ export const onSend = (): AsyncAction => {
|
|
|
|
const pendingNonce: number = stateUtils.getPendingNonce(pending);
|
|
|
|
const pendingNonce: number = stateUtils.getPendingNonce(pending);
|
|
|
|
const nonce = pendingNonce >= account.nonce ? pendingNonce + 1 : account.nonce;
|
|
|
|
const nonce = pendingNonce >= account.nonce ? pendingNonce + 1 : account.nonce;
|
|
|
|
|
|
|
|
|
|
|
|
console.warn("NONCEE", nonce, account.nonce, stateUtils.getPendingNonce(pending))
|
|
|
|
console.warn("NONCE", nonce, account.nonce, stateUtils.getPendingNonce(pending))
|
|
|
|
|
|
|
|
|
|
|
|
const txData = {
|
|
|
|
const txData = {
|
|
|
|
address_n,
|
|
|
|
address_n,
|
|
|
@ -930,6 +932,13 @@ export const onSend = (): AsyncAction => {
|
|
|
|
txData,
|
|
|
|
txData,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// clear session storage
|
|
|
|
|
|
|
|
dispatch( SessionStorageActions.clear() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reset form
|
|
|
|
|
|
|
|
dispatch( init() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dispatch({
|
|
|
|
dispatch({
|
|
|
|
type: NOTIFICATION.ADD,
|
|
|
|
type: NOTIFICATION.ADD,
|
|
|
|
payload: {
|
|
|
|
payload: {
|
|
|
|