Use type imports from @polkadot/types/interfaces (#4103)

* Move chain params to apps-config

* Use type imports from @polkadot/types/interfaces
This commit is contained in:
Jaco Greeff 2020-11-29 19:03:06 +01:00 committed by GitHub
parent aa499718c8
commit e6d3c61176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 59 additions and 59 deletions

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { RuntimeVersion } from '@polkadot/types/interfaces';
import type { RuntimeVersion } from '@polkadot/types/interfaces';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,13 +1,13 @@
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Conviction } from '@polkadot/types/interfaces';
import type { AmountValidateState } from '../Accounts/types';
import BN from 'bn.js';
import React, { useState } from 'react';
import { ConvictionDropdown, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components';
import { BalanceFree } from '@polkadot/react-query';
import { Conviction } from '@polkadot/types/interfaces';
import { BN_ZERO } from '@polkadot/util';
import { useTranslation } from '../translate';

View File

@ -3,13 +3,13 @@
import type { TxCallback } from '@polkadot/react-components/Status/types';
import type { Option } from '@polkadot/types';
import type { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces';
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { Button, Card, TxButton } from '@polkadot/react-components';
import { useAccounts, useApi } from '@polkadot/react-hooks';
import { FormatBalance } from '@polkadot/react-query';
import { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces';
import { ClaimStyles } from './Claim';
import Statement from './Statement';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-claims authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EthereumAddress, EcdsaSignature, StatementKind } from '@polkadot/types/interfaces';
import type { EthereumAddress, EcdsaSignature, StatementKind } from '@polkadot/types/interfaces';
import secp256k1 from 'secp256k1/elliptic';
import registry from '@polkadot/react-api/typeRegistry';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-council authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import React, { useState } from 'react';
import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, MemberCount } from '@polkadot/types/interfaces';
import type { AccountId, MemberCount } from '@polkadot/types/interfaces';
import React, { useMemo } from 'react';
import { AddressMini, Expander } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-council authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import type { AccountId, Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import React, { useState } from 'react';
import { Button, Modal, ProposedAction, TxButton, VoteAccount } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Balance } from '@polkadot/types/interfaces';
import type { AccountId, Balance } from '@polkadot/types/interfaces';
import React from 'react';
import { AddressSmall, Tag } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Balance } from '@polkadot/types/interfaces';
import type { AccountId, Balance } from '@polkadot/types/interfaces';
import React from 'react';
import { AddressMini, Expander } from '@polkadot/react-components';

View File

@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { SubmittableExtrinsic } from '@polkadot/api/promise/types';
import { Hash } from '@polkadot/types/interfaces';
import type { Hash } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useEffect, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Hash } from '@polkadot/types/interfaces';
import type { Hash } from '@polkadot/types/interfaces';
import React from 'react';
import { Button } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { PropIndex, Proposal } from '@polkadot/types/interfaces';
import type { PropIndex, Proposal } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useMemo, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { VoteThreshold } from '@polkadot/types/interfaces';
import type { VoteThreshold } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import { useEffect, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { VoteThreshold } from '@polkadot/types/interfaces';
import type { VoteThreshold } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import { calcPassing } from '@polkadot/api-derive/democracy/util';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Header } from '@polkadot/types/interfaces';
import type { Header } from '@polkadot/types/interfaces';
import React from 'react';
import { useApi, useCall } from '@polkadot/react-hooks';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-explorer authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Hash } from '@polkadot/types/interfaces';
import type { Hash } from '@polkadot/types/interfaces';
import React, { useEffect, useState } from 'react';
import { Spinner } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-explorer authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BlockNumber } from '@polkadot/types/interfaces';
import type { BlockNumber } from '@polkadot/types/interfaces';
import React, { useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-explorer authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EventRecord } from '@polkadot/types/interfaces';
import type { EventRecord } from '@polkadot/types/interfaces';
import React from 'react';
import { Event as EventDisplay, Expander } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { PeerInfo } from '@polkadot/types/interfaces';
import type { PeerInfo } from '@polkadot/types/interfaces';
import React, { useRef } from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-parachains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ParaId, ParachainProposal } from '@polkadot/types/interfaces';
import type { ParaId, ParachainProposal } from '@polkadot/types/interfaces';
export interface ProposalExt {
id: ParaId;

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-parachains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { UpwardMessage } from '@polkadot/types/interfaces';
import type { UpwardMessage } from '@polkadot/types/interfaces';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-society authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Bid } from '@polkadot/types/interfaces';
import type { Bid } from '@polkadot/types/interfaces';
import React, { useEffect, useState } from 'react';
import { AddressSmall, TxButton } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-society authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Bid } from '@polkadot/types/interfaces';
import type { Bid } from '@polkadot/types/interfaces';
import React, { useRef } from 'react';
import { Table } from '@polkadot/react-components';

View File

@ -3,7 +3,7 @@
// Adapted (wih permission) from https://www.w3schools.com/code/tryit.asp?filename=GGIGKE2GG7N1
import { AccountId } from '@polkadot/types/interfaces';
import type { AccountId } from '@polkadot/types/interfaces';
// const DEFAULT_FN = (ctx: CanvasRenderingContext2D, path: Path2D) => ctx.fill(path);
const PADD = 25;

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-society authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { SocietyVote } from '@polkadot/types/interfaces';
import type { SocietyVote } from '@polkadot/types/interfaces';
export interface OwnMembers {
allMembers: string[];

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-society authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Bid } from '@polkadot/types/interfaces';
import type { Bid } from '@polkadot/types/interfaces';
import { useApi, useCall } from '@polkadot/react-hooks';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, StakingLedger } from '@polkadot/types/interfaces';
import type { AccountId, StakingLedger } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Balance, UnappliedSlashOther } from '@polkadot/types/interfaces';
import type { AccountId, Balance, UnappliedSlashOther } from '@polkadot/types/interfaces';
import BN from 'bn.js';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EraIndex, SlashingSpans } from '@polkadot/types/interfaces';
import type { EraIndex, SlashingSpans } from '@polkadot/types/interfaces';
import React, { useMemo } from 'react';
import { AddressMini, Expander, Spinner } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Balance } from '@polkadot/types/interfaces';
import type { Balance } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useMemo } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { UnappliedSlash } from '@polkadot/types/interfaces';
import type { UnappliedSlash } from '@polkadot/types/interfaces';
import BN from 'bn.js';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId } from '@polkadot/types/interfaces';
import type { AccountId } from '@polkadot/types/interfaces';
import React, { useRef } from 'react';
import { AddressSmall, Table, Tag } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import React, { useState } from 'react';
import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Hash } from '@polkadot/types/interfaces';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Hash } from '@polkadot/types/interfaces';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
export interface ComponentProps {
className?: string;

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Hash } from '@polkadot/types/interfaces';
import type { Hash } from '@polkadot/types/interfaces';
import { useApi, useCall } from '@polkadot/react-hooks';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-treasury authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, Balance, BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces';
import type { AccountId, Balance, BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useEffect, useMemo, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Proposal } from '@polkadot/types/interfaces';
import type { Proposal } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Address, AccountId } from '@polkadot/types/interfaces';
import type { Address, AccountId } from '@polkadot/types/interfaces';
import React from 'react';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import React from 'react';
import { Available } from '@polkadot/react-query';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Call } from '@polkadot/types/interfaces';
import type { Call } from '@polkadot/types/interfaces';
import React from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import React, { useEffect, useState } from 'react';
import keyring from '@polkadot/ui-keyring';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import React from 'react';
import { LockedVote } from '@polkadot/react-query';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import React from 'react';
import { Nonce } from '@polkadot/react-query';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Proposal } from '@polkadot/types/interfaces';
import type { Proposal } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Proposal } from '@polkadot/types/interfaces';
import type { Proposal } from '@polkadot/types/interfaces';
export default function isTreasuryProposalVote (proposal?: Proposal | null): boolean {
if (!proposal) {

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
export default function toShortAddress (_address?: AccountId | AccountIndex | Address | string | null | Uint8Array): string {
const address = (_address || '').toString();

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId } from '@polkadot/types/interfaces';
import type { AccountId } from '@polkadot/types/interfaces';
import { useMemo } from 'react';
import { useAccounts, useApi, useCall } from '@polkadot/react-hooks';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId } from '@polkadot/types/interfaces';
import type { AccountId } from '@polkadot/types/interfaces';
import { useApi } from './useApi';
import { useCall } from './useCall';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BlockNumber, Votes } from '@polkadot/types/interfaces';
import type { BlockNumber, Votes } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import { useMemo } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Call } from '@polkadot/types/interfaces';
import type { Call } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import { useEffect, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BlockNumber } from '@polkadot/types/interfaces';
import type { BlockNumber } from '@polkadot/types/interfaces';
import React from 'react';
import { useApi, useCall } from '@polkadot/react-hooks';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BlockNumber } from '@polkadot/types/interfaces';
import type { BlockNumber } from '@polkadot/types/interfaces';
import React from 'react';
import { useApi, useCall } from '@polkadot/react-hooks';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EraRewardPoints } from '@polkadot/types/interfaces';
import type { EraRewardPoints } from '@polkadot/types/interfaces';
import React, { useEffect, useState } from 'react';
import { HeaderExtended } from '@polkadot/api-derive';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Moment } from '@polkadot/types/interfaces';
import type { Moment } from '@polkadot/types/interfaces';
import BN from 'bn.js';
import React, { useEffect, useState } from 'react';

View File

@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BlockNumber, EventRecord } from '@polkadot/types/interfaces';
import type { BlockNumber, EventRecord } from '@polkadot/types/interfaces';
export interface IndexedEvent {
indexes: number[];