Merge remote-tracking branch 'origin/staging' into staging

# Conflicts:
#	lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart
This commit is contained in:
detherminal 2023-04-27 21:22:04 +03:00
commit 7ea374d6e4
43 changed files with 1700 additions and 2127 deletions

View file

@ -0,0 +1 @@
{"v":"5.10.2","fr":30,"ip":0,"op":60,"w":30,"h":30,"nm":"arrow-rotate","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"arrow-rotate","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":44,"s":[200]},{"t":60,"s":[360]}],"ix":10},"p":{"a":0,"k":[15,15,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-0.828],[0,0],[3.389,0],[1.441,-4.074],[-0.781,-0.277],[-0.276,0.778],[-3.22,0],[-1.369,-1.823],[0,0],[0,-0.83],[-0.83,0],[0,0],[-0.023,0],[0,0],[0,0.83],[0,0],[0.83,0]],"o":[[0,0],[-1.964,-2.437],[-4.533,0],[-0.276,0.741],[0.781,0.277],[1.031,-2.916],[2.494,0],[0,0],[-0.83,0],[0,0.83],[0,0],[0.023,0],[0,0],[0.83,0],[0,0],[0,-0.828],[-0.83,0]],"v":[[8.25,-8.25],[8.25,-6.497],[-0.042,-10.5],[-9.902,-3.502],[-8.988,-1.584],[-7.073,-2.498],[-0.042,-7.5],[6,-4.5],[4.5,-4.5],[3,-3],[4.5,-1.5],[8.452,-1.5],[8.522,-1.5],[9.75,-1.5],[11.25,-3],[11.25,-8.25],[9.75,-9.75]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[-0.828,0],[0,0.83],[0,0],[-3.347,0],[-1.439,4.073],[0.783,0.277],[0.277,-0.778],[3.262,0],[1.411,1.823],[0,0],[0,0.83],[0.83,0],[0,0],[0,-0.83]],"o":[[0,0.83],[0.828,0],[0,0],[1.922,2.438],[4.575,0],[0.277,-0.783],[-0.778,-0.277],[-1.031,2.916],[-2.452,0],[0,0],[0.83,0],[0,-0.83],[0,0],[-0.828,0],[0,0]],"v":[[-11.25,8.25],[-9.75,9.75],[-8.25,8.25],[-8.25,6.497],[0,10.5],[9.9,3.502],[8.986,1.584],[7.073,2.498],[0,7.5],[-6.042,4.5],[-4.5,4.5],[-3,3],[-4.5,1.5],[-9.75,1.5],[-11.25,3]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.137254908681,0.137254908681,0.137254908681,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Vector","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"ct":1,"bm":0}],"markers":[]}

View file

@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.66875V2.5C13.5 1.94781 13.9469 1.5 14.5 1.5C15.0531 1.5 15.5 1.94781 15.5 2.5V6C15.5 6.55313 15.0531 7 14.5 7H13.6812C13.6656 7 13.65 7 13.6344 7H11C10.4469 7 10 6.55313 10 6C10 5.44688 10.4469 5 11 5H12C11.0875 3.78438 9.63438 3 7.97188 3C5.825 3 3.97187 4.39062 3.28437 6.33437C3.10031 6.85312 2.52875 7.12812 2.00813 6.94375C1.4875 6.75937 1.21438 6.15938 1.39844 5.66563C2.35906 2.94938 4.95 1 7.97188 1C10.2313 1 12.1906 2.04438 13.5 3.66875ZM1.5 14.5C0.947812 14.5 0.5 14.0531 0.5 13.5V10C0.5 9.44688 0.947812 9 1.5 9H5C5.55313 9 6 9.44688 6 10C6 10.5531 5.55313 11 5 11H3.97187C4.9125 12.2156 6.36563 13 8 13C10.175 13 12.0281 11.6094 12.7156 9.66562C12.9 9.14687 13.4719 8.87187 13.9906 9.05625C14.5125 9.24062 14.7844 9.8125 14.6 10.3344C13.6406 13.05 11.05 15 8 15C5.76875 15 3.78125 13.9563 2.5 12.3313V13.5C2.5 14.0531 2.05219 14.5 1.5 14.5Z" fill="#232323"/>
</svg>

Before

Width:  |  Height:  |  Size: 992 B

View file

@ -9,7 +9,7 @@ Here you will find instructions on how to install the necessary tools for buildi
The following prerequisites can be installed with the setup script [`scripts/setup.sh`](./../scripts/setup.sh) or manually as described below:
- Flutter 3.7.6 [(install manually or with git, do not install with snap)](https://docs.flutter.dev/get-started/install)
- Flutter 3.7.11 [(install manually or with git, do not install with snap)](https://docs.flutter.dev/get-started/install)
- Dart SDK Requirement (>=2.19.0, up until <3.0.0) (normally included with a flutter install)
- Android setup ([Android Studio](https://developer.android.com/studio) and subsequent dependencies)
@ -41,11 +41,17 @@ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-
Install [Rust](https://www.rust-lang.org/tools/install) with command:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install 1.67.1
rustup default 1.67.1
```
Install the additional components for Rust:
```
cargo install cargo-ndk
cargo install cargo-ndk --version 2.12.7
```
Android specific dependencies:
```
sudo apt-get install libc6-dev-i386
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
```
Linux desktop specific dependencies:

View file

@ -4,6 +4,7 @@ import 'package:stackwallet/models/paynym/paynym_code.dart';
class PaynymAccount {
final String nymID;
final String nymName;
final bool segwit;
final List<PaynymCode> codes;
@ -13,9 +14,13 @@ class PaynymAccount {
/// list of nymId
final List<PaynymAccountLite> following;
PaynymCode get nonSegwitPaymentCode =>
codes.firstWhere((element) => !element.segwit);
PaynymAccount(
this.nymID,
this.nymName,
this.segwit,
this.codes,
this.followers,
this.following,
@ -24,6 +29,7 @@ class PaynymAccount {
PaynymAccount.fromMap(Map<String, dynamic> map)
: nymID = map["nymID"] as String,
nymName = map["nymName"] as String,
segwit = map["segwit"] as bool,
codes = (map["codes"] as List<dynamic>)
.map((e) => PaynymCode.fromMap(Map<String, dynamic>.from(e as Map)))
.toList(),
@ -39,6 +45,7 @@ class PaynymAccount {
PaynymAccount copyWith({
String? nymID,
String? nymName,
bool? segwit,
List<PaynymCode>? codes,
List<PaynymAccountLite>? followers,
List<PaynymAccountLite>? following,
@ -46,6 +53,7 @@ class PaynymAccount {
return PaynymAccount(
nymID ?? this.nymID,
nymName ?? this.nymName,
segwit ?? this.segwit,
codes ?? this.codes,
followers ?? this.followers,
following ?? this.following,
@ -55,6 +63,7 @@ class PaynymAccount {
Map<String, dynamic> toMap() => {
"nymID": nymID,
"nymName": nymName,
"segwit": segwit,
"codes": codes.map((e) => e.toMap()),
"followers": followers.map((e) => e.toMap()),
"following": followers.map((e) => e.toMap()),

View file

@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
@ -21,37 +20,15 @@ class RestoringDialog extends StatefulWidget {
State<RestoringDialog> createState() => _RestoringDialogState();
}
class _RestoringDialogState extends State<RestoringDialog>
with TickerProviderStateMixin {
late AnimationController? _spinController;
late Animation<double> _spinAnimation;
class _RestoringDialogState extends State<RestoringDialog> {
late final Future<void> Function() onCancel;
@override
void initState() {
onCancel = widget.onCancel;
_spinController = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
)..repeat();
_spinAnimation = CurvedAnimation(
parent: _spinController!,
curve: Curves.linear,
);
super.initState();
}
@override
void dispose() {
_spinController?.dispose();
_spinController = null;
super.dispose();
}
@override
Widget build(BuildContext context) {
if (Util.isDesktop) {
@ -69,14 +46,9 @@ class _RestoringDialogState extends State<RestoringDialog>
const Spacer(
flex: 1,
),
RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(Assets.svg.arrowRotate3,
const RotatingArrows(
width: 40,
height: 40,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
const Spacer(
flex: 2,
@ -127,14 +99,9 @@ class _RestoringDialogState extends State<RestoringDialog>
child: StackDialog(
title: "Restoring wallet",
message: "This may take a while. Please do not exit this screen.",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(Assets.svg.arrowRotate3,
icon: const RotatingArrows(
width: 24,
height: 24,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
rightButton: TextButton(
style: Theme.of(context)

View file

@ -109,7 +109,7 @@ class _ConfirmChangeNowSendViewState
time,
]);
sendProgressController.triggerSuccess();
sendProgressController.triggerSuccess?.call();
await Future<void>.delayed(const Duration(seconds: 5));
txid = results.first as String;

View file

@ -447,7 +447,7 @@ class _AddNewPaynymFollowViewState
child: PaynymCard(
key: UniqueKey(),
label: _searchResult!.nymName,
paymentCodeString: _searchResult!.codes.first.code,
paymentCodeString: _searchResult!.nonSegwitPaymentCode.code,
walletId: widget.walletId,
),
),

View file

@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
@ -18,34 +17,7 @@ class ClaimingPaynymDialog extends StatefulWidget {
State<ClaimingPaynymDialog> createState() => _RestoringDialogState();
}
class _RestoringDialogState extends State<ClaimingPaynymDialog>
with TickerProviderStateMixin {
late AnimationController? _spinController;
late Animation<double> _spinAnimation;
@override
void initState() {
_spinController = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
)..repeat();
_spinAnimation = CurvedAnimation(
parent: _spinController!,
curve: Curves.linear,
);
super.initState();
}
@override
void dispose() {
_spinController?.dispose();
_spinController = null;
super.dispose();
}
class _RestoringDialogState extends State<ClaimingPaynymDialog> {
@override
Widget build(BuildContext context) {
if (Util.isDesktop) {
@ -62,16 +34,10 @@ class _RestoringDialogState extends State<ClaimingPaynymDialog>
),
],
),
RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
const RotatingArrows(
width: 40,
height: 40,
),
),
Padding(
padding: const EdgeInsets.all(40),
child: Column(
@ -115,16 +81,10 @@ class _RestoringDialogState extends State<ClaimingPaynymDialog>
child: StackDialog(
title: "Claiming PayNym",
message: "We are generating your PayNym",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
icon: const RotatingArrows(
width: 24,
height: 24,
),
),
rightButton: SecondaryButton(
label: "Cancel",
onPressed: () {

View file

@ -55,7 +55,7 @@ class PaynymQrPopup extends StatelessWidget {
child: Row(
children: [
PayNymBot(
paymentCodeString: paynymAccount.codes.first.code,
paymentCodeString: paynymAccount.nonSegwitPaymentCode.code,
size: isDesktop ? 56 : 36,
),
const SizedBox(
@ -108,7 +108,7 @@ class PaynymQrPopup extends StatelessWidget {
height: 6,
),
Text(
paynymAccount.codes.first.code,
paynymAccount.nonSegwitPaymentCode.code,
style: isDesktop
? STextStyles.desktopTextSmall(context)
: STextStyles.infoSmall(context).copyWith(
@ -127,7 +127,7 @@ class PaynymQrPopup extends StatelessWidget {
onTap: () async {
await Clipboard.setData(
ClipboardData(
text: paynymAccount.codes.first.code,
text: paynymAccount.nonSegwitPaymentCode.code,
),
);
unawaited(
@ -150,7 +150,7 @@ class PaynymQrPopup extends StatelessWidget {
QrImage(
padding: const EdgeInsets.all(0),
size: 130,
data: paynymAccount.codes.first.code,
data: paynymAccount.nonSegwitPaymentCode.code,
foregroundColor:
Theme.of(context).extension<StackColors>()!.textDark,
),

View file

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/models/paynym/paynym_account.dart';
import 'package:stackwallet/pages/paynym/dialogs/claiming_paynym_dialog.dart';
import 'package:stackwallet/pages/paynym/paynym_home_view.dart';
import 'package:stackwallet/pages/wallet_view/wallet_view.dart';
@ -11,7 +12,6 @@ import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/providers/wallet/my_paynym_account_state_provider.dart';
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
@ -36,6 +36,29 @@ class PaynymClaimView extends ConsumerStatefulWidget {
}
class _PaynymClaimViewState extends ConsumerState<PaynymClaimView> {
Future<bool> _addSegwitCode(PaynymAccount myAccount) async {
final manager =
ref.read(walletsChangeNotifierProvider).getManager(widget.walletId);
// get wallet to access paynym calls
final wallet = manager.wallet as PaynymWalletInterface;
final token = await ref
.read(paynymAPIProvider)
.token(myAccount.nonSegwitPaymentCode.code);
final signature = await wallet.signStringWithNotificationKey(token.value!);
final pCodeSegwit = await wallet.getPaymentCode(isSegwit: true);
final addResult = await ref.read(paynymAPIProvider).add(
token.value!,
signature,
myAccount.nymID,
pCodeSegwit.toString(),
);
return addResult.value ?? false;
}
@override
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
@ -169,8 +192,7 @@ class _PaynymClaimViewState extends ConsumerState<PaynymClaimView> {
if (shouldCancel) return;
// get payment code
final pCode = await wallet.getPaymentCode(
DerivePathTypeExt.primaryFor(manager.coin));
final pCode = await wallet.getPaymentCode(isSegwit: false);
if (shouldCancel) return;
@ -185,6 +207,18 @@ class _PaynymClaimViewState extends ConsumerState<PaynymClaimView> {
if (created.value!.claimed) {
// payment code already claimed
debugPrint("pcode already claimed!!");
final account =
await ref.read(paynymAPIProvider).nym(pCode.toString());
if (!account.value!.segwit) {
for (int i = 0; i < 100; i++) {
final result = await _addSegwitCode(account.value!);
if (result == true) {
break;
}
}
}
if (mounted) {
if (isDesktop) {
Navigator.of(context, rootNavigator: true).pop();
@ -223,6 +257,14 @@ class _PaynymClaimViewState extends ConsumerState<PaynymClaimView> {
if (claim.value?.claimed == pCode.toString()) {
final account =
await ref.read(paynymAPIProvider).nym(pCode.toString());
if (!account.value!.segwit) {
for (int i = 0; i < 100; i++) {
final result = await _addSegwitCode(account.value!);
if (result == true) {
break;
}
}
}
ref.read(myPaynymAccountStateProvider.state).state =
account.value!;

View file

@ -275,8 +275,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
paymentCodeString: ref
.watch(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
),
),
@ -298,8 +297,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
ref
.watch(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
12,
5),
@ -330,8 +328,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
text: ref
.read(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
),
);
@ -376,8 +373,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
ref
.read(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
sharePositionOrigin: sharePositionOrigin);
},
@ -447,8 +443,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
paymentCodeString: ref
.watch(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
),
),
@ -473,8 +468,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
ref
.watch(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
12,
5),
@ -501,8 +495,7 @@ class _PaynymHomeViewState extends ConsumerState<PaynymHomeView> {
text: ref
.read(myPaynymAccountStateProvider.state)
.state!
.codes
.first
.nonSegwitPaymentCode
.code,
),
);

View file

@ -8,7 +8,6 @@ import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/providers/wallet/my_paynym_account_state_provider.dart';
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
@ -75,7 +74,7 @@ class _PaynymFollowersListState extends ConsumerState<PaynymFollowersList> {
// get payment code
final pCode = await wallet.getPaymentCode(
DerivePathTypeExt.primaryFor(manager.coin),
isSegwit: false,
);
// get account from api

View file

@ -8,7 +8,6 @@ import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/providers/wallet/my_paynym_account_state_provider.dart';
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
@ -75,7 +74,7 @@ class _PaynymFollowingListState extends ConsumerState<PaynymFollowingList> {
// get payment code
final pCode = await wallet.getPaymentCode(
DerivePathTypeExt.primaryFor(manager.coin),
isSegwit: false,
);
// get account from api

View file

@ -233,6 +233,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
children: [
GestureDetector(
onTap: () {
HapticFeedback.lightImpact();
clipboard.setData(
ClipboardData(text: receivingAddress),
);

View file

@ -135,7 +135,7 @@ class _ConfirmTransactionViewState
time,
]);
sendProgressController.triggerSuccess();
sendProgressController.triggerSuccess?.call();
await Future<void>.delayed(const Duration(seconds: 5));
txid = results.first as String;

View file

@ -453,11 +453,12 @@ class _SendViewState extends ConsumerState<SendView> {
final wallet = manager.wallet as PaynymWalletInterface;
final paymentCode = PaymentCode.fromPaymentCode(
widget.accountLite!.code,
wallet.networkType,
networkType: wallet.networkType,
);
final feeRate = ref.read(feeRateTypeStateProvider);
txDataFuture = wallet.preparePaymentCodeSend(
paymentCode: paymentCode,
isSegwit: widget.accountLite!.segwit,
amount: amount,
args: {
"feeRate": feeRate,

View file

@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -23,38 +23,16 @@ class BuildingTransactionDialog extends StatefulWidget {
State<BuildingTransactionDialog> createState() => _RestoringDialogState();
}
class _RestoringDialogState extends State<BuildingTransactionDialog>
with TickerProviderStateMixin {
late AnimationController? _spinController;
late Animation<double> _spinAnimation;
class _RestoringDialogState extends State<BuildingTransactionDialog> {
late final VoidCallback onCancel;
@override
void initState() {
onCancel = widget.onCancel;
_spinController = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
)..repeat();
_spinAnimation = CurvedAnimation(
parent: _spinController!,
curve: Curves.linear,
);
super.initState();
}
@override
void dispose() {
_spinController?.dispose();
_spinController = null;
super.dispose();
}
@override
Widget build(BuildContext context) {
final isChans = Theme.of(context).extension<StackColors>()!.themeType ==
@ -80,15 +58,9 @@ class _RestoringDialogState extends State<BuildingTransactionDialog>
),
),
if (!isChans)
RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
width: 24,
height: 24,
),
const RotatingArrows(
width: 40,
height: 40,
),
const SizedBox(
height: 40,
@ -151,17 +123,10 @@ class _RestoringDialogState extends State<BuildingTransactionDialog>
)
: StackDialog(
title: "Generating transaction",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
icon: const RotatingArrows(
width: 24,
height: 24,
),
),
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!

View file

@ -113,7 +113,7 @@ class _RestoringDialogState extends State<SendingTransactionDialog> {
}
class ProgressAndSuccessController {
late VoidCallback triggerSuccess;
VoidCallback? triggerSuccess;
}
class ProgressAndSuccess extends StatefulWidget {

View file

@ -162,7 +162,7 @@ class GlobalSettingsView extends StatelessWidget {
height: 8,
),
SettingsListButton(
iconAssetName: Assets.svg.arrowRotate3,
iconAssetName: Assets.svg.arrowRotate,
iconSize: 18,
title: "Syncing preferences",
onPressed: () {

View file

@ -214,7 +214,7 @@ class _StackRestoreProgressViewState
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
_restore();
unawaited(_restore());
});
super.initState();
}
@ -325,7 +325,7 @@ class _StackRestoreProgressViewState
: null,
)
: RoundedContainer(
padding: EdgeInsets.all(0),
padding: EdgeInsets.zero,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
@ -411,7 +411,7 @@ class _StackRestoreProgressViewState
: null,
)
: RoundedContainer(
padding: EdgeInsets.all(0),
padding: EdgeInsets.zero,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
@ -497,7 +497,7 @@ class _StackRestoreProgressViewState
: null,
)
: RoundedContainer(
padding: EdgeInsets.all(0),
padding: EdgeInsets.zero,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
@ -548,8 +548,7 @@ class _StackRestoreProgressViewState
final state = ref.watch(stackRestoringUIStateProvider
.select((value) => value.trades));
return !isDesktop
? Container(
child: RestoringItemCard(
? RestoringItemCard(
left: SizedBox(
width: 32,
height: 32,
@ -560,7 +559,7 @@ class _StackRestoreProgressViewState
.buttonBackSecondary,
child: Center(
child: SvgPicture.asset(
Assets.svg.arrowRotate2,
Assets.svg.arrowsTwoWay,
width: 16,
height: 16,
color: Theme.of(context)
@ -582,10 +581,9 @@ class _StackRestoreProgressViewState
style: STextStyles.errorSmall(context),
)
: null,
),
)
: RoundedContainer(
padding: EdgeInsets.all(0),
padding: EdgeInsets.zero,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
@ -603,7 +601,7 @@ class _StackRestoreProgressViewState
.buttonBackSecondary,
child: Center(
child: SvgPicture.asset(
Assets.svg.arrowRotate2,
Assets.svg.arrowsTwoWay,
width: 16,
height: 16,
color: Theme.of(context)

View file

@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
import 'package:stackwallet/widgets/conditional_parent.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -66,18 +64,12 @@ class _RescanningDialogState extends State<RescanningDialog>
maxWidth: 500,
child: child,
),
child: StackDialog(
child: const StackDialog(
title: "Rescanning blockchain",
message: "This may take a while. Please do not exit this screen.",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate3,
icon: RotatingArrows(
width: 24,
height: 24,
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
),
),
// rightButton: TextButton(
// style: Theme.of(context).textButtonTheme.style?.copyWith(

View file

@ -269,7 +269,7 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
height: 8,
),
SettingsListButton(
iconAssetName: Assets.svg.arrowRotate3,
iconAssetName: Assets.svg.arrowRotate,
title: "Syncing preferences",
onPressed: () {
Navigator.of(context).pushNamed(

View file

@ -3,15 +3,14 @@ import 'dart:async';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/pages/token_view/token_view.dart';
import 'package:stackwallet/providers/global/wallets_provider.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/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
/// [eventBus] should only be set during testing
class WalletRefreshButton extends ConsumerStatefulWidget {
@ -36,30 +35,16 @@ class WalletRefreshButton extends ConsumerStatefulWidget {
ConsumerState<WalletRefreshButton> createState() => _RefreshButtonState();
}
class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
with TickerProviderStateMixin {
class _RefreshButtonState extends ConsumerState<WalletRefreshButton> {
late final EventBus eventBus;
late AnimationController? _spinController;
late Animation<double> _spinAnimation;
late RotatingArrowsController _spinController;
late StreamSubscription<dynamic> _syncStatusSubscription;
@override
void initState() {
_spinController = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
);
_spinAnimation = CurvedAnimation(
parent: _spinController!,
curve: Curves.linear,
);
if (widget.initialSyncStatus == WalletSyncStatus.syncing) {
_spinController?.repeat();
}
_spinController = RotatingArrowsController();
eventBus =
widget.eventBus != null ? widget.eventBus! : GlobalEventBus.instance;
@ -71,26 +56,26 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
widget.tokenContractAddress == null) {
switch (event.newStatus) {
case WalletSyncStatus.unableToSync:
_spinController?.stop();
_spinController.stop?.call();
break;
case WalletSyncStatus.synced:
_spinController?.stop();
_spinController.stop?.call();
break;
case WalletSyncStatus.syncing:
unawaited(_spinController?.repeat());
_spinController.repeat?.call();
break;
}
} else if (widget.tokenContractAddress != null &&
event.walletId == widget.walletId + widget.tokenContractAddress!) {
switch (event.newStatus) {
case WalletSyncStatus.unableToSync:
_spinController?.stop();
_spinController.stop?.call();
break;
case WalletSyncStatus.synced:
_spinController?.stop();
_spinController.stop?.call();
break;
case WalletSyncStatus.syncing:
unawaited(_spinController?.repeat());
_spinController.repeat?.call();
break;
}
}
@ -102,9 +87,6 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
@override
void dispose() {
_spinController?.dispose();
_spinController = null;
_syncStatusSubscription.cancel();
super.dispose();
@ -117,9 +99,6 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
return SizedBox(
height: isDesktop ? 22 : 36,
width: isDesktop ? 22 : 36,
child: Semantics(
label: "Refresh Button. Refreshes The Values In Page.",
excludeSemantics: true,
child: MaterialButton(
color: isDesktop
? Theme.of(context).extension<StackColors>()!.buttonBackSecondary
@ -132,11 +111,11 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
.getManagerProvider(widget.walletId);
final isRefreshing = ref.read(managerProvider).isRefreshing;
if (!isRefreshing) {
_spinController?.repeat();
_spinController.repeat?.call();
ref
.read(managerProvider)
.refresh()
.then((_) => _spinController?.stop());
.then((_) => _spinController.stop?.call());
}
} else {
if (!ref.read(tokenServiceProvider)!.isRefreshing) {
@ -154,12 +133,11 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
Constants.size.circularBorderRadius,
),
),
child: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
child: RotatingArrows(
spinByDefault: widget.initialSyncStatus == WalletSyncStatus.syncing,
width: isDesktop ? 12 : 24,
height: isDesktop ? 12 : 24,
controller: _spinController,
color: widget.overrideIconColor != null
? widget.overrideIconColor!
: isDesktop
@ -171,8 +149,6 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
.textFavoriteCard,
),
),
),
)
);
}
}

View file

@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class CancellingTransactionProgressDialog extends StatefulWidget {
@ -13,51 +11,19 @@ class CancellingTransactionProgressDialog extends StatefulWidget {
}
class _CancellingTransactionProgressDialogState
extends State<CancellingTransactionProgressDialog>
with TickerProviderStateMixin {
late AnimationController? _spinController;
late Animation<double> _spinAnimation;
@override
void initState() {
_spinController = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
)..repeat();
_spinAnimation = CurvedAnimation(
parent: _spinController!,
curve: Curves.linear,
);
super.initState();
}
@override
void dispose() {
_spinController?.dispose();
_spinController = null;
super.dispose();
}
extends State<CancellingTransactionProgressDialog> {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
return false;
},
child: StackDialog(
child: const StackDialog(
title: "Cancelling transaction",
message: "This may take a while. Please do not exit this screen.",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate3,
icon: RotatingArrows(
width: 24,
height: 24,
color: Theme.of(context).extension<StackColors>()!.accentColorDark,
),
),
// rightButton: TextButton(
// style: Theme.of(context).textButtonTheme.style?.copyWith(

View file

@ -43,7 +43,6 @@ import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/show_loading.dart';
@ -912,7 +911,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
manager.wallet as PaynymWalletInterface;
final code = await paynymInterface.getPaymentCode(
DerivePathTypeExt.primaryFor(manager.coin));
isSegwit: false,
);
final account = await ref
.read(paynymAPIProvider)
@ -928,7 +928,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
// check if account exists and for matching code to see if claimed
if (account.value != null &&
account.value!.codes.first.claimed) {
account.value!.nonSegwitPaymentCode.claimed &&
account.value!.segwit) {
ref.read(myPaynymAccountStateProvider.state).state =
account.value!;

View file

@ -262,11 +262,12 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
final wallet = manager.wallet as PaynymWalletInterface;
final paymentCode = PaymentCode.fromPaymentCode(
widget.accountLite!.code,
wallet.networkType,
networkType: wallet.networkType,
);
final feeRate = ref.read(feeRateTypeStateProvider);
txDataFuture = wallet.preparePaymentCodeSend(
paymentCode: paymentCode,
isSegwit: widget.accountLite!.segwit,
amount: amount,
args: {
"feeRate": feeRate,

View file

@ -21,7 +21,6 @@ import 'package:stackwallet/utilities/amount/amount.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/enums/derive_path_type_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
@ -271,8 +270,7 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
final wallet = manager.wallet as PaynymWalletInterface;
final code =
await wallet.getPaymentCode(DerivePathTypeExt.primaryFor(manager.coin));
final code = await wallet.getPaymentCode(isSegwit: false);
final account = await ref.read(paynymAPIProvider).nym(code.toString());
@ -285,7 +283,9 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
Navigator.of(context, rootNavigator: true).pop();
// check if account exists and for matching code to see if claimed
if (account.value != null && account.value!.codes.first.claimed) {
if (account.value != null &&
account.value!.nonSegwitPaymentCode.claimed &&
account.value!.segwit) {
ref.read(myPaynymAccountStateProvider.state).state = account.value!;
await Navigator.of(context).pushNamed(

View file

@ -164,6 +164,7 @@ class BitcoinWallet extends CoinServiceAPI
// _checkP2PKHChangeAddressForTransactions,
dustLimitP2PKH: DUST_LIMIT_P2PKH.raw.toInt(),
minConfirms: MINIMUM_CONFIRMATIONS,
dustLimit: DUST_LIMIT.raw.toInt(),
);
}
@ -422,7 +423,7 @@ class BitcoinWallet extends CoinServiceAPI
level: LogLevel.Info);
}
Future<Tuple2<List<isar_models.Address>, DerivePathType>> _checkGaps(
Future<Tuple3<List<isar_models.Address>, DerivePathType, int>> _checkGaps(
int maxNumberOfIndexesToCheck,
int maxUnusedAddressGap,
int txCountBatchSize,
@ -432,6 +433,8 @@ class BitcoinWallet extends CoinServiceAPI
) async {
List<isar_models.Address> addressArray = [];
int gapCounter = 0;
int highestIndexWithHistory = 0;
for (int index = 0;
index < maxNumberOfIndexesToCheck && gapCounter < maxUnusedAddressGap;
index += txCountBatchSize) {
@ -505,6 +508,9 @@ class BitcoinWallet extends CoinServiceAPI
if (count > 0) {
iterationsAddressArray.add(txCountCallArgs["${_id}_$k"]!);
// update highest
highestIndexWithHistory = index + k;
// reset counter
gapCounter = 0;
}
@ -517,7 +523,7 @@ class BitcoinWallet extends CoinServiceAPI
// cache all the transactions while waiting for the current function to finish.
unawaited(getTransactionCacheEarly(iterationsAddressArray));
}
return Tuple2(addressArray, type);
return Tuple3(addressArray, type, highestIndexWithHistory);
}
Future<void> getTransactionCacheEarly(List<String> allAddresses) async {
@ -561,9 +567,9 @@ class BitcoinWallet extends CoinServiceAPI
DerivePathType.bip84,
];
final List<Future<Tuple2<List<isar_models.Address>, DerivePathType>>>
final List<Future<Tuple3<List<isar_models.Address>, DerivePathType, int>>>
receiveFutures = [];
final List<Future<Tuple2<List<isar_models.Address>, DerivePathType>>>
final List<Future<Tuple3<List<isar_models.Address>, DerivePathType, int>>>
changeFutures = [];
const receiveChain = 0;
@ -622,6 +628,7 @@ class BitcoinWallet extends CoinServiceAPI
final List<isar_models.Address> addressesToStore = [];
int highestReceivingIndexWithHistory = 0;
// If restoring a wallet that never received any funds, then set receivingArray manually
// If we didn't do this, it'd store an empty array
for (final tuple in receiveResults) {
@ -633,10 +640,13 @@ class BitcoinWallet extends CoinServiceAPI
);
addressesToStore.add(address);
} else {
highestReceivingIndexWithHistory =
max(tuple.item3, highestReceivingIndexWithHistory);
addressesToStore.addAll(tuple.item1);
}
}
int highestChangeIndexWithHistory = 0;
// If restoring a wallet that never sent any funds with change, then set changeArray
// manually. If we didn't do this, it'd store an empty array.
for (final tuple in changeResults) {
@ -648,10 +658,20 @@ class BitcoinWallet extends CoinServiceAPI
);
addressesToStore.add(address);
} else {
highestChangeIndexWithHistory =
max(tuple.item3, highestChangeIndexWithHistory);
addressesToStore.addAll(tuple.item1);
}
}
// remove extra addresses to help minimize risk of creating a large gap
addressesToStore.removeWhere((e) =>
e.subType == isar_models.AddressSubType.change &&
e.derivationIndex > highestChangeIndexWithHistory);
addressesToStore.removeWhere((e) =>
e.subType == isar_models.AddressSubType.receiving &&
e.derivationIndex > highestReceivingIndexWithHistory);
if (isRescan) {
await db.updateOrPutAddresses(addressesToStore);
} else {
@ -659,10 +679,11 @@ class BitcoinWallet extends CoinServiceAPI
}
// get own payment code
final myCode = await getPaymentCode(DerivePathType.bip44, root);
// isSegwit does not matter here at all
final myCode = await getPaymentCode(isSegwit: false);
// refresh transactions to pick up any received notification transactions
await _refreshTransactions();
await _refreshNotificationAddressTransactions();
try {
final Set<String> codesToCheck = {};
@ -691,7 +712,10 @@ class BitcoinWallet extends CoinServiceAPI
);
}
await _updateUTXOs();
await Future.wait([
_refreshTransactions(),
_updateUTXOs(),
]);
await Future.wait([
updateCachedId(walletId),
@ -915,7 +939,8 @@ class BitcoinWallet extends CoinServiceAPI
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.0, walletId));
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.1, walletId));
final myCode = await getPaymentCode(DerivePathType.bip44);
// isSegwit does not matter here at all
final myCode = await getPaymentCode(isSegwit: false);
final Set<String> codesToCheck = {};
final nym = await PaynymIsApi().nym(myCode.toString());
if (nym.value != null) {
@ -1221,6 +1246,11 @@ class BitcoinWallet extends CoinServiceAPI
}
await _prefs.init();
// this will add the notification address to the db if it isn't
// already there for older wallets
await getMyNotificationAddress();
// await _checkCurrentChangeAddressesForTransactions();
// await _checkCurrentReceivingAddressesForTransactions();
}
@ -1346,10 +1376,12 @@ class BitcoinWallet extends CoinServiceAPI
.getAddresses(walletId)
.filter()
.not()
.group(
(q) => q
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.not()
.subTypeEqualTo(isar_models.AddressSubType.nonWallet)
.or()
.subTypeEqualTo(isar_models.AddressSubType.nonWallet),
)
.findAll();
return allAddresses;
}
@ -1444,6 +1476,10 @@ class BitcoinWallet extends CoinServiceAPI
_generateAddressForChain(1, 0, DerivePathType.bip49),
]);
// this will add the notification address to the db if it isn't
// already there so it can be watched
await getMyNotificationAddress();
await db.putAddresses(initialAddresses);
Logging.instance.log("_generateNewWalletFinished", level: LogLevel.Info);
@ -1517,42 +1553,6 @@ class BitcoinWallet extends CoinServiceAPI
);
}
/// Returns the latest receiving/change (external/internal) address for the wallet depending on [chain]
/// and
/// [chain] - Use 0 for receiving (external), 1 for change (internal). Should not be any other value!
Future<String> _getCurrentAddressForChain(
int chain,
DerivePathType derivePathType,
) async {
final subType = chain == 0 // Here, we assume that chain == 1 if it isn't 0
? isar_models.AddressSubType.receiving
: isar_models.AddressSubType.change;
isar_models.AddressType type;
isar_models.Address? address;
switch (derivePathType) {
case DerivePathType.bip44:
type = isar_models.AddressType.p2pkh;
break;
case DerivePathType.bip49:
type = isar_models.AddressType.p2sh;
break;
case DerivePathType.bip84:
type = isar_models.AddressType.p2wpkh;
break;
default:
throw Exception("DerivePathType unsupported");
}
address = await db
.getAddresses(walletId)
.filter()
.typeEqualTo(type)
.subTypeEqualTo(subType)
.sortByDerivationIndexDesc()
.findFirst();
return address!.value;
}
String _buildDerivationStorageKey({
required int chain,
required DerivePathType derivePathType,
@ -2020,6 +2020,60 @@ class BitcoinWallet extends CoinServiceAPI
return false;
}
Future<void> _refreshNotificationAddressTransactions() async {
final address = await getMyNotificationAddress();
final hashes = await _fetchHistory([address.value]);
List<Map<String, dynamic>> allTransactions = [];
final currentHeight = await chainHeight;
for (final txHash in hashes) {
final storedTx = await db
.getTransactions(walletId)
.filter()
.txidEqualTo(txHash["tx_hash"] as String)
.findFirst();
// TODO: remove bip47Notification type check sometime after Q2 2023
if (storedTx == null ||
storedTx.subType ==
isar_models.TransactionSubType.bip47Notification ||
!storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) {
final tx = await cachedElectrumXClient.getTransaction(
txHash: txHash["tx_hash"] as String,
verbose: true,
coin: coin,
);
tx["address"] = await db
.getAddresses(walletId)
.filter()
.valueEqualTo(txHash["address"] as String)
.findFirst();
tx["height"] = txHash["height"];
allTransactions.add(tx);
}
}
final List<Tuple2<isar_models.Transaction, isar_models.Address?>> txnsData =
[];
for (final txObject in allTransactions) {
final data = await parseTransaction(
txObject,
cachedElectrumXClient,
[address],
coin,
MINIMUM_CONFIRMATIONS,
walletId,
);
txnsData.add(data);
}
await db.addNewTransactionData(txnsData, walletId);
}
Future<void> _refreshTransactions() async {
final List<isar_models.Address> allAddresses =
await _fetchAllOwnAddresses();
@ -2282,8 +2336,7 @@ class BitcoinWallet extends CoinServiceAPI
utxoSigningData: utxoSigningData,
recipients: [
recipientAddress,
await _getCurrentAddressForChain(
1, DerivePathTypeExt.primaryFor(coin)),
await currentChangeAddress,
],
satoshiAmounts: [
satoshiAmountToSend,
@ -2326,8 +2379,7 @@ class BitcoinWallet extends CoinServiceAPI
feeForTwoOutputs) {
// generate new change address if current change address has been used
await _checkChangeAddressForTransactions();
final String newChangeAddress = await _getCurrentAddressForChain(
1, DerivePathTypeExt.primaryFor(coin));
final String newChangeAddress = await currentChangeAddress;
int feeBeingPaid =
satoshisBeingUsed - satoshiAmountToSend - changeOutputSize;
@ -2554,6 +2606,44 @@ class BitcoinWallet extends CoinServiceAPI
String? pubKey;
String? wif;
final address = await db.getAddress(walletId, sd.utxo.address!);
if (address?.derivationPath != null) {
final bip32.BIP32 node;
if (address!.subType == isar_models.AddressSubType.paynymReceive) {
final code = await paymentCodeStringByKey(address.otherData!);
final bip47base = await getBip47BaseNode();
final privateKey = await getPrivateKeyForPaynymReceivingAddress(
paymentCodeString: code!,
index: address.derivationIndex,
);
node = bip32.BIP32.fromPrivateKey(
privateKey,
bip47base.chainCode,
bip32.NetworkType(
wif: _network.wif,
bip32: bip32.Bip32Type(
public: _network.bip32.public,
private: _network.bip32.private,
),
),
);
} else {
node = await Bip32Utils.getBip32Node(
(await mnemonicString)!,
(await mnemonicPassphrase)!,
_network,
address.derivationPath!.value,
);
}
wif = node.toWIF();
pubKey = Format.uint8listToString(node.publicKey);
}
if (wif == null || pubKey == null) {
// fetch receiving derivations if null
receiveDerivations[sd.derivePathType] ??= await _fetchDerivations(
chain: 0,
@ -2578,20 +2668,6 @@ class BitcoinWallet extends CoinServiceAPI
wif = changeDerivation["wif"] as String;
}
}
if (wif == null || pubKey == null) {
final address = await db.getAddress(walletId, sd.utxo.address!);
if (address?.derivationPath != null) {
final node = await Bip32Utils.getBip32Node(
(await mnemonicString)!,
(await mnemonicPassphrase)!,
_network,
address!.derivationPath!.value,
);
wif = node.toWIF();
pubKey = Format.uint8listToString(node.publicKey);
}
}
if (wif != null && pubKey != null) {

View file

@ -2733,7 +2733,9 @@ class BitcoinCashWallet extends CoinServiceAPI
required List<String> recipients,
required List<int> satoshiAmounts,
}) async {
final builder = bitbox.Bitbox.transactionBuilder();
final builder = bitbox.Bitbox.transactionBuilder(
testnet: coin == Coin.bitcoincashTestnet,
);
// retrieve address' utxos from the rest api
List<bitbox.Utxo> _utxos =

File diff suppressed because it is too large Load diff

View file

@ -206,7 +206,7 @@ class _SVG {
String get pending => "assets/svg/pending.svg";
String get radio => "assets/svg/signal-stream.svg";
String get arrowRotate => "assets/svg/arrow-rotate.svg";
String get arrowRotate2 => "assets/svg/arrow-rotate2.svg";
String get arrowsTwoWay => "assets/svg/arrow-rotate2.svg";
String get alertCircle => "assets/svg/alert-circle.svg";
String get checkCircle => "assets/svg/circle-check.svg";
String get clipboard => "assets/svg/clipboard.svg";
@ -222,7 +222,6 @@ class _SVG {
String get networkWired => "assets/svg/network-wired-2.svg";
String get addressBook => "assets/svg/address-book.svg";
String get addressBook2 => "assets/svg/address-book2.svg";
String get arrowRotate3 => "assets/svg/rotate-exclamation.svg";
String get delete => "assets/svg/delete.svg";
String get arrowRight => "assets/svg/arrow-right.svg";
String get dollarSign => "assets/svg/dollar-sign.svg";
@ -417,6 +416,7 @@ class _ANIMATIONS {
String get test2 => "assets/lottie/test2.json";
String get iconSend => "assets/lottie/icon_send.json";
String get loaderAndCheckmark => "assets/lottie/loader_and_checkmark.json";
String get arrowRotate => "assets/lottie/arrow_rotate.json";
}
class _GIF {

View file

@ -25,14 +25,18 @@ class PaynymIsApi {
version +
(endpoint.startsWith("/") ? endpoint : "/$endpoint");
final uri = Uri.parse(url);
final headers = {
'Content-Type': 'application/json; charset=UTF-8',
}..addAll(additionalHeaders);
final response = await http.post(
uri,
headers: {
'Content-Type': 'application/json; charset=UTF-8',
}..addAll(additionalHeaders),
headers: headers,
body: jsonEncode(body),
);
debugPrint("Paynym request uri: $uri");
debugPrint("Paynym request body: $body");
debugPrint("Paynym request headers: $headers");
debugPrint("Paynym response code: ${response.statusCode}");
debugPrint("Paynym response body: ${response.body}");
@ -543,24 +547,44 @@ class PaynymIsApi {
// | 401 | Unauthorized token or signature or Unclaimed payment code |
//
// ------
Future<PaynymResponse<bool>> add(
String token,
String signature,
String nym,
String code,
) async {
final result = await _post(
"/nym/add",
{
"nym": nym,
"code": code,
"signature": signature,
},
{
"auth-token": token,
},
);
// NOT USED
// Future<Map<String, dynamic>> add(
// String token,
// String signature,
// String nym,
// String code,
// ) async {
// return _post(
// "/add",
// {
// "nym": nym,
// "code": code,
// "signature": signature,
// },
// {
// "auth-token": token,
// },
// );
// }
String message;
bool value = false;
switch (result.item2) {
case 200:
message = "Code added successfully";
value = true;
break;
case 400:
message = "Bad request";
break;
case 401:
message = "Unauthorized token or signature or Unclaimed payment code";
break;
case 404:
message = "Nym not found";
break;
default:
message = result.item1["message"] as String? ?? "Unknown error";
}
return PaynymResponse(value, result.item2, message);
}
}

View file

@ -0,0 +1,87 @@
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class RotatingArrowsController {
VoidCallback? forward;
VoidCallback? repeat;
VoidCallback? stop;
}
class RotatingArrows extends StatefulWidget {
const RotatingArrows({
Key? key,
required this.height,
required this.width,
this.controller,
this.color,
this.spinByDefault = true,
}) : super(key: key);
final double height;
final double width;
final RotatingArrowsController? controller;
final Color? color;
final bool spinByDefault;
@override
State<RotatingArrows> createState() => _RotatingArrowsState();
}
class _RotatingArrowsState extends State<RotatingArrows>
with SingleTickerProviderStateMixin {
late final AnimationController animationController;
@override
void initState() {
animationController = AnimationController(vsync: this);
widget.controller?.forward = animationController.forward;
widget.controller?.repeat = animationController.repeat;
widget.controller?.stop = animationController.stop;
super.initState();
}
@override
void dispose() {
animationController.dispose();
widget.controller?.forward = null;
widget.controller?.repeat = null;
widget.controller?.stop = null;
super.dispose();
}
@override
Widget build(BuildContext context) {
return Lottie.asset(
Assets.lottie.arrowRotate,
controller: animationController,
height: widget.height,
width: widget.width,
delegates: LottieDelegates(
values: [
ValueDelegate.color(
const ["**"],
value: widget.color ??
Theme.of(context).extension<StackColors>()!.accentColorDark,
),
ValueDelegate.strokeColor(
const ["**"],
value: widget.color ??
Theme.of(context).extension<StackColors>()!.accentColorDark,
),
],
),
onLoaded: (composition) {
animationController.duration = composition.duration;
// if controller was not set just assume continuous repeat
if (widget.spinByDefault) {
animationController.repeat();
}
},
);
}
}

View file

@ -11,7 +11,6 @@ import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/providers/wallet/my_paynym_account_state_provider.dart';
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
@ -68,8 +67,7 @@ class _PaynymFollowToggleButtonState
.read(paynymAPIProvider)
.nym(widget.paymentCodeStringToFollow, true);
final myPCode =
await wallet.getPaymentCode(DerivePathTypeExt.primaryFor(manager.coin));
final myPCode = await wallet.getPaymentCode(isSegwit: false);
PaynymResponse<String> token =
await ref.read(paynymAPIProvider).token(myPCode.toString());
@ -77,8 +75,8 @@ class _PaynymFollowToggleButtonState
// sign token with notification private key
String signature = await wallet.signStringWithNotificationKey(token.value!);
var result = await ref.read(paynymAPIProvider).follow(
token.value!, signature, followedAccount.value!.codes.first.code);
var result = await ref.read(paynymAPIProvider).follow(token.value!,
signature, followedAccount.value!.nonSegwitPaymentCode.code);
int i = 0;
for (;
@ -90,8 +88,8 @@ class _PaynymFollowToggleButtonState
// sign token with notification private key
signature = await wallet.signStringWithNotificationKey(token.value!);
result = await ref.read(paynymAPIProvider).follow(
token.value!, signature, followedAccount.value!.codes.first.code);
result = await ref.read(paynymAPIProvider).follow(token.value!, signature,
followedAccount.value!.nonSegwitPaymentCode.code);
await Future<void>.delayed(const Duration(milliseconds: 200));
print("RRR result: $result");
@ -118,8 +116,8 @@ class _PaynymFollowToggleButtonState
PaynymAccountLite(
followedAccount.value!.nymID,
followedAccount.value!.nymName,
followedAccount.value!.codes.first.code,
followedAccount.value!.codes.first.segwit,
followedAccount.value!.nonSegwitPaymentCode.code,
followedAccount.value!.segwit,
),
);
@ -169,8 +167,7 @@ class _PaynymFollowToggleButtonState
.read(paynymAPIProvider)
.nym(widget.paymentCodeStringToFollow, true);
final myPCode =
await wallet.getPaymentCode(DerivePathTypeExt.primaryFor(manager.coin));
final myPCode = await wallet.getPaymentCode(isSegwit: false);
PaynymResponse<String> token =
await ref.read(paynymAPIProvider).token(myPCode.toString());
@ -178,8 +175,8 @@ class _PaynymFollowToggleButtonState
// sign token with notification private key
String signature = await wallet.signStringWithNotificationKey(token.value!);
var result = await ref.read(paynymAPIProvider).unfollow(
token.value!, signature, followedAccount.value!.codes.first.code);
var result = await ref.read(paynymAPIProvider).unfollow(token.value!,
signature, followedAccount.value!.nonSegwitPaymentCode.code);
int i = 0;
for (;
@ -191,8 +188,8 @@ class _PaynymFollowToggleButtonState
// sign token with notification private key
signature = await wallet.signStringWithNotificationKey(token.value!);
result = await ref.read(paynymAPIProvider).unfollow(
token.value!, signature, followedAccount.value!.codes.first.code);
result = await ref.read(paynymAPIProvider).unfollow(token.value!,
signature, followedAccount.value!.nonSegwitPaymentCode.code);
await Future<void>.delayed(const Duration(milliseconds: 200));
print("unfollow RRR result: $result");
}

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
@ -276,6 +277,7 @@ class PinKeyboard extends StatelessWidget {
void _numberHandler(String number) {
onNumberKeyPressed.call(number);
HapticFeedback.lightImpact();
}
@override

View file

@ -111,11 +111,11 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "48dd65f88822fba8543826274f6d51c17f735f93"
resolved-ref: "48dd65f88822fba8543826274f6d51c17f735f93"
ref: "38847255d035c0f6ec5bc93d19130ec804cf90e9"
resolved-ref: "38847255d035c0f6ec5bc93d19130ec804cf90e9"
url: "https://github.com/cypherstack/bip47.git"
source: git
version: "1.0.0"
version: "2.0.0"
bitbox:
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.2+162
version: 1.7.4+164
environment:
sdk: ">=2.17.0 <3.0.0"
@ -60,7 +60,7 @@ dependencies:
bip47:
git:
url: https://github.com/cypherstack/bip47.git
ref: 48dd65f88822fba8543826274f6d51c17f735f93
ref: 38847255d035c0f6ec5bc93d19130ec804cf90e9
# Utility plugins
# provider: ^6.0.1
@ -248,7 +248,6 @@ flutter:
- assets/svg/chevron-up.svg
- assets/svg/lock-keyhole.svg
- assets/svg/lock-open.svg
- assets/svg/rotate-exclamation.svg
- assets/svg/folder-down.svg
- assets/svg/network-wired.svg
- assets/svg/network-wired-2.svg
@ -383,6 +382,7 @@ flutter:
- assets/lottie/test2.json
- assets/lottie/icon_send.json
- assets/lottie/loader_and_checkmark.json
- assets/lottie/arrow_rotate.json
# gifs
- assets/gif/

View file

@ -7,7 +7,7 @@ import 'dart:async' as _i23;
import 'dart:typed_data' as _i30;
import 'dart:ui' as _i25;
import 'package:bip32/bip32.dart' as _i18;
import 'package:bip32/bip32.dart' as _i17;
import 'package:bip47/bip47.dart' as _i19;
import 'package:bitcoindart/bitcoindart.dart' as _i14;
import 'package:flutter/foundation.dart' as _i4;
@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i13;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10;
import 'package:stackwallet/models/balance.dart' as _i12;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i18;
import 'package:stackwallet/models/node_model.dart' as _i26;
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9;
import 'package:stackwallet/models/signing_data.dart' as _i29;
@ -209,8 +209,8 @@ class _FakeTuple2_14<T1, T2> extends _i1.SmartFake
);
}
class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
_FakeAddress_15(
class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 {
_FakeBIP32_15(
Object parent,
Invocation parentInvocation,
) : super(
@ -219,8 +219,8 @@ class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
);
}
class _FakeBIP32_16 extends _i1.SmartFake implements _i18.BIP32 {
_FakeBIP32_16(
class _FakeAddress_16 extends _i1.SmartFake implements _i18.Address {
_FakeAddress_16(
Object parent,
Invocation parentInvocation,
) : super(
@ -987,16 +987,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
returnValue: _i22.Coin.bitcoin,
) as _i22.Coin);
@override
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i18.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
returnValue: _i23.Future<List<_i18.UTXO>>.value(<_i18.UTXO>[]),
) as _i23.Future<List<_i18.UTXO>>);
@override
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i18.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
_i23.Future<List<_i18.Transaction>>.value(<_i18.Transaction>[]),
) as _i23.Future<List<_i18.Transaction>>);
@override
_i23.Future<String> get currentReceivingAddress => (super.noSuchMethod(
Invocation.getter(#currentReceivingAddress),
@ -1406,7 +1406,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
required bool? coinControl,
required bool? isSendAll,
int? additionalOutputs = 0,
List<_i17.UTXO>? utxos,
List<_i18.UTXO>? utxos,
}) =>
super.noSuchMethod(Invocation.method(
#coinSelection,
@ -1423,7 +1423,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
));
@override
_i23.Future<List<_i29.SigningData>> fetchBuildTxData(
List<_i17.UTXO>? utxosToUse) =>
List<_i18.UTXO>? utxosToUse) =>
(super.noSuchMethod(
Invocation.method(
#fetchBuildTxData,
@ -1677,10 +1677,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i16.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction(
_i23.Future<_i16.Tuple2<_i18.Transaction, _i18.Address>> parseTransaction(
Map<String, dynamic>? txData,
dynamic electrumxClient,
List<_i17.Address>? myAddresses,
List<_i18.Address>? myAddresses,
_i22.Coin? coin,
int? minConfirms,
String? walletId,
@ -1698,8 +1698,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
],
),
returnValue:
_i23.Future<_i16.Tuple2<_i17.Transaction, _i17.Address>>.value(
_FakeTuple2_14<_i17.Transaction, _i17.Address>(
_i23.Future<_i16.Tuple2<_i18.Transaction, _i18.Address>>.value(
_FakeTuple2_14<_i18.Transaction, _i18.Address>(
this,
Invocation.method(
#parseTransaction,
@ -1713,7 +1713,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
],
),
)),
) as _i23.Future<_i16.Tuple2<_i17.Transaction, _i17.Address>>);
) as _i23.Future<_i16.Tuple2<_i18.Transaction, _i18.Address>>);
@override
void initPaynymWalletInterface({
required String? walletId,
@ -1723,6 +1723,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
required _i13.MainDB? db,
required _i10.ElectrumX? electrumXClient,
required _i7.SecureStorageInterface? secureStorage,
required int? dustLimit,
required int? dustLimitP2PKH,
required int? minConfirms,
required _i23.Future<String?> Function()? getMnemonicString,
@ -1741,7 +1742,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
})?
prepareSend,
required _i23.Future<int> Function({required String address})? getTxCount,
required _i23.Future<List<_i29.SigningData>> Function(List<_i17.UTXO>)?
required _i23.Future<List<_i29.SigningData>> Function(List<_i18.UTXO>)?
fetchBuildTxData,
required _i23.Future<void> Function()? refresh,
required _i23.Future<void> Function()? checkChangeAddressForTransactions,
@ -1758,6 +1759,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
#db: db,
#electrumXClient: electrumXClient,
#secureStorage: secureStorage,
#dustLimit: dustLimit,
#dustLimitP2PKH: dustLimitP2PKH,
#minConfirms: minConfirms,
#getMnemonicString: getMnemonicString,
@ -1776,28 +1778,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i17.Address> currentReceivingPaynymAddress(
_i19.PaymentCode? sender) =>
_i23.Future<_i17.BIP32> getBip47BaseNode() => (super.noSuchMethod(
Invocation.method(
#getBip47BaseNode,
[],
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#getBip47BaseNode,
[],
),
)),
) as _i23.Future<_i17.BIP32>);
@override
_i23.Future<_i30.Uint8List> getPrivateKeyForPaynymReceivingAddress({
required String? paymentCodeString,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#getPrivateKeyForPaynymReceivingAddress,
[],
{
#paymentCodeString: paymentCodeString,
#index: index,
},
),
returnValue: _i23.Future<_i30.Uint8List>.value(_i30.Uint8List(0)),
) as _i23.Future<_i30.Uint8List>);
@override
_i23.Future<_i18.Address> currentReceivingPaynymAddress({
required _i19.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
returnValue: _i23.Future<_i18.Address>.value(_FakeAddress_16(
this,
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
)),
) as _i23.Future<_i17.Address>);
) as _i23.Future<_i18.Address>);
@override
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions(
_i19.PaymentCode? sender) =>
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions({
required _i19.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#checkCurrentPaynymReceivingAddressForTransactions,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
@ -1813,81 +1861,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i18.BIP32> deriveNotificationBip32Node({
required String? mnemonic,
required String? mnemonicPassphrase,
}) =>
(super.noSuchMethod(
_i23.Future<_i17.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod(
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
returnValue: _i23.Future<_i18.BIP32>.value(_FakeBIP32_16(
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
)),
) as _i23.Future<_i18.BIP32>);
) as _i23.Future<_i17.BIP32>);
@override
_i23.Future<_i18.BIP32> deriveReceivingPrivateKeyNode({
required String? mnemonic,
required String? mnemonicPassphrase,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
returnValue: _i23.Future<_i18.BIP32>.value(_FakeBIP32_16(
this,
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
)),
) as _i23.Future<_i18.BIP32>);
@override
_i23.Future<_i19.PaymentCode> getPaymentCode(
_i28.DerivePathType? derivePathType, [
_i18.BIP32? bip32Root,
]) =>
_i23.Future<_i19.PaymentCode> getPaymentCode({required bool? isSegwit}) =>
(super.noSuchMethod(
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
returnValue: _i23.Future<_i19.PaymentCode>.value(_FakePaymentCode_17(
this,
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
)),
) as _i23.Future<_i19.PaymentCode>);
@ -1912,6 +1912,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
@override
_i23.Future<Map<String, dynamic>> preparePaymentCodeSend({
required _i19.PaymentCode? paymentCode,
required bool? isSegwit,
required _i15.Amount? amount,
Map<String, dynamic>? args,
}) =>
@ -1921,6 +1922,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
[],
{
#paymentCode: paymentCode,
#isSegwit: isSegwit,
#amount: amount,
#args: args,
},
@ -1929,9 +1931,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
_i23.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i23.Future<Map<String, dynamic>>);
@override
_i23.Future<_i17.Address> nextUnusedSendAddressFrom({
_i23.Future<_i18.Address> nextUnusedSendAddressFrom({
required _i19.PaymentCode? pCode,
required _i18.BIP32? privateKeyNode,
required bool? isSegwit,
required _i17.BIP32? privateKeyNode,
int? startIndex = 0,
}) =>
(super.noSuchMethod(
@ -1940,29 +1943,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
returnValue: _i23.Future<_i18.Address>.value(_FakeAddress_16(
this,
Invocation.method(
#nextUnusedSendAddressFrom,
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
)),
) as _i23.Future<_i17.Address>);
) as _i23.Future<_i18.Address>);
@override
_i23.Future<Map<String, dynamic>> prepareNotificationTx({
required int? selectedTxFeeRate,
required String? targetPaymentCodeString,
int? additionalOutputs = 0,
List<_i17.UTXO>? utxos,
List<_i18.UTXO>? utxos,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1999,34 +2004,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
returnValue: _i23.Future<bool>.value(false),
) as _i23.Future<bool>);
@override
_i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransaction({
required _i17.Transaction? transaction,
required _i17.Address? myNotificationAddress,
}) =>
_i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransaction(
{required _i18.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransaction,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i19.PaymentCode?>.value(),
) as _i23.Future<_i19.PaymentCode?>);
@override
_i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({
required _i17.Transaction? transaction,
required _i17.Address? myNotificationAddress,
}) =>
_i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransactionBad(
{required _i18.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransactionBad,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i19.PaymentCode?>.value(),
) as _i23.Future<_i19.PaymentCode?>);
@ -2071,111 +2066,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<void> restoreHistoryWith(
_i19.PaymentCode? other,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
) =>
_i23.Future<void> restoreHistoryWith({
required _i19.PaymentCode? other,
required bool? checkSegwitAsWell,
required int? maxUnusedAddressGap,
required int? maxNumberOfIndexesToCheck,
}) =>
(super.noSuchMethod(
Invocation.method(
#restoreHistoryWith,
[
other,
maxUnusedAddressGap,
maxNumberOfIndexesToCheck,
],
[],
{
#other: other,
#checkSegwitAsWell: checkSegwitAsWell,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i17.Address> generatePaynymSendAddressFromKeyPair({
required _i14.ECPair? pair,
required int? derivationIndex,
required _i28.DerivePathType? derivePathType,
required _i19.PaymentCode? toPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
)),
) as _i23.Future<_i17.Address>);
@override
_i23.Future<_i17.Address> generatePaynymReceivingAddressFromKeyPair({
required _i14.ECPair? pair,
required int? derivationIndex,
required _i28.DerivePathType? derivePathType,
required _i19.PaymentCode? fromPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
)),
) as _i23.Future<_i17.Address>);
@override
_i23.Future<_i17.Address> getMyNotificationAddress(
_i28.DerivePathType? derivePathType, [
_i18.BIP32? bip32Root,
]) =>
(super.noSuchMethod(
_i23.Future<_i18.Address> getMyNotificationAddress() => (super.noSuchMethod(
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
returnValue: _i23.Future<_i18.Address>.value(_FakeAddress_16(
this,
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
)),
) as _i23.Future<_i17.Address>);
) as _i23.Future<_i18.Address>);
@override
_i23.Future<List<String>> lookupKey(String? paymentCodeString) =>
(super.noSuchMethod(
@ -2812,16 +2736,16 @@ class MockManager extends _i1.Mock implements _i6.Manager {
),
) as _i12.Balance);
@override
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i18.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
_i23.Future<List<_i18.Transaction>>.value(<_i18.Transaction>[]),
) as _i23.Future<List<_i18.Transaction>>);
@override
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i18.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
returnValue: _i23.Future<List<_i18.UTXO>>.value(<_i18.UTXO>[]),
) as _i23.Future<List<_i18.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(
@ -3180,16 +3104,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI {
),
) as _i12.Balance);
@override
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i18.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
_i23.Future<List<_i18.Transaction>>.value(<_i18.Transaction>[]),
) as _i23.Future<List<_i18.Transaction>>);
@override
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i18.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
returnValue: _i23.Future<List<_i18.UTXO>>.value(<_i18.UTXO>[]),
) as _i23.Future<List<_i18.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(

View file

@ -7,7 +7,7 @@ import 'dart:async' as _i23;
import 'dart:typed_data' as _i29;
import 'dart:ui' as _i25;
import 'package:bip32/bip32.dart' as _i17;
import 'package:bip32/bip32.dart' as _i16;
import 'package:bip47/bip47.dart' as _i18;
import 'package:bitcoindart/bitcoindart.dart' as _i13;
import 'package:flutter/foundation.dart' as _i4;
@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
import 'package:stackwallet/models/balance.dart' as _i11;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
import 'package:stackwallet/models/node_model.dart' as _i31;
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
import 'package:stackwallet/models/signing_data.dart' as _i28;
@ -194,8 +194,8 @@ class _FakeTuple2_13<T1, T2> extends _i1.SmartFake
);
}
class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
_FakeAddress_14(
class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 {
_FakeBIP32_14(
Object parent,
Invocation parentInvocation,
) : super(
@ -204,8 +204,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
);
}
class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 {
_FakeBIP32_15(
class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
_FakeAddress_15(
Object parent,
Invocation parentInvocation,
) : super(
@ -779,16 +779,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValue: _i22.Coin.bitcoin,
) as _i22.Coin);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<String> get currentReceivingAddress => (super.noSuchMethod(
Invocation.getter(#currentReceivingAddress),
@ -1197,7 +1197,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
required bool? coinControl,
required bool? isSendAll,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
super.noSuchMethod(Invocation.method(
#coinSelection,
@ -1214,7 +1214,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
));
@override
_i23.Future<List<_i28.SigningData>> fetchBuildTxData(
List<_i16.UTXO>? utxosToUse) =>
List<_i17.UTXO>? utxosToUse) =>
(super.noSuchMethod(
Invocation.method(
#fetchBuildTxData,
@ -1468,10 +1468,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction(
_i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction(
Map<String, dynamic>? txData,
dynamic electrumxClient,
List<_i16.Address>? myAddresses,
List<_i17.Address>? myAddresses,
_i22.Coin? coin,
int? minConfirms,
String? walletId,
@ -1489,8 +1489,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
],
),
returnValue:
_i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value(
_FakeTuple2_13<_i16.Transaction, _i16.Address>(
_i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value(
_FakeTuple2_13<_i17.Transaction, _i17.Address>(
this,
Invocation.method(
#parseTransaction,
@ -1504,7 +1504,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
],
),
)),
) as _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>);
) as _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>);
@override
void initPaynymWalletInterface({
required String? walletId,
@ -1514,6 +1514,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
required _i12.MainDB? db,
required _i9.ElectrumX? electrumXClient,
required _i19.SecureStorageInterface? secureStorage,
required int? dustLimit,
required int? dustLimitP2PKH,
required int? minConfirms,
required _i23.Future<String?> Function()? getMnemonicString,
@ -1532,7 +1533,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
})?
prepareSend,
required _i23.Future<int> Function({required String address})? getTxCount,
required _i23.Future<List<_i28.SigningData>> Function(List<_i16.UTXO>)?
required _i23.Future<List<_i28.SigningData>> Function(List<_i17.UTXO>)?
fetchBuildTxData,
required _i23.Future<void> Function()? refresh,
required _i23.Future<void> Function()? checkChangeAddressForTransactions,
@ -1549,6 +1550,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
#db: db,
#electrumXClient: electrumXClient,
#secureStorage: secureStorage,
#dustLimit: dustLimit,
#dustLimitP2PKH: dustLimitP2PKH,
#minConfirms: minConfirms,
#getMnemonicString: getMnemonicString,
@ -1567,28 +1569,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i16.Address> currentReceivingPaynymAddress(
_i18.PaymentCode? sender) =>
_i23.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod(
Invocation.method(
#getBip47BaseNode,
[],
),
returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#getBip47BaseNode,
[],
),
)),
) as _i23.Future<_i16.BIP32>);
@override
_i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({
required String? paymentCodeString,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#getPrivateKeyForPaynymReceivingAddress,
[],
{
#paymentCodeString: paymentCodeString,
#index: index,
},
),
returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
) as _i23.Future<_i29.Uint8List>);
@override
_i23.Future<_i17.Address> currentReceivingPaynymAddress({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions(
_i18.PaymentCode? sender) =>
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#checkCurrentPaynymReceivingAddressForTransactions,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
@ -1604,81 +1652,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i17.BIP32> deriveNotificationBip32Node({
required String? mnemonic,
required String? mnemonicPassphrase,
}) =>
(super.noSuchMethod(
_i23.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod(
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
)),
) as _i23.Future<_i17.BIP32>);
) as _i23.Future<_i16.BIP32>);
@override
_i23.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({
required String? mnemonic,
required String? mnemonicPassphrase,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
)),
) as _i23.Future<_i17.BIP32>);
@override
_i23.Future<_i18.PaymentCode> getPaymentCode(
_i27.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
_i23.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) =>
(super.noSuchMethod(
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
returnValue: _i23.Future<_i18.PaymentCode>.value(_FakePaymentCode_16(
this,
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
)),
) as _i23.Future<_i18.PaymentCode>);
@ -1703,6 +1703,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
@override
_i23.Future<Map<String, dynamic>> preparePaymentCodeSend({
required _i18.PaymentCode? paymentCode,
required bool? isSegwit,
required _i14.Amount? amount,
Map<String, dynamic>? args,
}) =>
@ -1712,6 +1713,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
[],
{
#paymentCode: paymentCode,
#isSegwit: isSegwit,
#amount: amount,
#args: args,
},
@ -1720,9 +1722,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
_i23.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i23.Future<Map<String, dynamic>>);
@override
_i23.Future<_i16.Address> nextUnusedSendAddressFrom({
_i23.Future<_i17.Address> nextUnusedSendAddressFrom({
required _i18.PaymentCode? pCode,
required _i17.BIP32? privateKeyNode,
required bool? isSegwit,
required _i16.BIP32? privateKeyNode,
int? startIndex = 0,
}) =>
(super.noSuchMethod(
@ -1731,29 +1734,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#nextUnusedSendAddressFrom,
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<Map<String, dynamic>> prepareNotificationTx({
required int? selectedTxFeeRate,
required String? targetPaymentCodeString,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1790,34 +1795,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValue: _i23.Future<bool>.value(false),
) as _i23.Future<bool>);
@override
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransaction,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i18.PaymentCode?>.value(),
) as _i23.Future<_i18.PaymentCode?>);
@override
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransactionBad,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i18.PaymentCode?>.value(),
) as _i23.Future<_i18.PaymentCode?>);
@ -1862,111 +1857,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<void> restoreHistoryWith(
_i18.PaymentCode? other,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
) =>
_i23.Future<void> restoreHistoryWith({
required _i18.PaymentCode? other,
required bool? checkSegwitAsWell,
required int? maxUnusedAddressGap,
required int? maxNumberOfIndexesToCheck,
}) =>
(super.noSuchMethod(
Invocation.method(
#restoreHistoryWith,
[
other,
maxUnusedAddressGap,
maxNumberOfIndexesToCheck,
],
[],
{
#other: other,
#checkSegwitAsWell: checkSegwitAsWell,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i27.DerivePathType? derivePathType,
required _i18.PaymentCode? toPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
)),
) as _i23.Future<_i16.Address>);
@override
_i23.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i27.DerivePathType? derivePathType,
required _i18.PaymentCode? fromPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
)),
) as _i23.Future<_i16.Address>);
@override
_i23.Future<_i16.Address> getMyNotificationAddress(
_i27.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
(super.noSuchMethod(
_i23.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod(
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<List<String>> lookupKey(String? paymentCodeString) =>
(super.noSuchMethod(
@ -2386,16 +2310,16 @@ class MockManager extends _i1.Mock implements _i6.Manager {
),
) as _i11.Balance);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(
@ -2754,16 +2678,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI {
),
) as _i11.Balance);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(

View file

@ -7,7 +7,7 @@ import 'dart:async' as _i22;
import 'dart:typed_data' as _i29;
import 'dart:ui' as _i24;
import 'package:bip32/bip32.dart' as _i17;
import 'package:bip32/bip32.dart' as _i16;
import 'package:bip47/bip47.dart' as _i18;
import 'package:bitcoindart/bitcoindart.dart' as _i13;
import 'package:flutter/foundation.dart' as _i4;
@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
import 'package:stackwallet/models/balance.dart' as _i11;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
import 'package:stackwallet/models/signing_data.dart' as _i27;
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i25;
@ -192,8 +192,8 @@ class _FakeTuple2_13<T1, T2> extends _i1.SmartFake
);
}
class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
_FakeAddress_14(
class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 {
_FakeBIP32_14(
Object parent,
Invocation parentInvocation,
) : super(
@ -202,8 +202,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
);
}
class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 {
_FakeBIP32_15(
class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
_FakeAddress_15(
Object parent,
Invocation parentInvocation,
) : super(
@ -766,16 +766,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
returnValue: _i21.Coin.bitcoin,
) as _i21.Coin);
@override
_i22.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i22.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i22.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i22.Future<List<_i16.UTXO>>);
returnValue: _i22.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i22.Future<List<_i17.UTXO>>);
@override
_i22.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i22.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i22.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i22.Future<List<_i16.Transaction>>);
_i22.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i22.Future<List<_i17.Transaction>>);
@override
_i22.Future<String> get currentReceivingAddress => (super.noSuchMethod(
Invocation.getter(#currentReceivingAddress),
@ -1184,7 +1184,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
required bool? coinControl,
required bool? isSendAll,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
super.noSuchMethod(Invocation.method(
#coinSelection,
@ -1201,7 +1201,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
));
@override
_i22.Future<List<_i27.SigningData>> fetchBuildTxData(
List<_i16.UTXO>? utxosToUse) =>
List<_i17.UTXO>? utxosToUse) =>
(super.noSuchMethod(
Invocation.method(
#fetchBuildTxData,
@ -1455,10 +1455,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i22.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction(
_i22.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction(
Map<String, dynamic>? txData,
dynamic electrumxClient,
List<_i16.Address>? myAddresses,
List<_i17.Address>? myAddresses,
_i21.Coin? coin,
int? minConfirms,
String? walletId,
@ -1476,8 +1476,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
],
),
returnValue:
_i22.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value(
_FakeTuple2_13<_i16.Transaction, _i16.Address>(
_i22.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value(
_FakeTuple2_13<_i17.Transaction, _i17.Address>(
this,
Invocation.method(
#parseTransaction,
@ -1491,7 +1491,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
],
),
)),
) as _i22.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>);
) as _i22.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>);
@override
void initPaynymWalletInterface({
required String? walletId,
@ -1501,6 +1501,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
required _i12.MainDB? db,
required _i9.ElectrumX? electrumXClient,
required _i28.SecureStorageInterface? secureStorage,
required int? dustLimit,
required int? dustLimitP2PKH,
required int? minConfirms,
required _i22.Future<String?> Function()? getMnemonicString,
@ -1519,7 +1520,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
})?
prepareSend,
required _i22.Future<int> Function({required String address})? getTxCount,
required _i22.Future<List<_i27.SigningData>> Function(List<_i16.UTXO>)?
required _i22.Future<List<_i27.SigningData>> Function(List<_i17.UTXO>)?
fetchBuildTxData,
required _i22.Future<void> Function()? refresh,
required _i22.Future<void> Function()? checkChangeAddressForTransactions,
@ -1536,6 +1537,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
#db: db,
#electrumXClient: electrumXClient,
#secureStorage: secureStorage,
#dustLimit: dustLimit,
#dustLimitP2PKH: dustLimitP2PKH,
#minConfirms: minConfirms,
#getMnemonicString: getMnemonicString,
@ -1554,28 +1556,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i22.Future<_i16.Address> currentReceivingPaynymAddress(
_i18.PaymentCode? sender) =>
_i22.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod(
Invocation.method(
#getBip47BaseNode,
[],
),
returnValue: _i22.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#getBip47BaseNode,
[],
),
)),
) as _i22.Future<_i16.BIP32>);
@override
_i22.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({
required String? paymentCodeString,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#getPrivateKeyForPaynymReceivingAddress,
[],
{
#paymentCodeString: paymentCodeString,
#index: index,
},
),
returnValue: _i22.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
) as _i22.Future<_i29.Uint8List>);
@override
_i22.Future<_i17.Address> currentReceivingPaynymAddress({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i22.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
)),
) as _i22.Future<_i16.Address>);
) as _i22.Future<_i17.Address>);
@override
_i22.Future<void> checkCurrentPaynymReceivingAddressForTransactions(
_i18.PaymentCode? sender) =>
_i22.Future<void> checkCurrentPaynymReceivingAddressForTransactions({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#checkCurrentPaynymReceivingAddressForTransactions,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i22.Future<void>.value(),
returnValueForMissingStub: _i22.Future<void>.value(),
@ -1591,81 +1639,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
returnValueForMissingStub: _i22.Future<void>.value(),
) as _i22.Future<void>);
@override
_i22.Future<_i17.BIP32> deriveNotificationBip32Node({
required String? mnemonic,
required String? mnemonicPassphrase,
}) =>
(super.noSuchMethod(
_i22.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod(
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
returnValue: _i22.Future<_i17.BIP32>.value(_FakeBIP32_15(
returnValue: _i22.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
)),
) as _i22.Future<_i17.BIP32>);
) as _i22.Future<_i16.BIP32>);
@override
_i22.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({
required String? mnemonic,
required String? mnemonicPassphrase,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
returnValue: _i22.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
)),
) as _i22.Future<_i17.BIP32>);
@override
_i22.Future<_i18.PaymentCode> getPaymentCode(
_i26.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
_i22.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) =>
(super.noSuchMethod(
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
returnValue: _i22.Future<_i18.PaymentCode>.value(_FakePaymentCode_16(
this,
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
)),
) as _i22.Future<_i18.PaymentCode>);
@ -1690,6 +1690,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
@override
_i22.Future<Map<String, dynamic>> preparePaymentCodeSend({
required _i18.PaymentCode? paymentCode,
required bool? isSegwit,
required _i14.Amount? amount,
Map<String, dynamic>? args,
}) =>
@ -1699,6 +1700,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
[],
{
#paymentCode: paymentCode,
#isSegwit: isSegwit,
#amount: amount,
#args: args,
},
@ -1707,9 +1709,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
_i22.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i22.Future<Map<String, dynamic>>);
@override
_i22.Future<_i16.Address> nextUnusedSendAddressFrom({
_i22.Future<_i17.Address> nextUnusedSendAddressFrom({
required _i18.PaymentCode? pCode,
required _i17.BIP32? privateKeyNode,
required bool? isSegwit,
required _i16.BIP32? privateKeyNode,
int? startIndex = 0,
}) =>
(super.noSuchMethod(
@ -1718,29 +1721,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i22.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#nextUnusedSendAddressFrom,
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
)),
) as _i22.Future<_i16.Address>);
) as _i22.Future<_i17.Address>);
@override
_i22.Future<Map<String, dynamic>> prepareNotificationTx({
required int? selectedTxFeeRate,
required String? targetPaymentCodeString,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1777,34 +1782,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
returnValue: _i22.Future<bool>.value(false),
) as _i22.Future<bool>);
@override
_i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransaction,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i22.Future<_i18.PaymentCode?>.value(),
) as _i22.Future<_i18.PaymentCode?>);
@override
_i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransactionBad,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i22.Future<_i18.PaymentCode?>.value(),
) as _i22.Future<_i18.PaymentCode?>);
@ -1849,111 +1844,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
returnValueForMissingStub: _i22.Future<void>.value(),
) as _i22.Future<void>);
@override
_i22.Future<void> restoreHistoryWith(
_i18.PaymentCode? other,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
) =>
_i22.Future<void> restoreHistoryWith({
required _i18.PaymentCode? other,
required bool? checkSegwitAsWell,
required int? maxUnusedAddressGap,
required int? maxNumberOfIndexesToCheck,
}) =>
(super.noSuchMethod(
Invocation.method(
#restoreHistoryWith,
[
other,
maxUnusedAddressGap,
maxNumberOfIndexesToCheck,
],
[],
{
#other: other,
#checkSegwitAsWell: checkSegwitAsWell,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
},
),
returnValue: _i22.Future<void>.value(),
returnValueForMissingStub: _i22.Future<void>.value(),
) as _i22.Future<void>);
@override
_i22.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i26.DerivePathType? derivePathType,
required _i18.PaymentCode? toPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
)),
) as _i22.Future<_i16.Address>);
@override
_i22.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i26.DerivePathType? derivePathType,
required _i18.PaymentCode? fromPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
)),
) as _i22.Future<_i16.Address>);
@override
_i22.Future<_i16.Address> getMyNotificationAddress(
_i26.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
(super.noSuchMethod(
_i22.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod(
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i22.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
)),
) as _i22.Future<_i16.Address>);
) as _i22.Future<_i17.Address>);
@override
_i22.Future<List<String>> lookupKey(String? paymentCodeString) =>
(super.noSuchMethod(
@ -2111,16 +2035,16 @@ class MockManager extends _i1.Mock implements _i6.Manager {
),
) as _i11.Balance);
@override
_i22.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i22.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i22.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i22.Future<List<_i16.Transaction>>);
_i22.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i22.Future<List<_i17.Transaction>>);
@override
_i22.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i22.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i22.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i22.Future<List<_i16.UTXO>>);
returnValue: _i22.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i22.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(
@ -2479,16 +2403,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI {
),
) as _i11.Balance);
@override
_i22.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i22.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i22.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i22.Future<List<_i16.Transaction>>);
_i22.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i22.Future<List<_i17.Transaction>>);
@override
_i22.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i22.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i22.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i22.Future<List<_i16.UTXO>>);
returnValue: _i22.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i22.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(

View file

@ -7,7 +7,7 @@ import 'dart:async' as _i21;
import 'dart:typed_data' as _i28;
import 'dart:ui' as _i23;
import 'package:bip32/bip32.dart' as _i17;
import 'package:bip32/bip32.dart' as _i16;
import 'package:bip47/bip47.dart' as _i18;
import 'package:bitcoindart/bitcoindart.dart' as _i13;
import 'package:flutter/foundation.dart' as _i4;
@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
import 'package:stackwallet/models/balance.dart' as _i11;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
import 'package:stackwallet/models/signing_data.dart' as _i26;
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i24;
@ -192,8 +192,8 @@ class _FakeTuple2_13<T1, T2> extends _i1.SmartFake
);
}
class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
_FakeAddress_14(
class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 {
_FakeBIP32_14(
Object parent,
Invocation parentInvocation,
) : super(
@ -202,8 +202,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
);
}
class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 {
_FakeBIP32_15(
class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
_FakeAddress_15(
Object parent,
Invocation parentInvocation,
) : super(
@ -521,16 +521,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
returnValue: _i20.Coin.bitcoin,
) as _i20.Coin);
@override
_i21.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i21.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i21.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i21.Future<List<_i16.UTXO>>);
returnValue: _i21.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i21.Future<List<_i17.UTXO>>);
@override
_i21.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i21.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i21.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i21.Future<List<_i16.Transaction>>);
_i21.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i21.Future<List<_i17.Transaction>>);
@override
_i21.Future<String> get currentReceivingAddress => (super.noSuchMethod(
Invocation.getter(#currentReceivingAddress),
@ -939,7 +939,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
required bool? coinControl,
required bool? isSendAll,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
super.noSuchMethod(Invocation.method(
#coinSelection,
@ -956,7 +956,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
));
@override
_i21.Future<List<_i26.SigningData>> fetchBuildTxData(
List<_i16.UTXO>? utxosToUse) =>
List<_i17.UTXO>? utxosToUse) =>
(super.noSuchMethod(
Invocation.method(
#fetchBuildTxData,
@ -1210,10 +1210,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i21.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction(
_i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction(
Map<String, dynamic>? txData,
dynamic electrumxClient,
List<_i16.Address>? myAddresses,
List<_i17.Address>? myAddresses,
_i20.Coin? coin,
int? minConfirms,
String? walletId,
@ -1231,8 +1231,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
],
),
returnValue:
_i21.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value(
_FakeTuple2_13<_i16.Transaction, _i16.Address>(
_i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value(
_FakeTuple2_13<_i17.Transaction, _i17.Address>(
this,
Invocation.method(
#parseTransaction,
@ -1246,7 +1246,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
],
),
)),
) as _i21.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>);
) as _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>);
@override
void initPaynymWalletInterface({
required String? walletId,
@ -1256,6 +1256,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
required _i12.MainDB? db,
required _i9.ElectrumX? electrumXClient,
required _i27.SecureStorageInterface? secureStorage,
required int? dustLimit,
required int? dustLimitP2PKH,
required int? minConfirms,
required _i21.Future<String?> Function()? getMnemonicString,
@ -1274,7 +1275,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
})?
prepareSend,
required _i21.Future<int> Function({required String address})? getTxCount,
required _i21.Future<List<_i26.SigningData>> Function(List<_i16.UTXO>)?
required _i21.Future<List<_i26.SigningData>> Function(List<_i17.UTXO>)?
fetchBuildTxData,
required _i21.Future<void> Function()? refresh,
required _i21.Future<void> Function()? checkChangeAddressForTransactions,
@ -1291,6 +1292,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
#db: db,
#electrumXClient: electrumXClient,
#secureStorage: secureStorage,
#dustLimit: dustLimit,
#dustLimitP2PKH: dustLimitP2PKH,
#minConfirms: minConfirms,
#getMnemonicString: getMnemonicString,
@ -1309,28 +1311,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i21.Future<_i16.Address> currentReceivingPaynymAddress(
_i18.PaymentCode? sender) =>
_i21.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod(
Invocation.method(
#getBip47BaseNode,
[],
),
returnValue: _i21.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#getBip47BaseNode,
[],
),
)),
) as _i21.Future<_i16.BIP32>);
@override
_i21.Future<_i28.Uint8List> getPrivateKeyForPaynymReceivingAddress({
required String? paymentCodeString,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#getPrivateKeyForPaynymReceivingAddress,
[],
{
#paymentCodeString: paymentCodeString,
#index: index,
},
),
returnValue: _i21.Future<_i28.Uint8List>.value(_i28.Uint8List(0)),
) as _i21.Future<_i28.Uint8List>);
@override
_i21.Future<_i17.Address> currentReceivingPaynymAddress({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
)),
) as _i21.Future<_i16.Address>);
) as _i21.Future<_i17.Address>);
@override
_i21.Future<void> checkCurrentPaynymReceivingAddressForTransactions(
_i18.PaymentCode? sender) =>
_i21.Future<void> checkCurrentPaynymReceivingAddressForTransactions({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#checkCurrentPaynymReceivingAddressForTransactions,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i21.Future<void>.value(),
returnValueForMissingStub: _i21.Future<void>.value(),
@ -1346,81 +1394,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
returnValueForMissingStub: _i21.Future<void>.value(),
) as _i21.Future<void>);
@override
_i21.Future<_i17.BIP32> deriveNotificationBip32Node({
required String? mnemonic,
required String? mnemonicPassphrase,
}) =>
(super.noSuchMethod(
_i21.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod(
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
returnValue: _i21.Future<_i17.BIP32>.value(_FakeBIP32_15(
returnValue: _i21.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
)),
) as _i21.Future<_i17.BIP32>);
) as _i21.Future<_i16.BIP32>);
@override
_i21.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({
required String? mnemonic,
required String? mnemonicPassphrase,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
returnValue: _i21.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
)),
) as _i21.Future<_i17.BIP32>);
@override
_i21.Future<_i18.PaymentCode> getPaymentCode(
_i25.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
_i21.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) =>
(super.noSuchMethod(
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
returnValue: _i21.Future<_i18.PaymentCode>.value(_FakePaymentCode_16(
this,
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
)),
) as _i21.Future<_i18.PaymentCode>);
@ -1445,6 +1445,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
@override
_i21.Future<Map<String, dynamic>> preparePaymentCodeSend({
required _i18.PaymentCode? paymentCode,
required bool? isSegwit,
required _i14.Amount? amount,
Map<String, dynamic>? args,
}) =>
@ -1454,6 +1455,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
[],
{
#paymentCode: paymentCode,
#isSegwit: isSegwit,
#amount: amount,
#args: args,
},
@ -1462,9 +1464,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
_i21.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i21.Future<Map<String, dynamic>>);
@override
_i21.Future<_i16.Address> nextUnusedSendAddressFrom({
_i21.Future<_i17.Address> nextUnusedSendAddressFrom({
required _i18.PaymentCode? pCode,
required _i17.BIP32? privateKeyNode,
required bool? isSegwit,
required _i16.BIP32? privateKeyNode,
int? startIndex = 0,
}) =>
(super.noSuchMethod(
@ -1473,29 +1476,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#nextUnusedSendAddressFrom,
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
)),
) as _i21.Future<_i16.Address>);
) as _i21.Future<_i17.Address>);
@override
_i21.Future<Map<String, dynamic>> prepareNotificationTx({
required int? selectedTxFeeRate,
required String? targetPaymentCodeString,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1532,34 +1537,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
returnValue: _i21.Future<bool>.value(false),
) as _i21.Future<bool>);
@override
_i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransaction,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i21.Future<_i18.PaymentCode?>.value(),
) as _i21.Future<_i18.PaymentCode?>);
@override
_i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransactionBad,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i21.Future<_i18.PaymentCode?>.value(),
) as _i21.Future<_i18.PaymentCode?>);
@ -1604,111 +1599,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet {
returnValueForMissingStub: _i21.Future<void>.value(),
) as _i21.Future<void>);
@override
_i21.Future<void> restoreHistoryWith(
_i18.PaymentCode? other,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
) =>
_i21.Future<void> restoreHistoryWith({
required _i18.PaymentCode? other,
required bool? checkSegwitAsWell,
required int? maxUnusedAddressGap,
required int? maxNumberOfIndexesToCheck,
}) =>
(super.noSuchMethod(
Invocation.method(
#restoreHistoryWith,
[
other,
maxUnusedAddressGap,
maxNumberOfIndexesToCheck,
],
[],
{
#other: other,
#checkSegwitAsWell: checkSegwitAsWell,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
},
),
returnValue: _i21.Future<void>.value(),
returnValueForMissingStub: _i21.Future<void>.value(),
) as _i21.Future<void>);
@override
_i21.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i25.DerivePathType? derivePathType,
required _i18.PaymentCode? toPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
)),
) as _i21.Future<_i16.Address>);
@override
_i21.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i25.DerivePathType? derivePathType,
required _i18.PaymentCode? fromPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
)),
) as _i21.Future<_i16.Address>);
@override
_i21.Future<_i16.Address> getMyNotificationAddress(
_i25.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
(super.noSuchMethod(
_i21.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod(
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
)),
) as _i21.Future<_i16.Address>);
) as _i21.Future<_i17.Address>);
@override
_i21.Future<List<String>> lookupKey(String? paymentCodeString) =>
(super.noSuchMethod(

View file

@ -7,7 +7,7 @@ import 'dart:async' as _i23;
import 'dart:typed_data' as _i29;
import 'dart:ui' as _i25;
import 'package:bip32/bip32.dart' as _i17;
import 'package:bip32/bip32.dart' as _i16;
import 'package:bip47/bip47.dart' as _i18;
import 'package:bitcoindart/bitcoindart.dart' as _i13;
import 'package:flutter/foundation.dart' as _i4;
@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
import 'package:stackwallet/models/balance.dart' as _i11;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
import 'package:stackwallet/models/node_model.dart' as _i30;
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
import 'package:stackwallet/models/signing_data.dart' as _i28;
@ -193,8 +193,8 @@ class _FakeTuple2_13<T1, T2> extends _i1.SmartFake
);
}
class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
_FakeAddress_14(
class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 {
_FakeBIP32_14(
Object parent,
Invocation parentInvocation,
) : super(
@ -203,8 +203,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
);
}
class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 {
_FakeBIP32_15(
class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
_FakeAddress_15(
Object parent,
Invocation parentInvocation,
) : super(
@ -778,16 +778,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValue: _i22.Coin.bitcoin,
) as _i22.Coin);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<String> get currentReceivingAddress => (super.noSuchMethod(
Invocation.getter(#currentReceivingAddress),
@ -1196,7 +1196,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
required bool? coinControl,
required bool? isSendAll,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
super.noSuchMethod(Invocation.method(
#coinSelection,
@ -1213,7 +1213,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
));
@override
_i23.Future<List<_i28.SigningData>> fetchBuildTxData(
List<_i16.UTXO>? utxosToUse) =>
List<_i17.UTXO>? utxosToUse) =>
(super.noSuchMethod(
Invocation.method(
#fetchBuildTxData,
@ -1467,10 +1467,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction(
_i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction(
Map<String, dynamic>? txData,
dynamic electrumxClient,
List<_i16.Address>? myAddresses,
List<_i17.Address>? myAddresses,
_i22.Coin? coin,
int? minConfirms,
String? walletId,
@ -1488,8 +1488,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
],
),
returnValue:
_i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value(
_FakeTuple2_13<_i16.Transaction, _i16.Address>(
_i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value(
_FakeTuple2_13<_i17.Transaction, _i17.Address>(
this,
Invocation.method(
#parseTransaction,
@ -1503,7 +1503,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
],
),
)),
) as _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>);
) as _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>);
@override
void initPaynymWalletInterface({
required String? walletId,
@ -1513,6 +1513,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
required _i12.MainDB? db,
required _i9.ElectrumX? electrumXClient,
required _i19.SecureStorageInterface? secureStorage,
required int? dustLimit,
required int? dustLimitP2PKH,
required int? minConfirms,
required _i23.Future<String?> Function()? getMnemonicString,
@ -1531,7 +1532,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
})?
prepareSend,
required _i23.Future<int> Function({required String address})? getTxCount,
required _i23.Future<List<_i28.SigningData>> Function(List<_i16.UTXO>)?
required _i23.Future<List<_i28.SigningData>> Function(List<_i17.UTXO>)?
fetchBuildTxData,
required _i23.Future<void> Function()? refresh,
required _i23.Future<void> Function()? checkChangeAddressForTransactions,
@ -1548,6 +1549,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
#db: db,
#electrumXClient: electrumXClient,
#secureStorage: secureStorage,
#dustLimit: dustLimit,
#dustLimitP2PKH: dustLimitP2PKH,
#minConfirms: minConfirms,
#getMnemonicString: getMnemonicString,
@ -1566,28 +1568,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i16.Address> currentReceivingPaynymAddress(
_i18.PaymentCode? sender) =>
_i23.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod(
Invocation.method(
#getBip47BaseNode,
[],
),
returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#getBip47BaseNode,
[],
),
)),
) as _i23.Future<_i16.BIP32>);
@override
_i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({
required String? paymentCodeString,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#getPrivateKeyForPaynymReceivingAddress,
[],
{
#paymentCodeString: paymentCodeString,
#index: index,
},
),
returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
) as _i23.Future<_i29.Uint8List>);
@override
_i23.Future<_i17.Address> currentReceivingPaynymAddress({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions(
_i18.PaymentCode? sender) =>
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#checkCurrentPaynymReceivingAddressForTransactions,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
@ -1603,81 +1651,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i17.BIP32> deriveNotificationBip32Node({
required String? mnemonic,
required String? mnemonicPassphrase,
}) =>
(super.noSuchMethod(
_i23.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod(
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
)),
) as _i23.Future<_i17.BIP32>);
) as _i23.Future<_i16.BIP32>);
@override
_i23.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({
required String? mnemonic,
required String? mnemonicPassphrase,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
)),
) as _i23.Future<_i17.BIP32>);
@override
_i23.Future<_i18.PaymentCode> getPaymentCode(
_i27.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
_i23.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) =>
(super.noSuchMethod(
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
returnValue: _i23.Future<_i18.PaymentCode>.value(_FakePaymentCode_16(
this,
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
)),
) as _i23.Future<_i18.PaymentCode>);
@ -1702,6 +1702,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
@override
_i23.Future<Map<String, dynamic>> preparePaymentCodeSend({
required _i18.PaymentCode? paymentCode,
required bool? isSegwit,
required _i14.Amount? amount,
Map<String, dynamic>? args,
}) =>
@ -1711,6 +1712,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
[],
{
#paymentCode: paymentCode,
#isSegwit: isSegwit,
#amount: amount,
#args: args,
},
@ -1719,9 +1721,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
_i23.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i23.Future<Map<String, dynamic>>);
@override
_i23.Future<_i16.Address> nextUnusedSendAddressFrom({
_i23.Future<_i17.Address> nextUnusedSendAddressFrom({
required _i18.PaymentCode? pCode,
required _i17.BIP32? privateKeyNode,
required bool? isSegwit,
required _i16.BIP32? privateKeyNode,
int? startIndex = 0,
}) =>
(super.noSuchMethod(
@ -1730,29 +1733,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#nextUnusedSendAddressFrom,
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<Map<String, dynamic>> prepareNotificationTx({
required int? selectedTxFeeRate,
required String? targetPaymentCodeString,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1789,34 +1794,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValue: _i23.Future<bool>.value(false),
) as _i23.Future<bool>);
@override
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransaction,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i18.PaymentCode?>.value(),
) as _i23.Future<_i18.PaymentCode?>);
@override
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransactionBad,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i18.PaymentCode?>.value(),
) as _i23.Future<_i18.PaymentCode?>);
@ -1861,111 +1856,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<void> restoreHistoryWith(
_i18.PaymentCode? other,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
) =>
_i23.Future<void> restoreHistoryWith({
required _i18.PaymentCode? other,
required bool? checkSegwitAsWell,
required int? maxUnusedAddressGap,
required int? maxNumberOfIndexesToCheck,
}) =>
(super.noSuchMethod(
Invocation.method(
#restoreHistoryWith,
[
other,
maxUnusedAddressGap,
maxNumberOfIndexesToCheck,
],
[],
{
#other: other,
#checkSegwitAsWell: checkSegwitAsWell,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i27.DerivePathType? derivePathType,
required _i18.PaymentCode? toPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
)),
) as _i23.Future<_i16.Address>);
@override
_i23.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i27.DerivePathType? derivePathType,
required _i18.PaymentCode? fromPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
)),
) as _i23.Future<_i16.Address>);
@override
_i23.Future<_i16.Address> getMyNotificationAddress(
_i27.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
(super.noSuchMethod(
_i23.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod(
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<List<String>> lookupKey(String? paymentCodeString) =>
(super.noSuchMethod(
@ -2323,16 +2247,16 @@ class MockManager extends _i1.Mock implements _i6.Manager {
),
) as _i11.Balance);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(
@ -2691,16 +2615,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI {
),
) as _i11.Balance);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(

View file

@ -7,7 +7,7 @@ import 'dart:async' as _i23;
import 'dart:typed_data' as _i29;
import 'dart:ui' as _i25;
import 'package:bip32/bip32.dart' as _i17;
import 'package:bip32/bip32.dart' as _i16;
import 'package:bip47/bip47.dart' as _i18;
import 'package:bitcoindart/bitcoindart.dart' as _i13;
import 'package:flutter/foundation.dart' as _i4;
@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
import 'package:stackwallet/models/balance.dart' as _i11;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16;
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
import 'package:stackwallet/models/node_model.dart' as _i30;
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
import 'package:stackwallet/models/signing_data.dart' as _i28;
@ -193,8 +193,8 @@ class _FakeTuple2_13<T1, T2> extends _i1.SmartFake
);
}
class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
_FakeAddress_14(
class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 {
_FakeBIP32_14(
Object parent,
Invocation parentInvocation,
) : super(
@ -203,8 +203,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address {
);
}
class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 {
_FakeBIP32_15(
class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address {
_FakeAddress_15(
Object parent,
Invocation parentInvocation,
) : super(
@ -778,16 +778,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValue: _i22.Coin.bitcoin,
) as _i22.Coin);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<String> get currentReceivingAddress => (super.noSuchMethod(
Invocation.getter(#currentReceivingAddress),
@ -1196,7 +1196,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
required bool? coinControl,
required bool? isSendAll,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
super.noSuchMethod(Invocation.method(
#coinSelection,
@ -1213,7 +1213,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
));
@override
_i23.Future<List<_i28.SigningData>> fetchBuildTxData(
List<_i16.UTXO>? utxosToUse) =>
List<_i17.UTXO>? utxosToUse) =>
(super.noSuchMethod(
Invocation.method(
#fetchBuildTxData,
@ -1467,10 +1467,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction(
_i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction(
Map<String, dynamic>? txData,
dynamic electrumxClient,
List<_i16.Address>? myAddresses,
List<_i17.Address>? myAddresses,
_i22.Coin? coin,
int? minConfirms,
String? walletId,
@ -1488,8 +1488,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
],
),
returnValue:
_i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value(
_FakeTuple2_13<_i16.Transaction, _i16.Address>(
_i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value(
_FakeTuple2_13<_i17.Transaction, _i17.Address>(
this,
Invocation.method(
#parseTransaction,
@ -1503,7 +1503,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
],
),
)),
) as _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>);
) as _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>);
@override
void initPaynymWalletInterface({
required String? walletId,
@ -1513,6 +1513,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
required _i12.MainDB? db,
required _i9.ElectrumX? electrumXClient,
required _i19.SecureStorageInterface? secureStorage,
required int? dustLimit,
required int? dustLimitP2PKH,
required int? minConfirms,
required _i23.Future<String?> Function()? getMnemonicString,
@ -1531,7 +1532,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
})?
prepareSend,
required _i23.Future<int> Function({required String address})? getTxCount,
required _i23.Future<List<_i28.SigningData>> Function(List<_i16.UTXO>)?
required _i23.Future<List<_i28.SigningData>> Function(List<_i17.UTXO>)?
fetchBuildTxData,
required _i23.Future<void> Function()? refresh,
required _i23.Future<void> Function()? checkChangeAddressForTransactions,
@ -1548,6 +1549,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
#db: db,
#electrumXClient: electrumXClient,
#secureStorage: secureStorage,
#dustLimit: dustLimit,
#dustLimitP2PKH: dustLimitP2PKH,
#minConfirms: minConfirms,
#getMnemonicString: getMnemonicString,
@ -1566,28 +1568,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
_i23.Future<_i16.Address> currentReceivingPaynymAddress(
_i18.PaymentCode? sender) =>
_i23.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod(
Invocation.method(
#getBip47BaseNode,
[],
),
returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#getBip47BaseNode,
[],
),
)),
) as _i23.Future<_i16.BIP32>);
@override
_i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({
required String? paymentCodeString,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#getPrivateKeyForPaynymReceivingAddress,
[],
{
#paymentCodeString: paymentCodeString,
#index: index,
},
),
returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
) as _i23.Future<_i29.Uint8List>);
@override
_i23.Future<_i17.Address> currentReceivingPaynymAddress({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#currentReceivingPaynymAddress,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions(
_i18.PaymentCode? sender) =>
_i23.Future<void> checkCurrentPaynymReceivingAddressForTransactions({
required _i18.PaymentCode? sender,
required bool? isSegwit,
}) =>
(super.noSuchMethod(
Invocation.method(
#checkCurrentPaynymReceivingAddressForTransactions,
[sender],
[],
{
#sender: sender,
#isSegwit: isSegwit,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
@ -1603,81 +1651,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i17.BIP32> deriveNotificationBip32Node({
required String? mnemonic,
required String? mnemonicPassphrase,
}) =>
(super.noSuchMethod(
_i23.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod(
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14(
this,
Invocation.method(
#deriveNotificationBip32Node,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
},
),
)),
) as _i23.Future<_i17.BIP32>);
) as _i23.Future<_i16.BIP32>);
@override
_i23.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({
required String? mnemonic,
required String? mnemonicPassphrase,
required int? index,
}) =>
(super.noSuchMethod(
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15(
this,
Invocation.method(
#deriveReceivingPrivateKeyNode,
[],
{
#mnemonic: mnemonic,
#mnemonicPassphrase: mnemonicPassphrase,
#index: index,
},
),
)),
) as _i23.Future<_i17.BIP32>);
@override
_i23.Future<_i18.PaymentCode> getPaymentCode(
_i27.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
_i23.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) =>
(super.noSuchMethod(
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
returnValue: _i23.Future<_i18.PaymentCode>.value(_FakePaymentCode_16(
this,
Invocation.method(
#getPaymentCode,
[
derivePathType,
bip32Root,
],
[],
{#isSegwit: isSegwit},
),
)),
) as _i23.Future<_i18.PaymentCode>);
@ -1702,6 +1702,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
@override
_i23.Future<Map<String, dynamic>> preparePaymentCodeSend({
required _i18.PaymentCode? paymentCode,
required bool? isSegwit,
required _i14.Amount? amount,
Map<String, dynamic>? args,
}) =>
@ -1711,6 +1712,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
[],
{
#paymentCode: paymentCode,
#isSegwit: isSegwit,
#amount: amount,
#args: args,
},
@ -1719,9 +1721,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
_i23.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i23.Future<Map<String, dynamic>>);
@override
_i23.Future<_i16.Address> nextUnusedSendAddressFrom({
_i23.Future<_i17.Address> nextUnusedSendAddressFrom({
required _i18.PaymentCode? pCode,
required _i17.BIP32? privateKeyNode,
required bool? isSegwit,
required _i16.BIP32? privateKeyNode,
int? startIndex = 0,
}) =>
(super.noSuchMethod(
@ -1730,29 +1733,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#nextUnusedSendAddressFrom,
[],
{
#pCode: pCode,
#isSegwit: isSegwit,
#privateKeyNode: privateKeyNode,
#startIndex: startIndex,
},
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<Map<String, dynamic>> prepareNotificationTx({
required int? selectedTxFeeRate,
required String? targetPaymentCodeString,
int? additionalOutputs = 0,
List<_i16.UTXO>? utxos,
List<_i17.UTXO>? utxos,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -1789,34 +1794,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValue: _i23.Future<bool>.value(false),
) as _i23.Future<bool>);
@override
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransaction,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i18.PaymentCode?>.value(),
) as _i23.Future<_i18.PaymentCode?>);
@override
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({
required _i16.Transaction? transaction,
required _i16.Address? myNotificationAddress,
}) =>
_i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad(
{required _i17.Transaction? transaction}) =>
(super.noSuchMethod(
Invocation.method(
#unBlindedPaymentCodeFromTransactionBad,
[],
{
#transaction: transaction,
#myNotificationAddress: myNotificationAddress,
},
{#transaction: transaction},
),
returnValue: _i23.Future<_i18.PaymentCode?>.value(),
) as _i23.Future<_i18.PaymentCode?>);
@ -1861,111 +1856,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<void> restoreHistoryWith(
_i18.PaymentCode? other,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
) =>
_i23.Future<void> restoreHistoryWith({
required _i18.PaymentCode? other,
required bool? checkSegwitAsWell,
required int? maxUnusedAddressGap,
required int? maxNumberOfIndexesToCheck,
}) =>
(super.noSuchMethod(
Invocation.method(
#restoreHistoryWith,
[
other,
maxUnusedAddressGap,
maxNumberOfIndexesToCheck,
],
[],
{
#other: other,
#checkSegwitAsWell: checkSegwitAsWell,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
},
),
returnValue: _i23.Future<void>.value(),
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@override
_i23.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i27.DerivePathType? derivePathType,
required _i18.PaymentCode? toPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymSendAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#toPaymentCode: toPaymentCode,
},
),
)),
) as _i23.Future<_i16.Address>);
@override
_i23.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({
required _i13.ECPair? pair,
required int? derivationIndex,
required _i27.DerivePathType? derivePathType,
required _i18.PaymentCode? fromPaymentCode,
}) =>
(super.noSuchMethod(
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
this,
Invocation.method(
#generatePaynymReceivingAddressFromKeyPair,
[],
{
#pair: pair,
#derivationIndex: derivationIndex,
#derivePathType: derivePathType,
#fromPaymentCode: fromPaymentCode,
},
),
)),
) as _i23.Future<_i16.Address>);
@override
_i23.Future<_i16.Address> getMyNotificationAddress(
_i27.DerivePathType? derivePathType, [
_i17.BIP32? bip32Root,
]) =>
(super.noSuchMethod(
_i23.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod(
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14(
returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15(
this,
Invocation.method(
#getMyNotificationAddress,
[
derivePathType,
bip32Root,
],
[],
),
)),
) as _i23.Future<_i16.Address>);
) as _i23.Future<_i17.Address>);
@override
_i23.Future<List<String>> lookupKey(String? paymentCodeString) =>
(super.noSuchMethod(
@ -2323,16 +2247,16 @@ class MockManager extends _i1.Mock implements _i6.Manager {
),
) as _i11.Balance);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(
@ -2691,16 +2615,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI {
),
) as _i11.Balance);
@override
_i23.Future<List<_i16.Transaction>> get transactions => (super.noSuchMethod(
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
Invocation.getter(#transactions),
returnValue:
_i23.Future<List<_i16.Transaction>>.value(<_i16.Transaction>[]),
) as _i23.Future<List<_i16.Transaction>>);
_i23.Future<List<_i17.Transaction>>.value(<_i17.Transaction>[]),
) as _i23.Future<List<_i17.Transaction>>);
@override
_i23.Future<List<_i16.UTXO>> get utxos => (super.noSuchMethod(
_i23.Future<List<_i17.UTXO>> get utxos => (super.noSuchMethod(
Invocation.getter(#utxos),
returnValue: _i23.Future<List<_i16.UTXO>>.value(<_i16.UTXO>[]),
) as _i23.Future<List<_i16.UTXO>>);
returnValue: _i23.Future<List<_i17.UTXO>>.value(<_i17.UTXO>[]),
) as _i23.Future<List<_i17.UTXO>>);
@override
set walletName(String? newName) => super.noSuchMethod(
Invocation.setter(