Skip to main content

BcsStruct

@iota/iota-sdk


@iota/iota-sdk / bcs / BcsStruct

Class: BcsStruct<T, Name>

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

Extends

  • BcsType<{ [K in keyof T]: T[K] extends BcsType<infer U, any> ? U : never }, { [K in keyof T]: T[K] extends BcsType<any, infer U> ? U : never }, Name>

Type Parameters

T

T extends Record<string, BcsType<any>>

Name

Name extends string = string

Constructors

Constructor

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

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

Parameters

__namedParameters

BcsStructOptions<T, Name>

Returns

BcsStruct<T, Name>

Overrides

BcsType.constructor

Properties

$inferInput

$inferInput: { [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }

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

Inherited from

BcsType.$inferInput


$inferType

$inferType: { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

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) => { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

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

Parameters

reader

BcsReader

Returns

{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

Inherited from

BcsType.read


serializedSize

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

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

Parameters

value

{ [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }

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

{ [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }

Returns

void

Inherited from

BcsType.validate

Methods

fromBase58()

fromBase58(b64): { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

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

Parameters

b64

string

Returns

{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

Inherited from

BcsType.fromBase58


fromBase64()

fromBase64(b64): { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

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

Parameters

b64

string

Returns

{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

Inherited from

BcsType.fromBase64


fromHex()

fromHex(hex): { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

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

Parameters

hex

string

Returns

{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

Inherited from

BcsType.fromHex


parse()

parse(bytes): { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

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

Parameters

bytes

Uint8Array

Returns

{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

Inherited from

BcsType.parse


serialize()

serialize(value, options?): SerializedBcs<{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }, { [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }>

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

Parameters

value

{ [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }

options?

BcsWriterOptions

Returns

SerializedBcs<{ [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }, { [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }>

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 = { [K in string | number | symbol]: T[K] extends BcsType<U, any, string> ? U : never }

Input2

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

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

{ [K in string | number | symbol]: T[K] extends BcsType<any, U, string> ? U : never }

writer

BcsWriter

Returns

void

Inherited from

BcsType.write