diff --git a/packages/page-staking/src/Actions/Account/InjectKeys.tsx b/packages/page-staking/src/Actions/Account/InjectKeys.tsx
index ef2dc5bddc..2c04db1103 100644
--- a/packages/page-staking/src/Actions/Account/InjectKeys.tsx
+++ b/packages/page-staking/src/Actions/Account/InjectKeys.tsx
@@ -60,7 +60,7 @@ function InjectKeys ({ onClose }: Props): React.ReactElement | null {
const _onSubmit = useCallback(
(): void => queueRpc({
- rpc: { section: 'author', method: 'insertKey' } as any,
+ rpc: { method: 'insertKey', section: 'author' } as any,
values: [keyType, suri, publicKey]
}),
[keyType, publicKey, queueRpc, suri]
diff --git a/packages/page-staking/src/Actions/Account/Nominate.tsx b/packages/page-staking/src/Actions/Account/Nominate.tsx
index cdcff3c5a3..fef4bb41db 100644
--- a/packages/page-staking/src/Actions/Account/Nominate.tsx
+++ b/packages/page-staking/src/Actions/Account/Nominate.tsx
@@ -24,7 +24,7 @@ interface Props {
const MAX_NOMINEES = 16;
-function Nominate ({ className, controllerId, nominees, onClose, next, stakingOverview, stashId }: Props): React.ReactElement | null {
+function Nominate ({ className, controllerId, next, nominees, onClose, stakingOverview, stashId }: Props): React.ReactElement | null {
const { t } = useTranslation();
const [favorites] = useFavorites(STORE_FAVS_BASE);
const [validators, setValidators] = useState([]);
diff --git a/packages/page-staking/src/Actions/Account/Unbond.tsx b/packages/page-staking/src/Actions/Account/Unbond.tsx
index de5f9f8d28..4096e93b2a 100644
--- a/packages/page-staking/src/Actions/Account/Unbond.tsx
+++ b/packages/page-staking/src/Actions/Account/Unbond.tsx
@@ -122,8 +122,8 @@ class Unbond extends TxComponent {
const { maxUnbond = prevState.maxUnbond, maxBalance = prevState.maxBalance } = newState;
return {
- maxUnbond,
- maxBalance
+ maxBalance,
+ maxUnbond
};
});
}
diff --git a/packages/page-staking/src/Actions/Account/index.tsx b/packages/page-staking/src/Actions/Account/index.tsx
index 999224a91c..f4a74c6c75 100644
--- a/packages/page-staking/src/Actions/Account/index.tsx
+++ b/packages/page-staking/src/Actions/Account/index.tsx
@@ -120,7 +120,7 @@ function Account ({ allStashes, className, isOwnStash, next, onUpdateType, rewar
const balancesAll = useCall(api.derive.balances.all as any, [stashId]);
const stakingAccount = useCall(api.derive.staking.account as any, [stashId]);
const [[payoutRewards, payoutEras, payoutTotal], setStakingRewards] = useState<[DeriveStakerReward[], EraIndex[], BN]>([[], [], new BN(0)]);
- const [{ controllerId, destination, destinationId, hexSessionIdQueue, hexSessionIdNext, isLoading, isOwnController, isStashNominating, isStashValidating, nominees, sessionIds, validatorPrefs }, setStakeState] = useState({ controllerId: null, destinationId: 0, hexSessionIdNext: null, hexSessionIdQueue: null, isLoading: true, isOwnController: false, isStashNominating: false, isStashValidating: false, sessionIds: [] });
+ const [{ controllerId, destination, destinationId, hexSessionIdNext, hexSessionIdQueue, isLoading, isOwnController, isStashNominating, isStashValidating, nominees, sessionIds, validatorPrefs }, setStakeState] = useState({ controllerId: null, destinationId: 0, hexSessionIdNext: null, hexSessionIdQueue: null, isLoading: true, isOwnController: false, isStashNominating: false, isStashValidating: false, sessionIds: [] });
const [activeNoms, setActiveNoms] = useState([]);
const inactiveNoms = useInactives(stashId, nominees);
const [isBondExtraOpen, toggleBondExtra] = useToggle();
diff --git a/packages/page-staking/src/Overview/Address/index.tsx b/packages/page-staking/src/Overview/Address/index.tsx
index f11849bf74..4c80431497 100644
--- a/packages/page-staking/src/Overview/Address/index.tsx
+++ b/packages/page-staking/src/Overview/Address/index.tsx
@@ -50,7 +50,7 @@ function expandInfo ({ exposure, validatorPrefs }: DeriveStakingQuery): StakingS
let stakeOwn: BN | undefined;
if (exposure) {
- nominators = exposure.others.map(({ who, value }): [string, Balance] => [who.toString(), value.unwrap()]);
+ nominators = exposure.others.map(({ value, who }): [string, Balance] => [who.toString(), value.unwrap()]);
stakeTotal = exposure.total.unwrap();
stakeOwn = exposure.own.unwrap();
stakeOther = stakeTotal.sub(stakeOwn);
@@ -75,7 +75,7 @@ function checkVisibility (api: ApiPromise, address: string, filterName: string,
if (filterLower) {
if (accountInfo) {
- const { identity, nickname, accountId, accountIndex } = accountInfo;
+ const { accountId, accountIndex, identity, nickname } = accountInfo;
if (accountId?.toString().includes(filterName) || accountIndex?.toString().includes(filterName)) {
isVisible = true;
@@ -104,7 +104,7 @@ function Address ({ address, className, filterName, hasQueries, isAuthor, isElec
const { api } = useApi();
const accountInfo = useCall(api.derive.accounts.info as any, [address]);
const stakingInfo = useCall(isMain && api.derive.staking.query as any, [address]);
- const [{ commission, nominators, stakeOwn, stakeOther }, setStakingState] = useState({ nominators: [] });
+ const [{ commission, nominators, stakeOther, stakeOwn }, setStakingState] = useState({ nominators: [] });
const [isVisible, setIsVisible] = useState(true);
useEffect((): void => {
diff --git a/packages/page-staking/src/Overview/index.tsx b/packages/page-staking/src/Overview/index.tsx
index dd63f19dd3..2f7f31eb3e 100644
--- a/packages/page-staking/src/Overview/index.tsx
+++ b/packages/page-staking/src/Overview/index.tsx
@@ -19,7 +19,7 @@ interface Props extends BareProps {
stakingOverview?: DeriveStakingOverview;
}
-function Overview ({ className, hasQueries, isIntentions, recentlyOnline, next, setNominators, stakingOverview }: Props): React.ReactElement {
+function Overview ({ className, hasQueries, isIntentions, next, recentlyOnline, setNominators, stakingOverview }: Props): React.ReactElement {
const { byAuthor, lastBlockAuthors } = useContext(BlockAuthorsContext);
return (
diff --git a/packages/page-staking/src/Targets/index.tsx b/packages/page-staking/src/Targets/index.tsx
index 7f47a59d1f..645bb96973 100644
--- a/packages/page-staking/src/Targets/index.tsx
+++ b/packages/page-staking/src/Targets/index.tsx
@@ -97,9 +97,9 @@ function extractInfo (allAccounts: string[], amount: BN = new BN(0), electedInfo
const validators = sortValidators(
electedInfo.info.map(({ accountId, exposure: _exposure, validatorPrefs }): ValidatorInfo => {
const exposure = _exposure || {
- total: createType(registry, 'Compact'),
+ others: createType(registry, 'Vec'),
own: createType(registry, 'Compact'),
- others: createType(registry, 'Vec')
+ total: createType(registry, 'Compact')
};
const prefs = (validatorPrefs as (ValidatorPrefs | ValidatorPrefsTo196)) || {
commission: createType(registry, 'Compact')
@@ -132,11 +132,11 @@ function extractInfo (allAccounts: string[], amount: BN = new BN(0), electedInfo
bondOwn,
bondShare: 0,
bondTotal,
+ commissionPer: (((prefs as ValidatorPrefs).commission?.unwrap() || new BN(0)).toNumber() / 10_000_000),
isCommission: !!(prefs as ValidatorPrefs).commission,
isFavorite: favorites.includes(key),
isNominating,
key,
- commissionPer: (((prefs as ValidatorPrefs).commission?.unwrap() || new BN(0)).toNumber() / 10_000_000),
numNominators: exposure.others.length,
rankBondOther: 0,
rankBondOwn: 0,
@@ -183,11 +183,11 @@ function Targets ({ className }: Props): React.ReactElement {
const [_amount, setAmount] = useState(new BN(1_000));
const electedInfo = useCall(api.derive.staking.electedInfo, []);
const [favorites, toggleFavorite] = useFavorites(STORE_FAVS_BASE);
- const [{ nominators, validators, sorted, totalStaked }, setWorkable] = useState({ nominators: [], validators: [] });
+ const [{ nominators, sorted, totalStaked, validators }, setWorkable] = useState({ nominators: [], validators: [] });
const [{ sortBy, sortFromMax }, setSortBy] = useState<{ sortBy: SortBy; sortFromMax: boolean }>({ sortBy: 'rankOverall', sortFromMax: true });
const amount = useDebounce(_amount);
const labels = useMemo(
- (): Record => ({ rankComm: t('commission'), rankBondTotal: t('total stake'), rankBondOwn: t('own stake'), rankBondOther: t('other stake'), rankOverall: t('profit/era est') }),
+ (): Record => ({ rankBondOther: t('other stake'), rankBondOwn: t('own stake'), rankBondTotal: t('total stake'), rankComm: t('commission'), rankOverall: t('profit/era est') }),
[t]
);
@@ -207,7 +207,7 @@ function Targets ({ className }: Props): React.ReactElement {
const { nominators, totalStaked, validators } = extractInfo(allAccounts, amount, electedInfo, favorites, lastReward);
const sorted = sort(sortBy, sortFromMax, validators);
- setWorkable({ nominators, totalStaked, sorted, validators });
+ setWorkable({ nominators, sorted, totalStaked, validators });
}
}, [allAccounts, amount, electedInfo, favorites, lastReward, sortBy, sortFromMax]);
diff --git a/packages/page-storage/src/Query.tsx b/packages/page-storage/src/Query.tsx
index 2eb1470f62..15d07a75e4 100644
--- a/packages/page-storage/src/Query.tsx
+++ b/packages/page-storage/src/Query.tsx
@@ -61,16 +61,16 @@ function typeToString ({ creator: { meta: { modifier, type } } }: StorageEntryPr
function createComponent (type: string, Component: React.ComponentType, defaultProps: DefaultProps, renderHelper: ComponentRenderer): { Component: React.ComponentType; render: (createComponent: RenderFn) => React.ComponentType; refresh: (swallowErrors: boolean, contentShorten: boolean) => React.ComponentType } {
return {
Component,
- // In order to replace the default component during runtime we can provide a RenderFn to create a new 'plugged' component
- render: (createComponent: RenderFn): React.ComponentType =>
- renderHelper(createComponent, defaultProps),
// In order to modify the parameters which are used to render the default component, we can use this method
refresh: (swallowErrors: boolean, contentShorten: boolean): React.ComponentType =>
renderHelper(
(value: any): React.ReactNode =>
{valueToText(type, value, swallowErrors, contentShorten)},
defaultProps
- )
+ ),
+ // In order to replace the default component during runtime we can provide a RenderFn to create a new 'plugged' component
+ render: (createComponent: RenderFn): React.ComponentType =>
+ renderHelper(createComponent, defaultProps)
};
}
diff --git a/packages/page-storage/src/Selection/Modules.tsx b/packages/page-storage/src/Selection/Modules.tsx
index 84c8413a58..3a5fa76644 100644
--- a/packages/page-storage/src/Selection/Modules.tsx
+++ b/packages/page-storage/src/Selection/Modules.tsx
@@ -87,7 +87,7 @@ function Modules ({ onAdd }: Props): React.ReactElement {
_onChangeValues([]);
};
- const { creator: { method, section, meta } } = key;
+ const { creator: { meta, method, section } } = key;
return (
diff --git a/packages/page-sudo/src/Sudo.tsx b/packages/page-sudo/src/Sudo.tsx
index ea9eb915be..3119e7b443 100644
--- a/packages/page-sudo/src/Sudo.tsx
+++ b/packages/page-sudo/src/Sudo.tsx
@@ -26,13 +26,13 @@ interface State {
class Propose extends TxComponent {
public state: State = {
- method: null,
- isValid: false
+ isValid: false,
+ method: null
};
public render (): React.ReactNode {
const { apiDefaultTxSudo, isMine, sudoKey, t } = this.props;
- const { method, isValid } = this.state;
+ const { isValid, method } = this.state;
return isMine
? (
@@ -71,11 +71,10 @@ class Propose extends TxComponent {
this.setState(
(prevState: State): State => {
const { method = prevState.method } = newState;
- const isValid = !!method;
return {
- method,
- isValid
+ isValid: !!method,
+ method
};
}
);
diff --git a/packages/page-sudo/src/index.tsx b/packages/page-sudo/src/index.tsx
index 14fef7c7b7..5635515e0e 100644
--- a/packages/page-sudo/src/index.tsx
+++ b/packages/page-sudo/src/index.tsx
@@ -16,7 +16,7 @@ import { useTranslation } from './translate';
function SudoApp ({ basePath }: Props): React.ReactElement {
const { t } = useTranslation();
- const { allAccounts, sudoKey, isMine } = useSudo();
+ const { allAccounts, isMine, sudoKey } = useSudo();
const items = useMemo(() => [
{
isRoot: true,
diff --git a/packages/page-tech-comm/src/Proposals/Propose.tsx b/packages/page-tech-comm/src/Proposals/Propose.tsx
index 078260f7ca..fcfd5c881c 100644
--- a/packages/page-tech-comm/src/Proposals/Propose.tsx
+++ b/packages/page-tech-comm/src/Proposals/Propose.tsx
@@ -19,7 +19,7 @@ interface Props {
function Propose ({ isMember, members }: Props): React.ReactElement {
const { t } = useTranslation();
const { apiDefaultTxSudo } = useApi();
- const { isOpen, onOpen, onClose } = useModal();
+ const { isOpen, onClose, onOpen } = useModal();
const [accountId, setAcountId] = useState(null);
const [proposal, setProposal] = useState | null>(null);
const [[threshold, hasThreshold], setThreshold] = useState<[BN | null, boolean]>([
diff --git a/packages/page-toolbox/src/Rpc/Results.tsx b/packages/page-toolbox/src/Rpc/Results.tsx
index 27c5030ede..397d705f1a 100644
--- a/packages/page-toolbox/src/Rpc/Results.tsx
+++ b/packages/page-toolbox/src/Rpc/Results.tsx
@@ -26,7 +26,7 @@ function Results ({ queue = [] }: Props): React.ReactElement | null {
return (
- {filtered.map(({ error, id, result, rpc: { section, method } }): React.ReactNode => (
+ {filtered.map(({ error, id, result, rpc: { method, section } }): React.ReactNode => (
|