"use strict";
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
Object.defineProperty(exports, "__esModule", { value: true });
// type overrides for modules (where duplication between modules exist)
const TYPES_MODULES = {
    contracts: {
        StorageKey: 'ContractStorageKey'
    },
    identity: {
        Judgement: 'IdentityJudgement'
    },
    society: {
        Judgement: 'SocietyJudgement',
        Vote: 'SocietyVote'
    },
    treasury: {
        Proposal: 'TreasuryProposal'
    }
};
exports.TYPES_MODULES = TYPES_MODULES;
// these are override types for Polkadot & Kusama chains
// NOTE The SessionKeys definition for Polkadot and Substrate (OpaqueKeys
// implementation) are different. Detect Polkadot and inject the `Keys`
// definition as applicable. (4 keys in substrate vs 5 in Polkadot/CC3).
const TYPES_POLKADOT_VERSIONED = [
    {
        minmax: [1000, undefined],
        types: {
            Keys: 'SessionKeys5'
        }
    }
];
const TYPES_KUSAMA_VERSIONED = [
    {
        minmax: [1019, 1031],
        types: {
            BalanceLock: 'BalanceLockTo212',
            DispatchError: 'DispatchErrorTo198',
            Keys: 'SessionKeys5',
            SlashingSpans: 'SlashingSpansTo204'
        }
    },
    {
        minmax: [1032, 1042],
        types: {
            BalanceLock: 'BalanceLockTo212',
            Keys: 'SessionKeys5',
            SlashingSpans: 'SlashingSpansTo204'
        }
    },
    {
        minmax: [1043, undefined],
        types: {
            BalanceLock: 'BalanceLockTo212',
            Keys: 'SessionKeys5'
        }
    }
];
// Type overrides based on specific nodes
const TYPES_CHAIN = {};
exports.TYPES_CHAIN = TYPES_CHAIN;
// Type overrides based on  metadata versions
const TYPES_META = [
    {
        // NOTE this is for support of old, e.g. Alex, old metadata and BlockNumber/Index
        // This is detected based on metadata version, since this is what we have up-front
        //   v3 = Alex
        //   v4 = v1.0 branch
        minmax: [0, 4],
        types: {
            BlockNumber: 'u64',
            Index: 'u64',
            EventRecord: 'EventRecordTo76',
            ValidatorPrefs: 'ValidatorPrefsTo145'
        }
    }
];
exports.TYPES_META = TYPES_META;
// Type overrides for specific spec types & versions as given in runtimeVersion
const TYPES_SPEC = {
    kusama: TYPES_KUSAMA_VERSIONED,
    polkadot: TYPES_POLKADOT_VERSIONED
};
exports.TYPES_SPEC = TYPES_SPEC;
