Skip to content

feat: handle quotes without defined receiver#7259

Open
limitofzero wants to merge 80 commits intodevelopfrom
feat/handle-quotes-without-receiver
Open

feat: handle quotes without defined receiver#7259
limitofzero wants to merge 80 commits intodevelopfrom
feat/handle-quotes-without-receiver

Conversation

@limitofzero
Copy link
Copy Markdown
Contributor

@limitofzero limitofzero commented Apr 6, 2026

Summary

Add a default address for btc/sol bridging to show a quote until a user set a receiver address.

To Test

  1. Open swap form and select sol/btc as destination network
  • quote should be shown before user enter receiver address
  • user can't swap until a receiver address is not present
  • bridge should always trade funds to the provided receiver address
  • quote requests(https://1click.chaindefuser.com/v0/quote) should contain bc1q5eapy5ptdr98vtx9c5pfaa2yd20ncd3n397ek4 for BTC or F2nKBvD1yak1zvvGSdZdBmjKraCQX2gE14rA12Wqt23b for SOL in recipient field if user don't enter any receiver, otherwise they should contain the provided receiver address
image

Summary by CodeRabbit

  • Bug Fixes

    • Prevented placeholder/non-final bridge recipients from being used when placing orders.
    • Better fallback and validation for non-EVM bridge recipients (BTC, SOL), ensuring correct defaults are selected.
  • Behavior/UI

    • Recipient input visibility no longer appears for anonymous sessions unless a recipient is present in the URL.
  • Tests

    • Added and expanded tests covering recipient resolution across EVM and non-EVM chains.

# Conflicts:
#	apps/cowswap-frontend/package.json
#	apps/explorer/package.json
#	apps/sdk-tools/package.json
#	apps/widget-configurator/package.json
#	libs/analytics/package.json
#	libs/balances-and-allowances/package.json
#	libs/common-const/package.json
#	libs/common-hooks/package.json
#	libs/common-utils/package.json
#	libs/core/package.json
#	libs/currency/package.json
#	libs/ens/package.json
#	libs/events/package.json
#	libs/multicall/package.json
#	libs/permit-utils/package.json
#	libs/tokens/package.json
#	libs/types/package.json
#	libs/ui/package.json
#	libs/wallet/package.json
#	libs/widget-lib/package.json
#	pnpm-lock.yaml
…tc-sol

# Conflicts:
#	apps/cowswap-frontend/package.json
#	apps/explorer/package.json
#	apps/sdk-tools/package.json
#	apps/widget-configurator/package.json
#	libs/analytics/package.json
#	libs/balances-and-allowances/package.json
#	libs/common-const/package.json
#	libs/common-hooks/package.json
#	libs/common-utils/package.json
#	libs/core/package.json
#	libs/currency/package.json
#	libs/ens/package.json
#	libs/events/package.json
#	libs/multicall/package.json
#	libs/permit-utils/package.json
#	libs/tokens/package.json
#	libs/types/package.json
#	libs/ui/package.json
#	libs/wallet/package.json
#	libs/widget-lib/package.json
#	pnpm-lock.yaml
@limitofzero limitofzero changed the title feat: handle quotes without receiver feat: handle quotes without defined receiver Apr 14, 2026
# Conflicts:
#	apps/cowswap-frontend/package.json
#	apps/explorer/package.json
#	apps/sdk-tools/package.json
#	apps/widget-configurator/package.json
#	libs/analytics/package.json
#	libs/balances-and-allowances/package.json
#	libs/common-const/package.json
#	libs/common-hooks/package.json
#	libs/common-utils/package.json
#	libs/core/package.json
#	libs/currency/package.json
#	libs/ens/package.json
#	libs/events/package.json
#	libs/multicall/package.json
#	libs/permit-utils/package.json
#	libs/tokens/package.json
#	libs/types/package.json
#	libs/ui/package.json
#	libs/wallet/package.json
#	libs/widget-lib/package.json
#	pnpm-lock.yaml
Base automatically changed from feat/add-receiver-for-btc-sol to develop April 15, 2026 14:28
# Conflicts:
#	apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetForm.tsx
#	apps/cowswap-frontend/src/modules/tradeQuote/hooks/useQuoteParamsRecipient.test.ts
#	apps/cowswap-frontend/src/modules/tradeQuote/hooks/useQuoteParamsRecipient.ts
@limitofzero
Copy link
Copy Markdown
Contributor Author

@elena-zh thank you, could u pls check again, I added fallback to default recipient if user enter invalid one

Copy link
Copy Markdown
Contributor

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

Hey @limitofzero , changes almost LGTM!
However, now the banner is not displayed for a regular bridge in SC wallets, that is why the main button is disabled

Image

Could you please fix it?

Besides. there is 1 nitpick: sometimes it takes too long to load the quote, and in the end I see this error in stead of a 'wrong recipient' message/ Could you please double check whether it is an issue on Near side or on ours?

Image

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants