Module

x/polkadot/mod.ts>types.Option

Package publishing for deno.land/x/polkadot
Go to Latest
class types.Option
implements IOption<T>
import { types } from "https://dotland.deno.dev/x/polkadot@0.2.38/mod.ts";
const { Option } = types;

Constructors

new
Option(
registry: Registry,
typeName: CodecClass<T> | string,
value?: unknown,
unnamed 3?: DefinitionSetter<CodecClass<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
optional
isStorageFallback: 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>>
import types.Option
import { types } from "https://dotland.deno.dev/x/polkadot@0.2.38/mod.ts";
const { Option } = types;