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

Sync v0.9.0 dev into firodex #102

Merged
merged 21 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Komodo Wallet
name: Build Firo Wallet
on:
pull_request:
types: [ opened, synchronize, reopened ]
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
https://discord.gg/komodo.
https://firo.org/community/social/.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 - 2023 Komodo Platform
Copyright (c) 2019 - 2023 Firo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
80 changes: 44 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
# Komodo Wallet - Open Source GitHub Repository 🚀
# Firo Wallet - Open Source GitHub Repository 🚀

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/komodoplatform/atomicdex-mobile/build.yml)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/komodoplatform/atomicdex-mobile)
![GitHub contributors](https://img.shields.io/github/contributors-anon/komodoplatform/atomicdex-mobile)
![GitHub last commit](https://img.shields.io/github/last-commit/komodoplatform/atomicdex-mobile)
![GitHub top language](https://img.shields.io/github/languages/top/komodoplatform/atomicdex-mobile)
![Discord](https://img.shields.io/discord/412898016371015680)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/komodoplatform/atomicdex-mobile)
![GitHub repo size](https://img.shields.io/github/repo-size/komodoplatform/atomicdex-mobile)
![Twitter Follow](https://img.shields.io/twitter/follow/komodoplatform?style=social)
![Twitter Follow](https://img.shields.io/twitter/follow/firoorg?style=social)

Welcome to the Komodo Wallet open-source repository! This cutting-edge project is brought to you by Komodo, providing a mighty non-custodial wallet and decentralised exchange all in one mobile app. Take control of your cryptocurrencies and trade seamlessly on your mobile phone or tablet with Komodo Wallet!
Welcome to the Firo Wallet open-source repository! This cutting-edge project is brought to you by Firo, providing a mighty non-custodial wallet and decentralised exchange all in one mobile app. Take control of your cryptocurrencies and trade seamlessly on your mobile phone or tablet with Firo Wallet!

<p float="center">
<img src="https://user-images.githubusercontent.com/77973576/229565868-b121e9b6-2d2b-4390-a81f-a7878d0bfea8.png" width="33%" />
<img src="https://user-images.githubusercontent.com/77973576/229565938-81a51d44-5a73-4acd-8885-454e6fa6443d.png" width="33%" />
<img src="https://user-images.githubusercontent.com/77973576/229565938-81a51d44-5a73-4acd-8885-454e6fa6443d.png" width="33%" />
<img src="https://user-images.githubusercontent.com/77973576/229565995-252df819-1ea9-4cc8-a9bc-4ab3e1c80caf.png" width="33%" />
<img src="https://user-images.githubusercontent.com/77973576/229566018-285b6b6d-677e-464e-aafb-e55fecb2df82.png" width="33%" />
<img src="https://user-images.githubusercontent.com/77973576/229566049-2f25b16b-da76-4295-b4e6-ba567ac582f7.png" width="33%" />
<img src="https://user-images.githubusercontent.com/77973576/229566075-aa00a5a9-55ae-4acd-ad7b-d67ed3a65db6.png" width="33%" />
</p>

## Unleashing the Power of Komodo DeFi Framework 💡
We've made this repository public to showcase the incredible potential of the Komodo DeFi Framework and to spark interest among companies looking to integrate this game-changing technology into their own applications. Our goal is to drive innovation and expand the reach of decentralised exchange technology worldwide.
## Unleashing the Power of Firo DeFi Framework 💡

We've made this repository public to showcase the incredible potential of the Firo DeFi Framework and to spark interest among companies looking to integrate this game-changing technology into their own applications. Our goal is to drive innovation and expand the reach of decentralised exchange technology worldwide.

## Exciting Features 🌟

- **Non-custodial wallet:** You're in control - only you can access your private keys.
- **Decentralized exchange:** Trade cryptocurrencies effortlessly across blockchain networks with atomic swap technology, bypassing the need for a middleman.
- **500+ Listed Cryptocurrencies:** A vast and ever-growing list of supported cryptocurrencies.
- **Unlimited markets:** Over 300,000 completed atomic swaps and a staggering 10,000+ trading pairs.
- **User support:** Engage with our active Discord support channel, where official team members are ready to help. We'd also love to hear your feedback.
- **Most supported protocols:** Komodo Wallet outshines the competition by supporting the most blockchain protocols of any decentralized exchange on the market.
- **Established team:** Our pioneering Komodo developers have been at the forefront of DEX technology since 2014.
- **Most supported protocols:** Firo Wallet outshines the competition by supporting the most blockchain protocols of any decentralized exchange on the market.
- **Established team:** Our pioneering Firo developers have been at the forefront of DEX technology since 2014.
- **Frequent updates:** Our dedicated developers are constantly working to enhance the app's user experience, security, and feature set.

## Download Komodo Wallet 📲
Embrace financial freedom at your fingertips by downloading the Komodo Wallet:
## Download Firo Wallet 📲

Embrace financial freedom at your fingertips by downloading the Firo Wallet:

- [iOS](https://testflight.apple.com/join/c2mOLEoC)
- [Android](https://play.google.com/store/apps/details?id=com.komodoplatform.atomicdex)
- [Android](https://play.google.com/store/apps/details?id=org.firo.dex)

## Get Involved 🤝

We welcome developers, designers, and testers' contributions to our open-source project. If you'd like to contribute, please review the [contribution guidelines](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md).

For any questions about the Komodo Wallet or the exchange, join our lively [Discord Support channel](https://komodoplatform.com/discord). Official team members are identifiable by the "Komodo Team" role.
For any questions about the Firo Wallet or the exchange, join our lively [Discord Support channel](https://firo.org/community/social/). Official team members are identifiable by the "Firo Team" role.

# NB (Forkers/contributors):
# NB (Forkers/contributors)

This repository is currently in the process of undergoing safety and Flutter version upgrades. Expect major merge conflicts in the near future for any files updated from this repository. Please note that this software is under active development and provided "as is" without warranties or guarantees. Use at your own risk, as the authors and maintainers shall not be held liable for any issues, damages, or losses resulting from its use.

## Getting Started

Build requires up-to-date version of coins file from https://github.com/KomodoPlatform/coins
Build requires up-to-date version of coins file from <https://github.com/KomodoPlatform/coins>

Commit hash and sha256sum of coins file is specified in `coins_ci.json`.
You may download one manually or use `fetch_coins.sh` script on Linux and macOS or `fetch_coins.ps1` PowerShell script on Windows.
Expand All @@ -63,29 +67,24 @@ MacOS: `brew install coreutils jq`, [Brew software](https://brew.sh/)

Windows: `choco install jq`, [Choco software](https://chocolatey.org/)


## Build and run

https://github.com/KomodoPlatform/AtomicDEX-mobile/wiki/Project-Setup#build-and-run

<https://github.com/KomodoPlatform/AtomicDEX-mobile/wiki/Project-Setup#build-and-run>

## Run/Build with screenshot and video recording ON

```
flutter run --dart-define=screenshot=true
```

## Firo DeFi Framework Library Setup

## Komodo DeFi Framework Library Setup:

Komodo Wallet runs the Komodo DeFi Framework locally on the user's device. The API binary is platform-specific and must be manually set up by the developer instead of a typical Flutter dependency.

Ensure you run the most recent Komodo DeFi Framework [stable release](https://github.com/KomodoPlatform/atomicDEX-API/releases). Download the API binary for each platform and extract its `libmm2.a` file into the applicable platform's API folder.

Firo Wallet runs the Firo DeFi Framework locally on the user's device. The API binary is platform-specific and must be manually set up by the developer instead of a typical Flutter dependency.

Ensure you run the most recent Firo DeFi Framework [stable release](https://github.com/KomodoPlatform/atomicDEX-API/releases). Download the API binary for each platform and extract its `libmm2.a` file into the applicable platform's API folder.

### [Stable API releases](https://github.com/KomodoPlatform/atomicDEX-API/releases)

| API Build | API Path* |
|--|--|
| android-aarch64 | `android/app/src/main/cpp/libs/arm64-v8a/libmm2.a` |
Expand All @@ -94,31 +93,37 @@ Ensure you run the most recent Komodo DeFi Framework [stable release](https://gi

**Relative to the Flutter project's root folder. E.g. if your name was Bob and you cloned the flutter project into your macOS home directory, the full path for the iOS API would be `/Users/Bob/atomicdex_mobile/ios/libmm2.a`*

See [our wiki](https://github.com/KomodoPlatform/atomicdex-mobile/wiki/Project-Setup#android-builds-from-scratch) here for more thorough project setup steps. Besides installing the API binary, Komodo Wallet is set up similarly to any other cloned Flutter project.
See [our wiki](https://github.com/KomodoPlatform/atomicdex-mobile/wiki/Project-Setup#android-builds-from-scratch) here for more thorough project setup steps. Besides installing the API binary, Firo Wallet is set up similarly to any other cloned Flutter project.

## Accessing the database

adb exec-out run-as com.komodoplatform.atomicdex cat /data/data/com.komodoplatform.atomicdex/app_flutter/AtomicDEX.db > AtomicDEX.db
adb exec-out run-as org.firo.dex cat /data/data/org.firo.dex/app_flutter/AtomicDEX.db > AtomicDEX.db
sqlite3 AtomicDEX.db

## Localization

1. Extract messages to the .arb file:

```bash
flutter pub run intl_generator:extract_to_arb --output-dir=lib/l10n lib/localizations.dart
```

2. Sync generated `intl_messages.arb` with existing locale `intl_*.arb` files:

```bash
dart run sync_arb_files.dart
```

3. ARB files can be used for input to translation tools like [Arbify](https://github.com/Arbify/Arbify), [Localizely](https://localizely.com/) etc.
4. The resulting translations can be used to generate a set of libraries:

```bash
flutter pub run intl_generator:generate_from_arb --output-dir=lib/l10n lib/localizations.dart lib/l10n/intl_*.arb
```

5. Manual editing of generated `messages_*.dart` files might be needed to delete nullable syntax (`?` symbol), since the app doesn't support it yet.

## Generate latest coin config:
## Generate latest coin config

Clone the latest version of [coins](https://github.com/KomodoPlatform/coins)

Expand All @@ -130,24 +135,27 @@ Open the cloned repository and run the script below in the terminal in the repo
python3 utils/generate_app_configs.py
```

Copy the generated `coins_config.json` file from the Utils folder and paste it inside the `assets/` folder in the Komodo Wallet project.
Copy the generated `coins_config.json` file from the Utils folder and paste it inside the `assets/` folder in the Firo Wallet project.

## Audio samples sources

- [ticking sound](https://freesound.org/people/FoolBoyMedia/sounds/264498/)
- [silence](https://freesound.org/people/Mullabfuhr/sounds/540483/)
- [start (iOS)](https://freesound.org/people/pizzaiolo/sounds/320664/)
- [ticking sound](https://freesound.org/people/FoolBoyMedia/sounds/264498/)
- [silence](https://freesound.org/people/Mullabfuhr/sounds/540483/)
- [start (iOS)](https://freesound.org/people/pizzaiolo/sounds/320664/)

## Testing

## Testing
### 1. Manual testing

### 1. Manual testing
Manual testing plan:
[https://docs.google.com/spreadsheets/d/1jeIkGe2CmJ7YmuoVi6Rlc9KRr3wiBPf44Qy0Nd8qtOY/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1jeIkGe2CmJ7YmuoVi6Rlc9KRr3wiBPf44Qy0Nd8qtOY/edit?usp=sharing)

### 2. Integration testing
### 2. Integration testing

[Guide and coverage](integration_test/README.md)

### 3. Unit/Widget testing
### 3. Unit/Widget testing

Not supported

## License 📄
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {


defaultConfig {
applicationId "com.komodoplatform.atomicdex"
applicationId "org.firo.dex"
minSdkVersion 28
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.komodoplatform.atomicdex">
package="org.firo.dex">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.komodoplatform.atomicdex">
package="org.firo.dex">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
Expand Down Expand Up @@ -28,7 +28,7 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Komodo Wallet"
android:label="Firo Wallet"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
6 changes: 3 additions & 3 deletions android/app/src/main/cpp/mm2_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static std::mutex LOG_MUTEX;
static std::optional<LogHandler> LOG_HANDLER;

extern "C" JNIEXPORT jbyte JNICALL
Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2Main(
Java_org_firo_dex_MainActivity_nativeMm2Main(
JNIEnv *env,
jobject, /* this */
jstring conf,
Expand Down Expand Up @@ -196,14 +196,14 @@ Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2Main(
}

extern "C" JNIEXPORT jbyte JNICALL
Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2MainStatus(
Java_org_firo_dex_MainActivity_nativeMm2MainStatus(
JNIEnv *,
jobject /* this */) {
return static_cast<jbyte>(mm2_main_status());
}

extern "C" JNIEXPORT jbyte JNICALL
Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2Stop(
Java_org_firo_dex_MainActivity_nativeMm2Stop(
JNIEnv *,
jobject /* this */) {
return static_cast<jbyte>(mm2_stop());
Expand Down
Binary file added android/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.komodoplatform.atomicdex;
package org.firo.dex;

import android.Manifest;
import android.app.Activity;
Expand Down Expand Up @@ -89,9 +89,9 @@ protected void onNewIntent(@NonNull Intent intent) {
private void createNotificationChannel() {
// TBD: Use AndroidX to create the channel.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel("com.komodoplatform.atomicdex/notification",
NotificationChannel channel = new NotificationChannel("org.firo.dex/notification",
"General notifications", NotificationManager.IMPORTANCE_HIGH);
channel.setDescription("Komodo Wallet general notifications");
channel.setDescription("Firo Wallet general notifications");
channel.enableLights(true);
channel.setLightColor(0xFF64ffbf);
channel.enableVibration(true);
Expand All @@ -110,7 +110,7 @@ private void createNotificationChannel() {
void createNotification(String title, String text, int uid) {Activity activity = (Activity) (Object) this;
NotificationCompat.Builder builder = new NotificationCompat
.Builder(activity,
"com.komodoplatform.atomicdex/notification")
"org.firo.dex/notification")
.setSmallIcon(R.mipmap.ic_launcher_round)
.setContentTitle(title)
.setContentText(text)
Expand All @@ -131,7 +131,7 @@ private void nativeC(FlutterEngine flutterEngine) {

BinaryMessenger bm = flutterEngine.getDartExecutor().getBinaryMessenger();
// https://flutter.dev/docs/development/platform-integration/platform-channels?tab=android-channel-kotlin-tab#step-3-add-an-android-platform-specific-implementation
new MethodChannel(bm, "com.komodoplatform.atomicdex/nativeC")
new MethodChannel(bm, "org.firo.dex/nativeC")
.setMethodCallHandler(new MethodChannel.MethodCallHandler() {
@Override
public void onMethodCall(MethodCall call, MethodChannel.Result result) {
Expand Down Expand Up @@ -249,13 +249,13 @@ public void run() {
void getPaymentUri(Intent intent) {
paymentUri = intent.getData();
}
/// Corresponds to Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2MainStatus in main.cpp
/// Corresponds to Java_org_firo_dex_MainActivity_nativeMm2MainStatus in main.cpp
private native byte nativeMm2MainStatus();

/// Corresponds to Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2Main in main.cpp
/// Corresponds to Java_org_firo_dex_MainActivity_nativeMm2Main in main.cpp
private native byte nativeMm2Main(String conf, JNILogListener listener);

/// Corresponds to Java_com_komodoplatform_atomicdex_MainActivity_nativeMm2Stop in main.cpp
/// Corresponds to Java_org_firo_dex_MainActivity_nativeMm2Stop in main.cpp
private native byte nativeMm2Stop();

@Override
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions android/app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<resources>
<color
name="background_color"
>#1e2a3a</color>
>#110202</color>
<color
name="icon_foreground_color"
>#1E2A3A</color>
>#110202</color>
</resources>
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="launcher_background">#9B1C2E</color>
</resources>
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/launcher_icon_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="launcher_icon_background">#9B1C2E</color>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.komodoplatform.atomicdex">
package="org.firo.dex">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Binary file modified assets/branding/android-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/hd/app_logo_hd_1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/hd/app_logo_hd_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/ios-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/ios_app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/logo_app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/logo_app_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/mark_and_text_vertical_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/mark_and_text_vertical_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/branding/mark_and_text_vertical_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading