polyseed support

This commit is contained in:
Czarek Nakamoto 2024-04-30 09:55:24 +02:00
parent 01b5bc479d
commit 7929d49e27
4 changed files with 27 additions and 10 deletions

View file

@ -311,7 +311,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
SizedBox( SizedBox(
height: isDesktop ? 40 : 24, height: isDesktop ? 40 : 24,
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==
@ -327,7 +329,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
: STextStyles.smallMed12(context), : STextStyles.smallMed12(context),
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==
@ -335,7 +339,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
SizedBox( SizedBox(
height: isDesktop ? 16 : 8, height: isDesktop ? 16 : 8,
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==
@ -345,7 +351,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
onTap: chooseDate, onTap: chooseDate,
controller: _dateController, controller: _dateController,
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==
@ -356,7 +364,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
onTap: chooseDesktopDate, onTap: chooseDesktopDate,
controller: _dateController, controller: _dateController,
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==
@ -364,7 +374,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
const SizedBox( const SizedBox(
height: 8, height: 8,
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==
@ -385,7 +397,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
), ),
), ),
), ),
if (coin == Coin.monero || if ((coin == Coin.monero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25) ||
coin == Coin.epicCash || coin == Coin.epicCash ||
(coin == Coin.wownero && (coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state == ref.watch(mnemonicWordCountStateProvider.state).state ==

View file

@ -184,7 +184,7 @@ abstract class Constants {
values.addAll([24, 12]); values.addAll([24, 12]);
case Coin.monero: case Coin.monero:
values.addAll([25]); values.addAll([16, 25]);
break; break;
case Coin.wownero: case Coin.wownero:
values.addAll([14, 25]); values.addAll([14, 25]);

View file

@ -159,6 +159,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface {
type: WalletType.monero, type: WalletType.monero,
trusted: node.trusted ?? false, trusted: node.trusted ?? false,
), ),
socksProxyAddress: null,
); );
} }
@ -392,7 +393,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface {
final mnemonic = await getMnemonic(); final mnemonic = await getMnemonic();
final seedLength = mnemonic.trim().split(" ").length; final seedLength = mnemonic.trim().split(" ").length;
if (seedLength != 25) { if (seedLength != 25 && seedLength != 16) {
throw Exception("Invalid monero mnemonic length found: $seedLength"); throw Exception("Invalid monero mnemonic length found: $seedLength");
} }

View file

@ -149,6 +149,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface {
type: WalletType.wownero, type: WalletType.wownero,
trusted: node.trusted ?? false, trusted: node.trusted ?? false,
), ),
socksProxyAddress: null,
); );
} }
@ -331,7 +332,8 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface {
// days: // days:
// 2))); // subtract a couple days to ensure we have a buffer for SWB // 2))); // subtract a couple days to ensure we have a buffer for SWB
// TODO(mrcyjanek): implement // TODO(mrcyjanek): implement
final bufferedCreateHeight = 1; //getSeedHeightSync(wallet!.seed.trim()); final bufferedCreateHeight =
1; //getSeedHeightSync(wallet!.seed.trim());
await info.updateRestoreHeight( await info.updateRestoreHeight(
newRestoreHeight: bufferedCreateHeight, newRestoreHeight: bufferedCreateHeight,