forked from axiom-team/gecko
identity migration is working
This commit is contained in:
parent
99f939d5a2
commit
c840753f4a
|
@ -598,7 +598,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
return await sdk.api.keyring.checkMnemonicValid(mnemonic);
|
||||
}
|
||||
|
||||
Future csToV2Address(String salt, String password) async {
|
||||
Future<String> csToV2Address(String salt, String password) async {
|
||||
final scrypt = pc.KeyDerivator('scrypt');
|
||||
|
||||
scrypt.init(
|
||||
|
@ -621,6 +621,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
|
||||
g1V1NewAddress = newAddress.address!;
|
||||
notifyListeners();
|
||||
return g1V1NewAddress;
|
||||
}
|
||||
|
||||
Future<List> getBalanceAndIdtyStatus(String address, String myAddress) async {
|
||||
|
@ -801,7 +802,8 @@ class SubstrateSdk with ChangeNotifier {
|
|||
{required String fromAddress,
|
||||
required String destAddress,
|
||||
required String formPassword,
|
||||
required String destPassword}) async {
|
||||
required String destPassword,
|
||||
bool withBalance = false}) async {
|
||||
transactionStatus = '';
|
||||
final fromPubkey = await sdk.api.account.decodeAddress([fromAddress]);
|
||||
final sender = TxSenderData(
|
||||
|
@ -840,6 +842,20 @@ messageToSign: $messageToSign
|
|||
messageToSignHex: $messageToSignHex
|
||||
newKeySig: $newKeySig""");
|
||||
|
||||
if (withBalance) {
|
||||
txInfo = TxInfoData(
|
||||
'utility',
|
||||
'batchAll',
|
||||
sender,
|
||||
);
|
||||
|
||||
const tx1 = 'api.tx.universalDividend.claimUds()';
|
||||
final tx2 =
|
||||
'api.tx.identity.changeOwnerKey("$destAddress", "$newKeySig")';
|
||||
const tx3 = 'api.tx.balances.transferAll(false)';
|
||||
|
||||
rawParams = '[[$tx1, $tx2, $tx3]]';
|
||||
} else {
|
||||
txInfo = TxInfoData(
|
||||
'identity',
|
||||
'changeOwnerKey',
|
||||
|
@ -847,12 +863,7 @@ newKeySig: $newKeySig""");
|
|||
);
|
||||
|
||||
txOptions = [destAddress, newKeySig];
|
||||
|
||||
// const tx1 = 'api.tx.universalDividend.claimUds()';
|
||||
// final tx2 = 'api.tx.identity.changeOwnerKey("$destAddress", "$newKeySig")';
|
||||
// const tx3 = 'api.tx.balances.transferAll(false)';
|
||||
|
||||
// rawParams = '[[$tx1, $tx2, $tx3]]';
|
||||
}
|
||||
|
||||
return await _executeCall(txInfo, txOptions, formPassword, rawParams);
|
||||
}
|
||||
|
@ -918,7 +929,8 @@ newKeySig: $newKeySig""");
|
|||
fromAddress: keypair.address!,
|
||||
destAddress: destAddress,
|
||||
formPassword: 'password',
|
||||
destPassword: destPassword);
|
||||
destPassword: destPassword,
|
||||
withBalance: true);
|
||||
} else if (balance != 0) {
|
||||
await pay(
|
||||
fromAddress: keypair.address!,
|
||||
|
|
|
@ -1062,8 +1062,8 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: gecko-old
|
||||
resolved-ref: "87096351fb187614b6386343615db39a2f2b5b9b"
|
||||
ref: gecko-unwrapbytes
|
||||
resolved-ref: b019cc2a6e77b6989f94b1bef8259298410cd82a
|
||||
url: "https://github.com/poka-IT/sdk.git"
|
||||
source: git
|
||||
version: "0.4.8"
|
||||
|
|
|
@ -65,7 +65,8 @@ dependencies:
|
|||
# url: https://github.com/polkawallet-io/sdk.git
|
||||
# ref: develop
|
||||
url: https://github.com/poka-IT/sdk.git
|
||||
ref: gecko-old
|
||||
# ref: gecko-old
|
||||
ref: gecko-unwrapbytes
|
||||
dots_indicator: ^2.1.0
|
||||
web_socket_channel: ^2.2.0
|
||||
connectivity_plus: ^2.3.3
|
||||
|
|
Loading…
Reference in New Issue