forked from polkadot-js/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
derives.ts
30 lines (25 loc) · 1.09 KB
/
derives.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2017-2024 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition, OverrideBundleType } from '@polkadot/types/types';
import equilibrium from './spec/equilibrium.js';
import genshiro from './spec/genshiro.js';
import interbtc from './spec/interbtc.js';
import mangata from './spec/mangata.js';
import subspace from './spec/subspace.js';
const mapping: [OverrideBundleDefinition, string[]][] = [
[equilibrium, ['Equilibrium', 'Equilibrium-parachain']],
[genshiro, ['Genshiro', 'Gens-parachain']],
[interbtc, ['interbtc-parachain', 'interbtc-standalone', 'interlay-parachain', 'kintsugi-parachain', 'testnet-kintsugi', 'testnet-interlay']],
[subspace, ['subspace']],
[mangata, ['mangata', 'mangata-parachain']]
];
export function applyDerives (typesBundle: OverrideBundleType): OverrideBundleType {
mapping.forEach(([{ derives }, chains]): void => {
chains.forEach((chain): void => {
if (typesBundle.spec?.[chain]) {
typesBundle.spec[chain].derives = derives;
}
});
});
return typesBundle;
}