polkadot-js/api

View on GitHub
packages/types/src/metadata/v10/toV11.ts

Summary

Maintainability
A
0 mins
Test Coverage
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { Registry } from '@polkadot/types-codec/types';
import type { MetadataV10, MetadataV11 } from '../../interfaces/metadata/index.js';

/** @internal */
export function toV11 (registry: Registry, { modules }: MetadataV10): MetadataV11 {
  return registry.createTypeUnsafe('MetadataV11', [{
    // This is new in V11, pass V0 here - something non-existing, telling the API to use
    // the fallback for this information (on-chain detection)
    extrinsic: {
      signedExtensions: [],
      version: 0
    },
    modules
  }]);
}