diff --git a/package.json b/package.json
index 9b2d88449f..7213f63aab 100644
--- a/package.json
+++ b/package.json
@@ -8,10 +8,10 @@
"packages/*"
],
"resolutions": {
- "@polkadot/api": "^1.9.0-beta.16",
- "@polkadot/api-contract": "^1.9.0-beta.16",
+ "@polkadot/api": "^1.9.0-beta.18",
+ "@polkadot/api-contract": "^1.9.0-beta.18",
"@polkadot/keyring": "^2.7.0-beta.8",
- "@polkadot/types": "^1.9.0-beta.16",
+ "@polkadot/types": "^1.9.0-beta.18",
"@polkadot/util": "^2.7.0-beta.8",
"@polkadot/util-crypto": "^2.7.0-beta.8",
"babel-core": "^7.0.0-bridge.0",
diff --git a/packages/page-contracts/package.json b/packages/page-contracts/package.json
index b1e22ae726..22481b4bbc 100644
--- a/packages/page-contracts/package.json
+++ b/packages/page-contracts/package.json
@@ -12,6 +12,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.9.2",
- "@polkadot/api-contract": "^1.9.0-beta.16"
+ "@polkadot/api-contract": "^1.9.0-beta.18"
}
}
diff --git a/packages/page-council/src/Motions/Motion.tsx b/packages/page-council/src/Motions/Motion.tsx
index 69898cb667..d52df9ba43 100644
--- a/packages/page-council/src/Motions/Motion.tsx
+++ b/packages/page-council/src/Motions/Motion.tsx
@@ -40,7 +40,7 @@ function Motion ({ className, isMember, members, motion: { hash, proposal, votes
{formatNumber(index)} |
diff --git a/packages/page-democracy/src/Overview/DispatchBlock.tsx b/packages/page-democracy/src/Overview/DispatchBlock.tsx
deleted file mode 100644
index 0e48bcdc19..0000000000
--- a/packages/page-democracy/src/Overview/DispatchBlock.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
-// This software may be modified and distributed under the terms
-// of the Apache-2.0 license. See the LICENSE file for details.
-
-import { BlockNumber, Hash, ReferendumIndex } from '@polkadot/types/interfaces';
-import { ITuple } from '@polkadot/types/types';
-
-import React, { useEffect, useState } from 'react';
-import { registry } from '@polkadot/react-api';
-import { Option, StorageKey, Vec, createType } from '@polkadot/types';
-import { hexToU8a } from '@polkadot/util';
-
-import DispatchEntry from './DispatchEntry';
-
-interface Props {
- entries: Option>>>;
- keyPrefix: string;
- storageKey: StorageKey;
-}
-
-interface Entry {
- blockNumber?: BlockNumber;
- hash: Hash;
- referendumIndex: ReferendumIndex;
-}
-
-function DispatchBlock ({ entries, keyPrefix, storageKey }: Props): React.ReactElement | null {
- const [blockNumber, setBlockNumber] = useState();
- const [expanded, setExpanded] = useState([]);
-
- useEffect((): void => {
- keyPrefix && storageKey && setBlockNumber(
- createType(registry, 'BlockNumber', hexToU8a(
- `0x${storageKey.toHex().replace(keyPrefix, '').substr(16)}`)
- )
- );
- }, [keyPrefix, storageKey]);
-
- useEffect((): void => {
- setExpanded(
- entries?.isSome
- ? entries
- .unwrap()
- .map((entry): [Hash, ReferendumIndex] | null => entry.unwrapOr(null))
- .filter((entry): boolean => !!entry)
- .map(([hash, referendumIndex]: any): Entry => ({
- blockNumber, hash, referendumIndex
- }))
- : []
- );
- }, [blockNumber, entries]);
-
- if (!expanded.length) {
- return null;
- }
-
- return (
- <>
- {expanded.map(({ blockNumber, hash, referendumIndex }): React.ReactNode => (
-
- ))}
- >
- );
-}
-
-export default React.memo(DispatchBlock);
diff --git a/packages/page-democracy/src/Overview/DispatchEntry.tsx b/packages/page-democracy/src/Overview/DispatchEntry.tsx
index 8a37cd5566..49f11304c2 100644
--- a/packages/page-democracy/src/Overview/DispatchEntry.tsx
+++ b/packages/page-democracy/src/Overview/DispatchEntry.tsx
@@ -2,15 +2,14 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
-import { AccountId, Balance, BlockNumber, Hash, Proposal, ReferendumIndex } from '@polkadot/types/interfaces';
-import { ITuple } from '@polkadot/types/types';
+import { DeriveDispatch } from '@polkadot/api-derive/types';
+import { BlockNumber } from '@polkadot/types/interfaces';
import BN from 'bn.js';
-import React, { useEffect, useState } from 'react';
+import React from 'react';
import { LinkExternal } from '@polkadot/react-components';
import { useApi, useCall } from '@polkadot/react-hooks';
import { BlockToTime } from '@polkadot/react-query';
-import { Bytes, Option } from '@polkadot/types';
import { formatNumber } from '@polkadot/util';
import { useTranslation } from '../translate';
@@ -18,48 +17,39 @@ import ProposalCell from './ProposalCell';
import PreImageButton from './PreImageButton';
interface Props {
- blockNumber?: BlockNumber;
- hash: Hash;
- referendumIndex: ReferendumIndex;
+ value: DeriveDispatch;
}
-function DispatchEntry ({ blockNumber, hash, referendumIndex }: Props): React.ReactElement {
+function DispatchEntry ({ value: { at, image, imageHash, index } }: Props): React.ReactElement {
const { t } = useTranslation();
const { api } = useApi();
const bestNumber = useCall(api.derive.chain.bestNumber, []) || new BN(0);
- const preimage = useCall |