UNPKG

2.57 kBJavaScriptView Raw
1// Copyright 2017-2022 @polkadot/types-known authors & contributors
2// SPDX-License-Identifier: Apache-2.0
3import { objectSpread } from '@polkadot/util'; // type overrides for modules (where duplication between modules exist)
4
5const typesAlias = {
6 assets: {
7 Approval: 'AssetApproval',
8 ApprovalKey: 'AssetApprovalKey',
9 Balance: 'TAssetBalance',
10 DestroyWitness: 'AssetDestroyWitness'
11 },
12 babe: {
13 EquivocationProof: 'BabeEquivocationProof'
14 },
15 balances: {
16 Status: 'BalanceStatus'
17 },
18 beefy: {
19 AuthorityId: 'BeefyId'
20 },
21 contracts: {
22 StorageKey: 'ContractStorageKey'
23 },
24 electionProviderMultiPhase: {
25 Phase: 'ElectionPhase'
26 },
27 ethereum: {
28 Block: 'EthBlock',
29 Header: 'EthHeader',
30 Receipt: 'EthReceipt',
31 Transaction: 'EthTransaction',
32 TransactionStatus: 'EthTransactionStatus'
33 },
34 evm: {
35 Account: 'EvmAccount',
36 Log: 'EvmLog',
37 Vicinity: 'EvmVicinity'
38 },
39 grandpa: {
40 Equivocation: 'GrandpaEquivocation',
41 EquivocationProof: 'GrandpaEquivocationProof'
42 },
43 identity: {
44 Judgement: 'IdentityJudgement'
45 },
46 inclusion: {
47 ValidatorIndex: 'ParaValidatorIndex'
48 },
49 paraDisputes: {
50 ValidatorIndex: 'ParaValidatorIndex'
51 },
52 paraInclusion: {
53 ValidatorIndex: 'ParaValidatorIndex'
54 },
55 paraScheduler: {
56 ValidatorIndex: 'ParaValidatorIndex'
57 },
58 paraShared: {
59 ValidatorIndex: 'ParaValidatorIndex'
60 },
61 parachains: {
62 Id: 'ParaId'
63 },
64 parasDisputes: {
65 ValidatorIndex: 'ParaValidatorIndex'
66 },
67 parasInclusion: {
68 ValidatorIndex: 'ParaValidatorIndex'
69 },
70 parasScheduler: {
71 ValidatorIndex: 'ParaValidatorIndex'
72 },
73 parasShared: {
74 ValidatorIndex: 'ParaValidatorIndex'
75 },
76 proposeParachain: {
77 Proposal: 'ParachainProposal'
78 },
79 proxy: {
80 Announcement: 'ProxyAnnouncement'
81 },
82 scheduler: {
83 ValidatorIndex: 'ParaValidatorIndex'
84 },
85 shared: {
86 ValidatorIndex: 'ParaValidatorIndex'
87 },
88 society: {
89 Judgement: 'SocietyJudgement',
90 Vote: 'SocietyVote'
91 },
92 staking: {
93 Compact: 'CompactAssignments'
94 },
95 treasury: {
96 Proposal: 'TreasuryProposal'
97 },
98 xcm: {
99 AssetId: 'XcmAssetId'
100 },
101 xcmPallet: {
102 AssetId: 'XcmAssetId'
103 }
104};
105/**
106 * @description Get types for specific modules (metadata override)
107 */
108
109export function getAliasTypes({
110 knownTypes
111}, section) {
112 var _knownTypes$typesAlia;
113
114 return objectSpread({}, typesAlias[section], (_knownTypes$typesAlia = knownTypes.typesAlias) === null || _knownTypes$typesAlia === void 0 ? void 0 : _knownTypes$typesAlia[section]);
115}
\No newline at end of file