Documentation
Preparing search index...
@mysten/bcs
BcsType
Class BcsType<T, Input, Name>
Type Parameters
T
Input
=
T
const
Name
extends
string
=
string
Hierarchy (
View Summary
)
BcsType
BcsEnum
BcsStruct
BcsTuple
Index
Constructors
constructor
Properties
_
codec
$infer
Input
$infer
Type
name
serialized
Size
to
Bytes
validate
Methods
from
Base58
from
Base64
from
Hex
parse
read
serialize
to
Base58
to
Base64
to
Hex
transform
write
Constructors
constructor
new
BcsType
<
T
,
Input
=
T
,
const
Name
extends
string
=
string
>
(
options
:
{
kind
?:
string
;
name
:
Name
;
read
:
(
(
reader
:
BcsReader
)
=>
T
)
|
(
()
=>
T
)
;
serialize
?:
(
value
:
Input
,
options
?:
BcsWriterOptions
,
)
=>
Uint8Array
<
ArrayBuffer
>
;
serializedSize
?:
(
value
:
Input
)
=>
number
|
null
;
validate
?:
(
value
:
Input
)
=>
void
;
write
:
|
(
(
value
:
Input
,
writer
:
BcsWriter
)
=>
void
)
|
(
(
value
:
Input
)
=>
void
)
;
}
&
BcsTypeOptions
<
T
,
Input
,
Name
>
,
)
:
BcsType
<
T
,
Input
,
Name
>
Type Parameters
T
Input
=
T
const
Name
extends
string
=
string
Parameters
options
:
{
kind
?:
string
;
name
:
Name
;
read
:
(
(
reader
:
BcsReader
)
=>
T
)
|
(
()
=>
T
)
;
serialize
?:
(
value
:
Input
,
options
?:
BcsWriterOptions
,
)
=>
Uint8Array
<
ArrayBuffer
>
;
serializedSize
?:
(
value
:
Input
)
=>
number
|
null
;
validate
?:
(
value
:
Input
)
=>
void
;
write
:
|
(
(
value
:
Input
,
writer
:
BcsWriter
)
=>
void
)
|
(
(
value
:
Input
)
=>
void
)
;
}
&
BcsTypeOptions
<
T
,
Input
,
Name
>
Returns
BcsType
<
T
,
Input
,
Name
>
Properties
_
codec
_codec
:
{
kind
?:
string
;
read
:
()
=>
T
;
write
:
(
value
:
Input
)
=>
void
}
$infer
Input
$inferInput
:
Input
$infer
Type
$inferType
:
T
name
name
:
Name
serialized
Size
serializedSize
:
(
value
:
Input
,
options
?:
BcsWriterOptions
)
=>
number
|
null
to
Bytes
toBytes
:
(
value
:
Input
,
options
?:
BcsWriterOptions
)
=>
Uint8Array
<
ArrayBuffer
>
validate
validate
:
(
value
:
Input
)
=>
void
Methods
from
Base58
fromBase58
(
b58
:
string
)
:
T
Parameters
b58
:
string
Returns
T
from
Base64
fromBase64
(
b64
:
string
)
:
T
Parameters
b64
:
string
Returns
T
from
Hex
fromHex
(
hex
:
string
)
:
T
Parameters
hex
:
string
Returns
T
parse
parse
(
bytes
:
Uint8Array
)
:
T
Parameters
bytes
:
Uint8Array
Returns
T
read
read
(
reader
:
BcsReader
)
:
T
Parameters
reader
:
BcsReader
Returns
T
Deprecated
Use
parse
instead.
serialize
serialize
(
value
:
Input
,
options
?:
BcsWriterOptions
)
:
SerializedBcs
<
T
,
Input
>
Parameters
value
:
Input
Optional
options
:
BcsWriterOptions
Returns
SerializedBcs
<
T
,
Input
>
to
Base58
toBase58
(
value
:
Input
)
:
string
Parameters
value
:
Input
Returns
string
to
Base64
toBase64
(
value
:
Input
)
:
string
Parameters
value
:
Input
Returns
string
to
Hex
toHex
(
value
:
Input
)
:
string
Parameters
value
:
Input
Returns
string
transform
transform
<
T2
=
T
,
Input2
=
Input
,
NewName
extends
string
=
Name
>
(
__namedParameters
:
{
input
?:
(
val
:
Input2
)
=>
Input
;
output
?:
(
value
:
T
)
=>
T2
;
}
&
BcsTypeOptions
<
T2
,
Input2
,
NewName
>
,
)
:
BcsType
<
T2
,
Input2
,
NewName
>
Type Parameters
T2
=
T
Input2
=
Input
NewName
extends
string
=
Name
Parameters
__namedParameters
:
{
input
?:
(
val
:
Input2
)
=>
Input
;
output
?:
(
value
:
T
)
=>
T2
}
&
BcsTypeOptions
<
T2
,
Input2
,
NewName
,
>
Returns
BcsType
<
T2
,
Input2
,
NewName
>
write
write
(
value
:
Input
,
_writer
?:
BcsWriter
)
:
void
Parameters
value
:
Input
Optional
_writer
:
BcsWriter
Returns
void
Deprecated
Use
toBytes
or
serialize
instead.
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
_
codec
$infer
Input
$infer
Type
name
serialized
Size
to
Bytes
validate
Methods
from
Base58
from
Base64
from
Hex
parse
read
serialize
to
Base58
to
Base64
to
Hex
transform
write
Documentation
Loading...
Deprecated
Use parse instead.