-
Notifications
You must be signed in to change notification settings - Fork 45
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
Native Android Swap (no webview) + Buy & Sell #20
base: main
Are you sure you want to change the base?
Conversation
- Swap functionality is implemented using native kotlin/android code which is much faster and has better performance than the proposed webview workaround. -Stonfi APIs added to project. - multidex added to project. - new strings added to project.
- Implemented the android native flow of buy and sell. - Added "boot.tonkeeper.com" to the list of base URLs.
- Some strings translated to Russian language. - swap submit button UI improvement. - Removed TokenTypeItem.kt class and added new Item classes for ChooseTokenAdapter.
- Handle UI reaction on API request timeout. - Fix minor bug related to list scrolling in bottomsheet. - Minor bug fix.
My Submission Details:APK of my submission: APK Implemented Features:I have implemented two features for this contest, the native SWAP and the BUY/SELL. Unfortunately due to my time limitations I did not completely implement staking feature and therefore I didn't push this feature. About My Implementation:
Swap:I have implemented the swap feature completely native. There is no use of webview or javascript injection, only pure Kotlin code which ensures great performance, and a fast user experience. When user enters the native swap page, a skeleton/shimmer loading is displayed and all assets are fetched from the API. The user can choose pairs to swap and change minimum slippage and see the swap simulation details, and finally click on the continue button to go to confirm page and confirm the swap. In this part the message object is created using native Kotlin code and then sent to the blockchain. Swap is done successfully and user is redirected to transaction history page. The flow of the swap is exactly implemented based on the provided Figma desings and the current behavior of tonkeeper react-native app and tonkeeper web. Buy/Sell:I have also implemented Buy and sell feature where users can trade TON, and fiat through partner platforms. When user enters the "Buy or Sell" screen, they can enter the amount of TON they want to buy or sell, and the fiat equivalent of the entered amount is instantly calculated and displayed to the user. The exchange rate between TON and fiat currency is being fetched periodically, and the fiat equivalent that is displayed to the user is updated periodically and is always based on the latest exchange rate. Then user can select payment method from a list (for example pay by credit card), and then the continue button becomes active and user continues to the next page where a list of operators are displayed to the user. The list of operators are fetched from one API and the exchange rate each operator offers is fetched from another API. These data are mapped and displayed together. User can also change the default currency and the exchange rate will instantly update based on the new currency. After selecting the operator the user moves forward to the confirmation page where we display how much user is paying and how much user is getting, the user can change these numbers and click continue, after that user is redirected to the webview to do its payment. finally user is redirected back to the application. Buy or Sell is done successfully. Staking:Unfortunately due to my time limitations I did not completely implement staking feature and therefore I didn't push this feature. |
I have took part in the tonkeeper contest and have implemented these two features:
About Swap: I have implemented swap natively using Kotlin code and have not used any Javascript injection into webview. This has resulted into a smooth swap and great performance.
About: I have also implemented Buy and sell feature is where user can enter TON amount and select payment method and currency and then operator and finally is redirected to the operators web payment gateway.
Thanks.