Skip to main content
Module

x/polkadot/types-codec/extended/Type.ts

Package publishing for deno.land/x/polkadot
Go to Latest
File

import type { Registry } from '../types/index.ts';
import { Text } from '../native/Text.ts';import { sanitize } from '../utils/index.ts';
/** * @name Type * @description * This is a extended version of Text, specifically to handle types. Here we rely fully * on what Text provides us, however we also adjust the types received from the runtime, * i.e. we remove the `T::` prefixes found in some types for consistency across implementation. */export class Type extends Text { constructor (registry: Registry, value: Text | Uint8Array | string = '') { super(registry, value);
this.setOverride(sanitize(this.toString())); }
/** * @description Returns the base runtime type name for this instance */ public override toRawType (): string { return 'Type'; }}