<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Emanuel</title>
    <description>The latest articles on Forem by Emanuel (@emanueljrc).</description>
    <link>https://forem.com/emanueljrc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1332900%2F99648f5f-3ef9-4454-968f-83e5b6b7975e.jpeg</url>
      <title>Forem: Emanuel</title>
      <link>https://forem.com/emanueljrc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/emanueljrc"/>
    <language>en</language>
    <item>
      <title>Making a crypto wallet app with React Native</title>
      <dc:creator>Emanuel</dc:creator>
      <pubDate>Thu, 31 Oct 2024 00:49:27 +0000</pubDate>
      <link>https://forem.com/emanueljrc/making-a-crypto-wallet-app-with-react-native-35i4</link>
      <guid>https://forem.com/emanueljrc/making-a-crypto-wallet-app-with-react-native-35i4</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/EmanuelJrc/KroWallet" rel="noopener noreferrer"&gt;KroWallet - crypto wallet&lt;/a&gt;&lt;br&gt;
My Journey Building a Crypto Wallet App with React Native Expo&lt;/p&gt;

&lt;p&gt;TL;DR: Building a &lt;a href="https://github.com/EmanuelJrc/KroWallet" rel="noopener noreferrer"&gt;crypto wallet&lt;/a&gt; app has been one of the best projects I built, just for the knowledge that I got from it and experience.&lt;br&gt;
If you’re considering building a similar project or simply curious about the process, I hope this write-up helps you navigate the complexities of crypto and mobile development!&lt;br&gt;
Also if you want to contribute or ask questions feel free to do so.&lt;/p&gt;

&lt;p&gt;Why Build a Crypto Wallet App?&lt;/p&gt;

&lt;p&gt;Ever since I first discovered crypto, I started by looking for a good wallet app that has nice look and feel, but also functionality.&lt;br&gt;
However, there weren't many apps that fit what I was looking for, so that would be the reason for this.&lt;br&gt;
My goal was to create a simple, intuitive, and secure crypto wallet that allows users to manage multiple cryptocurrencies, check their balance, and make transactions.&lt;/p&gt;

&lt;p&gt;I chose to build the app in React Native to create a cross-platform experience, and I decided to start with Nano/Banano, and Stellar due to its efficient transaction model and focus on enabling low-cost, cross-border payments.&lt;/p&gt;

&lt;p&gt;Step 1: Setting Up the Core App in React Native&lt;/p&gt;

&lt;p&gt;I started by setting up a basic React Native app using Expo, which turned out to be a double-edged sword because of some things not working correctly. Some initial setup choices were easy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expo Secure Store for securely storing wallet data.&lt;/li&gt;
&lt;li&gt;Expo Clipboard for easy copy-paste functionality of keys.&lt;/li&gt;
&lt;li&gt;React Native Gesture Handler for smooth interactions within the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choosing the right libraries and tools made a significant difference. For example, using expo-secure-store allowed me to focus more on wallet functionality without worrying too much about the security of sensitive information, like private keys.&lt;/p&gt;

&lt;p&gt;Step 2: Generating and Importing Wallets&lt;/p&gt;

&lt;p&gt;The first major feature was the ability to generate and import Stellar wallets. I implemented this by integrating Stellar SDK to handle wallet creation and transaction signing. Creating new key pairs with the SDK was straightforward, but securely storing the keys was a priority.&lt;/p&gt;

&lt;p&gt;Here’s a high-level look at how I handled it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate Keypair: I used StellarSdk.Keypair.random() to generate a public and secret key pair.&lt;/li&gt;
&lt;li&gt;Store Secret Key: Using Expo’s Secure Store, I securely stored the secret key so that users wouldn’t have to re-enter it every time.&lt;/li&gt;
&lt;li&gt;Import Existing Wallet: For users who already had a Stellar wallet, I allowed them to import it by entering their secret key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 3: Checking Account Balance&lt;/p&gt;

&lt;p&gt;Displaying the wallet balance was more challenging than I expected. I used the Stellar Horizon API to fetch the account balance, but I needed to format the response data and handle potential issues like unfunded accounts. Here’s how I approached it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Call: I used the &lt;code&gt;server.loadAccount(publicKey)&lt;/code&gt; function to retrieve the account’s balance.&lt;/li&gt;
&lt;li&gt;Formatting: Since Stellar allows multiple asset types, I looped through each balance object to identify the native XLM balance and displayed it in a user-friendly way.&lt;/li&gt;
&lt;li&gt;Error Handling: If an account was unfunded (no balance), I displayed a message prompting the user to fund the account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Handling decimals was also a key challenge. Cryptocurrency balances can have many decimal places, so I rounded them to two decimal places for a cleaner look.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const formatBalance = (balance) =&amp;gt; parseFloat(balance).toFixed(2);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Step 4: Sending Transactions&lt;/p&gt;

&lt;p&gt;Sending XLM from the wallet was a significant milestone. This process involved:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Taking user input for the destination address and amount.&lt;/li&gt;
&lt;li&gt;Verifying the inputs to ensure validity.&lt;/li&gt;
&lt;li&gt;Building, signing, and submitting the transaction using Stellar’s SDK.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ensuring a secure and seamless experience for sending transactions took a bit of work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Funding account for the first time: One thing I overlooked was adding support for sending XLM to a new address that is receving funds for the first time, for that there is a &lt;code&gt;StellarSdk.Operation.createAccount&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Validation: Stellar has specific address formats, so I added checks to ensure the destination address was valid.&lt;/li&gt;
&lt;li&gt;Feedback: Users want to know their transaction’s status, so I displayed loading states and transaction results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 5: Displaying Recent Transactions&lt;/p&gt;

&lt;p&gt;This was one of the more rewarding features to implement. Displaying a list of recent transactions makes the wallet feel complete and gives users more transparency over their activity.&lt;/p&gt;

&lt;p&gt;To fetch transaction history, I used the server.payments() method from the Stellar SDK, filtering for recent payment operations related to the user’s public key. I then displayed each transaction as a “sent” or “received” transaction by comparing the source and destination addresses.&lt;/p&gt;

&lt;p&gt;Here’s a simplified version of the code that powers the transaction display:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fetchTransactions = async () =&amp;gt; {
  const payments = await server
    .payments()
    .forAccount(publicKey)
    .order("desc")
    .limit(10)
    .call();

  const formattedTransactions = payments.records.map((payment) =&amp;gt; ({
    id: payment.id,
    amount: parseFloat(payment.amount).toFixed(2),
    type: payment.from === publicKey ? "Sent" : "Received",
    created_at: payment.created_at,
  }));

  setTransactions(formattedTransactions);
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key Challenges and Takeaways&lt;/p&gt;

&lt;p&gt;Building this wallet app came with its share of challenges and learning moments. Here are a few key takeaways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Security First: Managing private keys is a huge responsibility, and prioritizing secure storage is essential. Using Expo Secure Store was a lifesaver, but I also had to be mindful of other security best practices.&lt;/li&gt;
&lt;li&gt;User Experience Matters: Crypto apps can be complex, but my goal was to make the wallet as user-friendly as possible. This meant limiting decimals in balances, providing clear error messages, and making sure transactions were easy to send.&lt;/li&gt;
&lt;li&gt;Error Handling is Essential: In crypto, things don’t always go smoothly. From unfunded accounts to network errors, there are many points where things can go wrong. Building in error handling made the app much more robust.&lt;/li&gt;
&lt;li&gt;Understanding Blockchain Basics: Working with Stellar gave me a deeper understanding of blockchain transactions, key pairs, and network APIs. I found that having a solid grasp of these fundamentals helped me make more informed development choices.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmo2u31ow9f4d7zptm4y8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmo2u31ow9f4d7zptm4y8.png" alt="Image description" width="800" height="1734"&gt;&lt;/a&gt;&lt;br&gt;
This is the final look i came up with for the Stellar (XLM) Screen&lt;/p&gt;

&lt;p&gt;What’s Next?&lt;/p&gt;

&lt;p&gt;This is just the beginning! My goal is to expand the app to support multiple cryptocurrencies like Bitcoin, Nano, and Dogecoin. I’m also planning to implement dark mode, add a settings screen, and maybe even introduce notifications for incoming transactions.&lt;/p&gt;

&lt;p&gt;Building this app has been an amazing learning experience, and I’m excited to keep improving it. If you’re interested in developing your own crypto wallet app, I’d encourage you to dive in and experiment—you’ll learn a ton along the way.&lt;/p&gt;

&lt;p&gt;Thank you for reading, and stay tuned for updates on my app!&lt;/p&gt;

&lt;p&gt;This post could serve as a great resource for other developers curious about crypto and mobile development, but also for me since there are probably a lot of people that can come up with brilliant ideas.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>reactnative</category>
      <category>mobile</category>
      <category>cryptocurrency</category>
    </item>
    <item>
      <title>Setting up My WSL and Neovim Environment</title>
      <dc:creator>Emanuel</dc:creator>
      <pubDate>Tue, 12 Mar 2024 13:29:06 +0000</pubDate>
      <link>https://forem.com/emanueljrc/setting-up-my-wsl-and-neovim-environment-54cl</link>
      <guid>https://forem.com/emanueljrc/setting-up-my-wsl-and-neovim-environment-54cl</guid>
      <description>&lt;p&gt;Introduction:&lt;br&gt;
In my ongoing journey of the 100DaysOfCode challenge, Day 4 marked a significant milestone as I decided to level up my coding environment. Inspired by fellow developer &lt;a href="https://github.com/craftzdog"&gt;Craftzdog (Takuya)&lt;/a&gt;, I took the plunge to enhance my setup. In this blog post, I'll share my experience of setting up WSL Ubuntu, Fish Shell, and configuring Neovim with LazyVim, revolutionizing my coding workflow.&lt;/p&gt;

&lt;p&gt;Setting up WSL Ubuntu and Fish Shell:&lt;br&gt;
Setting up WSL Ubuntu was surprisingly straightforward. After enabling WSL in Windows features and installing Ubuntu from the Microsoft Store, I opted for the Fish Shell for its powerful features and intuitive syntax. To manage Fish plugins, I chose Fisher, a lightweight package manager that simplifies plugin installation and management.&lt;/p&gt;

&lt;p&gt;Configuring Neovim with LazyVim:&lt;br&gt;
Neovim has been gaining popularity among developers for its extensibility and performance. Inspired by &lt;a href="https://github.com/craftzdog/dotfiles-public"&gt;Craftzdog's (Takuya)&lt;/a&gt; setup, I decided to configure Neovim with LazyVim, a plugin manager that simplifies the setup process and provides a curated set of plugins for productivity and efficiency. With LazyVim, I customized Neovim to suit my preferences, including syntax highlighting, auto-completion, and code navigation features.&lt;/p&gt;

&lt;p&gt;Taking Inspiration from Craftzdog (Takuya):&lt;br&gt;
Craftzdog (Takuya) has been a source of inspiration for many developers, including myself. His approach to configuring Neovim and Fish Shell has inspired me to elevate my own coding environment.&lt;/p&gt;

&lt;p&gt;Future Plans and Conclusion:&lt;br&gt;
As I continue my coding journey, I'm excited to explore the possibilities offered by my enhanced coding environment. Whether it's building web applications, diving into data science projects, or contributing to open-source software, I'm confident that my WSL Ubuntu, Fish Shell, and Neovim with LazyVim setup will support me every step of the way. Stay tuned for more updates as I embark on new coding adventures!&lt;/p&gt;

&lt;p&gt;Images of My Development Environment:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5htyzwq3iz35k1u9tex5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5htyzwq3iz35k1u9tex5.png" alt="Image description" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0tbo2r3ohmof51hpa1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0tbo2r3ohmof51hpa1f.png" alt="Image description" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
Day 4 of #100DaysOfCode was a game-changer as I upgraded my coding environment with WSL Ubuntu, Fish Shell, and Neovim with LazyVim. By harnessing the power of Linux, Fish Shell, and optimizing my code editor, I'm ready to tackle coding challenges with confidence and efficiency. Here's to embracing new tools and technologies in the pursuit of coding excellence!&lt;br&gt;
If you want a full tutorial or have any questions feel free to ask :)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>vim</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Learning React State</title>
      <dc:creator>Emanuel</dc:creator>
      <pubDate>Fri, 08 Mar 2024 16:33:28 +0000</pubDate>
      <link>https://forem.com/emanueljrc/learning-react-state-23ij</link>
      <guid>https://forem.com/emanueljrc/learning-react-state-23ij</guid>
      <description>&lt;p&gt;100DaysOfCode: Day 2&lt;/p&gt;

&lt;p&gt;Today, I dove into React state management!&lt;br&gt;
Explored what state is, how it works in React, and learned to update and structure state efficiently.&lt;br&gt;
Also, got a grip on controlled components for more dynamic user interfaces.&lt;br&gt;
Stay tuned for more updates! 💻🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>Starting with React</title>
      <dc:creator>Emanuel</dc:creator>
      <pubDate>Thu, 07 Mar 2024 17:05:45 +0000</pubDate>
      <link>https://forem.com/emanueljrc/starting-with-react-355o</link>
      <guid>https://forem.com/emanueljrc/starting-with-react-355o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Day 1 of 100DaysOfCode&lt;/strong&gt;: 🚀 So, today officially marks the start of my coding journey! &lt;br&gt;
 Kicked things off with React, following The Odin Project. &lt;br&gt;
Started with the basics - wrapping my head around what components are, how they're crafted (spoiler: it involves a lot of JSX), and where they hang out in React land. &lt;br&gt;
Overall I am satisfied with the amount of things learnt today.&lt;br&gt;
See you all tomorrow!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fveatjbvbjx9yhr1u0j9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fveatjbvbjx9yhr1u0j9a.png" alt="react components" width="800" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Hi, I'm Emanuel Juricev</title>
      <dc:creator>Emanuel</dc:creator>
      <pubDate>Wed, 06 Mar 2024 18:42:42 +0000</pubDate>
      <link>https://forem.com/emanueljrc/hi-im-emanuel-juricev-1f1c</link>
      <guid>https://forem.com/emanueljrc/hi-im-emanuel-juricev-1f1c</guid>
      <description>&lt;p&gt;Heyy there developers, nice to meet you!&lt;/p&gt;

&lt;p&gt;Shortly about me:&lt;br&gt;
I live in Croatia. &lt;br&gt;
I mostly code JavaScript and do a lot of frontend web development, currently learning about backend development.&lt;/p&gt;

&lt;p&gt;I am thrilled to announce that from tomorrow i will be starting the 100DaysOfCode challenge.&lt;br&gt;
I'll be sharing my daily learnings on here, &lt;a href="https://www.linkedin.com/in/emanueljrc/"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://twitter.com/emanueljuricev"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Primary Targets :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Web Dev (MERN Stack)&lt;/li&gt;
&lt;li&gt;Exploring AI/ML&lt;/li&gt;
&lt;li&gt;Contributing to Open Source.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Join me on this coding journey, let's inspire and help each other!&lt;br&gt;
You can also find me on Github as &lt;a href="https://github.com/EmanuelJrc"&gt;emanueljrc&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
