Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(exchange): multi provider. Encryptus and Banxa #3130

Merged
merged 30 commits into from
Mar 17, 2024

Conversation

banklesss
Copy link
Contributor

@banklesss banklesss commented Mar 14, 2024

TODO:

  • Figma questions feedback
  • Apply Encryptus url-generator (using Banxa for testing purposes)
  • add encryptus min/max ada
  • error/loading screens in create order screen

WARNING: Getting the base URL from encryptus in mainnet will cause an error until they finish deploying the production platform.

@banklesss banklesss self-assigned this Mar 14, 2024
@banklesss banklesss marked this pull request as draft March 14, 2024 02:24
@banklesss banklesss requested a review from stackchain March 14, 2024 02:24
banklesss and others added 2 commits March 14, 2024 11:10
…er/SelectProvider.tsx

Co-authored-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com>
Signed-off-by: banklesss <105349292+banklesss@users.noreply.github.com>
@stackchain stackchain added this to the 4.26.0 milestone Mar 14, 2024
@banklesss banklesss force-pushed the feature/exchange/multi-provider branch from 29b6110 to 9cd2a83 Compare March 14, 2024 18:24
@stackchain stackchain force-pushed the feature/exchange/multi-provider branch from 6f89046 to 817e0cb Compare March 16, 2024 14:35
@stackchain stackchain force-pushed the feature/exchange/multi-provider branch from 817e0cb to 08d54b2 Compare March 16, 2024 14:47
key={wallet.id}
manager={exchangeManager}
initialState={{
providerId: 'banxa',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

banxa as default

orderType === 'buy'
? providerSelected.supportedFeatures.buy?.fee ?? 0
: providerSelected.supportedFeatures.sell?.fee ?? 0
const Logo = providerSelected.id === 'banxa' ? BanxaLogo : EncryptusLogo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not the best solution. open to ideas

Comment on lines 21 to 22
if (orderType === 'buy' && !features.supportedFeatures.buy) orderTypeChanged('sell')
else if (orderType === 'sell' && !features.supportedFeatures.sell) orderTypeChanged('buy')
Copy link
Contributor Author

@banklesss banklesss Mar 17, 2024

Choose a reason for hiding this comment

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

maybe this logic should be in the provider

renderItem={({item: [provider, features]}: {item: [string, Exchange.Provider]}) => {
const fee =
orderType === 'buy' ? features.supportedFeatures.buy?.fee ?? 0 : features.supportedFeatures.sell?.fee ?? 0
const Logo = provider === 'banxa' ? BanxaLogo : EncryptusLogo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not the best solution. open to ideas

Comment on lines 55 to 56
const Logo = isEncryptus ? EncryptusLogo : BanxaLogo
const label = isEncryptus ? 'Encryptus' : 'Banxa'
Copy link
Contributor Author

@banklesss banklesss Mar 17, 2024

Choose a reason for hiding this comment

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

not the best solution. open to ideas. here we need to take into consideration that banxa cant attach custom params. i will ask them anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is not possible to use Exchange context here because this screen opens in the wallet selection screen (and tx history)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<Stack.Screen name="main-wallet-routes" component={WalletTabNavigator} />
return (
<Stack.Navigator
initialRouteName={initialUrl !== null ? 'exchange-result' : 'wallet-selection'}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here is the route after login

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@michaeljscript i think there will be a conflict with your changes. i would say that the result screen is the priority

Copy link
Contributor Author

Choose a reason for hiding this comment

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

product question i think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wait you are using a different navigator i think

@banklesss banklesss marked this pull request as ready for review March 17, 2024 08:55
@banklesss banklesss changed the title feature(exchange): multi provider feature(exchange): multi provider. Encryptus and Banxa Mar 17, 2024
@stackchain stackchain force-pushed the feature/exchange/multi-provider branch from 5f2f345 to a3f91f4 Compare March 17, 2024 13:04
@stackchain stackchain merged commit 49634c0 into develop Mar 17, 2024
2 checks passed
@stackchain stackchain deleted the feature/exchange/multi-provider branch March 17, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants