Documentation
Preparing search index...
@mysten/bcs
BcsType
Class BcsType<T, Input>
Type Parameters
T
Input
=
T
Index
Constructors
constructor
Properties
$infer
Input
$infer
Type
name
read
serialized
Size
validate
Methods
from
Base58
from
Base64
from
Hex
parse
serialize
transform
write
Constructors
constructor
new
BcsType
<
T
,
Input
=
T
>
(
options
:
{
name
:
string
;
read
:
(
reader
:
BcsReader
)
=>
T
;
serialize
?:
(
value
:
Input
,
options
?:
BcsWriterOptions
)
=>
Uint8Array
;
serializedSize
?:
(
value
:
Input
)
=>
null
|
number
;
validate
?:
(
value
:
Input
)
=>
void
;
write
:
(
value
:
Input
,
writer
:
BcsWriter
)
=>
void
;
}
&
BcsTypeOptions
<
T
,
Input
>
,
)
:
BcsType
<
T
,
Input
>
Type Parameters
T
Input
=
T
Parameters
options
:
{
name
:
string
;
read
:
(
reader
:
BcsReader
)
=>
T
;
serialize
?:
(
value
:
Input
,
options
?:
BcsWriterOptions
)
=>
Uint8Array
;
serializedSize
?:
(
value
:
Input
)
=>
null
|
number
;
validate
?:
(
value
:
Input
)
=>
void
;
write
:
(
value
:
Input
,
writer
:
BcsWriter
)
=>
void
;
}
&
BcsTypeOptions
<
T
,
Input
>
Returns
BcsType
<
T
,
Input
>
Properties
$infer
Input
$inferInput
:
Input
$infer
Type
$inferType
:
T
name
name
:
string
read
read
:
(
reader
:
BcsReader
)
=>
T
serialized
Size
serializedSize
:
(
value
:
Input
,
options
?:
BcsWriterOptions
)
=>
null
|
number
validate
validate
:
(
value
:
Input
)
=>
void
Methods
from
Base58
fromBase58
(
b64
:
string
)
:
T
Parameters
b64
:
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
serialize
serialize
(
value
:
Input
,
options
?:
BcsWriterOptions
)
:
SerializedBcs
<
T
,
Input
>
Parameters
value
:
Input
Optional
options
:
BcsWriterOptions
Returns
SerializedBcs
<
T
,
Input
>
transform
transform
<
T2
=
T
,
Input2
=
Input
>
(
__namedParameters
:
{
input
?:
(
val
:
Input2
)
=>
Input
;
output
?:
(
value
:
T
)
=>
T2
;
}
&
BcsTypeOptions
<
T2
,
Input2
>
,
)
:
BcsType
<
T2
,
Input2
>
Type Parameters
T2
=
T
Input2
=
Input
Parameters
__namedParameters
:
{
input
?:
(
val
:
Input2
)
=>
Input
;
output
?:
(
value
:
T
)
=>
T2
}
&
BcsTypeOptions
<
T2
,
Input2
,
>
Returns
BcsType
<
T2
,
Input2
>
write
write
(
value
:
Input
,
writer
:
BcsWriter
)
:
void
Parameters
value
:
Input
writer
:
BcsWriter
Returns
void
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
$infer
Input
$infer
Type
name
read
serialized
Size
validate
Methods
from
Base58
from
Base64
from
Hex
parse
serialize
transform
write
Documentation
Loading...