View on GitHub
File Changes
m
+1/-0

                      
# history plugin for vscode
.history
+
Yoroi Shelley Testnet
m
+7/-7
import URILandingPage from './containers/uri/URILandingPage';
import Transfer from './containers/transfer/Transfer';
import StakingDashboardPage from './containers/wallet/staking/StakingDashboardPage';
-
import StakingSimulatorPage from './containers/wallet/staking/StakingSimulatorPage';
-
import StakingAdvancedSimulatorPage from './containers/wallet/staking/StakingAdvancedSimulatorPage';
+
import StakingSimplePage from './containers/wallet/staking/StakingSimplePage';
+
import StakingAdvancePage from './containers/wallet/staking/StakingAdvancePage';

                      
/* eslint-disable max-len */
export const Routes = (
      <>
        <Route
          exact
-
          path={ROUTES.WALLETS.STAKE_DASHBOARD}
+
          path={ROUTES.WALLETS.DELEGATION_DASHBOARD}
          component={(props) => <StakingDashboardPage {...props} stores={stores} actions={actions} />}
        />
        <Route
          exact
-
          path={ROUTES.WALLETS.STAKE_SIMULATOR}
-
          component={(props) => <StakingSimulatorPage {...props} stores={stores} actions={actions} />}
+
          path={ROUTES.WALLETS.DELEGATION_SIMPLE}
+
          component={(props) => <StakingSimplePage {...props} stores={stores} actions={actions} />}
        />
        <Route
          exact
-
          path={ROUTES.WALLETS.STAKE_ADVANCED_SIMULATOR}
-
          component={(props) => <StakingAdvancedSimulatorPage {...props} stores={stores} actions={actions} />}
+
          path={ROUTES.WALLETS.DELEGATION_ADVANCE}
+
          component={(props) => <StakingAdvancePage {...props} stores={stores} actions={actions} />}
        />
      </>)
    }
    id: 'wallet.navigation.receive',
    defaultMessage: '!!!Receive',
  },
-
  stakeDashboard: {
-
    id: 'wallet.navigation.stakeDashboard',
+
  delegationDashboard: {
+
    id: 'wallet.navigation.delegationDashboard',
    defaultMessage: '!!!Dashboard',
  },
-
  stakeAdvancedSimulator: {
-
    id: 'wallet.navigation.stakeAdvancedSimulator',
-
    defaultMessage: '!!!Advanced staking simulator',
+
  delegationAdvance: {
+
    id: 'wallet.navigation.delegationAdvance',
+
    defaultMessage: '!!!Delegation (Advance)',
  },
-
  stakeSimulator: {
-
    id: 'wallet.navigation.stakeSimulator',
-
    defaultMessage: '!!!Simple staking simulator',
+
  delegationSimple: {
+
    id: 'wallet.navigation.delegationSimple',
+
    defaultMessage: '!!!Delegation (Simple)',
  },
});

                      
            <div className={styles.navItem}>
              <WalletNavButton
                className="stakeDashboard"
-
                label={intl.formatMessage(messages.stakeDashboard)}
+
                label={intl.formatMessage(messages.delegationDashboard)}
                icon={summaryIcon}
-
                isActive={isActiveNavItem('stake-dashboard')}
-
                onClick={() => onNavItemClick('stake-dashboard')}
+
                isActive={isActiveNavItem('delegation-dashboard')}
+
                onClick={() => onNavItemClick('delegation-dashboard')}
              />
            </div>

                      
            <div className={styles.navItem}>
              <WalletNavButton
                className="stakeSimulator"
-
                label={intl.formatMessage(messages.stakeSimulator)}
+
                label={intl.formatMessage(messages.delegationSimple)}
                icon={sendIcon}
-
                isActive={isActiveNavItem('stake-simulator')}
-
                onClick={() => onNavItemClick('stake-simulator')}
+
                isActive={isActiveNavItem('delegation-simple')}
+
                onClick={() => onNavItemClick('delegation-simple')}
              />
            </div>

                      
            <div className={styles.navItem}>
              <WalletNavButton
                className="stakeAdvancedSimulator"
-
                label={intl.formatMessage(messages.stakeAdvancedSimulator)}
+
                label={intl.formatMessage(messages.delegationAdvance)}
                icon={receiveIcon}
-
                isActive={isActiveNavItem('stake-advanced-simulator')}
-
                onClick={() => onNavItemClick('stake-advanced-simulator')}
+
                isActive={isActiveNavItem('delegation-advance')}
+
                onClick={() => onNavItemClick('delegation-advance')}
              />
            </div>
          </>
// @flow

                      
import React from 'react';
-
import MainLayout from '../../MainLayout';
-
import TopBarContainer from '../../TopBarContainer';
import type { InjectedContainerProps } from '../../../types/injectedPropsType';

                      
const prettifyReceivedPools = (pools: Array<{
    return () => {
      window.removeEventListener('message', messageHandler);
    };
-

                      
  }, []);
};

                      
const Staking = (props: InjectedContainerProps) => {
  const iframeRef = React.useRef(null);
-
  const { actions, stores, children } = props;
+
  const { stores, stakingUrl } = props;
  const { profile } = stores;
-
  const topbarContainer = (<TopBarContainer actions={actions} stores={stores} />);

                      
  useIframeMessageReceiver();

                      
-
  const seizaUrl = process.env.SEIZA_FOR_YOROI_URL;
-
  if (seizaUrl == null) {
+
  if (stakingUrl == null) {
    throw new Error('Staking undefined SEIZA_FOR_YOROI_URL should never happen');
  }
  return (
-
    <MainLayout
-
      topbar={topbarContainer}
-
      // TODO: Check Seiza server connection
-
      connectionErrorType="healthy"
-
      actions={actions}
-
      stores={stores}
-
    >
-
      <iframe ref={iframeRef} title="Staking" src={`${seizaUrl}/staking?locale=${profile.currentLocale}`} frameBorder="0" width="100%" height="100%" />;
-
      {children}
-
    </MainLayout>
+
      <iframe ref={iframeRef} title="Staking" src={`${stakingUrl}&locale=${profile.currentLocale}`} frameBorder="0" width="100%" height="100%" />
  );
-

                      
};

                      
export default Staking;
+
// @flow
+
import React, { Component } from 'react';
+
import { observer } from 'mobx-react';
+
import SeizaFetcher from './SeizaFetcher';
+

                      
+
import type { InjectedProps } from '../../../types/injectedPropsType';
+
import {ConfigType} from "../../../../config/config-types";
+

                      
+
type Props = InjectedProps
+

                      
+
declare var CONFIG: ConfigType;
+
const seizaAdvance = CONFIG.seiza.advance;
+

                      
+
@observer
+
export default class StakingAdvancePage extends Component<Props> {
+

                      
+
  render() {
+
    const { stores } = this.props;
+
    return (<SeizaFetcher {...this.props} stores={stores} stakingUrl={seizaAdvance} />);
+
  }
+
}
-
// @flow
-
import React, { Component } from 'react';
-
import { observer } from 'mobx-react';
-
import type { InjectedProps } from '../../../types/injectedPropsType';
-

                      
-
type Props = InjectedProps
-

                      
-
@observer
-
export default class StakingAdvancedSimulatorPage extends Component<Props> {
-

                      
-
  render() {
-
    return (<div>StakingAdvancedSimulatorPage</div>);
-
  }
-
}
+
// @flow
+
import React, { Component } from 'react';
+
import { observer } from 'mobx-react';
+
import SeizaFetcher from './SeizaFetcher';
+

                      
+
import type { InjectedProps } from '../../../types/injectedPropsType';
+
import {ConfigType} from "../../../../config/config-types";
+

                      
+
type Props = InjectedProps;
+

                      
+
declare var CONFIG: ConfigType;
+
const seizaSimple = CONFIG.seiza.simple;
+

                      
+
@observer
+
export default class StakingSimplePage extends Component<Props> {
+

                      
+
  render() {
+
    const { stores } = this.props;
+
    return (<SeizaFetcher {...this.props} stores={stores} stakingUrl={seizaSimple} />);
+
  }
+
}
-
// @flow
-
import React, { Component } from 'react';
-
import { observer } from 'mobx-react';
-

                      
-
import type { InjectedProps } from '../../../types/injectedPropsType';
-

                      
-
type Props = InjectedProps;
-

                      
-
@observer
-
export default class StakingSimulatorPage extends Component<Props> {
-

                      
-
  render() {
-
    return (<div>StakingSimulatorPage</div>);
-
  }
-
}
    TRANSACTIONS: '/wallets/:id/transactions',
    SEND: '/wallets/:id/send',
    RECEIVE: '/wallets/:id/receive',
-
    STAKE_DASHBOARD: '/wallets/:id/stake-dashboard',
-
    STAKE_SIMULATOR: '/wallets/:id/stake-simulator',
-
    STAKE_ADVANCED_SIMULATOR: '/wallets/:id/stake-advanced-simulator',
+
    DELEGATION_DASHBOARD: '/wallets/:id/delegation-dashboard',
+
    DELEGATION_SIMPLE: '/wallets/:id/delegation-simple',
+
    DELEGATION_ADVANCE: '/wallets/:id/delegation-advance',
  },
  SETTINGS: {
    ROOT: '/settings',
    "websocketUrl": "wss://testnet-yoroi-backend.yoroiwallet.com:443",
    "name": "shelley-dev"
  },
+
  "seiza": {
+
    "simple": "http://localhost:3001/staking-simple/list?sortBy=REVENUE&searchText=&performance[]=0&performance[]=100",
+
    "advance": "http://localhost:3001/staking/list?sortBy=REVENUE&searchText=&performance[]=0&performance[]=100"
+
  },
  "app": {
    "walletRefreshInterval": 20000,
    "serverStatusRefreshInterval": 20000,
m
+60/-60
      "dependencies": {
        "abbrev": {
          "version": "1.1.1",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
          "dev": true,
          "optional": true
        },
        "ansi-regex": {
          "version": "2.1.1",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
          "dev": true,
          "optional": true
        },
        "aproba": {
          "version": "1.2.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
          "dev": true,
          "optional": true
        },
        "are-we-there-yet": {
          "version": "1.1.5",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
          "dev": true,
          "optional": true,
        },
        "balanced-match": {
          "version": "1.0.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
          "dev": true,
          "optional": true
        },
        "brace-expansion": {
          "version": "1.1.11",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
          "dev": true,
          "optional": true,
        },
        "code-point-at": {
          "version": "1.1.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
          "dev": true,
          "optional": true
        },
        "concat-map": {
          "version": "0.0.1",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
          "dev": true,
          "optional": true
        },
        "console-control-strings": {
          "version": "1.1.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
          "dev": true,
          "optional": true
        },
        "core-util-is": {
          "version": "1.0.2",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
          "dev": true,
          "optional": true
        },
        "debug": {
          "version": "4.1.1",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
          "dev": true,
          "optional": true,
        },
        "deep-extend": {
          "version": "0.6.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
          "dev": true,
          "optional": true
        },
        "delegates": {
          "version": "1.0.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
          "dev": true,
          "optional": true
        },
        "detect-libc": {
          "version": "1.0.3",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
          "dev": true,
          "optional": true
        },
        "fs.realpath": {
          "version": "1.0.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
          "dev": true,
          "optional": true
        },
        "gauge": {
          "version": "2.7.4",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
          "dev": true,
          "optional": true,
        },
        "glob": {
          "version": "7.1.3",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
          "dev": true,
          "optional": true,
        },
        "has-unicode": {
          "version": "2.0.1",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
          "dev": true,
          "optional": true
        },
        "iconv-lite": {
          "version": "0.4.24",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
          "dev": true,
          "optional": true,
        },
        "ignore-walk": {
          "version": "3.0.1",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
          "dev": true,
          "optional": true,
        },
        "inflight": {
          "version": "1.0.6",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
          "dev": true,
          "optional": true,
        },
        "inherits": {
          "version": "2.0.3",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
          "dev": true,
          "optional": true
        },
        "ini": {
          "version": "1.3.5",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
          "dev": true,
          "optional": true
        },
        "is-fullwidth-code-point": {
          "version": "1.0.0",
-
          "resolved": "",
+
          "resolved": false,
          "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",