Skip to content

Commit

Permalink
v5.0.0
Browse files Browse the repository at this point in the history
Support for solana, cardano, cosmos, thor, maya, kuji
  • Loading branch information
mrtnetwork committed Apr 20, 2024
1 parent c3a9063 commit 678318c
Show file tree
Hide file tree
Showing 234 changed files with 10,317 additions and 581 deletions.
Binary file added .DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions mrt_wallet/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "mrt_wallet",
"request": "launch",
"type": "dart"
},
{
"name": "mrt_wallet (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "mrt_wallet (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
Binary file added mrt_wallet/assets/image/ada.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 added mrt_wallet/assets/image/atom.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 added mrt_wallet/assets/image/cacao.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 added mrt_wallet/assets/image/kujira.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 added mrt_wallet/assets/image/sol.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 added mrt_wallet/assets/image/thor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mrt_wallet/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions mrt_wallet/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions mrt_wallet/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
17 changes: 17 additions & 0 deletions mrt_wallet/lib/app/constant/page_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ class PagePathConst {
static const String tronTransfer = "/tron/transfer";
static const String tronTransaction = "/tron/transaction";
static const String tronMultiSigAddress = "/tron/setup_multisig_address";
// solana transfer
static const String solanaTransfer = "/solana/transfer";

/// cardano
static const String cardanoTransaction = "/cardano/transaction";
static const String cosmosTransaction = "/cosmos/transaction";

static const String setupRippleAddress = "/ripple/setup_address";
static const String setupBitcoinAddress = "/bitcoin/setup_address";
static const String setupEthAddress = "/ethereum/setup_address";
static const String setupTronAddress = "/tron/setup_address";
static const String setupSolanaAddress = "/solana/setup_address";
static const String setupCardanoAddress = "/cardano/setup_address";
static const String setupCosmosAddress = "/cosmos/setup_address";

static const String setupBitcoinMultsig = "/bitcoin/setup_multisig_address";

Expand Down Expand Up @@ -59,17 +68,25 @@ class PagePathConst {
if (network is AppBitcoinNetwork) return bitcoinTransaction;
if (network is APPEVMNetwork) return ethereumTransaction;
if (network is APPTVMNetwork) return tronTransfer;
if (network is APPSolanaNetwork) return solanaTransfer;
if (network is APPCardanoNetwork) return cardanoTransaction;
if (network is APPCosmosNetwork) return cosmosTransaction;
return rippleTransfer;
}

static String setupAddressPage(AppNetworkImpl network) {
if (network is AppBitcoinNetwork) return setupBitcoinAddress;
if (network is APPEVMNetwork) return setupEthAddress;
if (network is APPTVMNetwork) return setupTronAddress;
if (network is APPSolanaNetwork) return setupSolanaAddress;
if (network is APPCardanoNetwork) return setupCardanoAddress;
if (network is APPCosmosNetwork) return setupCosmosAddress;
return setupRippleAddress;
}

static const String importERC20Token = "ethereum/import_token";
static const String importTRC20Token = "tron/import_token";
static const String importTrc10Token = "tron/import_trc10_token";

static const String importSPLTokens = "solana/import_spl_tokens";
}
4 changes: 4 additions & 0 deletions mrt_wallet/lib/app/error/exception/wallet_ex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class WalletExceptionConst {
WalletException("contact_already_exist");
static final WalletException invalidBalance =
WalletException("invalid_balance");
static final WalletException unsuportedFeature =
WalletException("unsuported_feature");

static final WalletException condition = WalletException("message");
static final WalletException emptyThrow = WalletException("");
Expand All @@ -76,6 +78,8 @@ class WalletExceptionConst {
WalletException("invalid_ripple_privatekey_algorithm");
static final WalletException multiSigDerivationNotSuported =
WalletException("not_support_multisig_derivation");
static final WalletException inaccessibleKeyAlgorithm =
WalletException("inaccessible_key_algorithm");
static final WalletException invalidTokenInformation =
WalletException("invalid_token_information");
static final WalletException invalidNftInfromaation =
Expand Down
8 changes: 8 additions & 0 deletions mrt_wallet/lib/app/extention/bool.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:mrt_wallet/app/extention/string.dart';

extension QuickBooleanExtension on bool {
String get tr {
if (this) return "yes".tr;
return "no".tr;
}
}
42 changes: 41 additions & 1 deletion mrt_wallet/lib/app/extention/cbor.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:blockchain_utils/blockchain_utils.dart';

extension ExtractCborList on CborListValue {
T? getIndex<T>(int index) {
T? elementAt<T>(int index) {
if (index > value.length - 1) return null;
final cborValue = value[index];
final dynamic v;
Expand Down Expand Up @@ -46,4 +46,44 @@ extension ExtractCborList on CborListValue {
}
return v;
}

/// Gets the value at the specified [index] in the [CborListValue].
///
/// If [index] is out of bounds and [T] is nullable, returns null. Otherwise, throws a [MessageException].
T getElement<T>(int index) {
if (index >= value.length) {
if (null is T) return null as T;
throw MessageException("Index out of bounds.",
details: {"length": value.length, "index": index});
}

final CborObject obj = value.elementAt(index);
if (null is T && obj == const CborNullValue()) {
return null as T;
}
if (obj is T) return obj as T;
if (obj.value is! T) {
throw MessageException("Failed to cast value.",
details: {"Excepted": obj.value.runtimeType, "Type": "$T"});
}
return obj.value;
}
}

extension QuickCbor on CborObject {
/// Converts the value of the [CborObject] to the specified type [E] using the provided function [toe].
///
/// Throws a [MessageException] if the value cannot be converted to type [T].
E to<E, T>(E Function(T e) toe) {
if (this is T) {
return toe(this as T);
}
if (value is! T) {
throw MessageException("Failed to cast value.", details: {
"Value": "$value",
"Type": "$T",
});
}
return toe(value as T);
}
}
1 change: 1 addition & 0 deletions mrt_wallet/lib/app/extention/extention.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export 'string.dart';
export 'color.dart';
export 'date_time.dart';
export 'cbor.dart';
export 'bool.dart';
66 changes: 64 additions & 2 deletions mrt_wallet/lib/app/localization/localization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ class Localization {
"If you wish to remove the account name, please confirm by entering an empty text.",
"evm_networks": "EVM",
"tvm_networks": "TVM",
"sol_networks": "SOL",
"disable_standard_derivation":
"You can manually create a BIP32 path to generate an address by disabling the standard derivation.",
"transfer": "Transfer",
Expand Down Expand Up @@ -1141,7 +1142,7 @@ class Localization {
"rbf_desc":
"Allows users to adjust transaction fees after initiation for priority or confirmation speed changes.",
"memo_desc2":
"Additional message or information attached to a Bitcoin transaction.",
"Additional message or information attached to a ___1__ transaction.",
"custom_derivation": "Custom derivation",
"key_already_exists": "Private key already exists",
"wallet_deletation_desc":
Expand Down Expand Up @@ -1362,7 +1363,68 @@ class Localization {
"For the time being, the Tron network exclusively supports the Trongrid API.",
"min": "MIN",
"bitcoin_rbf_error":
"When using RBF, make sure your UTXOs have been confirmed; otherwise, you may encounter a non-final error"
"When using RBF, make sure your UTXOs have been confirmed; otherwise, you may encounter a non-final error",
"inaccessible_key_algorithm":
"Key algorithm inaccessible in multisig account.",
"recipient_info": "Recipient info",
"executable": "Executable",
"import_spl_tokens": "Import SPL Tokens",
"unable_to_locate_token":
"Unable to locate any SPL tokens in your account",
"cardano_networks": "ADA",
"select_era_for_generate_addr":
"Please select the Cardano era to generate the address.",
"shelly": "Shelley",
"byron": "Byron",
"recommended_address_type":
"We recommend using the latest era (Shelley) to access all network features.",
"cardano_era": "Cardano Era",
"master_key_generation": "Master Key Generation",
"cardano_bip32_master_key":
"Cardano supports two different methods for generating the BIP32 master key.",
"choose_master_key_gen":
"Please choose the master key generation method.",
"ledger": "Ledger",
"icarus": "Icarus",
"shelley_address_format": "Shelley address format",
"base": "Base",
"reward": "Reward",
"enterprise": "Enterprise",
"use_legacy": "Use legacy",
"seed_generation": "Seed Generation",
"seed_generation_type":
"Please select the method for generating the seed",
"byron_legacy_seed": "Byron Legacy Seed",
"byron_legacy": "Byron legacy",
"first_index": "First index",
"second_index": "second index",
"invalid_derivation_index": "Invalid derivation index",
"basic": "Basic",
"n_asset": "___1__ Asset",
"remaining_asset_amount": "Remaining asset amount",
"remaining_asset_amount_and_receiver":
"Remaining asset amount of UTXO and receiver address.",
"assets": "Assets",
"tap_to_add_assets_for_recipient": "Tap to add assets for recipient",
"choose_asset_you_want_to_transfer":
"Choose the assets you wish to transfer",
"setup_output_asset_amount": "Setup output assets",
"a_minimum_a_ada_required": "A minimum of 1 ADA output is required.",
"unsuported_feature": "Unsuported feature",
"cosmos_networks": "Cosmos and forked",
"add_least_one_receipt": "Add at least one recipient",
"the_amount_is_unspecified": "The amount is unspecified.",
"elliptic_curve_options": "Elliptic Curve Options",
"address_generation_algorithm":
"Address Generation Algorithm Selection",
"amount_must_exceed": "The output amount must exceed ___1__.",
"back_to_the_page": "Back to the page",
"label": "Label",
"metadatum_label": "Metadatum label",
"enther_valid_un_label":
"Please enter a valid unsigned number for the label.",
"label_already_exists": "The label you entered already exists.",
"no_account_chosen": "No account has been chosen."
}
};
}
Loading

0 comments on commit 678318c

Please sign in to comment.