g1v1 import: display v1 pubkey instead of v2 address
This commit is contained in:
parent
826dcf7c7c
commit
4c7326bfaa
|
@ -1,6 +1,7 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:fast_base58/fast_base58.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
|
@ -10,6 +11,7 @@ import 'package:gecko/providers/home.dart';
|
|||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:pinenacl/ed25519.dart';
|
||||
import 'package:polkawallet_sdk/api/apiKeyring.dart';
|
||||
import 'package:polkawallet_sdk/api/types/networkParams.dart';
|
||||
import 'package:polkawallet_sdk/api/types/txInfoData.dart';
|
||||
|
@ -39,6 +41,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
TextEditingController csSalt = TextEditingController();
|
||||
TextEditingController csPassword = TextEditingController();
|
||||
String g1V1NewAddress = '';
|
||||
String g1V1OldPubkey = '';
|
||||
bool isCesiumIDVisible = false;
|
||||
bool isCesiumAddresLoading = false;
|
||||
late int udValue;
|
||||
|
@ -679,6 +682,9 @@ class SubstrateSdk with ChangeNotifier {
|
|||
cryptoType: CryptoType.ed25519,
|
||||
rawSeed: rawSeedHex);
|
||||
|
||||
SigningKey rootKey = SigningKey(seed: rawSeed);
|
||||
g1V1OldPubkey = Base58Encode(rootKey.publicKey);
|
||||
|
||||
g1V1NewAddress = newAddress.address!;
|
||||
notifyListeners();
|
||||
return g1V1NewAddress;
|
||||
|
|
|
@ -139,7 +139,7 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
|
||||
showText(String text,
|
||||
[double size = 18, bool bold = false, bool smooth = true]) {
|
||||
log.d('$address $text');
|
||||
// log.d('$address $text');
|
||||
return AnimatedFadeOutIn<String>(
|
||||
data: text,
|
||||
duration: Duration(milliseconds: smooth ? 200 : 0),
|
||||
|
|
|
@ -185,13 +185,13 @@ class ImportG1v1 extends StatelessWidget {
|
|||
key: keyCopyAddress,
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: sub.g1V1NewAddress));
|
||||
ClipboardData(text: sub.g1V1OldPubkey));
|
||||
snackCopyKey(context);
|
||||
},
|
||||
child: Text(
|
||||
getShortPubkey(sub.g1V1NewAddress),
|
||||
sub.g1V1OldPubkey,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
|
|
|
@ -338,7 +338,7 @@ packages:
|
|||
source: hosted
|
||||
version: "1.3.1"
|
||||
fast_base58:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: fast_base58
|
||||
url: "https://pub.dartlang.org"
|
||||
|
@ -975,7 +975,7 @@ packages:
|
|||
source: hosted
|
||||
version: "7.4.0"
|
||||
pinenacl:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: pinenacl
|
||||
url: "https://pub.dartlang.org"
|
||||
|
|
|
@ -59,6 +59,8 @@ dependencies:
|
|||
flutter_dotenv: ^5.0.2
|
||||
accordion: ^2.5.1
|
||||
flutter_svg: ^1.1.6
|
||||
pinenacl: ^0.3.3
|
||||
fast_base58: ^0.2.1
|
||||
|
||||
dev_dependencies:
|
||||
# flutter_launcher_icons: ^0.9.2
|
||||
|
|
Loading…
Reference in New Issue