Skip to content

Commit

Permalink
Merge pull request #25 from Beldex-Coin/dev
Browse files Browse the repository at this point in the history
Bump Version 1.3.3
  • Loading branch information
sanada08 authored Mar 20, 2024
2 parents 0690da7 + 82c50ad commit ef395a0
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 82 deletions.
9 changes: 9 additions & 0 deletions assets/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,13 @@
version: 1.3.2
changes:
- Introduced Buy BNS feature
- Minor bug fixes
-
version: 1.3.3
changes:
- Fixed reconnecting issue if wallet fails to connect
- Fixed crash in fetching My BNS details
- Fixed missing payment ID details for integrated address transaction
- Fixed UI issues
- Updated Node list
- Minor bug fixes
Binary file modified assets/images/new-images/green_coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions assets/node_list.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
-
uri: publicnode1.rpcnode.stream:29095
is_default: true
-
uri: explorer.beldex.io:19091
is_default: false
-
uri: mainnet.beldex.io:29095
is_default: false
-
uri: publicnode2.rpcnode.stream:29095
is_default: false
Expand Down
84 changes: 49 additions & 35 deletions lib/src/bns/my_bns_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MyBnsPage extends StatefulWidget {
class MyBnsPageState extends State<MyBnsPage> with TickerProviderStateMixin {
final _decryptRecordController = TextEditingController();
StreamController<List<BnsRow>> _getAllBnsStreamController;
var isLoading = true;

@override
void initState() {
Expand Down Expand Up @@ -159,59 +160,70 @@ class MyBnsPageState extends State<MyBnsPage> with TickerProviderStateMixin {
currentFocus.unfocus();
}
if (_decryptRecordController.text.isNotEmpty) {
FetchingBnsRecordDialogBox().showFetchingBnsRecordDialog(
context, settingsStore);
await getNameToNameHash('${_decryptRecordController
.text}.bdx'.toLowerCase()).then((nameHash) {
var isValidBns = false;
getAllBns().then((value) {
if (value.isNotEmpty) {
for (var i = 0; i < value.length; i++) {
if (nameHash == value[i].nameHash) {
isValidBns = true;
if(!isLoading) {
FetchingBnsRecordDialogBox().showFetchingBnsRecordDialog(
context, settingsStore);
await getNameToNameHash('${_decryptRecordController
.text}.bdx'.toLowerCase()).then((nameHash) {
var isValidBns = false;
getAllBns().then((value) {
if (value.isNotEmpty) {
for (var i = 0; i < value.length; i++) {
if (nameHash == value[i].nameHash) {
isValidBns = true;
}
}
}
if (isValidBns) {
final bnsSetRecordResponse = bnsSetRecord(
'${_decryptRecordController.text}.bdx'.toLowerCase());
if (bnsSetRecordResponse) {
callGetAllBns();
if (isValidBns) {
final bnsSetRecordResponse = bnsSetRecord(
'${_decryptRecordController.text}.bdx'
.toLowerCase());
if (bnsSetRecordResponse) {
callGetAllBns();
Navigator.of(context).pop();
Toast.show(
'Successfully decrypted BNS Record for ${_decryptRecordController
.text}.bdx', context,
duration: Toast.LENGTH_LONG,
gravity: Toast.BOTTOM,
textColor: Colors.white,
backgroundColor: Color(0xff0ba70f),
);
_decryptRecordController.clear();
}
} else {
Navigator.of(context).pop();
Toast.show(
'Successfully decrypted BNS Record for ${_decryptRecordController
.text}.bdx', context,
duration: Toast.LENGTH_LONG,
'The given BNS record doesn\'t exist or does not belong to this wallet.',
context, duration: Toast.LENGTH_LONG,
gravity: Toast.BOTTOM,
textColor: Colors.white,
backgroundColor: Color(0xff0ba70f),
backgroundColor: Colors.red,
);
_decryptRecordController.clear();
}
} else {
Navigator.of(context).pop();
Toast.show(
'The given BNS record doesn\'t exist or does not belong to this wallet.',
context, duration: Toast.LENGTH_LONG,
'Failed to decrypt BNS Record for ${_decryptRecordController
.text}.bdx', context,
duration: Toast.LENGTH_LONG,
gravity: Toast.BOTTOM,
textColor: Colors.white,
backgroundColor: Colors.red,
);
_decryptRecordController.clear();
}
} else {
Navigator.of(context).pop();
Toast.show(
'Failed to decrypt BNS Record for ${_decryptRecordController
.text}.bdx', context,
duration: Toast.LENGTH_LONG,
gravity: Toast.BOTTOM,
textColor: Colors.white,
backgroundColor: Colors.red,
);
_decryptRecordController.clear();
}
});
});
});
}else{
Toast.show(
'Please wait until we fetch the BNS record from Network', context,
duration: Toast.LENGTH_LONG,
gravity: Toast.BOTTOM,
textColor: Colors.white,
backgroundColor: Colors.red,
);
}
} else {
return null;
}
Expand Down Expand Up @@ -256,6 +268,7 @@ class MyBnsPageState extends State<MyBnsPage> with TickerProviderStateMixin {
AsyncSnapshot<List<BnsRow>> snapshot) {
if (snapshot.data != null) {
final allBns = snapshot.data;
isLoading = false;
if (allBns.isNotEmpty) {
return ListView.builder(
shrinkWrap: true,
Expand Down Expand Up @@ -809,6 +822,7 @@ class MyBnsPageState extends State<MyBnsPage> with TickerProviderStateMixin {
);
}
} else {
isLoading = true;
return Center(
child: CircularProgressIndicator(
valueColor:
Expand Down
8 changes: 0 additions & 8 deletions lib/src/domain/common/default_settings_migration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ Future<void> replaceNodesMigration({@required Box<Node> nodes}) async {
final replaceNodes = <String, Node>{
'publicnode1.rpcnode.stream:29095':
Node(uri: 'publicnode1.rpcnode.stream:29095'),
'explorer.beldex.io:19091':
Node(uri: 'explorer.beldex.io:19091'),
'mainnet.beldex.io:29095':
Node(uri: 'mainnet.beldex.io:29095'),
'publicnode2.rpcnode.stream:29095':
Node(uri: 'publicnode2.rpcnode.stream:29095'),
'publicnode3.rpcnode.stream:29095':
Expand Down Expand Up @@ -101,8 +97,6 @@ Future<void> changeCurrentNodeToDefault(

const nodesList = <String>[
'publicnode1.rpcnode.stream:29095',
'explorer.beldex.io:19091',
'mainnet.beldex.io:29095',
'publicnode2.rpcnode.stream:29095',
'publicnode3.rpcnode.stream:29095',
'publicnode4.rpcnode.stream:29095',
Expand Down Expand Up @@ -130,8 +124,6 @@ Future<void> replaceDefaultNode(
@required Box<Node> nodes}) async {
const nodesForReplace = <String>[
'publicnode1.rpcnode.stream:29095',
'explorer.beldex.io:19091',
'mainnet.beldex.io:29095',
'publicnode2.rpcnode.stream:29095',
'publicnode3.rpcnode.stream:29095',
'publicnode4.rpcnode.stream:29095',
Expand Down
14 changes: 7 additions & 7 deletions lib/src/screens/base_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ abstract class BasePage extends StatelessWidget {
}
final settingsStore = Provider.of<SettingsStore>(context);
final _backButton = Container(
height: 30,
width: 40,
height: 48,
width: 48,
child: SvgPicture.asset(
'assets/images/new-images/back_arrow.svg',
color: settingsStore.isDarkTheme ? Colors.white : Colors.black,
height: 80,
width: 50,
height: 48,
width: 48,
fit: BoxFit.fill,
));
return Container(
width: 60,
padding: EdgeInsets.only(left: 15),
padding: EdgeInsets.only(left: 10,top: 4),
alignment: Alignment.centerLeft,
child: SizedBox(
height: 30,
width: 40,
height: 48,
width: 48,
child: ButtonTheme(
buttonColor: Colors.transparent,
minWidth: double.minPositive,
Expand Down
20 changes: 7 additions & 13 deletions lib/src/screens/dashboard/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:beldex_wallet/src/node/sync_status.dart';
import 'package:beldex_wallet/src/screens/dashboard/dashboard_rescan_dialog.dart';
import 'package:beldex_wallet/src/util/network_service.dart';
import 'package:beldex_wallet/src/util/screen_sizer.dart';
import 'package:beldex_wallet/src/widgets/standart_switch.dart';
import 'package:beldex_wallet/src/widgets/standard_switch.dart';
import 'package:beldex_wallet/theme_changer.dart';
import 'package:beldex_wallet/themes.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
Expand All @@ -16,7 +16,6 @@ import 'package:beldex_wallet/generated/l10n.dart';
import 'package:beldex_wallet/routes.dart';
import 'package:beldex_wallet/src/domain/common/balance_display_mode.dart';
import 'package:beldex_wallet/src/screens/base_page.dart';
import 'package:beldex_wallet/src/stores/action_list/action_list_store.dart';
import 'package:beldex_wallet/src/stores/balance/balance_store.dart';
import 'package:beldex_wallet/src/stores/settings/settings_store.dart';
import 'package:beldex_wallet/src/stores/sync/sync_store.dart';
Expand Down Expand Up @@ -77,7 +76,7 @@ class DashboardPage extends BasePage {
children: [
Container(
height: 25,
child: StandartSwitch(
child: StandardSwitch(
value: settingsStore.isDarkTheme,
icon: true,
onTaped: () {
Expand Down Expand Up @@ -200,7 +199,7 @@ class DashboardPageBodyState extends State<DashboardPageBody> {

Connectivity connectivity;
StreamSubscription<ConnectivityResult> subscription;
var reconnect = false;
//var reconnect = false;


Future<void> _presentQRScanner(BuildContext context) async {
Expand Down Expand Up @@ -237,7 +236,6 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
Widget build(BuildContext context) {
final walletStore = Provider.of<WalletStore>(context);
final balanceStore = Provider.of<BalanceStore>(context);
final actionListStore = Provider.of<ActionListStore>(context);
final syncStore = Provider.of<SyncStore>(context);
final settingsStore = Provider.of<SettingsStore>(context);
final networkStatus = Provider.of<NetworkStatus>(context);
Expand All @@ -251,12 +249,9 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
child: Observer(
key: _listObserverKey,
builder: (_) {
final items = actionListStore.items ?? <String>[];
final itemsCount = 2; //items.length + 2;
return ListView.builder(
key: _listKey,
//padding: EdgeInsets.only(bottom: 15),
itemCount: itemsCount,
itemCount: 2,
itemBuilder: (context, index) {
if (index == 0) {
return Container(
Expand Down Expand Up @@ -287,12 +282,11 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
descriptionText = S
.of(context)
.please_try_to_connect_to_another_node;
reconnect = true;
if (networkStatus == NetworkStatus.online &&
reconnect) {
/* reconnect = true;
if (networkStatus == NetworkStatus.online && reconnect) {
walletStore.reconnect();
reconnect = false;
}
}*/
}
return Container(
child: Column(
Expand Down
34 changes: 34 additions & 0 deletions lib/src/screens/dashboard/transaction_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TransactionRow extends StatelessWidget {
this.transaction,
this.isBns,
//this.isStake
this.paymentId
});

final VoidCallback onTap;
Expand All @@ -34,6 +35,7 @@ class TransactionRow extends StatelessWidget {
final TransactionInfo transaction;
// final bool isStake;
final bool isBns;
final String paymentId;

void _launchUrl(String url) async {
if (await canLaunch(url)) await launch(url);
Expand Down Expand Up @@ -229,6 +231,38 @@ class TransactionRow extends StatelessWidget {
),
),
SizedBox(height: 10),
Visibility(
visible: paymentId != '0000000000000000',
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: settingsStore.isDarkTheme
? Color(0xff454555)
: Color(0xffDADADA)),
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Payment ID',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w900)),
Container(
child: Text(
paymentId
)),
],
),
),
),
),
Visibility(
visible: paymentId != '0000000000000000',
child: SizedBox(height: 10)
),
Container(
decoration: BoxDecoration(
border: Border.all(
Expand Down
1 change: 1 addition & 0 deletions lib/src/screens/dashboard/transactiondetails_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ class TransactionDetailsListBodyState
transaction: transaction,
//isStake: transaction.isStake,
isBns:transaction.isBns,
paymentId:transaction.paymentId
);
}

Expand Down
Loading

0 comments on commit ef395a0

Please sign in to comment.