Merge branch 'staging' into add-xtz

# Conflicts:
#	lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart
#	lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart
#	lib/services/coins/coin_service.dart
#	lib/services/price.dart
#	lib/utilities/amount/amount_unit.dart
#	lib/utilities/block_explorers.dart
#	lib/utilities/constants.dart
#	lib/utilities/default_nodes.dart
#	lib/utilities/enums/coin_enum.dart
#	lib/utilities/enums/derive_path_type_enum.dart
#	lib/widgets/node_card.dart
#	lib/widgets/node_options_sheet.dart
#	pubspec.yaml
This commit is contained in:
ryleedavis 2023-07-28 10:48:52 -06:00
commit b66b25eb1f
101 changed files with 2444 additions and 1095 deletions

Binary file not shown.

Binary file not shown.

@ -1 +1 @@
Subproject commit 407425c9fcf7a30c81f1345246c7225bc18b5cd5
Subproject commit e48952185556a10f182184fd572bcb04365f5831

View file

@ -69,13 +69,18 @@ class ElectrumX {
List<ElectrumXNode>? failovers;
int currentFailoverIndex = -1;
ElectrumX(
{required String host,
required int port,
required bool useSSL,
required Prefs prefs,
required List<ElectrumXNode> failovers,
JsonRPC? client}) {
final Duration connectionTimeoutForSpecialCaseJsonRPCClients;
ElectrumX({
required String host,
required int port,
required bool useSSL,
required Prefs prefs,
required List<ElectrumXNode> failovers,
JsonRPC? client,
this.connectionTimeoutForSpecialCaseJsonRPCClients =
const Duration(seconds: 60),
}) {
_prefs = prefs;
_host = host;
_port = port;
@ -108,9 +113,9 @@ class ElectrumX {
Future<dynamic> request({
required String command,
List<dynamic> args = const [],
Duration connectionTimeout = const Duration(seconds: 60),
String? requestID,
int retries = 2,
Duration requestTimeout = const Duration(seconds: 60),
}) async {
if (!(await _allow())) {
throw WifiOnlyException();
@ -121,26 +126,31 @@ class ElectrumX {
host: host,
port: port,
useSSL: useSSL,
connectionTimeout: connectionTimeout,
connectionTimeout: connectionTimeoutForSpecialCaseJsonRPCClients,
);
} else {
_rpcClient = JsonRPC(
host: failovers![currentFailoverIndex].address,
port: failovers![currentFailoverIndex].port,
useSSL: failovers![currentFailoverIndex].useSSL,
connectionTimeout: connectionTimeout,
connectionTimeout: connectionTimeoutForSpecialCaseJsonRPCClients,
);
}
try {
final requestId = requestID ?? const Uuid().v1();
final jsonArgs = json.encode(args);
final jsonRequestString =
'{"jsonrpc": "2.0", "id": "$requestId","method": "$command","params": $jsonArgs}';
final jsonRequestString = '{"jsonrpc": "2.0", '
'"id": "$requestId",'
'"method": "$command",'
'"params": $jsonArgs}';
// Logging.instance.log("ElectrumX jsonRequestString: $jsonRequestString");
final response = await _rpcClient!.request(jsonRequestString);
final response = await _rpcClient!.request(
jsonRequestString,
requestTimeout,
);
if (response.exception != null) {
throw response.exception!;
@ -174,7 +184,7 @@ class ElectrumX {
return request(
command: command,
args: args,
connectionTimeout: connectionTimeout,
requestTimeout: requestTimeout,
requestID: requestID,
retries: retries - 1,
);
@ -187,7 +197,7 @@ class ElectrumX {
return request(
command: command,
args: args,
connectionTimeout: connectionTimeout,
requestTimeout: requestTimeout,
requestID: requestID,
);
} else {
@ -204,7 +214,7 @@ class ElectrumX {
Future<List<Map<String, dynamic>>> batchRequest({
required String command,
required Map<String, List<dynamic>> args,
Duration connectionTimeout = const Duration(seconds: 60),
Duration requestTimeout = const Duration(seconds: 60),
int retries = 2,
}) async {
if (!(await _allow())) {
@ -216,14 +226,14 @@ class ElectrumX {
host: host,
port: port,
useSSL: useSSL,
connectionTimeout: connectionTimeout,
connectionTimeout: connectionTimeoutForSpecialCaseJsonRPCClients,
);
} else {
_rpcClient = JsonRPC(
host: failovers![currentFailoverIndex].address,
port: failovers![currentFailoverIndex].port,
useSSL: failovers![currentFailoverIndex].useSSL,
connectionTimeout: connectionTimeout,
connectionTimeout: connectionTimeoutForSpecialCaseJsonRPCClients,
);
}
@ -246,7 +256,8 @@ class ElectrumX {
// Logging.instance.log("batch request: $request");
// send batch request
final jsonRpcResponse = (await _rpcClient!.request(request));
final jsonRpcResponse =
(await _rpcClient!.request(request, requestTimeout));
if (jsonRpcResponse.exception != null) {
throw jsonRpcResponse.exception!;
@ -281,7 +292,7 @@ class ElectrumX {
return batchRequest(
command: command,
args: args,
connectionTimeout: connectionTimeout,
requestTimeout: requestTimeout,
retries: retries - 1,
);
} else {
@ -293,7 +304,7 @@ class ElectrumX {
return batchRequest(
command: command,
args: args,
connectionTimeout: connectionTimeout,
requestTimeout: requestTimeout,
);
} else {
currentFailoverIndex = -1;
@ -310,7 +321,7 @@ class ElectrumX {
final response = await request(
requestID: requestID,
command: 'server.ping',
connectionTimeout: const Duration(seconds: 2),
requestTimeout: const Duration(seconds: 2),
retries: retryCount,
).timeout(const Duration(seconds: 2)) as Map<String, dynamic>;
return response.keys.contains("result") && response["result"] == null;
@ -442,7 +453,7 @@ class ElectrumX {
final response = await request(
requestID: requestID,
command: 'blockchain.scripthash.get_history',
connectionTimeout: const Duration(minutes: 5),
requestTimeout: const Duration(minutes: 5),
args: [
scripthash,
],
@ -666,11 +677,13 @@ class ElectrumX {
}) async {
try {
final response = await request(
requestID: requestID,
command: 'lelantus.getusedcoinserials',
args: [
"$startNumber",
]);
requestID: requestID,
command: 'lelantus.getusedcoinserials',
args: [
"$startNumber",
],
requestTimeout: const Duration(minutes: 2),
);
return Map<String, dynamic>.from(response["result"] as Map);
} catch (e) {
Logging.instance.log(e, level: LogLevel.Error);

View file

@ -79,7 +79,6 @@ class JsonRPC {
// TODO different timeout length?
req.initiateTimeout(
Duration(seconds: connectionTimeout.inSeconds ~/ 2),
onTimedOut: () {
_requestQueue.remove(req);
},
@ -88,7 +87,10 @@ class JsonRPC {
});
}
Future<JsonRPCResponse> request(String jsonRpcRequest) async {
Future<JsonRPCResponse> request(
String jsonRpcRequest,
Duration requestTimeout,
) async {
await _requestMutex.protect(() async {
if (_socket == null) {
Logging.instance.log(
@ -101,6 +103,7 @@ class JsonRPC {
final req = _JsonRPCRequest(
jsonRequest: jsonRpcRequest,
requestTimeout: requestTimeout,
completer: Completer<JsonRPCResponse>(),
);
@ -243,9 +246,14 @@ class _JsonRPCRequest {
final String jsonRequest;
final Completer<JsonRPCResponse> completer;
final Duration requestTimeout;
final List<int> _responseData = [];
_JsonRPCRequest({required this.jsonRequest, required this.completer});
_JsonRPCRequest({
required this.jsonRequest,
required this.completer,
required this.requestTimeout,
});
void appendDataAndCheckIfComplete(List<int> data) {
_responseData.addAll(data);
@ -263,11 +271,10 @@ class _JsonRPCRequest {
}
}
void initiateTimeout(
Duration timeout, {
void initiateTimeout({
VoidCallback? onTimedOut,
}) {
Future<void>.delayed(timeout).then((_) {
Future<void>.delayed(requestTimeout).then((_) {
if (!isComplete) {
try {
throw Exception("_JsonRPCRequest timed out: $jsonRequest");

View file

@ -45,7 +45,7 @@ class StackTheme {
case "dark":
return Brightness.dark;
default:
// just return light instead of a possible crash causing error
// just return light instead of a possible crash causing error
return Brightness.light;
}
}
@ -131,8 +131,8 @@ class StackTheme {
@ignore
Color get accentColorBlue => _accentColorBlue ??= Color(
accentColorBlueInt,
);
accentColorBlueInt,
);
@ignore
Color? _accentColorBlue;
late final int accentColorBlueInt;
@ -141,8 +141,8 @@ class StackTheme {
@ignore
Color get accentColorGreen => _accentColorGreen ??= Color(
accentColorGreenInt,
);
accentColorGreenInt,
);
@ignore
Color? _accentColorGreen;
late final int accentColorGreenInt;
@ -151,8 +151,8 @@ class StackTheme {
@ignore
Color get accentColorYellow => _accentColorYellow ??= Color(
accentColorYellowInt,
);
accentColorYellowInt,
);
@ignore
Color? _accentColorYellow;
late final int accentColorYellowInt;
@ -161,8 +161,8 @@ class StackTheme {
@ignore
Color get accentColorRed => _accentColorRed ??= Color(
accentColorRedInt,
);
accentColorRedInt,
);
@ignore
Color? _accentColorRed;
late final int accentColorRedInt;
@ -171,8 +171,8 @@ class StackTheme {
@ignore
Color get accentColorOrange => _accentColorOrange ??= Color(
accentColorOrangeInt,
);
accentColorOrangeInt,
);
@ignore
Color? _accentColorOrange;
late final int accentColorOrangeInt;
@ -181,8 +181,8 @@ class StackTheme {
@ignore
Color get accentColorDark => _accentColorDark ??= Color(
accentColorDarkInt,
);
accentColorDarkInt,
);
@ignore
Color? _accentColorDark;
late final int accentColorDarkInt;
@ -191,8 +191,8 @@ class StackTheme {
@ignore
Color get shadow => _shadow ??= Color(
shadowInt,
);
shadowInt,
);
@ignore
Color? _shadow;
late final int shadowInt;
@ -201,8 +201,8 @@ class StackTheme {
@ignore
Color get textDark => _textDark ??= Color(
textDarkInt,
);
textDarkInt,
);
@ignore
Color? _textDark;
late final int textDarkInt;
@ -211,8 +211,8 @@ class StackTheme {
@ignore
Color get textDark2 => _textDark2 ??= Color(
textDark2Int,
);
textDark2Int,
);
@ignore
Color? _textDark2;
late final int textDark2Int;
@ -221,8 +221,8 @@ class StackTheme {
@ignore
Color get textDark3 => _textDark3 ??= Color(
textDark3Int,
);
textDark3Int,
);
@ignore
Color? _textDark3;
late final int textDark3Int;
@ -231,8 +231,8 @@ class StackTheme {
@ignore
Color get textSubtitle1 => _textSubtitle1 ??= Color(
textSubtitle1Int,
);
textSubtitle1Int,
);
@ignore
Color? _textSubtitle1;
late final int textSubtitle1Int;
@ -241,8 +241,8 @@ class StackTheme {
@ignore
Color get textSubtitle2 => _textSubtitle2 ??= Color(
textSubtitle2Int,
);
textSubtitle2Int,
);
@ignore
Color? _textSubtitle2;
late final int textSubtitle2Int;
@ -251,8 +251,8 @@ class StackTheme {
@ignore
Color get textSubtitle3 => _textSubtitle3 ??= Color(
textSubtitle3Int,
);
textSubtitle3Int,
);
@ignore
Color? _textSubtitle3;
late final int textSubtitle3Int;
@ -261,8 +261,8 @@ class StackTheme {
@ignore
Color get textSubtitle4 => _textSubtitle4 ??= Color(
textSubtitle4Int,
);
textSubtitle4Int,
);
@ignore
Color? _textSubtitle4;
late final int textSubtitle4Int;
@ -271,8 +271,8 @@ class StackTheme {
@ignore
Color get textSubtitle5 => _textSubtitle5 ??= Color(
textSubtitle5Int,
);
textSubtitle5Int,
);
@ignore
Color? _textSubtitle5;
late final int textSubtitle5Int;
@ -281,8 +281,8 @@ class StackTheme {
@ignore
Color get textSubtitle6 => _textSubtitle6 ??= Color(
textSubtitle6Int,
);
textSubtitle6Int,
);
@ignore
Color? _textSubtitle6;
late final int textSubtitle6Int;
@ -291,8 +291,8 @@ class StackTheme {
@ignore
Color get textWhite => _textWhite ??= Color(
textWhiteInt,
);
textWhiteInt,
);
@ignore
Color? _textWhite;
late final int textWhiteInt;
@ -301,8 +301,8 @@ class StackTheme {
@ignore
Color get textFavoriteCard => _textFavoriteCard ??= Color(
textFavoriteCardInt,
);
textFavoriteCardInt,
);
@ignore
Color? _textFavoriteCard;
late final int textFavoriteCardInt;
@ -311,8 +311,8 @@ class StackTheme {
@ignore
Color get textError => _textError ??= Color(
textErrorInt,
);
textErrorInt,
);
@ignore
Color? _textError;
late final int textErrorInt;
@ -321,8 +321,8 @@ class StackTheme {
@ignore
Color get textRestore => _textRestore ??= Color(
textRestoreInt,
);
textRestoreInt,
);
@ignore
Color? _textRestore;
late final int textRestoreInt;
@ -331,8 +331,8 @@ class StackTheme {
@ignore
Color get buttonBackPrimary => _buttonBackPrimary ??= Color(
buttonBackPrimaryInt,
);
buttonBackPrimaryInt,
);
@ignore
Color? _buttonBackPrimary;
late final int buttonBackPrimaryInt;
@ -341,8 +341,8 @@ class StackTheme {
@ignore
Color get buttonBackSecondary => _buttonBackSecondary ??= Color(
buttonBackSecondaryInt,
);
buttonBackSecondaryInt,
);
@ignore
Color? _buttonBackSecondary;
late final int buttonBackSecondaryInt;
@ -351,8 +351,8 @@ class StackTheme {
@ignore
Color get buttonBackPrimaryDisabled => _buttonBackPrimaryDisabled ??= Color(
buttonBackPrimaryDisabledInt,
);
buttonBackPrimaryDisabledInt,
);
@ignore
Color? _buttonBackPrimaryDisabled;
late final int buttonBackPrimaryDisabledInt;
@ -372,8 +372,8 @@ class StackTheme {
@ignore
Color get buttonBackBorder => _buttonBackBorder ??= Color(
buttonBackBorderInt,
);
buttonBackBorderInt,
);
@ignore
Color? _buttonBackBorder;
late final int buttonBackBorderInt;
@ -382,8 +382,8 @@ class StackTheme {
@ignore
Color get buttonBackBorderDisabled => _buttonBackBorderDisabled ??= Color(
buttonBackBorderDisabledInt,
);
buttonBackBorderDisabledInt,
);
@ignore
Color? _buttonBackBorderDisabled;
late final int buttonBackBorderDisabledInt;
@ -392,8 +392,8 @@ class StackTheme {
@ignore
Color get buttonBackBorderSecondary => _buttonBackBorderSecondary ??= Color(
buttonBackBorderSecondaryInt,
);
buttonBackBorderSecondaryInt,
);
@ignore
Color? _buttonBackBorderSecondary;
late final int buttonBackBorderSecondaryInt;
@ -413,8 +413,8 @@ class StackTheme {
@ignore
Color get numberBackDefault => _numberBackDefault ??= Color(
numberBackDefaultInt,
);
numberBackDefaultInt,
);
@ignore
Color? _numberBackDefault;
late final int numberBackDefaultInt;
@ -423,8 +423,8 @@ class StackTheme {
@ignore
Color get numpadBackDefault => _numpadBackDefault ??= Color(
numpadBackDefaultInt,
);
numpadBackDefaultInt,
);
@ignore
Color? _numpadBackDefault;
late final int numpadBackDefaultInt;
@ -433,8 +433,8 @@ class StackTheme {
@ignore
Color get bottomNavBack => _bottomNavBack ??= Color(
bottomNavBackInt,
);
bottomNavBackInt,
);
@ignore
Color? _bottomNavBack;
late final int bottomNavBackInt;
@ -443,8 +443,8 @@ class StackTheme {
@ignore
Color get buttonTextPrimary => _buttonTextPrimary ??= Color(
buttonTextPrimaryInt,
);
buttonTextPrimaryInt,
);
@ignore
Color? _buttonTextPrimary;
late final int buttonTextPrimaryInt;
@ -453,8 +453,8 @@ class StackTheme {
@ignore
Color get buttonTextSecondary => _buttonTextSecondary ??= Color(
buttonTextSecondaryInt,
);
buttonTextSecondaryInt,
);
@ignore
Color? _buttonTextSecondary;
late final int buttonTextSecondaryInt;
@ -463,8 +463,8 @@ class StackTheme {
@ignore
Color get buttonTextPrimaryDisabled => _buttonTextPrimaryDisabled ??= Color(
buttonTextPrimaryDisabledInt,
);
buttonTextPrimaryDisabledInt,
);
@ignore
Color? _buttonTextPrimaryDisabled;
late final int buttonTextPrimaryDisabledInt;
@ -1517,117 +1517,117 @@ class StackTheme {
..version = version
..assetsV1 = version == 1
? ThemeAssets.fromJson(
json: Map<String, dynamic>.from(json["assets"] as Map),
themeId: json["id"] as String,
)
json: Map<String, dynamic>.from(json["assets"] as Map),
themeId: json["id"] as String,
)
: null
..assetsV2 = version == 2
? ThemeAssetsV2.fromJson(
json: Map<String, dynamic>.from(json["assets"] as Map),
themeId: json["id"] as String,
)
json: Map<String, dynamic>.from(json["assets"] as Map),
themeId: json["id"] as String,
)
: null
..assetsV3 = version >= 3
? ThemeAssetsV3.fromJson(
json: Map<String, dynamic>.from(json["assets"] as Map),
themeId: json["id"] as String,
)
json: Map<String, dynamic>.from(json["assets"] as Map),
themeId: json["id"] as String,
)
: null
..themeId = json["id"] as String
..name = json["name"] as String
..brightnessString = json["brightness"] as String
..backgroundInt = parseColor(json["colors"]["background"] as String)
..backgroundAppBarInt =
parseColor(json["colors"]["background_app_bar"] as String)
parseColor(json["colors"]["background_app_bar"] as String)
..gradientBackgroundString = json["colors"]["gradients"] != null
? jsonEncode(json["colors"]["gradients"])
: null
..standardBoxShadowString =
jsonEncode(json["colors"]["box_shadows"]["standard"] as Map)
jsonEncode(json["colors"]["box_shadows"]["standard"] as Map)
..homeViewButtonBarBoxShadowString =
json["colors"]["box_shadows"]["home_view_button_bar"] == null
? null
: jsonEncode(
json["colors"]["box_shadows"]["home_view_button_bar"] as Map)
json["colors"]["box_shadows"]["home_view_button_bar"] == null
? null
: jsonEncode(
json["colors"]["box_shadows"]["home_view_button_bar"] as Map)
..coinColorsJsonString = jsonEncode(json["colors"]['coin'] as Map)
..overlayInt = parseColor(json["colors"]["overlay"] as String)
..accentColorBlueInt =
parseColor(json["colors"]["accent_color_blue"] as String)
parseColor(json["colors"]["accent_color_blue"] as String)
..accentColorGreenInt =
parseColor(json["colors"]["accent_color_green"] as String)
parseColor(json["colors"]["accent_color_green"] as String)
..accentColorYellowInt =
parseColor(json["colors"]["accent_color_yellow"] as String)
parseColor(json["colors"]["accent_color_yellow"] as String)
..accentColorRedInt =
parseColor(json["colors"]["accent_color_red"] as String)
parseColor(json["colors"]["accent_color_red"] as String)
..accentColorOrangeInt =
parseColor(json["colors"]["accent_color_orange"] as String)
parseColor(json["colors"]["accent_color_orange"] as String)
..accentColorDarkInt =
parseColor(json["colors"]["accent_color_dark"] as String)
parseColor(json["colors"]["accent_color_dark"] as String)
..shadowInt = parseColor(json["colors"]["shadow"] as String)
..textDarkInt = parseColor(json["colors"]["text_dark_one"] as String)
..textDark2Int = parseColor(json["colors"]["text_dark_two"] as String)
..textDark3Int = parseColor(json["colors"]["text_dark_three"] as String)
..textWhiteInt = parseColor(json["colors"]["text_white"] as String)
..textFavoriteCardInt =
parseColor(json["colors"]["text_favorite"] as String)
parseColor(json["colors"]["text_favorite"] as String)
..textErrorInt = parseColor(json["colors"]["text_error"] as String)
..textRestoreInt = parseColor(json["colors"]["text_restore"] as String)
..buttonBackPrimaryInt =
parseColor(json["colors"]["button_back_primary"] as String)
parseColor(json["colors"]["button_back_primary"] as String)
..buttonBackSecondaryInt =
parseColor(json["colors"]["button_back_secondary"] as String)
parseColor(json["colors"]["button_back_secondary"] as String)
..buttonBackPrimaryDisabledInt =
parseColor(json["colors"]["button_back_primary_disabled"] as String)
parseColor(json["colors"]["button_back_primary_disabled"] as String)
..buttonBackSecondaryDisabledInt =
parseColor(json["colors"]["button_back_secondary_disabled"] as String)
parseColor(json["colors"]["button_back_secondary_disabled"] as String)
..buttonBackBorderInt =
parseColor(json["colors"]["button_back_border"] as String)
parseColor(json["colors"]["button_back_border"] as String)
..buttonBackBorderDisabledInt =
parseColor(json["colors"]["button_back_border_disabled"] as String)
parseColor(json["colors"]["button_back_border_disabled"] as String)
..buttonBackBorderSecondaryInt =
parseColor(json["colors"]["button_back_border_secondary"] as String)
parseColor(json["colors"]["button_back_border_secondary"] as String)
..buttonBackBorderSecondaryDisabledInt = parseColor(
json["colors"]["button_back_border_secondary_disabled"] as String)
..numberBackDefaultInt =
parseColor(json["colors"]["number_back_default"] as String)
parseColor(json["colors"]["number_back_default"] as String)
..numpadBackDefaultInt =
parseColor(json["colors"]["numpad_back_default"] as String)
parseColor(json["colors"]["numpad_back_default"] as String)
..bottomNavBackInt =
parseColor(json["colors"]["bottom_nav_back"] as String)
parseColor(json["colors"]["bottom_nav_back"] as String)
..textSubtitle1Int =
parseColor(json["colors"]["text_subtitle_one"] as String)
parseColor(json["colors"]["text_subtitle_one"] as String)
..textSubtitle2Int =
parseColor(json["colors"]["text_subtitle_two"] as String)
parseColor(json["colors"]["text_subtitle_two"] as String)
..textSubtitle3Int =
parseColor(json["colors"]["text_subtitle_three"] as String)
parseColor(json["colors"]["text_subtitle_three"] as String)
..textSubtitle4Int =
parseColor(json["colors"]["text_subtitle_four"] as String)
parseColor(json["colors"]["text_subtitle_four"] as String)
..textSubtitle5Int =
parseColor(json["colors"]["text_subtitle_five"] as String)
parseColor(json["colors"]["text_subtitle_five"] as String)
..textSubtitle6Int =
parseColor(json["colors"]["text_subtitle_six"] as String)
parseColor(json["colors"]["text_subtitle_six"] as String)
..buttonTextPrimaryInt =
parseColor(json["colors"]["button_text_primary"] as String)
parseColor(json["colors"]["button_text_primary"] as String)
..buttonTextSecondaryInt =
parseColor(json["colors"]["button_text_secondary"] as String)
parseColor(json["colors"]["button_text_secondary"] as String)
..buttonTextPrimaryDisabledInt =
parseColor(json["colors"]["button_text_primary_disabled"] as String)
parseColor(json["colors"]["button_text_primary_disabled"] as String)
..buttonTextSecondaryDisabledInt =
parseColor(json["colors"]["button_text_secondary_disabled"] as String)
parseColor(json["colors"]["button_text_secondary_disabled"] as String)
..buttonTextBorderInt =
parseColor(json["colors"]["button_text_border"] as String)
parseColor(json["colors"]["button_text_border"] as String)
..buttonTextDisabledInt =
parseColor(json["colors"]["button_text_disabled"] as String)
parseColor(json["colors"]["button_text_disabled"] as String)
..buttonTextBorderlessInt =
parseColor(json["colors"]["button_text_borderless"] as String)
parseColor(json["colors"]["button_text_borderless"] as String)
..buttonTextBorderlessDisabledInt = parseColor(
json["colors"]["button_text_borderless_disabled"] as String)
..numberTextDefaultInt =
parseColor(json["colors"]["number_text_default"] as String)
parseColor(json["colors"]["number_text_default"] as String)
..numpadTextDefaultInt =
parseColor(json["colors"]["numpad_text_default"] as String)
parseColor(json["colors"]["numpad_text_default"] as String)
..bottomNavTextInt =
parseColor(json["colors"]["bottom_nav_text"] as String)
parseColor(json["colors"]["bottom_nav_text"] as String)
..customTextButtonEnabledTextInt = parseColor(
json["colors"]["custom_text_button_enabled_text"] as String)
..customTextButtonDisabledTextInt = parseColor(
@ -1635,87 +1635,87 @@ class StackTheme {
..switchBGOnInt = parseColor(json["colors"]["switch_bg_on"] as String)
..switchBGOffInt = parseColor(json["colors"]["switch_bg_off"] as String)
..switchBGDisabledInt =
parseColor(json["colors"]["switch_bg_disabled"] as String)
parseColor(json["colors"]["switch_bg_disabled"] as String)
..switchCircleOnInt =
parseColor(json["colors"]["switch_circle_on"] as String)
parseColor(json["colors"]["switch_circle_on"] as String)
..switchCircleOffInt =
parseColor(json["colors"]["switch_circle_off"] as String)
parseColor(json["colors"]["switch_circle_off"] as String)
..switchCircleDisabledInt =
parseColor(json["colors"]["switch_circle_disabled"] as String)
parseColor(json["colors"]["switch_circle_disabled"] as String)
..stepIndicatorBGCheckInt =
parseColor(json["colors"]["step_indicator_bg_check"] as String)
parseColor(json["colors"]["step_indicator_bg_check"] as String)
..stepIndicatorBGNumberInt =
parseColor(json["colors"]["step_indicator_bg_number"] as String)
parseColor(json["colors"]["step_indicator_bg_number"] as String)
..stepIndicatorBGInactiveInt =
parseColor(json["colors"]["step_indicator_bg_inactive"] as String)
parseColor(json["colors"]["step_indicator_bg_inactive"] as String)
..stepIndicatorBGLinesInt =
parseColor(json["colors"]["step_indicator_bg_lines"] as String)
parseColor(json["colors"]["step_indicator_bg_lines"] as String)
..stepIndicatorBGLinesInactiveInt = parseColor(
json["colors"]["step_indicator_bg_lines_inactive"] as String)
..stepIndicatorIconTextInt =
parseColor(json["colors"]["step_indicator_icon_text"] as String)
parseColor(json["colors"]["step_indicator_icon_text"] as String)
..stepIndicatorIconNumberInt =
parseColor(json["colors"]["step_indicator_icon_number"] as String)
parseColor(json["colors"]["step_indicator_icon_number"] as String)
..stepIndicatorIconInactiveInt =
parseColor(json["colors"]["step_indicator_icon_inactive"] as String)
parseColor(json["colors"]["step_indicator_icon_inactive"] as String)
..checkboxBGCheckedInt =
parseColor(json["colors"]["checkbox_bg_checked"] as String)
parseColor(json["colors"]["checkbox_bg_checked"] as String)
..checkboxBorderEmptyInt =
parseColor(json["colors"]["checkbox_border_empty"] as String)
parseColor(json["colors"]["checkbox_border_empty"] as String)
..checkboxBGDisabledInt =
parseColor(json["colors"]["checkbox_bg_disabled"] as String)
parseColor(json["colors"]["checkbox_bg_disabled"] as String)
..checkboxIconCheckedInt =
parseColor(json["colors"]["checkbox_icon_checked"] as String)
parseColor(json["colors"]["checkbox_icon_checked"] as String)
..checkboxIconDisabledInt =
parseColor(json["colors"]["checkbox_icon_disabled"] as String)
parseColor(json["colors"]["checkbox_icon_disabled"] as String)
..checkboxTextLabelInt =
parseColor(json["colors"]["checkbox_text_label"] as String)
parseColor(json["colors"]["checkbox_text_label"] as String)
..snackBarBackSuccessInt =
parseColor(json["colors"]["snack_bar_back_success"] as String)
parseColor(json["colors"]["snack_bar_back_success"] as String)
..snackBarBackErrorInt =
parseColor(json["colors"]["snack_bar_back_error"] as String)
parseColor(json["colors"]["snack_bar_back_error"] as String)
..snackBarBackInfoInt =
parseColor(json["colors"]["snack_bar_back_info"] as String)
parseColor(json["colors"]["snack_bar_back_info"] as String)
..snackBarTextSuccessInt =
parseColor(json["colors"]["snack_bar_text_success"] as String)
parseColor(json["colors"]["snack_bar_text_success"] as String)
..snackBarTextErrorInt =
parseColor(json["colors"]["snack_bar_text_error"] as String)
parseColor(json["colors"]["snack_bar_text_error"] as String)
..snackBarTextInfoInt =
parseColor(json["colors"]["snack_bar_text_info"] as String)
parseColor(json["colors"]["snack_bar_text_info"] as String)
..bottomNavIconBackInt =
parseColor(json["colors"]["bottom_nav_icon_back"] as String)
parseColor(json["colors"]["bottom_nav_icon_back"] as String)
..bottomNavIconIconInt =
parseColor(json["colors"]["bottom_nav_icon_icon"] as String)
parseColor(json["colors"]["bottom_nav_icon_icon"] as String)
..bottomNavIconIconHighlightedInt = parseColor(
json["colors"]["bottom_nav_icon_icon_highlighted"] as String)
..topNavIconPrimaryInt =
parseColor(json["colors"]["top_nav_icon_primary"] as String)
parseColor(json["colors"]["top_nav_icon_primary"] as String)
..topNavIconGreenInt =
parseColor(json["colors"]["top_nav_icon_green"] as String)
parseColor(json["colors"]["top_nav_icon_green"] as String)
..topNavIconYellowInt =
parseColor(json["colors"]["top_nav_icon_yellow"] as String)
parseColor(json["colors"]["top_nav_icon_yellow"] as String)
..topNavIconRedInt =
parseColor(json["colors"]["top_nav_icon_red"] as String)
parseColor(json["colors"]["top_nav_icon_red"] as String)
..settingsIconBackInt =
parseColor(json["colors"]["settings_icon_back"] as String)
parseColor(json["colors"]["settings_icon_back"] as String)
..settingsIconIconInt =
parseColor(json["colors"]["settings_icon_icon"] as String)
parseColor(json["colors"]["settings_icon_icon"] as String)
..settingsIconBack2Int =
parseColor(json["colors"]["settings_icon_back_two"] as String)
parseColor(json["colors"]["settings_icon_back_two"] as String)
..settingsIconElementInt =
parseColor(json["colors"]["settings_icon_element"] as String)
parseColor(json["colors"]["settings_icon_element"] as String)
..textFieldActiveBGInt =
parseColor(json["colors"]["text_field_active_bg"] as String)
parseColor(json["colors"]["text_field_active_bg"] as String)
..textFieldDefaultBGInt =
parseColor(json["colors"]["text_field_default_bg"] as String)
parseColor(json["colors"]["text_field_default_bg"] as String)
..textFieldErrorBGInt =
parseColor(json["colors"]["text_field_error_bg"] as String)
parseColor(json["colors"]["text_field_error_bg"] as String)
..textFieldSuccessBGInt =
parseColor(json["colors"]["text_field_success_bg"] as String)
parseColor(json["colors"]["text_field_success_bg"] as String)
..textFieldErrorBorderInt =
parseColor(json["colors"]["text_field_error_border"] as String)
parseColor(json["colors"]["text_field_error_border"] as String)
..textFieldSuccessBorderInt =
parseColor(json["colors"]["text_field_success_border"] as String)
parseColor(json["colors"]["text_field_success_border"] as String)
..textFieldActiveSearchIconLeftInt = parseColor(
json["colors"]["text_field_active_search_icon_left"] as String)
..textFieldDefaultSearchIconLeftInt = parseColor(
@ -1725,19 +1725,19 @@ class StackTheme {
..textFieldSuccessSearchIconLeftInt = parseColor(
json["colors"]["text_field_success_search_icon_left"] as String)
..textFieldActiveTextInt =
parseColor(json["colors"]["text_field_active_text"] as String)
parseColor(json["colors"]["text_field_active_text"] as String)
..textFieldDefaultTextInt =
parseColor(json["colors"]["text_field_default_text"] as String)
parseColor(json["colors"]["text_field_default_text"] as String)
..textFieldErrorTextInt =
parseColor(json["colors"]["text_field_error_text"] as String)
parseColor(json["colors"]["text_field_error_text"] as String)
..textFieldSuccessTextInt =
parseColor(json["colors"]["text_field_success_text"] as String)
parseColor(json["colors"]["text_field_success_text"] as String)
..textFieldActiveLabelInt =
parseColor(json["colors"]["text_field_active_label"] as String)
parseColor(json["colors"]["text_field_active_label"] as String)
..textFieldErrorLabelInt =
parseColor(json["colors"]["text_field_error_label"] as String)
parseColor(json["colors"]["text_field_error_label"] as String)
..textFieldSuccessLabelInt =
parseColor(json["colors"]["text_field_success_label"] as String)
parseColor(json["colors"]["text_field_success_label"] as String)
..textFieldActiveSearchIconRightInt = parseColor(
json["colors"]["text_field_active_search_icon_right"] as String)
..textFieldDefaultSearchIconRightInt = parseColor(
@ -1753,61 +1753,61 @@ class StackTheme {
..settingsItem2ActiveSubInt = parseColor(
json["colors"]["settings_item_level_two_active_sub"] as String)
..radioButtonIconBorderInt =
parseColor(json["colors"]["radio_button_icon_border"] as String)
parseColor(json["colors"]["radio_button_icon_border"] as String)
..radioButtonIconBorderDisabledInt = parseColor(
json["colors"]["radio_button_icon_border_disabled"] as String)
..radioButtonBorderEnabledInt =
parseColor(json["colors"]["radio_button_border_enabled"] as String)
parseColor(json["colors"]["radio_button_border_enabled"] as String)
..radioButtonBorderDisabledInt =
parseColor(json["colors"]["radio_button_border_disabled"] as String)
parseColor(json["colors"]["radio_button_border_disabled"] as String)
..radioButtonIconCircleInt =
parseColor(json["colors"]["radio_button_icon_circle"] as String)
parseColor(json["colors"]["radio_button_icon_circle"] as String)
..radioButtonIconEnabledInt =
parseColor(json["colors"]["radio_button_icon_enabled"] as String)
parseColor(json["colors"]["radio_button_icon_enabled"] as String)
..radioButtonTextEnabledInt =
parseColor(json["colors"]["radio_button_text_enabled"] as String)
parseColor(json["colors"]["radio_button_text_enabled"] as String)
..radioButtonTextDisabledInt =
parseColor(json["colors"]["radio_button_text_disabled"] as String)
parseColor(json["colors"]["radio_button_text_disabled"] as String)
..radioButtonLabelEnabledInt =
parseColor(json["colors"]["radio_button_label_enabled"] as String)
parseColor(json["colors"]["radio_button_label_enabled"] as String)
..radioButtonLabelDisabledInt =
parseColor(json["colors"]["radio_button_label_disabled"] as String)
parseColor(json["colors"]["radio_button_label_disabled"] as String)
..infoItemBGInt = parseColor(json["colors"]["info_item_bg"] as String)
..infoItemLabelInt =
parseColor(json["colors"]["info_item_label"] as String)
parseColor(json["colors"]["info_item_label"] as String)
..infoItemTextInt = parseColor(json["colors"]["info_item_text"] as String)
..infoItemIconsInt =
parseColor(json["colors"]["info_item_icons"] as String)
parseColor(json["colors"]["info_item_icons"] as String)
..popupBGInt = parseColor(json["colors"]["popup_bg"] as String)
..currencyListItemBGInt =
parseColor(json["colors"]["currency_list_item_bg"] as String)
parseColor(json["colors"]["currency_list_item_bg"] as String)
..stackWalletBGInt = parseColor(json["colors"]["sw_bg"] as String)
..stackWalletMidInt = parseColor(json["colors"]["sw_mid"] as String)
..stackWalletBottomInt = parseColor(json["colors"]["sw_bottom"] as String)
..bottomNavShadowInt =
parseColor(json["colors"]["bottom_nav_shadow"] as String)
parseColor(json["colors"]["bottom_nav_shadow"] as String)
..splashInt = parseColor(json["colors"]["splash"] as String)
..highlightInt = parseColor(json["colors"]["highlight"] as String)
..warningForegroundInt =
parseColor(json["colors"]["warning_foreground"] as String)
parseColor(json["colors"]["warning_foreground"] as String)
..warningBackgroundInt =
parseColor(json["colors"]["warning_background"] as String)
parseColor(json["colors"]["warning_background"] as String)
..loadingOverlayTextColorInt =
parseColor(json["colors"]["loading_overlay_text_color"] as String)
parseColor(json["colors"]["loading_overlay_text_color"] as String)
..myStackContactIconBGInt =
parseColor(json["colors"]["my_stack_contact_icon_bg"] as String)
parseColor(json["colors"]["my_stack_contact_icon_bg"] as String)
..textConfirmTotalAmountInt =
parseColor(json["colors"]["text_confirm_total_amount"] as String)
parseColor(json["colors"]["text_confirm_total_amount"] as String)
..textSelectedWordTableItemInt =
parseColor(json["colors"]["text_selected_word_table_iterm"] as String)
parseColor(json["colors"]["text_selected_word_table_iterm"] as String)
..favoriteStarActiveInt =
parseColor(json["colors"]["favorite_star_active"] as String)
parseColor(json["colors"]["favorite_star_active"] as String)
..favoriteStarInactiveInt =
parseColor(json["colors"]["favorite_star_inactive"] as String)
parseColor(json["colors"]["favorite_star_inactive"] as String)
..rateTypeToggleColorOnInt =
parseColor(json["colors"]["rate_type_toggle_color_on"] as String)
parseColor(json["colors"]["rate_type_toggle_color_on"] as String)
..rateTypeToggleColorOffInt =
parseColor(json["colors"]["rate_type_toggle_color_off"] as String)
parseColor(json["colors"]["rate_type_toggle_color_off"] as String)
..rateTypeToggleDesktopColorOnInt = parseColor(
json["colors"]["rate_type_toggle_desktop_color_on"] as String)
..rateTypeToggleDesktopColorOffInt = parseColor(
@ -1815,19 +1815,19 @@ class StackTheme {
..ethTagTextInt = parseColor(json["colors"]["eth_tag_text"] as String)
..ethTagBGInt = parseColor(json["colors"]["eth_tag_bg"] as String)
..ethWalletTagTextInt =
parseColor(json["colors"]["eth_wallet_tag_text"] as String)
parseColor(json["colors"]["eth_wallet_tag_text"] as String)
..ethWalletTagBGInt =
parseColor(json["colors"]["eth_wallet_tag_bg"] as String)
parseColor(json["colors"]["eth_wallet_tag_bg"] as String)
..tokenSummaryTextPrimaryInt =
parseColor(json["colors"]["token_summary_text_primary"] as String)
parseColor(json["colors"]["token_summary_text_primary"] as String)
..tokenSummaryTextSecondaryInt =
parseColor(json["colors"]["token_summary_text_secondary"] as String)
parseColor(json["colors"]["token_summary_text_secondary"] as String)
..tokenSummaryBGInt =
parseColor(json["colors"]["token_summary_bg"] as String)
parseColor(json["colors"]["token_summary_bg"] as String)
..tokenSummaryButtonBGInt =
parseColor(json["colors"]["token_summary_button_bg"] as String)
parseColor(json["colors"]["token_summary_button_bg"] as String)
..tokenSummaryIconInt =
parseColor(json["colors"]["token_summary_icon"] as String);
parseColor(json["colors"]["token_summary_icon"] as String);
}
/// Grab the int value of the hex color string.
@ -1840,7 +1840,7 @@ class StackTheme {
} else {
throw ArgumentError(
'"$colorHex" and corresponding int '
'value "$colorValue" is not a valid color.',
'value "$colorValue" is not a valid color.',
);
}
} catch (_) {
@ -2078,18 +2078,18 @@ class ThemeAssetsV2 implements IThemeAssets {
@ignore
Map<Coin, String> get coinIcons => _coinIcons ??= parseCoinAssetsString(
coinIconsString,
placeHolder: coinPlaceholder,
);
coinIconsString,
placeHolder: coinPlaceholder,
);
@ignore
Map<Coin, String>? _coinIcons;
late final String coinIconsString;
@ignore
Map<Coin, String> get coinImages => _coinImages ??= parseCoinAssetsString(
coinImagesString,
placeHolder: coinPlaceholder,
);
coinImagesString,
placeHolder: coinPlaceholder,
);
@ignore
Map<Coin, String>? _coinImages;
late final String coinImagesString;
@ -2164,9 +2164,9 @@ class ThemeAssetsV2 implements IThemeAssets {
}
static Map<Coin, String> parseCoinAssetsString(
String jsonString, {
required String placeHolder,
}) {
String jsonString, {
required String placeHolder,
}) {
final json = jsonDecode(jsonString) as Map;
final map = Map<String, dynamic>.from(json);
@ -2348,18 +2348,18 @@ class ThemeAssetsV3 implements IThemeAssets {
@ignore
Map<Coin, String> get coinIcons => _coinIcons ??= parseCoinAssetsString(
coinIconsString,
placeHolder: coinPlaceholder,
);
coinIconsString,
placeHolder: coinPlaceholder,
);
@ignore
Map<Coin, String>? _coinIcons;
late final String coinIconsString;
@ignore
Map<Coin, String> get coinImages => _coinImages ??= parseCoinAssetsString(
coinImagesString,
placeHolder: coinPlaceholder,
);
coinImagesString,
placeHolder: coinPlaceholder,
);
@ignore
Map<Coin, String>? _coinImages;
late final String coinImagesString;
@ -2379,9 +2379,9 @@ class ThemeAssetsV3 implements IThemeAssets {
_coinCardImages ??= coinCardImagesString == null
? null
: parseCoinAssetsString(
coinCardImagesString!,
placeHolder: coinPlaceholder,
);
coinCardImagesString!,
placeHolder: coinPlaceholder,
);
@ignore
Map<Coin, String>? _coinCardImages;
late final String? coinCardImagesString;
@ -2391,9 +2391,9 @@ class ThemeAssetsV3 implements IThemeAssets {
_coinCardFavoritesImages ??= coinCardFavoritesImagesString == null
? null
: parseCoinAssetsString(
coinCardFavoritesImagesString!,
placeHolder: coinPlaceholder,
);
coinCardFavoritesImagesString!,
placeHolder: coinPlaceholder,
);
@ignore
Map<Coin, String>? _coinCardFavoritesImages;
@Name("otherStringParam1")
@ -2450,15 +2450,15 @@ class ThemeAssetsV3 implements IThemeAssets {
)
..coinCardImagesString = json["coins"]["cards"] is Map
? createCoinAssetsString(
"$themeId/assets",
Map<String, dynamic>.from(json["coins"]["cards"] as Map),
)
"$themeId/assets",
Map<String, dynamic>.from(json["coins"]["cards"] as Map),
)
: null
..coinCardFavoritesImagesString = json["coins"]["favoriteCards"] is Map
? createCoinAssetsString(
"$themeId/assets",
Map<String, dynamic>.from(json["coins"]["favoriteCards"] as Map),
)
"$themeId/assets",
Map<String, dynamic>.from(json["coins"]["favoriteCards"] as Map),
)
: null
..loadingGifRelative = json["loading_gif"] is String
? "$themeId/assets/${json["loading_gif"] as String}"
@ -2499,9 +2499,9 @@ class ThemeAssetsV3 implements IThemeAssets {
}
static Map<Coin, String> parseCoinAssetsString(
String jsonString, {
required String placeHolder,
}) {
String jsonString, {
required String placeHolder,
}) {
final json = jsonDecode(jsonString) as Map;
final map = Map<String, dynamic>.from(json);
@ -2571,4 +2571,4 @@ abstract class IThemeAssets {
String? get loadingGif;
String? get background;
}
}

View file

@ -4,11 +4,12 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:http/http.dart' as http;
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/services/coins/banano/banano_wallet.dart';
import 'package:stackwallet/services/monkey_service.dart';
import 'package:stackwallet/themes/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/assets.dart';
@ -20,6 +21,8 @@ import 'package:stackwallet/widgets/background.dart';
import 'package:stackwallet/widgets/conditional_parent.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
@ -44,75 +47,14 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
late final String walletId;
List<int>? imageBytes;
String receivingAddress = "";
Future<void> getMonkeyImage(String address) async {
if (address.isEmpty) {
//address shouldn't be empty
return;
}
final http.Response response = await http
.get(Uri.parse('https://monkey.banano.cc/api/v1/monkey/$address'));
if (response.statusCode == 200) {
final manager =
ref.read(walletsChangeNotifierProvider).getManager(walletId);
final decodedResponse = response.bodyBytes;
await (manager.wallet as BananoWallet)
.updateMonkeyImageBytes(decodedResponse);
} else {
throw Exception("Failed to get MonKey");
}
Future<void> _updateWalletMonKey(Uint8List monKeyBytes) async {
final manager =
ref.read(walletsChangeNotifierProvider).getManager(walletId);
await (manager.wallet as BananoWallet)
.updateMonkeyImageBytes(monKeyBytes.toList());
}
// void getMonkeySVG(String address) async {
// if (address.isEmpty) {
// //address shouldn't be empty
// return;
// }
//
// final http.Response response = await http
// .get(Uri.parse('https://monkey.banano.cc/api/v1/monkey/$address'));
//
// if (response.statusCode == 200) {
// final decodedResponse = response.bodyBytes;
// Directory directory = await getApplicationDocumentsDirectory();
// late Directory sampleFolder;
//
// if (Platform.isAndroid) {
// directory = Directory("/storage/emulated/0/");
// sampleFolder = Directory('${directory!.path}Documents');
// } else if (Platform.isIOS) {
// sampleFolder = Directory(directory!.path);
// } else if (Platform.isLinux) {
// sampleFolder = Directory('${directory!.path}Documents');
// } else if (Platform.isWindows) {
// sampleFolder = Directory('${directory!.path}Documents');
// } else if (Platform.isMacOS) {
// sampleFolder = Directory('${directory!.path}Documents');
// }
//
// try {
// if (!sampleFolder.existsSync()) {
// sampleFolder.createSync(recursive: true);
// }
// } catch (e, s) {
// // todo: come back to this
// debugPrint("$e $s");
// }
//
// final docPath = sampleFolder.path;
// final filePath = "$docPath/monkey.svg";
//
// File imgFile = File(filePath);
// await imgFile.writeAsBytes(decodedResponse);
// } else {
// throw Exception("Failed to get MonKey");
// }
// }
Future<Directory?> getDocsDir() async {
Future<Directory?> _getDocsDir() async {
try {
if (Platform.isAndroid) {
return Directory("/storage/emulated/0/Documents");
@ -124,80 +66,48 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
}
}
Future<void> downloadMonkey(String address, bool isPNG) async {
if (address.isEmpty) {
//address shouldn't be empty
return;
String _monkeyPath = "";
Future<void> _saveMonKeyToFile({
required Uint8List bytes,
bool isPNG = false,
bool overwrite = false,
}) async {
if (Platform.isAndroid) {
await Permission.storage.request();
}
String url = "https://monkey.banano.cc/api/v1/monkey/$address";
if (isPNG) {
url += '?format=png&size=512&background=false';
final dir = await _getDocsDir();
if (dir == null) {
throw Exception("Failed to get documents directory to save monKey image");
}
final http.Response response = await http.get(Uri.parse(url));
final address = await ref
.read(walletsChangeNotifierProvider)
.getManager(walletId)
.currentReceivingAddress;
final docPath = dir.path;
String filePath = "$docPath/monkey_$address";
if (response.statusCode == 200) {
if (Platform.isAndroid) {
await Permission.storage.request();
}
filePath += isPNG ? ".png" : ".svg";
final decodedResponse = response.bodyBytes;
final Directory? sampleFolder = await getDocsDir();
File imgFile = File(filePath);
print("PATH: ${sampleFolder?.path}");
if (sampleFolder == null) {
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
return;
}
// try {
// if (!sampleFolder.existsSync()) {
// sampleFolder.createSync(recursive: true);
// }
// } catch (e, s) {
// // todo: come back to this
// debugPrint("$e $s");
// }
final docPath = sampleFolder.path;
String filePath = "$docPath/monkey_$address";
filePath += isPNG ? ".png" : ".svg";
// todo check if monkey.png exists
File imgFile = File(filePath);
await imgFile.writeAsBytes(decodedResponse);
} else {
throw Exception("Failed to get MonKey");
if (imgFile.existsSync() && !overwrite) {
throw Exception("File already exists");
}
await imgFile.writeAsBytes(bytes);
_monkeyPath = filePath;
}
@override
void initState() {
walletId = widget.walletId;
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final address = await ref
.read(walletsChangeNotifierProvider)
.getManager(walletId)
.currentReceivingAddress;
setState(() {
receivingAddress = address;
});
});
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
final manager = ref.watch(walletsChangeNotifierProvider
@ -208,7 +118,6 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
imageBytes ??= (manager.wallet as BananoWallet).getMonkeyImageBytes();
//edit for desktop
return Background(
child: ConditionalParent(
condition: isDesktop,
@ -235,64 +144,116 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
.extension<StackColors>()!
.topNavIconPrimary,
),
onPressed: () {
if (mounted) {
Navigator.of(context).pop();
}
},
onPressed: Navigator.of(context).pop,
),
const SizedBox(
width: 15,
),
SvgPicture.asset(Assets.svg.monkey),
SvgPicture.asset(
Assets.svg.monkey,
width: 32,
height: 32,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
const SizedBox(
width: 12,
),
Text(
"MonKey",
style: STextStyles.navBarTitle(context),
style: STextStyles.desktopH3(context),
),
],
),
),
trailing: Padding(
padding: const EdgeInsets.all(8.0),
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const StackDialog(
title: "About MonKeys",
message:
"A MonKey is a visual representation of your Banano address.",
);
});
},
child: Row(
children: [
SvgPicture.asset(
Assets.svg.circleQuestion,
color: Colors.blue[800],
),
const SizedBox(
width: 6,
),
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
"What is MonKey?",
style: STextStyles.desktopTextSmall(context).copyWith(
color: Colors.blue[800],
trailing: RawMaterialButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(1000),
),
onPressed: () {
showDialog<void>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return DesktopDialog(
maxHeight: double.infinity,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 32),
child: Text(
"About MonKeys",
style: STextStyles.desktopH3(context),
),
),
const DesktopDialogCloseButton(),
],
),
),
Text(
"A MonKey is a visual representation of your Banano address.",
style:
STextStyles.desktopTextMedium(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(
32,
),
child: PrimaryButton(
width: 272.5,
label: "OK",
onPressed: () {
Navigator.of(context).pop();
},
),
),
],
),
],
),
],
),
);
},
);
},
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 19,
horizontal: 32,
),
child: Row(
children: [
SvgPicture.asset(
Assets.svg.circleQuestion,
width: 20,
height: 20,
color: Theme.of(context)
.extension<StackColors>()!
.customTextButtonEnabledText,
),
const SizedBox(
width: 8,
),
Text(
"What is MonKey?",
style:
STextStyles.desktopMenuItemSelected(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.customTextButtonEnabledText,
),
)
],
),
),
),
@ -318,22 +279,24 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
AspectRatio(
aspectRatio: 1,
child: AppBarIconButton(
icon: SvgPicture.asset(
Assets.svg.circleQuestion,
),
onPressed: () {
showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const StackOkDialog(
title: "About MonKeys",
message:
"A MonKey is a visual representation of your Banano address.",
);
});
}),
icon: SvgPicture.asset(
Assets.svg.circleQuestion,
),
onPressed: () {
showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const StackOkDialog(
title: "About MonKeys",
message:
"A MonKey is a visual representation of your Banano address.",
);
},
);
},
),
),
],
),
@ -376,26 +339,97 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
SecondaryButton(
label: "Save as SVG",
onPressed: () async {
bool didError = false;
await showLoading(
whileFuture:
downloadMonkey(receivingAddress, false),
whileFuture: Future.wait([
_saveMonKeyToFile(
bytes: Uint8List.fromList(
(manager.wallet as BananoWallet)
.getMonkeyImageBytes()!),
),
Future<void>.delayed(
const Duration(seconds: 2),
),
]),
context: context,
isDesktop: Util.isDesktop,
message: "Saving MonKey svg",
onException: (e) {
didError = true;
String msg = e.toString();
while (msg.isNotEmpty &&
msg.startsWith("Exception:")) {
msg = msg.substring(10).trim();
}
showFloatingFlushBar(
type: FlushBarType.warning,
message: msg,
context: context,
);
},
);
if (!didError && mounted) {
await showFloatingFlushBar(
type: FlushBarType.success,
message:
"SVG MonKey image saved to $_monkeyPath",
context: context,
);
}
},
),
const SizedBox(height: 12),
SecondaryButton(
label: "Download as PNG",
onPressed: () async {
bool didError = false;
await showLoading(
whileFuture:
downloadMonkey(receivingAddress, true),
whileFuture: Future.wait([
manager.currentReceivingAddress.then(
(address) async => await ref
.read(pMonKeyService)
.fetchMonKey(
address: address,
png: true,
)
.then(
(monKeyBytes) async =>
await _saveMonKeyToFile(
bytes: monKeyBytes,
isPNG: true,
),
),
),
Future<void>.delayed(
const Duration(seconds: 2)),
]),
context: context,
isDesktop: Util.isDesktop,
message: "Downloading MonKey png",
onException: (e) {
didError = true;
String msg = e.toString();
while (msg.isNotEmpty &&
msg.startsWith("Exception:")) {
msg = msg.substring(10).trim();
}
showFloatingFlushBar(
type: FlushBarType.warning,
message: msg,
context: context,
);
},
);
if (!didError && mounted) {
await showFloatingFlushBar(
type: FlushBarType.success,
message:
"PNG MonKey image saved to $_monkeyPath",
context: context,
);
}
},
),
],
@ -453,17 +487,37 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
child: PrimaryButton(
label: "Fetch MonKey",
onPressed: () async {
final future = Future.wait([
getMonkeyImage(receivingAddress),
Future<void>.delayed(const Duration(seconds: 2)),
]);
await showLoading(
whileFuture: future,
whileFuture: Future.wait([
manager.currentReceivingAddress.then(
(address) async => await ref
.read(pMonKeyService)
.fetchMonKey(address: address)
.then(
(monKeyBytes) async =>
await _updateWalletMonKey(
monKeyBytes,
),
),
),
Future<void>.delayed(const Duration(seconds: 2)),
]),
context: context,
isDesktop: Util.isDesktop,
message: "Fetching MonKey",
subMessage: "We are fetching your MonKey",
onException: (e) {
String msg = e.toString();
while (msg.isNotEmpty &&
msg.startsWith("Exception:")) {
msg = msg.substring(10).trim();
}
showFloatingFlushBar(
type: FlushBarType.warning,
message: msg,
context: context,
);
},
);
imageBytes = (manager.wallet as BananoWallet)
@ -472,17 +526,6 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
if (imageBytes != null) {
setState(() {});
}
// if (isDesktop) {
// Navigator.of(context).popUntil(
// ModalRoute.withName(
// DesktopWalletView.routeName),
// );
// } else {
// Navigator.of(context).popUntil(
// ModalRoute.withName(WalletView.routeName),
// );
// }
},
),
),

View file

@ -1,21 +1,32 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:http/http.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
import 'package:stackwallet/models/isar/ordinal.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/ordinals/widgets/dialogs.dart';
import 'package:stackwallet/providers/db/main_db_provider.dart';
import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/amount/amount_formatter.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/show_loading.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/widgets/background.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class OrdinalDetailsView extends StatefulWidget {
class OrdinalDetailsView extends ConsumerStatefulWidget {
const OrdinalDetailsView({
Key? key,
required this.walletId,
@ -28,14 +39,25 @@ class OrdinalDetailsView extends StatefulWidget {
static const routeName = "/ordinalDetailsView";
@override
State<OrdinalDetailsView> createState() => _OrdinalDetailsViewState();
ConsumerState<OrdinalDetailsView> createState() => _OrdinalDetailsViewState();
}
class _OrdinalDetailsViewState extends State<OrdinalDetailsView> {
class _OrdinalDetailsViewState extends ConsumerState<OrdinalDetailsView> {
static const _spacing = 12.0;
late final UTXO? utxo;
@override
void initState() {
utxo = widget.ordinal.getUTXO(ref.read(mainDBProvider));
super.initState();
}
@override
Widget build(BuildContext context) {
final coin = ref.watch(walletsChangeNotifierProvider
.select((value) => value.getManager(widget.walletId).coin));
return Background(
child: SafeArea(
child: Scaffold(
@ -73,26 +95,33 @@ class _OrdinalDetailsViewState extends State<OrdinalDetailsView> {
height: _spacing,
),
_DetailsItemWCopy(
title: "ID",
title: "Inscription ID",
data: widget.ordinal.inscriptionId,
),
// const SizedBox(
// height: _spacing,
// ),
// // todo: add utxo status
const SizedBox(
height: _spacing,
),
// todo: add utxo status
const SizedBox(
height: _spacing,
),
const _DetailsItemWCopy(
_DetailsItemWCopy(
title: "Amount",
data: "TODO", // TODO infer from utxo utxoTXID:utxoVOUT
data: utxo == null
? "ERROR"
: ref.watch(pAmountFormatter(coin)).format(
Amount(
rawValue: BigInt.from(utxo!.value),
fractionDigits: coin.decimals,
),
),
),
const SizedBox(
height: _spacing,
),
const _DetailsItemWCopy(
_DetailsItemWCopy(
title: "Owner address",
data: "TODO", // infer from address associated w utxoTXID
data: utxo?.address ?? "ERROR",
),
const SizedBox(
height: _spacing,
@ -150,11 +179,27 @@ class _DetailsItemWCopy extends StatelessWidget {
);
}
},
child: SvgPicture.asset(
Assets.svg.copy,
color:
Theme.of(context).extension<StackColors>()!.infoItemIcons,
width: 12,
child: Row(
children: [
SvgPicture.asset(
Assets.svg.copy,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
width: 12,
),
const SizedBox(
width: 6,
),
Text(
"Copy",
style: STextStyles.infoSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
],
),
),
],
@ -184,6 +229,37 @@ class _OrdinalImageGroup extends StatelessWidget {
static const _spacing = 12.0;
Future<String> _savePngToFile() async {
final response = await get(Uri.parse(ordinal.content));
if (response.statusCode != 200) {
throw Exception(
"statusCode=${response.statusCode} body=${response.bodyBytes}");
}
final bytes = response.bodyBytes;
if (Platform.isAndroid) {
await Permission.storage.request();
}
final dir = Platform.isAndroid
? Directory("/storage/emulated/0/Documents")
: await getApplicationDocumentsDirectory();
final docPath = dir.path;
final filePath = "$docPath/ordinal_${ordinal.inscriptionNumber}.png";
File imgFile = File(filePath);
if (imgFile.existsSync()) {
throw Exception("File already exists");
}
await imgFile.writeAsBytes(bytes);
return filePath;
}
@override
Widget build(BuildContext context) {
return Column(
@ -197,15 +273,20 @@ class _OrdinalImageGroup extends StatelessWidget {
// const SizedBox(
// height: _spacing,
// ),
AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.transparent,
child: Image.network(
ordinal.content, // Use the preview URL as the image source
fit: BoxFit.cover,
filterQuality:
FilterQuality.none, // Set the filter mode to nearest
ClipRRect(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.transparent,
child: Image.network(
ordinal.content, // Use the preview URL as the image source
fit: BoxFit.cover,
filterQuality:
FilterQuality.none, // Set the filter mode to nearest
),
),
),
),
@ -227,8 +308,34 @@ class _OrdinalImageGroup extends StatelessWidget {
),
buttonHeight: ButtonHeight.l,
iconSpacing: 4,
onPressed: () {
// TODO: save and download image to device
onPressed: () async {
bool didError = false;
final filePath = await showLoading<String>(
whileFuture: _savePngToFile(),
context: context,
isDesktop: true,
message: "Saving ordinal image",
onException: (e) {
didError = true;
String msg = e.toString();
while (msg.isNotEmpty && msg.startsWith("Exception:")) {
msg = msg.substring(10).trim();
}
showFloatingFlushBar(
type: FlushBarType.warning,
message: msg,
context: context,
);
},
);
if (!didError && context.mounted) {
await showFloatingFlushBar(
type: FlushBarType.success,
message: "Image saved to $filePath",
context: context,
);
}
},
),
),

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -196,6 +196,10 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
case Coin.nano:
case Coin.banano:
case Coin.stellar:
case Coin.stellarTestnet:
throw UnimplementedError();
//TODO: check network/node
case Coin.tezos:
//TODO: check network/node
}
@ -728,7 +732,6 @@ class _NodeFormState extends ConsumerState<NodeForm> {
case Coin.namecoin:
case Coin.bitcoincash:
case Coin.particl:
case Coin.tezos:
case Coin.bitcoinTestNet:
case Coin.litecoinTestNet:
case Coin.bitcoincashTestnet:

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -173,7 +173,10 @@ class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
case Coin.nano:
case Coin.banano:
case Coin.tezos:
//TODO: check network/node
case Coin.stellar:
case Coin.stellarTestnet:
throw UnimplementedError();
//TODO: check network/node
}
if (testPassed) {

View file

@ -927,22 +927,23 @@ class _WalletViewState extends ConsumerState<WalletView> {
);
},
),
WalletNavigationBarItemData(
icon: SvgPicture.asset(
Assets.svg.monkey,
height: 20,
width: 20,
color: Theme.of(context)
.extension<StackColors>()!
.bottomNavIconIcon,
),
label: "MonKey",
onTap: () {
Navigator.of(context).pushNamed(
MonkeyView.routeName,
arguments: widget.walletId,
);
}),
if (coin == Coin.banano)
WalletNavigationBarItemData(
icon: SvgPicture.asset(
Assets.svg.monkey,
height: 20,
width: 20,
color: Theme.of(context)
.extension<StackColors>()!
.bottomNavIconIcon,
),
label: "MonKey",
onTap: () {
Navigator.of(context).pushNamed(
MonkeyView.routeName,
arguments: widget.walletId,
);
}),
if (ref.watch(
walletsChangeNotifierProvider.select(
(value) => value

View file

@ -10,6 +10,7 @@
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
@ -28,6 +29,7 @@ import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub
import 'package:stackwallet/providers/global/auto_swb_service_provider.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
import 'package:stackwallet/services/coins/banano/banano_wallet.dart';
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
import 'package:stackwallet/themes/coin_icon_provider.dart';
@ -153,6 +155,10 @@ class _DesktopWalletViewState extends ConsumerState<DesktopWalletView> {
final managerProvider = ref.watch(walletsChangeNotifierProvider
.select((value) => value.getManagerProvider(widget.walletId)));
final monke = coin == Coin.banano
? (manager.wallet as BananoWallet).getMonkeyImageBytes()
: null;
return ConditionalParent(
condition: _rescanningOnOpen,
builder: (child) {
@ -334,13 +340,20 @@ class _DesktopWalletViewState extends ConsumerState<DesktopWalletView> {
padding: const EdgeInsets.all(20),
child: Row(
children: [
SvgPicture.file(
File(
ref.watch(coinIconProvider(coin)),
if (monke != null)
SvgPicture.memory(
Uint8List.fromList(monke!),
width: 60,
height: 60,
),
if (monke == null)
SvgPicture.file(
File(
ref.watch(coinIconProvider(coin)),
),
width: 40,
height: 40,
),
width: 40,
height: 40,
),
const SizedBox(
width: 10,
),

View file

@ -354,7 +354,7 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
manager.coin == Coin.firoTestNet ||
manager.hasWhirlpoolSupport ||
manager.coin == Coin.banano ||
manager.hasWhirlpoolSupport;
manager.hasOrdinalsSupport;
return Row(
children: [
if (Constants.enableExchange)

View file

@ -1,12 +1,15 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:http/http.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
import 'package:stackwallet/models/isar/ordinal.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart';
import 'package:stackwallet/providers/db/main_db_provider.dart';
import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
@ -15,10 +18,12 @@ import 'package:stackwallet/utilities/amount/amount_formatter.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/show_loading.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class DesktopOrdinalDetailsView extends ConsumerStatefulWidget {
@ -44,6 +49,37 @@ class _DesktopOrdinalDetailsViewState
late final UTXO? utxo;
Future<String> _savePngToFile() async {
final response = await get(Uri.parse(widget.ordinal.content));
if (response.statusCode != 200) {
throw Exception(
"statusCode=${response.statusCode} body=${response.bodyBytes}");
}
final bytes = response.bodyBytes;
if (Platform.isAndroid) {
await Permission.storage.request();
}
final dir = Platform.isAndroid
? Directory("/storage/emulated/0/Documents")
: await getApplicationDocumentsDirectory();
final docPath = dir.path;
final filePath = "$docPath/ordinal_${widget.ordinal.inscriptionNumber}.png";
File imgFile = File(filePath);
if (imgFile.existsSync()) {
throw Exception("File already exists");
}
await imgFile.writeAsBytes(bytes);
return filePath;
}
@override
void initState() {
utxo = widget.ordinal.getUTXO(ref.read(mainDBProvider));
@ -137,7 +173,7 @@ class _DesktopOrdinalDetailsViewState
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
SelectableText(
"INSC. ${widget.ordinal.inscriptionNumber}",
style: STextStyles.w600_20(context),
),
@ -174,74 +210,98 @@ class _DesktopOrdinalDetailsViewState
// const SizedBox(
// width: 16,
// ),
// SecondaryButton(
// width: 150,
// label: "Download",
// icon: SvgPicture.asset(
// Assets.svg.arrowDown,
// width: 13,
// height: 18,
// color: Theme.of(context)
// .extension<StackColors>()!
// .buttonTextSecondary,
// ),
// buttonHeight: ButtonHeight.l,
// iconSpacing: 8,
// onPressed: () {
// // TODO: save and download image to device
// },
// ),
SecondaryButton(
width: 150,
label: "Download",
icon: SvgPicture.asset(
Assets.svg.arrowDown,
width: 13,
height: 18,
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
buttonHeight: ButtonHeight.l,
iconSpacing: 8,
onPressed: () async {
bool didError = false;
final path = await showLoading<String>(
whileFuture: _savePngToFile(),
context: context,
isDesktop: true,
message: "Saving ordinal image",
onException: (e) {
didError = true;
String msg = e.toString();
while (msg.isNotEmpty &&
msg.startsWith("Exception:")) {
msg = msg.substring(10).trim();
}
showFloatingFlushBar(
type: FlushBarType.warning,
message: msg,
context: context,
);
},
);
if (!didError && mounted) {
await showFloatingFlushBar(
type: FlushBarType.success,
message: "Image saved to $path",
context: context,
);
}
},
),
],
),
),
const SizedBox(
height: 16,
),
_DetailsItemWCopy(
title: "Inscription number",
data: widget.ordinal.inscriptionNumber.toString(),
),
const SizedBox(
height: _spacing,
),
_DetailsItemWCopy(
title: "Inscription ID",
data: widget.ordinal.inscriptionId,
),
const SizedBox(
height: _spacing,
),
// todo: add utxo status
const SizedBox(
height: _spacing,
),
_DetailsItemWCopy(
title: "Amount",
data: utxo == null
? "ERROR"
: ref.watch(pAmountFormatter(coin)).format(
Amount(
rawValue: BigInt.from(utxo!.value),
fractionDigits: coin.decimals,
),
),
),
const SizedBox(
height: _spacing,
),
_DetailsItemWCopy(
title: "Owner address",
data: utxo?.address ?? "ERROR",
),
const SizedBox(
height: _spacing,
),
_DetailsItemWCopy(
title: "Transaction ID",
data: widget.ordinal.utxoTXID,
),
const SizedBox(
height: _spacing,
RoundedWhiteContainer(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_DetailsItemWCopy(
title: "Inscription number",
data: widget.ordinal.inscriptionNumber.toString(),
),
const _Divider(),
_DetailsItemWCopy(
title: "Inscription ID",
data: widget.ordinal.inscriptionId,
),
// const SizedBox(
// height: _spacing,
// ),
// // todo: add utxo status
const _Divider(),
_DetailsItemWCopy(
title: "Amount",
data: utxo == null
? "ERROR"
: ref.watch(pAmountFormatter(coin)).format(
Amount(
rawValue: BigInt.from(utxo!.value),
fractionDigits: coin.decimals,
),
),
),
const _Divider(),
_DetailsItemWCopy(
title: "Owner address",
data: utxo?.address ?? "ERROR",
),
const _Divider(),
_DetailsItemWCopy(
title: "Transaction ID",
data: widget.ordinal.utxoTXID,
),
],
),
),
],
),
@ -255,6 +315,23 @@ class _DesktopOrdinalDetailsViewState
}
}
class _Divider extends StatelessWidget {
const _Divider({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(
vertical: 16,
),
child: Container(
height: 1,
color: Theme.of(context).extension<StackColors>()!.backgroundAppBar,
),
);
}
}
class _DetailsItemWCopy extends StatelessWidget {
const _DetailsItemWCopy({
Key? key,
@ -267,48 +344,29 @@ class _DetailsItemWCopy extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RoundedWhiteContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: STextStyles.itemSubtitle(context),
),
GestureDetector(
onTap: () async {
await Clipboard.setData(ClipboardData(text: data));
if (context.mounted) {
unawaited(
showFloatingFlushBar(
type: FlushBarType.info,
message: "Copied to clipboard",
context: context,
),
);
}
},
child: SvgPicture.asset(
Assets.svg.copy,
color:
Theme.of(context).extension<StackColors>()!.infoItemIcons,
width: 12,
),
),
],
),
const SizedBox(
height: 4,
),
SelectableText(
data,
style: STextStyles.itemSubtitle12(context),
),
],
),
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: STextStyles.itemSubtitle(context),
),
IconCopyButton(
data: data,
),
],
),
const SizedBox(
height: 4,
),
SelectableText(
data,
style: STextStyles.itemSubtitle12(context),
),
],
);
}
}

View file

@ -16,17 +16,12 @@ import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/mixins/ordinals_interface.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/show_loading.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
import 'package:stackwallet/widgets/textfield_icon_button.dart';
class DesktopOrdinalsView extends ConsumerStatefulWidget {
const DesktopOrdinalsView({
@ -102,6 +97,8 @@ class _DesktopOrdinals extends ConsumerState<DesktopOrdinalsView> {
Assets.svg.ordinal,
width: 32,
height: 32,
color:
Theme.of(context).extension<StackColors>()!.textSubtitle1,
),
const SizedBox(
width: 12,

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -27,6 +27,7 @@ import 'package:stackwallet/services/coins/monero/monero_wallet.dart';
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
import 'package:stackwallet/services/coins/nano/nano_wallet.dart';
import 'package:stackwallet/services/coins/particl/particl_wallet.dart';
import 'package:stackwallet/services/coins/stellar/stellar_wallet.dart';
import 'package:stackwallet/services/coins/tezos/tezos_wallet.dart';
import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart';
import 'package:stackwallet/services/transaction_notification_tracker.dart';
@ -219,6 +220,15 @@ abstract class CoinServiceAPI {
cachedClient: cachedClient,
tracker: tracker);
case Coin.stellar:
return StellarWallet(
walletId: walletId,
walletName: walletName,
coin: coin,
secureStore: secureStorageInterface,
tracker: tracker,
);
case Coin.tezos:
return TezosWallet(
walletId: walletId,

View file

@ -0,0 +1,809 @@
import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:isar/isar.dart';
import 'package:stackwallet/db/isar/main_db.dart';
import 'package:stackwallet/models/balance.dart' as SWBalance;
import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'
as SWAddress;
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'
as SWTransaction;
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
import 'package:stackwallet/models/node_model.dart';
import 'package:stackwallet/models/paymint/fee_object_model.dart';
import 'package:stackwallet/services/coins/coin_service.dart';
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart';
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
import 'package:stackwallet/services/mixins/wallet_cache.dart';
import 'package:stackwallet/services/mixins/wallet_db.dart';
import 'package:stackwallet/services/node_service.dart';
import 'package:stackwallet/services/transaction_notification_tracker.dart';
import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/default_nodes.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
import 'package:stellar_flutter_sdk/stellar_flutter_sdk.dart';
import 'package:tuple/tuple.dart';
const int MINIMUM_CONFIRMATIONS = 1;
class StellarWallet extends CoinServiceAPI with WalletCache, WalletDB {
late StellarSDK stellarSdk;
late Network stellarNetwork;
StellarWallet({
required String walletId,
required String walletName,
required Coin coin,
required TransactionNotificationTracker tracker,
required SecureStorageInterface secureStore,
MainDB? mockableOverride,
}) {
txTracker = tracker;
_walletId = walletId;
_walletName = walletName;
_coin = coin;
_secureStore = secureStore;
initCache(walletId, coin);
initWalletDB(mockableOverride: mockableOverride);
if (coin.name == "stellarTestnet") {
stellarSdk = StellarSDK.TESTNET;
stellarNetwork = Network.TESTNET;
} else {
stellarSdk = StellarSDK.PUBLIC;
stellarNetwork = Network.PUBLIC;
}
}
late final TransactionNotificationTracker txTracker;
late SecureStorageInterface _secureStore;
// final StellarSDK stellarSdk = StellarSDK.PUBLIC;
@override
bool get isFavorite => _isFavorite ??= getCachedIsFavorite();
bool? _isFavorite;
@override
set isFavorite(bool isFavorite) {
_isFavorite = isFavorite;
updateCachedIsFavorite(isFavorite);
}
@override
bool get shouldAutoSync => _shouldAutoSync;
bool _shouldAutoSync = true;
Timer? timer;
final _prefs = Prefs.instance;
@override
set shouldAutoSync(bool shouldAutoSync) {
if (_shouldAutoSync != shouldAutoSync) {
_shouldAutoSync = shouldAutoSync;
if (!shouldAutoSync) {
timer?.cancel();
timer = null;
stopNetworkAlivePinging();
} else {
startNetworkAlivePinging();
refresh();
}
}
}
Timer? _networkAliveTimer;
void startNetworkAlivePinging() {
// call once on start right away
_periodicPingCheck();
// then periodically check
_networkAliveTimer = Timer.periodic(
Constants.networkAliveTimerDuration,
(_) async {
_periodicPingCheck();
},
);
}
void stopNetworkAlivePinging() {
_networkAliveTimer?.cancel();
_networkAliveTimer = null;
}
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance.fire(
NodeConnectionStatusChangedEvent(
status,
walletId,
coin,
),
);
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}
@override
String get walletName => _walletName;
late String _walletName;
@override
set walletName(String name) => _walletName = name;
@override
SWBalance.Balance get balance => _balance ??= getCachedBalance();
SWBalance.Balance? _balance;
@override
Coin get coin => _coin;
late Coin _coin;
Future<bool> _accountExists(String accountId) async {
bool exists = false;
try {
AccountResponse receiverAccount =
await stellarSdk.accounts.account(accountId);
if (receiverAccount.accountId != "") {
exists = true;
}
} catch (e, s) {
Logging.instance.log(
"Error getting account ${e.toString()} - ${s.toString()}",
level: LogLevel.Error);
}
return exists;
}
@override
Future<String> confirmSend({required Map<String, dynamic> txData}) async {
final secretSeed = await _secureStore.read(key: '${_walletId}_secretSeed');
KeyPair senderKeyPair = KeyPair.fromSecretSeed(secretSeed!);
AccountResponse sender =
await stellarSdk.accounts.account(senderKeyPair.accountId);
final amountToSend = txData['recipientAmt'] as Amount;
//First check if account exists, can be skipped, but if the account does not exist,
// the transaction fee will be charged when the transaction fails.
bool validAccount = await _accountExists(txData['address'] as String);
Transaction transaction;
if (!validAccount) {
//Fund the account, user must ensure account is correct
CreateAccountOperationBuilder createAccBuilder =
CreateAccountOperationBuilder(
txData['address'] as String, amountToSend.decimal.toString());
transaction = TransactionBuilder(sender)
.addOperation(createAccBuilder.build())
.build();
} else {
transaction = TransactionBuilder(sender)
.addOperation(PaymentOperationBuilder(txData['address'] as String,
Asset.NATIVE, amountToSend.decimal.toString())
.build())
.build();
}
transaction.sign(senderKeyPair, stellarNetwork);
try {
SubmitTransactionResponse response =
await stellarSdk.submitTransaction(transaction);
if (!response.success) {
throw ("Unable to send transaction");
}
return response.hash!;
} catch (e, s) {
Logging.instance.log("Error sending TX $e - $s", level: LogLevel.Error);
rethrow;
}
}
Future<SWAddress.Address?> get _currentReceivingAddress => db
.getAddresses(walletId)
.filter()
.typeEqualTo(SWAddress.AddressType.unknown)
.and()
.subTypeEqualTo(SWAddress.AddressSubType.unknown)
.sortByDerivationIndexDesc()
.findFirst();
@override
Future<String> get currentReceivingAddress async =>
(await _currentReceivingAddress)?.value ?? await getAddressSW();
Future<int> getBaseFee() async {
// final nodeURI = Uri.parse("${getCurrentNode().host}:${getCurrentNode().port}");
final nodeURI = Uri.parse(getCurrentNode().host);
final httpClient = http.Client();
FeeStatsResponse fsp =
await FeeStatsRequestBuilder(httpClient, nodeURI).execute();
return int.parse(fsp.lastLedgerBaseFee);
}
@override
Future<Amount> estimateFeeFor(Amount amount, int feeRate) async {
var baseFee = await getBaseFee();
int fee = 100;
switch (feeRate) {
case 0:
fee = baseFee * 10;
case 1:
case 2:
fee = baseFee * 50;
case 3:
fee = baseFee * 100;
case 4:
fee = baseFee * 200;
default:
fee = baseFee * 50;
}
return Amount(rawValue: BigInt.from(fee), fractionDigits: coin.decimals);
}
@override
Future<void> exit() async {
_hasCalledExit = true;
timer?.cancel();
timer = null;
stopNetworkAlivePinging();
}
NodeModel? _xlmNode;
NodeModel getCurrentNode() {
if (_xlmNode != null) {
return _xlmNode!;
} else if (NodeService(secureStorageInterface: _secureStore)
.getPrimaryNodeFor(coin: coin) !=
null) {
return NodeService(secureStorageInterface: _secureStore)
.getPrimaryNodeFor(coin: coin)!;
} else {
return DefaultNodes.getNodeFor(coin);
}
}
@override
Future<FeeObject> get fees async {
// final nodeURI = Uri.parse("${getCurrentNode().host}:${getCurrentNode().port}");
final nodeURI = Uri.parse(getCurrentNode().host);
final httpClient = http.Client();
FeeStatsResponse fsp =
await FeeStatsRequestBuilder(httpClient, nodeURI).execute();
return FeeObject(
numberOfBlocksFast: 0,
numberOfBlocksAverage: 0,
numberOfBlocksSlow: 0,
fast: int.parse(fsp.lastLedgerBaseFee) * 100,
medium: int.parse(fsp.lastLedgerBaseFee) * 50,
slow: int.parse(fsp.lastLedgerBaseFee) * 10);
}
@override
Future<void> fullRescan(
int maxUnusedAddressGap, int maxNumberOfIndexesToCheck) async {
await _prefs.init();
await updateTransactions();
await updateChainHeight();
await updateBalance();
}
@override
Future<bool> generateNewAddress() {
// TODO: implement generateNewAddress
throw UnimplementedError();
}
@override
bool get hasCalledExit => _hasCalledExit;
bool _hasCalledExit = false;
@override
Future<void> initializeExisting() async {
await _prefs.init();
}
@override
Future<void> initializeNew() async {
if ((await mnemonicString) != null || (await mnemonicPassphrase) != null) {
throw Exception(
"Attempted to overwrite mnemonic on generate new wallet!");
}
await _prefs.init();
String mnemonic = await Wallet.generate24WordsMnemonic();
await _secureStore.write(key: '${_walletId}_mnemonic', value: mnemonic);
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
Wallet wallet = await Wallet.from(mnemonic);
KeyPair keyPair = await wallet.getKeyPair(index: 0);
String address = keyPair.accountId;
String secretSeed =
keyPair.secretSeed; //This will be required for sending a tx
await _secureStore.write(key: '${_walletId}_secretSeed', value: secretSeed);
final swAddress = SWAddress.Address(
walletId: walletId,
value: address,
publicKey: keyPair.publicKey,
derivationIndex: 0,
derivationPath: null,
type: SWAddress.AddressType.unknown, // TODO: set type
subType: SWAddress.AddressSubType.unknown);
await db.putAddress(swAddress);
await Future.wait(
[updateCachedId(walletId), updateCachedIsFavorite(false)]);
}
Future<String> getAddressSW() async {
var mnemonic = await _secureStore.read(key: '${_walletId}_mnemonic');
Wallet wallet = await Wallet.from(mnemonic!);
KeyPair keyPair = await wallet.getKeyPair(index: 0);
return Future.value(keyPair.accountId);
}
@override
bool get isConnected => _isConnected;
bool _isConnected = false;
@override
bool get isRefreshing => refreshMutex;
bool refreshMutex = false;
@override
// TODO: implement maxFee
Future<int> get maxFee => throw UnimplementedError();
@override
Future<List<String>> get mnemonic =>
mnemonicString.then((value) => value!.split(" "));
@override
Future<String?> get mnemonicPassphrase =>
_secureStore.read(key: '${_walletId}_mnemonicPassphrase');
@override
Future<String?> get mnemonicString =>
_secureStore.read(key: '${_walletId}_mnemonic');
@override
Future<Map<String, dynamic>> prepareSend(
{required String address,
required Amount amount,
Map<String, dynamic>? args}) async {
try {
final feeRate = args?["feeRate"];
var fee = 1000;
if (feeRate is FeeRateType) {
final theFees = await fees;
switch (feeRate) {
case FeeRateType.fast:
fee = theFees.fast;
case FeeRateType.slow:
fee = theFees.slow;
case FeeRateType.average:
default:
fee = theFees.medium;
}
}
Map<String, dynamic> txData = {
"fee": fee,
"address": address,
"recipientAmt": amount,
};
Logging.instance.log("prepare send: $txData", level: LogLevel.Info);
return txData;
} catch (e, s) {
Logging.instance.log("Error getting fees $e - $s", level: LogLevel.Error);
rethrow;
}
}
@override
Future<void> recoverFromMnemonic(
{required String mnemonic,
String? mnemonicPassphrase,
required int maxUnusedAddressGap,
required int maxNumberOfIndexesToCheck,
required int height}) async {
if ((await mnemonicString) != null ||
(await this.mnemonicPassphrase) != null) {
throw Exception("Attempted to overwrite mnemonic on restore!");
}
var wallet = await Wallet.from(mnemonic);
var keyPair = await wallet.getKeyPair(index: 0);
var address = keyPair.accountId;
var secretSeed = keyPair.secretSeed;
await _secureStore.write(
key: '${_walletId}_mnemonic', value: mnemonic.trim());
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',
value: mnemonicPassphrase ?? "",
);
await _secureStore.write(key: '${_walletId}_secretSeed', value: secretSeed);
final swAddress = SWAddress.Address(
walletId: walletId,
value: address,
publicKey: keyPair.publicKey,
derivationIndex: 0,
derivationPath: null,
type: SWAddress.AddressType.unknown, // TODO: set type
subType: SWAddress.AddressSubType.unknown);
await db.putAddress(swAddress);
await Future.wait(
[updateCachedId(walletId), updateCachedIsFavorite(false)]);
}
Future<void> updateChainHeight() async {
final height = await stellarSdk.ledgers
.order(RequestBuilderOrder.DESC)
.limit(1)
.execute()
.then((value) => value.records!.first.sequence)
.onError((error, stackTrace) => throw ("Error getting chain height"));
await updateCachedChainHeight(height);
}
Future<void> updateTransactions() async {
try {
List<Tuple2<SWTransaction.Transaction, SWAddress.Address?>>
transactionList = [];
Page<OperationResponse> payments = await stellarSdk.payments
.forAccount(await getAddressSW())
.order(RequestBuilderOrder.DESC)
.execute()
.onError(
(error, stackTrace) => throw ("Could not fetch transactions"));
for (OperationResponse response in payments.records!) {
// PaymentOperationResponse por;
if (response is PaymentOperationResponse) {
PaymentOperationResponse por = response;
Logging.instance.log(
"ALL TRANSACTIONS IS ${por.transactionSuccessful}",
level: LogLevel.Info);
Logging.instance.log("THIS TX HASH IS ${por.transactionHash}",
level: LogLevel.Info);
SWTransaction.TransactionType type;
if (por.sourceAccount == await getAddressSW()) {
type = SWTransaction.TransactionType.outgoing;
} else {
type = SWTransaction.TransactionType.incoming;
}
final amount = Amount(
rawValue: BigInt.parse(float
.parse(por.amount!)
.toStringAsFixed(coin.decimals)
.replaceAll(".", "")),
fractionDigits: coin.decimals,
);
int fee = 0;
int height = 0;
//Query the transaction linked to the payment,
// por.transaction returns a null sometimes
TransactionResponse tx =
await stellarSdk.transactions.transaction(por.transactionHash!);
if (tx.hash.isNotEmpty) {
fee = tx.feeCharged!;
height = tx.ledger;
}
var theTransaction = SWTransaction.Transaction(
walletId: walletId,
txid: por.transactionHash!,
timestamp:
DateTime.parse(por.createdAt!).millisecondsSinceEpoch ~/ 1000,
type: type,
subType: SWTransaction.TransactionSubType.none,
amount: 0,
amountString: amount.toJsonString(),
fee: fee,
height: height,
isCancelled: false,
isLelantus: false,
slateId: "",
otherData: "",
inputs: [],
outputs: [],
nonce: 0,
numberOfMessages: null,
);
SWAddress.Address? receivingAddress = await _currentReceivingAddress;
SWAddress.Address address =
type == SWTransaction.TransactionType.incoming
? receivingAddress!
: SWAddress.Address(
walletId: walletId,
value: por.sourceAccount!,
publicKey:
KeyPair.fromAccountId(por.sourceAccount!).publicKey,
derivationIndex: 0,
derivationPath: null,
type: SWAddress.AddressType.unknown, // TODO: set type
subType: SWAddress.AddressSubType.unknown);
Tuple2<SWTransaction.Transaction, SWAddress.Address> tuple =
Tuple2(theTransaction, address);
transactionList.add(tuple);
} else if (response is CreateAccountOperationResponse) {
CreateAccountOperationResponse caor = response;
SWTransaction.TransactionType type;
if (caor.sourceAccount == await getAddressSW()) {
type = SWTransaction.TransactionType.outgoing;
} else {
type = SWTransaction.TransactionType.incoming;
}
final amount = Amount(
rawValue: BigInt.parse(float
.parse(caor.startingBalance!)
.toStringAsFixed(coin.decimals)
.replaceAll(".", "")),
fractionDigits: coin.decimals,
);
int fee = 0;
int height = 0;
TransactionResponse tx =
await stellarSdk.transactions.transaction(caor.transactionHash!);
if (tx.hash.isNotEmpty) {
fee = tx.feeCharged!;
height = tx.ledger;
}
var theTransaction = SWTransaction.Transaction(
walletId: walletId,
txid: caor.transactionHash!,
timestamp:
DateTime.parse(caor.createdAt!).millisecondsSinceEpoch ~/ 1000,
type: type,
subType: SWTransaction.TransactionSubType.none,
amount: 0,
amountString: amount.toJsonString(),
fee: fee,
height: height,
isCancelled: false,
isLelantus: false,
slateId: "",
otherData: "",
inputs: [],
outputs: [],
nonce: 0,
numberOfMessages: null,
);
SWAddress.Address? receivingAddress = await _currentReceivingAddress;
SWAddress.Address address =
type == SWTransaction.TransactionType.incoming
? receivingAddress!
: SWAddress.Address(
walletId: walletId,
value: caor.sourceAccount!,
publicKey:
KeyPair.fromAccountId(caor.sourceAccount!).publicKey,
derivationIndex: 0,
derivationPath: null,
type: SWAddress.AddressType.unknown, // TODO: set type
subType: SWAddress.AddressSubType.unknown);
Tuple2<SWTransaction.Transaction, SWAddress.Address> tuple =
Tuple2(theTransaction, address);
transactionList.add(tuple);
}
}
await db.addNewTransactionData(transactionList, walletId);
} catch (e, s) {
Logging.instance.log(
"Exception rethrown from updateTransactions(): $e\n$s",
level: LogLevel.Error);
}
}
Future<void> updateBalance() async {
try {
AccountResponse accountResponse =
await stellarSdk.accounts.account(await getAddressSW());
for (Balance balance in accountResponse.balances) {
switch (balance.assetType) {
case Asset.TYPE_NATIVE:
_balance = SWBalance.Balance(
total: Amount(
rawValue: BigInt.from(float.parse(balance.balance) * 10000000),
fractionDigits: coin.decimals,
),
spendable: Amount(
rawValue: BigInt.from(float.parse(balance.balance) * 10000000),
fractionDigits: coin.decimals,
),
blockedTotal: Amount(
rawValue: BigInt.from(0),
fractionDigits: coin.decimals,
),
pendingSpendable: Amount(
rawValue: BigInt.from(0),
fractionDigits: coin.decimals,
),
);
Logging.instance.log(_balance, level: LogLevel.Info);
await updateCachedBalance(_balance!);
}
}
} catch (e, s) {
Logging.instance.log(
"ERROR GETTING BALANCE $e\n$s",
level: LogLevel.Info,
);
}
}
@override
Future<void> refresh() async {
if (refreshMutex) {
Logging.instance.log(
"$walletId $walletName refreshMutex denied",
level: LogLevel.Info,
);
return;
} else {
refreshMutex = true;
}
try {
await _prefs.init();
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.syncing,
walletId,
coin,
),
);
await updateChainHeight();
await updateTransactions();
await updateBalance();
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.synced,
walletId,
coin,
),
);
if (shouldAutoSync) {
timer ??= Timer.periodic(const Duration(seconds: 30), (timer) async {
Logging.instance.log(
"Periodic refresh check for $walletId $walletName in object instance: $hashCode",
level: LogLevel.Info);
await refresh();
GlobalEventBus.instance.fire(
UpdatedInBackgroundEvent(
"New data found in $walletId $walletName in background!",
walletId,
),
);
});
}
} catch (e, s) {
Logging.instance.log(
"Failed to refresh stellar wallet $walletId: '$walletName': $e\n$s",
level: LogLevel.Warning,
);
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.unableToSync,
walletId,
coin,
),
);
}
refreshMutex = false;
}
@override
int get storedChainHeight => getCachedChainHeight();
@override
Future<bool> testNetworkConnection() {
// TODO: implement testNetworkConnection
throw UnimplementedError();
}
@override
Future<List<SWTransaction.Transaction>> get transactions =>
db.getTransactions(walletId).findAll();
@override
Future<void> updateNode(bool shouldRefresh) async {
_xlmNode = NodeService(secureStorageInterface: _secureStore)
.getPrimaryNodeFor(coin: coin) ??
DefaultNodes.getNodeFor(coin);
if (shouldRefresh) {
unawaited(refresh());
}
}
@override
Future<void> updateSentCachedTxData(Map<String, dynamic> txData) async {
final transaction = SWTransaction.Transaction(
walletId: walletId,
txid: txData["txid"] as String,
timestamp: DateTime.now().millisecondsSinceEpoch ~/ 1000,
type: SWTransaction.TransactionType.outgoing,
subType: SWTransaction.TransactionSubType.none,
// precision may be lost here hence the following amountString
amount: (txData["recipientAmt"] as Amount).raw.toInt(),
amountString: (txData["recipientAmt"] as Amount).toJsonString(),
fee: txData["fee"] as int,
height: null,
isCancelled: false,
isLelantus: false,
otherData: null,
slateId: null,
nonce: null,
inputs: [],
outputs: [],
numberOfMessages: null,
);
final address = txData["address"] is String
? await db.getAddress(walletId, txData["address"] as String)
: null;
await db.addNewTransactionData(
[
Tuple2(transaction, address),
],
walletId,
);
}
@override
// TODO: implement utxos
Future<List<UTXO>> get utxos => throw UnimplementedError();
@override
bool validateAddress(String address) {
return RegExp(r"^[G][A-Z0-9]{55}$").hasMatch(address);
}
@override
String get walletId => _walletId;
late String _walletId;
}

View file

@ -1,6 +1,6 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:http/http.dart' as http;
import 'package:stackwallet/dto/ordinals/inscription_data.dart';
import 'package:stackwallet/dto/ordinals/litescribe_response.dart';
@ -21,7 +21,8 @@ class LitescribeAPI {
if (response.statusCode == 200) {
return LitescribeResponse(data: _validateJson(response.body));
} else {
throw Exception('LitescribeAPI _getResponse exception: Failed to load data');
throw Exception(
'LitescribeAPI _getResponse exception: Failed to load data');
}
}
@ -30,39 +31,49 @@ class LitescribeAPI {
if (parsed is Map<String, dynamic>) {
return parsed;
} else {
throw const FormatException('LitescribeAPI _validateJson exception: Invalid JSON format');
throw const FormatException(
'LitescribeAPI _validateJson exception: Invalid JSON format');
}
}
Future<List<InscriptionData>> getInscriptionsByAddress(String address, {int cursor = 0, int size = 1000}) async {
Future<List<InscriptionData>> getInscriptionsByAddress(String address,
{int cursor = 0, int size = 1000}) async {
// size param determines how many inscriptions are returned per response
// default of 1000 is used to cover most addresses (I assume)
// if the total number of inscriptions at the address exceeds the length of the list of inscriptions returned, another call with a higher size is made
final int defaultLimit = 1000;
final response = await _getResponse('/address/inscriptions?address=$address&cursor=$cursor&size=$size');
final response = await _getResponse(
'/address/inscriptions?address=$address&cursor=$cursor&size=$size');
// Check if the number of returned inscriptions equals the limit
final list = response.data['result']['list'];
final int total = response.data['result']['total'] as int;
final int currentSize = list.length as int;
int currentSize = 0;
if (total == 0) {
return <InscriptionData>[];
}
final list = response.data['result']!['list'];
currentSize = list.length as int;
if (currentSize == size && currentSize < total) {
// If the number of returned inscriptions equals the limit and there are more inscriptions available,
// increment the cursor and make the next API call to fetch the remaining inscriptions.
final int newCursor = cursor + size;
return getInscriptionsByAddress(address, cursor: newCursor, size: size);
} else {
try {
// Iterate through the list and create InscriptionData objects from each element
final List<InscriptionData> inscriptions = (list as List<dynamic>)
.map((json) => InscriptionData.fromJson(json as Map<String, dynamic>))
.map((json) =>
InscriptionData.fromJson(json as Map<String, dynamic>))
.toList();
return inscriptions;
} catch (e) {
throw const FormatException('LitescribeAPI getInscriptionsByAddress exception: AddressInscriptionResponse.fromJson failure');
throw const FormatException(
'LitescribeAPI getInscriptionsByAddress exception: AddressInscriptionResponse.fromJson failure');
}
}
}
}
}

View file

@ -0,0 +1,40 @@
import 'dart:typed_data';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:stackwallet/utilities/logger.dart';
final pMonKeyService = Provider((ref) => MonKeyService());
class MonKeyService {
static const baseURL = "https://monkey.banano.cc/api/v1/monkey/";
Future<Uint8List> fetchMonKey({
required String address,
bool png = false,
}) async {
try {
String url = "https://monkey.banano.cc/api/v1/monkey/$address";
if (png) {
url += '?format=png&size=512&background=false';
}
final response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
return response.bodyBytes;
} else {
throw Exception(
"statusCode=${response.statusCode} body=${response.body}",
);
}
} catch (e, s) {
Logging.instance.log(
"Failed fetchMonKey($address): $e\n$s",
level: LogLevel.Error,
);
rethrow;
}
}
}

View file

@ -100,7 +100,7 @@ class PriceAPI {
Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency"
"=${baseCurrency.toLowerCase()}"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,tezos"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar,tezos"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false");
final coinGeckoResponse = await client.get(

View file

@ -28,6 +28,7 @@ class CoinThemeColorDefault {
Color get namecoin => const Color(0xFF91B1E1);
Color get wownero => const Color(0xFFED80C1);
Color get particl => const Color(0xFF8175BD);
Color get stellar => const Color(0xFF6600FF);
Color get nano => const Color(0xFF209CE9);
Color get banano => const Color(0xFFFBDD11);
Color get tezos => const Color(0xFF0F61FF);
@ -63,6 +64,9 @@ class CoinThemeColorDefault {
return wownero;
case Coin.particl:
return particl;
case Coin.stellar:
case Coin.stellarTestnet:
return stellar;
case Coin.nano:
return nano;
case Coin.banano:

View file

@ -1707,6 +1707,9 @@ class StackColors extends ThemeExtension<StackColors> {
return _coin.wownero;
case Coin.particl:
return _coin.particl;
case Coin.stellar:
case Coin.stellarTestnet:
return _coin.stellar;
case Coin.nano:
return _coin.nano;
case Coin.banano:

View file

@ -27,7 +27,7 @@ final pThemeService = Provider<ThemeService>((ref) {
});
class ThemeService {
static const _currentDefaultThemeVersion = 3;
static const _currentDefaultThemeVersion = 4;
ThemeService._();
static ThemeService? _instance;
static ThemeService get instance => _instance ??= ThemeService._();

View file

@ -105,6 +105,8 @@ class AddressUtils {
return Address.validateAddress(address, namecoin, namecoin.bech32!);
case Coin.particl:
return Address.validateAddress(address, particl);
case Coin.stellar:
return RegExp(r"^[G][A-Z0-9]{55}$").hasMatch(address);
case Coin.nano:
return NanoAccounts.isValid(NanoAccountType.NANO, address);
case Coin.banano:
@ -141,6 +143,8 @@ class AddressUtils {
return Address.validateAddress(address, firoTestNetwork);
case Coin.dogecoinTestNet:
return Address.validateAddress(address, dogecointestnet);
case Coin.stellarTestnet:
return RegExp(r"^[G][A-Z0-9]{55}$").hasMatch(address);
}
}

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -50,6 +50,8 @@ enum AmountUnit {
case Coin.dogecoin:
case Coin.eCash:
case Coin.epicCash:
case Coin.stellar: // TODO: check if this is correct
case Coin.stellarTestnet:
case Coin.tezos:
return AmountUnit.values.sublist(0, 4);
@ -63,7 +65,6 @@ enum AmountUnit {
case Coin.nano:
case Coin.banano:
return AmountUnit.values;
}
}
}

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -54,10 +54,14 @@ Uri getDefaultBlockExplorerUrlFor({
return Uri.parse("https://chainz.cryptoid.info/nmc/tx.dws?$txid.htm");
case Coin.particl:
return Uri.parse("https://chainz.cryptoid.info/part/tx.dws?$txid.htm");
case Coin.stellar:
return Uri.parse("https://stellarchain.io/tx/$txid");
case Coin.nano:
return Uri.parse("https://www.nanolooker.com/block/$txid");
case Coin.banano:
return Uri.parse("https://www.bananolooker.com/block/$txid");
case Coin.stellarTestnet:
return Uri.parse("https://testnet.stellarchain.io/transactions/$txid");
case Coin.tezos:
return Uri.parse("https://tzstats.com/$txid");
}

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -42,6 +42,7 @@ abstract class Constants {
BigInt.parse("1000000000000000000000000000000"); // 1*10^30
static final BigInt _satsPerCoinBanano =
BigInt.parse("100000000000000000000000000000"); // 1*10^29
static final BigInt _satsPerCoinStellar = BigInt.from(10000000); // https://developers.stellar.org/docs/fundamentals-and-concepts/stellar-data-structures/assets#amount-precision
static final BigInt _satsPerCoin = BigInt.from(100000000);
static final BigInt _satsPerCoinTezos = BigInt.from(1000000);
static const int _decimalPlaces = 8;
@ -51,6 +52,7 @@ abstract class Constants {
static const int _decimalPlacesMonero = 12;
static const int _decimalPlacesEthereum = 18;
static const int _decimalPlacesECash = 2;
static const int _decimalPlacesStellar = 7;
static const int _decimalPlacesTezos = 6;
static const int notificationsMax = 0xFFFFFFFF;
@ -98,6 +100,10 @@ abstract class Constants {
case Coin.eCash:
return _satsPerCoinECash;
case Coin.stellar:
case Coin.stellarTestnet:
return _satsPerCoinStellar;
case Coin.tezos:
return _satsPerCoinTezos;
}
@ -138,6 +144,10 @@ abstract class Constants {
case Coin.eCash:
return _decimalPlacesECash;
case Coin.stellar:
case Coin.stellarTestnet:
return _decimalPlacesStellar;
case Coin.tezos:
return _decimalPlacesTezos;
}
@ -162,10 +172,13 @@ abstract class Constants {
case Coin.namecoin:
case Coin.particl:
case Coin.nano:
case Coin.stellar:
case Coin.stellarTestnet:
values.addAll([24, 12]);
break;
case Coin.banano:
values.addAll([24, 12]);
break;
case Coin.tezos:
values.addAll([24, 12]);
@ -223,6 +236,10 @@ abstract class Constants {
case Coin.banano: // TODO: Verify this
return 1;
case Coin.stellar:
case Coin.stellarTestnet:
return 5;
case Coin.tezos:
return 60;
}
@ -252,6 +269,8 @@ abstract class Constants {
case Coin.nano:
case Coin.banano:
case Coin.stellar:
case Coin.stellarTestnet:
case Coin.tezos:
return 24;

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -34,6 +34,7 @@ abstract class DefaultNodes {
bitcoincashTestnet,
dogecoinTestnet,
firoTestnet,
stellarTestnet,
];
static NodeModel get bitcoin => NodeModel(
@ -181,6 +182,18 @@ abstract class DefaultNodes {
isFailover: true,
isDown: false);
static NodeModel get stellar => NodeModel(
host: "https://horizon.stellar.org",
port: 443,
name: defaultName,
id: _nodeId(Coin.stellar),
useSSL: false,
enabled: true,
coinName: Coin.stellar.name,
isFailover: true,
isDown: false
);
static NodeModel get tezos => NodeModel(
// TODO: Change this to stack wallet one
host: "https://mainnet.api.tez.ie",
@ -275,6 +288,18 @@ abstract class DefaultNodes {
isDown: false,
);
static NodeModel get stellarTestnet => NodeModel(
host: "https://horizon-testnet.stellar.org/",
port: 50022,
name: defaultName,
id: _nodeId(Coin.stellarTestnet),
useSSL: true,
enabled: true,
coinName: Coin.stellarTestnet.name,
isFailover: true,
isDown: false,
);
static NodeModel getNodeFor(Coin coin) {
switch (coin) {
case Coin.bitcoin:
@ -312,6 +337,10 @@ abstract class DefaultNodes {
case Coin.particl:
return particl;
case Coin.stellar:
return stellar;
case Coin.nano:
return nano;
@ -335,6 +364,9 @@ abstract class DefaultNodes {
case Coin.dogecoinTestNet:
return dogecoinTestnet;
case Coin.stellarTestnet:
return stellarTestnet;
}
}
}

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -27,6 +27,7 @@ import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart'
import 'package:stackwallet/services/coins/nano/nano_wallet.dart' as nano;
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
as particl;
import 'package:stackwallet/services/coins/stellar/stellar_wallet.dart' as xlm;
import 'package:stackwallet/services/coins/tezos/tezos_wallet.dart' as tezos;
import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart' as wow;
import 'package:stackwallet/utilities/constants.dart';
@ -45,6 +46,7 @@ enum Coin {
namecoin,
nano,
particl,
stellar,
tezos,
wownero,
@ -86,6 +88,8 @@ extension CoinExt on Coin {
return "Monero";
case Coin.particl:
return "Particl";
case Coin.stellar:
return "Stellar";
case Coin.tezos:
return "Tezos";
case Coin.wownero:
@ -131,6 +135,8 @@ extension CoinExt on Coin {
return "XMR";
case Coin.particl:
return "PART";
case Coin.stellar:
return "XLM";
case Coin.tezos:
return "XTZ";
case Coin.wownero:
@ -151,6 +157,8 @@ extension CoinExt on Coin {
return "tFIRO";
case Coin.dogecoinTestNet:
return "tDOGE";
case Coin.stellarTestnet:
return "tXLM";
}
}
@ -177,6 +185,8 @@ extension CoinExt on Coin {
return "monero";
case Coin.particl:
return "particl";
case Coin.stellar:
return "stellar";
case Coin.tezos:
return "tezos";
case Coin.wownero:
@ -197,6 +207,8 @@ extension CoinExt on Coin {
return "firo";
case Coin.dogecoinTestNet:
return "dogecoin";
case Coin.stellarTestnet:
return "stellar";
}
}
@ -224,6 +236,8 @@ extension CoinExt on Coin {
case Coin.wownero:
case Coin.nano:
case Coin.banano:
case Coin.stellar:
case Coin.stellarTestnet:
return false;
}
}
@ -252,6 +266,8 @@ extension CoinExt on Coin {
case Coin.firoTestNet:
case Coin.nano:
case Coin.banano:
case Coin.stellar:
case Coin.stellarTestnet:
return false;
}
}
@ -273,6 +289,7 @@ extension CoinExt on Coin {
case Coin.nano:
case Coin.banano:
case Coin.eCash:
case Coin.stellar:
return false;
case Coin.dogecoinTestNet:
@ -280,6 +297,7 @@ extension CoinExt on Coin {
case Coin.litecoinTestNet:
case Coin.bitcoincashTestnet:
case Coin.firoTestNet:
case Coin.stellarTestnet:
return true;
}
}
@ -301,6 +319,7 @@ extension CoinExt on Coin {
case Coin.nano:
case Coin.banano:
case Coin.eCash:
case Coin.stellar:
return this;
case Coin.dogecoinTestNet:
@ -317,6 +336,9 @@ extension CoinExt on Coin {
case Coin.firoTestNet:
return Coin.firo;
case Coin.stellarTestnet:
return Coin.stellar;
}
}
@ -357,6 +379,10 @@ extension CoinExt on Coin {
case Coin.particl:
return particl.MINIMUM_CONFIRMATIONS;
case Coin.stellar:
case Coin.stellarTestnet:
return xlm.MINIMUM_CONFIRMATIONS;
case Coin.tezos:
return tezos.MINIMUM_CONFIRMATIONS;
@ -419,6 +445,10 @@ Coin coinFromPrettyName(String name) {
case "particl":
return Coin.particl;
case "Stellar":
case "stellar":
return Coin.stellar;
case "Tezos":
case "tezos":
return Coin.tezos;
@ -467,6 +497,11 @@ Coin coinFromPrettyName(String name) {
case "banano":
return Coin.banano;
case "Stellar Testnet":
case "stellarTestnet":
case "tStellar":
return Coin.stellarTestnet;
default:
throw ArgumentError.value(
name,
@ -500,6 +535,8 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
return Coin.namecoin;
case "part":
return Coin.particl;
case "xlm":
return Coin.stellar;
case "xtz":
return Coin.tezos;
case "tltc":
@ -518,6 +555,8 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
return Coin.nano;
case "ban":
return Coin.banano;
case "txlm":
return Coin.stellarTestnet;
default:
throw ArgumentError.value(
ticker, "name", "No Coin enum value with that ticker");

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -49,6 +49,8 @@ extension DerivePathTypeExt on DerivePathType {
case Coin.wownero:
case Coin.nano:
case Coin.banano:
case Coin.stellar:
case Coin.stellarTestnet:
case Coin.tezos: // TODO: Is this true?
throw UnsupportedError(
"$coin does not use bitcoin style derivation paths");

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -195,7 +195,10 @@ class _NodeCardState extends ConsumerState<NodeCard> {
case Coin.nano:
case Coin.banano:
case Coin.tezos:
//TODO: check network/node
case Coin.stellar:
case Coin.stellarTestnet:
throw UnimplementedError();
//TODO: check network/node
}
if (testPassed) {

View file

@ -1,6 +1,6 @@
/*
/*
* This file is part of Stack Wallet.
*
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
@ -178,7 +178,10 @@ class NodeOptionsSheet extends ConsumerWidget {
case Coin.nano:
case Coin.banano:
case Coin.tezos:
//TODO: check network/node
case Coin.stellar:
case Coin.stellarTestnet:
throw UnimplementedError();
//TODO: check network/node
}
if (testPassed) {

View file

@ -37,18 +37,18 @@ packages:
dependency: transitive
description:
name: args
sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.4.1"
version: "2.4.2"
asn1lib:
dependency: transitive
description:
name: asn1lib
sha256: ab96a1cb3beeccf8145c52e449233fe68364c9641623acd3adad66f8184f1039
sha256: b74e3842a52c61f8819a1ec8444b4de5419b41a7465e69d4aa681445377398b0
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
async:
dependency: "direct main"
description:
@ -146,10 +146,10 @@ packages:
dependency: transitive
description:
name: build
sha256: "43865b79fbb78532e4bff7c33087aa43b1d488c4fdef014eaef568af6d8016dc"
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.4.1"
build_config:
dependency: transitive
description:
@ -170,26 +170,26 @@ packages:
dependency: transitive
description:
name: build_resolvers
sha256: db49b8609ef8c81cca2b310618c3017c00f03a92af44c04d310b907b2d692d95
sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.2.1"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "220ae4553e50d7c21a17c051afc7b183d28a24a420502e842f303f8e4e6edced"
sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b"
url: "https://pub.dev"
source: hosted
version: "2.4.4"
version: "2.4.6"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "88a57f2ac99849362e73878334caa9f06ee25f31d2adced882b8337838c84e1e"
sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41"
url: "https://pub.dev"
source: hosted
version: "7.2.9"
version: "7.2.10"
built_collection:
dependency: transitive
description:
@ -202,10 +202,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: "7dd62d9faf105c434f3d829bbe9c4be02ec67f5ed94832222116122df67c5452"
sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166"
url: "https://pub.dev"
source: hosted
version: "8.6.0"
version: "8.6.1"
characters:
dependency: transitive
description:
@ -242,10 +242,10 @@ packages:
dependency: transitive
description:
name: code_builder
sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe"
sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189"
url: "https://pub.dev"
source: hosted
version: "4.4.0"
version: "4.5.0"
collection:
dependency: transitive
description:
@ -298,10 +298,10 @@ packages:
dependency: "direct main"
description:
name: crypto
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.0.3"
cryptography:
dependency: transitive
description:
@ -314,10 +314,10 @@ packages:
dependency: transitive
description:
name: csslib
sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f"
sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb"
url: "https://pub.dev"
source: hosted
version: "0.17.3"
version: "1.0.0"
cw_core:
dependency: "direct main"
description:
@ -382,18 +382,18 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad
sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
dartx:
dependency: transitive
description:
name: dartx
sha256: "45d7176701f16c5a5e00a4798791c1964bc231491b879369c818dd9a9c764871"
sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
dbus:
dependency: transitive
description:
@ -406,10 +406,10 @@ packages:
dependency: "direct main"
description:
name: decimal
sha256: eece91944f523657c75a3a008a90ec7f7eb3986191153a78570c7d0ac8ef3d01
sha256: "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.3.3"
dependency_validator:
dependency: "direct dev"
description:
@ -450,14 +450,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.0"
dio:
dependency: transitive
description:
name: dio
sha256: "3866d67f93523161b643187af65f5ac08bc991a5bcdaf41a2d587fe4ccb49993"
url: "https://pub.dev"
source: hosted
version: "5.3.0"
dropdown_button2:
dependency: "direct main"
description:
name: dropdown_button2
sha256: "374f2390161bf782b4896f0b1b24cbb2b5daaa1cfb11047c3307461dcdf44e07"
sha256: "83c54a5022f898d63e3abe21240b64b937e676103207287e6705d3f9bb04d654"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.3.6"
eip1559:
dependency: transitive
description:
@ -542,10 +550,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "9d6e95ec73abbd31ec54d0e0df8a961017e165aba1395e462e5b31ea0c165daf"
sha256: b1729fc96627dd44012d0a901558177418818d6bd428df59dcfeb594e5f66432
url: "https://pub.dev"
source: hosted
version: "5.3.1"
version: "5.3.2"
fixnum:
dependency: transitive
description:
@ -606,10 +614,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.0.2"
flutter_local_notifications:
dependency: "direct main"
description:
@ -670,10 +678,10 @@ packages:
dependency: "direct main"
description:
name: flutter_rounded_date_picker
sha256: e7143cc5cbf3aec1536286653e38b0809abc99fb76c91bd910dbd98ae003d890
sha256: e6aa2dc5d3b44e8bbe85ef901be69eac59ba4136427f11f4c8b2a303e1e774e7
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.4"
flutter_secure_storage:
dependency: "direct main"
description:
@ -821,10 +829,10 @@ packages:
dependency: transitive
description:
name: html
sha256: "58e3491f7bf0b6a4ea5110c0c688877460d1a6366731155c4a4580e7ded773e8"
sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
url: "https://pub.dev"
source: hosted
version: "0.15.3"
version: "0.15.4"
http:
dependency: "direct main"
description:
@ -953,10 +961,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
local_auth:
dependency: "direct main"
description:
@ -977,10 +985,10 @@ packages:
dependency: "direct main"
description:
name: lottie
sha256: "23522951540d20a57a60202ed7022e6376bed206a4eee1c347a91f58bd57eb9f"
sha256: "0793a5866062e5cc8a8b24892fa94c3095953ea914a7fdf790f550dd7537fe60"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.5.0"
matcher:
dependency: transitive
description:
@ -1033,10 +1041,10 @@ packages:
dependency: "direct dev"
description:
name: mockito
sha256: "8b46d7eb40abdda92d62edd01546051f0c27365e65608c284de336dccfef88cc"
sha256: "7d5b53bcd556c1bc7ffbe4e4d5a19c3e112b7e925e9e172dd7c6ad0630812616"
url: "https://pub.dev"
source: hosted
version: "5.4.1"
version: "5.4.2"
mocktail:
dependency: transitive
description:
@ -1145,10 +1153,10 @@ packages:
dependency: transitive
description:
name: path_provider_foundation
sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3"
sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.2.4"
path_provider_linux:
dependency: transitive
description:
@ -1169,50 +1177,50 @@ packages:
dependency: transitive
description:
name: path_provider_windows
sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6
sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96"
url: "https://pub.dev"
source: hosted
version: "2.1.6"
version: "2.1.7"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
sha256: "33c6a1253d1f95fd06fa74b65b7ba907ae9811f9d5c1d3150e51417d04b8d6a8"
sha256: "63e5216aae014a72fe9579ccd027323395ce7a98271d9defa9d57320d001af81"
url: "https://pub.dev"
source: hosted
version: "10.2.0"
version: "10.4.3"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: d8cc6a62ded6d0f49c6eac337e080b066ee3bce4d405bd9439a61e1f1927bfe8
sha256: "2ffaf52a21f64ac9b35fe7369bb9533edbd4f698e5604db8645b1064ff4cf221"
url: "https://pub.dev"
source: hosted
version: "10.2.1"
version: "10.3.3"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: ee96ac32f5a8e6f80756e25b25b9f8e535816c8e6665a96b6d70681f8c4f7e85
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
url: "https://pub.dev"
source: hosted
version: "9.0.8"
version: "9.1.4"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: "68abbc472002b5e6dfce47fe9898c6b7d8328d58b5d2524f75e277c07a97eb84"
sha256: "7c6b1500385dd1d2ca61bb89e2488ca178e274a69144d26bbd65e33eae7c02a9"
url: "https://pub.dev"
source: hosted
version: "3.9.0"
version: "3.11.3"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: f67cab14b4328574938ecea2db3475dad7af7ead6afab6338772c5f88963e38b
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098
url: "https://pub.dev"
source: hosted
version: "0.1.2"
version: "0.1.3"
petitparser:
dependency: transitive
description:
@ -1221,6 +1229,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.4.0"
pinenacl:
dependency: transitive
description:
name: pinenacl
sha256: "3a5503637587d635647c93ea9a8fecf48a420cc7deebe6f1fc85c2a5637ab327"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
platform:
dependency: transitive
description:
@ -1233,10 +1249,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc"
sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.5"
pointycastle:
dependency: "direct main"
description:
@ -1390,18 +1406,18 @@ packages:
dependency: transitive
description:
name: source_gen
sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33"
sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.4.0"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f"
sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.4"
source_map_stack_trace:
dependency: transitive
description:
@ -1451,6 +1467,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.2+1"
stellar_flutter_sdk:
dependency: "direct main"
description:
name: stellar_flutter_sdk
sha256: "7a9b7dc76018bbd0b9c828045cf0e26e07ec44208fb1a1733273de2390205475"
url: "https://pub.dev"
source: hosted
version: "1.6.0"
stream_channel:
dependency: transitive
description:
@ -1555,14 +1579,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
toml:
dependency: transitive
description:
name: toml
sha256: "69756bc12eccf279b72217a87310d217efc4b3752f722e890f672801f19ac485"
url: "https://pub.dev"
source: hosted
version: "0.13.1"
tuple:
dependency: "direct main"
description:
name: tuple
sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa"
sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.0.2"
typed_data:
dependency: transitive
description:
@ -1579,22 +1611,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.2"
unorm_dart:
dependency: transitive
description:
name: unorm_dart
sha256: "5b35bff83fce4d76467641438f9e867dc9bcfdb8c1694854f230579d68cd8f4b"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3
sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e"
url: "https://pub.dev"
source: hosted
version: "6.1.11"
version: "6.1.12"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: eed4e6a1164aa9794409325c3b707ff424d4d1c2a785e7db67f8bbda00e36e51
sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af"
url: "https://pub.dev"
source: hosted
version: "6.0.35"
version: "6.0.37"
url_launcher_ios:
dependency: transitive
description:
@ -1615,34 +1655,34 @@ packages:
dependency: transitive
description:
name: url_launcher_macos
sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e"
sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.6"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370"
sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.3"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "6bb1e5d7fe53daf02a8fee85352432a40b1f868a81880e99ec7440113d5cfcab"
sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4
url: "https://pub.dev"
source: hosted
version: "2.0.17"
version: "2.0.18"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771"
sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
version: "3.0.7"
uuid:
dependency: "direct main"
description:
@ -1768,18 +1808,18 @@ packages:
dependency: transitive
description:
name: win32
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee
url: "https://pub.dev"
source: hosted
version: "4.1.4"
version: "5.0.5"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: "1c52f994bdccb77103a6231ad4ea331a244dbcef5d1f37d8462f713143b0bfae"
sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
window_size:
dependency: "direct main"
description:

View file

@ -11,7 +11,7 @@ description: Stack Wallet
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.7.16+182
version: 1.7.17+184
environment:
sdk: ">=3.0.2 <4.0.0"
@ -138,6 +138,7 @@ dependencies:
desktop_drop: ^0.4.1
nanodart: ^2.0.0
basic_utils: ^5.5.4
stellar_flutter_sdk: ^1.6.0
tezart: ^2.0.5
dev_dependencies:

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/cached_electrumx_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:ui' as _i10;
@ -28,8 +26,18 @@ import 'package:stackwallet/utilities/prefs.dart' as _i5;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
@ -68,6 +76,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -86,9 +103,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -97,9 +114,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i4.Future<dynamic>.value(),
@ -108,7 +125,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -118,7 +135,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -359,7 +376,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -378,7 +395,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,

View file

@ -59,6 +59,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -97,6 +98,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -132,6 +134,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -161,6 +164,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 2),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -195,6 +199,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 2),
),
).thenThrow(Exception());
@ -224,6 +229,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -281,6 +287,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -310,6 +317,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -345,6 +353,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -377,6 +386,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -415,6 +425,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -446,6 +457,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(minutes: 5),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -503,6 +515,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(minutes: 5),
),
).thenThrow(Exception());
@ -534,6 +547,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -599,6 +613,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -630,6 +645,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -667,6 +683,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -699,6 +716,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -734,6 +752,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -765,6 +784,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -800,6 +820,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -831,6 +852,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(minutes: 2),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -866,6 +888,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(minutes: 2),
),
).thenThrow(Exception());
@ -897,6 +920,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -931,6 +955,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -963,6 +988,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -998,6 +1024,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -1031,6 +1058,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -1066,6 +1094,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -1099,6 +1128,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(minutes: 2),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -1134,6 +1164,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(minutes: 2),
),
).thenThrow(Exception());
@ -1165,6 +1196,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -1199,6 +1231,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());
@ -1228,6 +1261,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenAnswer(
(_) async => JsonRPCResponse(data: {
@ -1264,6 +1298,7 @@ void main() {
mockClient.request(
'{"jsonrpc": "2.0", "id": "some requestId",'
'"method": "$command","params": $jsonArgs}',
const Duration(seconds: 60),
),
).thenThrow(Exception());

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/electrumx_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;
import 'dart:ui' as _i9;
@ -80,18 +78,27 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC {
),
) as Duration);
@override
_i3.Future<_i2.JsonRPCResponse> request(String? jsonRpcRequest) =>
_i3.Future<_i2.JsonRPCResponse> request(
String? jsonRpcRequest,
Duration? requestTimeout,
) =>
(super.noSuchMethod(
Invocation.method(
#request,
[jsonRpcRequest],
[
jsonRpcRequest,
requestTimeout,
],
),
returnValue:
_i3.Future<_i2.JsonRPCResponse>.value(_FakeJsonRPCResponse_1(
this,
Invocation.method(
#request,
[jsonRpcRequest],
[
jsonRpcRequest,
requestTimeout,
],
),
)),
) as _i3.Future<_i2.JsonRPCResponse>);

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/flutter_secure_storage_interface_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;

View file

@ -15,7 +15,10 @@ void main() {
const jsonRequestString =
'{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}';
final result = await jsonRPC.request(jsonRequestString);
final result = await jsonRPC.request(
jsonRequestString,
const Duration(seconds: 1),
);
expect(result.data, {"jsonrpc": "2.0", "result": null, "id": "some id"});
});
@ -30,7 +33,11 @@ void main() {
const jsonRequestString =
'{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}';
expect(() => jsonRPC.request(jsonRequestString),
expect(
() => jsonRPC.request(
jsonRequestString,
const Duration(seconds: 1),
),
throwsA(isA<SocketException>()));
});
@ -45,7 +52,11 @@ void main() {
const jsonRequestString =
'{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}';
expect(() => jsonRPC.request(jsonRequestString),
expect(
() => jsonRPC.request(
jsonRequestString,
const Duration(seconds: 1),
),
throwsA(isA<SocketException>()));
});
}

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:convert' as _i5;
import 'dart:typed_data' as _i4;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/models/type_adapter_tests/transactions_model_adapter_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:convert' as _i5;
import 'dart:typed_data' as _i4;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/models/type_adapter_tests/utxo_model_adapter_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:convert' as _i5;
import 'dart:typed_data' as _i4;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/notifications/notification_card_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:typed_data' as _i6;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/pages/send_view/send_view_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i23;
import 'dart:typed_data' as _i30;

View file

@ -28,7 +28,7 @@ void main() {
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,bitcoin-cash"
",namecoin,wownero,ethereum,particl,nano,banano&order=market_cap_desc&per_page=50"
",namecoin,wownero,ethereum,particl,nano,banano,stellar&order=market_cap_desc&per_page=50"
"&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
@ -113,19 +113,21 @@ void main() {
'Coin.namecoin: [0, 0.0], '
'Coin.nano: [0, 0.0], '
'Coin.particl: [0, 0.0], '
'Coin.stellar: [0, 0.0], '
'Coin.wownero: [0, 0.0], '
'Coin.bitcoinTestNet: [0, 0.0], '
'Coin.bitcoincashTestnet: [0, 0.0], '
'Coin.dogecoinTestNet: [0, 0.0], '
'Coin.firoTestNet: [0, 0.0], '
'Coin.litecoinTestNet: [0, 0.0]'
'Coin.litecoinTestNet: [0, 0.0], '
'Coin.stellarTestnet: [0, 0.0]'
'}',
);
verify(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false",
),
headers: {'Content-Type': 'application/json'})).called(1);
@ -140,7 +142,7 @@ void main() {
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&"
"ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
@ -219,23 +221,20 @@ void main() {
'{'
'Coin.bitcoin: [1, 0.0], '
'Coin.monero: [0.00717236, -0.77656], '
'Coin.banano: [0, 0.0], '
'Coin.bitcoincash: [0, 0.0], '
'Coin.banano: [0, 0.0], Coin.bitcoincash: [0, 0.0], '
'Coin.dogecoin: [0.00000315, -2.68533], '
'Coin.eCash: [0, 0.0], '
'Coin.epicCash: [0.00002803, 7.27524], '
'Coin.ethereum: [0, 0.0], '
'Coin.epicCash: [0.00002803, 7.27524], Coin.ethereum: [0, 0.0], '
'Coin.firo: [0.0001096, -0.89304], '
'Coin.litecoin: [0, 0.0], '
'Coin.namecoin: [0, 0.0], '
'Coin.nano: [0, 0.0], '
'Coin.particl: [0, 0.0], '
'Coin.nano: [0, 0.0], Coin.particl: [0, 0.0], Coin.stellar: [0, 0.0], '
'Coin.wownero: [0, 0.0], '
'Coin.bitcoinTestNet: [0, 0.0], '
'Coin.bitcoincashTestnet: [0, 0.0], '
'Coin.dogecoinTestNet: [0, 0.0], '
'Coin.bitcoincashTestnet: [0, 0.0], Coin.dogecoinTestNet: [0, 0.0], '
'Coin.firoTestNet: [0, 0.0], '
'Coin.litecoinTestNet: [0, 0.0]'
'Coin.litecoinTestNet: [0, 0.0], '
'Coin.stellarTestnet: [0, 0.0]'
'}',
);
@ -244,7 +243,7 @@ void main() {
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {'Content-Type': 'application/json'})).called(1);
@ -258,7 +257,7 @@ void main() {
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
@ -331,8 +330,7 @@ void main() {
expect(
price.toString(),
'{'
'Coin.bitcoin: [0, 0.0], '
'Coin.monero: [0, 0.0], '
'Coin.bitcoin: [0, 0.0], Coin.monero: [0, 0.0], '
'Coin.banano: [0, 0.0], '
'Coin.bitcoincash: [0, 0.0], '
'Coin.dogecoin: [0, 0.0], '
@ -344,12 +342,14 @@ void main() {
'Coin.namecoin: [0, 0.0], '
'Coin.nano: [0, 0.0], '
'Coin.particl: [0, 0.0], '
'Coin.stellar: [0, 0.0], '
'Coin.wownero: [0, 0.0], '
'Coin.bitcoinTestNet: [0, 0.0], '
'Coin.bitcoincashTestnet: [0, 0.0], '
'Coin.dogecoinTestNet: [0, 0.0], '
'Coin.firoTestNet: [0, 0.0], '
'Coin.litecoinTestNet: [0, 0.0]'
'Coin.litecoinTestNet: [0, 0.0], '
'Coin.stellarTestnet: [0, 0.0]'
'}',
);
});
@ -361,7 +361,7 @@ void main() {
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
@ -389,12 +389,14 @@ void main() {
'Coin.namecoin: [0, 0.0], '
'Coin.nano: [0, 0.0], '
'Coin.particl: [0, 0.0], '
'Coin.stellar: [0, 0.0], '
'Coin.wownero: [0, 0.0], '
'Coin.bitcoinTestNet: [0, 0.0], '
'Coin.bitcoincashTestnet: [0, 0.0], '
'Coin.dogecoinTestNet: [0, 0.0], '
'Coin.firoTestNet: [0, 0.0], '
'Coin.litecoinTestNet: [0, 0.0]'
'Coin.litecoinTestNet: [0, 0.0], '
'Coin.stellarTestnet: [0, 0.0]'
'}',
);
});

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/price_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;
import 'dart:convert' as _i4;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/address_book_view/address_book_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i9;
import 'dart:ui' as _i11;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/address_book_view/subviews/address_book_entry_details_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/address_book_view/subviews/edit_address_book_entry_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/exchange/exchange_view_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i6;
import 'dart:ui' as _i9;
@ -1031,8 +1029,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
[],
{#apiKey: apiKey},
),
returnValue: _i6.Future<
_i2.ExchangeResponse<List<_i20.FixedRateMarket>>>.value(
returnValue: _i6
.Future<_i2.ExchangeResponse<List<_i20.FixedRateMarket>>>.value(
_FakeExchangeResponse_0<List<_i20.FixedRateMarket>>(
this,
Invocation.method(
@ -1073,8 +1071,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
#apiKey: apiKey,
},
),
returnValue: _i6.Future<
_i2.ExchangeResponse<_i21.ExchangeTransaction>>.value(
returnValue: _i6
.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>.value(
_FakeExchangeResponse_0<_i21.ExchangeTransaction>(
this,
Invocation.method(
@ -1130,8 +1128,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
#apiKey: apiKey,
},
),
returnValue: _i6.Future<
_i2.ExchangeResponse<_i21.ExchangeTransaction>>.value(
returnValue: _i6
.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>.value(
_FakeExchangeResponse_0<_i21.ExchangeTransaction>(
this,
Invocation.method(
@ -1155,35 +1153,35 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
)),
) as _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>);
@override
_i6.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>
getTransactionStatus({
_i6.Future<
_i2
.ExchangeResponse<_i22.ExchangeTransactionStatus>> getTransactionStatus({
required String? id,
String? apiKey,
}) =>
(super.noSuchMethod(
Invocation.method(
#getTransactionStatus,
[],
{
#id: id,
#apiKey: apiKey,
},
),
returnValue: _i6.Future<
_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>.value(
_FakeExchangeResponse_0<_i22.ExchangeTransactionStatus>(
this,
Invocation.method(
#getTransactionStatus,
[],
{
#id: id,
#apiKey: apiKey,
},
),
)),
) as _i6
.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>);
(super.noSuchMethod(
Invocation.method(
#getTransactionStatus,
[],
{
#id: id,
#apiKey: apiKey,
},
),
returnValue: _i6
.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>.value(
_FakeExchangeResponse_0<_i22.ExchangeTransactionStatus>(
this,
Invocation.method(
#getTransactionStatus,
[],
{
#id: id,
#apiKey: apiKey,
},
),
)),
) as _i6.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>);
@override
_i6.Future<_i2.ExchangeResponse<List<_i23.Pair>>>
getAvailableFloatingRatePairs({bool? includePartners = false}) =>

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/lockscreen_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testA_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i7;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testB_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i7;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testC_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i7;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/onboarding/backup_key_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/onboarding/backup_key_warning_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i7;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/onboarding/create_pin_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/onboarding/name_your_wallet_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/onboarding/restore_wallet_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i9;
import 'dart:ui' as _i12;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/onboarding/verify_backup_key_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/currency_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/add_custom_node_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i9;
import 'dart:ui' as _i11;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/node_details_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i9;
import 'dart:ui' as _i11;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:ui' as _i7;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_backup_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rescan_warning_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i7;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i14;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/settings_view/settings_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i7;
import 'dart:ui' as _i9;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/wallet_view/confirm_send_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/wallet_view/receive_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/wallet_view/send_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i12;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/screen_tests/wallet_view/wallet_view_screen_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i8;
import 'dart:ui' as _i10;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/change_now/change_now_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;
import 'dart:convert' as _i4;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/bitcoin/bitcoin_wallet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
@ -26,8 +24,8 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
@ -36,8 +34,18 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
);
}
class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_1(
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeElectrumX_2 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_2(
Object parent,
Invocation parentInvocation,
) : super(
@ -76,6 +84,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -94,9 +111,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -105,9 +122,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i4.Future<dynamic>.value(),
@ -116,7 +133,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -126,7 +143,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -367,7 +384,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -386,7 +403,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,
@ -408,7 +425,7 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
@override
_i3.ElectrumX get electrumXClient => (super.noSuchMethod(
Invocation.getter(#electrumXClient),
returnValue: _FakeElectrumX_1(
returnValue: _FakeElectrumX_2(
this,
Invocation.getter(#electrumXClient),
),

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/bitcoincash/bitcoincash_wallet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
@ -26,8 +24,8 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
@ -36,8 +34,18 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
);
}
class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_1(
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeElectrumX_2 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_2(
Object parent,
Invocation parentInvocation,
) : super(
@ -76,6 +84,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -94,9 +111,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -105,9 +122,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i4.Future<dynamic>.value(),
@ -116,7 +133,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -126,7 +143,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -367,7 +384,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -386,7 +403,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,
@ -408,7 +425,7 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
@override
_i3.ElectrumX get electrumXClient => (super.noSuchMethod(
Invocation.getter(#electrumXClient),
returnValue: _FakeElectrumX_1(
returnValue: _FakeElectrumX_2(
this,
Invocation.getter(#electrumXClient),
),

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/dogecoin/dogecoin_wallet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
@ -26,8 +24,8 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
@ -36,8 +34,18 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
);
}
class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_1(
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeElectrumX_2 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_2(
Object parent,
Invocation parentInvocation,
) : super(
@ -76,6 +84,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -94,9 +111,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -105,9 +122,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i4.Future<dynamic>.value(),
@ -116,7 +133,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -126,7 +143,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -367,7 +384,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -386,7 +403,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,
@ -408,7 +425,7 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
@override
_i3.ElectrumX get electrumXClient => (super.noSuchMethod(
Invocation.getter(#electrumXClient),
returnValue: _FakeElectrumX_1(
returnValue: _FakeElectrumX_2(
this,
Invocation.getter(#electrumXClient),
),

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/firo/firo_wallet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
@ -32,8 +30,8 @@ import 'package:tuple/tuple.dart' as _i13;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
@ -42,8 +40,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
);
}
class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_1(
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
@ -52,8 +50,8 @@ class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
);
}
class _FakeIsar_2 extends _i1.SmartFake implements _i4.Isar {
_FakeIsar_2(
class _FakeElectrumX_2 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_2(
Object parent,
Invocation parentInvocation,
) : super(
@ -62,9 +60,19 @@ class _FakeIsar_2 extends _i1.SmartFake implements _i4.Isar {
);
}
class _FakeQueryBuilder_3<OBJ, R, S> extends _i1.SmartFake
class _FakeIsar_3 extends _i1.SmartFake implements _i4.Isar {
_FakeIsar_3(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeQueryBuilder_4<OBJ, R, S> extends _i1.SmartFake
implements _i4.QueryBuilder<OBJ, R, S> {
_FakeQueryBuilder_3(
_FakeQueryBuilder_4(
Object parent,
Invocation parentInvocation,
) : super(
@ -103,6 +111,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -121,9 +138,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i5.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -132,9 +149,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i5.Future<dynamic>.value(),
@ -143,7 +160,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i5.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -153,7 +170,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -394,7 +411,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -413,7 +430,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,
@ -435,7 +452,7 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX {
@override
_i3.ElectrumX get electrumXClient => (super.noSuchMethod(
Invocation.getter(#electrumXClient),
returnValue: _FakeElectrumX_1(
returnValue: _FakeElectrumX_2(
this,
Invocation.getter(#electrumXClient),
),
@ -603,7 +620,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
@override
_i4.Isar get isar => (super.noSuchMethod(
Invocation.getter(#isar),
returnValue: _FakeIsar_2(
returnValue: _FakeIsar_3(
this,
Invocation.getter(#isar),
),
@ -688,7 +705,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
#getAddresses,
[walletId],
),
returnValue: _FakeQueryBuilder_3<_i12.Address, _i12.Address,
returnValue: _FakeQueryBuilder_4<_i12.Address, _i12.Address,
_i4.QAfterWhereClause>(
this,
Invocation.method(
@ -761,7 +778,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
#getTransactions,
[walletId],
),
returnValue: _FakeQueryBuilder_3<_i12.Transaction, _i12.Transaction,
returnValue: _FakeQueryBuilder_4<_i12.Transaction, _i12.Transaction,
_i4.QAfterWhereClause>(
this,
Invocation.method(
@ -829,7 +846,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
[walletId],
),
returnValue:
_FakeQueryBuilder_3<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>(
_FakeQueryBuilder_4<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>(
this,
Invocation.method(
#getUTXOs,
@ -868,8 +885,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
utxos,
],
),
returnValue: _i5.Future<bool>.value(),
returnValueForMissingStub: _i5.Future<bool>.value(),
returnValue: _i5.Future<bool>.value(false),
) as _i5.Future<bool>);
@override
_i5.Stream<_i12.UTXO?> watchUTXO({
@ -896,7 +912,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
#getTransactionNotes,
[walletId],
),
returnValue: _FakeQueryBuilder_3<_i12.TransactionNote,
returnValue: _FakeQueryBuilder_4<_i12.TransactionNote,
_i12.TransactionNote, _i4.QAfterWhereClause>(
this,
Invocation.method(
@ -965,7 +981,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
#getAddressLabels,
[walletId],
),
returnValue: _FakeQueryBuilder_3<_i12.AddressLabel,
returnValue: _FakeQueryBuilder_4<_i12.AddressLabel,
_i12.AddressLabel, _i4.QAfterWhereClause>(
this,
Invocation.method(
@ -1107,7 +1123,7 @@ class MockMainDB extends _i1.Mock implements _i9.MainDB {
#getEthContracts,
[],
),
returnValue: _FakeQueryBuilder_3<_i12.EthContract, _i12.EthContract,
returnValue: _FakeQueryBuilder_4<_i12.EthContract, _i12.EthContract,
_i4.QWhere>(
this,
Invocation.method(

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/manager_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i11;
@ -105,8 +103,18 @@ class _FakeAmount_6 extends _i1.SmartFake implements _i8.Amount {
);
}
class _FakeDecimal_7 extends _i1.SmartFake implements _i9.Decimal {
_FakeDecimal_7(
class _FakeDuration_7 extends _i1.SmartFake implements Duration {
_FakeDuration_7(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeDecimal_8 extends _i1.SmartFake implements _i9.Decimal {
_FakeDecimal_8(
Object parent,
Invocation parentInvocation,
) : super(
@ -1074,6 +1082,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_7(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -1092,9 +1109,9 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
_i11.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1103,9 +1120,9 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i11.Future<dynamic>.value(),
@ -1114,7 +1131,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
_i11.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -1124,7 +1141,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -1365,7 +1382,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i11.Future<_i9.Decimal>.value(_FakeDecimal_7(
returnValue: _i11.Future<_i9.Decimal>.value(_FakeDecimal_8(
this,
Invocation.method(
#estimateFee,
@ -1384,7 +1401,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i11.Future<_i9.Decimal>.value(_FakeDecimal_7(
returnValue: _i11.Future<_i9.Decimal>.value(_FakeDecimal_8(
this,
Invocation.method(
#relayFee,

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/namecoin/namecoin_wallet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
@ -26,8 +24,8 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
@ -36,8 +34,18 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
);
}
class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_1(
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeElectrumX_2 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_2(
Object parent,
Invocation parentInvocation,
) : super(
@ -76,6 +84,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -94,9 +111,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -105,9 +122,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i4.Future<dynamic>.value(),
@ -116,7 +133,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -126,7 +143,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -367,7 +384,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -386,7 +403,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,
@ -408,7 +425,7 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
@override
_i3.ElectrumX get electrumXClient => (super.noSuchMethod(
Invocation.getter(#electrumXClient),
returnValue: _FakeElectrumX_1(
returnValue: _FakeElectrumX_2(
this,
Invocation.getter(#electrumXClient),
),

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/coins/particl/particl_wallet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
@ -26,8 +24,8 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_0(
class _FakeDuration_0 extends _i1.SmartFake implements Duration {
_FakeDuration_0(
Object parent,
Invocation parentInvocation,
) : super(
@ -36,8 +34,18 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal {
);
}
class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_1(
class _FakeDecimal_1 extends _i1.SmartFake implements _i2.Decimal {
_FakeDecimal_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeElectrumX_2 extends _i1.SmartFake implements _i3.ElectrumX {
_FakeElectrumX_2(
Object parent,
Invocation parentInvocation,
) : super(
@ -76,6 +84,15 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
returnValueForMissingStub: null,
);
@override
Duration get connectionTimeoutForSpecialCaseJsonRPCClients =>
(super.noSuchMethod(
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
returnValue: _FakeDuration_0(
this,
Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients),
),
) as Duration);
@override
String get host => (super.noSuchMethod(
Invocation.getter(#host),
returnValue: '',
@ -94,9 +111,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<dynamic> request({
required String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2,
Duration? requestTimeout = const Duration(seconds: 60),
}) =>
(super.noSuchMethod(
Invocation.method(
@ -105,9 +122,9 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries,
#requestTimeout: requestTimeout,
},
),
returnValue: _i4.Future<dynamic>.value(),
@ -116,7 +133,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
_i4.Future<List<Map<String, dynamic>>> batchRequest({
required String? command,
required Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
Duration? requestTimeout = const Duration(seconds: 60),
int? retries = 2,
}) =>
(super.noSuchMethod(
@ -126,7 +143,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
{
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestTimeout: requestTimeout,
#retries: retries,
},
),
@ -367,7 +384,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
#blocks: blocks,
},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#estimateFee,
@ -386,7 +403,7 @@ class MockElectrumX extends _i1.Mock implements _i3.ElectrumX {
[],
{#requestID: requestID},
),
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0(
returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_1(
this,
Invocation.method(
#relayFee,
@ -408,7 +425,7 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
@override
_i3.ElectrumX get electrumXClient => (super.noSuchMethod(
Invocation.getter(#electrumXClient),
returnValue: _FakeElectrumX_1(
returnValue: _FakeElectrumX_2(
this,
Invocation.getter(#electrumXClient),
),

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/services/wallets_service_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/address_book_card_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:ui' as _i5;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/custom_buttons/favorite_toggle_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:typed_data' as _i6;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/custom_loading_overlay_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:typed_data' as _i6;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/desktop/desktop_scaffold_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:typed_data' as _i6;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/managed_favorite_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i23;
import 'dart:typed_data' as _i29;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/node_card_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:ui' as _i7;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/node_options_sheet_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i11;
import 'dart:ui' as _i13;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/table_view/table_view_row_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i22;
import 'dart:typed_data' as _i27;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/trade_card_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:typed_data' as _i6;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/transaction_card_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i19;
import 'dart:typed_data' as _i34;
@ -3215,8 +3213,7 @@ class MockMainDB extends _i1.Mock implements _i14.MainDB {
utxos,
],
),
returnValue: _i19.Future<void>.value(),
returnValueForMissingStub: _i19.Future<void>.value(),
returnValue: _i19.Future<bool>.value(false),
) as _i19.Future<bool>);
@override
_i19.Stream<_i22.UTXO?> watchUTXO({

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/wallet_card_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i21;
import 'dart:typed_data' as _i28;

View file

@ -1,9 +1,7 @@
// Mocks generated by Mockito 5.4.1 from annotations
// Mocks generated by Mockito 5.4.2 from annotations
// in stackwallet/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.dart.
// Do not manually edit this file.
// @dart=2.19
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i23;
import 'dart:typed_data' as _i29;

Some files were not shown because too many files have changed in this diff Show more