Skip to content

Commit

Permalink
V5.8.2
Browse files Browse the repository at this point in the history
Fixed various bugs and added support for the Monero network.
  • Loading branch information
mrtnetwork committed Jan 2, 2025
1 parent 4afe816 commit 66d9ecd
Show file tree
Hide file tree
Showing 992 changed files with 802,361 additions and 30,013 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ Welcome to MRT Wallet, the open-source wallet crafted for the decentralized futu

- **Features:** Seamless support for Polkadot transactions.

### Monero

- **Features:** Seamless support for Monero transactions, Generate and verify proof.

## Web3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class WebViewPlatformView(

init {
webView.settings.javaScriptEnabled = true
webView.settings.domStorageEnabled = true
webView.webViewClient = CustomWebViewClient(channel, id)
webView.webChromeClient = CustomWebChromeClient(channel, id)

Expand Down
30 changes: 15 additions & 15 deletions mrt_native_support/example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
revision: "dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668"
channel: "stable"

project_type: app
Expand All @@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
- platform: android
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
- platform: ios
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
- platform: linux
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
- platform: macos
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
- platform: web
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
- platform: windows
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668

# User provided section

Expand Down
38 changes: 9 additions & 29 deletions mrt_native_support/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:example/app_kit_view.dart';
import 'package:flutter/material.dart';
import 'package:mrt_native_support/models/models.dart';
import 'package:mrt_native_support/platform_interface.dart';
Expand Down Expand Up @@ -55,30 +54,16 @@ class MyHomePage extends StatefulWidget {

class _MyHomePageState extends State<MyHomePage> with WebViewListener {
bool init = false;
final controller = PlatformInterface.webViewController;
MRTAndroidViewController? ca;
void initWebView() async {
await controller.init("jafar",
url: "https://google.com", jsInterface: "MRT");
ca = await MRTAndroidViewController.create(viewType: "jafar");
init = true;
setState(() {});
}
void initWebView() async {}

@override
void onPageProgress(WebViewEvent event) {
print("onPageProgress ${event.progress}");
}
void onPageProgress(WebViewEvent event) {}

@override
void onPageFinished(WebViewEvent event) {
print("onPageFinished ${event.url}");
}
void onPageFinished(WebViewEvent event) {}

@override
void onPageStart(WebViewEvent event) {
print("onPageStart ${event.url}");
}
void onPageStart(WebViewEvent event) {}

@override
Widget build(BuildContext context) {
Expand All @@ -96,20 +81,15 @@ class _MyHomePageState extends State<MyHomePage> with WebViewListener {
onPressed: () {
initWebView();
},
child: Text("init")),
child: const Text("init")),
TextButton(
onPressed: () {
init = false;
setState(() {});
},
child: Text("change")),
TextButton(
onPressed: () {
ca?.dispose();
controller.dispose("jafar");
print("ca $ca");
},
child: Text("dispose")),
child: const Text(
"changewqeqwe qweqwe qweqwe wqeq qweqwewe qweqasd asd we qweqwe")),
TextButton(onPressed: () {}, child: const Text("dispose")),
],
),
body: Container(
Expand All @@ -121,5 +101,5 @@ class _MyHomePageState extends State<MyHomePage> with WebViewListener {
}

@override
String? get viewType => "jafar";
String? get viewType => "j qweqweafar";
}
39 changes: 19 additions & 20 deletions mrt_native_support/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ packages:
blockchain_utils:
dependency: transitive
description:
name: blockchain_utils
sha256: aebc3a32b927b34f638817c4bfdb85f86a97e6ad35f0cd962660b0c6e8d5c56b
url: "https://pub.dev"
source: hosted
version: "3.3.0"
path: "../../../blockchain_utils"
relative: true
source: path
version: "3.5.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -45,10 +44,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -87,18 +86,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -166,7 +165,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_span:
dependency: transitive
description:
Expand All @@ -179,10 +178,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
Expand All @@ -195,10 +194,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
term_glyph:
dependency: transitive
description:
Expand All @@ -211,10 +210,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
vector_math:
dependency: transitive
description:
Expand All @@ -227,10 +226,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.3.0"
sdks:
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.22.0"
2 changes: 1 addition & 1 deletion mrt_native_support/lib/io/io_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class IoPlatformInterface extends MrtPlatformInterface {
if (prefix != null) {
values = values..removeWhere((k, v) => !k.startsWith(prefix));
}
return Map<String, String>.from(data!);
return Map<String, String>.from(values);
}

/// ios
Expand Down
10 changes: 10 additions & 0 deletions mrt_native_support/lib/models/device/models/platform.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:mrt_native_support/exception/exception.dart';

enum AppPlatform {
windows,
web,
Expand All @@ -7,4 +9,12 @@ enum AppPlatform {

bool get isDesktop =>
this == AppPlatform.windows || this == AppPlatform.macos;

static AppPlatform fromName(String? name) {
return values.firstWhere(
(e) => e.name == name,
orElse: () =>
throw const MRTNativePluginException("Invalid platform name."),
);
}
}
8 changes: 6 additions & 2 deletions mrt_native_support/lib/models/events/models/wallet_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ class WalletEvent {
final String requestId;
final WalletEventTypes type;
final String? additional;
final String? platform;
WalletEvent(
{required this.clientId,
required List<int> data,
required this.requestId,
required this.type,
this.additional})
this.additional,
this.platform})
: data = List<int>.unmodifiable(data);
factory WalletEvent.fromJson(Map<String, dynamic> json) {
return WalletEvent(
clientId: json["client_id"],
data: List<int>.from(json["data"]),
requestId: json["request_id"],
type: WalletEventTypes.fromName(json["type"]),
additional: json["additional"]);
additional: json["additional"],
platform: json["platform"]);
}

Map<String, dynamic> toJson() {
Expand All @@ -46,6 +49,7 @@ class WalletEvent {
"request_id": requestId,
"type": type.name,
"additional": additional,
"platform": platform
};
}
}
6 changes: 3 additions & 3 deletions mrt_native_support/lib/mrt_native_support.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// This Flutter plugin incorporates code inspired by the following projects:
// This Flutter plugin incorporates code inspired by the following projects:

/// 1. [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) - Some of the methods in this plugin are inspired by the flutter_secure_storage plugin, which is licensed under the BSD license. The original project can be found at: https://github.com/mogol/flutter_secure_storage
/// 2. [window_manager](https://pub.dev/packages/window_manager) - Additionally, some methods are inspired by the window_manager plugin, which is licensed under the MIT license. The original project can be found at: https://github.com/leanflutter/window_manager
// 1. [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) - Some of the methods in this plugin are inspired by the flutter_secure_storage plugin, which is licensed under the BSD license. The original project can be found at: https://github.com/mogol/flutter_secure_storage
// 2. [window_manager](https://pub.dev/packages/window_manager) - Additionally, some methods are inspired by the window_manager plugin, which is licensed under the MIT license. The original project can be found at: https://github.com/leanflutter/window_manager

import 'dart:async';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import 'package:flutter/services.dart';
import 'mrt_native_support_platform_interface.dart';

/// An implementation of [Mrt_nPlatform] that uses method channels.
// ignore: camel_case_types
class MethodChannelMrt_n extends Mrt_nPlatform {
/// The method channel used to interact with the native platform.
@visibleForTesting
final methodChannel = const MethodChannel('mrt_n');

@override
Future<String?> getPlatformVersion() async {
final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
final version =
await methodChannel.invokeMethod<String>('getPlatformVersion');
return version;
}
}
2 changes: 1 addition & 1 deletion mrt_native_support/lib/native_types.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library mrt_native_types;
library;

export 'models/device/models/device_info.dart';
export 'models/events/models/events.dart';
Expand Down
2 changes: 1 addition & 1 deletion mrt_native_support/lib/platform_interface.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library mrt_platform_interface;
library;

import 'package:mrt_native_support/base.dart'
if (dart.library.js_interop) 'web/mrt_native_web.dart'
Expand Down
21 changes: 19 additions & 2 deletions mrt_native_support/lib/web/api/core/js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,31 @@ import 'dart:js_interop';
@JS("Object")
extension type MRTJsObject(JSObject _) implements JSObject {
@JS("freeze")
external static T freeze<T extends JSObject>(T obj);
external static T freeze<T extends JSAny>(T obj);
@JS("defineProperty")
external static void defineProperty(
JSObject obj, String prop, JSObject descriptor);
@JS("isFrozen")
external static bool isFrozen(JSObject obj);
external static JSAny keys(JSAny? val);
external static JSArray<JSString>? keys(JSAny? val);
external static JSAny entries(JSAny? val);
external bool hasOwnProperty(String nameOrSymbol);
external static bool hasOwn(JSAny? obj, String prop);
static List<String>? keys_(JSAny? val) {
return MRTJsObject.keys(val)?.toDart.map((e) => e.toDart).toList();
}

static T? as<T extends JSAny>(
{required JSAny? object, required List<String> keys}) {
try {
final properties = MRTJsObject.keys_(object);
if (properties == null) return null;
for (final i in keys) {
if (!properties.contains(i)) return null;
}
return object as T;
} catch (e) {
return null;
}
}
}
Loading

0 comments on commit 66d9ecd

Please sign in to comment.