fix: can add custom derivation

This commit is contained in:
poka 2024-01-13 00:27:00 +01:00
parent bfce822b17
commit 5950088bca
7 changed files with 59 additions and 26 deletions

View File

@ -1,5 +1,5 @@
{
"initial_monetary_mass": 60100,
"initial_monetary_mass": 80100,
"identities": {
"test1": {
"index": 0,
@ -61,11 +61,21 @@
},
"owner_pubkey": "6FgzG8NwatTWHo7rM7sPP6P4Q95R2ZQNqYiHCs38RT21"
},
"testCesium1": {
"test6": {
"index": 5,
"balance": 10000,
"membership_expire_on": 1705509948,
"next_cert_issuable_on": 1668347505,
"certs_received": {
"test1": 1727758466
},
"owner_pubkey": "FZ8URw5rPqpWegWnufpcBDkg6tMpc2JmNZVCuPA9g3nq"
},
"testCesium1": {
"index": 6,
"balance": 10000,
"membership_expire_on": 1705509948,
"next_cert_issuable_on": 1668347505,
"certs_received": {
"test1": 1727758466,
"test2": 1727758466,
@ -73,5 +83,8 @@
},
"owner_pubkey": "DCovzCEnQm9GUWe6mr8u42JR1JAuoj3HbQUGdCkfTzSr"
}
},
"wallets": {
"BPKBoTrrLD1XWmpZdRsfDnDT1M6PBBvgzPxAKNdutVV2": 10000
}
}

View File

@ -30,7 +30,7 @@ const cesiumPod = "https://g1.data.le-sou.org";
// String cesiumPod = "https://g1.data.e-is.pro";
const datapodEndpoint = 'gdev-datapod.p2p.legal';
// const v2sDatapod = 'http://10.0.2.2:8080';
// const datapodEndpoint = '10.0.2.2:8080';
// Contexts
late BuildContext homeContext;

View File

@ -67,11 +67,14 @@ class WalletOptionsProvider with ChangeNotifier {
password: myWalletProvider.pinCode);
}
await walletBox.delete(wallet.key);
await walletBox.delete(wallet.address);
if (wallet.imageCustomPath != null) {
final avatarFile = File(wallet.imageCustomPath!);
await avatarFile.delete();
if (await avatarFile.exists()) {
await avatarFile.delete();
}
}
datapod.deleteProfile(address: wallet.address);
await sub.deleteAccounts([wallet.address]);

View File

@ -82,8 +82,10 @@ class _HomeScreenState extends State<HomeScreen> {
'wss://$validIndexerEndpoint/v1/graphql',
);
const headerWebsocket =
datapodEndpoint == '10.0.2.2:8080' ? 'ws' : 'wss';
final wsLinkDatapod = WebSocketLink(
'wss://$datapodEndpoint/v1/graphql',
'$headerWebsocket://$datapodEndpoint/v1/graphql',
);
duniterIndexer.indexerClient = GraphQLClient(

View File

@ -122,7 +122,7 @@ class _CustomDerivationState extends State<CustomDerivation> {
);
}
if (myWalletProvider.pinCode != '') return;
if (myWalletProvider.pinCode == '') return;
String newDerivationName =
'${'wallet'.tr()} ${myWalletProvider.listWallets.last.number! + 2}';
if (dropdownValue == 'root') {

View File

@ -63,22 +63,45 @@ class HistoryQuery extends StatelessWidget {
}
final List transactions = result.data?["transaction"];
// Get transaction in progress if exist
String? transactionId;
for (final entry in sub.transactionStatus.entries) {
if (entry.value.from == address) {
transactionId = entry.key;
break;
}
}
if (result.hasException) {
log.e('Error Indexer: ${result.exception}');
return Column(children: <Widget>[
ScaledSizedBox(height: 50),
Text(
"noNetworkNoHistory".tr(),
textAlign: TextAlign.center,
style: scaledTextStyle(fontSize: 18),
Column(
children: [
if (transactionId != null)
TransactionInProgressTule(
address: address, transactionId: transactionId),
ScaledSizedBox(height: 50),
Text(
"noNetworkNoHistory".tr(),
textAlign: TextAlign.center,
style: scaledTextStyle(fontSize: 18),
),
],
)
]);
} else if (transactions.isEmpty) {
return Column(children: <Widget>[
ScaledSizedBox(height: 50),
Text(
"noDataToDisplay".tr(),
style: scaledTextStyle(fontSize: 18),
Column(
children: [
if (transactionId != null)
TransactionInProgressTule(
address: address, transactionId: transactionId),
ScaledSizedBox(height: 50),
Text(
"noDataToDisplay".tr(),
style: scaledTextStyle(fontSize: 18),
),
],
)
]);
}
@ -96,15 +119,6 @@ class HistoryQuery extends StatelessWidget {
offset: transactions.length,
);
// Get transaction in progress if exist
String? transactionId;
for (final entry in sub.transactionStatus.entries) {
if (entry.value.from == address) {
transactionId = entry.key;
break;
}
}
// Build history list
return NotificationListener(
child: Builder(

View File

@ -40,6 +40,7 @@ class _TransactionInProgressTuleState extends State<TransactionInProgressTule> {
txContent = sub.transactionStatus[widget.transactionId]!;
subscription = stream.listen((result) {
if (result.data?['account_by_pk'] == null) return;
if (result.hasException) {
log.e(result.exception);
isVisible = true;
@ -128,7 +129,7 @@ class _TransactionInProgressTuleState extends State<TransactionInProgressTule> {
statusIcon,
ScaledSizedBox(width: 10),
ScaledSizedBox(
width: 160,
width: 170,
child: Text(
humanStatus,
style: scaledTextStyle(