Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): Use Network wallets for Onramper Widget #2833

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AntonioVentilii-DFINITY
Copy link
Collaborator

@AntonioVentilii-DFINITY AntonioVentilii-DFINITY commented Oct 11, 2024

Motivation

As Security review suggested, it is better to use the param networkWallets of Onramper instead of wallets, to reduce the link length and make it more scalable.

Currently the same wallet addresses for each individual token are specified in the onramper wallets URL parameter, e.g.: https://buy.onramper.dev/?wallets=icp_icp:9dd073a8b088ce77f7e0362d8a3b51752f20c304eb019fc83feb4511d1fa914e,eth:0x0a12ef5b74541C7De3c36B9f0265902869741b6A,usdc_ethereum:0x0a12ef5b74541C7De3c36B9f0265902869741b6A,link_ethereum:0x0a12ef5b74541C7De3c36B9f0265902869741b6A,... IIUC: if wallet addresses are the same for a network these could be specified in networkWallets like this https://buy.onramper.dev/?wallets=icp_icp:9dd073a8b088ce77f7e0362d8a3b51752f20c304eb019fc83feb4511d1fa914e&networkWallets=ethereum:0x0a12ef5b74541C7De3c36B9f0265902869741b6A... Doing this is highly recommended because otherwise you could run into issues with the URL length if more tokens get added over time

Changes

  • Create mapping util to link each network from Oisy to a networkWallet for Onramper (plus tests).
  • Include networkWallets among the parameters to build the source link.
  • Add the list of network (and mapping to address) to the Onramper Widget, removing the list of crypto wallets.

Note

I would like to leave the old utils and parameters there, just in case. But it can be discussed.

Tests

Manual test in local replica worked as usual.

GIX-3110

@AntonioVentilii-DFINITY AntonioVentilii-DFINITY requested a review from a team as a code owner October 11, 2024 14:10
@AntonioVentilii-DFINITY AntonioVentilii-DFINITY changed the title feat(frontend): Use Network wallets for Onramper Widget feat(frontend): Use Network wallets for Onramper Widget [GIX-3110] Oct 11, 2024
@AntonioVentilii-DFINITY AntonioVentilii-DFINITY changed the title feat(frontend): Use Network wallets for Onramper Widget [GIX-3110] feat(frontend): Use Network wallets for Onramper Widget Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants