diff --git a/package.json b/package.json index 05b21f78e7..9d79459112 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@babel/runtime": "^7.15.4", "@crustio/crust-pin": "^1.0.0", "@pinata/sdk": "^1.1.23", - "@polkadot/dev": "^0.63.10", + "@polkadot/dev": "^0.63.18", "@polkadot/ts": "^0.4.12", "@types/bn.js": "^4.11.6", "@types/chart.js": "^2.9.34", @@ -91,15 +91,15 @@ "webpack-cli": "^4.9.1" }, "resolutions": { - "@polkadot/api": "^6.5.3-4", - "@polkadot/api-contract": "^6.5.3-4", + "@polkadot/api": "^6.5.3-7", + "@polkadot/api-contract": "^6.5.3-7", "@polkadot/hw-ledger": "^7.6.1", "@polkadot/keyring": "^7.6.1", "@polkadot/networks": "^7.6.1", - "@polkadot/phishing": "^0.6.383", - "@polkadot/types": "^6.5.3-4", - "@polkadot/types-known": "^6.5.3-4", - "@polkadot/types-support": "^6.5.3-4", + "@polkadot/phishing": "^0.6.389", + "@polkadot/types": "^6.5.3-7", + "@polkadot/types-known": "^6.5.3-7", + "@polkadot/types-support": "^6.5.3-7", "@polkadot/util": "^7.6.1", "@polkadot/util-crypto": "^7.6.1", "@polkadot/wasm-crypto": "^4.2.1", diff --git a/packages/apps-electron/package.json b/packages/apps-electron/package.json index df69e2bbd4..fe2d94fc50 100644 --- a/packages/apps-electron/package.json +++ b/packages/apps-electron/package.json @@ -15,7 +15,7 @@ "dependencies": { "@babel/core": "^7.15.8", "@babel/polyfill": "^7.12.1", - "@polkadot/dev": "^0.63.10", + "@polkadot/dev": "^0.63.18", "@polkadot/react-components": "^0.98.2-20", "electron-log": "^4.4.1", "electron-updater": "^4.6.1" diff --git a/packages/apps/package.json b/packages/apps/package.json index 5d6e18fe0c..447989645a 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -19,7 +19,7 @@ "@babel/runtime": "^7.15.4", "@polkadot/apps-config": "^0.98.2-20", "@polkadot/apps-routing": "^0.98.2-20", - "@polkadot/dev": "^0.63.10", + "@polkadot/dev": "^0.63.18", "@polkadot/react-api": "^0.98.2-20", "@polkadot/react-components": "^0.98.2-20", "@polkadot/react-hooks": "^0.98.2-20", diff --git a/packages/page-accounts/package.json b/packages/page-accounts/package.json index fb9766ec87..6c2a981f17 100644 --- a/packages/page-accounts/package.json +++ b/packages/page-accounts/package.json @@ -15,9 +15,9 @@ "version": "0.98.2-20", "dependencies": { "@babel/runtime": "^7.15.4", - "@polkadot/phishing": "^0.6.383", + "@polkadot/phishing": "^0.6.389", "@polkadot/react-components": "^0.98.2-20", - "@polkadot/vanitygen": "^0.48.2-1", + "@polkadot/vanitygen": "^0.48.2-2", "detect-browser": "^5.2.1", "file-saver": "^2.0.5" }, diff --git a/packages/page-contracts/package.json b/packages/page-contracts/package.json index 77d21d21ff..e358867b9b 100644 --- a/packages/page-contracts/package.json +++ b/packages/page-contracts/package.json @@ -15,6 +15,6 @@ "version": "0.98.2-20", "dependencies": { "@babel/runtime": "^7.15.4", - "@polkadot/api-contract": "^6.5.3-4" + "@polkadot/api-contract": "^6.5.3-7" } } diff --git a/packages/page-parachains/src/Overview/Parachain.tsx b/packages/page-parachains/src/Overview/Parachain.tsx index 9233085289..f3b59832e8 100644 --- a/packages/page-parachains/src/Overview/Parachain.tsx +++ b/packages/page-parachains/src/Overview/Parachain.tsx @@ -1,10 +1,7 @@ // Copyright 2017-2021 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option, Vec } from '@polkadot/types'; -import type { AccountId, BalanceOf, BlockNumber, CandidatePendingAvailability, GroupIndex, HeadData, ParaId } from '@polkadot/types/interfaces'; -import type { PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsParasParaLifecycle } from '@polkadot/types/lookup'; -import type { Codec, ITuple } from '@polkadot/types/types'; +import type { AccountId, GroupIndex, ParaId } from '@polkadot/types/interfaces'; import type { LeasePeriod, QueuedAction } from '../types'; import type { EventMapInfo, ValidatorInfo } from './types'; @@ -12,15 +9,14 @@ import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { AddressMini, Expander, ParaLink } from '@polkadot/react-components'; -import { useApi, useCallMulti } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; import { useTranslation } from '../translate'; -import { sliceHex } from '../util'; import Lifecycle from './Lifecycle'; import ParachainInfo from './ParachainInfo'; import Periods from './Periods'; +import useParaInfo from './useParaInfo'; interface Props { bestNumber?: BN; @@ -36,55 +32,6 @@ interface Props { validators?: [GroupIndex, ValidatorInfo[]]; } -type QueryResult = [Option, Option, Option, Vec, Vec, Vec, Vec, Option, Option, Option, Option>[]]; - -interface QueryState { - headHex: string | null; - leases: number[]; - lifecycle: PolkadotRuntimeParachainsParasParaLifecycle | null; - paraInfo: PolkadotRuntimeCommonParasRegistrarParaInfo | null; - pendingAvail: CandidatePendingAvailability | null; - updateAt: BlockNumber | null; - qDmp: number; - qUmp: number; - qHrmpE: number; - qHrmpI: number; - watermark: BlockNumber | null; -} - -const optionsMulti = { - defaultValue: { - headHex: null, - leases: [], - lifecycle: null, - paraInfo: null, - pendingAvail: null, - qDmp: 0, - qHrmpE: 0, - qHrmpI: 0, - qUmp: 0, - updateAt: null, - watermark: null - }, - transform: ([headData, optUp, optLifecycle, dmp, ump, hrmpE, hrmpI, optWm, optPending, optInfo, leases]: QueryResult): QueryState => ({ - headHex: headData.isSome - ? sliceHex(headData.unwrap()) - : null, - leases: leases - .map((opt, index) => opt.isSome ? index : -1) - .filter((period) => period !== -1), - lifecycle: optLifecycle.unwrapOr(null), - paraInfo: optInfo.unwrapOr(null), - pendingAvail: optPending.unwrapOr(null), - qDmp: dmp.length, - qHrmpE: hrmpE.length, - qHrmpI: hrmpI.length, - qUmp: ump.length, - updateAt: optUp.unwrapOr(null), - watermark: optWm.unwrapOr(null) - }) -}; - function renderAddresses (list?: AccountId[], indices?: BN[]): JSX.Element[] | undefined { return list?.map((id, index) => ( { const { t } = useTranslation(); - const { api } = useApi(); - const paraInfo = useCallMulti([ - [api.query.paras.heads, id], - [api.query.paras.futureCodeUpgrades, id], - [api.query.paras.paraLifecycles, id], - [(api.query.parasDmp || api.query.paraDmp || api.query.dmp)?.downwardMessageQueues, id], - [(api.query.parasUmp || api.query.ump)?.relayDispatchQueues, id], - [(api.query.parasHrmp || api.query.paraHrmp || api.query.hrmp)?.hrmpEgressChannelsIndex, id], - [(api.query.parasHrmp || api.query.paraHrmp || api.query.hrmp)?.hrmpIngressChannelsIndex, id], - [(api.query.parasHrmp || api.query.paraHrmp || api.query.hrmp)?.hrmpWatermarks, id], - [(api.query.parasInclusion || api.query.paraInclusion || api.query.inclusion)?.pendingAvailability, id], - [api.query.registrar.paras, id], - [api.query.slots.leases, id] - ], optionsMulti); + const paraInfo = useParaInfo(id); const [nonBacked, setNonBacked] = useState([]); const blockDelay = useMemo( diff --git a/packages/page-parachains/src/Overview/ParachainInfo.tsx b/packages/page-parachains/src/Overview/ParachainInfo.tsx index 7ec21f5e12..c8b9e33d98 100644 --- a/packages/page-parachains/src/Overview/ParachainInfo.tsx +++ b/packages/page-parachains/src/Overview/ParachainInfo.tsx @@ -20,6 +20,8 @@ const transformHeader = { function ParachainInfo ({ className, id }: Props): React.ReactElement { const { api } = useParaApi(id); + + // We are not using the derive here, we keep this queries to the point to not overload const bestNumber = useCall(api?.rpc.chain.subscribeNewHeads, undefined, transformHeader); const runtimeVersion = useCall(api?.rpc.state.subscribeRuntimeVersion); diff --git a/packages/page-parachains/src/Overview/Parachains.tsx b/packages/page-parachains/src/Overview/Parachains.tsx index a393641fff..765236eeb5 100644 --- a/packages/page-parachains/src/Overview/Parachains.tsx +++ b/packages/page-parachains/src/Overview/Parachains.tsx @@ -1,22 +1,17 @@ // Copyright 2017-2021 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type BN from 'bn.js'; -import type { ApiPromise } from '@polkadot/api'; -import type { SignedBlockExtended } from '@polkadot/api-derive/types'; -import type { Event, ParaId } from '@polkadot/types/interfaces'; -import type { PolkadotPrimitivesV1CandidateReceipt } from '@polkadot/types/lookup'; -import type { IEvent } from '@polkadot/types/types'; +import type { ParaId } from '@polkadot/types/interfaces'; import type { LeasePeriod, QueuedAction, ScheduledProposals } from '../types'; -import type { EventMapInfo } from './types'; -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import React, { useMemo, useRef } from 'react'; import { Table } from '@polkadot/react-components'; -import { useApi, useBestNumber, useCall, useIsParasLinked } from '@polkadot/react-hooks'; +import { useBestNumber, useIsParasLinked } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; import Parachain from './Parachain'; +import useEvents from './useEvents'; import useValidators from './useValidators'; interface Props { @@ -26,28 +21,6 @@ interface Props { scheduled?: ScheduledProposals[]; } -type EventMap = Record; - -interface LastEvents { - lastBacked: EventMap; - lastIncluded: EventMap; - lastTimeout: EventMap; -} - -const EMPTY_EVENTS: LastEvents = { lastBacked: {}, lastIncluded: {}, lastTimeout: {} }; - -function includeEntry (map: EventMap, event: Event, blockHash: string, blockNumber: BN): void { - const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV1CandidateReceipt]>).data[0]; - - if (descriptor) { - map[descriptor.paraId.toString()] = { - blockHash, - blockNumber, - relayParent: descriptor.relayParent.toHex() - }; - } -} - function extractScheduledIds (scheduled: ScheduledProposals[] = []): Record { return scheduled.reduce((all: Record, { scheduledIds }: ScheduledProposals): Record => scheduledIds.reduce((all: Record, id) => ({ @@ -56,47 +29,6 @@ function extractScheduledIds (scheduled: ScheduledProposals[] = []): Record { - if (phase.isApplyExtrinsic) { - if (paraEvents.CandidateBacked.is(event)) { - includeEntry(backed, event, blockHash, blockNumber); - wasBacked = true; - } else if (paraEvents.CandidateIncluded.is(event)) { - includeEntry(included, event, blockHash, blockNumber); - wasIncluded = true; - } else if (paraEvents.CandidateTimedOut.is(event)) { - includeEntry(timeout, event, blockHash, blockNumber); - wasTimeout = true; - } - } - }); - - return wasBacked || wasIncluded || wasTimeout - ? { - lastBacked: wasBacked - ? { ...prev.lastBacked, ...backed } - : prev.lastBacked, - lastIncluded: wasIncluded - ? { ...prev.lastIncluded, ...included } - : prev.lastIncluded, - lastTimeout: wasTimeout - ? { ...prev.lastTimeout, ...timeout } - : prev.lastTimeout - } - : prev; -} - function extractActions (actionsQueue: QueuedAction[], knownIds: [ParaId, string][] = []): Record { return knownIds.reduce((all: Record, [id, key]) => ({ ...all, @@ -121,10 +53,8 @@ function extractIds (hasLinksMap: Record, ids: ParaId[]): [Para function Parachains ({ actionsQueue, ids, leasePeriod, scheduled }: Props): React.ReactElement { const { t } = useTranslation(); - const { api } = useApi(); const bestNumber = useBestNumber(); - const lastBlock = useCall(api.derive.chain.subscribeNewBlocks); - const [{ lastBacked, lastIncluded, lastTimeout }, setLastEvents] = useState(EMPTY_EVENTS); + const { lastBacked, lastIncluded, lastTimeout } = useEvents(); const hasLinksMap = useIsParasLinked(ids); const [validators, validatorMap] = useValidators(ids); @@ -157,12 +87,6 @@ function Parachains ({ actionsQueue, ids, leasePeriod, scheduled }: Props): Reac [actionsQueue, knownIds] ); - useEffect((): void => { - lastBlock && setLastEvents((prev) => - extractEvents(api, lastBlock, prev) - ); - }, [api, lastBlock]); - return ( ('There are no registered parachains')} diff --git a/packages/page-parachains/src/Overview/useEvents.ts b/packages/page-parachains/src/Overview/useEvents.ts new file mode 100644 index 0000000000..69ee20efd1 --- /dev/null +++ b/packages/page-parachains/src/Overview/useEvents.ts @@ -0,0 +1,98 @@ +// Copyright 2017-2021 @polkadot/app-parachains authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type BN from 'bn.js'; +import type { ApiPromise } from '@polkadot/api'; +import type { SignedBlockExtended } from '@polkadot/api-derive/types'; +import type { Event } from '@polkadot/types/interfaces'; +import type { PolkadotPrimitivesV1CandidateReceipt } from '@polkadot/types/lookup'; +import type { IEvent } from '@polkadot/types/types'; +import type { EventMapInfo } from './types'; + +import { useEffect, useState } from 'react'; + +import { createNamedHook, useApi, useCall } from '@polkadot/react-hooks'; +import { stringify } from '@polkadot/util'; + +type EventMap = Record; + +interface Result { + lastBacked: EventMap; + lastIncluded: EventMap; + lastTimeout: EventMap; +} + +const EMPTY_EVENTS: Result = { lastBacked: {}, lastIncluded: {}, lastTimeout: {} }; + +function includeEntry (map: EventMap, event: Event, blockHash: string, blockNumber: BN): void { + try { + const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV1CandidateReceipt]>).data[0]; + + if (descriptor && descriptor.paraId) { + map[descriptor.paraId.toString()] = { + blockHash, + blockNumber, + relayParent: descriptor.relayParent.toHex() + }; + } + } catch (error) { + throw new Error(`${event.section}.${event.method}(${stringify(event.data)}):: ${(error as Error).message}`); + } +} + +function extractEvents (api: ApiPromise, lastBlock: SignedBlockExtended, prev: Result): Result { + const backed: EventMap = {}; + const included: EventMap = {}; + const timeout: EventMap = {}; + const blockNumber = lastBlock.block.header.number.unwrap(); + const blockHash = lastBlock.block.header.hash.toHex(); + const paraEvents = (api.events.paraInclusion || api.events.parasInclusion || api.events.inclusion); + let wasBacked = false; + let wasIncluded = false; + let wasTimeout = false; + + paraEvents && lastBlock.events.forEach(({ event, phase }) => { + if (phase.isApplyExtrinsic) { + if (paraEvents.CandidateBacked.is(event)) { + includeEntry(backed, event, blockHash, blockNumber); + wasBacked = true; + } else if (paraEvents.CandidateIncluded.is(event)) { + includeEntry(included, event, blockHash, blockNumber); + wasIncluded = true; + } else if (paraEvents.CandidateTimedOut.is(event)) { + includeEntry(timeout, event, blockHash, blockNumber); + wasTimeout = true; + } + } + }); + + return wasBacked || wasIncluded || wasTimeout + ? { + lastBacked: wasBacked + ? { ...prev.lastBacked, ...backed } + : prev.lastBacked, + lastIncluded: wasIncluded + ? { ...prev.lastIncluded, ...included } + : prev.lastIncluded, + lastTimeout: wasTimeout + ? { ...prev.lastTimeout, ...timeout } + : prev.lastTimeout + } + : prev; +} + +function useEventsImpl (): Result { + const { api } = useApi(); + const lastBlock = useCall(api.derive.chain.subscribeNewBlocks); + const [state, setState] = useState(EMPTY_EVENTS); + + useEffect((): void => { + lastBlock && setState((prev) => + extractEvents(api, lastBlock, prev) + ); + }, [api, lastBlock]); + + return state; +} + +export default createNamedHook('useEvents', useEventsImpl); diff --git a/packages/page-parachains/src/Overview/useParaInfo.ts b/packages/page-parachains/src/Overview/useParaInfo.ts new file mode 100644 index 0000000000..f768592f44 --- /dev/null +++ b/packages/page-parachains/src/Overview/useParaInfo.ts @@ -0,0 +1,80 @@ +// Copyright 2017-2021 @polkadot/app-parachains authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { Option, Vec } from '@polkadot/types'; +import type { AccountId, BalanceOf, BlockNumber, CandidatePendingAvailability, HeadData, ParaId } from '@polkadot/types/interfaces'; +import type { PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsParasParaLifecycle } from '@polkadot/types/lookup'; +import type { Codec, ITuple } from '@polkadot/types/types'; + +import { createNamedHook, useApi, useCallMulti } from '@polkadot/react-hooks'; + +import { sliceHex } from '../util'; + +type QueryResult = [Option, Option, Option, Vec, Vec, Vec, Vec, Option, Option, Option, Option>[]]; + +interface Result { + headHex: string | null; + leases: number[]; + lifecycle: PolkadotRuntimeParachainsParasParaLifecycle | null; + paraInfo: PolkadotRuntimeCommonParasRegistrarParaInfo | null; + pendingAvail: CandidatePendingAvailability | null; + updateAt: BlockNumber | null; + qDmp: number; + qUmp: number; + qHrmpE: number; + qHrmpI: number; + watermark: BlockNumber | null; +} + +const optionsMulti = { + defaultValue: { + headHex: null, + leases: [], + lifecycle: null, + paraInfo: null, + pendingAvail: null, + qDmp: 0, + qHrmpE: 0, + qHrmpI: 0, + qUmp: 0, + updateAt: null, + watermark: null + }, + transform: ([headData, optUp, optLifecycle, dmp, ump, hrmpE, hrmpI, optWm, optPending, optInfo, leases]: QueryResult): Result => ({ + headHex: headData.isSome + ? sliceHex(headData.unwrap()) + : null, + leases: leases + .map((opt, index) => opt.isSome ? index : -1) + .filter((period) => period !== -1), + lifecycle: optLifecycle.unwrapOr(null), + paraInfo: optInfo.unwrapOr(null), + pendingAvail: optPending.unwrapOr(null), + qDmp: dmp.length, + qHrmpE: hrmpE.length, + qHrmpI: hrmpI.length, + qUmp: ump.length, + updateAt: optUp.unwrapOr(null), + watermark: optWm.unwrapOr(null) + }) +}; + +function useParaInfoImpl (id: ParaId): Result { + const { api } = useApi(); + + return useCallMulti([ + [api.query.paras.heads, id], + [api.query.paras.futureCodeUpgrades, id], + [api.query.paras.paraLifecycles, id], + [(api.query.parasDmp || api.query.paraDmp || api.query.dmp)?.downwardMessageQueues, id], + [(api.query.parasUmp || api.query.ump)?.relayDispatchQueues, id], + [(api.query.parasHrmp || api.query.paraHrmp || api.query.hrmp)?.hrmpEgressChannelsIndex, id], + [(api.query.parasHrmp || api.query.paraHrmp || api.query.hrmp)?.hrmpIngressChannelsIndex, id], + [(api.query.parasHrmp || api.query.paraHrmp || api.query.hrmp)?.hrmpWatermarks, id], + [(api.query.parasInclusion || api.query.paraInclusion || api.query.inclusion)?.pendingAvailability, id], + [api.query.registrar.paras, id], + [api.query.slots.leases, id] + ], optionsMulti); +} + +export default createNamedHook('useParaInfo', useParaInfoImpl); diff --git a/packages/page-parachains/src/Parathreads/Parathread.tsx b/packages/page-parachains/src/Parathreads/Parathread.tsx index 137dc3469d..c2af47ecc1 100644 --- a/packages/page-parachains/src/Parathreads/Parathread.tsx +++ b/packages/page-parachains/src/Parathreads/Parathread.tsx @@ -1,22 +1,20 @@ // Copyright 2017-2021 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { AccountId, HeadData, ParaId } from '@polkadot/types/interfaces'; -import type { PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle } from '@polkadot/types/lookup'; +import type { ParaId } from '@polkadot/types/interfaces'; import type { LeaseInfo, LeasePeriod, QueuedAction } from '../types'; import React, { useMemo } from 'react'; import { AddressSmall, ParaLink, TxButton } from '@polkadot/react-components'; -import { useAccounts, useApi, useCallMulti } from '@polkadot/react-hooks'; +import { useAccounts, useApi } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; import Lifecycle from '../Overview/Lifecycle'; // import ParachainInfo from '../Overview/ParachainInfo'; import Periods from '../Overview/Periods'; import { useTranslation } from '../translate'; -import { sliceHex } from '../util'; +import useThreadInfo from './useThreadInfo'; interface Props { id: ParaId; @@ -25,41 +23,11 @@ interface Props { nextAction?: QueuedAction; } -interface MultiState { - headHex: string | null; - lifecycle: PolkadotRuntimeParachainsParasParaLifecycle | null; - manager: AccountId | null; -} - -const optMulti = { - defaultValue: { - headHex: null, - lifecycle: null, - manager: null - }, - transform: ([optHead, optGenesis, optLifecycle, optInfo]: [Option, Option, Option, Option]): MultiState => ({ - headHex: optHead.isSome - ? sliceHex(optHead.unwrap()) - : optGenesis.isSome - ? sliceHex(optGenesis.unwrap().genesisHead) - : null, - lifecycle: optLifecycle.unwrapOr(null), - manager: optInfo.isSome - ? optInfo.unwrap().manager - : null - }) -}; - -function Upcoming ({ id, leasePeriod, leases, nextAction }: Props): React.ReactElement { +function Parathread ({ id, leasePeriod, leases, nextAction }: Props): React.ReactElement { const { t } = useTranslation(); const { api } = useApi(); const { isAccount } = useAccounts(); - const { headHex, lifecycle, manager } = useCallMulti([ - [api.query.paras.heads, id], - [api.query.paras.upcomingParasGenesis, id], - [api.query.paras.paraLifecycles, id], - [api.query.registrar.paras, id] - ], optMulti); + const { headHex, lifecycle, manager } = useThreadInfo(id); const periods = useMemo( () => leasePeriod?.currentPeriod && leases && @@ -112,4 +80,4 @@ function Upcoming ({ id, leasePeriod, leases, nextAction }: Props): React.ReactE ); } -export default React.memo(Upcoming); +export default React.memo(Parathread); diff --git a/packages/page-parachains/src/Parathreads/index.tsx b/packages/page-parachains/src/Parathreads/index.tsx index 80d928488d..c1f0509781 100644 --- a/packages/page-parachains/src/Parathreads/index.tsx +++ b/packages/page-parachains/src/Parathreads/index.tsx @@ -1,19 +1,17 @@ // Copyright 2017-2021 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { AccountId, BalanceOf, ParaId } from '@polkadot/types/interfaces'; -import type { ITuple } from '@polkadot/types/types'; -import type { LeaseInfo, LeasePeriod, OwnedId, QueuedAction } from '../types'; +import type { ParaId } from '@polkadot/types/interfaces'; +import type { LeasePeriod, OwnedId, QueuedAction } from '../types'; -import React, { useCallback, useRef } from 'react'; +import React, { useRef } from 'react'; import { Table } from '@polkadot/react-components'; -import { useApi, useCall, useIsParasLinked } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; import Actions from './Actions'; import Parathread from './Parathread'; +import useParaMap from './useParaMap'; interface Props { actionsQueue: QueuedAction[]; @@ -23,62 +21,9 @@ interface Props { ownedIds: OwnedId[]; } -type ParaMap = [ParaId, LeaseInfo[]][]; - -function extractParaMap (hasLinksMap: Record, paraIds: ParaId[], leases: Option>[][]): ParaMap { - return paraIds - .reduce((all: ParaMap, id, index): ParaMap => { - all.push([ - id, - leases[index] - .map((optLease, period): LeaseInfo | null => { - if (optLease.isNone) { - return null; - } - - const [accountId, balance] = optLease.unwrap(); - - return { - accountId, - balance, - period - }; - }) - .filter((item): item is LeaseInfo => !!item) - ]); - - return all; - }, []) - .sort(([aId, aLeases], [bId, bLeases]): number => { - const aKnown = hasLinksMap[aId.toString()] || false; - const bKnown = hasLinksMap[bId.toString()] || false; - - return aLeases.length && bLeases.length - ? (aLeases[0].period - bLeases[0].period) || aId.cmp(bId) - : aLeases.length - ? -1 - : bLeases.length - ? 1 - : aKnown === bKnown - ? aId.cmp(bId) - : aKnown - ? -1 - : 1; - }); -} - function Parathreads ({ actionsQueue, className, ids, leasePeriod, ownedIds }: Props): React.ReactElement { const { t } = useTranslation(); - const { api } = useApi(); - const hasLinksMap = useIsParasLinked(ids); - const leaseMap = useCall(ids && api.query.slots.leases.multi, [ids], { - transform: useCallback( - ([[paraIds], leases]: [[ParaId[]], Option>[][]]): ParaMap => - extractParaMap(hasLinksMap, paraIds, leases), - [hasLinksMap] - ), - withParamsTransform: true - }); + const leaseMap = useParaMap(ids); const headerRef = useRef([ [t('parathreads'), 'start', 2], diff --git a/packages/page-parachains/src/Parathreads/useParaMap.ts b/packages/page-parachains/src/Parathreads/useParaMap.ts new file mode 100644 index 0000000000..c455e09126 --- /dev/null +++ b/packages/page-parachains/src/Parathreads/useParaMap.ts @@ -0,0 +1,72 @@ +// Copyright 2017-2021 @polkadot/app-parachains authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { Option } from '@polkadot/types'; +import type { AccountId, BalanceOf, ParaId } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; +import type { LeaseInfo } from '../types'; + +import { useCallback } from 'react'; + +import { createNamedHook, useApi, useCall, useIsParasLinked } from '@polkadot/react-hooks'; + +type Result = [ParaId, LeaseInfo[]][]; + +function extractParaMap (hasLinksMap: Record, paraIds: ParaId[], leases: Option>[][]): Result { + return paraIds + .reduce((all: Result, id, index): Result => { + all.push([ + id, + leases[index] + .map((optLease, period): LeaseInfo | null => { + if (optLease.isNone) { + return null; + } + + const [accountId, balance] = optLease.unwrap(); + + return { + accountId, + balance, + period + }; + }) + .filter((item): item is LeaseInfo => !!item) + ]); + + return all; + }, []) + .sort(([aId, aLeases], [bId, bLeases]): number => { + const aKnown = hasLinksMap[aId.toString()] || false; + const bKnown = hasLinksMap[bId.toString()] || false; + + return aLeases.length && bLeases.length + ? (aLeases[0].period - bLeases[0].period) || aId.cmp(bId) + : aLeases.length + ? -1 + : bLeases.length + ? 1 + : aKnown === bKnown + ? aId.cmp(bId) + : aKnown + ? -1 + : 1; + }); +} + +function useParaMapImpl (ids?: ParaId[]): Result | undefined { + const { api } = useApi(); + const hasLinksMap = useIsParasLinked(ids); + const transform = useCallback( + ([[paraIds], leases]: [[ParaId[]], Option>[][]]): Result => + extractParaMap(hasLinksMap, paraIds, leases), + [hasLinksMap] + ); + + return useCall(ids && api.query.slots.leases.multi, [ids], { + transform, + withParamsTransform: true + }); +} + +export default createNamedHook('useParaMap', useParaMapImpl); diff --git a/packages/page-parachains/src/Parathreads/useThreadInfo.ts b/packages/page-parachains/src/Parathreads/useThreadInfo.ts new file mode 100644 index 0000000000..1f01aed99c --- /dev/null +++ b/packages/page-parachains/src/Parathreads/useThreadInfo.ts @@ -0,0 +1,48 @@ +// Copyright 2017-2021 @polkadot/app-parachains authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { Option } from '@polkadot/types'; +import type { AccountId, HeadData, ParaId } from '@polkadot/types/interfaces'; +import type { PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle } from '@polkadot/types/lookup'; + +import { createNamedHook, useApi, useCallMulti } from '@polkadot/react-hooks'; + +import { sliceHex } from '../util'; + +interface Result { + headHex: string | null; + lifecycle: PolkadotRuntimeParachainsParasParaLifecycle | null; + manager: AccountId | null; +} + +const optMulti = { + defaultValue: { + headHex: null, + lifecycle: null, + manager: null + }, + transform: ([optHead, optGenesis, optLifecycle, optInfo]: [Option, Option, Option, Option]): Result => ({ + headHex: optHead.isSome + ? sliceHex(optHead.unwrap()) + : optGenesis.isSome + ? sliceHex(optGenesis.unwrap().genesisHead) + : null, + lifecycle: optLifecycle.unwrapOr(null), + manager: optInfo.isSome + ? optInfo.unwrap().manager + : null + }) +}; + +function useThreadInfoImpl (id: ParaId): Result { + const { api } = useApi(); + + return useCallMulti([ + [api.query.paras.heads, id], + [api.query.paras.upcomingParasGenesis, id], + [api.query.paras.paraLifecycles, id], + [api.query.registrar.paras, id] + ], optMulti); +} + +export default createNamedHook('useThreadInfo', useThreadInfoImpl); diff --git a/packages/react-api/package.json b/packages/react-api/package.json index 7cc58f5328..6b21eb925f 100644 --- a/packages/react-api/package.json +++ b/packages/react-api/package.json @@ -15,7 +15,7 @@ "version": "0.98.2-20", "dependencies": { "@babel/runtime": "^7.15.4", - "@polkadot/api": "^6.5.3-4", + "@polkadot/api": "^6.5.3-7", "@polkadot/extension-compat-metamask": "^0.40.5-2", "@polkadot/extension-dapp": "^0.40.5-2", "@substrate/connect": "^0.4.6", diff --git a/packages/test-support/package.json b/packages/test-support/package.json index 68f78fef78..8dac90dae2 100644 --- a/packages/test-support/package.json +++ b/packages/test-support/package.json @@ -18,7 +18,7 @@ "testcontainers": "^7.21.0" }, "devDependencies": { - "@polkadot/types-support": "^6.5.3-4", + "@polkadot/types-support": "^6.5.3-7", "@testing-library/jest-dom": "^5.14.1", "tsconfig-paths": "^3.11.0" } diff --git a/yarn.lock b/yarn.lock index 417bb5faf2..7687f2794e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2501,50 +2501,50 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-contract@npm:^6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/api-contract@npm:6.5.3-4" +"@polkadot/api-contract@npm:^6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/api-contract@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/api": 6.5.3-4 - "@polkadot/types": 6.5.3-4 + "@polkadot/api": 6.5.3-7 + "@polkadot/types": 6.5.3-7 "@polkadot/util": ^7.6.1 rxjs: ^7.4.0 - checksum: 67111f94d1f571b7ac31a933696eea4d7535c024fd16c85d2ebe44c9ab567cc083c49042c60f095a68dd7652c31b5d712466f3c6e7581613cc600565b4a703fb + checksum: 8a274ad46810b85bef160beee910fab3e0b9135b099bcd9895bab43de174e760c79c8f01cb1a1db4ec56dbce58f078cedeff3e741221e6f3c0f7ff002136c0f4 languageName: node linkType: hard -"@polkadot/api-derive@npm:6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/api-derive@npm:6.5.3-4" +"@polkadot/api-derive@npm:6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/api-derive@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/api": 6.5.3-4 - "@polkadot/rpc-core": 6.5.3-4 - "@polkadot/types": 6.5.3-4 + "@polkadot/api": 6.5.3-7 + "@polkadot/rpc-core": 6.5.3-7 + "@polkadot/types": 6.5.3-7 "@polkadot/util": ^7.6.1 "@polkadot/util-crypto": ^7.6.1 rxjs: ^7.4.0 - checksum: 430a560ff39ac2f70bb257306dbd593f6c3b35a76e4700538a689c47fe9c1f8e390c0a2be5251cbfa4206dfe351f0c5a01a38eb1fcaa90b04db9dc72702164a2 + checksum: 0ac8258b808ed5f0c99f8c8fc60b7e8c23690f949005e55de3bbea4281908a8c14fd9e2e3cebfb27eac356228c576885a02392d0bb43e2bef7a62f409e1fdac5 languageName: node linkType: hard -"@polkadot/api@npm:^6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/api@npm:6.5.3-4" +"@polkadot/api@npm:^6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/api@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/api-derive": 6.5.3-4 + "@polkadot/api-derive": 6.5.3-7 "@polkadot/keyring": ^7.6.1 - "@polkadot/rpc-core": 6.5.3-4 - "@polkadot/rpc-provider": 6.5.3-4 - "@polkadot/types": 6.5.3-4 - "@polkadot/types-known": 6.5.3-4 + "@polkadot/rpc-core": 6.5.3-7 + "@polkadot/rpc-provider": 6.5.3-7 + "@polkadot/types": 6.5.3-7 + "@polkadot/types-known": 6.5.3-7 "@polkadot/util": ^7.6.1 "@polkadot/util-crypto": ^7.6.1 eventemitter3: ^4.0.7 rxjs: ^7.4.0 - checksum: 59e12d74ddf6b754bd708ed144ff09fd137ab2ef341903c9d872425292f257261c2ecf733c5acbd01e9f1cd7feed55025130eec23c84655f3e164413e81e9408 + checksum: fe07daf9110a737aa7e2c49727155720493a56066f49de0dee56ecd752ce0b05eabfcf0dfdf42e3bce0ea40e958736c3b7387e646aaa607bd5652fc7bcaadcb3 languageName: node linkType: hard @@ -2553,10 +2553,10 @@ __metadata: resolution: "@polkadot/app-accounts@workspace:packages/page-accounts" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/phishing": ^0.6.383 + "@polkadot/phishing": ^0.6.389 "@polkadot/react-components": ^0.98.2-20 "@polkadot/test-support": 0.98.2-20 - "@polkadot/vanitygen": ^0.48.2-1 + "@polkadot/vanitygen": ^0.48.2-2 detect-browser: ^5.2.1 file-saver: ^2.0.5 languageName: unknown @@ -2617,7 +2617,7 @@ __metadata: resolution: "@polkadot/app-contracts@workspace:packages/page-contracts" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/api-contract": ^6.5.3-4 + "@polkadot/api-contract": ^6.5.3-7 languageName: unknown linkType: soft @@ -2837,7 +2837,7 @@ __metadata: dependencies: "@babel/core": ^7.15.8 "@babel/polyfill": ^7.12.1 - "@polkadot/dev": ^0.63.10 + "@polkadot/dev": ^0.63.18 "@polkadot/react-components": ^0.98.2-20 "@types/react-dom": ^17.0.10 "@types/tmp": ^0.2.2 @@ -2871,7 +2871,7 @@ __metadata: "@babel/runtime": ^7.15.4 "@polkadot/apps-config": ^0.98.2-20 "@polkadot/apps-routing": ^0.98.2-20 - "@polkadot/dev": ^0.63.10 + "@polkadot/dev": ^0.63.18 "@polkadot/react-api": ^0.98.2-20 "@polkadot/react-components": ^0.98.2-20 "@polkadot/react-hooks": ^0.98.2-20 @@ -2908,9 +2908,9 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/dev@npm:^0.63.10": - version: 0.63.10 - resolution: "@polkadot/dev@npm:0.63.10" +"@polkadot/dev@npm:^0.63.18": + version: 0.63.18 + resolution: "@polkadot/dev@npm:0.63.18" dependencies: "@babel/cli": ^7.15.7 "@babel/core": ^7.15.8 @@ -2936,10 +2936,10 @@ __metadata: "@rollup/plugin-inject": ^4.0.3 "@rollup/plugin-json": ^4.1.0 "@rollup/plugin-node-resolve": ^13.0.6 - "@rushstack/eslint-patch": ^1.0.8 + "@rushstack/eslint-patch": ^1.0.9 "@typescript-eslint/eslint-plugin": 5.2.0 "@typescript-eslint/parser": 5.2.0 - "@vue/component-compiler-utils": ^3.2.2 + "@vue/component-compiler-utils": ^3.3.0 babel-jest: ^27.3.1 babel-plugin-module-extension-resolver: ^1.0.0-rc.2 babel-plugin-module-resolver: ^4.1.0 @@ -2998,7 +2998,7 @@ __metadata: polkadot-exec-rollup: scripts/polkadot-exec-rollup.cjs polkadot-exec-tsc: scripts/polkadot-exec-tsc.cjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs - checksum: a47ef588d69c35d67fb96ffc8a386de1d5c722dd9817068cc063e0d634c4e9f356e937d572eb46bfdcbd28a4e9822c9469cb6cab8ec2eda024e0053b7d31e63a + checksum: 76c73b040bb02e9b1d7b050718e1e9b8bad4a20850b33e9597d0ccc07981e79c18f19ff3d1b4ab2827b86fe7fede8ee11f83b3ecf3518de7e294164de4b1c130 languageName: node linkType: hard @@ -3095,15 +3095,15 @@ __metadata: languageName: node linkType: hard -"@polkadot/phishing@npm:^0.6.383": - version: 0.6.383 - resolution: "@polkadot/phishing@npm:0.6.383" +"@polkadot/phishing@npm:^0.6.389": + version: 0.6.389 + resolution: "@polkadot/phishing@npm:0.6.389" dependencies: "@babel/runtime": ^7.15.4 "@polkadot/util": ^7.6.1 "@polkadot/util-crypto": ^7.6.1 "@polkadot/x-fetch": ^7.6.1 - checksum: 28c513e98089fc6106359f4d182315382e49274af075330eb94e99a6001766be9569f9441b50eebb76a167a3f6589959874e8001d5909f03ba3807018e26fc47 + checksum: 83800b4960c835ff47a74e28d5997d3fc76d8af0858296b93392d000d9380757be3df3826f996118c7e60535dfcd608d156615d8bd6651c92176e5c4fb725e9a languageName: node linkType: hard @@ -3112,7 +3112,7 @@ __metadata: resolution: "@polkadot/react-api@workspace:packages/react-api" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/api": ^6.5.3-4 + "@polkadot/api": ^6.5.3-7 "@polkadot/extension-compat-metamask": ^0.40.5-2 "@polkadot/extension-dapp": ^0.40.5-2 "@substrate/connect": ^0.4.6 @@ -3245,32 +3245,32 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/rpc-core@npm:6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/rpc-core@npm:6.5.3-4" +"@polkadot/rpc-core@npm:6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/rpc-core@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/rpc-provider": 6.5.3-4 - "@polkadot/types": 6.5.3-4 + "@polkadot/rpc-provider": 6.5.3-7 + "@polkadot/types": 6.5.3-7 "@polkadot/util": ^7.6.1 rxjs: ^7.4.0 - checksum: 96fd54e73770567878d2bbc37da2211d49a2a8efcf4ffd404de8d7207506546cc569b6b8e159312bbffb2bf5accc0cea79008fb9843ea01f446f76e13827f898 + checksum: 066963f79b3d5bcf0f265038e3ad12534218aaed3f8d86c7d82a44f41a89aad8c3fdae2b63f27d627b984ab87988fe1465713aea5d4864ca1046d8b6ea20790c languageName: node linkType: hard -"@polkadot/rpc-provider@npm:6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/rpc-provider@npm:6.5.3-4" +"@polkadot/rpc-provider@npm:6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/rpc-provider@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 - "@polkadot/types": 6.5.3-4 + "@polkadot/types": 6.5.3-7 "@polkadot/util": ^7.6.1 "@polkadot/util-crypto": ^7.6.1 "@polkadot/x-fetch": ^7.6.1 "@polkadot/x-global": ^7.6.1 "@polkadot/x-ws": ^7.6.1 eventemitter3: ^4.0.7 - checksum: 83893a423df5adebf2698097e993a43abaaf7a3783df576d489625b6f257a3d327e41175b1d8f7d8e49bfd83f7e5566d864337db27cc7acd891179efa7faca2a + checksum: 8f1eaccdd2b0c92a4e33efcfd9cabf21962b90c8a27a8609d5b2a705411e9e3517edfcd01211286fbed58c0cebf4138516d1192bb3345284e44fda62bf74ba3a languageName: node linkType: hard @@ -3294,7 +3294,7 @@ __metadata: version: 0.0.0-use.local resolution: "@polkadot/test-support@workspace:packages/test-support" dependencies: - "@polkadot/types-support": ^6.5.3-4 + "@polkadot/types-support": ^6.5.3-7 "@testing-library/jest-dom": ^5.14.1 "@testing-library/react": ^12.1.2 testcontainers: ^7.21.0 @@ -3311,37 +3311,37 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-known@npm:^6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/types-known@npm:6.5.3-4" +"@polkadot/types-known@npm:^6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/types-known@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 "@polkadot/networks": ^7.6.1 - "@polkadot/types": 6.5.3-4 + "@polkadot/types": 6.5.3-7 "@polkadot/util": ^7.6.1 - checksum: f7d5ca275aa024380d494a44bccf01cbaed813757c7924a3bbcb59b3fadfdfb739bd809a03305b399654291766a7bf50d8888afab8a72f1ef9a4d0a122b2eb96 + checksum: e4cc0a68674a16b03b90a3a959da0bf2c9de8046d1c2418139b6ed67b11b83388ea778b15af274b6c675babf007c8b6f30528bd1ee25345f4584b4571330177f languageName: node linkType: hard -"@polkadot/types-support@npm:^6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/types-support@npm:6.5.3-4" +"@polkadot/types-support@npm:^6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/types-support@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 "@polkadot/util": ^7.6.1 - checksum: 61fd4c91a27d0c9920adc6ef3ad2e3ca0f83e20fd80c0ef7b35ecc0dcd28d664668512484230a04dab895913781745b29e94ddbc28b0bae0ef4e9024e3911024 + checksum: abd6b587c68feb198330766d7a0f0e69f5b91635a0daecdb4d9d493f5b88c05b10b115953010a2491b7314a95e932ae0ed30379744594856f009a10e3e7ab5c4 languageName: node linkType: hard -"@polkadot/types@npm:^6.5.3-4": - version: 6.5.3-4 - resolution: "@polkadot/types@npm:6.5.3-4" +"@polkadot/types@npm:^6.5.3-7": + version: 6.5.3-7 + resolution: "@polkadot/types@npm:6.5.3-7" dependencies: "@babel/runtime": ^7.15.4 "@polkadot/util": ^7.6.1 "@polkadot/util-crypto": ^7.6.1 rxjs: ^7.4.0 - checksum: cdeb293982b9bf49322761c121040dbc224a1815a21c65a2bc002b763d742d22345602ba98760f950bce3954296203d2130724a20c709f6c1f22dd331d75733a + checksum: c78cce86fc551c17f73d2d4110ce53e4c87ed68e3ca9a59f9c5c022faf6814680bbf6ee4ee8afc335cb75fc887e2eb54e69031f581d1db5f4bb6ec1198bff7f7 languageName: node linkType: hard @@ -3436,9 +3436,9 @@ __metadata: languageName: node linkType: hard -"@polkadot/vanitygen@npm:^0.48.2-1": - version: 0.48.2-1 - resolution: "@polkadot/vanitygen@npm:0.48.2-1" +"@polkadot/vanitygen@npm:^0.48.2-2": + version: 0.48.2-2 + resolution: "@polkadot/vanitygen@npm:0.48.2-2" dependencies: "@babel/core": ^7.15.8 "@babel/register": ^7.15.3 @@ -3449,7 +3449,7 @@ __metadata: yargs: ^17.2.1 bin: polkadot-js-vanitygen: index.cjs - checksum: 053cca98d859de1b56d3a90df8e3d9da377a5ea7d2e794805b50cc3f8ccf55377f55a1a595e7e9bc850c3941677549e387776cd2ae0360c928c75dbe5b66d6d4 + checksum: 1b33467a9b0d49c3c904c3351102413f73e6d5b64526202450b2d312fc18ace8c22660615f2affb067c3e24b19898a14569a4523ac4fdb4d221969693124f7c5 languageName: node linkType: hard @@ -3636,10 +3636,10 @@ __metadata: languageName: node linkType: hard -"@rushstack/eslint-patch@npm:^1.0.8": - version: 1.0.8 - resolution: "@rushstack/eslint-patch@npm:1.0.8" - checksum: e1c4e2d8317db712a4f24510eacb98c13fd18632eaffae0096a359ab02021ce44c35f614d489741e57f4b0f2d8b11b4b95cdc00aa57753d840d0ba512a5c609e +"@rushstack/eslint-patch@npm:^1.0.9": + version: 1.0.9 + resolution: "@rushstack/eslint-patch@npm:1.0.9" + checksum: 01425d38261013955990e4e923bc57dd1ff258a09740a5cbf5645b6a61cd3c85255edd11801277c07022fabbdfdb39d1d324f6acb1bc0b1795d2a0a187b9569f languageName: node linkType: hard @@ -4776,9 +4776,9 @@ __metadata: languageName: node linkType: hard -"@vue/component-compiler-utils@npm:^3.2.2": - version: 3.2.2 - resolution: "@vue/component-compiler-utils@npm:3.2.2" +"@vue/component-compiler-utils@npm:^3.3.0": + version: 3.3.0 + resolution: "@vue/component-compiler-utils@npm:3.3.0" dependencies: consolidate: ^0.15.1 hash-sum: ^1.0.2 @@ -4786,13 +4786,13 @@ __metadata: merge-source-map: ^1.1.0 postcss: ^7.0.36 postcss-selector-parser: ^6.0.2 - prettier: ^1.18.2 + prettier: ^1.18.2 || ^2.0.0 source-map: ~0.6.1 vue-template-es2015-compiler: ^1.9.0 dependenciesMeta: prettier: optional: true - checksum: ae2d08b4c1907c1bdb2c35e0d67e58afd3afa053bbc5f9cdb6de8915b051124d034cd6b14808aca5c93776289dd832e5514847e4fb925571857aa237262d753a + checksum: 70fee2289a4f54ec1be4d46136ee9b9893e31bf5622cead5be06c3dfb83449c3dbe6f8c03404625ccf302d0628ff9e2ea1debfae609d1bfe1d065d8f57c5dba8 languageName: node linkType: hard @@ -15776,7 +15776,7 @@ __metadata: "@babel/runtime": ^7.15.4 "@crustio/crust-pin": ^1.0.0 "@pinata/sdk": ^1.1.23 - "@polkadot/dev": ^0.63.10 + "@polkadot/dev": ^0.63.18 "@polkadot/ts": ^0.4.12 "@types/bn.js": ^4.11.6 "@types/chart.js": ^2.9.34 @@ -16016,16 +16016,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^1.18.2": - version: 1.19.1 - resolution: "prettier@npm:1.19.1" - bin: - prettier: ./bin-prettier.js - checksum: bc78219e0f8173a808f4c6c8e0a137dd8ebd4fbe013e63fe1a37a82b48612f17b8ae8e18a992adf802ee2cf7428f14f084e7c2846ca5759cf4013c6e54810e1f - languageName: node - linkType: hard - -"prettier@npm:^2.4.1": +"prettier@npm:^1.18.2 || ^2.0.0, prettier@npm:^2.4.1": version: 2.4.1 resolution: "prettier@npm:2.4.1" bin: