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(swap): enable app fee via remote config #5359

Merged
merged 3 commits into from
May 2, 2024

Conversation

jeanregisser
Copy link
Member

@jeanregisser jeanregisser commented Apr 29, 2024

Description

This PR allows enabling the swap fee via the remote config.

When enabled, the free Valora swap fee line item is hidden.
The details of the Valora fee are then displayed when hitting the info button of the exchange rate line item.

Test plan

  • Updated tests
Valora fee disabled Valora fee enabled (0 fee from API) Valora fee enabled (positive fee from API)
image image image
image image image

Notes:

  • copies are not final
  • the "Valora fee disabled" case is same as today except it also shows the info icon next to the exchange rate.

Related issues

Backwards compatibility

Yes

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 86.06%. Comparing base (2bbc26b) to head (3bc37a9).
Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5359      +/-   ##
==========================================
+ Coverage   85.90%   86.06%   +0.15%     
==========================================
  Files         737      735       -2     
  Lines       30140    29967     -173     
  Branches     5165     5133      -32     
==========================================
- Hits        25891    25790     -101     
+ Misses       4017     3950      -67     
+ Partials      232      227       -5     
Files Coverage Δ
src/analytics/Properties.tsx 100.00% <ø> (ø)
src/statsig/constants.ts 100.00% <ø> (ø)
src/swap/SwapTransactionDetails.tsx 91.30% <100.00%> (+0.98%) ⬆️
src/swap/types.ts 100.00% <ø> (ø)
src/swap/useSwapQuote.ts 93.25% <100.00%> (+0.31%) ⬆️
src/swap/SwapScreen.tsx 94.01% <84.61%> (-0.39%) ⬇️

... and 23 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bbc26b...3bc37a9. Read the comment docs.

@jeanregisser jeanregisser changed the title feat: enable swap fee via remote config feat(swap): enable valora fee via remote config Apr 30, 2024
Copy link
Collaborator

@kathaypacific kathaypacific left a comment

Choose a reason for hiding this comment

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

LGTM!! i wondered if we want to hard code "valora" in variable names and translation keys / params for the fees? we've tried to be brand agnostic in the code so far so wanted to check that this was an intentional move (i was thinking that the readability wouldn't be affected if we omit the "valora" part)

@jeanregisser
Copy link
Member Author

LGTM!! i wondered if we want to hard code "valora" in variable names and translation keys / params for the fees? we've tried to be brand agnostic in the code so far so wanted to check that this was an intentional move (i was thinking that the readability wouldn't be affected if we omit the "valora" part)

It's intentional, but I see your point.
If we remove the "valora" part I think it's way less clear what this is, cause we already have network fee, gas fee, and soon cross-chain fee.
Just calling it "swap fee" may be a bit ambiguous I think, as there are liquidity pool swap fees already which we don't really see.
Maybe we could call it appFee? or appEditorFee? or swapApiFee?

@jeanregisser jeanregisser changed the title feat(swap): enable valora fee via remote config feat(swap): enable app fee via remote config Apr 30, 2024
@jeanregisser jeanregisser added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit a4ca31c May 2, 2024
17 checks passed
@jeanregisser jeanregisser deleted the jeanregisser/swap-fee branch May 2, 2024 07:32
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
### Description

This PR allows enabling the swap fee via the remote config.

When enabled, the free Valora swap fee line item is hidden.
The details of the Valora fee are then displayed when hitting the info
button of the exchange rate line item.

### Test plan

- Updated tests

| Valora fee disabled | Valora fee enabled (0 fee from API) | Valora fee
enabled (positive fee from API) |
|----------|----------|----------|
|
![image](https://github.com/valora-inc/wallet/assets/57791/6cded654-86bd-46eb-ab8d-da35076588bd)
|
![image](https://github.com/valora-inc/wallet/assets/57791/038fb3b4-d2cf-4d49-8325-40b6824038a8)
|
![image](https://github.com/valora-inc/wallet/assets/57791/576fcf93-b99a-4269-a387-fa009e10dedb)
|
|
![image](https://github.com/valora-inc/wallet/assets/57791/37ac4758-4d25-46a7-852a-c6b21ea44047)
|
![image](https://github.com/valora-inc/wallet/assets/57791/49cd7a09-775e-4b47-91b4-ecf0a022b4c6)
|
![image](https://github.com/valora-inc/wallet/assets/57791/dd66d5d3-0bd3-4c89-a5cd-4b4b1c34d442)
|

Notes: 
- copies are not final
- the "Valora fee disabled" case is same as today except it also shows
the info icon next to the exchange rate.

### Related issues

- Fixes RET-1061

### Backwards compatibility

Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
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.

None yet

2 participants