> For the complete documentation index, see [llms.txt](/llms.txt).

# showSwap

Function to open the swap interface using the Wallet Services plugin.

info

Please note that this function doesn't work for external wallet logins. It only works for social login embedded wallets.

### Usage[​](#usage "Direct link to Usage")

```
await web3auth.showSwap({
  show: true,
}) // Opens the Swap Modal

```

### Parameters[​](#parameters "Direct link to Parameters")

| Name       | Type    | Description                                                                                              |
| ---------- | ------- | -------------------------------------------------------------------------------------------------------- |
| show       | boolean | Controls whether the swap UI is visible. Set to true to display the swap interface, or false to hide it. |
| fromToken? | string  | Specifies the token being swapped from. Optional field.                                                  |
| toToken?   | string  | Specifies the token being swapped to. Optional field.                                                    |
| fromValue? | string  | The amount of the fromToken to be swapped. Optional field.                                               |
| toAddress? | string  | The recipient's address for the toToken. Optional field.                                                 |

### Return type[​](#return-type "Direct link to Return type")

```
Promise<void>

```

The function returns a Promise that resolves when the swap modal is successfully displayed.
