> For the complete documentation index, see [llms.txt](https://city-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://city-protocol.gitbook.io/docs/software-development-kit/swap/build-methods.md).

# Build Methods

#### buildSwap

Fetches the full swap transaction payload from the aggregator, ready to be signed and broadcast. If `slippage` is omitted, the SDK requests auto-slippage and defaults `slippagePercent` to `0.5`.

```
const route = await swapClient.buildSwap({
  chainIndex: "1",
  fromToken: "USDC",
  toToken: "WETH",
  amount: "100000000",
  walletAddress: "0xYourWallet",
  gasLevel: "average",
  swapMode: "exactIn",
  slippage: "0.5",
});
```

#### getApproveTransaction

Returns the ERC-20 approval calldata required before a swap can be executed.

```
const approval = await swapClient.getApproveTransaction({
  chainIndex: "1",
  tokenAddress: "USDC",
  amount: "100000000",
});
```
