diff --git a/package.json b/package.json index 457f57529a..ee4a5a7c1c 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,13 @@ "packages/*" ], "resolutions": { - "@polkadot/api": "^4.6.3-9", - "@polkadot/api-contract": "^4.6.3-9", + "@polkadot/api": "^4.6.3-10", + "@polkadot/api-contract": "^4.6.3-10", "@polkadot/hw-ledger": "^6.2.2-7", "@polkadot/keyring": "^6.2.2-7", "@polkadot/networks": "^6.2.2-7", "@polkadot/phishing": "^0.6.104", - "@polkadot/types": "^4.6.3-9", + "@polkadot/types": "^4.6.3-10", "@polkadot/util": "^6.2.2-7", "@polkadot/util-crypto": "^6.2.2-7", "@polkadot/wasm-crypto": "^4.0.2", diff --git a/packages/page-assets/src/Balances/Account.tsx b/packages/page-assets/src/Balances/Account.tsx index 773208a8f5..1055bdda76 100644 --- a/packages/page-assets/src/Balances/Account.tsx +++ b/packages/page-assets/src/Balances/Account.tsx @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/app-assets authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AssetBalance, AssetId } from '@polkadot/types/interfaces'; +import type { AssetBalance, AssetId, TAssetBalance } from '@polkadot/types/interfaces'; import React from 'react'; @@ -16,10 +16,11 @@ interface Props { assetId: AssetId; balance: AssetBalance; className?: string; + minBalance: TAssetBalance; siFormat: [number, string]; } -function Account ({ accountId, assetId, balance: { balance, isFrozen, isSufficient }, className, siFormat }: Props): React.ReactElement { +function Account ({ accountId, assetId, balance: { balance, isFrozen, isSufficient }, className, minBalance, siFormat }: Props): React.ReactElement { const { t } = useTranslation(); return ( @@ -43,6 +44,7 @@ function Account ({ accountId, assetId, balance: { balance, isFrozen, isSufficie diff --git a/packages/page-assets/src/Balances/Transfer.tsx b/packages/page-assets/src/Balances/Transfer.tsx index a97f613657..b947e5dbc2 100644 --- a/packages/page-assets/src/Balances/Transfer.tsx +++ b/packages/page-assets/src/Balances/Transfer.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import type { AssetId } from '@polkadot/types/interfaces'; +import type { AssetId, TAssetBalance } from '@polkadot/types/interfaces'; -import React, { useMemo, useState } from 'react'; +import React, { useState } from 'react'; import { Button, InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; @@ -15,10 +15,11 @@ interface Props { accountId: string; assetId: AssetId; className?: string; + minBalance: TAssetBalance; siFormat: [number, string]; } -function Transfer ({ accountId, assetId, className, siFormat: [siDecimals, siSymbol] }: Props): React.ReactElement { +function Transfer ({ accountId, assetId, className, minBalance, siFormat: [siDecimals, siSymbol] }: Props): React.ReactElement { const { t } = useTranslation(); const { api } = useApi(); const [isOpen, toggleOpen] = useToggle(); @@ -26,11 +27,6 @@ function Transfer ({ accountId, assetId, className, siFormat: [siDecimals, siSym const [recipientId, setRecipientId] = useState(null); const [isProtected, setIsProtected] = useState(true); - const isAmountValid = useMemo( - () => !!amount && !amount.isZero(), - [amount] - ); - return ( <>