Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/cow-protocol/tutorials/widget/widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ createCowSwapWidget(document.getElementById('cowswap-widget'), {
| `hideRecentTokens` | `boolean` | false | Hides the "Recent tokens" section in the token selector. |
| `hideFavoriteTokens` | `boolean` | false | Hides the "Favorite tokens" section in the token selector. |
| `disableTokenImport` | `boolean` | false | Disables adding custom tokens and custom token lists by the user. |
| `disableEIP2612Permits` | `boolean` | false | Disables the EIP-2612 permit signing flow. When `true`, the widget never signs an off-chain permit and always sends an on-chain approval transaction, even for tokens that support permit. |
| `disableInfiniteApprove` | `boolean` | false | Disables infinite (`MAX_UINT256`) ERC-20 approvals. When `true`, every approval transaction approves only the exact trade-size amount, and the "Partial approval" toggle in Settings is shown but locked on. |
| `partnerFee` | `PartnerFee` | --- | Enables a fee for all trades in the widget. See [Partner fee](#partner-fee) section for more details. |
| `slippage` | `FlexibleSlippageConfig` | --- | Sets slippage settings globally or per network. See [Slippage configuration](#slippage-configuration) section for more details. |
| `disableTrade` | `object` | --- | Conditions to control the ability to trade. Accepts `{ whenPriceImpactIsUnknown?: boolean, whenPriceImpactIsHigherThan?: number }`. |
Expand All @@ -375,6 +377,7 @@ createCowSwapWidget(document.getElementById('cowswap-widget'), {
| `disableProgressBar` | `boolean` | false | Disables the progress bar shown after a swap order is placed. |
| `disablePostTradeTips` | `boolean` | false | Disables CoW Swap educational tips shown after a trade completes. |
| `disableCrossChainSwap` | `boolean` | false | Disables cross-chain swaps (aka Swap and Bridge) feature. |
| `disableCustomRecipient` | `boolean` | false | Disables setting a custom recipient for all trading widgets (swap, limit, twap). Note: cross-chain swaps rely on custom recipient functionality, so set `disableCrossChainSwap` to `true` as well if you want the recipient to always equal the order owner. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the issue cowprotocol/cowswap#7654 , we need to let integrators know that bridge orders to Solana and BTC will stop working when the setting is set to true.

E.g. add the 2nd note: If this setting is set to true, cross-chain swaps to Solana and Bitcoin will no longer function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wound't it make more sense for this setting to only disable the custom recipient in EVM then?

| `disableWindowOpen` | `boolean` | false | When `true`, the host page will not use `window.open` to open links requested by the widget. |
| `standaloneMode` | `boolean` | false | When enabled, the widget uses its own Ethereum provider and the user can connect a wallet from within the widget. |
| `hideNetworkSelector` | `boolean` | false | Hides the network selector in the widget UI. |
Expand All @@ -384,6 +387,7 @@ createCowSwapWidget(document.getElementById('cowswap-widget'), {
| `sounds` | `CowSwapWidgetSounds` | --- | Configure notification sounds. Provide a URL to an audio file, or set to `null` to disable a sound. See [Sounds](#sounds) section for more details. |
| `images` | `CowSwapWidgetImages` | --- | Replace default widget images (e.g. the empty orders illustration). See [Images](#images) section for more details. |
| `content` | `CowSwapWidgetContent` | --- | Customizable labels and content. Allows overriding the fee label (`feeLabel`) and fee tooltip markdown (`feeTooltipMarkdown`). |
| `hooks` | `object` | --- | Hooks invoked before key actions, each returning a `boolean` (or `Promise<boolean>`) to allow or block the action: `onBeforeApproval`, `onBeforeWrapOrUnwrap`, `onBeforeTrade`, `onBeforeOrderCancel`, `onBeforeOrdersCancel`. |

## Custom theme

Expand Down
Loading