Skip to content

Commit f5822ff

Browse files
committed
V5.9.0
Enables importing Substrate networks, interacting with metadata, creating extrinsics, querying storage, and making runtime calls. Fully compatible with Web3 on Chrome, Brave, Firefox, Edge, Android, and macOS for substrate
1 parent feeeeb2 commit f5822ff

464 files changed

Lines changed: 137191 additions & 192127 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,11 @@ Welcome to MRT Wallet, the open-source wallet crafted for the decentralized futu
105105

106106

107107

108-
### Kusama
108+
### Substrate
109109

110-
- **Features:** Seamless support for Kusama transactions.
111-
112-
### Polkadot
113-
114-
- **Features:** Seamless support for Polkadot transactions.
110+
- **Features:** Provides seamless support for Kusama, Polkadot transactions, and standalone chains.
111+
- **Highlights:** Enables importing Substrate networks, interacting with metadata, creating extrinsics, querying storage, and making runtime calls.
112+
- **Web3 Support** Fully compatible with Web3 on Chrome, Brave, Firefox, Edge, Android, and macOS.
115113

116114
### Monero
117115

mrt_native_support/example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ packages:
1515
path: "../../../blockchain_utils"
1616
relative: true
1717
source: path
18-
version: "3.5.0"
18+
version: "4.0.0"
1919
boolean_selector:
2020
dependency: transitive
2121
description:

mrt_native_support/lib/io/io_platforms.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
library io_platform_interface;
1+
library;
22

33
import 'dart:async';
44
import 'dart:io';
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import 'package:mrt_native_support/models/device/models/platform.dart';
22

33
class MRTAPPConfig {
4+
static const int _storageVersion = 1;
45
final AppPlatform platform;
56
final bool hasBarcodeScanner;
6-
const MRTAPPConfig({required this.platform, required this.hasBarcodeScanner});
7+
final int storageVersion;
8+
const MRTAPPConfig(
9+
{required this.platform,
10+
required this.hasBarcodeScanner,
11+
this.storageVersion = _storageVersion});
712
}

mrt_native_support/lib/models/events/models/wallet_event.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ enum WalletEventTypes {
88
ping,
99
popup,
1010
windowId,
11-
openExtension;
11+
openExtension,
12+
background;
1213

1314
static WalletEventTypes fromName(String name) {
1415
return values.firstWhere((e) => e.name == name,

mrt_native_support/lib/models/size/models/rect.dart

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,45 @@ class WidgetRect {
33
final double width;
44
final double x;
55
final double y;
6+
final double? devicePixelRatio;
67
const WidgetRect(
78
{required this.height,
89
required this.width,
910
required this.x,
10-
required this.y});
11+
required this.y,
12+
this.devicePixelRatio});
13+
14+
static WidgetRect? fromString(String? v) {
15+
if (v == null) return null;
16+
try {
17+
final numbers = v.split('_').map((e) => double.tryParse(e)).toList();
18+
return WidgetRect(
19+
height: numbers[0]!,
20+
width: numbers[1]!,
21+
x: numbers[2]!,
22+
y: numbers[3]!,
23+
devicePixelRatio: numbers[4]!);
24+
} catch (_) {
25+
return null;
26+
}
27+
}
28+
29+
WidgetRect copyWith(
30+
{double? height,
31+
double? width,
32+
double? x,
33+
double? y,
34+
double? devicePixelRatio}) {
35+
return WidgetRect(
36+
height: height ?? this.height,
37+
width: width ?? this.width,
38+
x: x ?? this.x,
39+
y: y ?? this.y,
40+
devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio);
41+
}
42+
43+
@override
44+
String toString() {
45+
return "${height}_${width}_${x}_${y}_$devicePixelRatio";
46+
}
1147
}

mrt_native_support/lib/mrt_native_support.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ abstract class MrtPlatformInterface extends PlatformInterface {
4646
Future<void> stopBarcodeScanner();
4747
Future<bool> hasBarcodeScanner();
4848
Future<MRTAPPConfig> getConfig();
49-
5049
Future<String?> readClipboard();
5150
Future<bool> writeClipboard(String text);
5251
}

mrt_native_support/lib/web/api/chrome/api/core.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ ChromeAPI get extension {
4646
return _browser;
4747
}
4848

49+
bool get isMozila => _browserNullabe != null;
50+
4951
bool get isExtension =>
5052
_chromeNullabe?.runtimeNullable?.idNullabe != null ||
5153
_browserNullabe?.runtimeNullable?.idNullabe != null;

mrt_native_support/lib/web/api/chrome/api/windows.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ extension type ChromeWindows._(JSObject _) {
66
external JSPromise<ChromeWindow> create(ChromeWindowsCreateData? ccreateData);
77
external JSPromise<ChromeWindow> getCurrent(
88
ChromeWindowsQueryOptions? queryOptions);
9+
external JSPromise<ChromeWindow> getLastFocused(
10+
ChromeWindowsQueryOptions? queryOptions);
911
external JSPromise<ChromeWindow> get(
1012
int windowId, ChromeWindowsQueryOptions? queryOptions);
13+
external JSPromise<JSArray<ChromeWindow>> getAll(
14+
ChromeWindowsQueryOptions? queryOptions);
1115
external JSPromise<ChromeWindow> update(
1216
int windowId, ChromeWindowsUpdateInfo? updateInfo);
1317
Future<ChromeWindow> create_(
@@ -69,6 +73,25 @@ extension type ChromeWindows._(JSObject _) {
6973
return await future;
7074
}
7175

76+
Future<ChromeWindow> getLastFocused_(
77+
{bool? populate, List<String>? windowTypes}) async {
78+
final future = getLastFocused(ChromeWindowsQueryOptions(
79+
populate: populate,
80+
windowTypes: windowTypes?.map((e) => e.toJS).toList().toJS))
81+
.toDart;
82+
return await future;
83+
}
84+
85+
Future<List<ChromeWindow>> getAll_(
86+
{bool? populate, List<String>? windowTypes}) async {
87+
final future = getAll(ChromeWindowsQueryOptions(
88+
populate: populate,
89+
windowTypes: windowTypes?.map((e) => e.toJS).toList().toJS))
90+
.toDart;
91+
final r = await future;
92+
return r.toDart;
93+
}
94+
7295
Future<ChromeWindow> getCurrent_(
7396
{bool? populate, List<String>? windowTypes}) async {
7497
final future = getCurrent(ChromeWindowsQueryOptions(

mrt_native_support/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313
plugin_platform_interface: ^2.1.8
14-
blockchain_utils: ^4.0.0
14+
blockchain_utils: ^4.0.1
1515
# blockchain_utils:
1616
# path: ../../../blockchain_utils
1717

0 commit comments

Comments
 (0)