# Move Types

## TS SDK Move Types <a href="#ts-sdk-move-types" id="ts-sdk-move-types"></a>

When developing on Endless, and specifically working with the SDK, developers often need to handle Move types serialization and deserialization. Whether is to construct a transaction payload, build a raw transaction or read BCS data.

The SDK provides a convenient Move subclasses to easily interact with move types to perform serialization or deserialization operations. Each class has a `serialize`, `serializeForEntryFunction` and `serializeForScriptFunction` methods and a `deserialize` static class.

In addition, for complex types like `Vector` the SDK supports nested serialization and deserialization.

### Move primitive types <a href="#move-primitive-types" id="move-primitive-types"></a>

Classes to handle Move primitive types:

* U8
* U16
* U32
* U64
* U128
* U256
* Bool
* AccountAddress

```js
const serializer = new Serializer();

const u8 = new U8(1);
u8.serialize(serializer);
u8.serializeForEntryFunction(serializer);
u8.serializeForScriptFunction(serializer);

const deserializer = new Deserializer(new Uint8Array(u8.value));
deserializer.deserialize(U8);
```

### Move struct types <a href="#move-struct-types" id="move-struct-types"></a>

* MoveVector
* MoveString
* MoveOption

```js
const serializer = new Serializer();

const moveString = new MoveString("hello world");
moveString.serialize(serializer);
moveString.serializeForEntryFunction(serializer);
moveString.serializeForScriptFunction(serializer);

const deserializer = new Deserializer(serializer.toUint8Array());
deserializer.deserializeStr();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.endless.link/endless/devbuild/build/endless-sdks/typescript-sdk/move-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
