showSwap
Function to open the Swap interface using the Wallet Services Plugin.
Usage
await web3auth.showSwap({
show: true,
}); // Opens the Swap Modal
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
Promise<void>;
The function returns a Promise that resolves when the swap modal is successfully displayed.