rainbow icon indicating copy to clipboard operation
rainbow copied to clipboard

Swaps deeplink

Open greg-schrammel opened this issue 1 year ago • 2 comments

Fixes APP-1234

What changed (plus any additional context for devs)

inputAsset: UniqueId
outputAsset: UniqueId

inputAmount: Number
outputAmount: Number
percentageToSell: Number // value between 0 and 1

gasSpeed: 'normal' | 'fast' | 'urgent'
slippage: Number
flashbots: Boolean

from: Address

with assets

  • inputAsset and outputAsset expects a UniqueId (address_chainId) ex: rainbow://swaps?inputAsset=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48_1

with prefilled values

  • percentageToSell > inputAmount > outputAmount only one is used, in this order of importance
  • percentageToSell expects a value between 0 and 1 ex: rainbow://swaps?inputAsset=eth_1&percentageToSell=0.2, 20% of wallet swappable ETH

with gasSpeed

  • values are normal,fast or urgent ex: rainbow://swaps?gasSpeed=urgent

with flashbots

  • param not included does not mean false, keeps user preferences
  • flashbots=true any other value besides true means false ex: rainbow://swaps?flashbots=true

with slipagge

  • in bips slippage=100 = 1% slippage ex: rainbow://swaps?slippage=100

with from

  • let you navigate to another wallet, param is silently ignored if you don't own the wallet ex: rainbow://swaps?from=0x507F0daA42b215273B8a063B092ff3b6d27767aF

Screen recordings / screenshots

What to test

  • multiple weird combinations of params
  • with app open and app closed

to test in ios you can run xcrun simctl openurl booted 'rainbow://swap/?outputAsset=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48_1&gasSpeed=urgent&flashbots=true&inputAmount=1&inputAsset=eth_1'

greg-schrammel avatar Oct 08 '24 11:10 greg-schrammel

Launch in simulator or device for afa7d2ecb7bd8c91a1f526c9c4c4fad7c61232e6

brunobar79 avatar Oct 08 '24 12:10 brunobar79

Launch in simulator or device for d51e895db95b897058e4f4132926fb36e56b080a

brunobar79 avatar Oct 28 '24 21:10 brunobar79

Launch in simulator or device for 7e95ffbd39ff08c549ccd82ad48884b5328884f3

brunobar79 avatar Oct 29 '24 09:10 brunobar79

hey @greg-schrammel, did we end up getting blocked / deprioritizing this?

derHowie avatar Nov 25 '24 17:11 derHowie

hey @greg-schrammel, did we end up getting blocked / deprioritizing this?

no I moved to other stuff and forgot about it, just fixed the conflicts

greg-schrammel avatar Nov 25 '24 18:11 greg-schrammel

Launch in simulator or device for 4c3d7cf66f3369354fb8b3db27d0dd510ea1a3d0

brunobar79 avatar Nov 25 '24 21:11 brunobar79

Launch in simulator or device for dc3803c278866e39eff1afbac08477465b2ce92a

brunobar79 avatar Nov 26 '24 22:11 brunobar79

Launch in simulator or device for 60f5effece4522f2c53de1d7bcd0db84d165fb8b

brunobar79 avatar Dec 04 '24 19:12 brunobar79