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

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

Package publishing for deno.land/x/polkadot
Go to Latest
class Option
implements IOption<T>
import { Option } from "https://deno.land/x/polkadot@0.2.16/types/codec/index.ts";

Constructors

new
Option(
registry: Registry,
typeName: CodecClass<T> | string,
value?: unknown,
unnamed 3?: Options<T>,
)

Type Parameters

T extends Codec

Properties

optional
createdAtHash: IU8a
readonly
encodedLength: number
readonly
hash: IU8a
optional
initialU8aLength: number
readonly
isEmpty: boolean
readonly
isNone: boolean
readonly
isSome: boolean
readonly
registry: Registry
readonly
value: T

Methods

eq(other?: unknown): boolean
inspect(): Inspect
toHex(): HexString
toHuman(isExtended?: boolean): AnyJson
toJSON(): AnyJson
toPrimitive(): AnyJson
toRawType(isBare?: boolean): string
toString(): string
toU8a(isBare?: boolean): Uint8Array
unwrapOr<O>(defaultValue: O): T | O

Static Methods

with<O extends Codec>(Type: CodecClass<O> | string): CodecClass<Option<O>>