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

x/polkadot/types-codec/base/Option.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.28/types-codec/base/Option.ts";

Constructors

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

Properties

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

Methods

eq(other?: unknown): boolean
toHuman(isExtended?: boolean): 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>>