diff --git a/packages/apps-config/src/api/chain/crust-maxwell.ts b/packages/apps-config/src/api/chain/crust-maxwell.ts deleted file mode 100644 index 7b6bcb3303..0000000000 --- a/packages/apps-config/src/api/chain/crust-maxwell.ts +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2017-2022 @polkadot/apps-config authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// structs need to be in order -/* eslint-disable sort-keys */ - -export default { - AccountInfo: 'AccountInfoWithProviders', - Address: 'AccountId', - AddressInfo: 'Vec', - LookupSource: 'AccountId', - EraBenefits: { - total_benefits: 'Balance', - total_funds: 'Balance', - used_benefits: 'Balance', - active_era: 'EraIndex' - }, - FeeReductionBenefit: { - funds: 'Balance', - total_fee_reduction_count: 'u32', - used_fee_reduction_quota: 'Balance', - used_fee_reduction_count: 'u32', - refreshed_at: 'EraIndex' - }, - CsmBalance: 'Balance', - CsmBalanceOf: 'Balance', - ETHAddress: 'Vec', - EthereumTxHash: 'H256', - CSMLedger: { - total: 'Compact', - active: 'Compact', - unlocking: 'Vec>' - }, - CSMUnlockChunk: { - value: 'Compact', - bn: 'Compact' - }, - FileInfo: { - file_size: 'u64', - expired_on: 'BlockNumber', - calculated_at: 'BlockNumber', - amount: 'Balance', - prepaid: 'Balance', - reported_replica_count: 'u32', - replicas: 'Vec>' - }, - MerchantLedger: { - reward: 'Balance', - collateral: 'Balance' - }, - Releases: { - _enum: ['V1_0_0', 'V2_0_0'] - }, - Replica: { - who: 'AccountId', - valid_at: 'BlockNumber', - anchor: 'SworkerAnchor', - is_reported: 'bool' - }, - Status: { - _enum: ['Free', 'Reserved'] - }, - UsedInfo: { - used_size: 'u64', - reported_group_count: 'u32', - groups: 'BTreeMap' - }, - Guarantee: { - targets: 'Vec>', - total: 'Compact', - submitted_in: 'EraIndex', - suppressed: 'bool' - }, - ValidatorPrefs: { - guarantee_fee: 'Compact' - }, - IASSig: 'Vec', - Identity: { - anchor: 'SworkerAnchor', - punishment_deadline: 'u64', - group: 'Option' - }, - ISVBody: 'Vec', - MerkleRoot: 'Vec', - ReportSlot: 'u64', - PKInfo: { - code: 'SworkerCode', - anchor: 'Option' - }, - SworkerAnchor: 'Vec', - SworkerCert: 'Vec', - SworkerCode: 'Vec', - SworkerPubKey: 'Vec', - SworkerSignature: 'Vec', - WorkReport: { - report_slot: 'u64', - used: 'u64', - free: 'u64', - reported_files_size: 'u64', - reported_srd_root: 'MerkleRoot', - reported_files_root: 'MerkleRoot' - } -}; diff --git a/packages/apps-config/src/api/chain/index.ts b/packages/apps-config/src/api/chain/index.ts deleted file mode 100644 index 953798e719..0000000000 --- a/packages/apps-config/src/api/chain/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2017-2022 @polkadot/apps-config authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { typesChain } from '@phala/typedefs'; - -import CrustMaxwell from './crust-maxwell'; - -// alphabetical, based on the actual displayed name -export default { - ...typesChain, - 'Crust Maxwell': CrustMaxwell -}; diff --git a/packages/apps-config/src/api/index.ts b/packages/apps-config/src/api/index.ts index 72953868e1..e69f01bd98 100644 --- a/packages/apps-config/src/api/index.ts +++ b/packages/apps-config/src/api/index.ts @@ -3,18 +3,9 @@ import type { OverrideBundleType } from '@polkadot/types/types'; -import typesChain from './chain'; import spec from './spec'; export * from './constants'; export * from './params'; -export function getChainTypes (_specName: string, chainName: string): Record> { - return { - ...(typesChain[chainName as keyof typeof typesChain] || {}) - }; -} - export const typesBundle: OverrideBundleType = { spec }; - -export { typesChain }; diff --git a/packages/apps-config/src/ci/runner.ts b/packages/apps-config/src/ci/runner.ts index 5acec4d253..586f78080f 100644 --- a/packages/apps-config/src/ci/runner.ts +++ b/packages/apps-config/src/ci/runner.ts @@ -6,7 +6,7 @@ import fs from 'fs'; import { ApiPromise, WsProvider } from '@polkadot/api'; import { assert, isError, isString } from '@polkadot/util'; -import { typesBundle, typesChain } from '../api'; +import { typesBundle } from '../api'; import { createWsEndpoints } from '../endpoints'; import { fetchJson } from './fetch'; @@ -41,8 +41,7 @@ function createChecker (issueFile: string, failures: string[]): (name: string, w provider, throwOnConnect: true, throwOnUnknown: false, - typesBundle, - typesChain + typesBundle }); setTimeout((): void => { diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index 1e862330c4..eb216a85dd 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -13,7 +13,7 @@ import store from 'store'; import { ApiPromise, WsProvider } from '@polkadot/api'; import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util'; -import { ethereumChains, typesBundle, typesChain } from '@polkadot/apps-config'; +import { ethereumChains, typesBundle } from '@polkadot/apps-config'; import { web3Accounts, web3Enable } from '@polkadot/extension-dapp'; import { TokenUnit } from '@polkadot/react-components/InputNumber'; import { StatusContext } from '@polkadot/react-components/Status'; @@ -265,8 +265,7 @@ async function createApi (apiUrl: string, signer: ApiSigner, onError: (error: un registry, signer, types, - typesBundle, - typesChain + typesBundle }); // See https://github.com/polkadot-js/api/pull/4672#issuecomment-1078843960 diff --git a/packages/react-hooks/src/useApiUrl.ts b/packages/react-hooks/src/useApiUrl.ts index ca6fc9c247..792ec133e2 100644 --- a/packages/react-hooks/src/useApiUrl.ts +++ b/packages/react-hooks/src/useApiUrl.ts @@ -6,7 +6,7 @@ import type { ProviderInterface } from '@polkadot/rpc-provider/types'; import { useEffect, useMemo, useRef, useState } from 'react'; import { ApiPromise, WsProvider } from '@polkadot/api'; -import { typesBundle, typesChain } from '@polkadot/apps-config'; +import { typesBundle } from '@polkadot/apps-config'; import { arrayShuffle, isString } from '@polkadot/util'; import { createNamedHook } from './createNamedHook'; @@ -45,8 +45,7 @@ function useApiUrlImpl (url?: null | string | string[]): ApiPromise | null { ApiPromise .create({ provider: (providerRef.current = new WsProvider(urls)), - typesBundle, - typesChain + typesBundle }) .then((api) => mountedRef.current && setState(api)) .catch(console.error);