Skip to content

swaps: check slippage remote config#3767

Merged
estebanmino merged 4 commits into
@bruno/rainbow-swapsfrom
@esteban/check-slippage-remote-config
Jul 20, 2022
Merged

swaps: check slippage remote config#3767
estebanmino merged 4 commits into
@bruno/rainbow-swapsfrom
@esteban/check-slippage-remote-config

Conversation

@estebanmino
Copy link
Copy Markdown
Contributor

@estebanmino estebanmino commented Jul 20, 2022

Fixes TEAM2-276
Figma link (if any):

What changed (plus any additional context for devs)

APK is not getting the values

waiting for @ibrahimtaveras00 to confirm is working now

Screen recordings / screenshots

What to test

Final checklist

  • Assigned individual reviewers?
  • Added labels? (team1/team2, critical path, release, dev QA)
  • Did you test both iOS and Android?
  • If your changes are visual, did you check both the light and dark themes?
  • Added e2e tests? If not, please specify why
  • If you added new critical path files, did you update the CODEOWNERS file?
  • If no dev QA label, did you add the PR to the QA Queue?

@estebanmino estebanmino added swap-aggregator Label for the swap aggregator feature project team2 labels Jul 20, 2022
Copy link
Copy Markdown
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

QA Passed 👍🏽

@estebanmino estebanmino marked this pull request as ready for review July 20, 2022 21:37
@estebanmino estebanmino requested a review from a team July 20, 2022 21:38
Copy link
Copy Markdown
Contributor

@derHowie derHowie left a comment

Choose a reason for hiding this comment

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

💯

@estebanmino estebanmino merged commit 30eadaf into @bruno/rainbow-swaps Jul 20, 2022
@estebanmino estebanmino deleted the @esteban/check-slippage-remote-config branch July 20, 2022 22:34
@linear
Copy link
Copy Markdown

linear Bot commented Jul 21, 2022

estebanmino added a commit that referenced this pull request Jul 21, 2022
* fix loading state and small markets bug

* swap review updates (#3236)

* change button text

* init ds

* tweak min content height

* mark impact as negative

* init fee row

* update price row

* i18n

* add custom text color to pull

* rename and refactor exchange row

* fix naming

* moar i18n

* first pass: swap settings

* rm legacy logic

* lil font tweak

* halfway swap settings

* flashbots protec

* pretty

* rainbo fee hook

* pipe up

* fee row pre i18n

* tweak opacities

* new currencyTile

* update labels

* anotha label

* rm collabsible option

* first pass new masthead

* init exchange icons

* plug in slippage

* add xtra checks

* exchange row

* add BPA functionality to row comp

* rm fun stuff :(

* init explainer

* clean up masthead

* explainer height

* lang

* review

* enable swapping all assets

* fix swap quotes and cta update

* swap exchange icons (#3268)

* icon url

* fallback colors

* components

* rm default eth (#3270)

* fix formatting of max. sold and min received

* fix weth swap details

* navigate to input or output automatically

* allow l2s

* fix formatting

* token selection for L2s working

* l2 quotes working

* l2 search working

* fix loading issue

* op gas stuff

* revert bs

* l2 quotes working and review sheet working

* clean up

* expanded state available networks (#3306)

* additional networks hook update

* component and add to sheet

* tweak rendering logic

* i18n

* yeah

* handle singular case

* network switcher (#3308)

* network switcher component

* add util

* fix chainId noise

* refactor + add switcher

* fix queries

* backbutton

* handle network switch

* i18n

* fix key

* more swap fixes

* UniswapCurrency => SwappableAsset

* fix min received formatting

* use uniqueId (#3318)

* swap - fix discover charts (#3317)

* fix discover charts

* fix discover charts address issue

* fix discover charts address issue

* fix discover charts

* rename func

* fix missing price crash

* mmkv + nav to explain sheet

* tweak func calls

* add explain sheet type

* tweak dark arbitrum color

* reset swap inputs (#3328)

* reset inputs

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* flashbots no l2 (#3327)

* disable in settings

* fix mainnet check

* more fixes

* updated dark mode network colors

* swap - review clean up (#3337)

* prevent mainnet search when no query

* defaults & i18n (#3344)

* gas limit magic

* fix gas issue

* more work for l2 swaps

* lint

* fix approvals

* fix l2 swaps

* l2 swaps work

* update multichain weth support

* clean up

* bump @rainbow/swaps

* weth wrapping / unwrapping working on L2s

* use error codes instead of messages

* swap - fix derived values behavior (#3393)

* tweak behavior

* unrel: we should toggle editable

* fix prepending 0 scenario

* swap - infer token network (#3395)

* add debug check

* pass hasBalance

* switch output network & addy

* ignoreTypeCheck

* ooops

* fix bad prop

* hasBalance -> from Disco

* fix expanded state crash

* fix fucked up nav

* disable output

* available networks explainooor (#3432)

* length check (#3433)

* swap - disable l2 favs (#3436)

* optional chaining

* conditional spacing

* props and clean up

* @skylar/swap e2e (#3441)

* save

* swap tests passing

* fix rest of the tests

* passing

* fix badges and l2 fallback images

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* fix send flow

* more fixes

* more fixes

* bump detox

* restore kilsession;

* restore dep bump

* fix e2e

* lint

* explainer sheet crash

* explainer sheet crash

* restore detox to iOS 13.7

* wait for currencylist screen

* more e2e fixes

* Swaps: Navigator entrypoints (#3465)

* Fix navigator entrypoints

* make android great again

* add handle

* tweaks

* e2e

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* lint

* swap -  bugz pass #1 (#3477)

* optionals

* reset native

* exchange formatting + parsing

* better

* fix arbitrum shiz

* L2 icons + colors

* isETH l2 check

* add lowercase

* hacky fix for swap adjusted amounts

* ci

* prop name baptism

* Update src/components/exchange/ExchangeField.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix asset call

* oop

Co-authored-by: Esteban Miño <efmino@uc.cl>

* network -> currentNetwork

* swaps: android go to review fix (#3482)

* android review button available

* end of line

* swaps - fix auto network regression from nav changes (#3484)

* add logic to handle new nav flow

* crash

* update for readability

* rm old logic

* review

* fix crash (#3493)

* swaps - fix savings flow regressions (#3499)

* savings check

* savings check + render logic

* use route name to continue showing currency list (#3491)

* update react-native-pager-view (#3506)

* swap - route picker (#3471)

* init assets 4 now

* assets updates

* add route to redux

* pass in route to qoutes

* component

* i18n + prop clean up

* code review

* android fixes + source

* route -> source

* add settings route

* source picker

* update copy

* opaque bq

* swaps - fix android network switcher crash (#3523)

* fix menu options call

* lowercase

* swaps - add coin icon to output title (#3522)

* update hook deps

* pass asset

* render conditionally

* add ignoreBadge

* lint

* android

* swaps  - setting currencies via route params (#3513)

* use route name to continue showing currency list

* routing complete / override issue WIP

* pass asset to button

* pass default assets thru to modal

* use defaults and pass to main swap

* clean

* init handle new default source

* update savings prop

* fix types, crash , & should update effect

* actually fix savings

* rm exchange component props

* ty chris

* pass asset

* lang

* fix type

Co-authored-by: derHowie <derhowiedesigns@gmail.com>

* Adds high + medium slippage warning in swap settings (#3512)

* Extract slippage input into separate component

* Update copy

* Adds price impact warning

* Update size

* Use Stack for spacing

* Convert module to TS

* expose isSeverePriceImpact

* Remove true used for testing

* Fix linter errors

* Remove old Text field

* Move constant

* Fix more linter errors

* Reduce font sizes for android

* Update MaxToleranceInput

* [TEAM2-95] Swap review sheet -> more details: exchange row formatting (#3535)

* place label and content in same Columns component

* reuse SwapDetailsLabel

* bleed.right 6

* swaps: flashbots + confirmation button UI (#3530)

* fix loading calc (#3528)

* Polish more details animation (#3532)

* Fix android layout shift on the swap screen (#3536)

* swaps: token network fixes (#3542)

* only set chainId that's a number

* swapSupportsFlashbots in settings

* enable swap button for owned assets in wallet screen

* fix wrong type on input asset

* show swap button if has balances

* lint

* Swap aggregator styling + copy updates (#3540)

* [TEAM2-113] Swap token list sheet: no tokens on [network] explainer sheet is missing (#3539)

* add obtain l2s explainer sheet

* esteban CR: dismiss android keyboard, use lang, clean up

* fix android spacing issue and navigation + keyboard fixes

* swaps - android selection color (#3545)

* android selection color

* crash

* colorForAsset

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - arbis warning cleanup (#3544)

* add network check to input focus

* input handeling + editable logic

* swaps: placeholder network badge (#3549)

* add badge

* dont render time if undefined

* remove skeleton network

* swaps - e2e tweak (#3494)

* e2e tweak

* fix testIds

* try notch

* update e2e to develop

* audit

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix discover search header (#3564)

* froze lock

* swaps: output value fixed decimals (#3550)

* fixed 6

* rollback unrelated change

* add roundingMode

* dismiss keyboard before interaction manager and use mainnet as default when currency.type does not exist (#3561)

* swaps - main swap sheet spec (#3521)

* fetching copy

* fix cut off /uncentered text

* fix colors & formatting

* fix prop name

* fix android line height

* bump react-native-safe-area-context

* react-native-safe-area-context

* rm soft menu call

* exchange specific component

* rm android specific logic + better formatting

* optimization

* rm ios only animation

* rm debug colors

* condense android inputs to better match ios

* Revert "bump react-native-safe-area-context"

This reverts commit 5de479a.

* Revert "rm soft menu call"

This reverts commit 837d843.

* Revert "react-native-safe-area-context"

This reverts commit c6c8240.

* Revert "rm soft menu call"

This reverts commit 837d843.

* revert safe area context bump

* rm flashbots label

* fix da notch

* rm soft menu bs

* tighten up padding a bit

* formatting + consistent heights

* add marginTop override

* rm spacers + small phone logic

* revert spacer

* isSmallAndroidPhone

* lint

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - fix l2 fallback colors (#3562)

* fix l2 fallback colors

* fix type

* override in focused when transitioning to main exchange modal (#3576)

* Fix exchange rate in swap review modal  (#3574)

* convert raw amounts to decimals before dividing

* fix fee percentage

* Update rainbow fee explainer sheet

* swaps: update flip behavior (#3577)

* flipping

* disable on fetching quote

* NOOP

* Swaps: Fix some keyboard issues (#3555)

* Fix swap screen keyboard issues

* Fix keyboard issues on swap settings screen

* fix

* add missing fromDiscover

* blur only on ios

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Update route swap icons (#3567)

* fix insets (#3584)

* revert discover input (#3586)

* fix filtering (#3585)

* pass type

* fix: use getNetworkFromType in switch network explainer (#3591)

* swaps: round max input (#3588)

* audit-ci

* audit-ci

* audit-ci

* [TEAM2-159] Disable L2 favorites in token expanded state (#3582)

* remove add to favorites from l2 AddTokenSheet

* preserve cta position and use includes

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap review sheet UI updates (#3568)

* Swap review sheet UI tweaks

* Tighten up Android rows

* Less crazy prettier formatting

* Fix android icon clipping

* Swap UI fixes

* Fix token amount centering

* tweak button centering on android

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* fix: rounding input on max to decimalPlaces (#3597)

* [TEAM2-3] Update Swap explain sheets copy (#3599)

* add explainers to swap settings

* i18n still curious

* esteban code review comments

* remove unncessary interaction manager

* dismiss keyboard if explainer appears first

* combine keyboard listeners into one effect

* settings title i18n

* Bunch of android layout fixes (#3600)

* swaps - input price fallback (#3603)

* fallback price

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fixes (#3604)

* TEAM2-186

* TEAM2-181

* TEAM2-183

* swaps: flipping behavior changes (#3609)

* flip from native value and arbitrum

* native to token values

* comment rm

* Update src/hooks/useSwapDerivedValues.ts

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

* swaps - extra height android explainers (#3607)

* bump js sdk

* fix mainnet color (#3621)

* use chain id to determine network (#3614)

* resolved explainer sheet capitalization typos (#3612)

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* swaps: handle price impact warnings (#3617)

* handle price impact warnings

* hasPriceImpact

* updated price_impact.label to reflect design copy changes

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* Swaps: Fix insufficient gas label (#3623)

* fix insufficient gas label

* get rid of OP

* move to lang files

* Swaps: Align swap layout to spec (#3615)

* Fix swap screen layout

* PR review

* swaps - auto adjust max for native assets (#3625)

* remove alert

* add support for all native assets

* remove e2e test

* Swaps: Android explainer + slippage input fixes (#3616)

* Swaps: Easier tap targets for explainer buttons

* Swaps: Align slippage % input label

* design system

* padding margin vertical

* fix merge

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix NaN rainbow fee (#3628)

* Fix swapping via exchanges alignment (#3620)

* repro TEAM2-175

* Fix percentage pill

* Remove hardcoded protocols

* Remove hardcoded protocols

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap: Fix input debounce (#3610)

* use setTimeout

* fix debounce issues

* use existing focus logic

* improve isFocused

* optional chaining

* bug fix

* flipping is back

* rm not needed clear

* fix swap flip when focused on native input

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - explainer updates (#3624)

* add explainer + tweak logic

* copy + style updates

* no token updates

* rm extra android height

* symbol instead of name

* pass token symbols

* l2 copy + output disabled copy

* rm loose

* fix e2e

* updated output_disabled explainer copy

* unified colors

* altered copy for unverified token sheet

* fix regression

Co-authored-by: Daniel Sinclair <d@niel.nyc>

* swaps: isHighPriceImpact debounce (#3629)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* [TEAM2-198][TEAM2-212] Favorite duplicates when searching for an address / Deprecate Imported category in Swap search (#3632)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* remove imported section and move imported data to verified/unverified sections

* clean up + add clarifying comment

* fix highliquidity dupe

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: update output disabled explainer (#3641)

* add title_empty

* eof

* Swaps: Analytics (#3635)

* analytics for swap submit/complete

* analytics for swap details update

* tweak open swap details modal analytics

* fixes + include network

* remove priceImpactPercentDisplay from event tracking

* nevermind

* remove wallet address from event tracking

* asset: get asset from discover to swap (#3640)

* fix

* chaining

* swaps: more input flip & max (#3638)

* add debounce in exchangefield

* works

* flipping color

* native field

* to precision when flipping

* swaps: fix matic fees (#3644)

* swaps: currency selection updates (#3645)

* Swap fixes (#3649)

* fix matic -> wmatic minimum received

* lowercase with

* comment

* rename

* [TEAM2-238] Pinned tokens in mainnet swap search (#3654)

* pin prioritized tokens

* use token addresses in references

* swaps: improve flipping (#3652)

* update state instead of ref handling

* arbitrum swap

* swaps- liquidity explainer (#3631)

* liquidity explainer

* fix pixel crash

* fix

* end of filw

* onLongPress

* waitAndTap

* add e2e Wallet screen after swiping left

* logs

* onLongPress

* rm logs

* audit

* move swap setting test to its own step

Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Esteban Miño <efmino@uc.cl>

* [TEAM2-230] Token Expanded sheet Swap entry point bugs (#3648)

* move fromDiscover flag

* fix fromDiscover param correctly

* Fix swap failures (#3653)

* bump swaps SDK

* remove unused ref

* add utility toHexWithoutLeadingZeros

* refactor gas estimation

* bump sdk again

* add missing tx params to wrap/unwrap

* fix incorrect assumption that swap action never requires approve

* fix approvals for wMatic

* bump polygon defaults

* code review comments

* disable trace call for l2s

* bump defaults for l2 swaps

* skip estimates when quote is in progress

* use defaults for l2s

* optimism to the moon

* fix default swap gas limit for l2s

* polygon to the moon

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix switching currency with max input (#3662)

* swaps: fix explainers inputs focus (#3663)

* Keyboard.dismiss on navigate:

* TEAM2-195

* android

* silence audit

* swaps: fix press disabled confirm (#3676)

* [TEAM2-229] Balances not invalidating after completed swap (#3677)

* l2 balance update wip

* fetching new balances on tx confirm

* clean up

* no previous balance case working and l2 icons showing

* remove logs + DRY up additionalAssetsData

* add sentry logs + clean up debug logs

* conditionally patch l2 balances manually

* fix conflicts

* add internalType

* additionalDataUpdateL2AssetBalance on internal type trade

* format asset to be updated

* dont explore authorize tx on l2

* bump optimism basic swap

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* swaps - fix savings params (#3681)

* fix params

* no details for savings

* fix slippage editing (#3689)

* balance check (#3684)

* swaps: don't fetch quote on input focus (#3686)

* don't change values on focus

* on native input

* swaps: improve useSwapDerivedOutputs (#3687)

* don't change values on focus

* on native input

* use use react query

* remove not needed stuff

* bump debouncedIsHighPriceImpact to 1 sec

* bump debouncedIsHighPriceImpact to 1 sec

* fix inputTokenDecimals in computeSlippageAdjustedAmounts

* ignore late quote data

* ignore next line

* comment

* if loading disable press on confirm

* polling to 10 secs

* review comments

* swaps - truncate long token symbols  (#3685)

* truncate symbol

* add right margin

* truncated text

* dumbo

* sort favorites by abc in filtered and unfiltered states (#3700)

* swaps: updated swipe logic (#3711)

* add back swipe gestures

* add back xtras

* revert old logic

* simple logic

* fix android animation jank

* dont pass source=rainbow (#3719)

* add footer spacing on android (#3718)

* Set custom depth of the scroll view in Exchange modal in RNCM (#3716)

* Set custom depth of the scroll view in Exchange modal in RNCM

* Update UIViewController+slack.swift

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* use colors from theme

* catch up versions

* fix some exchange list breaking changes

* swaps: savings flow e2e (#3721)

* testIDs

* tests

* swaps: fix fast currency select row (#3726)

* fix prop ordering

* better

* fix passed props

* fix spacing and native asset logic

* fix

* network fallback

* silence audit

* end of line audit

* fix-test-id

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Filter dropped txs (#3728)

* dropped txs

* bump to 1.6.17 so testflight works

* silence audit

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* swaps: tweak base fee e2e (#3735)

* lower base fee

* audit

* fix: empty input flipping behavior (#3738)

* swaps: exchange icons memos + error reset (#3741)

* memos + error reset

* Update src/components/expanded-state/swap-details/SwapDetailsExchangeRow.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: osdnk review (#3730)

* fix zerox logo

* tweak animation

* rm old network check

* add new network check

* add back interactions

* auditoor

* fix favs

* remove init base fee

* swaps: fix flashbots tip (#3745)

* Decrement nonce if flashbots txs is dropped (#3743)

* Add default slippage to remote config (#3749)

* add default_slippage_bips to config

* load default slippage from config when opening modal

* Failed L2 swaps don't display Failed transaction activity state (#3736)

* check tx receipts in pending tx watcher

* remove redundant title assignment

* only fetch receipt if nonce has not been included

* check for txObj before fetching receipt instead

* rename flashbots feature flag (#3750)

* fix weth plus eth favorite scenario (#3753)

* disable swap button after pressed once (#3752)

* disable swap button after pressed once

* extract to aux function

* swaps: remote slippage by network (#3756)

* config work

* fix effect

* swaps: fix gas loading state (#3755)

* add is gas ready var

* revert not needed change

* Boolean(gasValue?.amount)

* swaps: add loading check to confirm button (#3754)

* add loading checks

* Revert "add loading checks"

This reverts commit 583afe7.

* disable long press while loading

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix: bump swap with permit gas (#3757)

* bump to 400000

* bump to 400000

* rainbow-me/swaps 0.1.9

* fixedGasLimitAfterApproval

* fix ../model/config import

* silence audit

* Swaps: Fix select currency scroll on Android (#3759)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* input fix (#3762)

* input fix

* bug fix

* swaps: fix 0. value in inputs behavior (#3766)

* fix flashbots speed up (#3765)

* Fix weird swap sheet clipping on Android (#3768)

* swaps: check for valid slippage remote config before setting it (#3767)

* check is not null first

* credefault values

* use default

* Check first jic

* fix (#3771)

* fix (#3772)

* swaps: block flashbots swaps miner tip (#3769)

* dont allow less than 6

* use FLASHBOTS_MIN_TIP

* swaps: fix slippage reset (#3773)

* fix it

* fix comments

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>
Co-authored-by: moxey.eth <jakemoxey@gmail.com>
Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>
Co-authored-by: Luc Succes <l2succes@gmail.com>
Co-authored-by: pugson <hi@wojtek.im>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Daniel Sinclair <d@niel.nyc>
Co-authored-by: Daniel Sinclair <daniel@rainbow.me>
Co-authored-by: Michał Osadnik <micosa97@gmail.com>
estebanmino added a commit that referenced this pull request Jul 28, 2022
* fix loading state and small markets bug

* swap review updates (#3236)

* change button text

* init ds

* tweak min content height

* mark impact as negative

* init fee row

* update price row

* i18n

* add custom text color to pull

* rename and refactor exchange row

* fix naming

* moar i18n

* first pass: swap settings

* rm legacy logic

* lil font tweak

* halfway swap settings

* flashbots protec

* pretty

* rainbo fee hook

* pipe up

* fee row pre i18n

* tweak opacities

* new currencyTile

* update labels

* anotha label

* rm collabsible option

* first pass new masthead

* init exchange icons

* plug in slippage

* add xtra checks

* exchange row

* add BPA functionality to row comp

* rm fun stuff :(

* init explainer

* clean up masthead

* explainer height

* lang

* review

* enable swapping all assets

* fix swap quotes and cta update

* swap exchange icons (#3268)

* icon url

* fallback colors

* components

* rm default eth (#3270)

* fix formatting of max. sold and min received

* fix weth swap details

* navigate to input or output automatically

* allow l2s

* fix formatting

* token selection for L2s working

* l2 quotes working

* l2 search working

* fix loading issue

* op gas stuff

* revert bs

* l2 quotes working and review sheet working

* clean up

* expanded state available networks (#3306)

* additional networks hook update

* component and add to sheet

* tweak rendering logic

* i18n

* yeah

* handle singular case

* network switcher (#3308)

* network switcher component

* add util

* fix chainId noise

* refactor + add switcher

* fix queries

* backbutton

* handle network switch

* i18n

* fix key

* more swap fixes

* UniswapCurrency => SwappableAsset

* fix min received formatting

* use uniqueId (#3318)

* swap - fix discover charts (#3317)

* fix discover charts

* fix discover charts address issue

* fix discover charts address issue

* fix discover charts

* rename func

* fix missing price crash

* mmkv + nav to explain sheet

* tweak func calls

* add explain sheet type

* tweak dark arbitrum color

* reset swap inputs (#3328)

* reset inputs

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* flashbots no l2 (#3327)

* disable in settings

* fix mainnet check

* more fixes

* updated dark mode network colors

* swap - review clean up (#3337)

* prevent mainnet search when no query

* defaults & i18n (#3344)

* gas limit magic

* fix gas issue

* more work for l2 swaps

* lint

* fix approvals

* fix l2 swaps

* l2 swaps work

* update multichain weth support

* clean up

* bump @rainbow/swaps

* weth wrapping / unwrapping working on L2s

* use error codes instead of messages

* swap - fix derived values behavior (#3393)

* tweak behavior

* unrel: we should toggle editable

* fix prepending 0 scenario

* swap - infer token network (#3395)

* add debug check

* pass hasBalance

* switch output network & addy

* ignoreTypeCheck

* ooops

* fix bad prop

* hasBalance -> from Disco

* fix expanded state crash

* fix fucked up nav

* disable output

* available networks explainooor (#3432)

* length check (#3433)

* swap - disable l2 favs (#3436)

* optional chaining

* conditional spacing

* props and clean up

* @skylar/swap e2e (#3441)

* save

* swap tests passing

* fix rest of the tests

* passing

* fix badges and l2 fallback images

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* fix send flow

* more fixes

* more fixes

* bump detox

* restore kilsession;

* restore dep bump

* fix e2e

* lint

* explainer sheet crash

* explainer sheet crash

* restore detox to iOS 13.7

* wait for currencylist screen

* more e2e fixes

* Swaps: Navigator entrypoints (#3465)

* Fix navigator entrypoints

* make android great again

* add handle

* tweaks

* e2e

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* lint

* swap -  bugz pass #1 (#3477)

* optionals

* reset native

* exchange formatting + parsing

* better

* fix arbitrum shiz

* L2 icons + colors

* isETH l2 check

* add lowercase

* hacky fix for swap adjusted amounts

* ci

* prop name baptism

* Update src/components/exchange/ExchangeField.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix asset call

* oop

Co-authored-by: Esteban Miño <efmino@uc.cl>

* network -> currentNetwork

* swaps: android go to review fix (#3482)

* android review button available

* end of line

* swaps - fix auto network regression from nav changes (#3484)

* add logic to handle new nav flow

* crash

* update for readability

* rm old logic

* review

* fix crash (#3493)

* swaps - fix savings flow regressions (#3499)

* savings check

* savings check + render logic

* use route name to continue showing currency list (#3491)

* update react-native-pager-view (#3506)

* swap - route picker (#3471)

* init assets 4 now

* assets updates

* add route to redux

* pass in route to qoutes

* component

* i18n + prop clean up

* code review

* android fixes + source

* route -> source

* add settings route

* source picker

* update copy

* opaque bq

* swaps - fix android network switcher crash (#3523)

* fix menu options call

* lowercase

* swaps - add coin icon to output title (#3522)

* update hook deps

* pass asset

* render conditionally

* add ignoreBadge

* lint

* android

* swaps  - setting currencies via route params (#3513)

* use route name to continue showing currency list

* routing complete / override issue WIP

* pass asset to button

* pass default assets thru to modal

* use defaults and pass to main swap

* clean

* init handle new default source

* update savings prop

* fix types, crash , & should update effect

* actually fix savings

* rm exchange component props

* ty chris

* pass asset

* lang

* fix type

Co-authored-by: derHowie <derhowiedesigns@gmail.com>

* Adds high + medium slippage warning in swap settings (#3512)

* Extract slippage input into separate component

* Update copy

* Adds price impact warning

* Update size

* Use Stack for spacing

* Convert module to TS

* expose isSeverePriceImpact

* Remove true used for testing

* Fix linter errors

* Remove old Text field

* Move constant

* Fix more linter errors

* Reduce font sizes for android

* Update MaxToleranceInput

* [TEAM2-95] Swap review sheet -> more details: exchange row formatting (#3535)

* place label and content in same Columns component

* reuse SwapDetailsLabel

* bleed.right 6

* swaps: flashbots + confirmation button UI (#3530)

* fix loading calc (#3528)

* Polish more details animation (#3532)

* Fix android layout shift on the swap screen (#3536)

* swaps: token network fixes (#3542)

* only set chainId that's a number

* swapSupportsFlashbots in settings

* enable swap button for owned assets in wallet screen

* fix wrong type on input asset

* show swap button if has balances

* lint

* Swap aggregator styling + copy updates (#3540)

* [TEAM2-113] Swap token list sheet: no tokens on [network] explainer sheet is missing (#3539)

* add obtain l2s explainer sheet

* esteban CR: dismiss android keyboard, use lang, clean up

* fix android spacing issue and navigation + keyboard fixes

* swaps - android selection color (#3545)

* android selection color

* crash

* colorForAsset

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - arbis warning cleanup (#3544)

* add network check to input focus

* input handeling + editable logic

* swaps: placeholder network badge (#3549)

* add badge

* dont render time if undefined

* remove skeleton network

* swaps - e2e tweak (#3494)

* e2e tweak

* fix testIds

* try notch

* update e2e to develop

* audit

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix discover search header (#3564)

* froze lock

* swaps: output value fixed decimals (#3550)

* fixed 6

* rollback unrelated change

* add roundingMode

* dismiss keyboard before interaction manager and use mainnet as default when currency.type does not exist (#3561)

* swaps - main swap sheet spec (#3521)

* fetching copy

* fix cut off /uncentered text

* fix colors & formatting

* fix prop name

* fix android line height

* bump react-native-safe-area-context

* react-native-safe-area-context

* rm soft menu call

* exchange specific component

* rm android specific logic + better formatting

* optimization

* rm ios only animation

* rm debug colors

* condense android inputs to better match ios

* Revert "bump react-native-safe-area-context"

This reverts commit 5de479a.

* Revert "rm soft menu call"

This reverts commit 837d843.

* Revert "react-native-safe-area-context"

This reverts commit c6c8240.

* Revert "rm soft menu call"

This reverts commit 837d843.

* revert safe area context bump

* rm flashbots label

* fix da notch

* rm soft menu bs

* tighten up padding a bit

* formatting + consistent heights

* add marginTop override

* rm spacers + small phone logic

* revert spacer

* isSmallAndroidPhone

* lint

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - fix l2 fallback colors (#3562)

* fix l2 fallback colors

* fix type

* override in focused when transitioning to main exchange modal (#3576)

* Fix exchange rate in swap review modal  (#3574)

* convert raw amounts to decimals before dividing

* fix fee percentage

* Update rainbow fee explainer sheet

* swaps: update flip behavior (#3577)

* flipping

* disable on fetching quote

* NOOP

* Swaps: Fix some keyboard issues (#3555)

* Fix swap screen keyboard issues

* Fix keyboard issues on swap settings screen

* fix

* add missing fromDiscover

* blur only on ios

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Update route swap icons (#3567)

* fix insets (#3584)

* revert discover input (#3586)

* fix filtering (#3585)

* pass type

* fix: use getNetworkFromType in switch network explainer (#3591)

* swaps: round max input (#3588)

* audit-ci

* audit-ci

* audit-ci

* [TEAM2-159] Disable L2 favorites in token expanded state (#3582)

* remove add to favorites from l2 AddTokenSheet

* preserve cta position and use includes

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap review sheet UI updates (#3568)

* Swap review sheet UI tweaks

* Tighten up Android rows

* Less crazy prettier formatting

* Fix android icon clipping

* Swap UI fixes

* Fix token amount centering

* tweak button centering on android

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* fix: rounding input on max to decimalPlaces (#3597)

* [TEAM2-3] Update Swap explain sheets copy (#3599)

* add explainers to swap settings

* i18n still curious

* esteban code review comments

* remove unncessary interaction manager

* dismiss keyboard if explainer appears first

* combine keyboard listeners into one effect

* settings title i18n

* Bunch of android layout fixes (#3600)

* swaps - input price fallback (#3603)

* fallback price

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fixes (#3604)

* TEAM2-186

* TEAM2-181

* TEAM2-183

* swaps: flipping behavior changes (#3609)

* flip from native value and arbitrum

* native to token values

* comment rm

* Update src/hooks/useSwapDerivedValues.ts

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

* swaps - extra height android explainers (#3607)

* bump js sdk

* fix mainnet color (#3621)

* use chain id to determine network (#3614)

* resolved explainer sheet capitalization typos (#3612)

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* swaps: handle price impact warnings (#3617)

* handle price impact warnings

* hasPriceImpact

* updated price_impact.label to reflect design copy changes

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* Swaps: Fix insufficient gas label (#3623)

* fix insufficient gas label

* get rid of OP

* move to lang files

* Swaps: Align swap layout to spec (#3615)

* Fix swap screen layout

* PR review

* swaps - auto adjust max for native assets (#3625)

* remove alert

* add support for all native assets

* remove e2e test

* Swaps: Android explainer + slippage input fixes (#3616)

* Swaps: Easier tap targets for explainer buttons

* Swaps: Align slippage % input label

* design system

* padding margin vertical

* fix merge

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix NaN rainbow fee (#3628)

* Fix swapping via exchanges alignment (#3620)

* repro TEAM2-175

* Fix percentage pill

* Remove hardcoded protocols

* Remove hardcoded protocols

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap: Fix input debounce (#3610)

* use setTimeout

* fix debounce issues

* use existing focus logic

* improve isFocused

* optional chaining

* bug fix

* flipping is back

* rm not needed clear

* fix swap flip when focused on native input

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - explainer updates (#3624)

* add explainer + tweak logic

* copy + style updates

* no token updates

* rm extra android height

* symbol instead of name

* pass token symbols

* l2 copy + output disabled copy

* rm loose

* fix e2e

* updated output_disabled explainer copy

* unified colors

* altered copy for unverified token sheet

* fix regression

Co-authored-by: Daniel Sinclair <d@niel.nyc>

* swaps: isHighPriceImpact debounce (#3629)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* [TEAM2-198][TEAM2-212] Favorite duplicates when searching for an address / Deprecate Imported category in Swap search (#3632)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* remove imported section and move imported data to verified/unverified sections

* clean up + add clarifying comment

* fix highliquidity dupe

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: update output disabled explainer (#3641)

* add title_empty

* eof

* Swaps: Analytics (#3635)

* analytics for swap submit/complete

* analytics for swap details update

* tweak open swap details modal analytics

* fixes + include network

* remove priceImpactPercentDisplay from event tracking

* nevermind

* remove wallet address from event tracking

* asset: get asset from discover to swap (#3640)

* fix

* chaining

* swaps: more input flip & max (#3638)

* add debounce in exchangefield

* works

* flipping color

* native field

* to precision when flipping

* swaps: fix matic fees (#3644)

* swaps: currency selection updates (#3645)

* Swap fixes (#3649)

* fix matic -> wmatic minimum received

* lowercase with

* comment

* rename

* [TEAM2-238] Pinned tokens in mainnet swap search (#3654)

* pin prioritized tokens

* use token addresses in references

* swaps: improve flipping (#3652)

* update state instead of ref handling

* arbitrum swap

* swaps- liquidity explainer (#3631)

* liquidity explainer

* fix pixel crash

* fix

* end of filw

* onLongPress

* waitAndTap

* add e2e Wallet screen after swiping left

* logs

* onLongPress

* rm logs

* audit

* move swap setting test to its own step

Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Esteban Miño <efmino@uc.cl>

* [TEAM2-230] Token Expanded sheet Swap entry point bugs (#3648)

* move fromDiscover flag

* fix fromDiscover param correctly

* Fix swap failures (#3653)

* bump swaps SDK

* remove unused ref

* add utility toHexWithoutLeadingZeros

* refactor gas estimation

* bump sdk again

* add missing tx params to wrap/unwrap

* fix incorrect assumption that swap action never requires approve

* fix approvals for wMatic

* bump polygon defaults

* code review comments

* disable trace call for l2s

* bump defaults for l2 swaps

* skip estimates when quote is in progress

* use defaults for l2s

* optimism to the moon

* fix default swap gas limit for l2s

* polygon to the moon

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix switching currency with max input (#3662)

* swaps: fix explainers inputs focus (#3663)

* Keyboard.dismiss on navigate:

* TEAM2-195

* android

* silence audit

* swaps: fix press disabled confirm (#3676)

* [TEAM2-229] Balances not invalidating after completed swap (#3677)

* l2 balance update wip

* fetching new balances on tx confirm

* clean up

* no previous balance case working and l2 icons showing

* remove logs + DRY up additionalAssetsData

* add sentry logs + clean up debug logs

* conditionally patch l2 balances manually

* fix conflicts

* add internalType

* additionalDataUpdateL2AssetBalance on internal type trade

* format asset to be updated

* dont explore authorize tx on l2

* bump optimism basic swap

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* swaps - fix savings params (#3681)

* fix params

* no details for savings

* fix slippage editing (#3689)

* balance check (#3684)

* swaps: don't fetch quote on input focus (#3686)

* don't change values on focus

* on native input

* swaps: improve useSwapDerivedOutputs (#3687)

* don't change values on focus

* on native input

* use use react query

* remove not needed stuff

* bump debouncedIsHighPriceImpact to 1 sec

* bump debouncedIsHighPriceImpact to 1 sec

* fix inputTokenDecimals in computeSlippageAdjustedAmounts

* ignore late quote data

* ignore next line

* comment

* if loading disable press on confirm

* polling to 10 secs

* review comments

* swaps - truncate long token symbols  (#3685)

* truncate symbol

* add right margin

* truncated text

* dumbo

* sort favorites by abc in filtered and unfiltered states (#3700)

* swaps: updated swipe logic (#3711)

* add back swipe gestures

* add back xtras

* revert old logic

* simple logic

* fix android animation jank

* dont pass source=rainbow (#3719)

* add footer spacing on android (#3718)

* Set custom depth of the scroll view in Exchange modal in RNCM (#3716)

* Set custom depth of the scroll view in Exchange modal in RNCM

* Update UIViewController+slack.swift

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* use colors from theme

* catch up versions

* fix some exchange list breaking changes

* swaps: savings flow e2e (#3721)

* testIDs

* tests

* swaps: fix fast currency select row (#3726)

* fix prop ordering

* better

* fix passed props

* fix spacing and native asset logic

* fix

* network fallback

* silence audit

* end of line audit

* fix-test-id

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Filter dropped txs (#3728)

* dropped txs

* bump to 1.6.17 so testflight works

* silence audit

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* swaps: tweak base fee e2e (#3735)

* lower base fee

* audit

* fix: empty input flipping behavior (#3738)

* swaps: exchange icons memos + error reset (#3741)

* memos + error reset

* Update src/components/expanded-state/swap-details/SwapDetailsExchangeRow.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: osdnk review (#3730)

* fix zerox logo

* tweak animation

* rm old network check

* add new network check

* add back interactions

* auditoor

* fix favs

* remove init base fee

* swaps: fix flashbots tip (#3745)

* Decrement nonce if flashbots txs is dropped (#3743)

* Add default slippage to remote config (#3749)

* add default_slippage_bips to config

* load default slippage from config when opening modal

* Failed L2 swaps don't display Failed transaction activity state (#3736)

* check tx receipts in pending tx watcher

* remove redundant title assignment

* only fetch receipt if nonce has not been included

* check for txObj before fetching receipt instead

* rename flashbots feature flag (#3750)

* fix weth plus eth favorite scenario (#3753)

* disable swap button after pressed once (#3752)

* disable swap button after pressed once

* extract to aux function

* swaps: remote slippage by network (#3756)

* config work

* fix effect

* swaps: fix gas loading state (#3755)

* add is gas ready var

* revert not needed change

* Boolean(gasValue?.amount)

* swaps: add loading check to confirm button (#3754)

* add loading checks

* Revert "add loading checks"

This reverts commit 583afe7.

* disable long press while loading

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix: bump swap with permit gas (#3757)

* bump to 400000

* bump to 400000

* rainbow-me/swaps 0.1.9

* fixedGasLimitAfterApproval

* fix ../model/config import

* silence audit

* Swaps: Fix select currency scroll on Android (#3759)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* input fix (#3762)

* input fix

* bug fix

* swaps: fix 0. value in inputs behavior (#3766)

* fix flashbots speed up (#3765)

* Fix weird swap sheet clipping on Android (#3768)

* swaps: check for valid slippage remote config before setting it (#3767)

* check is not null first

* credefault values

* use default

* Check first jic

* fix (#3771)

* fix (#3772)

* swaps: block flashbots swaps miner tip (#3769)

* dont allow less than 6

* use FLASHBOTS_MIN_TIP

* swaps: fix slippage reset (#3773)

* fix it

* fix comments

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>
Co-authored-by: moxey.eth <jakemoxey@gmail.com>
Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>
Co-authored-by: Luc Succes <l2succes@gmail.com>
Co-authored-by: pugson <hi@wojtek.im>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Daniel Sinclair <d@niel.nyc>
Co-authored-by: Daniel Sinclair <daniel@rainbow.me>
Co-authored-by: Michał Osadnik <micosa97@gmail.com>
estebanmino added a commit that referenced this pull request Jul 28, 2022
* fix loading state and small markets bug

* swap review updates (#3236)

* change button text

* init ds

* tweak min content height

* mark impact as negative

* init fee row

* update price row

* i18n

* add custom text color to pull

* rename and refactor exchange row

* fix naming

* moar i18n

* first pass: swap settings

* rm legacy logic

* lil font tweak

* halfway swap settings

* flashbots protec

* pretty

* rainbo fee hook

* pipe up

* fee row pre i18n

* tweak opacities

* new currencyTile

* update labels

* anotha label

* rm collabsible option

* first pass new masthead

* init exchange icons

* plug in slippage

* add xtra checks

* exchange row

* add BPA functionality to row comp

* rm fun stuff :(

* init explainer

* clean up masthead

* explainer height

* lang

* review

* enable swapping all assets

* fix swap quotes and cta update

* swap exchange icons (#3268)

* icon url

* fallback colors

* components

* rm default eth (#3270)

* fix formatting of max. sold and min received

* fix weth swap details

* navigate to input or output automatically

* allow l2s

* fix formatting

* token selection for L2s working

* l2 quotes working

* l2 search working

* fix loading issue

* op gas stuff

* revert bs

* l2 quotes working and review sheet working

* clean up

* expanded state available networks (#3306)

* additional networks hook update

* component and add to sheet

* tweak rendering logic

* i18n

* yeah

* handle singular case

* network switcher (#3308)

* network switcher component

* add util

* fix chainId noise

* refactor + add switcher

* fix queries

* backbutton

* handle network switch

* i18n

* fix key

* more swap fixes

* UniswapCurrency => SwappableAsset

* fix min received formatting

* use uniqueId (#3318)

* swap - fix discover charts (#3317)

* fix discover charts

* fix discover charts address issue

* fix discover charts address issue

* fix discover charts

* rename func

* fix missing price crash

* mmkv + nav to explain sheet

* tweak func calls

* add explain sheet type

* tweak dark arbitrum color

* reset swap inputs (#3328)

* reset inputs

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* flashbots no l2 (#3327)

* disable in settings

* fix mainnet check

* more fixes

* updated dark mode network colors

* swap - review clean up (#3337)

* prevent mainnet search when no query

* defaults & i18n (#3344)

* gas limit magic

* fix gas issue

* more work for l2 swaps

* lint

* fix approvals

* fix l2 swaps

* l2 swaps work

* update multichain weth support

* clean up

* bump @rainbow/swaps

* weth wrapping / unwrapping working on L2s

* use error codes instead of messages

* swap - fix derived values behavior (#3393)

* tweak behavior

* unrel: we should toggle editable

* fix prepending 0 scenario

* swap - infer token network (#3395)

* add debug check

* pass hasBalance

* switch output network & addy

* ignoreTypeCheck

* ooops

* fix bad prop

* hasBalance -> from Disco

* fix expanded state crash

* fix fucked up nav

* disable output

* available networks explainooor (#3432)

* length check (#3433)

* swap - disable l2 favs (#3436)

* optional chaining

* conditional spacing

* props and clean up

* @skylar/swap e2e (#3441)

* save

* swap tests passing

* fix rest of the tests

* passing

* fix badges and l2 fallback images

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* fix send flow

* more fixes

* more fixes

* bump detox

* restore kilsession;

* restore dep bump

* fix e2e

* lint

* explainer sheet crash

* explainer sheet crash

* restore detox to iOS 13.7

* wait for currencylist screen

* more e2e fixes

* Swaps: Navigator entrypoints (#3465)

* Fix navigator entrypoints

* make android great again

* add handle

* tweaks

* e2e

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* lint

* swap -  bugz pass #1 (#3477)

* optionals

* reset native

* exchange formatting + parsing

* better

* fix arbitrum shiz

* L2 icons + colors

* isETH l2 check

* add lowercase

* hacky fix for swap adjusted amounts

* ci

* prop name baptism

* Update src/components/exchange/ExchangeField.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix asset call

* oop

Co-authored-by: Esteban Miño <efmino@uc.cl>

* network -> currentNetwork

* swaps: android go to review fix (#3482)

* android review button available

* end of line

* swaps - fix auto network regression from nav changes (#3484)

* add logic to handle new nav flow

* crash

* update for readability

* rm old logic

* review

* fix crash (#3493)

* swaps - fix savings flow regressions (#3499)

* savings check

* savings check + render logic

* use route name to continue showing currency list (#3491)

* update react-native-pager-view (#3506)

* swap - route picker (#3471)

* init assets 4 now

* assets updates

* add route to redux

* pass in route to qoutes

* component

* i18n + prop clean up

* code review

* android fixes + source

* route -> source

* add settings route

* source picker

* update copy

* opaque bq

* swaps - fix android network switcher crash (#3523)

* fix menu options call

* lowercase

* swaps - add coin icon to output title (#3522)

* update hook deps

* pass asset

* render conditionally

* add ignoreBadge

* lint

* android

* swaps  - setting currencies via route params (#3513)

* use route name to continue showing currency list

* routing complete / override issue WIP

* pass asset to button

* pass default assets thru to modal

* use defaults and pass to main swap

* clean

* init handle new default source

* update savings prop

* fix types, crash , & should update effect

* actually fix savings

* rm exchange component props

* ty chris

* pass asset

* lang

* fix type

Co-authored-by: derHowie <derhowiedesigns@gmail.com>

* Adds high + medium slippage warning in swap settings (#3512)

* Extract slippage input into separate component

* Update copy

* Adds price impact warning

* Update size

* Use Stack for spacing

* Convert module to TS

* expose isSeverePriceImpact

* Remove true used for testing

* Fix linter errors

* Remove old Text field

* Move constant

* Fix more linter errors

* Reduce font sizes for android

* Update MaxToleranceInput

* [TEAM2-95] Swap review sheet -> more details: exchange row formatting (#3535)

* place label and content in same Columns component

* reuse SwapDetailsLabel

* bleed.right 6

* swaps: flashbots + confirmation button UI (#3530)

* fix loading calc (#3528)

* Polish more details animation (#3532)

* Fix android layout shift on the swap screen (#3536)

* swaps: token network fixes (#3542)

* only set chainId that's a number

* swapSupportsFlashbots in settings

* enable swap button for owned assets in wallet screen

* fix wrong type on input asset

* show swap button if has balances

* lint

* Swap aggregator styling + copy updates (#3540)

* [TEAM2-113] Swap token list sheet: no tokens on [network] explainer sheet is missing (#3539)

* add obtain l2s explainer sheet

* esteban CR: dismiss android keyboard, use lang, clean up

* fix android spacing issue and navigation + keyboard fixes

* swaps - android selection color (#3545)

* android selection color

* crash

* colorForAsset

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - arbis warning cleanup (#3544)

* add network check to input focus

* input handeling + editable logic

* swaps: placeholder network badge (#3549)

* add badge

* dont render time if undefined

* remove skeleton network

* swaps - e2e tweak (#3494)

* e2e tweak

* fix testIds

* try notch

* update e2e to develop

* audit

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix discover search header (#3564)

* froze lock

* swaps: output value fixed decimals (#3550)

* fixed 6

* rollback unrelated change

* add roundingMode

* dismiss keyboard before interaction manager and use mainnet as default when currency.type does not exist (#3561)

* swaps - main swap sheet spec (#3521)

* fetching copy

* fix cut off /uncentered text

* fix colors & formatting

* fix prop name

* fix android line height

* bump react-native-safe-area-context

* react-native-safe-area-context

* rm soft menu call

* exchange specific component

* rm android specific logic + better formatting

* optimization

* rm ios only animation

* rm debug colors

* condense android inputs to better match ios

* Revert "bump react-native-safe-area-context"

This reverts commit 5de479a.

* Revert "rm soft menu call"

This reverts commit 837d843.

* Revert "react-native-safe-area-context"

This reverts commit c6c8240.

* Revert "rm soft menu call"

This reverts commit 837d843.

* revert safe area context bump

* rm flashbots label

* fix da notch

* rm soft menu bs

* tighten up padding a bit

* formatting + consistent heights

* add marginTop override

* rm spacers + small phone logic

* revert spacer

* isSmallAndroidPhone

* lint

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - fix l2 fallback colors (#3562)

* fix l2 fallback colors

* fix type

* override in focused when transitioning to main exchange modal (#3576)

* Fix exchange rate in swap review modal  (#3574)

* convert raw amounts to decimals before dividing

* fix fee percentage

* Update rainbow fee explainer sheet

* swaps: update flip behavior (#3577)

* flipping

* disable on fetching quote

* NOOP

* Swaps: Fix some keyboard issues (#3555)

* Fix swap screen keyboard issues

* Fix keyboard issues on swap settings screen

* fix

* add missing fromDiscover

* blur only on ios

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Update route swap icons (#3567)

* fix insets (#3584)

* revert discover input (#3586)

* fix filtering (#3585)

* pass type

* fix: use getNetworkFromType in switch network explainer (#3591)

* swaps: round max input (#3588)

* audit-ci

* audit-ci

* audit-ci

* [TEAM2-159] Disable L2 favorites in token expanded state (#3582)

* remove add to favorites from l2 AddTokenSheet

* preserve cta position and use includes

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap review sheet UI updates (#3568)

* Swap review sheet UI tweaks

* Tighten up Android rows

* Less crazy prettier formatting

* Fix android icon clipping

* Swap UI fixes

* Fix token amount centering

* tweak button centering on android

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* fix: rounding input on max to decimalPlaces (#3597)

* [TEAM2-3] Update Swap explain sheets copy (#3599)

* add explainers to swap settings

* i18n still curious

* esteban code review comments

* remove unncessary interaction manager

* dismiss keyboard if explainer appears first

* combine keyboard listeners into one effect

* settings title i18n

* Bunch of android layout fixes (#3600)

* swaps - input price fallback (#3603)

* fallback price

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fixes (#3604)

* TEAM2-186

* TEAM2-181

* TEAM2-183

* swaps: flipping behavior changes (#3609)

* flip from native value and arbitrum

* native to token values

* comment rm

* Update src/hooks/useSwapDerivedValues.ts

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

* swaps - extra height android explainers (#3607)

* bump js sdk

* fix mainnet color (#3621)

* use chain id to determine network (#3614)

* resolved explainer sheet capitalization typos (#3612)

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* swaps: handle price impact warnings (#3617)

* handle price impact warnings

* hasPriceImpact

* updated price_impact.label to reflect design copy changes

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* Swaps: Fix insufficient gas label (#3623)

* fix insufficient gas label

* get rid of OP

* move to lang files

* Swaps: Align swap layout to spec (#3615)

* Fix swap screen layout

* PR review

* swaps - auto adjust max for native assets (#3625)

* remove alert

* add support for all native assets

* remove e2e test

* Swaps: Android explainer + slippage input fixes (#3616)

* Swaps: Easier tap targets for explainer buttons

* Swaps: Align slippage % input label

* design system

* padding margin vertical

* fix merge

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix NaN rainbow fee (#3628)

* Fix swapping via exchanges alignment (#3620)

* repro TEAM2-175

* Fix percentage pill

* Remove hardcoded protocols

* Remove hardcoded protocols

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap: Fix input debounce (#3610)

* use setTimeout

* fix debounce issues

* use existing focus logic

* improve isFocused

* optional chaining

* bug fix

* flipping is back

* rm not needed clear

* fix swap flip when focused on native input

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - explainer updates (#3624)

* add explainer + tweak logic

* copy + style updates

* no token updates

* rm extra android height

* symbol instead of name

* pass token symbols

* l2 copy + output disabled copy

* rm loose

* fix e2e

* updated output_disabled explainer copy

* unified colors

* altered copy for unverified token sheet

* fix regression

Co-authored-by: Daniel Sinclair <d@niel.nyc>

* swaps: isHighPriceImpact debounce (#3629)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* [TEAM2-198][TEAM2-212] Favorite duplicates when searching for an address / Deprecate Imported category in Swap search (#3632)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* remove imported section and move imported data to verified/unverified sections

* clean up + add clarifying comment

* fix highliquidity dupe

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: update output disabled explainer (#3641)

* add title_empty

* eof

* Swaps: Analytics (#3635)

* analytics for swap submit/complete

* analytics for swap details update

* tweak open swap details modal analytics

* fixes + include network

* remove priceImpactPercentDisplay from event tracking

* nevermind

* remove wallet address from event tracking

* asset: get asset from discover to swap (#3640)

* fix

* chaining

* swaps: more input flip & max (#3638)

* add debounce in exchangefield

* works

* flipping color

* native field

* to precision when flipping

* swaps: fix matic fees (#3644)

* swaps: currency selection updates (#3645)

* Swap fixes (#3649)

* fix matic -> wmatic minimum received

* lowercase with

* comment

* rename

* [TEAM2-238] Pinned tokens in mainnet swap search (#3654)

* pin prioritized tokens

* use token addresses in references

* swaps: improve flipping (#3652)

* update state instead of ref handling

* arbitrum swap

* swaps- liquidity explainer (#3631)

* liquidity explainer

* fix pixel crash

* fix

* end of filw

* onLongPress

* waitAndTap

* add e2e Wallet screen after swiping left

* logs

* onLongPress

* rm logs

* audit

* move swap setting test to its own step

Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Esteban Miño <efmino@uc.cl>

* [TEAM2-230] Token Expanded sheet Swap entry point bugs (#3648)

* move fromDiscover flag

* fix fromDiscover param correctly

* Fix swap failures (#3653)

* bump swaps SDK

* remove unused ref

* add utility toHexWithoutLeadingZeros

* refactor gas estimation

* bump sdk again

* add missing tx params to wrap/unwrap

* fix incorrect assumption that swap action never requires approve

* fix approvals for wMatic

* bump polygon defaults

* code review comments

* disable trace call for l2s

* bump defaults for l2 swaps

* skip estimates when quote is in progress

* use defaults for l2s

* optimism to the moon

* fix default swap gas limit for l2s

* polygon to the moon

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix switching currency with max input (#3662)

* swaps: fix explainers inputs focus (#3663)

* Keyboard.dismiss on navigate:

* TEAM2-195

* android

* silence audit

* swaps: fix press disabled confirm (#3676)

* [TEAM2-229] Balances not invalidating after completed swap (#3677)

* l2 balance update wip

* fetching new balances on tx confirm

* clean up

* no previous balance case working and l2 icons showing

* remove logs + DRY up additionalAssetsData

* add sentry logs + clean up debug logs

* conditionally patch l2 balances manually

* fix conflicts

* add internalType

* additionalDataUpdateL2AssetBalance on internal type trade

* format asset to be updated

* dont explore authorize tx on l2

* bump optimism basic swap

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* swaps - fix savings params (#3681)

* fix params

* no details for savings

* fix slippage editing (#3689)

* balance check (#3684)

* swaps: don't fetch quote on input focus (#3686)

* don't change values on focus

* on native input

* swaps: improve useSwapDerivedOutputs (#3687)

* don't change values on focus

* on native input

* use use react query

* remove not needed stuff

* bump debouncedIsHighPriceImpact to 1 sec

* bump debouncedIsHighPriceImpact to 1 sec

* fix inputTokenDecimals in computeSlippageAdjustedAmounts

* ignore late quote data

* ignore next line

* comment

* if loading disable press on confirm

* polling to 10 secs

* review comments

* swaps - truncate long token symbols  (#3685)

* truncate symbol

* add right margin

* truncated text

* dumbo

* sort favorites by abc in filtered and unfiltered states (#3700)

* swaps: updated swipe logic (#3711)

* add back swipe gestures

* add back xtras

* revert old logic

* simple logic

* fix android animation jank

* dont pass source=rainbow (#3719)

* add footer spacing on android (#3718)

* Set custom depth of the scroll view in Exchange modal in RNCM (#3716)

* Set custom depth of the scroll view in Exchange modal in RNCM

* Update UIViewController+slack.swift

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* use colors from theme

* catch up versions

* fix some exchange list breaking changes

* swaps: savings flow e2e (#3721)

* testIDs

* tests

* swaps: fix fast currency select row (#3726)

* fix prop ordering

* better

* fix passed props

* fix spacing and native asset logic

* fix

* network fallback

* silence audit

* end of line audit

* fix-test-id

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Filter dropped txs (#3728)

* dropped txs

* bump to 1.6.17 so testflight works

* silence audit

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* swaps: tweak base fee e2e (#3735)

* lower base fee

* audit

* fix: empty input flipping behavior (#3738)

* swaps: exchange icons memos + error reset (#3741)

* memos + error reset

* Update src/components/expanded-state/swap-details/SwapDetailsExchangeRow.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: osdnk review (#3730)

* fix zerox logo

* tweak animation

* rm old network check

* add new network check

* add back interactions

* auditoor

* fix favs

* remove init base fee

* swaps: fix flashbots tip (#3745)

* Decrement nonce if flashbots txs is dropped (#3743)

* Add default slippage to remote config (#3749)

* add default_slippage_bips to config

* load default slippage from config when opening modal

* Failed L2 swaps don't display Failed transaction activity state (#3736)

* check tx receipts in pending tx watcher

* remove redundant title assignment

* only fetch receipt if nonce has not been included

* check for txObj before fetching receipt instead

* rename flashbots feature flag (#3750)

* fix weth plus eth favorite scenario (#3753)

* disable swap button after pressed once (#3752)

* disable swap button after pressed once

* extract to aux function

* swaps: remote slippage by network (#3756)

* config work

* fix effect

* swaps: fix gas loading state (#3755)

* add is gas ready var

* revert not needed change

* Boolean(gasValue?.amount)

* swaps: add loading check to confirm button (#3754)

* add loading checks

* Revert "add loading checks"

This reverts commit 583afe7.

* disable long press while loading

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix: bump swap with permit gas (#3757)

* bump to 400000

* bump to 400000

* rainbow-me/swaps 0.1.9

* fixedGasLimitAfterApproval

* fix ../model/config import

* silence audit

* Swaps: Fix select currency scroll on Android (#3759)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* input fix (#3762)

* input fix

* bug fix

* swaps: fix 0. value in inputs behavior (#3766)

* fix flashbots speed up (#3765)

* Fix weird swap sheet clipping on Android (#3768)

* swaps: check for valid slippage remote config before setting it (#3767)

* check is not null first

* credefault values

* use default

* Check first jic

* fix (#3771)

* fix (#3772)

* swaps: block flashbots swaps miner tip (#3769)

* dont allow less than 6

* use FLASHBOTS_MIN_TIP

* swaps: fix slippage reset (#3773)

* fix it

* fix comments

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>
Co-authored-by: moxey.eth <jakemoxey@gmail.com>
Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>
Co-authored-by: Luc Succes <l2succes@gmail.com>
Co-authored-by: pugson <hi@wojtek.im>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Daniel Sinclair <d@niel.nyc>
Co-authored-by: Daniel Sinclair <daniel@rainbow.me>
Co-authored-by: Michał Osadnik <micosa97@gmail.com>
estebanmino added a commit that referenced this pull request Jul 28, 2022
* Rainbow swaps (#2763)

* fix loading state and small markets bug

* swap review updates (#3236)

* change button text

* init ds

* tweak min content height

* mark impact as negative

* init fee row

* update price row

* i18n

* add custom text color to pull

* rename and refactor exchange row

* fix naming

* moar i18n

* first pass: swap settings

* rm legacy logic

* lil font tweak

* halfway swap settings

* flashbots protec

* pretty

* rainbo fee hook

* pipe up

* fee row pre i18n

* tweak opacities

* new currencyTile

* update labels

* anotha label

* rm collabsible option

* first pass new masthead

* init exchange icons

* plug in slippage

* add xtra checks

* exchange row

* add BPA functionality to row comp

* rm fun stuff :(

* init explainer

* clean up masthead

* explainer height

* lang

* review

* enable swapping all assets

* fix swap quotes and cta update

* swap exchange icons (#3268)

* icon url

* fallback colors

* components

* rm default eth (#3270)

* fix formatting of max. sold and min received

* fix weth swap details

* navigate to input or output automatically

* allow l2s

* fix formatting

* token selection for L2s working

* l2 quotes working

* l2 search working

* fix loading issue

* op gas stuff

* revert bs

* l2 quotes working and review sheet working

* clean up

* expanded state available networks (#3306)

* additional networks hook update

* component and add to sheet

* tweak rendering logic

* i18n

* yeah

* handle singular case

* network switcher (#3308)

* network switcher component

* add util

* fix chainId noise

* refactor + add switcher

* fix queries

* backbutton

* handle network switch

* i18n

* fix key

* more swap fixes

* UniswapCurrency => SwappableAsset

* fix min received formatting

* use uniqueId (#3318)

* swap - fix discover charts (#3317)

* fix discover charts

* fix discover charts address issue

* fix discover charts address issue

* fix discover charts

* rename func

* fix missing price crash

* mmkv + nav to explain sheet

* tweak func calls

* add explain sheet type

* tweak dark arbitrum color

* reset swap inputs (#3328)

* reset inputs

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* flashbots no l2 (#3327)

* disable in settings

* fix mainnet check

* more fixes

* updated dark mode network colors

* swap - review clean up (#3337)

* prevent mainnet search when no query

* defaults & i18n (#3344)

* gas limit magic

* fix gas issue

* more work for l2 swaps

* lint

* fix approvals

* fix l2 swaps

* l2 swaps work

* update multichain weth support

* clean up

* bump @rainbow/swaps

* weth wrapping / unwrapping working on L2s

* use error codes instead of messages

* swap - fix derived values behavior (#3393)

* tweak behavior

* unrel: we should toggle editable

* fix prepending 0 scenario

* swap - infer token network (#3395)

* add debug check

* pass hasBalance

* switch output network & addy

* ignoreTypeCheck

* ooops

* fix bad prop

* hasBalance -> from Disco

* fix expanded state crash

* fix fucked up nav

* disable output

* available networks explainooor (#3432)

* length check (#3433)

* swap - disable l2 favs (#3436)

* optional chaining

* conditional spacing

* props and clean up

* @skylar/swap e2e (#3441)

* save

* swap tests passing

* fix rest of the tests

* passing

* fix badges and l2 fallback images

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* fix send flow

* more fixes

* more fixes

* bump detox

* restore kilsession;

* restore dep bump

* fix e2e

* lint

* explainer sheet crash

* explainer sheet crash

* restore detox to iOS 13.7

* wait for currencylist screen

* more e2e fixes

* Swaps: Navigator entrypoints (#3465)

* Fix navigator entrypoints

* make android great again

* add handle

* tweaks

* e2e

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* more e2e fixes

* lint

* swap -  bugz pass #1 (#3477)

* optionals

* reset native

* exchange formatting + parsing

* better

* fix arbitrum shiz

* L2 icons + colors

* isETH l2 check

* add lowercase

* hacky fix for swap adjusted amounts

* ci

* prop name baptism

* Update src/components/exchange/ExchangeField.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix asset call

* oop

Co-authored-by: Esteban Miño <efmino@uc.cl>

* network -> currentNetwork

* swaps: android go to review fix (#3482)

* android review button available

* end of line

* swaps - fix auto network regression from nav changes (#3484)

* add logic to handle new nav flow

* crash

* update for readability

* rm old logic

* review

* fix crash (#3493)

* swaps - fix savings flow regressions (#3499)

* savings check

* savings check + render logic

* use route name to continue showing currency list (#3491)

* update react-native-pager-view (#3506)

* swap - route picker (#3471)

* init assets 4 now

* assets updates

* add route to redux

* pass in route to qoutes

* component

* i18n + prop clean up

* code review

* android fixes + source

* route -> source

* add settings route

* source picker

* update copy

* opaque bq

* swaps - fix android network switcher crash (#3523)

* fix menu options call

* lowercase

* swaps - add coin icon to output title (#3522)

* update hook deps

* pass asset

* render conditionally

* add ignoreBadge

* lint

* android

* swaps  - setting currencies via route params (#3513)

* use route name to continue showing currency list

* routing complete / override issue WIP

* pass asset to button

* pass default assets thru to modal

* use defaults and pass to main swap

* clean

* init handle new default source

* update savings prop

* fix types, crash , & should update effect

* actually fix savings

* rm exchange component props

* ty chris

* pass asset

* lang

* fix type

Co-authored-by: derHowie <derhowiedesigns@gmail.com>

* Adds high + medium slippage warning in swap settings (#3512)

* Extract slippage input into separate component

* Update copy

* Adds price impact warning

* Update size

* Use Stack for spacing

* Convert module to TS

* expose isSeverePriceImpact

* Remove true used for testing

* Fix linter errors

* Remove old Text field

* Move constant

* Fix more linter errors

* Reduce font sizes for android

* Update MaxToleranceInput

* [TEAM2-95] Swap review sheet -> more details: exchange row formatting (#3535)

* place label and content in same Columns component

* reuse SwapDetailsLabel

* bleed.right 6

* swaps: flashbots + confirmation button UI (#3530)

* fix loading calc (#3528)

* Polish more details animation (#3532)

* Fix android layout shift on the swap screen (#3536)

* swaps: token network fixes (#3542)

* only set chainId that's a number

* swapSupportsFlashbots in settings

* enable swap button for owned assets in wallet screen

* fix wrong type on input asset

* show swap button if has balances

* lint

* Swap aggregator styling + copy updates (#3540)

* [TEAM2-113] Swap token list sheet: no tokens on [network] explainer sheet is missing (#3539)

* add obtain l2s explainer sheet

* esteban CR: dismiss android keyboard, use lang, clean up

* fix android spacing issue and navigation + keyboard fixes

* swaps - android selection color (#3545)

* android selection color

* crash

* colorForAsset

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - arbis warning cleanup (#3544)

* add network check to input focus

* input handeling + editable logic

* swaps: placeholder network badge (#3549)

* add badge

* dont render time if undefined

* remove skeleton network

* swaps - e2e tweak (#3494)

* e2e tweak

* fix testIds

* try notch

* update e2e to develop

* audit

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix discover search header (#3564)

* froze lock

* swaps: output value fixed decimals (#3550)

* fixed 6

* rollback unrelated change

* add roundingMode

* dismiss keyboard before interaction manager and use mainnet as default when currency.type does not exist (#3561)

* swaps - main swap sheet spec (#3521)

* fetching copy

* fix cut off /uncentered text

* fix colors & formatting

* fix prop name

* fix android line height

* bump react-native-safe-area-context

* react-native-safe-area-context

* rm soft menu call

* exchange specific component

* rm android specific logic + better formatting

* optimization

* rm ios only animation

* rm debug colors

* condense android inputs to better match ios

* Revert "bump react-native-safe-area-context"

This reverts commit 5de479a.

* Revert "rm soft menu call"

This reverts commit 837d843.

* Revert "react-native-safe-area-context"

This reverts commit c6c8240.

* Revert "rm soft menu call"

This reverts commit 837d843.

* revert safe area context bump

* rm flashbots label

* fix da notch

* rm soft menu bs

* tighten up padding a bit

* formatting + consistent heights

* add marginTop override

* rm spacers + small phone logic

* revert spacer

* isSmallAndroidPhone

* lint

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - fix l2 fallback colors (#3562)

* fix l2 fallback colors

* fix type

* override in focused when transitioning to main exchange modal (#3576)

* Fix exchange rate in swap review modal  (#3574)

* convert raw amounts to decimals before dividing

* fix fee percentage

* Update rainbow fee explainer sheet

* swaps: update flip behavior (#3577)

* flipping

* disable on fetching quote

* NOOP

* Swaps: Fix some keyboard issues (#3555)

* Fix swap screen keyboard issues

* Fix keyboard issues on swap settings screen

* fix

* add missing fromDiscover

* blur only on ios

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Update route swap icons (#3567)

* fix insets (#3584)

* revert discover input (#3586)

* fix filtering (#3585)

* pass type

* fix: use getNetworkFromType in switch network explainer (#3591)

* swaps: round max input (#3588)

* audit-ci

* audit-ci

* audit-ci

* [TEAM2-159] Disable L2 favorites in token expanded state (#3582)

* remove add to favorites from l2 AddTokenSheet

* preserve cta position and use includes

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap review sheet UI updates (#3568)

* Swap review sheet UI tweaks

* Tighten up Android rows

* Less crazy prettier formatting

* Fix android icon clipping

* Swap UI fixes

* Fix token amount centering

* tweak button centering on android

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* fix: rounding input on max to decimalPlaces (#3597)

* [TEAM2-3] Update Swap explain sheets copy (#3599)

* add explainers to swap settings

* i18n still curious

* esteban code review comments

* remove unncessary interaction manager

* dismiss keyboard if explainer appears first

* combine keyboard listeners into one effect

* settings title i18n

* Bunch of android layout fixes (#3600)

* swaps - input price fallback (#3603)

* fallback price

* Update src/hooks/useSwapDerivedOutputs.ts

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fixes (#3604)

* TEAM2-186

* TEAM2-181

* TEAM2-183

* swaps: flipping behavior changes (#3609)

* flip from native value and arbitrum

* native to token values

* comment rm

* Update src/hooks/useSwapDerivedValues.ts

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>

* swaps - extra height android explainers (#3607)

* bump js sdk

* fix mainnet color (#3621)

* use chain id to determine network (#3614)

* resolved explainer sheet capitalization typos (#3612)

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* swaps: handle price impact warnings (#3617)

* handle price impact warnings

* hasPriceImpact

* updated price_impact.label to reflect design copy changes

Co-authored-by: Daniel Sinclair <daniel@rainbow.me>

* Swaps: Fix insufficient gas label (#3623)

* fix insufficient gas label

* get rid of OP

* move to lang files

* Swaps: Align swap layout to spec (#3615)

* Fix swap screen layout

* PR review

* swaps - auto adjust max for native assets (#3625)

* remove alert

* add support for all native assets

* remove e2e test

* Swaps: Android explainer + slippage input fixes (#3616)

* Swaps: Easier tap targets for explainer buttons

* Swaps: Align slippage % input label

* design system

* padding margin vertical

* fix merge

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix NaN rainbow fee (#3628)

* Fix swapping via exchanges alignment (#3620)

* repro TEAM2-175

* Fix percentage pill

* Remove hardcoded protocols

* Remove hardcoded protocols

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swap: Fix input debounce (#3610)

* use setTimeout

* fix debounce issues

* use existing focus logic

* improve isFocused

* optional chaining

* bug fix

* flipping is back

* rm not needed clear

* fix swap flip when focused on native input

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps - explainer updates (#3624)

* add explainer + tweak logic

* copy + style updates

* no token updates

* rm extra android height

* symbol instead of name

* pass token symbols

* l2 copy + output disabled copy

* rm loose

* fix e2e

* updated output_disabled explainer copy

* unified colors

* altered copy for unverified token sheet

* fix regression

Co-authored-by: Daniel Sinclair <d@niel.nyc>

* swaps: isHighPriceImpact debounce (#3629)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* [TEAM2-198][TEAM2-212] Favorite duplicates when searching for an address / Deprecate Imported category in Swap search (#3632)

* debounce

* debouncedIsHighPriceImpact

* fix e2e

* remove imported section and move imported data to verified/unverified sections

* clean up + add clarifying comment

* fix highliquidity dupe

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: update output disabled explainer (#3641)

* add title_empty

* eof

* Swaps: Analytics (#3635)

* analytics for swap submit/complete

* analytics for swap details update

* tweak open swap details modal analytics

* fixes + include network

* remove priceImpactPercentDisplay from event tracking

* nevermind

* remove wallet address from event tracking

* asset: get asset from discover to swap (#3640)

* fix

* chaining

* swaps: more input flip & max (#3638)

* add debounce in exchangefield

* works

* flipping color

* native field

* to precision when flipping

* swaps: fix matic fees (#3644)

* swaps: currency selection updates (#3645)

* Swap fixes (#3649)

* fix matic -> wmatic minimum received

* lowercase with

* comment

* rename

* [TEAM2-238] Pinned tokens in mainnet swap search (#3654)

* pin prioritized tokens

* use token addresses in references

* swaps: improve flipping (#3652)

* update state instead of ref handling

* arbitrum swap

* swaps- liquidity explainer (#3631)

* liquidity explainer

* fix pixel crash

* fix

* end of filw

* onLongPress

* waitAndTap

* add e2e Wallet screen after swiping left

* logs

* onLongPress

* rm logs

* audit

* move swap setting test to its own step

Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Esteban Miño <efmino@uc.cl>

* [TEAM2-230] Token Expanded sheet Swap entry point bugs (#3648)

* move fromDiscover flag

* fix fromDiscover param correctly

* Fix swap failures (#3653)

* bump swaps SDK

* remove unused ref

* add utility toHexWithoutLeadingZeros

* refactor gas estimation

* bump sdk again

* add missing tx params to wrap/unwrap

* fix incorrect assumption that swap action never requires approve

* fix approvals for wMatic

* bump polygon defaults

* code review comments

* disable trace call for l2s

* bump defaults for l2 swaps

* skip estimates when quote is in progress

* use defaults for l2s

* optimism to the moon

* fix default swap gas limit for l2s

* polygon to the moon

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix switching currency with max input (#3662)

* swaps: fix explainers inputs focus (#3663)

* Keyboard.dismiss on navigate:

* TEAM2-195

* android

* silence audit

* swaps: fix press disabled confirm (#3676)

* [TEAM2-229] Balances not invalidating after completed swap (#3677)

* l2 balance update wip

* fetching new balances on tx confirm

* clean up

* no previous balance case working and l2 icons showing

* remove logs + DRY up additionalAssetsData

* add sentry logs + clean up debug logs

* conditionally patch l2 balances manually

* fix conflicts

* add internalType

* additionalDataUpdateL2AssetBalance on internal type trade

* format asset to be updated

* dont explore authorize tx on l2

* bump optimism basic swap

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* Update src/redux/additionalAssetsData.ts

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* swaps - fix savings params (#3681)

* fix params

* no details for savings

* fix slippage editing (#3689)

* balance check (#3684)

* swaps: don't fetch quote on input focus (#3686)

* don't change values on focus

* on native input

* swaps: improve useSwapDerivedOutputs (#3687)

* don't change values on focus

* on native input

* use use react query

* remove not needed stuff

* bump debouncedIsHighPriceImpact to 1 sec

* bump debouncedIsHighPriceImpact to 1 sec

* fix inputTokenDecimals in computeSlippageAdjustedAmounts

* ignore late quote data

* ignore next line

* comment

* if loading disable press on confirm

* polling to 10 secs

* review comments

* swaps - truncate long token symbols  (#3685)

* truncate symbol

* add right margin

* truncated text

* dumbo

* sort favorites by abc in filtered and unfiltered states (#3700)

* swaps: updated swipe logic (#3711)

* add back swipe gestures

* add back xtras

* revert old logic

* simple logic

* fix android animation jank

* dont pass source=rainbow (#3719)

* add footer spacing on android (#3718)

* Set custom depth of the scroll view in Exchange modal in RNCM (#3716)

* Set custom depth of the scroll view in Exchange modal in RNCM

* Update UIViewController+slack.swift

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* use colors from theme

* catch up versions

* fix some exchange list breaking changes

* swaps: savings flow e2e (#3721)

* testIDs

* tests

* swaps: fix fast currency select row (#3726)

* fix prop ordering

* better

* fix passed props

* fix spacing and native asset logic

* fix

* network fallback

* silence audit

* end of line audit

* fix-test-id

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Filter dropped txs (#3728)

* dropped txs

* bump to 1.6.17 so testflight works

* silence audit

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>

* swaps: tweak base fee e2e (#3735)

* lower base fee

* audit

* fix: empty input flipping behavior (#3738)

* swaps: exchange icons memos + error reset (#3741)

* memos + error reset

* Update src/components/expanded-state/swap-details/SwapDetailsExchangeRow.js

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: osdnk review (#3730)

* fix zerox logo

* tweak animation

* rm old network check

* add new network check

* add back interactions

* auditoor

* fix favs

* remove init base fee

* swaps: fix flashbots tip (#3745)

* Decrement nonce if flashbots txs is dropped (#3743)

* Add default slippage to remote config (#3749)

* add default_slippage_bips to config

* load default slippage from config when opening modal

* Failed L2 swaps don't display Failed transaction activity state (#3736)

* check tx receipts in pending tx watcher

* remove redundant title assignment

* only fetch receipt if nonce has not been included

* check for txObj before fetching receipt instead

* rename flashbots feature flag (#3750)

* fix weth plus eth favorite scenario (#3753)

* disable swap button after pressed once (#3752)

* disable swap button after pressed once

* extract to aux function

* swaps: remote slippage by network (#3756)

* config work

* fix effect

* swaps: fix gas loading state (#3755)

* add is gas ready var

* revert not needed change

* Boolean(gasValue?.amount)

* swaps: add loading check to confirm button (#3754)

* add loading checks

* Revert "add loading checks"

This reverts commit 583afe7.

* disable long press while loading

Co-authored-by: Esteban Miño <efmino@uc.cl>

* fix: bump swap with permit gas (#3757)

* bump to 400000

* bump to 400000

* rainbow-me/swaps 0.1.9

* fixedGasLimitAfterApproval

* fix ../model/config import

* silence audit

* Swaps: Fix select currency scroll on Android (#3759)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* input fix (#3762)

* input fix

* bug fix

* swaps: fix 0. value in inputs behavior (#3766)

* fix flashbots speed up (#3765)

* Fix weird swap sheet clipping on Android (#3768)

* swaps: check for valid slippage remote config before setting it (#3767)

* check is not null first

* credefault values

* use default

* Check first jic

* fix (#3771)

* fix (#3772)

* swaps: block flashbots swaps miner tip (#3769)

* dont allow less than 6

* use FLASHBOTS_MIN_TIP

* swaps: fix slippage reset (#3773)

* fix it

* fix comments

Co-authored-by: Esteban Miño <efmino@uc.cl>

Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>
Co-authored-by: moxey.eth <jakemoxey@gmail.com>
Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>
Co-authored-by: Luc Succes <l2succes@gmail.com>
Co-authored-by: pugson <hi@wojtek.im>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Daniel Sinclair <d@niel.nyc>
Co-authored-by: Daniel Sinclair <daniel@rainbow.me>
Co-authored-by: Michał Osadnik <micosa97@gmail.com>

* swaps: use tradeDetails?.defaultGasLimit as default (#3779)

* use tradeDetails?.defaultGasLimit as default

* using || instead in case of empty string

* remove TOKENS_WITH_FIXED_GAS_LIMIT_AFTER_APPROVAL

* silence

* use swapDetailsSheetConfig for swaps review sheet (#3781)

* use swapDetailsSheetConfig

* silence

* Swaps: Submitting button state (#3782)

* create submitting button state

* silence

* use swirly

Co-authored-by: Esteban Miño <efmino@uc.cl>

* swaps: fix conditional to use fast speed (#3789)

* fix conditional to use fast speed

* silence audit

* ChainId.mainnet

* swaps: more inputs feedback (#3783)

* fixes

* more fixes

* show warning if there's a value to show

* silence

* adding more states

* fix comment and adding debounce to not spam backend

* silence audit

* fix use debounce

* add derived values to usequery deps

* [TEAM2-291] Swaps button not disabled on testnets (#3795)

* disable swaps on chart expanded state correctly

* NOT testnet

* fix audit

* store isTestnet in const

* Revert "swaps: more inputs feedback (#3783)"

This reverts commit d7e4faa.

* Fix swaps e2e again (#3815)

* make hardhat not to block e2e

* fix gas limit defaults

* revert hardhat url change

* swaps: dont round max (#3810)

* Optimism and Arbitrum collectibles support with custom icons (#3799)

* wip

* created walletready hook for feature unlock: optimism custom icon

* add optimism and pixel icons

* filter locked icons

* @benisgold/custom icon (#3780)

* wip

* use app icon icon

* explainer sheet placeholder

* i18n + og icon

* more i18n and small changes

* updated app icon menu item icon

* explain sheet

* icons

* lint

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* working

* androiiiiiid

* fix audit stuff

* dont break if missing OP kovan RPC url

* fix redux dispatch

* Optimism and Arbitrum NFT support (#3784)

* Add simplehash nfts by wallet address handler

* Fetch optimism and arbitrum NFTs

* Setup for Simplehash NFT parser

* Construct permalinks for simplehash nft marketplaces

* Add Quixotic and Stratos to url opener whitelist

* Rename hideOpenSeaAction to hideNftMarketplaceAction

This is to make the name of this parameter more generic
as we now support more than the OpenSea marketplace.

* Lang: lowercase `with` in `View All With Property`

* Rename viewTraitOnOpenseaAction to viewTraitOnNftMarketplaceAction

* Rename viewTraitOnOpensea to viewTraitOnNftMarketplace in attribute Tag

* Retrieve simplehash marketplace name and add as a new field to unique assets

* Setup for using marketplace info in attribute tags

* Hide NFT marketplace action when collection slug is unavailble

Currently, we hide the NFT marketplace action when the NFT is a POAP.

For the Optimism and Arbitrum endpoints, it is possible that
marketplace page information is unavailable. In this case,
we also want to hide the NFT marketplace actions as the pages
will be unavailable.

* Rename handlePressOpensea to handlePressMarketplaceName

* Update lang files for viewing on OpenSea to be more generic

* Add OpenSea as marketplace to OS and Polygon parsers

* Support more generic marketplace collection website

* Show Rainbow Web only for supported networks

We do not support Optimism or Arbitrum NFTs on Rainbow web yet.
This change also includes explicitly passing in the network even
for mainnet NFTs.

* Use NONE constant in NFT brief token info row

* Set floor price to NONE on error or unsupported network

* Show L2 disclaimer for non-mainnet NFTs

* Update Share functionality in unique token expanded state

Since some networks are not supported by Rainbow web yet,
we want to fallback to using the permalink as the Share content.
If a permalink also does not exist, then we do not show the Share
button.

* Show NFT brief info only on supported networks.

We currently do not support last sale and floor price info
for L2s. The entire NFT Brief Info section will be ignored for L2s.

* Add simplehash types

* Support cursor for simplehash handler

* Remove shouldUpdateInBatches flag for unique tokens

With the new additions of unique token fetches, the
shouldUpdateInBatches flag was causing unexpected behavior.

* Fix and simplify action sheet index selection on collection on Android

* Fix and simplify action sheet index selection on asset on Android

* Lint cleanup and review comments

* Linter: update custom ENS unique token creation

* add flag on firebase to control OP kovan vs mainnet

* fix icon reset bug

* Update POAP parsing to include network

* audit fix

* disable android

* removed unnecessary UINewsstandIcon bundle key to pass App Review

* Fix: uniqBy should use uniqueId on collectibles

Previously it was using ID, which is just the token ID and not
guaranteed to be unique across collections.

* Version bump to v1.6.18

* Changelog and version bump to v1.6.19 (#3800)

* Consolidate explain sheet button configuration

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Daniel Sinclair <d@niel.nyc>

* swaps: inputs PRs (#3811)

* swaps: more inputs feedback (#3783)

* fixes

* more fixes

* show warning if there's a value to show

* silence

* adding more states

* fix comment and adding debounce to not spam backend

* silence audit

* fix use debounce

* add derived values to usequery deps

* add-fixes-rc-v1.6.17

* fix-e2e

* prevGasFeesParamsBySpeed in exchange modal

* trace call when is not testing

* trace call when is not testing only for trade support

* Fix swaps for testflight (#3812)

* fix testflight

* bump sdk

* swaps: use native display value for swap details (#3814)

* use native display value

* rm log

Co-authored-by: Esteban Miño <efmino@uc.cl>

* [TEAM2-292] Fix Sentry Bugs (#3813)

* null guard checkForUpdatedNonce

* null guard handleSearchResponse w/o resposne tokens

* null guard before str manip assetsWithScamURL

* add optional chaining to getNativeAssetForNetwork

* null guard address_from and nonce in checkForUpdatedNonce

* add imported and check filtering (#3816)

* Wallet data fixes rebased over custom icons for rcv1.6.19 (#3804)

* Do not fetch prices from uniswap

* Get rid of uniswap prices entirely

* Remove unused code

* Do not flash hidden coins

* Do not use stale redux data in async functions

* Check address is still current before dispatching updates from unique tokens to assets dedupe

* Abort data and txn dispatches after awaits if accountAddress is no longer current

Co-authored-by: Terry Sahaidak <tasssik@gmail.com>

* actually favorite things on currency selection list (#3817)

* swaps: team2-293 (#3818)

* fix crash

* submitting try ios

* swaps: android fix confirm button submitting state (#3819)

* fix button

* block smpam onSwap

* block smpam onSwap

* block smpam onSwap

* swaps: input clearing + loading state (#3828)

* inputs

* Revert "inputs"

This reverts commit 1402aa0.

* remove debounce

* gasready

* update gas on network change

* new e2e

* rollback e2e clearkeychain

* then clearing

* gas ready to estimate gas

* add e2e clearing native field

* rm is gas ready from where is not needed

* rm is gas ready from where is not needed

* null guard string manip (#3832)

* [RNBW-4059] swaps: fix arbitrum flipping (#3830)

* fix

* clear(

* additional inputs state

* delete comment

* fix: review coin icon (#3837)

* swap: bump gas estimation padding (#3839)

* swaps: fix currency row truncating (#3835)

* use tx.flashbots (#3844)

* handle 0 (#3836)

* swaps: handle flashbot miner tip from review sheet (#3846)

* Fix trace calls block number (#3853)

* fix trace calls block number

* default to 20

* Update src/handlers/uniswap.ts

Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com>
Co-authored-by: Skylar Barrera <skylar.barrera@gmail.com>
Co-authored-by: moxey.eth <jakemoxey@gmail.com>
Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>
Co-authored-by: Luc Succes <l2succes@gmail.com>
Co-authored-by: pugson <hi@wojtek.im>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Daniel Sinclair <d@niel.nyc>
Co-authored-by: Daniel Sinclair <daniel@rainbow.me>
Co-authored-by: Michał Osadnik <micosa97@gmail.com>
Co-authored-by: jinchung <jin.chung17@gmail.com>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>
Co-authored-by: Terry Sahaidak <tasssik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

swap-aggregator Label for the swap aggregator feature project team2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants