Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/types/codec/index.ts>Struct

Package publishing for deno.land/x/polkadot
Go to Latest
class Struct
implements IStruct<keyof S>
extends Map<keyof S, Codec>
import { Struct } from "https://deno.land/x/polkadot@0.2.37/types/codec/index.ts";

Constructors

new
Struct(
registry: Registry,
Types: S,
value?:
| V
| Map<unknown, unknown>
| unknown[]
| HexString
| null
,
jsonMap?,
unnamed 4?: DefinitionSetter<Definition>,
)

Type Parameters

optional
S extends TypesDef = TypesDef
optional
V extends [K in keyof S]: any = [K in keyof S]: any
optional
E extends [K in keyof S]: string = [K in keyof S]: string

Properties

optional
createdAtHash: IU8a | undefined
readonly
defKeys: string[]
readonly
encodedLength: number
readonly
hash: IU8a
optional
initialU8aLength: number
readonly
isEmpty: boolean
optional
isStorageFallback: boolean
readonly
registry: Registry
readonly
Type: E

Methods

eq(other?: unknown): boolean
get(key: keyof S): Codec | undefined
getAtIndex(index: number): Codec
getT<T>(key: string): T
inspect(isBare?: BareOpts): Inspect
toArray(): Codec[]
toHex(): HexString
toHuman(isExtended?: boolean): Record<string, AnyJson>
toJSON(): Record<string, AnyJson>
toPrimitive(): Record<string, AnyJson>
toRawType(): string
toString(): string
toU8a(isBare?: BareOpts): Uint8Array

Static Methods

with<S extends TypesDef>(Types: S, jsonMap?: Map<string, string>): CodecClass<Struct<S>>