-
Notifications
You must be signed in to change notification settings - Fork 879
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
Update on-ramp providers and add purchase method screen #16872
Conversation
I believe the primary task with on-ramp implementation is to expand the support by adding additional Ramp networks(Sardine etc). The UI is good to have but it was previously required due to multiple options: ramp and wyre. |
Is there any description of the actual changes required? I copied the iOS flow but couldn't find any other differences other than the extra screen "Select purchase method". |
android/brave_java_resources.gni
Outdated
@@ -175,6 +175,7 @@ brave_java_resources = [ | |||
"java/res/drawable-nodpi/ic_quick_action_search_and_bookmark_widget_preview.png", | |||
"java/res/drawable-nodpi/loader0.png", | |||
"java/res/drawable-nodpi/loader0_orange.png", | |||
"java/res/drawable-nodpi/ramp.png", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we have it in svg format? We are going to convert all pictures to vector graphic soon. That will decrease resources size plus they are scalable. It doesn't make sense to add anything new via png.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted from iOS, so the only option available was PNG. I'm going to try to manually convert this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or ask design team for a help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The results were low quality, I'll ask the design team for some help.
I would say there are plans to add more, but @jamesmudgett would know better. |
@Pavneet-Sing, here is a recording of the iOS flow that I copied. Compiled a debug version from the latest changes (Pulled the latest changes and recompiled right now just to be extra sure). The only difference seems to be this extra screen. Tried on both Solana and Ethereum networks. Let me know I'm missing something obvious. Screen.Recording.2023-01-26.at.2.41.49.PM.mov |
Update: I've just had a call with @jamesmudgett discussing the changes required. I'm going to ping you again once this PR is ready to review. |
IOS sardine support: https://github.com/brave/brave-ios/blob/development/Sources/BraveWallet/Crypto/Stores/BuyTokenStore.swift#L24 but it is for US only: https://github.com/brave/brave-ios/blob/development/Sources/BraveWallet/Crypto/Stores/BuyTokenStore.swift#L160 Additionally, Desktop has |
9d65975
to
e8a253d
Compare
.../java/org/chromium/chrome/browser/crypto_wallet/activities/SelectPurchaseMethodActivity.java
Outdated
Show resolved
Hide resolved
Review feedback addressed @SergeyZhukovsky. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
I am noticing a small delay to show Sardine option that can be displayed instantly. Just create a method to check if sardine is enabled and show it instantly. This will also simplify brave-core/android/java/org/chromium/chrome/browser/app/domain/OnRampModel.java Lines 27 to 37 in 46bc711
sardine-delay.webm |
28e2eff
to
9de5f77
Compare
@@ -241,11 +241,11 @@ public void setWalletCoinAdapterType(AdapterType type) { | |||
} | |||
|
|||
public void setWalletListItemModelList(List<WalletListItemModel> walletListItemModelList) { | |||
this.walletListItemModelList = walletListItemModelList; | |||
this.walletListItemModelList = removeDuplicates(walletListItemModelList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed to notice this before but this should be done where the data is fetched or processed then passed the filtered data to UI. Ok for now as a workaround, probably address this in the next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is causing an issue to remove tokens while showing tokens from all networks so logged an issue brave/brave-browser#28506
Resolves brave/brave-browser#23316 (Update on-ramp methods)
Resolves brave/brave-browser#27996 (Switch to new API
getBuyUrlV1
)Implements a new screen to select a purchase method containing Ramp.Network, Sardine and Transak.
Adopted new API
getBuyUrlV1
.mapToRampNetworkSymbol
.removeDuplicates
to avoid showing duplication in theEditVisibleAssetsBottomSheetDialogFragment
UI.Demo
demo.mov
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: