- generateTypes(chain, metadata, rpcMethods, runtimeVersion, outDir?, extension?, useSubPaths?): Promise<GeneratedResult>
Parameters
- chain: string
- metadata: {
apis: {
docs: string[];
methods: {
docs: string[];
inputs: {
name: string;
typeId: number;
}[];
name: string;
output: number;
}[];
name: string;
}[];
custom: {
map: ReadonlyMap<string, {
typeId: number;
value: `0x${string}`;
}>;
};
extrinsic: {
addressTypeId: number;
callTypeId: number;
extraTypeId: number;
signatureTypeId: number;
signedExtensions: {
additionalSigned: number;
ident: string;
typeId: number;
}[];
version: number;
};
outerEnums: {
callEnumTypeId: number;
errorEnumTypeId: number;
eventEnumTypeId: number;
};
pallets: {
calls: undefined | number;
constants: {
docs: string[];
name: string;
typeId: number;
value: `0x${string}`;
}[];
docs: string[];
error: undefined | number;
event: undefined | number;
index: number;
name: string;
storage: undefined | {
entries: {
default: `0x${string}`;
docs: string[];
modifier: string;
name: string;
storageType: {
type: "Plain";
value: {
valueTypeId: number;
};
} | {
type: "Map";
value: {
hashers: (...)[];
keyTypeId: number;
valueTypeId: number;
};
};
}[];
prefix: string;
};
}[];
runtimeType: number;
types: {
docs: string[];
id: number;
params: {
name: string;
typeId: undefined | number;
}[];
path: string[];
typeDef:
| {
type: "Struct";
value: {
fields: Field[];
};
}
| {
type: "Enum";
value: {
members: {
docs: string[];
fields: Field[];
index: number;
name: string;
}[];
};
}
| {
type: "Sequence";
value: {
typeParam: number;
};
}
| {
type: "SizedVec";
value: {
len: number;
typeParam: number;
};
}
| {
type: "Tuple";
value: {
fields: number[];
};
}
| {
type: "Primitive";
value: {
kind:
| "bool"
| "u8"
| "i8"
| "u16"
| "i16"
| "u32"
| "i32"
| "u64"
| "i64"
| "u128"
| "i128"
| "u256"
| "i256"
| "str"
| "char";
};
}
| {
type: "Compact";
value: {
typeParam: number;
};
}
| {
type: "BitSequence";
value: {
bitOrderType: number;
bitStoreType: number;
};
};
}[];
}apis: {
docs: string[];
methods: {
docs: string[];
inputs: {
name: string;
typeId: number;
}[];
name: string;
output: number;
}[];
name: string;
}[]
custom: {
map: ReadonlyMap<string, {
typeId: number;
value: `0x${string}`;
}>;
}
map: ReadonlyMap<string, {
typeId: number;
value: `0x${string}`;
}>
extrinsic: {
addressTypeId: number;
callTypeId: number;
extraTypeId: number;
signatureTypeId: number;
signedExtensions: {
additionalSigned: number;
ident: string;
typeId: number;
}[];
version: number;
}
addressTypeId: number
callTypeId: number
extraTypeId: number
signatureTypeId: number
signedExtensions: {
additionalSigned: number;
ident: string;
typeId: number;
}[]
version: number
outerEnums: {
callEnumTypeId: number;
errorEnumTypeId: number;
eventEnumTypeId: number;
}
callEnumTypeId: number
errorEnumTypeId: number
eventEnumTypeId: number
pallets: {
calls: undefined | number;
constants: {
docs: string[];
name: string;
typeId: number;
value: `0x${string}`;
}[];
docs: string[];
error: undefined | number;
event: undefined | number;
index: number;
name: string;
storage: undefined | {
entries: {
default: `0x${string}`;
docs: string[];
modifier: string;
name: string;
storageType: {
type: "Plain";
value: {
valueTypeId: number;
};
} | {
type: "Map";
value: {
hashers: (...)[];
keyTypeId: number;
valueTypeId: number;
};
};
}[];
prefix: string;
};
}[]
runtimeType: number
types: {
docs: string[];
id: number;
params: {
name: string;
typeId: undefined | number;
}[];
path: string[];
typeDef:
| {
type: "Struct";
value: {
fields: Field[];
};
}
| {
type: "Enum";
value: {
members: {
docs: string[];
fields: Field[];
index: number;
name: string;
}[];
};
}
| {
type: "Sequence";
value: {
typeParam: number;
};
}
| {
type: "SizedVec";
value: {
len: number;
typeParam: number;
};
}
| {
type: "Tuple";
value: {
fields: number[];
};
}
| {
type: "Primitive";
value: {
kind:
| "bool"
| "u8"
| "i8"
| "u16"
| "i16"
| "u32"
| "i32"
| "u64"
| "i64"
| "u128"
| "i128"
| "u256"
| "i256"
| "str"
| "char";
};
}
| {
type: "Compact";
value: {
typeParam: number;
};
}
| {
type: "BitSequence";
value: {
bitOrderType: number;
bitStoreType: number;
};
};
}[]
- rpcMethods: string[]
- runtimeVersion: SubstrateRuntimeVersion
- outDir: string = '.'
- extension: string = 'd.ts'
- useSubPaths: boolean = false