-
Notifications
You must be signed in to change notification settings - Fork 894
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
chore(wallet): refactor swap service interface #21406
Conversation
@@ -138,7 +139,7 @@ export function useJupiter(params: SwapParams) { | |||
outputToken: | |||
overriddenParams.toToken.contractAddress || | |||
WRAPPED_SOL_CONTRACT_ADDRESS, | |||
taker: overriddenParams.fromAddress | |||
taker: overriddenParams.fromAccountId.address |
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.
Let's get address from AccountInfo. Address field in AccountId was/is a temporary measure and to be removed soon™
const fromAccount = useAccountQuery(fromAccountId)
fromAccount.address
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.
Fixed here, but without the useAccountQuery()
hook.
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
components/brave_wallet_ui/page/screens/swap/hooks/useJupiter.ts
Outdated
Show resolved
Hide resolved
components/brave_wallet_ui/page/screens/swap/hooks/useZeroEx.ts
Outdated
Show resolved
Hide resolved
components/brave_wallet_ui/page/screens/swap/hooks/useZeroEx.ts
Outdated
Show resolved
Hide resolved
components/brave_wallet_ui/page/screens/swap/hooks/useZeroEx.ts
Outdated
Show resolved
Hide resolved
63d0349
to
bea0de1
Compare
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.
frontend ++
A Storybook has been deployed to preview UI for the latest push |
android/javatests/org/chromium/chrome/browser/brave_wallet/BraveWalletUtilsTest.java
Show resolved
Hide resolved
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.
wallet core LGTM.
Added some minor notes.
[puLL-Merge] - brave/brave-core@21406 DescriptionThe PR introduces a change in the wallet swap feature within the Brave browser for both Android and Java components. Specifically, it involves refactoring the swap feature's implementation to use a new class name in obfuscation and introduces a new structure to handle swap transaction parameters and responses more generically. ChangesChanges
|
A Storybook has been deployed to preview UI for the latest push |
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.
👍 Java parts look good!
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.
iOS++
* chore(wallet): refactor swap service interface (#21406) * chore(wallet): migrate to Jupiter API v6 (#21475) * chore(wallet): migrate to Jupiter API v6 * add referral account to collect platform fees * switch to processed preflight commitment for swaps * review(doug): remove unused dependencies in hook * add production referral key * Fixes BraveWalletUtilsTest Android unit tests --------- Co-authored-by: Serg <[email protected]>
No functional changes in this PR, just some refactoring of the
SwapService
interface.Resolves brave/brave-browser#34932
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:
N/A