Skip to main content

BcsEnum

@iota/iota-sdk


@iota/iota-sdk / bcs / BcsEnum

Class: BcsEnum<T, Name>

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:103

Extends

  • BcsType<EnumOutputShape<{ [K in keyof T]: T[K] extends BcsType<infer U, any> ? U : true }>, EnumInputShape<{ [K in keyof T]: T[K] extends BcsType<any, infer U, any> ? U : boolean | object | null }>, Name>

Type Parameters

T

T extends Record<string, BcsType<any> | null>

Name

Name extends string = string

Constructors

Constructor

new BcsEnum<T, Name>(__namedParameters): BcsEnum<T, Name>

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:108

Parameters

__namedParameters

BcsEnumOptions<T, Name>

Returns

BcsEnum<T, Name>

Overrides

BcsType.constructor

Properties

$inferInput

$inferInput: EnumInputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:12

Inherited from

BcsType.$inferInput


$inferType

$inferType: EnumOutputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:11

Inherited from

BcsType.$inferType


name

name: Name

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:13

Inherited from

BcsType.name


read

read: (reader) => EnumOutputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:14

Parameters

reader

BcsReader

Returns

EnumOutputShape

Inherited from

BcsType.read


serializedSize

serializedSize: (value, options?) => number | null

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:15

Parameters

value

EnumInputShape

options?

BcsWriterOptions

Returns

number | null

Inherited from

BcsType.serializedSize


validate

validate: (value) => void

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:16

Parameters

value

EnumInputShape

Returns

void

Inherited from

BcsType.validate

Methods

fromBase58()

fromBase58(b64): EnumOutputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:29

Parameters

b64

string

Returns

EnumOutputShape

Inherited from

BcsType.fromBase58


fromBase64()

fromBase64(b64): EnumOutputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:30

Parameters

b64

string

Returns

EnumOutputShape

Inherited from

BcsType.fromBase64


fromHex()

fromHex(hex): EnumOutputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:28

Parameters

hex

string

Returns

EnumOutputShape

Inherited from

BcsType.fromHex


parse()

parse(bytes): EnumOutputShape

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:27

Parameters

bytes

Uint8Array

Returns

EnumOutputShape

Inherited from

BcsType.parse


serialize()

serialize(value, options?): SerializedBcs<EnumOutputShape<{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : true }, Extract<keyof T, string>, { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : true }[keyof T] extends Type ? Type extends BcsType<U, U, string> ? U : never : never>, EnumInputShape<{ [K in string | number | symbol]: T[K] extends BcsType<any, U, any> ? U : boolean | object | null }>>

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:26

Parameters

value

EnumInputShape

options?

BcsWriterOptions

Returns

SerializedBcs<EnumOutputShape<{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : true }, Extract<keyof T, string>, { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : true }[keyof T] extends Type ? Type extends BcsType<U, U, string> ? U : never : never>, EnumInputShape<{ [K in string | number | symbol]: T[K] extends BcsType<any, U, any> ? U : boolean | object | null }>>

Inherited from

BcsType.serialize


transform()

transform<T2, Input2, NewName>(__namedParameters): BcsType<T2, Input2, NewName>

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:31

Type Parameters

T2

T2 = EnumOutputShape<{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : true }, Extract<keyof T, string>, { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : true }[keyof T] extends Type ? Type extends BcsType<U, U, string> ? U : never : never>

Input2

Input2 = EnumInputShape<{ [K in string | number | symbol]: T[K] extends BcsType<any, U, any> ? U : boolean | object | null }>

NewName

NewName extends string = Name

Parameters

__namedParameters

object & BcsTypeOptions<T2, Input2, NewName>

Returns

BcsType<T2, Input2, NewName>

Inherited from

BcsType.transform


write()

write(value, writer): void

Defined in: sdk/bcs/dist/cjs/bcs-type.d.ts:25

Parameters

value

EnumInputShape

writer

BcsWriter

Returns

void

Inherited from

BcsType.write