# Function Types

Function types are used to by [`quoteLayerZeroFee()`](/stargate/developers/cross-chain-swap-fee.md) to get the cross chain message fee.

For standard a Stargate `swap()`, use function type = `1`

```javascript
// all function types
uint8 public constant TYPE_SWAP_REMOTE            = 1;
uint8 public constant TYPE_ADD_LIQUIDITY          = 2;
uint8 public constant TYPE_REDEEM_LOCAL_CALL_BACK = 3;
uint8 public constant TYPE_WITHDRAW_REMOTE        = 4;
```

\
Each of the above types corresponds to a function within Stargate that sends a cross chain message.

* Type 1: Used for `swap()`
* Type 2: Used for `addLiquidity()`
* Type 3: Used for the B->A portion of an A->B->A `withdrawLocal()`
* Type 4: Use to initiate a `withdrawLocal()`&#x20;


---

# 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://stargateprotocol.gitbook.io/stargate/developers/function-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.
