Update deps (#7626)
This commit is contained in:
parent
f86d879b0b
commit
7b86595272
40
package.json
40
package.json
@ -59,18 +59,18 @@
|
||||
"test:skipped": "echo 'tests skipped'"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/core": "^7.18.0",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@crustio/crust-pin": "^1.0.0",
|
||||
"@pinata/sdk": "^1.1.25",
|
||||
"@polkadot/dev": "^0.66.23",
|
||||
"@polkadot/dev": "^0.66.28",
|
||||
"@types/chart.js": "^2.9.37",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/jest": "^27.5.0",
|
||||
"@types/jest": "^27.5.1",
|
||||
"@types/react-beautiful-dnd": "^13.1.2",
|
||||
"@types/react-copy-to-clipboard": "^5.0.2",
|
||||
"@types/react-dom": "^18.0.3",
|
||||
"@types/react-dom": "^18.0.4",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@types/store": "^2.0.2",
|
||||
"@types/styled-components": "^5.1.25",
|
||||
@ -87,28 +87,28 @@
|
||||
"react-is": "^18.1.0",
|
||||
"source-map-explorer": "^2.5.2",
|
||||
"styled-components": "^5.3.5",
|
||||
"webpack": "^5.72.0",
|
||||
"webpack": "^5.72.1",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^8.4.3-0",
|
||||
"@polkadot/api-augment": "^8.4.3-0",
|
||||
"@polkadot/api-base": "^8.4.3-0",
|
||||
"@polkadot/api-contract": "^8.4.3-0",
|
||||
"@polkadot/api-derive": "^8.4.3-0",
|
||||
"@polkadot/api": "^8.5.1",
|
||||
"@polkadot/api-augment": "^8.5.1",
|
||||
"@polkadot/api-base": "^8.5.1",
|
||||
"@polkadot/api-contract": "^8.5.1",
|
||||
"@polkadot/api-derive": "^8.5.1",
|
||||
"@polkadot/hw-ledger": "^9.2.1",
|
||||
"@polkadot/keyring": "^9.2.1",
|
||||
"@polkadot/networks": "^9.2.1",
|
||||
"@polkadot/phishing": "^0.13.9",
|
||||
"@polkadot/rpc-augment": "^8.4.3-0",
|
||||
"@polkadot/rpc-core": "^8.4.3-0",
|
||||
"@polkadot/rpc-provider": "^8.4.3-0",
|
||||
"@polkadot/types": "^8.4.3-0",
|
||||
"@polkadot/types-augment": "^8.4.3-0",
|
||||
"@polkadot/types-codec": "^8.4.3-0",
|
||||
"@polkadot/types-create": "^8.4.3-0",
|
||||
"@polkadot/types-known": "^8.4.3-0",
|
||||
"@polkadot/types-support": "^8.4.3-0",
|
||||
"@polkadot/rpc-augment": "^8.5.1",
|
||||
"@polkadot/rpc-core": "^8.5.1",
|
||||
"@polkadot/rpc-provider": "^8.5.1",
|
||||
"@polkadot/types": "^8.5.1",
|
||||
"@polkadot/types-augment": "^8.5.1",
|
||||
"@polkadot/types-codec": "^8.5.1",
|
||||
"@polkadot/types-create": "^8.5.1",
|
||||
"@polkadot/types-known": "^8.5.1",
|
||||
"@polkadot/types-support": "^8.5.1",
|
||||
"@polkadot/util": "^9.2.1",
|
||||
"@polkadot/util-crypto": "^9.2.1",
|
||||
"@polkadot/wasm-crypto": "^6.1.1",
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@acala-network/type-definitions": "^4.1.1",
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@bifrost-finance/type-definitions": "1.5.0",
|
||||
"@crustio/type-definitions": "1.3.0",
|
||||
"@darwinia/types": "2.7.5",
|
||||
@ -29,10 +29,10 @@
|
||||
"@metaverse-network-sdk/type-definitions": "^0.0.1-13",
|
||||
"@parallel-finance/type-definitions": "1.7.1",
|
||||
"@phala/typedefs": "0.2.30",
|
||||
"@polkadot/api": "^8.4.3-0",
|
||||
"@polkadot/api-derive": "^8.4.3-0",
|
||||
"@polkadot/api": "^8.5.1",
|
||||
"@polkadot/api-derive": "^8.5.1",
|
||||
"@polkadot/networks": "^9.2.1",
|
||||
"@polkadot/types": "^8.4.3-0",
|
||||
"@polkadot/types": "^8.5.1",
|
||||
"@polkadot/util": "^9.2.1",
|
||||
"@polkadot/x-fetch": "^9.2.1",
|
||||
"@polymathnetwork/polymesh-types": "0.0.2",
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
"sideEffects": false,
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/core": "^7.18.0",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@polkadot/dev": "^0.66.23",
|
||||
"@polkadot/dev": "^0.66.28",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"electron-log": "^4.4.7",
|
||||
"electron-updater": "^4.6.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-dom": "^18.0.3",
|
||||
"@types/react-dom": "^18.0.4",
|
||||
"@types/tmp": "^0.2.3",
|
||||
"babel-loader": "^8.2.5",
|
||||
"copy-webpack-plugin": "^10.2.4",
|
||||
@ -29,6 +29,6 @@
|
||||
"react-dom": "^18.1.0",
|
||||
"thread-loader": "^3.0.4",
|
||||
"tmp": "^0.2.1",
|
||||
"webpack": "^5.72.0"
|
||||
"webpack": "^5.72.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,6 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9"
|
||||
"@babel/runtime": "^7.18.0"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,12 +13,12 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/core": "^7.18.0",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/apps-config": "^0.115.3-13",
|
||||
"@polkadot/apps-routing": "^0.115.3-13",
|
||||
"@polkadot/dev": "^0.66.23",
|
||||
"@polkadot/dev": "^0.66.28",
|
||||
"@polkadot/react-api": "^0.115.3-13",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-hooks": "^0.115.3-13",
|
||||
@ -48,7 +48,7 @@
|
||||
"process": "^0.11.10",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"stream-http": "^3.2.0",
|
||||
"webpack": "^5.72.0",
|
||||
"webpack": "^5.72.1",
|
||||
"webpack-cli": "^4.9.2",
|
||||
"webpack-dev-server": "^4.9.0",
|
||||
"webpack-merge": "^5.8.0"
|
||||
|
||||
@ -13,13 +13,13 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/hw-ledger": "^9.2.1",
|
||||
"@polkadot/phishing": "^0.13.9",
|
||||
"@polkadot/phishing": "^0.13.25",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-hooks": "^0.115.3-13",
|
||||
"@polkadot/util": "^9.2.1",
|
||||
"@polkadot/vanitygen": "^0.51.6",
|
||||
"@polkadot/vanitygen": "^0.51.7",
|
||||
"detect-browser": "^5.3.0",
|
||||
"file-saver": "^2.0.5"
|
||||
},
|
||||
|
||||
@ -13,12 +13,12 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"file-saver": "^2.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^13.2.0",
|
||||
"testcontainers": "^8.10.0"
|
||||
"testcontainers": "^8.10.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"secp256k1": "^3.8.0"
|
||||
}
|
||||
|
||||
@ -13,6 +13,6 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9"
|
||||
"@babel/runtime": "^7.18.0"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api-contract": "^8.4.3-0"
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/api-contract": "^8.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-params": "^0.115.3-13",
|
||||
"@polkadot/react-signer": "^0.115.3-13"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { PalletUniquesInstanceMetadata } from '@polkadot/types/lookup';
|
||||
import type { PalletUniquesItemMetadata } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
|
||||
export interface ItemSupportedIpfsData {
|
||||
@ -14,6 +14,6 @@ export interface ItemInfo {
|
||||
account: AccountId,
|
||||
id: BN;
|
||||
key: string;
|
||||
metadata: PalletUniquesInstanceMetadata | null;
|
||||
metadata: PalletUniquesItemMetadata | null;
|
||||
ipfsData: ItemSupportedIpfsData | null;
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
// Copyright 2017-2022 @polkadot/app-nfts authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { PalletUniquesInstanceMetadata } from '@polkadot/types/lookup';
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { PalletUniquesItemMetadata } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { AccountItem } from '../types';
|
||||
import type { ItemInfo, ItemSupportedIpfsData } from './types';
|
||||
@ -35,7 +36,7 @@ const IPFS_FETCH_OPTIONS = {
|
||||
}
|
||||
};
|
||||
|
||||
function extractInfo ([, itemId]: [BN, BN], metadata: PalletUniquesInstanceMetadata, accountItems: AccountItem[]): ItemInfo {
|
||||
function extractInfo ([, itemId]: [BN, BN], metadata: Option<PalletUniquesItemMetadata>, accountItems: AccountItem[]): ItemInfo {
|
||||
const { accountId } = accountItems.find(({ itemId: _itemId }) => _itemId.eq(itemId)) as AccountItem;
|
||||
|
||||
return {
|
||||
@ -43,18 +44,16 @@ function extractInfo ([, itemId]: [BN, BN], metadata: PalletUniquesInstanceMetad
|
||||
id: itemId,
|
||||
ipfsData: null,
|
||||
key: itemId.toString(),
|
||||
metadata: metadata.isEmpty
|
||||
? null
|
||||
: metadata
|
||||
metadata: metadata.unwrapOr(null)
|
||||
};
|
||||
}
|
||||
|
||||
const addIpfsData = (ipfsData: IpfsData) => (itemInfo: ItemInfo): ItemInfo => {
|
||||
const ipfsHash = itemInfo.metadata?.toHuman()?.data?.toString() || '';
|
||||
const ipfsHash = itemInfo.metadata && itemInfo.metadata.data.toString();
|
||||
|
||||
return {
|
||||
...itemInfo,
|
||||
ipfsData: ipfsData.has(ipfsHash) ? ipfsData.get(ipfsHash) as ItemSupportedIpfsData | null : null
|
||||
ipfsData: (ipfsHash && ipfsData.has(ipfsHash) && ipfsData.get(ipfsHash)) || null
|
||||
};
|
||||
};
|
||||
|
||||
@ -67,11 +66,15 @@ function useItemsInfosImpl (accountItems: AccountItem[]): ItemInfo[] | undefined
|
||||
[accountItems]
|
||||
);
|
||||
|
||||
const metadata = useCall<[[[BN, BN][]], PalletUniquesInstanceMetadata[]]>(api.query.uniques.instanceMetadataOf.multi, [ids], QUERY_OPTS);
|
||||
const metadata = useCall<[[[BN, BN][]], Option<PalletUniquesItemMetadata>[]]>(api.query.uniques.instanceMetadataOf.multi, [ids], QUERY_OPTS);
|
||||
|
||||
const ipfsHashes = useMemo((): string[] | undefined => {
|
||||
if (metadata && metadata[1].length) {
|
||||
return metadata[1].map((metadataItem) => metadataItem.toHuman()?.data?.toString() || '');
|
||||
return metadata[1].map((o) =>
|
||||
o.isSome
|
||||
? o.unwrap().data.toString()
|
||||
: ''
|
||||
);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/app-nfts authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { CollectionInfo } from '../types';
|
||||
|
||||
import React from 'react';
|
||||
@ -37,8 +38,8 @@ function Collection ({ className, value: { details, id, ipfsData } }: Props): Re
|
||||
}
|
||||
</td>
|
||||
<td className='address media--1000'>{details && <AddressSmall value={details.owner} />}</td>
|
||||
<td className='string'>{details?.toJSON()?.isFrozen && t('Frozen')}</td>
|
||||
<td className='number'>{details?.instances && formatNumber(details.instances)}</td>
|
||||
<td className='string'>{details && details.isFrozen.isTrue && t('Frozen')}</td>
|
||||
<td className='number'>{details && formatNumber(details.items || (details as unknown as { instances: BN }).instances)}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { PalletUniquesClassDetails, PalletUniquesClassMetadata } from '@polkadot/types/lookup';
|
||||
import type { PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
|
||||
export interface CollectionSupportedIpfsData {
|
||||
@ -11,20 +11,20 @@ export interface CollectionSupportedIpfsData {
|
||||
}
|
||||
|
||||
export interface CollectionInfo {
|
||||
details: PalletUniquesClassDetails | null;
|
||||
details: PalletUniquesCollectionDetails | null;
|
||||
id: BN;
|
||||
isAdminMe: boolean;
|
||||
isIssuerMe: boolean;
|
||||
isFreezerMe: boolean;
|
||||
isOwnerMe: boolean;
|
||||
key: string;
|
||||
metadata: PalletUniquesClassMetadata | null;
|
||||
metadata: PalletUniquesCollectionMetadata | null;
|
||||
ipfsData: CollectionSupportedIpfsData | null;
|
||||
}
|
||||
|
||||
export interface CollectionInfoComplete extends CollectionInfo {
|
||||
details: PalletUniquesClassDetails;
|
||||
metadata: PalletUniquesClassMetadata;
|
||||
details: PalletUniquesCollectionDetails;
|
||||
metadata: PalletUniquesCollectionMetadata;
|
||||
}
|
||||
|
||||
export interface AccountItem {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { PalletUniquesClassDetails, PalletUniquesClassMetadata } from '@polkadot/types/lookup';
|
||||
import type { PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { CollectionInfo } from './types';
|
||||
|
||||
@ -51,7 +51,7 @@ function isAccount (allAccounts: string[], accountId: AccountId): boolean {
|
||||
return allAccounts.some((a) => a === address);
|
||||
}
|
||||
|
||||
function extractInfo (allAccounts: string[], id: BN, optDetails: Option<PalletUniquesClassDetails>, metadata: PalletUniquesClassMetadata): CollectionInfo {
|
||||
function extractInfo (allAccounts: string[], id: BN, optDetails: Option<PalletUniquesCollectionDetails>, metadata: Option<PalletUniquesCollectionMetadata>): CollectionInfo {
|
||||
const details = optDetails.unwrapOr(null);
|
||||
|
||||
return {
|
||||
@ -68,31 +68,33 @@ function extractInfo (allAccounts: string[], id: BN, optDetails: Option<PalletUn
|
||||
id,
|
||||
ipfsData: null,
|
||||
key: id.toString(),
|
||||
metadata: metadata.isEmpty
|
||||
? null
|
||||
: metadata
|
||||
metadata: metadata.unwrapOr(null)
|
||||
};
|
||||
}
|
||||
|
||||
const addIpfsData = (ipfsData: IpfsData) => (collectionInfo: CollectionInfo): CollectionInfo => {
|
||||
const ipfsHash = collectionInfo.metadata?.toHuman()?.data?.toString() || '';
|
||||
const ipfsHash = collectionInfo.metadata && collectionInfo.metadata.data?.toString();
|
||||
|
||||
return {
|
||||
...collectionInfo,
|
||||
ipfsData: ipfsData.has(ipfsHash) ? ipfsData.get(ipfsHash) as CollectionSupportedIpfsData | null : null
|
||||
ipfsData: (ipfsHash && ipfsData.has(ipfsHash) && ipfsData.get(ipfsHash)) || null
|
||||
};
|
||||
};
|
||||
|
||||
function useCollectionInfosImpl (ids?: BN[]): CollectionInfo[] | undefined {
|
||||
const { api } = useApi();
|
||||
const { allAccounts } = useAccounts();
|
||||
const metadata = useCall<[[BN[]], PalletUniquesClassMetadata[]]>(api.query.uniques.classMetadataOf.multi, [ids], QUERY_OPTS);
|
||||
const details = useCall<[[BN[]], Option<PalletUniquesClassDetails>[]]>(api.query.uniques.class.multi, [ids], QUERY_OPTS);
|
||||
const metadata = useCall<[[BN[]], Option<PalletUniquesCollectionMetadata>[]]>(api.query.uniques.classMetadataOf.multi, [ids], QUERY_OPTS);
|
||||
const details = useCall<[[BN[]], Option<PalletUniquesCollectionDetails>[]]>(api.query.uniques.class.multi, [ids], QUERY_OPTS);
|
||||
const [state, setState] = useState<CollectionInfo[] | undefined>();
|
||||
|
||||
const ipfsHashes = useMemo(
|
||||
() => metadata && metadata[1].length
|
||||
? metadata[1].map((m) => m.toHuman()?.data?.toString() || '')
|
||||
? metadata[1].map((o) =>
|
||||
o.isSome
|
||||
? o.unwrap().data.toString()
|
||||
: ''
|
||||
)
|
||||
: [],
|
||||
[metadata]
|
||||
);
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/apps-config": "^0.115.3-13",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13",
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/app-explorer": "^0.115.3-13",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-params": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13",
|
||||
"@polkadot/react-query": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api": "^8.4.3-0",
|
||||
"@polkadot/extension-compat-metamask": "^0.43.2",
|
||||
"@polkadot/extension-dapp": "^0.43.2",
|
||||
"@polkadot/rpc-provider": "^8.4.3-0",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/api": "^8.5.1",
|
||||
"@polkadot/extension-compat-metamask": "^0.43.3-1",
|
||||
"@polkadot/extension-dapp": "^0.43.3-1",
|
||||
"@polkadot/rpc-provider": "^8.5.1",
|
||||
"fflate": "^0.7.3",
|
||||
"rxjs": "^7.5.5"
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ const onlyOn = (environment: Environment) => <T extends ComponentType<any>>(comp
|
||||
return component;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react/display-name
|
||||
return () => null;
|
||||
};
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.1.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.1.1",
|
||||
"@fortawesome/react-fontawesome": "^0.1.18",
|
||||
@ -28,7 +28,7 @@
|
||||
"@polkadot/util-crypto": "^9.2.1",
|
||||
"chart.js": "^3.7.1",
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^21.8.0",
|
||||
"i18next": "^21.8.3",
|
||||
"i18next-browser-languagedetector": "^6.1.4",
|
||||
"owasp-password-strength-test": "^1.3.0",
|
||||
"react": "^18.1.0",
|
||||
@ -40,8 +40,8 @@
|
||||
"react-i18next": "^11.16.9",
|
||||
"react-is": "^18.1.0",
|
||||
"react-markdown": "^8.0.3",
|
||||
"react-router": "^5.3.1",
|
||||
"react-router-dom": "^5.3.1",
|
||||
"react-router": "^5.3.3",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-tooltip": "^4.2.21",
|
||||
"rehype-raw": "^6.1.1",
|
||||
"semantic-ui-css": "^2.4.1",
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/hw-ledger": "^9.2.1",
|
||||
"is-ipfs": "6.0.2"
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,6 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9"
|
||||
"@babel/runtime": "^7.18.0"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"type": "module",
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@babel/runtime": "^7.18.0",
|
||||
"@polkadot/hw-ledger": "^9.2.1",
|
||||
"@polkadot/react-components": "^0.115.3-13"
|
||||
}
|
||||
|
||||
@ -14,10 +14,10 @@
|
||||
"version": "0.115.3-13",
|
||||
"dependencies": {
|
||||
"@testing-library/react": "^13.2.0",
|
||||
"testcontainers": "^8.10.0"
|
||||
"testcontainers": "^8.10.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "^8.4.3-0",
|
||||
"@polkadot/types-support": "^8.5.1",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"tsconfig-paths": "^3.14.1"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user