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

staging-pocketsell -> master #2873

Merged
merged 25 commits into from
Sep 2, 2024
Merged

staging-pocketsell -> master #2873

merged 25 commits into from
Sep 2, 2024

Conversation

benma
Copy link
Contributor

@benma benma commented Aug 28, 2024

No description provided.

shonsirsha and others added 24 commits June 11, 2024 10:04
Mock API calls:
1. getExchangeSellSupported
2. getSellExchangeSupportedAccounts
`firmwareUpdateDialogOpen`. It's done to make the dialog
controllable from other pages such as the new sell page.
Conflicts:
	frontends/web/src/components/sidebar/sidebar.tsx
	frontends/web/src/routes/account/info/buyReceiveCTA.tsx
	frontends/web/src/routes/exchange/exchange.tsx
	frontends/web/src/routes/exchange/info.tsx
	frontends/web/src/routes/exchange/utils.ts
	frontends/web/src/routes/settings/components/device-settings/firmware-setting.tsx

Also modified imports in:
- frontends/web/src/routes/exchange/components/exchangeselectionradio.tsx
- frontends/web/src/routes/exchange/components/infocontent.tsx
Payment requests have been supported by bitbox02 firmware since v9.19.0.
This integrates the feature in the app, mocking a testnet payment request
in the Pocket widget section. Once the Pocket sell widget integration is
completed the mock function will be removed.

Note: to test this it is necessary to flash a dev device with a FW
having the test merchant enabled.
Exchange logic was largely implemented in the frontend. With this, all
the logic is moved to the backend, and the whole code is simplified.

Main changes:
- getExchangeDeals now has three params: coin, region and action
(buy/sell) and returns already filtered exchange deals, with best deal
flag already set
- mv sell.tsx buysell.tsx: this component now has an action param, that
allows to display different deals on the base of the enabled buy/sell
tab.
- all the /buy/ path has been moved to /exchange/
- a lot of frontend logic (e.g. to find the best deal) is not necessary
anymore and has been removed.
- pocket sell mockup button removed, as it is not necessary anymore

Still todo: we should check if the bb02 firmware supports silent
payments and can sell through Pocket using a backend endpoint instead
of just checking the version in the frontend. This will be done in a
future commit.
and update pocket exchange page title.
This inserts a new `SupportsPaymentRequests` method in the device
interface and creates a new related endpoint to check if the connected
device supports sell action in the exchange section.
There was a bug in the payment request implementation that didn't
correctly support mempool.space fees and resulted in a fee error
during the tx proposal on production environment.

This commit moves the fee target selection for payment requests in the
BE and fixes the bug.

It also fixes a bug in the tx proposal error handling.
Also removed the old (thus unused) pocket T&C translation keys.
@benma benma requested a review from shonsirsha August 28, 2024 07:24
@benma benma marked this pull request as ready for review August 28, 2024 10:22
Copy link
Collaborator

@shonsirsha shonsirsha left a comment

Choose a reason for hiding this comment

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

LGTM. 2 unused files need to be removed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file (and its css) are unused. Feel free to delete them.

@benma benma merged commit afa0535 into BitBoxSwiss:master Sep 2, 2024
6 checks passed
@benma benma deleted the staging-merged branch September 2, 2024 07:02
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.

3 participants