Nano rep fixes (#1145)

* add preference keys for default nano/banano rep

* updates to change rep page, add success message

* forgot to save this file

* nano_client cleanup

* first pass

* refactor to use sharedprefs in nano_client

* review fixes
This commit is contained in:
Matthew Fosse 2023-11-17 13:35:46 -05:00 committed by GitHub
parent 8237b89d56
commit f4e71c72ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 321 additions and 149 deletions

View file

@ -8,18 +8,28 @@ import 'package:cw_nano/nano_util.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:nanodart/nanodart.dart'; import 'package:nanodart/nanodart.dart';
import 'package:cw_core/node.dart'; import 'package:cw_core/node.dart';
import 'package:shared_preferences/shared_preferences.dart';
class NanoClient { class NanoClient {
static const String DEFAULT_REPRESENTATIVE =
"nano_38713x95zyjsqzx6nm1dsom1jmm668owkeb9913ax6nfgj15az3nu8xkx579";
static const Map<String, String> CAKE_HEADERS = { static const Map<String, String> CAKE_HEADERS = {
"Content-Type": "application/json", "Content-Type": "application/json",
"nano-app": "cake-wallet" "nano-app": "cake-wallet"
}; };
NanoClient() {
SharedPreferences.getInstance().then((value) => prefs = value);
}
late SharedPreferences prefs;
Node? _node; Node? _node;
Node? _powNode; Node? _powNode;
static const String _defaultDefaultRepresentative =
"nano_38713x95zyjsqzx6nm1dsom1jmm668owkeb9913ax6nfgj15az3nu8xkx579";
String getRepFromPrefs() {
// from preferences_key.dart "defaultNanoRep" key:
return prefs.getString("default_nano_representative") ?? _defaultDefaultRepresentative;
}
bool connect(Node node) { bool connect(Node node) {
try { try {
@ -84,44 +94,45 @@ class NanoClient {
required String repAddress, required String repAddress,
required String ourAddress, required String ourAddress,
}) async { }) async {
AccountInfoResponse? accountInfo = await getAccountInfo(ourAddress);
if (accountInfo == null) {
throw Exception(
"error while getting account info, you can't change the rep of an unopened account");
}
// construct the change block:
Map<String, String> changeBlock = {
"type": "state",
"account": ourAddress,
"previous": accountInfo.frontier,
"representative": repAddress,
"balance": accountInfo.balance,
"link": "0000000000000000000000000000000000000000000000000000000000000000",
"link_as_account": "nano_1111111111111111111111111111111111111111111111111111hifc8npp",
};
// sign the change block:
final String hash = NanoBlocks.computeStateHash(
NanoAccountType.NANO,
changeBlock["account"]!,
changeBlock["previous"]!,
changeBlock["representative"]!,
BigInt.parse(changeBlock["balance"]!),
changeBlock["link"]!,
);
final String signature = NanoSignatures.signBlock(hash, privateKey);
// get PoW for the send block:
final String work = await requestWork(accountInfo.frontier);
changeBlock["signature"] = signature;
changeBlock["work"] = work;
try { try {
AccountInfoResponse? accountInfo = await getAccountInfo(ourAddress);
if (accountInfo == null) {
throw Exception("error while getting account info");
}
// construct the change block:
Map<String, String> changeBlock = {
"type": "state",
"account": ourAddress,
"previous": accountInfo.frontier,
"representative": repAddress,
"balance": accountInfo.balance,
"link": "0000000000000000000000000000000000000000000000000000000000000000",
"link_as_account": "nano_1111111111111111111111111111111111111111111111111111hifc8npp",
};
// sign the change block:
final String hash = NanoBlocks.computeStateHash(
NanoAccountType.NANO,
changeBlock["account"]!,
changeBlock["previous"]!,
changeBlock["representative"]!,
BigInt.parse(changeBlock["balance"]!),
changeBlock["link"]!,
);
final String signature = NanoSignatures.signBlock(hash, privateKey);
// get PoW for the send block:
final String work = await requestWork(accountInfo.frontier);
changeBlock["signature"] = signature;
changeBlock["work"] = work;
return await processBlock(changeBlock, "change"); return await processBlock(changeBlock, "change");
} catch (e) { } catch (e) {
throw Exception("error while changing representative"); throw Exception("error while changing representative: $e");
} }
} }
@ -191,68 +202,63 @@ class NanoClient {
BigInt? balanceAfterTx, BigInt? balanceAfterTx,
String? previousHash, String? previousHash,
}) async { }) async {
try { // our address:
// our address: final String publicAddress = NanoUtil.privateKeyToAddress(privateKey);
final String publicAddress = NanoUtil.privateKeyToAddress(privateKey);
// first get the current account balance: // first get the current account balance:
if (balanceAfterTx == null) { if (balanceAfterTx == null) {
final BigInt currentBalance = (await getBalance(publicAddress)).currentBalance; final BigInt currentBalance = (await getBalance(publicAddress)).currentBalance;
final BigInt txAmount = BigInt.parse(amountRaw); final BigInt txAmount = BigInt.parse(amountRaw);
balanceAfterTx = currentBalance - txAmount; balanceAfterTx = currentBalance - txAmount;
}
// get the account info (we need the frontier and representative):
AccountInfoResponse? infoResponse = await getAccountInfo(publicAddress);
if (infoResponse == null) {
throw Exception(
"error while getting account info! (we probably don't have an open account yet)");
}
String frontier = infoResponse.frontier;
// override if provided:
if (previousHash != null) {
frontier = previousHash;
}
final String representative = infoResponse.representative;
// link = destination address:
final String link = NanoAccounts.extractPublicKey(destinationAddress);
final String linkAsAccount = destinationAddress;
// construct the send block:
Map<String, String> sendBlock = {
"type": "state",
"account": publicAddress,
"previous": frontier,
"representative": representative,
"balance": balanceAfterTx.toString(),
"link": link,
};
// sign the send block:
final String hash = NanoBlocks.computeStateHash(
NanoAccountType.NANO,
sendBlock["account"]!,
sendBlock["previous"]!,
sendBlock["representative"]!,
BigInt.parse(sendBlock["balance"]!),
sendBlock["link"]!,
);
final String signature = NanoSignatures.signBlock(hash, privateKey);
// get PoW for the send block:
final String work = await requestWork(frontier);
sendBlock["link_as_account"] = linkAsAccount;
sendBlock["signature"] = signature;
sendBlock["work"] = work;
// ready to post send block:
return sendBlock;
} catch (e) {
print(e);
rethrow;
} }
// get the account info (we need the frontier and representative):
AccountInfoResponse? infoResponse = await getAccountInfo(publicAddress);
if (infoResponse == null) {
throw Exception(
"error while getting account info! (we probably don't have an open account yet)");
}
String frontier = infoResponse.frontier;
// override if provided:
if (previousHash != null) {
frontier = previousHash;
}
final String representative = infoResponse.representative;
// link = destination address:
final String link = NanoAccounts.extractPublicKey(destinationAddress);
final String linkAsAccount = destinationAddress;
// construct the send block:
Map<String, String> sendBlock = {
"type": "state",
"account": publicAddress,
"previous": frontier,
"representative": representative,
"balance": balanceAfterTx.toString(),
"link": link,
};
// sign the send block:
final String hash = NanoBlocks.computeStateHash(
NanoAccountType.NANO,
sendBlock["account"]!,
sendBlock["previous"]!,
sendBlock["representative"]!,
BigInt.parse(sendBlock["balance"]!),
sendBlock["link"]!,
);
final String signature = NanoSignatures.signBlock(hash, privateKey);
// get PoW for the send block:
final String work = await requestWork(frontier);
sendBlock["link_as_account"] = linkAsAccount;
sendBlock["signature"] = signature;
sendBlock["work"] = work;
// ready to post send block:
return sendBlock;
} }
Future<void> receiveBlock({ Future<void> receiveBlock({
@ -274,7 +280,7 @@ class NanoClient {
// account is not open yet, we need to create an open block: // account is not open yet, we need to create an open block:
openBlock = true; openBlock = true;
// we don't have a representative set yet: // we don't have a representative set yet:
representative = DEFAULT_REPRESENTATIVE; representative = await getRepFromPrefs();
// we don't have a frontier yet: // we don't have a frontier yet:
frontier = "0000000000000000000000000000000000000000000000000000000000000000"; frontier = "0000000000000000000000000000000000000000000000000000000000000000";
} else { } else {

View file

@ -382,7 +382,7 @@ abstract class NanoWalletBase
_representativeAddress = accountInfo.representative; _representativeAddress = accountInfo.representative;
} catch (e) { } catch (e) {
// account not found: // account not found:
_representativeAddress = NanoClient.DEFAULT_REPRESENTATIVE; _representativeAddress = await _client.getRepFromPrefs();
throw Exception("Failed to get representative address $e"); throw Exception("Failed to get representative address $e");
} }
} }

View file

@ -290,6 +290,11 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client: frontend_server_client:
dependency: transitive dependency: transitive
description: description:
@ -594,6 +599,62 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.2.2"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a
url: "https://pub.dev"
source: hosted
version: "2.3.1"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
url: "https://pub.dev"
source: hosted
version: "2.2.1"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@ -753,4 +814,4 @@ packages:
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.0.0 <4.0.0" dart: ">=3.0.0 <4.0.0"
flutter: ">=3.3.0" flutter: ">=3.7.0"

View file

@ -21,6 +21,7 @@ dependencies:
ed25519_hd_key: ^2.2.0 ed25519_hd_key: ^2.2.0
hex: ^0.2.0 hex: ^0.2.0
http: ^1.1.0 http: ^1.1.0
shared_preferences: ^2.0.15
cw_core: cw_core:
path: ../cw_core path: ../cw_core

View file

@ -247,6 +247,8 @@ class BackupService {
final sortBalanceTokensBy = data[PreferencesKey.sortBalanceBy] as int?; final sortBalanceTokensBy = data[PreferencesKey.sortBalanceBy] as int?;
final pinNativeTokenAtTop = data[PreferencesKey.pinNativeTokenAtTop] as bool?; final pinNativeTokenAtTop = data[PreferencesKey.pinNativeTokenAtTop] as bool?;
final useEtherscan = data[PreferencesKey.useEtherscan] as bool?; final useEtherscan = data[PreferencesKey.useEtherscan] as bool?;
final defaultNanoRep = data[PreferencesKey.defaultNanoRep] as String?;
final defaultBananoRep = data[PreferencesKey.defaultBananoRep] as String?;
final lookupsTwitter = data[PreferencesKey.lookupsTwitter] as bool?; final lookupsTwitter = data[PreferencesKey.lookupsTwitter] as bool?;
final lookupsMastodon = data[PreferencesKey.lookupsMastodon] as bool?; final lookupsMastodon = data[PreferencesKey.lookupsMastodon] as bool?;
final lookupsYatService = data[PreferencesKey.lookupsYatService] as bool?; final lookupsYatService = data[PreferencesKey.lookupsYatService] as bool?;
@ -322,11 +324,10 @@ class BackupService {
if (currentTheme != null && DeviceInfo.instance.isMobile) { if (currentTheme != null && DeviceInfo.instance.isMobile) {
await _sharedPreferences.setInt(PreferencesKey.currentTheme, currentTheme); await _sharedPreferences.setInt(PreferencesKey.currentTheme, currentTheme);
// enforce dark theme on desktop platforms until the design is ready: // enforce dark theme on desktop platforms until the design is ready:
} else if (DeviceInfo.instance.isDesktop) { } else if (DeviceInfo.instance.isDesktop) {
await _sharedPreferences.setInt(PreferencesKey.currentTheme, ThemeList.darkTheme.raw); await _sharedPreferences.setInt(PreferencesKey.currentTheme, ThemeList.darkTheme.raw);
} }
if (exchangeStatus != null) if (exchangeStatus != null)
await _sharedPreferences.setInt(PreferencesKey.exchangeStatusKey, exchangeStatus); await _sharedPreferences.setInt(PreferencesKey.exchangeStatusKey, exchangeStatus);
@ -389,6 +390,13 @@ class BackupService {
if (useEtherscan != null) if (useEtherscan != null)
await _sharedPreferences.setBool(PreferencesKey.useEtherscan, useEtherscan); await _sharedPreferences.setBool(PreferencesKey.useEtherscan, useEtherscan);
if (defaultNanoRep != null)
await _sharedPreferences.setString(PreferencesKey.defaultNanoRep, defaultNanoRep);
if (defaultBananoRep != null)
await _sharedPreferences.setString(PreferencesKey.defaultBananoRep, defaultBananoRep);
if (syncAll != null) await _sharedPreferences.setBool(PreferencesKey.syncAllKey, syncAll);
if (lookupsTwitter != null) if (lookupsTwitter != null)
await _sharedPreferences.setBool(PreferencesKey.lookupsTwitter, lookupsTwitter); await _sharedPreferences.setBool(PreferencesKey.lookupsTwitter, lookupsTwitter);
@ -560,6 +568,9 @@ class BackupService {
PreferencesKey.pinNativeTokenAtTop: PreferencesKey.pinNativeTokenAtTop:
_sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop), _sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop),
PreferencesKey.useEtherscan: _sharedPreferences.getBool(PreferencesKey.useEtherscan), PreferencesKey.useEtherscan: _sharedPreferences.getBool(PreferencesKey.useEtherscan),
PreferencesKey.defaultNanoRep: _sharedPreferences.getString(PreferencesKey.defaultNanoRep),
PreferencesKey.defaultBananoRep:
_sharedPreferences.getString(PreferencesKey.defaultBananoRep),
PreferencesKey.lookupsTwitter: _sharedPreferences.getBool(PreferencesKey.lookupsTwitter), PreferencesKey.lookupsTwitter: _sharedPreferences.getBool(PreferencesKey.lookupsTwitter),
PreferencesKey.lookupsMastodon: _sharedPreferences.getBool(PreferencesKey.lookupsMastodon), PreferencesKey.lookupsMastodon: _sharedPreferences.getBool(PreferencesKey.lookupsMastodon),
PreferencesKey.lookupsYatService: PreferencesKey.lookupsYatService:

View file

@ -522,8 +522,7 @@ Future<void> setup({
getIt.registerFactory<Modify2FAPage>( getIt.registerFactory<Modify2FAPage>(
() => Modify2FAPage(setup2FAViewModel: getIt.get<Setup2FAViewModel>())); () => Modify2FAPage(setup2FAViewModel: getIt.get<Setup2FAViewModel>()));
getIt.registerFactory<DesktopSettingsPage>( getIt.registerFactory<DesktopSettingsPage>(() => DesktopSettingsPage());
() => DesktopSettingsPage());
getIt.registerFactoryParam<ReceiveOptionViewModel, ReceivePageOption?, void>( getIt.registerFactoryParam<ReceiveOptionViewModel, ReceivePageOption?, void>(
(pageOption, _) => ReceiveOptionViewModel(getIt.get<AppStore>().wallet!, pageOption)); (pageOption, _) => ReceiveOptionViewModel(getIt.get<AppStore>().wallet!, pageOption));
@ -766,7 +765,10 @@ Future<void> setup({
getIt.registerFactory(() => OtherSettingsPage(getIt.get<OtherSettingsViewModel>())); getIt.registerFactory(() => OtherSettingsPage(getIt.get<OtherSettingsViewModel>()));
getIt.registerFactory(() => NanoChangeRepPage(getIt.get<AppStore>().wallet!)); getIt.registerFactory(() => NanoChangeRepPage(
settingsStore: getIt.get<AppStore>().settingsStore,
wallet: getIt.get<AppStore>().wallet!,
));
getIt.registerFactoryParam<NodeCreateOrEditViewModel, WalletType?, bool?>( getIt.registerFactoryParam<NodeCreateOrEditViewModel, WalletType?, bool?>(
(WalletType? type, bool? isPow) => NodeCreateOrEditViewModel( (WalletType? type, bool? isPow) => NodeCreateOrEditViewModel(
@ -839,7 +841,8 @@ Future<void> setup({
case WalletType.ethereum: case WalletType.ethereum:
return ethereum!.createEthereumWalletService(_walletInfoSource); return ethereum!.createEthereumWalletService(_walletInfoSource);
case WalletType.bitcoinCash: case WalletType.bitcoinCash:
return bitcoinCash!.createBitcoinCashWalletService(_walletInfoSource, _unspentCoinsInfoSource!); return bitcoinCash!
.createBitcoinCashWalletService(_walletInfoSource, _unspentCoinsInfoSource!);
case WalletType.nano: case WalletType.nano:
return nano!.createNanoWalletService(_walletInfoSource); return nano!.createNanoWalletService(_walletInfoSource);
default: default:

View file

@ -50,6 +50,8 @@ class PreferencesKey {
static const sortBalanceBy = 'sort_balance_by'; static const sortBalanceBy = 'sort_balance_by';
static const pinNativeTokenAtTop = 'pin_native_token_at_top'; static const pinNativeTokenAtTop = 'pin_native_token_at_top';
static const useEtherscan = 'use_etherscan'; static const useEtherscan = 'use_etherscan';
static const defaultNanoRep = 'default_nano_representative';
static const defaultBananoRep = 'default_banano_representative';
static const lookupsTwitter = 'looks_up_twitter'; static const lookupsTwitter = 'looks_up_twitter';
static const lookupsMastodon = 'looks_up_mastodon'; static const lookupsMastodon = 'looks_up_mastodon';
static const lookupsYatService = 'looks_up_mastodon'; static const lookupsYatService = 'looks_up_mastodon';

View file

@ -166,7 +166,10 @@ class CWNano extends Nano {
@override @override
Future<void> changeRep(Object wallet, String address) async { Future<void> changeRep(Object wallet, String address) async {
return (wallet as NanoWallet).changeRep(address); if ((wallet as NanoWallet).transactionHistory.transactions.isEmpty) {
throw Exception("Can't change representative without an existing transaction history");
}
return wallet.changeRep(address);
} }
@override @override

View file

@ -2,6 +2,7 @@ import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart';
import 'package:cake_wallet/entities/fiat_api_mode.dart'; import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:cake_wallet/entities/update_haven_rate.dart'; import 'package:cake_wallet/entities/update_haven_rate.dart';
import 'package:cake_wallet/ethereum/ethereum.dart'; import 'package:cake_wallet/ethereum/ethereum.dart';
import 'package:cake_wallet/nano/nano.dart';
import 'package:cw_core/transaction_history.dart'; import 'package:cw_core/transaction_history.dart';
import 'package:cw_core/balance.dart'; import 'package:cw_core/balance.dart';
import 'package:cw_core/transaction_info.dart'; import 'package:cw_core/transaction_info.dart';

View file

@ -1,8 +1,11 @@
import 'package:cake_wallet/core/address_validator.dart'; import 'package:cake_wallet/core/address_validator.dart';
import 'package:cake_wallet/nano/nano.dart'; import 'package:cake_wallet/nano/nano.dart';
import 'package:cake_wallet/src/widgets/address_text_field.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/extensions/address_theme.dart';
import 'package:cake_wallet/utils/payment_request.dart';
import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_base.dart';
@ -14,21 +17,28 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
class NanoChangeRepPage extends BasePage { class NanoChangeRepPage extends BasePage {
NanoChangeRepPage(WalletBase wallet) NanoChangeRepPage({required SettingsStore settingsStore, required WalletBase wallet})
: _wallet = wallet, : _wallet = wallet,
_addressController = TextEditingController() { _settingsStore = settingsStore,
_addressController = TextEditingController(),
_formKey = GlobalKey<FormState>() {
_addressController.text = nano!.getRepresentative(wallet); _addressController.text = nano!.getRepresentative(wallet);
} }
final TextEditingController _addressController; final TextEditingController _addressController;
final WalletBase _wallet; final WalletBase _wallet;
final SettingsStore _settingsStore;
final GlobalKey<FormState> _formKey;
@override @override
String get title => S.current.change_rep; String get title => S.current.change_rep;
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
return Container( return Form(
key: _formKey,
child: Container(
padding: EdgeInsets.only(left: 24, right: 24), padding: EdgeInsets.only(left: 24, right: 24),
child: ScrollableWithBottomSection( child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(bottom: 24.0), contentPadding: EdgeInsets.only(bottom: 24.0),
@ -38,9 +48,17 @@ class NanoChangeRepPage extends BasePage {
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: BaseTextFormField( child: AddressTextField(
controller: _addressController, controller: _addressController,
hintText: S.of(context).node_address, onURIScanned: (uri) {
final paymentRequest = PaymentRequest.fromUri(uri);
_addressController.text = paymentRequest.address;
},
options: [
AddressTextFieldOption.paste,
AddressTextFieldOption.qrCode,
],
buttonColor: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
validator: AddressValidator(type: CryptoCurrency.nano), validator: AddressValidator(type: CryptoCurrency.nano),
), ),
) )
@ -59,6 +77,11 @@ class NanoChangeRepPage extends BasePage {
padding: EdgeInsets.only(right: 8.0), padding: EdgeInsets.only(right: 8.0),
child: LoadingPrimaryButton( child: LoadingPrimaryButton(
onPressed: () async { onPressed: () async {
if (_formKey.currentState != null &&
!_formKey.currentState!.validate()) {
return;
}
final confirmed = await showPopUp<bool>( final confirmed = await showPopUp<bool>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
@ -74,8 +97,19 @@ class NanoChangeRepPage extends BasePage {
if (confirmed) { if (confirmed) {
try { try {
_settingsStore.defaultNanoRep = _addressController.text;
await nano!.changeRep(_wallet, _addressController.text); await nano!.changeRep(_wallet, _addressController.text);
Navigator.of(context).pop();
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
alertTitle: S.of(context).successful,
alertContent: S.of(context).change_rep_successful,
buttonText: S.of(context).ok,
buttonAction: () => Navigator.pop(context));
});
} catch (e) { } catch (e) {
await showPopUp<void>( await showPopUp<void>(
context: context, context: context,
@ -97,6 +131,8 @@ class NanoChangeRepPage extends BasePage {
)), )),
], ],
)), )),
)); ),
),
);
} }
} }

View file

@ -86,6 +86,8 @@ abstract class SettingsStoreBase with Store {
required this.sortBalanceBy, required this.sortBalanceBy,
required this.pinNativeTokenAtTop, required this.pinNativeTokenAtTop,
required this.useEtherscan, required this.useEtherscan,
required this.defaultNanoRep,
required this.defaultBananoRep,
required this.lookupsTwitter, required this.lookupsTwitter,
required this.lookupsMastodon, required this.lookupsMastodon,
required this.lookupsYatService, required this.lookupsYatService,
@ -378,6 +380,13 @@ abstract class SettingsStoreBase with Store {
(bool useEtherscan) => (bool useEtherscan) =>
_sharedPreferences.setBool(PreferencesKey.useEtherscan, useEtherscan)); _sharedPreferences.setBool(PreferencesKey.useEtherscan, useEtherscan));
reaction((_) => defaultNanoRep,
(String nanoRep) => _sharedPreferences.setString(PreferencesKey.defaultNanoRep, nanoRep));
reaction(
(_) => defaultBananoRep,
(String bananoRep) =>
_sharedPreferences.setString(PreferencesKey.defaultBananoRep, bananoRep));
reaction( reaction(
(_) => lookupsTwitter, (_) => lookupsTwitter,
(bool looksUpTwitter) => (bool looksUpTwitter) =>
@ -541,6 +550,12 @@ abstract class SettingsStoreBase with Store {
@observable @observable
bool useEtherscan; bool useEtherscan;
@observable
String defaultNanoRep;
@observable
String defaultBananoRep;
@observable @observable
bool lookupsTwitter; bool lookupsTwitter;
@ -618,8 +633,8 @@ abstract class SettingsStoreBase with Store {
TransactionPriority? moneroTransactionPriority = monero?.deserializeMoneroTransactionPriority( TransactionPriority? moneroTransactionPriority = monero?.deserializeMoneroTransactionPriority(
raw: sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority)!); raw: sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority)!);
TransactionPriority? bitcoinTransactionPriority = TransactionPriority? bitcoinTransactionPriority =
bitcoin?.deserializeBitcoinTransactionPriority( bitcoin?.deserializeBitcoinTransactionPriority(
sharedPreferences.getInt(PreferencesKey.bitcoinTransactionPriority)!); sharedPreferences.getInt(PreferencesKey.bitcoinTransactionPriority)!);
TransactionPriority? havenTransactionPriority; TransactionPriority? havenTransactionPriority;
TransactionPriority? litecoinTransactionPriority; TransactionPriority? litecoinTransactionPriority;
@ -658,8 +673,8 @@ abstract class SettingsStoreBase with Store {
final isAppSecure = sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? false; final isAppSecure = sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? false;
final disableBuy = sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? false; final disableBuy = sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? false;
final disableSell = sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? false; final disableSell = sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? false;
final defaultBuyProvider = BuyProviderType.values[sharedPreferences.getInt( final defaultBuyProvider =
PreferencesKey.defaultBuyProvider) ?? 0]; BuyProviderType.values[sharedPreferences.getInt(PreferencesKey.defaultBuyProvider) ?? 0];
final currentFiatApiMode = FiatApiMode.deserialize( final currentFiatApiMode = FiatApiMode.deserialize(
raw: sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? raw: sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ??
FiatApiMode.enabled.raw); FiatApiMode.enabled.raw);
@ -678,7 +693,7 @@ abstract class SettingsStoreBase with Store {
sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForSendsToInternalWallets) ?? sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForSendsToInternalWallets) ??
false; false;
final shouldRequireTOTP2FAForExchangesToInternalWallets = sharedPreferences final shouldRequireTOTP2FAForExchangesToInternalWallets = sharedPreferences
.getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToInternalWallets) ?? .getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToInternalWallets) ??
false; false;
final shouldRequireTOTP2FAForExchangesToExternalWallets = sharedPreferences final shouldRequireTOTP2FAForExchangesToExternalWallets = sharedPreferences
.getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToExternalWallets) ?? .getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToExternalWallets) ??
@ -689,7 +704,7 @@ abstract class SettingsStoreBase with Store {
sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForCreatingNewWallets) ?? sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForCreatingNewWallets) ??
false; false;
final shouldRequireTOTP2FAForAllSecurityAndBackupSettings = sharedPreferences final shouldRequireTOTP2FAForAllSecurityAndBackupSettings = sharedPreferences
.getBool(PreferencesKey.shouldRequireTOTP2FAForAllSecurityAndBackupSettings) ?? .getBool(PreferencesKey.shouldRequireTOTP2FAForAllSecurityAndBackupSettings) ??
false; false;
final useTOTP2FA = sharedPreferences.getBool(PreferencesKey.useTOTP2FA) ?? false; final useTOTP2FA = sharedPreferences.getBool(PreferencesKey.useTOTP2FA) ?? false;
final totpSecretKey = sharedPreferences.getString(PreferencesKey.totpSecretKey) ?? ''; final totpSecretKey = sharedPreferences.getString(PreferencesKey.totpSecretKey) ?? '';
@ -718,10 +733,12 @@ abstract class SettingsStoreBase with Store {
? SeedPhraseLength.deserialize(raw: seedPhraseCount) ? SeedPhraseLength.deserialize(raw: seedPhraseCount)
: defaultSeedPhraseLength; : defaultSeedPhraseLength;
final sortBalanceBy = final sortBalanceBy =
SortBalanceBy.values[sharedPreferences.getInt(PreferencesKey.sortBalanceBy) ?? 0]; SortBalanceBy.values[sharedPreferences.getInt(PreferencesKey.sortBalanceBy) ?? 0];
final pinNativeTokenAtTop = final pinNativeTokenAtTop =
sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop) ?? true; sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop) ?? true;
final useEtherscan = sharedPreferences.getBool(PreferencesKey.useEtherscan) ?? true; final useEtherscan = sharedPreferences.getBool(PreferencesKey.useEtherscan) ?? true;
final defaultNanoRep = sharedPreferences.getString(PreferencesKey.defaultNanoRep) ?? "";
final defaultBananoRep = sharedPreferences.getString(PreferencesKey.defaultBananoRep) ?? "";
final lookupsTwitter = sharedPreferences.getBool(PreferencesKey.lookupsTwitter) ?? true; final lookupsTwitter = sharedPreferences.getBool(PreferencesKey.lookupsTwitter) ?? true;
final lookupsMastodon = sharedPreferences.getBool(PreferencesKey.lookupsMastodon) ?? true; final lookupsMastodon = sharedPreferences.getBool(PreferencesKey.lookupsMastodon) ?? true;
final lookupsYatService = sharedPreferences.getBool(PreferencesKey.lookupsYatService) ?? true; final lookupsYatService = sharedPreferences.getBool(PreferencesKey.lookupsYatService) ?? true;
@ -738,11 +755,11 @@ abstract class SettingsStoreBase with Store {
await LanguageService.localeDetection(); await LanguageService.localeDetection();
final nodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey); final nodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey);
final bitcoinElectrumServerId = final bitcoinElectrumServerId =
sharedPreferences.getInt(PreferencesKey.currentBitcoinElectrumSererIdKey); sharedPreferences.getInt(PreferencesKey.currentBitcoinElectrumSererIdKey);
final litecoinElectrumServerId = final litecoinElectrumServerId =
sharedPreferences.getInt(PreferencesKey.currentLitecoinElectrumSererIdKey); sharedPreferences.getInt(PreferencesKey.currentLitecoinElectrumSererIdKey);
final bitcoinCashElectrumServerId = final bitcoinCashElectrumServerId =
sharedPreferences.getInt(PreferencesKey.currentBitcoinCashNodeIdKey); sharedPreferences.getInt(PreferencesKey.currentBitcoinCashNodeIdKey);
final havenNodeId = sharedPreferences.getInt(PreferencesKey.currentHavenNodeIdKey); final havenNodeId = sharedPreferences.getInt(PreferencesKey.currentHavenNodeIdKey);
final ethereumNodeId = sharedPreferences.getInt(PreferencesKey.currentEthereumNodeIdKey); final ethereumNodeId = sharedPreferences.getInt(PreferencesKey.currentEthereumNodeIdKey);
final nanoNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey); final nanoNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey);
@ -759,7 +776,7 @@ abstract class SettingsStoreBase with Store {
final deviceName = await _getDeviceName() ?? ''; final deviceName = await _getDeviceName() ?? '';
final shouldShowYatPopup = sharedPreferences.getBool(PreferencesKey.shouldShowYatPopup) ?? true; final shouldShowYatPopup = sharedPreferences.getBool(PreferencesKey.shouldShowYatPopup) ?? true;
final generateSubaddresses = final generateSubaddresses =
sharedPreferences.getInt(PreferencesKey.autoGenerateSubaddressStatusKey); sharedPreferences.getInt(PreferencesKey.autoGenerateSubaddressStatusKey);
final autoGenerateSubaddressStatus = generateSubaddresses != null final autoGenerateSubaddressStatus = generateSubaddresses != null
? AutoGenerateSubaddressStatus.deserialize(raw: generateSubaddresses) ? AutoGenerateSubaddressStatus.deserialize(raw: generateSubaddresses)
@ -799,10 +816,10 @@ abstract class SettingsStoreBase with Store {
powNodes[WalletType.nano] = nanoPowNode; powNodes[WalletType.nano] = nanoPowNode;
} }
final savedSyncMode = SyncMode.all.firstWhere((element) { final savedSyncMode = SyncMode.all.firstWhere((element) {
return element.type.index == (sharedPreferences.getInt(PreferencesKey.syncModeKey) ?? 1); return element.type.index == (sharedPreferences.getInt(PreferencesKey.syncModeKey) ?? 1);
}); });
final savedSyncAll = sharedPreferences.getBool(PreferencesKey.syncAllKey) ?? true; final savedSyncAll = sharedPreferences.getBool(PreferencesKey.syncAllKey) ?? true;
return SettingsStore( return SettingsStore(
sharedPreferences: sharedPreferences, sharedPreferences: sharedPreferences,
@ -836,6 +853,8 @@ abstract class SettingsStoreBase with Store {
sortBalanceBy: sortBalanceBy, sortBalanceBy: sortBalanceBy,
pinNativeTokenAtTop: pinNativeTokenAtTop, pinNativeTokenAtTop: pinNativeTokenAtTop,
useEtherscan: useEtherscan, useEtherscan: useEtherscan,
defaultNanoRep: defaultNanoRep,
defaultBananoRep: defaultBananoRep,
lookupsTwitter: lookupsTwitter, lookupsTwitter: lookupsTwitter,
lookupsMastodon: lookupsMastodon, lookupsMastodon: lookupsMastodon,
lookupsYatService: lookupsYatService, lookupsYatService: lookupsYatService,
@ -874,35 +893,35 @@ abstract class SettingsStoreBase with Store {
raw: sharedPreferences.getString(PreferencesKey.currentFiatCurrencyKey)!); raw: sharedPreferences.getString(PreferencesKey.currentFiatCurrencyKey)!);
priority[WalletType.monero] = monero?.deserializeMoneroTransactionPriority( priority[WalletType.monero] = monero?.deserializeMoneroTransactionPriority(
raw: sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority)!) ?? raw: sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority)!) ??
priority[WalletType.monero]!; priority[WalletType.monero]!;
priority[WalletType.bitcoin] = bitcoin?.deserializeBitcoinTransactionPriority( priority[WalletType.bitcoin] = bitcoin?.deserializeBitcoinTransactionPriority(
sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority)!) ?? sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority)!) ??
priority[WalletType.bitcoin]!; priority[WalletType.bitcoin]!;
if (sharedPreferences.getInt(PreferencesKey.havenTransactionPriority) != null) { if (sharedPreferences.getInt(PreferencesKey.havenTransactionPriority) != null) {
priority[WalletType.haven] = monero?.deserializeMoneroTransactionPriority( priority[WalletType.haven] = monero?.deserializeMoneroTransactionPriority(
raw: sharedPreferences.getInt(PreferencesKey.havenTransactionPriority)!) ?? raw: sharedPreferences.getInt(PreferencesKey.havenTransactionPriority)!) ??
priority[WalletType.haven]!; priority[WalletType.haven]!;
} }
if (sharedPreferences.getInt(PreferencesKey.litecoinTransactionPriority) != null) { if (sharedPreferences.getInt(PreferencesKey.litecoinTransactionPriority) != null) {
priority[WalletType.litecoin] = bitcoin?.deserializeLitecoinTransactionPriority( priority[WalletType.litecoin] = bitcoin?.deserializeLitecoinTransactionPriority(
sharedPreferences.getInt(PreferencesKey.litecoinTransactionPriority)!) ?? sharedPreferences.getInt(PreferencesKey.litecoinTransactionPriority)!) ??
priority[WalletType.litecoin]!; priority[WalletType.litecoin]!;
} }
if (sharedPreferences.getInt(PreferencesKey.ethereumTransactionPriority) != null) { if (sharedPreferences.getInt(PreferencesKey.ethereumTransactionPriority) != null) {
priority[WalletType.ethereum] = ethereum?.deserializeEthereumTransactionPriority( priority[WalletType.ethereum] = ethereum?.deserializeEthereumTransactionPriority(
sharedPreferences.getInt(PreferencesKey.ethereumTransactionPriority)!) ?? sharedPreferences.getInt(PreferencesKey.ethereumTransactionPriority)!) ??
priority[WalletType.ethereum]!; priority[WalletType.ethereum]!;
} }
if (sharedPreferences.getInt(PreferencesKey.bitcoinCashTransactionPriority) != null) { if (sharedPreferences.getInt(PreferencesKey.bitcoinCashTransactionPriority) != null) {
priority[WalletType.bitcoinCash] = bitcoinCash?.deserializeBitcoinCashTransactionPriority( priority[WalletType.bitcoinCash] = bitcoinCash?.deserializeBitcoinCashTransactionPriority(
sharedPreferences.getInt(PreferencesKey.bitcoinCashTransactionPriority)!) ?? sharedPreferences.getInt(PreferencesKey.bitcoinCashTransactionPriority)!) ??
priority[WalletType.bitcoinCash]!; priority[WalletType.bitcoinCash]!;
} }
final generateSubaddresses = final generateSubaddresses =
sharedPreferences.getInt(PreferencesKey.autoGenerateSubaddressStatusKey); sharedPreferences.getInt(PreferencesKey.autoGenerateSubaddressStatusKey);
autoGenerateSubaddressStatus = generateSubaddresses != null autoGenerateSubaddressStatus = generateSubaddresses != null
? AutoGenerateSubaddressStatus.deserialize(raw: generateSubaddresses) ? AutoGenerateSubaddressStatus.deserialize(raw: generateSubaddresses)
@ -921,7 +940,7 @@ abstract class SettingsStoreBase with Store {
disableBuy = sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? disableBuy; disableBuy = sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? disableBuy;
disableSell = sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? disableSell; disableSell = sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? disableSell;
defaultBuyProvider = defaultBuyProvider =
BuyProviderType.values[sharedPreferences.getInt(PreferencesKey.defaultBuyProvider) ?? 0]; BuyProviderType.values[sharedPreferences.getInt(PreferencesKey.defaultBuyProvider) ?? 0];
allowBiometricalAuthentication = allowBiometricalAuthentication =
sharedPreferences.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? sharedPreferences.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ??
allowBiometricalAuthentication; allowBiometricalAuthentication;
@ -938,7 +957,7 @@ abstract class SettingsStoreBase with Store {
sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForSendsToInternalWallets) ?? sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForSendsToInternalWallets) ??
false; false;
shouldRequireTOTP2FAForExchangesToInternalWallets = sharedPreferences shouldRequireTOTP2FAForExchangesToInternalWallets = sharedPreferences
.getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToInternalWallets) ?? .getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToInternalWallets) ??
false; false;
shouldRequireTOTP2FAForExchangesToExternalWallets = sharedPreferences shouldRequireTOTP2FAForExchangesToExternalWallets = sharedPreferences
.getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToExternalWallets) ?? .getBool(PreferencesKey.shouldRequireTOTP2FAForExchangesToExternalWallets) ??
@ -949,7 +968,7 @@ abstract class SettingsStoreBase with Store {
sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForCreatingNewWallets) ?? sharedPreferences.getBool(PreferencesKey.shouldRequireTOTP2FAForCreatingNewWallets) ??
false; false;
shouldRequireTOTP2FAForAllSecurityAndBackupSettings = sharedPreferences shouldRequireTOTP2FAForAllSecurityAndBackupSettings = sharedPreferences
.getBool(PreferencesKey.shouldRequireTOTP2FAForAllSecurityAndBackupSettings) ?? .getBool(PreferencesKey.shouldRequireTOTP2FAForAllSecurityAndBackupSettings) ??
false; false;
shouldShowMarketPlaceInDashboard = shouldShowMarketPlaceInDashboard =
sharedPreferences.getBool(PreferencesKey.shouldShowMarketPlaceInDashboard) ?? sharedPreferences.getBool(PreferencesKey.shouldShowMarketPlaceInDashboard) ??
@ -982,6 +1001,8 @@ abstract class SettingsStoreBase with Store {
.values[sharedPreferences.getInt(PreferencesKey.sortBalanceBy) ?? sortBalanceBy.index]; .values[sharedPreferences.getInt(PreferencesKey.sortBalanceBy) ?? sortBalanceBy.index];
pinNativeTokenAtTop = sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop) ?? true; pinNativeTokenAtTop = sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop) ?? true;
useEtherscan = sharedPreferences.getBool(PreferencesKey.useEtherscan) ?? true; useEtherscan = sharedPreferences.getBool(PreferencesKey.useEtherscan) ?? true;
defaultNanoRep = sharedPreferences.getString(PreferencesKey.defaultNanoRep) ?? "";
defaultBananoRep = sharedPreferences.getString(PreferencesKey.defaultBananoRep) ?? "";
lookupsTwitter = sharedPreferences.getBool(PreferencesKey.lookupsTwitter) ?? true; lookupsTwitter = sharedPreferences.getBool(PreferencesKey.lookupsTwitter) ?? true;
lookupsMastodon = sharedPreferences.getBool(PreferencesKey.lookupsMastodon) ?? true; lookupsMastodon = sharedPreferences.getBool(PreferencesKey.lookupsMastodon) ?? true;
lookupsYatService = sharedPreferences.getBool(PreferencesKey.lookupsYatService) ?? true; lookupsYatService = sharedPreferences.getBool(PreferencesKey.lookupsYatService) ?? true;
@ -991,11 +1012,11 @@ abstract class SettingsStoreBase with Store {
final nodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey); final nodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey);
final bitcoinElectrumServerId = final bitcoinElectrumServerId =
sharedPreferences.getInt(PreferencesKey.currentBitcoinElectrumSererIdKey); sharedPreferences.getInt(PreferencesKey.currentBitcoinElectrumSererIdKey);
final litecoinElectrumServerId = final litecoinElectrumServerId =
sharedPreferences.getInt(PreferencesKey.currentLitecoinElectrumSererIdKey); sharedPreferences.getInt(PreferencesKey.currentLitecoinElectrumSererIdKey);
final bitcoinCashElectrumServerId = final bitcoinCashElectrumServerId =
sharedPreferences.getInt(PreferencesKey.currentBitcoinCashNodeIdKey); sharedPreferences.getInt(PreferencesKey.currentBitcoinCashNodeIdKey);
final havenNodeId = sharedPreferences.getInt(PreferencesKey.currentHavenNodeIdKey); final havenNodeId = sharedPreferences.getInt(PreferencesKey.currentHavenNodeIdKey);
final ethereumNodeId = sharedPreferences.getInt(PreferencesKey.currentEthereumNodeIdKey); final ethereumNodeId = sharedPreferences.getInt(PreferencesKey.currentEthereumNodeIdKey);
final nanoNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey); final nanoNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey);
@ -1057,7 +1078,8 @@ abstract class SettingsStoreBase with Store {
await _sharedPreferences.setInt(PreferencesKey.currentEthereumNodeIdKey, node.key as int); await _sharedPreferences.setInt(PreferencesKey.currentEthereumNodeIdKey, node.key as int);
break; break;
case WalletType.bitcoinCash: case WalletType.bitcoinCash:
await _sharedPreferences.setInt(PreferencesKey.currentBitcoinCashNodeIdKey, node.key as int); await _sharedPreferences.setInt(
PreferencesKey.currentBitcoinCashNodeIdKey, node.key as int);
break; break;
case WalletType.nano: case WalletType.nano:
await _sharedPreferences.setInt(PreferencesKey.currentNanoNodeIdKey, node.key as int); await _sharedPreferences.setInt(PreferencesKey.currentNanoNodeIdKey, node.key as int);

View file

@ -720,6 +720,7 @@
"enterWalletConnectURI": "WalletConnect ـﻟ URI ﻞﺧﺩﺃ", "enterWalletConnectURI": "WalletConnect ـﻟ URI ﻞﺧﺩﺃ",
"seed_key": "مفتاح البذور", "seed_key": "مفتاح البذور",
"enter_seed_phrase": "أدخل عبارة البذور الخاصة بك", "enter_seed_phrase": "أدخل عبارة البذور الخاصة بك",
"change_rep_successful": "تم تغيير ممثل بنجاح",
"add_contact": "ﻝﺎﺼﺗﺍ ﺔﻬﺟ ﺔﻓﺎﺿﺇ", "add_contact": "ﻝﺎﺼﺗﺍ ﺔﻬﺟ ﺔﻓﺎﺿﺇ",
"exchange_provider_unsupported": "${providerName} لم يعد مدعومًا!", "exchange_provider_unsupported": "${providerName} لم يعد مدعومًا!",
"domain_looks_up": "ﻝﺎﺠﻤﻟﺍ ﺚﺤﺑ ﺕﺎﻴﻠﻤﻋ", "domain_looks_up": "ﻝﺎﺠﻤﻟﺍ ﺚﺤﺑ ﺕﺎﻴﻠﻤﻋ",

View file

@ -716,6 +716,7 @@
"enterWalletConnectURI": "Въведете URI на WalletConnect", "enterWalletConnectURI": "Въведете URI на WalletConnect",
"seed_key": "Ключ за семена", "seed_key": "Ключ за семена",
"enter_seed_phrase": "Въведете вашата фраза за семена", "enter_seed_phrase": "Въведете вашата фраза за семена",
"change_rep_successful": "Успешно промени представител",
"add_contact": "Добави контакт", "add_contact": "Добави контакт",
"exchange_provider_unsupported": "${providerName} вече не се поддържа!", "exchange_provider_unsupported": "${providerName} вече не се поддържа!",
"domain_looks_up": "Търсене на домейни", "domain_looks_up": "Търсене на домейни",

View file

@ -716,6 +716,7 @@
"enterWalletConnectURI": "Zadejte identifikátor URI WalletConnect", "enterWalletConnectURI": "Zadejte identifikátor URI WalletConnect",
"seed_key": "Klíč semen", "seed_key": "Klíč semen",
"enter_seed_phrase": "Zadejte svou frázi semen", "enter_seed_phrase": "Zadejte svou frázi semen",
"change_rep_successful": "Úspěšně změnil zástupce",
"add_contact": "Přidat kontakt", "add_contact": "Přidat kontakt",
"exchange_provider_unsupported": "${providerName} již není podporováno!", "exchange_provider_unsupported": "${providerName} již není podporováno!",
"domain_looks_up": "Vyhledávání domén", "domain_looks_up": "Vyhledávání domén",

View file

@ -722,8 +722,9 @@
"awaitDAppProcessing": "Bitte warten Sie, bis die dApp die Verarbeitung abgeschlossen hat.", "awaitDAppProcessing": "Bitte warten Sie, bis die dApp die Verarbeitung abgeschlossen hat.",
"copyWalletConnectLink": "Kopieren Sie den WalletConnect-Link von dApp und fügen Sie ihn hier ein", "copyWalletConnectLink": "Kopieren Sie den WalletConnect-Link von dApp und fügen Sie ihn hier ein",
"enterWalletConnectURI": "Geben Sie den WalletConnect-URI ein", "enterWalletConnectURI": "Geben Sie den WalletConnect-URI ein",
"seed_key": "Seed-Schlüssel", "seed_key": "Samenschlüssel",
"enter_seed_phrase": "Geben Sie Ihre Seed-Phrase ein", "enter_seed_phrase": "Geben Sie Ihre Samenphrase ein",
"change_rep_successful": "Erfolgreich veränderte Vertreter",
"add_contact": "Kontakt hinzufügen", "add_contact": "Kontakt hinzufügen",
"exchange_provider_unsupported": "${providerName} wird nicht mehr unterstützt!", "exchange_provider_unsupported": "${providerName} wird nicht mehr unterstützt!",
"domain_looks_up": "Domain-Suchen", "domain_looks_up": "Domain-Suchen",

View file

@ -725,6 +725,7 @@
"enterWalletConnectURI": "Enter WalletConnect URI", "enterWalletConnectURI": "Enter WalletConnect URI",
"seed_key": "Seed key", "seed_key": "Seed key",
"enter_seed_phrase": "Enter your seed phrase", "enter_seed_phrase": "Enter your seed phrase",
"change_rep_successful": "Successfully changed representative",
"add_contact": "Add contact", "add_contact": "Add contact",
"exchange_provider_unsupported": "${providerName} is no longer supported!", "exchange_provider_unsupported": "${providerName} is no longer supported!",
"domain_looks_up": "Domain lookups", "domain_looks_up": "Domain lookups",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "Ingrese el URI de WalletConnect", "enterWalletConnectURI": "Ingrese el URI de WalletConnect",
"seed_key": "Llave de semilla", "seed_key": "Llave de semilla",
"enter_seed_phrase": "Ingrese su frase de semillas", "enter_seed_phrase": "Ingrese su frase de semillas",
"change_rep_successful": "Representante cambiado con éxito",
"add_contact": "Agregar contacto", "add_contact": "Agregar contacto",
"exchange_provider_unsupported": "¡${providerName} ya no es compatible!", "exchange_provider_unsupported": "¡${providerName} ya no es compatible!",
"domain_looks_up": "Búsquedas de dominio", "domain_looks_up": "Búsquedas de dominio",

View file

@ -722,8 +722,9 @@
"awaitDAppProcessing": "Veuillez attendre que l'application décentralisée (dApp) termine le traitement.", "awaitDAppProcessing": "Veuillez attendre que l'application décentralisée (dApp) termine le traitement.",
"copyWalletConnectLink": "Copiez le lien WalletConnect depuis l'application décentralisée (dApp) et collez-le ici", "copyWalletConnectLink": "Copiez le lien WalletConnect depuis l'application décentralisée (dApp) et collez-le ici",
"enterWalletConnectURI": "Saisissez l'URI de WalletConnect.", "enterWalletConnectURI": "Saisissez l'URI de WalletConnect.",
"seed_key": "Clé secrète (seed key)", "seed_key": "Clé de graines",
"enter_seed_phrase": "Entrez votre phrase secrète (seed)", "enter_seed_phrase": "Entrez votre phrase de semence",
"change_rep_successful": "Représentant changé avec succès",
"add_contact": "Ajouter le contact", "add_contact": "Ajouter le contact",
"exchange_provider_unsupported": "${providerName} n'est plus pris en charge !", "exchange_provider_unsupported": "${providerName} n'est plus pris en charge !",
"domain_looks_up": "Résolution de nom", "domain_looks_up": "Résolution de nom",

View file

@ -702,6 +702,7 @@
"enterWalletConnectURI": "Shigar da WalletConnect URI", "enterWalletConnectURI": "Shigar da WalletConnect URI",
"seed_key": "Maɓallin iri", "seed_key": "Maɓallin iri",
"enter_seed_phrase": "Shigar da Sert Sentarku", "enter_seed_phrase": "Shigar da Sert Sentarku",
"change_rep_successful": "An samu nasarar canzawa wakilin",
"add_contact": "Ƙara lamba", "add_contact": "Ƙara lamba",
"exchange_provider_unsupported": "${providerName}", "exchange_provider_unsupported": "${providerName}",
"domain_looks_up": "Binciken yanki", "domain_looks_up": "Binciken yanki",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "वॉलेटकनेक्ट यूआरआई दर्ज करें", "enterWalletConnectURI": "वॉलेटकनेक्ट यूआरआई दर्ज करें",
"seed_key": "बीज कुंजी", "seed_key": "बीज कुंजी",
"enter_seed_phrase": "अपना बीज वाक्यांश दर्ज करें", "enter_seed_phrase": "अपना बीज वाक्यांश दर्ज करें",
"change_rep_successful": "सफलतापूर्वक बदलकर प्रतिनिधि",
"add_contact": "संपर्क जोड़ें", "add_contact": "संपर्क जोड़ें",
"exchange_provider_unsupported": "${providerName} अब समर्थित नहीं है!", "exchange_provider_unsupported": "${providerName} अब समर्थित नहीं है!",
"domain_looks_up": "डोमेन लुकअप", "domain_looks_up": "डोमेन लुकअप",

View file

@ -722,6 +722,7 @@
"enterWalletConnectURI": "Unesite WalletConnect URI", "enterWalletConnectURI": "Unesite WalletConnect URI",
"seed_key": "Sjemenski ključ", "seed_key": "Sjemenski ključ",
"enter_seed_phrase": "Unesite svoju sjemensku frazu", "enter_seed_phrase": "Unesite svoju sjemensku frazu",
"change_rep_successful": "Uspješno promijenjena reprezentativna",
"add_contact": "Dodaj kontakt", "add_contact": "Dodaj kontakt",
"exchange_provider_unsupported": "${providerName} više nije podržan!", "exchange_provider_unsupported": "${providerName} više nije podržan!",
"domain_looks_up": "Pretraga domena", "domain_looks_up": "Pretraga domena",

View file

@ -712,6 +712,7 @@
"enterWalletConnectURI": "Masukkan URI WalletConnect", "enterWalletConnectURI": "Masukkan URI WalletConnect",
"seed_key": "Kunci benih", "seed_key": "Kunci benih",
"enter_seed_phrase": "Masukkan frasa benih Anda", "enter_seed_phrase": "Masukkan frasa benih Anda",
"change_rep_successful": "Berhasil mengubah perwakilan",
"add_contact": "Tambah kontak", "add_contact": "Tambah kontak",
"exchange_provider_unsupported": "${providerName} tidak lagi didukung!", "exchange_provider_unsupported": "${providerName} tidak lagi didukung!",
"domain_looks_up": "Pencarian domain", "domain_looks_up": "Pencarian domain",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "Inserisci l'URI di WalletConnect", "enterWalletConnectURI": "Inserisci l'URI di WalletConnect",
"seed_key": "Chiave di semi", "seed_key": "Chiave di semi",
"enter_seed_phrase": "Inserisci la tua frase di semi", "enter_seed_phrase": "Inserisci la tua frase di semi",
"change_rep_successful": "Rappresentante modificato con successo",
"add_contact": "Aggiungi contatto", "add_contact": "Aggiungi contatto",
"exchange_provider_unsupported": "${providerName} non è più supportato!", "exchange_provider_unsupported": "${providerName} non è più supportato!",
"domain_looks_up": "Ricerche di domini", "domain_looks_up": "Ricerche di domini",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "WalletConnect URI を入力してください", "enterWalletConnectURI": "WalletConnect URI を入力してください",
"seed_key": "シードキー", "seed_key": "シードキー",
"enter_seed_phrase": "シードフレーズを入力してください", "enter_seed_phrase": "シードフレーズを入力してください",
"change_rep_successful": "代表者の変更に成功しました",
"add_contact": "連絡先を追加", "add_contact": "連絡先を追加",
"exchange_provider_unsupported": "${providerName}はサポートされなくなりました!", "exchange_provider_unsupported": "${providerName}はサポートされなくなりました!",
"domain_looks_up": "ドメイン検索", "domain_looks_up": "ドメイン検索",

View file

@ -722,6 +722,7 @@
"enterWalletConnectURI": "WalletConnect URI를 입력하세요.", "enterWalletConnectURI": "WalletConnect URI를 입력하세요.",
"seed_key": "시드 키", "seed_key": "시드 키",
"enter_seed_phrase": "시드 문구를 입력하십시오", "enter_seed_phrase": "시드 문구를 입력하십시오",
"change_rep_successful": "대리인이 성공적으로 변경되었습니다",
"add_contact": "주소록에 추가", "add_contact": "주소록에 추가",
"exchange_provider_unsupported": "${providerName}은 더 이상 지원되지 않습니다!", "exchange_provider_unsupported": "${providerName}은 더 이상 지원되지 않습니다!",
"domain_looks_up": "도메인 조회", "domain_looks_up": "도메인 조회",

View file

@ -722,6 +722,7 @@
"enterWalletConnectURI": "WalletConnect URI ကိုရိုက်ထည့်ပါ။", "enterWalletConnectURI": "WalletConnect URI ကိုရိုက်ထည့်ပါ။",
"seed_key": "မျိုးစေ့သော့", "seed_key": "မျိုးစေ့သော့",
"enter_seed_phrase": "သင့်ရဲ့မျိုးစေ့စကားစုကိုရိုက်ထည့်ပါ", "enter_seed_phrase": "သင့်ရဲ့မျိုးစေ့စကားစုကိုရိုက်ထည့်ပါ",
"change_rep_successful": "အောင်မြင်စွာကိုယ်စားလှယ်ပြောင်းလဲသွားတယ်",
"add_contact": "အဆက်အသွယ်ထည့်ပါ။", "add_contact": "အဆက်အသွယ်ထည့်ပါ။",
"exchange_provider_unsupported": "${providerName} မရှိတော့ပါ!", "exchange_provider_unsupported": "${providerName} မရှိတော့ပါ!",
"domain_looks_up": "ဒိုမိန်းရှာဖွေမှုများ", "domain_looks_up": "ဒိုမိန်းရှာဖွေမှုများ",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "Voer WalletConnect-URI in", "enterWalletConnectURI": "Voer WalletConnect-URI in",
"seed_key": "Zaadsleutel", "seed_key": "Zaadsleutel",
"enter_seed_phrase": "Voer uw zaadzin in", "enter_seed_phrase": "Voer uw zaadzin in",
"change_rep_successful": "Met succes veranderde vertegenwoordiger",
"add_contact": "Contactpersoon toevoegen", "add_contact": "Contactpersoon toevoegen",
"exchange_provider_unsupported": "${providerName} wordt niet langer ondersteund!", "exchange_provider_unsupported": "${providerName} wordt niet langer ondersteund!",
"domain_looks_up": "Domein opzoeken", "domain_looks_up": "Domein opzoeken",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "Wprowadź identyfikator URI WalletConnect", "enterWalletConnectURI": "Wprowadź identyfikator URI WalletConnect",
"seed_key": "Klucz nasion", "seed_key": "Klucz nasion",
"enter_seed_phrase": "Wprowadź swoją frazę nasienną", "enter_seed_phrase": "Wprowadź swoją frazę nasienną",
"change_rep_successful": "Pomyślnie zmienił przedstawiciela",
"add_contact": "Dodaj kontakt", "add_contact": "Dodaj kontakt",
"exchange_provider_unsupported": "${providerName} nie jest już obsługiwany!", "exchange_provider_unsupported": "${providerName} nie jest już obsługiwany!",
"domain_looks_up": "Wyszukiwanie domen", "domain_looks_up": "Wyszukiwanie domen",

View file

@ -723,6 +723,7 @@
"enterWalletConnectURI": "Insira o URI do WalletConnect", "enterWalletConnectURI": "Insira o URI do WalletConnect",
"seed_key": "Chave de semente", "seed_key": "Chave de semente",
"enter_seed_phrase": "Digite sua frase de semente", "enter_seed_phrase": "Digite sua frase de semente",
"change_rep_successful": "Mudou com sucesso o representante",
"add_contact": "Adicionar contato", "add_contact": "Adicionar contato",
"exchange_provider_unsupported": "${providerName} não é mais suportado!", "exchange_provider_unsupported": "${providerName} não é mais suportado!",
"domain_looks_up": "Pesquisas de domínio", "domain_looks_up": "Pesquisas de domínio",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "Введите URI WalletConnect", "enterWalletConnectURI": "Введите URI WalletConnect",
"seed_key": "Ключ семян", "seed_key": "Ключ семян",
"enter_seed_phrase": "Введите свою семенную фразу", "enter_seed_phrase": "Введите свою семенную фразу",
"change_rep_successful": "Успешно изменил представитель",
"add_contact": "Добавить контакт", "add_contact": "Добавить контакт",
"exchange_provider_unsupported": "${providerName} больше не поддерживается!", "exchange_provider_unsupported": "${providerName} больше не поддерживается!",
"domain_looks_up": "Поиск доменов", "domain_looks_up": "Поиск доменов",

View file

@ -722,6 +722,7 @@
"enterWalletConnectURI": "เข้าสู่ WalletConnect URI", "enterWalletConnectURI": "เข้าสู่ WalletConnect URI",
"seed_key": "คีย์เมล็ดพันธุ์", "seed_key": "คีย์เมล็ดพันธุ์",
"enter_seed_phrase": "ป้อนวลีเมล็ดพันธุ์ของคุณ", "enter_seed_phrase": "ป้อนวลีเมล็ดพันธุ์ของคุณ",
"change_rep_successful": "เปลี่ยนตัวแทนสำเร็จ",
"add_contact": "เพิ่มผู้ติดต่อ", "add_contact": "เพิ่มผู้ติดต่อ",
"exchange_provider_unsupported": "${providerName} ไม่ได้รับการสนับสนุนอีกต่อไป!", "exchange_provider_unsupported": "${providerName} ไม่ได้รับการสนับสนุนอีกต่อไป!",
"domain_looks_up": "การค้นหาโดเมน", "domain_looks_up": "การค้นหาโดเมน",

View file

@ -719,6 +719,7 @@
"enterWalletConnectURI": "Ilagay ang WalletConnect URI", "enterWalletConnectURI": "Ilagay ang WalletConnect URI",
"seed_key": "Seed Key", "seed_key": "Seed Key",
"enter_seed_phrase": "Ipasok ang iyong pariralang binhi", "enter_seed_phrase": "Ipasok ang iyong pariralang binhi",
"change_rep_successful": "Matagumpay na nagbago ng kinatawan",
"add_contact": "Magdagdag ng contact", "add_contact": "Magdagdag ng contact",
"exchange_provider_unsupported": "Ang ${providerName} ay hindi na suportado!", "exchange_provider_unsupported": "Ang ${providerName} ay hindi na suportado!",
"domain_looks_up": "Mga paghahanap ng domain", "domain_looks_up": "Mga paghahanap ng domain",

View file

@ -722,6 +722,7 @@
"enterWalletConnectURI": "WalletConnect URI'sini girin", "enterWalletConnectURI": "WalletConnect URI'sini girin",
"seed_key": "Tohum", "seed_key": "Tohum",
"enter_seed_phrase": "Tohum ifadenizi girin", "enter_seed_phrase": "Tohum ifadenizi girin",
"change_rep_successful": "Temsilciyi başarıyla değiştirdi",
"add_contact": "Kişi ekle", "add_contact": "Kişi ekle",
"exchange_provider_unsupported": "${providerName} artık desteklenmiyor!", "exchange_provider_unsupported": "${providerName} artık desteklenmiyor!",
"domain_looks_up": "Etki alanı aramaları", "domain_looks_up": "Etki alanı aramaları",

View file

@ -724,6 +724,7 @@
"enterWalletConnectURI": "Введіть URI WalletConnect", "enterWalletConnectURI": "Введіть URI WalletConnect",
"seed_key": "Насіннєвий ключ", "seed_key": "Насіннєвий ключ",
"enter_seed_phrase": "Введіть свою насіннєву фразу", "enter_seed_phrase": "Введіть свою насіннєву фразу",
"change_rep_successful": "Успішно змінив представник",
"add_contact": "Додати контакт", "add_contact": "Додати контакт",
"exchange_provider_unsupported": "${providerName} більше не підтримується!", "exchange_provider_unsupported": "${providerName} більше не підтримується!",
"domain_looks_up": "Пошук доменів", "domain_looks_up": "Пошук доменів",

View file

@ -716,6 +716,7 @@
"enterWalletConnectURI": "WalletConnect URI ۔ﮟﯾﺮﮐ ﺝﺭﺩ", "enterWalletConnectURI": "WalletConnect URI ۔ﮟﯾﺮﮐ ﺝﺭﺩ",
"seed_key": "بیج کی کلید", "seed_key": "بیج کی کلید",
"enter_seed_phrase": "اپنے بیج کا جملہ درج کریں", "enter_seed_phrase": "اپنے بیج کا جملہ درج کریں",
"change_rep_successful": "نمائندہ کو کامیابی کے ساتھ تبدیل کیا",
"add_contact": "۔ﮟﯾﺮﮐ ﻞﻣﺎﺷ ﮧﻄﺑﺍﺭ", "add_contact": "۔ﮟﯾﺮﮐ ﻞﻣﺎﺷ ﮧﻄﺑﺍﺭ",
"exchange_provider_unsupported": "${providerName} اب تعاون نہیں کیا جاتا ہے!", "exchange_provider_unsupported": "${providerName} اب تعاون نہیں کیا جاتا ہے!",
"domain_looks_up": "ڈومین تلاش کرنا", "domain_looks_up": "ڈومین تلاش کرنا",

View file

@ -718,6 +718,7 @@
"enterWalletConnectURI": "Tẹ WalletConnect URI sii", "enterWalletConnectURI": "Tẹ WalletConnect URI sii",
"seed_key": "Bọtini Ose", "seed_key": "Bọtini Ose",
"enter_seed_phrase": "Tẹ ọrọ-iru irugbin rẹ", "enter_seed_phrase": "Tẹ ọrọ-iru irugbin rẹ",
"change_rep_successful": "Ni ifijišẹ yipada aṣoju",
"add_contact": "Fi olubasọrọ kun", "add_contact": "Fi olubasọrọ kun",
"exchange_provider_unsupported": "${providerName} ko ni atilẹyin mọ!", "exchange_provider_unsupported": "${providerName} ko ni atilẹyin mọ!",
"domain_looks_up": "Awọn wiwa agbegbe", "domain_looks_up": "Awọn wiwa agbegbe",

View file

@ -723,6 +723,7 @@
"enterWalletConnectURI": "输入 WalletConnect URI", "enterWalletConnectURI": "输入 WalletConnect URI",
"seed_key": "种子钥匙", "seed_key": "种子钥匙",
"enter_seed_phrase": "输入您的种子短语", "enter_seed_phrase": "输入您的种子短语",
"change_rep_successful": "成功改变了代表",
"add_contact": "增加联系人", "add_contact": "增加联系人",
"exchange_provider_unsupported": "${providerName}不再支持!", "exchange_provider_unsupported": "${providerName}不再支持!",
"domain_looks_up": "域名查找", "domain_looks_up": "域名查找",