Skip to content
Snippets Groups Projects
Commit babf1515 authored by Sydney Anne Erickson's avatar Sydney Anne Erickson :chipmunk:
Browse files

Merge branch 'metadata-fix' into 'master'

Metadata fix

See merge request xx-labs/docs!1
parents ee66942c c21c14e9
Branches
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