Skip to content
Snippets Groups Projects
Commit c21c14e9 authored by Matt Burton's avatar Matt Burton
Browse files

Metadata fix

parent ee66942c
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -15,12 +15,14 @@ import type { Codec, DefinitionRpcParam } from '@polkadot/types/types'; ...@@ -15,12 +15,14 @@ import type { Codec, DefinitionRpcParam } from '@polkadot/types/types';
import fs from 'fs'; import fs from 'fs';
import { result as rpcdata } from '../metadata.json';
import { Metadata, TypeRegistry, Vec } from '@polkadot/types'; import { Metadata, TypeRegistry, Vec } from '@polkadot/types';
import * as definitions from '@polkadot/types/interfaces/definitions'; import * as definitions from '@polkadot/types/interfaces/definitions';
import { getStorage as getSubstrateStorage } from '@polkadot/types/metadata/decorate/storage/getStorage'; import { getStorage as getSubstrateStorage } from '@polkadot/types/metadata/decorate/storage/getStorage';
import { Text } from '@polkadot/types/primitive'; import { Text } from '@polkadot/types/primitive';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import rpcdata from '@polkadot/types-support/metadata/static-substrate'; // import rpcdata from '@polkadot/types-support/metadata/static-substrate';
import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
interface SectionItem { interface SectionItem {
...@@ -414,7 +416,7 @@ function writeFile (name: string, ...chunks: any[]): void { ...@@ -414,7 +416,7 @@ function writeFile (name: string, ...chunks: any[]): void {
export function main (): void { export function main (): void {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcdata); const metadata = new Metadata(registry, rpcdata as `0x${string}`);
registry.setMetadata(metadata); registry.setMetadata(metadata);
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"baseUrl": "/Users/mirabel/Downloads/test", "baseUrl": "/Users/mirabel/Downloads/test",
"moduleResolution": "node", "moduleResolution": "node",
"esModuleInterop": true, "esModuleInterop": true,
"resolveJsonModule": true,
"target": "ES2015", "target": "ES2015",
"paths": { "paths": {
"sample-polkadotjs-typegen/*": ["src/*"], "sample-polkadotjs-typegen/*": ["src/*"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment