diff --git a/packages/app-accounts/src/modals/Transfer.tsx b/packages/app-accounts/src/modals/Transfer.tsx index ebbeb0d783..c1de333a0b 100644 --- a/packages/app-accounts/src/modals/Transfer.tsx +++ b/packages/app-accounts/src/modals/Transfer.tsx @@ -13,7 +13,7 @@ import styled from 'styled-components'; import { Button, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; -import Checks from '@polkadot/react-signer/Checks'; +// import Checks from '@polkadot/react-signer/Checks'; import translate from '../translate'; @@ -68,7 +68,7 @@ function Transfer ({ className, onClose, recipientId: propRecipientId, senderId: const { api } = useApi(); const [amount, setAmount] = useState(new BN(0)); const [extrinsic, setExtrinsic] = useState(null); - const [hasAvailable, setHasAvailable] = useState(true); + const [hasAvailable] = useState(true); const [maxBalance] = useState(new BN(0)); const [recipientId, setRecipientId] = useState(propRecipientId || null); const [senderId, setSenderId] = useState(propSenderId || null); @@ -121,12 +121,12 @@ function Transfer ({ className, onClose, recipientId: propRecipientId, senderId: onChange={setAmount} withMax /> - + /> */} diff --git a/packages/app-staking/src/Actions/Account/Validate.tsx b/packages/app-staking/src/Actions/Account/Validate.tsx index da3c056ab8..bb802f1321 100644 --- a/packages/app-staking/src/Actions/Account/Validate.tsx +++ b/packages/app-staking/src/Actions/Account/Validate.tsx @@ -31,7 +31,7 @@ interface State { validatorPayment: BN; } -const COMM_MUL = new BN(10_000_000); +const COMM_MUL = new BN(10000000); const MAX_COMM = new BN(100); class Validate extends TxComponent { diff --git a/packages/app-staking/src/Overview/Address.tsx b/packages/app-staking/src/Overview/Address.tsx index 2af7ab87cb..2947701630 100644 --- a/packages/app-staking/src/Overview/Address.tsx +++ b/packages/app-staking/src/Overview/Address.tsx @@ -74,7 +74,7 @@ function Address ({ address, authorsMap, className, filter, hasQueries, isElecte setStakingState({ commission: commission - ? `${(commission.toNumber() / 10_000_000).toFixed(2)}%` + ? `${(commission.toNumber() / 10000000).toFixed(2)}%` : undefined, controllerId: controllerId?.toString(), hasNominators: nominators.length !== 0, diff --git a/packages/app-staking/src/Query/Validator.tsx b/packages/app-staking/src/Query/Validator.tsx index 776dcc2f4a..37e595bd8c 100644 --- a/packages/app-staking/src/Query/Validator.tsx +++ b/packages/app-staking/src/Query/Validator.tsx @@ -78,7 +78,7 @@ function extractSplit (values: [Hash, Exposure][], validatorId: string): SplitDa .map(({ accountId, isOwn, value }): SplitEntry => ({ colors: isOwn ? COLORS_MINE : COLORS_OTHER, label: toShortAddress(accountId), - value: value.muln(10_000).div(total).toNumber() / 100 + value: value.muln(10000).div(total).toNumber() / 100 })); } diff --git a/packages/app-staking/src/Targets/Summary.tsx b/packages/app-staking/src/Targets/Summary.tsx index 67ff02b4d1..c1d03699c8 100644 --- a/packages/app-staking/src/Targets/Summary.tsx +++ b/packages/app-staking/src/Targets/Summary.tsx @@ -38,7 +38,7 @@ function Summary ({ lastReward, t, totalStaked }: Props): React.ReactElement { if (totalInsurance && totalStaked?.gtn(0)) { setStakeInfo({ - percentage: `${(totalStaked.muln(10_000).div(totalInsurance).toNumber() / 100).toFixed(2)}%`, + percentage: `${(totalStaked.muln(10000).div(totalInsurance).toNumber() / 100).toFixed(2)}%`, staked: totalStaked.toString() }); } diff --git a/packages/app-staking/src/Targets/index.tsx b/packages/app-staking/src/Targets/index.tsx index d7f3914fe1..3be9a489b4 100644 --- a/packages/app-staking/src/Targets/index.tsx +++ b/packages/app-staking/src/Targets/index.tsx @@ -19,7 +19,7 @@ import translate from '../translate'; import Summary from './Summary'; import Validator from './Validator'; -const PERBILL = new BN(1_000_000_000); +const PERBILL = new BN(1000000000); interface Props extends I18nProps, ComponentProps { } @@ -141,7 +141,7 @@ function Targets ({ className, sessionRewards, t }: Props): React.ReactElement

+ {hash && ( + + {hash.toHex()} + + )} + {mortality && ( + + {mortality} + + )} + {tip && tip.gtn(0) && ( + + + + )} +
); } @@ -85,5 +87,17 @@ export default translate( word-break: unset; word-wrap: unset; } + + .ui--Extrinsic--toplevel { + margin-top: 0.75rem; + + .ui--Labelled { + padding-left: 0; + + label { + left: 1.55rem; + } + } + } ` ); diff --git a/packages/react-signer/src/Checks/index.tsx b/packages/react-signer/src/Checks/index.tsx index 861f6cb008..72145ec535 100644 --- a/packages/react-signer/src/Checks/index.tsx +++ b/packages/react-signer/src/Checks/index.tsx @@ -260,7 +260,16 @@ export function FeeDisplay ({ accountId, balances_all = ZERO_BALANCE, balances_f // )(FeeDisplay) // ); -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export default function Checks (props: any): null { +export default function Checks ({ accountId, extrinsic }: any): null { + const { api } = useApi(); + + useEffect((): void => { + if (accountId && extrinsic?.paymentInfo && api.rpc.payment?.queryInfo) { + // extrinsic + // .paymentInfo(accountId) + // .then((json: any): void => console.log(JSON.stringify({ json }))); + } + }, [api, accountId, extrinsic]); + return null; }