Migrate a library from React to Kotlin Multiplatform to improve the performance of crypto apps on mobile devices.
We have developed a library on Kotlin Multiplatform for crypto wallets. Such a library performs better on mobile devices.
We have built an open-source showcase app, so that third-party developers can take a look at the principles behind the library and integrate it into their own projects.
Why this library was required. Originally, Symbiosis Labs Ltd reached out to us with a task to build an app to freely exchange cryptocurrencies. But during the development process, the priorities shifted and creation of a KMM library for crypto wallets became the key objective.
Blockchain systems were originally created in JavaScript, so the majority of the tools for them were written in JS as well. In this particular case, the customer used a React JS library. However, mobile devices do not support this language natively, so every JS app for smartphones has to use an emulator. This redundant intermediate step means the instructions are executed slower and the process requires more computational resources.
How we built the library. The process included two stages: reading specifications and migrating from React to Kotlin.
The specs required a bit of tidying up, so the reading stage took us several days. Yet, it still allowed us to save some time, compared to simply converting React code.
At the latter stage, we took the customer’s JS code and rewrote it in Kotlin. Another challenge was that the JS library was heavily based on React, so we had to rewrite idiomatic React code in Kotlin, namely, get rid of hooks.
Where can you see the library in action? As a follow-up to the library, we have built an app for exchanging cryptocurrencies between different blockchain networks. The app is open-source, which means third-party developers can take a look at the principles behind the library and integrate it into their own crypto wallets.
The customer’s original library used React. We needed to take great care with migrating the code from one framework to another to preserve all the features and keep it functioning properly.
We had to take a deep dive into the code, rewrite it, and then double- and triple-check it. Yet, we still ended up with some minor errors that were really hard to pinpoint later, since the final code was so different from the original.
We have developed a KMM library for crypto wallets. Such library performs better than a comparable library in JavaScript. There are no intermediate components between an instruction and its execution, which means the software runs faster and requires less computational resources.
We have built an app to showcase the library in action. Third-party developers can review its inner workings and integrate it into their crypto wallets.
Now we have a ready-made solution for such tasks, which is already functional and ready for integration.
What can you do with the library:
Since the blockchain was originally created in JavaScript, everything for it was written in JS as well. Now there is an alternative solution.