diff --git a/CHANGELOG.md b/CHANGELOG.md index dc3b88c6..f9a17af5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,4 +34,11 @@ - Add Edgeware network support. - Update ChainX plugin. - Update Laminar plugin to TC3. +- Fix known Bugs. + +# 2.0.5-beta +- Update Acala swap & loan UI. +- Remove Kusama council module. +- Update Edgeware Update. +- Update ChainX plugin. - Fix known Bugs. \ No newline at end of file diff --git a/assets/images/public/kar_crowd_loan.jpg b/assets/images/public/kar_crowd_loan.jpg new file mode 100644 index 00000000..c1208399 Binary files /dev/null and b/assets/images/public/kar_crowd_loan.jpg differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 7a20942f..fd735789 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -354,7 +354,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = WQ5H736A22; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -370,7 +370,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 2.0.4; + MARKETING_VERSION = 2.0.5; PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -493,7 +493,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = WQ5H736A22; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -509,7 +509,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 2.0.4; + MARKETING_VERSION = 2.0.5; PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -526,7 +526,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = WQ5H736A22; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -542,7 +542,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 2.0.4; + MARKETING_VERSION = 2.0.5; PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/app.dart b/lib/app.dart index 9c307b4f..5e2a8457 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -8,6 +8,7 @@ import 'package:app/pages/assets/asset/assetPage.dart'; import 'package:app/pages/assets/transfer/detailPage.dart'; import 'package:app/pages/assets/transfer/transferPage.dart'; import 'package:app/pages/public/guidePage.dart'; +import 'package:app/pages/public/adPage.dart'; import 'package:app/pages/homePage.dart'; import 'package:app/pages/networkSelectPage.dart'; import 'package:app/pages/profile/aboutPage.dart'; @@ -268,6 +269,15 @@ class _WalletAppState extends State { } Future _showGuide(BuildContext context, GetStorage storage) async { + // todo: remove this after crowd loan + final karStarted = await WalletApi.getKarCrowdLoanStarted(); + if (karStarted != null && karStarted['result']) { + storage.write(kar_crowd_loan_api_key, + '${karStarted['endpoint']}|${karStarted['subscribe']}'); + Navigator.of(context).pushNamed(AdPage.route); + return; + } + final storeKey = '${show_guide_status_key}_$app_beta_version'; final showGuideStatus = storage.read(storeKey); if (showGuideStatus == null) { @@ -381,6 +391,7 @@ class _WalletAppState extends State { WalletConnectSignPage.route: (_) => WalletConnectSignPage(_service, _service.account.getPassword), GuidePage.route: (_) => GuidePage(), + AdPage.route: (_) => AdPage(), KarCrowdLoanPage.route: (_) => KarCrowdLoanPage(_service, _connectedNode), KarCrowdLoanFormPage.route: (_) => KarCrowdLoanFormPage(_service, _connectedNode), @@ -423,7 +434,7 @@ class _WalletAppState extends State { @override Widget build(_) { return MaterialApp( - title: 'Polkawallet Plugin Kusama Demo', + title: 'Polkawallet', theme: _theme ?? _getAppTheme( widget.plugins[0].basic.primaryColor, diff --git a/lib/common/consts.dart b/lib/common/consts.dart index b18fa9aa..319f3a44 100644 --- a/lib/common/consts.dart +++ b/lib/common/consts.dart @@ -15,8 +15,9 @@ const prefixList = [ /// app versions enum BuildTargets { apk, playStore, dev } -const String app_beta_version = 'v2.0.4-beta.1'; -const int app_beta_version_code = 2041; +const String app_beta_version = 'v2.0.5-beta.3'; +const int app_beta_version_code = 2053; const show_guide_status_key = 'show_guide_status'; const show_banner_status_key = 'show_banner_status'; +const kar_crowd_loan_api_key = 'kar_crowd_loan_api'; diff --git a/lib/pages/assets/transfer/transferPage.dart b/lib/pages/assets/transfer/transferPage.dart index 0603ad48..896021af 100644 --- a/lib/pages/assets/transfer/transferPage.dart +++ b/lib/pages/assets/transfer/transferPage.dart @@ -100,9 +100,11 @@ class _TransferPageState extends State { final txInfo = TxInfoData('balances', 'transfer', sender); final fee = await widget.service.plugin.sdk.api.tx.estimateFees( txInfo, [widget.service.keyring.current.address, '10000000000']); - setState(() { - _fee = fee; - }); + if (mounted) { + setState(() { + _fee = fee; + }); + } return fee.partialFee.toString(); } @@ -221,6 +223,7 @@ class _TransferPageState extends State { key: ValueKey(_accountTo), ), TextFormField( + autovalidateMode: AutovalidateMode.onUserInteraction, decoration: InputDecoration( hintText: dic['amount'], labelText: diff --git a/lib/pages/public/AdBanner.dart b/lib/pages/public/AdBanner.dart index dddc603d..60fba344 100644 --- a/lib/pages/public/AdBanner.dart +++ b/lib/pages/public/AdBanner.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:app/common/consts.dart'; -import 'package:app/main.dart'; import 'package:app/pages/public/karCrowdLoanPage.dart'; import 'package:app/service/walletApi.dart'; import 'package:app/utils/i18n/index.dart'; @@ -61,10 +60,7 @@ class _AdBannerState extends State { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) { - // todo: only available in dev now - if (widget.service.buildTarget == BuildTargets.dev) { - _getCrowdLoanStarted(); - } + _getCrowdLoanStarted(); }); } diff --git a/lib/pages/public/adPage.dart b/lib/pages/public/adPage.dart new file mode 100644 index 00000000..bb3bb920 --- /dev/null +++ b/lib/pages/public/adPage.dart @@ -0,0 +1,140 @@ +import 'dart:async'; + +import 'package:app/utils/i18n/index.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:polkawallet_sdk/utils/i18n.dart'; +import 'package:polkawallet_ui/components/roundedButton.dart'; + +class AdPage extends StatefulWidget { + static final String route = '/guide/ad'; + @override + _AdPageState createState() => _AdPageState(); +} + +class _AdPageState extends State { + int _timerCount = 10; + + void _updateTimer() { + if (_timerCount > 0) { + setState(() { + _timerCount -= 1; + }); + + Timer(Duration(seconds: 1), () { + _updateTimer(); + }); + } else { + Navigator.of(context).pop(); + } + } + + @override + void initState() { + super.initState(); + + _updateTimer(); + } + + @override + Widget build(BuildContext context) { + final dic = I18n.of(context).getDic(i18n_full_dic_app, 'account'); + return Scaffold( + backgroundColor: Theme.of(context).cardColor, + body: Stack( + children: [ + Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/public/kar_crowd_loan.jpg"), + fit: BoxFit.cover, + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 64, left: 24), + child: Text('KARURA Parachain Auction', + style: TextStyle( + fontSize: 22, + color: Theme.of(context).cardColor, + fontWeight: FontWeight.bold)), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 8, left: 24, right: 24), + child: KarCrowdLoanTitleSet(), + ), + ), + Container( + margin: EdgeInsets.all(24), + child: RoundedButton( + text: '${dic['guide.enter']} (${_timerCount}s)', + onPressed: () => Navigator.of(context).pop(true), + ), + ) + ], + ) + ], + ), + ); + } +} + +class KarCrowdLoanTitleSet extends StatelessWidget { + KarCrowdLoanTitleSet({this.finished = false}); + final bool finished; + @override + Widget build(BuildContext context) { + final cardColor = Theme.of(context).cardColor; + final karColor = Colors.red; + final dic = I18n.of(context).getDic(i18n_full_dic_app, 'public'); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Stack( + children: [ + Padding( + padding: EdgeInsets.only(left: 4, top: 2), + child: Row( + children: [ + Expanded( + child: FittedBox( + child: Text( + dic['auction.${finished ? 'finish' : 'live'}'] + .toUpperCase(), + style: TextStyle( + color: karColor, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.italic)))) + ], + ), + ), + Padding( + padding: EdgeInsets.only(right: 4, bottom: 2), + child: Row( + children: [ + Expanded( + child: FittedBox( + child: Text( + dic['auction.${finished ? 'finish' : 'live'}'] + .toUpperCase(), + style: TextStyle( + color: cardColor, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.italic)))) + ], + ), + ), + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/public/karCrowdLoanFormPage.dart b/lib/pages/public/karCrowdLoanFormPage.dart index 28656d4b..fd967e04 100644 --- a/lib/pages/public/karCrowdLoanFormPage.dart +++ b/lib/pages/public/karCrowdLoanFormPage.dart @@ -1,3 +1,4 @@ +import 'package:app/common/consts.dart'; import 'package:app/pages/public/karCrowdLoanPage.dart'; import 'package:app/service/index.dart'; import 'package:app/service/walletApi.dart'; @@ -16,6 +17,13 @@ import 'package:polkawallet_ui/pages/txConfirmPage.dart'; import 'package:polkawallet_ui/utils/format.dart'; import 'package:polkawallet_ui/utils/index.dart'; +class KarCrowdLoanPageParams { + KarCrowdLoanPageParams(this.account, this.paraId, this.email); + final KeyPairData account; + final String paraId; + final String email; +} + class KarCrowdLoanFormPage extends StatefulWidget { KarCrowdLoanFormPage(this.service, this.connectedNode); final AppService service; @@ -27,22 +35,15 @@ class KarCrowdLoanFormPage extends StatefulWidget { _KarCrowdLoanFormPageState createState() => _KarCrowdLoanFormPageState(); } -const kar_para_index = '1000'; - class _KarCrowdLoanFormPageState extends State { - final _emailRegEx = RegExp( - r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"); final _referralRegEx = RegExp(r'^0x[0-9a-z]{64}$'); - final _emailFocusNode = FocusNode(); final _amountFocusNode = FocusNode(); final _referralFocusNode = FocusNode(); bool _submitting = false; - String _email = ''; double _amount = 0; String _referral = ''; - bool _emailValid = false; bool _amountValid = false; bool _referralValid = false; @@ -50,23 +51,6 @@ class _KarCrowdLoanFormPageState extends State { bool _emailAccept = true; - void _onEmailChange(String value) { - final v = value.trim(); - if (v.isEmpty) { - setState(() { - _email = v; - _emailValid = false; - }); - return; - } - - final valid = _emailRegEx.hasMatch(v); - setState(() { - _emailValid = valid; - _email = v; - }); - } - void _onAmountChange(String value, BigInt balanceInt) { final v = value.trim(); if (v.isEmpty) { @@ -80,9 +64,9 @@ class _KarCrowdLoanFormPageState extends State { final amt = double.parse(v); - final decimals = 12; - // final decimals = widget.service.plugin.networkState.tokenDecimals[0]; - final valid = amt < Fmt.bigIntToDouble(balanceInt, decimals); + final decimals = + (widget.service.plugin.networkState.tokenDecimals ?? [12])[0]; + final valid = amt < Fmt.bigIntToDouble(balanceInt, decimals) && amt >= 1; setState(() { _amountValid = valid; _amount = amt; @@ -108,10 +92,9 @@ class _KarCrowdLoanFormPageState extends State { }); return; } - final res = await WalletApi.verifyKarReferralCode(v); + final karApis = widget.service.store.storage.read(kar_crowd_loan_api_key); + final res = await WalletApi.verifyKarReferralCode(v, karApis.split('|')[0]); print(res); - // todo: valid2 = true for testing - // final valid2 = true; final valid2 = res != null && res['result']; setState(() { _referral = v; @@ -122,43 +105,44 @@ class _KarCrowdLoanFormPageState extends State { Future _signAndSubmit(KeyPairData account) async { if (_submitting || widget.connectedNode == null || - !(_amountValid && _emailValid && (_referralValid || _referral.isEmpty))) - return; + !(_amountValid && (_referralValid || _referral.isEmpty))) return; setState(() { _submitting = true; }); - final decimals = 12; - // final decimals = widget.service.plugin.networkState.tokenDecimals[0]; + final karApi = widget.service.store.storage.read(kar_crowd_loan_api_key); + final karApis = karApi.split('|'); + final KarCrowdLoanPageParams params = + ModalRoute.of(context).settings.arguments; + final decimals = + (widget.service.plugin.networkState.tokenDecimals ?? [12])[0]; + final amountInt = Fmt.tokenInt(_amount.toString(), decimals); final signed = widget.service.store.storage .read('$kar_statement_store_key${account.pubKey}'); - final amountInt = Fmt.tokenInt(_amount.toString(), decimals); - // todo: add this post request while API is ready. - final signingRes = await WalletApi.postKarCrowdLoan( - account.address, amountInt, _email, _referral, signed); - print(signingRes); - // final signingRes = {'result': true}; - if (signingRes != null && signingRes['result']) { + final signingRes = await widget.service.account.postKarCrowdLoan( + account.address, + amountInt, + params.email, + _referral, + signed, + karApis[0]); + if (signingRes != null && (signingRes['result'] ?? false)) { final dic = I18n.of(context).getDic(i18n_full_dic_app, 'public'); - // todo: use response data while API is ready. - final signingPayload = {'Sr25519': signingRes['signingPayload']}; - // final signingPayload = {'Sr25519': signed}; final res = (await Navigator.of(context).pushNamed(TxConfirmPage.route, arguments: TxConfirmParams( module: 'crowdloan', call: 'contribute', txTitle: dic['auction.contribute'], txDisplay: { - "paraIndex": kar_para_index, + "paraIndex": params.paraId, "amount": '$_amount KSM', - "signingPayload": signingPayload + // "signingPayload": signingPayload }, - params: [kar_para_index, amountInt.toString(), signingPayload], + params: [params.paraId, amountInt.toString(), null], ))) as Map; if (res != null) { - if (_emailAccept) { - // todo: update subscribe id in production - WalletApi.postKarSubscribe(_email); + if (params.email.isNotEmpty && _emailAccept) { + WalletApi.postKarSubscribe(params.email, karApis[1]); } await showCupertinoDialog( context: context, @@ -186,7 +170,9 @@ class _KarCrowdLoanFormPageState extends State { builder: (BuildContext context) { return CupertinoAlertDialog( title: Text('Failed'), - content: Text('Get Karura crowdloan info failed.'), + content: Text(signingRes == null + ? 'Get Karura crowdloan info failed.' + : signingRes['message']), actions: [ CupertinoButton( child: Text('OK'), @@ -202,10 +188,16 @@ class _KarCrowdLoanFormPageState extends State { } } + Widget _getTitle(String title) { + return Container( + margin: EdgeInsets.only(left: 16, bottom: 4), + child: Text(title, style: TextStyle(fontSize: 16, color: Colors.white)), + ); + } + @override void dispose() { super.dispose(); - _emailFocusNode.dispose(); _referralFocusNode.dispose(); _amountFocusNode.dispose(); } @@ -214,8 +206,8 @@ class _KarCrowdLoanFormPageState extends State { Widget build(_) { return Observer(builder: (BuildContext context) { final dic = I18n.of(context).getDic(i18n_full_dic_app, 'public'); - final decimals = 12; - // final decimals = widget.service.plugin.networkState.tokenDecimals[0]; + final decimals = + (widget.service.plugin.networkState.tokenDecimals ?? [12])[0]; final cardColor = Theme.of(context).cardColor; final karColor = Colors.red; @@ -227,14 +219,14 @@ class _KarCrowdLoanFormPageState extends State { final karInfoStyle = TextStyle(color: karColor, fontSize: 20, fontWeight: FontWeight.bold); - final KeyPairData account = ModalRoute.of(context).settings.arguments; + final KarCrowdLoanPageParams params = + ModalRoute.of(context).settings.arguments; final balanceInt = Fmt.balanceInt( widget.service.plugin.balances.native.availableBalance.toString()); final balanceView = Fmt.priceFloorBigInt(balanceInt, decimals, lengthMax: 8); - final inputValid = - _emailValid && _amountValid && (_referralValid || _referral.isEmpty); + final inputValid = _amountValid && (_referralValid || _referral.isEmpty); final isConnected = widget.connectedNode != null; return CrowdLoanPageLayout(dic['auction.contribute'], [ @@ -242,7 +234,11 @@ class _KarCrowdLoanFormPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 16, bottom: 16), + margin: EdgeInsets.only(top: 16), + child: _getTitle(dic['auction.address']), + ), + Container( + margin: EdgeInsets.only(bottom: 8), padding: EdgeInsets.fromLTRB(12, 8, 12, 8), decoration: BoxDecoration( color: Colors.white24, @@ -251,8 +247,8 @@ class _KarCrowdLoanFormPageState extends State { child: Row( children: [ AddressIcon( - account.address ?? '', - svg: account.icon, + params.account.address ?? '', + svg: params.account.icon, size: 36, tapToCopy: false, ), @@ -263,11 +259,11 @@ class _KarCrowdLoanFormPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - account.name ?? '', + params.account.name ?? '', style: TextStyle(fontSize: 18, color: cardColor), ), Text( - Fmt.address(account.address ?? ''), + Fmt.address(params.account.address ?? ''), style: TextStyle(color: grayColor, fontSize: 14), ), ], @@ -276,47 +272,24 @@ class _KarCrowdLoanFormPageState extends State { ], ), ), - Container( - margin: EdgeInsets.only(top: 8, bottom: 4), - child: CupertinoTextField( - padding: EdgeInsets.all(16), - placeholder: dic['auction.email'], - placeholderStyle: TextStyle(color: grayColor, fontSize: 18), - style: TextStyle(color: cardColor, fontSize: 18), - decoration: BoxDecoration( - color: Colors.white24, - borderRadius: BorderRadius.all(Radius.circular(64)), - border: Border.all( - color: _emailFocusNode.hasFocus ? karColor : grayColor), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: _getTitle(dic['auction.amount'])), + Padding( + padding: EdgeInsets.only(right: 16), + child: Text( + '${dic['auction.balance']}: $balanceView KSM', + style: TextStyle(color: Colors.white70, fontSize: 13), + ), ), - cursorColor: karColor, - clearButtonMode: OverlayVisibilityMode.editing, - focusNode: _emailFocusNode, - onChanged: _onEmailChange, - ), - ), - Container( - height: 12, - margin: EdgeInsets.only(left: 16, bottom: 8), - child: _email.isEmpty || _emailValid - ? Container() - : Text( - '${dic['auction.invalid']} ${dic['auction.email']}', - style: errorStyle, - ), - ), - Padding( - padding: EdgeInsets.only(left: 16, bottom: 4), - child: Text( - '${dic['auction.balance']}: $balanceView KSM', - style: TextStyle(color: Colors.white70), - ), + ], ), Container( margin: EdgeInsets.only(bottom: 4), child: CupertinoTextField( padding: EdgeInsets.all(16), - placeholder: dic['auction.amount'], + placeholder: dic['auction.amount1'], placeholderStyle: TextStyle(color: grayColor, fontSize: 18), style: TextStyle(color: cardColor, fontSize: 18), decoration: BoxDecoration( @@ -333,8 +306,7 @@ class _KarCrowdLoanFormPageState extends State { ), ), Container( - height: 12, - margin: EdgeInsets.only(left: 16, bottom: 8), + margin: EdgeInsets.only(left: 16, bottom: 4), child: _amount == 0 || _amountValid ? Container() : Text( @@ -342,6 +314,7 @@ class _KarCrowdLoanFormPageState extends State { style: errorStyle, ), ), + _getTitle(dic['auction.referral']), Container( margin: EdgeInsets.only(bottom: 4), child: CupertinoTextField( @@ -363,8 +336,7 @@ class _KarCrowdLoanFormPageState extends State { ), ), Container( - height: 12, - margin: EdgeInsets.only(left: 16, bottom: 8), + margin: EdgeInsets.only(left: 16, bottom: 4), child: _referral.isEmpty || _referralValid ? Container() : Text( @@ -373,6 +345,7 @@ class _KarCrowdLoanFormPageState extends State { ), ), Container( + margin: EdgeInsets.only(top: 16), padding: EdgeInsets.all(16), decoration: BoxDecoration( color: Colors.white30, @@ -426,43 +399,45 @@ class _KarCrowdLoanFormPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(dic['auction.lease'], style: karKeyStyle), - Text('12 MONTHS', style: karInfoStyle), + Text('48 WEEKS', style: karInfoStyle), ], ), ], ), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Theme( - child: SizedBox( - height: 48, - width: 32, - child: Padding( - padding: EdgeInsets.only(right: 8), - child: Checkbox( - value: _emailAccept, - onChanged: (v) { - setState(() { - _emailAccept = v; - }); - }, + params.email.isNotEmpty + ? Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Theme( + child: SizedBox( + height: 48, + width: 32, + child: Padding( + padding: EdgeInsets.only(right: 8), + child: Checkbox( + value: _emailAccept, + onChanged: (v) { + setState(() { + _emailAccept = v; + }); + }, + ), + ), + ), + data: ThemeData( + primarySwatch: karColor, + unselectedWidgetColor: karColor, // Your color + ), ), - ), - ), - data: ThemeData( - primarySwatch: karColor, - unselectedWidgetColor: karColor, // Your color - ), - ), - Expanded( - child: Text( - dic['auction.notify'], - style: TextStyle(color: cardColor, fontSize: 10), - )) - ], - ), + Expanded( + child: Text( + dic['auction.notify'], + style: TextStyle(color: cardColor, fontSize: 10), + )) + ], + ) + : Container(height: 16), Container( margin: EdgeInsets.only(top: 4, bottom: 32), child: RoundedButton( @@ -475,7 +450,7 @@ class _KarCrowdLoanFormPageState extends State { color: inputValid && !_submitting && isConnected ? karColor : Colors.grey, - onPressed: () => _signAndSubmit(account), + onPressed: () => _signAndSubmit(params.account), ), ) ], diff --git a/lib/pages/public/karCrowdLoanPage.dart b/lib/pages/public/karCrowdLoanPage.dart index 1acac523..2f9fa43c 100644 --- a/lib/pages/public/karCrowdLoanPage.dart +++ b/lib/pages/public/karCrowdLoanPage.dart @@ -1,15 +1,17 @@ import 'dart:async'; +import 'package:app/common/consts.dart'; import 'package:app/pages/public/karCrowdLoanFormPage.dart'; +import 'package:app/pages/public/adPage.dart'; import 'package:app/service/index.dart'; import 'package:app/service/walletApi.dart'; import 'package:app/utils/i18n/index.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:polkawallet_sdk/storage/types/keyPairData.dart'; -import 'package:polkawallet_sdk/webviewWithExtension/types/signExtrinsicParam.dart'; import 'package:polkawallet_sdk/api/types/networkParams.dart'; import 'package:polkawallet_sdk/utils/i18n.dart'; +import 'package:polkawallet_sdk/webviewWithExtension/types/signExtrinsicParam.dart'; import 'package:polkawallet_ui/components/addressIcon.dart'; import 'package:polkawallet_ui/components/roundedButton.dart'; import 'package:polkawallet_ui/pages/accountListPage.dart'; @@ -30,17 +32,24 @@ class KarCrowdLoanPage extends StatefulWidget { } class _KarCrowdLoanPageState extends State { + final _emailRegEx = RegExp( + r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"); + final _emailFocusNode = FocusNode(); + int _bestNumber = 0; Map _fundInfo; KeyPairData _account = KeyPairData(); bool _submitting = false; + String _email = ''; + bool _emailValid = true; + bool _accepted0 = false; bool _accepted1 = false; bool _accepted2 = false; - String _statement; + Map _statement; bool _signed = false; List _contributions = []; @@ -56,13 +65,14 @@ class _KarCrowdLoanPageState extends State { } Future _getCrowdLoanInfo() async { + await _getKarStatement(); _getCrowdLoanHistory(); if (widget.connectedNode == null) return; _updateBestNumber(); - final res = await widget.service.plugin.sdk.webView - .evalJavascript('api.query.crowdloan.funds("$kar_para_index")'); + final res = await widget.service.plugin.sdk.webView.evalJavascript( + 'api.query.crowdloan.funds("${_statement['paraId'].toString()}")'); if (mounted) { setState(() { _fundInfo = res; @@ -71,22 +81,35 @@ class _KarCrowdLoanPageState extends State { } Future _getCrowdLoanHistory() async { + final karApis = widget.service.store.storage.read(kar_crowd_loan_api_key); final res = await WalletApi.getKarCrowdLoanHistory( - widget.service.keyring.current.address); + _account.address, karApis.split('|')[0]); print(res); - if (mounted) { + if (res != null && mounted) { setState(() { _contributions = res; }); } + + // we can get users' statement signature if we got the history + if (!_signed && res.length > 0) { + final signed = res[0]['statement']['signature']; + widget.service.store.storage + .write('$kar_statement_store_key${_account.pubKey}', signed); + if (mounted) { + setState(() { + _signed = true; + }); + } + } } Future _getKarStatement() async { - final res = await WalletApi.getKarCrowdLoanStatement(); - print(res); + final karApis = widget.service.store.storage.read(kar_crowd_loan_api_key); + final res = await WalletApi.getKarCrowdLoanStatement(karApis.split('|')[0]); if (res != null && mounted) { setState(() { - _statement = res['statement']; + _statement = res; }); } } @@ -115,15 +138,34 @@ class _KarCrowdLoanPageState extends State { _accepted2 = false; _signed = signed != null; }); + + _getCrowdLoanHistory(); } } + void _onEmailChange(String value) { + final v = value.trim(); + if (v.isEmpty) { + setState(() { + _email = v; + _emailValid = true; + }); + return; + } + + final valid = _emailRegEx.hasMatch(v); + setState(() { + _emailValid = valid; + _email = v; + }); + } + Future _acceptAndSign() async { if (_submitting) return; - setState(() { _submitting = true; }); + final password = await widget.service.account.getPassword(context, _account); @@ -132,7 +174,7 @@ class _KarCrowdLoanPageState extends State { params.msgType = "pub(bytes.sign)"; params.request = { "address": _account.address, - "data": _statement, + "data": _statement['statement'], }; final signRes = await widget.service.plugin.sdk.api.keyring @@ -145,11 +187,7 @@ class _KarCrowdLoanPageState extends State { _signed = true; }); - final res = await Navigator.of(context) - .pushNamed(KarCrowdLoanFormPage.route, arguments: _account); - if (res != null) { - _getCrowdLoanInfo(); - } + await _goToContribute(); } else { setState(() { _submitting = false; @@ -157,14 +195,21 @@ class _KarCrowdLoanPageState extends State { } } + Future _goToContribute() async { + final res = await Navigator.of(context).pushNamed( + KarCrowdLoanFormPage.route, + arguments: KarCrowdLoanPageParams( + _account, _statement['paraId'].toString(), _email)); + if (res != null) { + _getCrowdLoanInfo(); + } + } + @override void initState() { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) { - _getCrowdLoanInfo(); - _getKarStatement(); - final acc = widget.service.keyring.current; final signed = widget.service.store.storage .read('$kar_statement_store_key${acc.pubKey}'); @@ -173,6 +218,8 @@ class _KarCrowdLoanPageState extends State { _account = widget.service.keyring.current; _signed = signed != null; }); + + _getCrowdLoanInfo(); }); } @@ -182,10 +229,15 @@ class _KarCrowdLoanPageState extends State { if (widget.connectedNode != null && _fundInfo == null) { _getCrowdLoanInfo(); - _getKarStatement(); } } + @override + void dispose() { + super.dispose(); + _emailFocusNode.dispose(); + } + @override Widget build(BuildContext context) { final dic = I18n.of(context).getDic(i18n_full_dic_app, 'public'); @@ -209,8 +261,9 @@ class _KarCrowdLoanPageState extends State { final cardColor = Theme.of(context).cardColor; final karColor = Colors.red; final grayColor = Colors.white70; + final titleStyle = TextStyle(color: grayColor, fontSize: 18); - final allAccepted = _accepted0 && _accepted1 && _accepted2; + final allAccepted = _accepted0 && _accepted1 && _accepted2 && _emailValid; return CrowdLoanPageLayout('', [ Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -229,52 +282,16 @@ class _KarCrowdLoanPageState extends State { ], ), Container( - margin: EdgeInsets.only(top: 4), + margin: EdgeInsets.only(top: 4, bottom: 20), child: Text(dic['auction.kar'], style: TextStyle( fontSize: 28, color: karColor, fontWeight: FontWeight.bold)), ), - Container( - margin: EdgeInsets.only(top: 20), - child: Stack( - children: [ - Padding( - padding: EdgeInsets.only(left: 4, top: 2), - child: Row( - children: [ - Expanded( - child: FittedBox( - child: Text( - dic['auction.${finished ? 'finish' : 'live'}'] - .toUpperCase(), - style: TextStyle( - color: karColor, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.italic)))) - ], - ), - ), - Padding( - padding: EdgeInsets.only(right: 4, bottom: 2), - child: Row( - children: [ - Expanded( - child: FittedBox( - child: Text( - dic['auction.${finished ? 'finish' : 'live'}'] - .toUpperCase(), - style: TextStyle( - color: cardColor, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.italic)))) - ], - ), - ), - ], - ), - ), + _fundInfo == null + ? Container() + : KarCrowdLoanTitleSet(finished: finished), Container( margin: EdgeInsets.only(top: 8, bottom: 32), child: widget.connectedNode == null || _fundInfo == null || finished @@ -303,15 +320,16 @@ class _KarCrowdLoanPageState extends State { margin: EdgeInsets.only(bottom: 4), child: Divider(color: grayColor), ), - Text( - dic['auction.address'], - style: TextStyle(color: grayColor, fontSize: 18), + Container( + margin: EdgeInsets.only(bottom: 8), + child: Text(dic['auction.address'], style: titleStyle), ), GestureDetector( child: Container( - margin: EdgeInsets.only(top: 8, bottom: 16), + margin: EdgeInsets.only(bottom: 16), padding: EdgeInsets.fromLTRB(12, 8, 12, 8), decoration: BoxDecoration( + color: Colors.white12, border: Border.all(color: grayColor), borderRadius: BorderRadius.all(Radius.circular(64))), child: Row( @@ -351,6 +369,51 @@ class _KarCrowdLoanPageState extends State { ), onTap: _selectAccount, ), + _signed + ? Container() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(bottom: 8), + child: + Text(dic['auction.email'], style: titleStyle), + ), + Container( + margin: EdgeInsets.only(bottom: 4), + child: CupertinoTextField( + padding: EdgeInsets.all(16), + placeholder: dic['auction.email'], + placeholderStyle: + TextStyle(color: grayColor, fontSize: 18), + style: TextStyle(color: cardColor, fontSize: 18), + decoration: BoxDecoration( + color: Colors.white12, + borderRadius: + BorderRadius.all(Radius.circular(64)), + border: Border.all( + color: _emailFocusNode.hasFocus + ? karColor + : grayColor), + ), + cursorColor: karColor, + clearButtonMode: OverlayVisibilityMode.editing, + focusNode: _emailFocusNode, + onChanged: _onEmailChange, + ), + ), + Container( + margin: EdgeInsets.only(left: 16, bottom: 4), + child: _email.isEmpty || _emailValid + ? Container() + : Text( + '${dic['auction.invalid']} ${dic['auction.email']}', + style: TextStyle( + color: karColor, fontSize: 10), + ), + ), + ], + ), _signed ? Container() : Row( @@ -385,7 +448,7 @@ class _KarCrowdLoanPageState extends State { style: TextStyle(color: cardColor), ), JumpToLink( - 'https://acala.network/', + 'https://acala.network/terms', text: ' ${dic['auction.term.0']}', color: karColor, ) @@ -397,41 +460,67 @@ class _KarCrowdLoanPageState extends State { ? _contributions.length == 0 ? Container() : Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - dic['auction.txs'], - style: TextStyle(color: cardColor), + Container( + margin: EdgeInsets.only(bottom: 8), + child: + Text(dic['auction.txs'], style: titleStyle), ), - Column( - children: _contributions.map((e) { - return Row( - children: [ - Column( + Container( + padding: EdgeInsets.fromLTRB(16, 8, 16, 8), + decoration: BoxDecoration( + border: Border.all( + color: grayColor, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(16))), + child: Column( + children: _contributions.map((e) { + return Container( + margin: + EdgeInsets.only(top: 8, bottom: 8), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Row( + Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Text( - 'Tx: ${Fmt.address(e['inBlock']['eventId'])}', + '${Fmt.balance(e['amount'], decimals)} KSM', + style: TextStyle( + color: cardColor, + fontWeight: + FontWeight.bold), + ), + Text( + Fmt.dateTime(DateTime.parse( + e['createdAt'])), + style: TextStyle( + color: grayColor, + fontSize: 13)) + ], + ), + Column( + children: [ + Text( + 'Event Id', style: TextStyle( color: Colors.white70), ), JumpToLink( - 'https://acala.network/', - text: - ' ${dic['auction.term.0']}', + 'https://kusama.subscan.io/extrinsic/${e['inBlock']['eventId']}', + text: e['inBlock']['eventId'], color: karColor, ) ], ), - Text(Fmt.dateTime( - DateTime.parse(e['createdAt']))) ], ), - Text( - '${Fmt.balance(e['amount'], decimals)} KSM') - ], - ); - }).toList(), + ); + }).toList(), + ), ) ], ) @@ -467,7 +556,7 @@ class _KarCrowdLoanPageState extends State { style: TextStyle(color: cardColor), ), JumpToLink( - 'https://acala.network/', + 'https://acala.network/terms#check', text: ' ${dic['auction.term.1']}', color: karColor, ) @@ -509,7 +598,7 @@ class _KarCrowdLoanPageState extends State { style: TextStyle(color: cardColor), ), JumpToLink( - 'https://acala.network/', + 'https://acala.network/privacy', text: ' ${dic['auction.term.2']}', color: karColor, ) @@ -522,19 +611,19 @@ class _KarCrowdLoanPageState extends State { child: _signed ? RoundedButton( text: dic['auction.contribute'], - color: karColor, - onPressed: () => Navigator.of(context).pushNamed( - KarCrowdLoanFormPage.route, - arguments: _account), + color: _emailValid ? karColor : Colors.grey, + onPressed: _emailValid ? _goToContribute : () => null, ) : RoundedButton( - text: dic['auction.accept'], icon: _submitting ? CupertinoActivityIndicator() : null, + text: dic['auction.accept'], color: allAccepted && !_submitting ? karColor : Colors.grey, - onPressed: allAccepted ? _acceptAndSign : () => null, + onPressed: allAccepted && !_submitting + ? _acceptAndSign + : () => null, ), ) ], @@ -570,7 +659,7 @@ class CrowdLoanPageLayout extends StatelessWidget { ), Container( height: 56, - margin: EdgeInsets.only(top: 24, left: 8), + margin: EdgeInsets.only(top: 32, left: 8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/service/apiAccount.dart b/lib/service/apiAccount.dart index 52d02c70..9b2df720 100644 --- a/lib/service/apiAccount.dart +++ b/lib/service/apiAccount.dart @@ -175,9 +175,10 @@ class ApiAccount { } Future postKarCrowdLoan(String address, BigInt amount, String email, - String referral, String signature) async { + String referral, String signature, String endpoint) async { final submitted = await WalletApi.postKarCrowdLoan( - address, amount, email, referral, signature); + address, amount, email, referral, signature, endpoint); + print(submitted); if (submitted != null && (submitted['result'] ?? false)) { apiRoot.store.account.setBannerVisible(false); } diff --git a/lib/service/walletApi.dart b/lib/service/walletApi.dart index f207b03e..ab21eaf2 100644 --- a/lib/service/walletApi.dart +++ b/lib/service/walletApi.dart @@ -5,7 +5,6 @@ import 'package:http/http.dart'; class WalletApi { static const String _endpoint = 'https://api.polkawallet.io'; - static const String _karEndpoint = 'https://crowdloan-api.laminar.codes'; static const String _jsCodeStorageKey = 'js_service_'; static const String _jsCodeStorageVersionKey = 'js_service_version_'; @@ -129,9 +128,9 @@ class WalletApi { } } - static Future getKarCrowdLoanStatement() async { + static Future getKarCrowdLoanStatement(String endpoint) async { try { - final res = await get('$_karEndpoint/statement'); + final res = await get('https://$endpoint/statement'); if (res == null) { return null; } else { @@ -143,9 +142,10 @@ class WalletApi { } } - static Future getKarCrowdLoanHistory(String address) async { + static Future getKarCrowdLoanHistory( + String address, String endpoint) async { try { - final res = await get('$_karEndpoint/contributions/$address'); + final res = await get('https://$endpoint/contributions/$address'); if (res == null) { return null; } else { @@ -158,9 +158,9 @@ class WalletApi { } } - static Future verifyKarReferralCode(String code) async { + static Future verifyKarReferralCode(String code, String endpoint) async { try { - final res = await get('$_karEndpoint/referral/$code'); + final res = await get('https://$endpoint/referral/$code'); if (res == null) { return null; } else { @@ -173,19 +173,21 @@ class WalletApi { } static Future postKarCrowdLoan(String address, BigInt amount, - String email, String referral, String signature) async { + String email, String referral, String signature, String endpoint) async { final headers = {"Content-type": "application/json", "Accept": "*/*"}; final body = { "address": address, "amount": amount.toString(), - "email": email, "signature": signature, }; + if (email.isNotEmpty) { + body.addAll({"email": email}); + } if (referral.isNotEmpty) { body.addAll({"referral": referral}); } try { - final res = await post('$_karEndpoint/sign', + final res = await post('https://$endpoint/verify', headers: headers, body: jsonEncode(body)); if (res == null) { return null; @@ -198,7 +200,7 @@ class WalletApi { } } - static Future postKarSubscribe(String email) async { + static Future postKarSubscribe(String email, String subscribeId) async { final headers = {"Content-type": "application/json", "Accept": "*/*"}; final body = { "fields": [ @@ -207,7 +209,7 @@ class WalletApi { }; try { final res = await post( - 'https://api.hsforms.com/submissions/v3/integration/submit/7522932/fc605148-482f-4302-a8d2-cece3251f7fc', + 'https://api.hsforms.com/submissions/v3/integration/submit/7522932/$subscribeId', headers: headers, body: jsonEncode(body)); if (res == null) { diff --git a/lib/utils/i18n/en/public.dart b/lib/utils/i18n/en/public.dart index dea4a86e..347a91f1 100644 --- a/lib/utils/i18n/en/public.dart +++ b/lib/utils/i18n/en/public.dart @@ -12,10 +12,11 @@ const Map enPublic = { 'auction.term.2': 'Privacy Policy', 'auction.accept': 'Accept & Sign', 'auction.contribute': 'Contribute', - 'auction.email': 'Email', - 'auction.amount': 'Amount to Contribute (KSM)', + 'auction.email': 'Email(optional)', + 'auction.amount': 'Amount', + 'auction.amount1': 'Amount to Contribute (KSM)', 'auction.balance': 'Available', - 'auction.referral': 'Referral Code (optional)', + 'auction.referral': 'Referral Code(optional)', 'auction.estimate': 'Estimated KAR Paradrop', 'auction.note': 'If Karura wins the auction, KAR rewards will be distributed upon genesis. Otherwise, the KSM locked will automatically bid for the next available auction. Check the Terms & Conditions for details.', diff --git a/lib/utils/i18n/zh/assets.dart b/lib/utils/i18n/zh/assets.dart index 195684c4..c208f0af 100644 --- a/lib/utils/i18n/zh/assets.dart +++ b/lib/utils/i18n/zh/assets.dart @@ -18,7 +18,7 @@ const Map zhAssets = { 'amount.exist.msg': '账户在网络上存活所需要的最小余额。', 'currency': '币种', 'currency.select': '选择币种', - 'make': '添加转账', + 'make': '发起转账', 'balance': '余额', 'locked': '锁定', 'available': '可用', diff --git a/lib/utils/i18n/zh/public.dart b/lib/utils/i18n/zh/public.dart index 07dec928..2860d65c 100644 --- a/lib/utils/i18n/zh/public.dart +++ b/lib/utils/i18n/zh/public.dart @@ -12,8 +12,9 @@ const Map zhPublic = { 'auction.term.2': '隐私条款', 'auction.accept': '接受并签名', 'auction.contribute': '支持竞拍', - 'auction.email': '邮箱', - 'auction.amount': '贡献数量(KSM)', + 'auction.email': '邮箱(选填)', + 'auction.amount': '数量', + 'auction.amount1': '贡献数量(KSM)', 'auction.balance': '可用余额', 'auction.referral': '邀请码(选填)', 'auction.estimate': '预估奖励(KAR)', diff --git a/pubspec.lock b/pubspec.lock index 1d5476e5..f2f68bd3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -127,6 +127,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0" + charts_flutter: + dependency: transitive + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0" checked_yaml: dependency: transitive description: @@ -168,7 +182,7 @@ packages: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+5" + version: "2.0.2" connectivity_for_web: dependency: transitive description: @@ -366,20 +380,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.4" + gql_dedupe_link: + dependency: transitive + description: + name: gql_dedupe_link + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.10" + gql_error_link: + dependency: transitive + description: + name: gql_error_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1-alpha+1601131172858" + gql_exec: + dependency: transitive + description: + name: gql_exec + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.5" + gql_http_link: + dependency: transitive + description: + name: gql_http_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" + gql_link: + dependency: transitive + description: + name: gql_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.1" + gql_transform_link: + dependency: transitive + description: + name: gql_transform_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" graphql: dependency: transitive description: name: graphql url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.0.1" graphql_flutter: dependency: transitive description: name: graphql_flutter url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.0.1" graphs: dependency: transitive description: @@ -387,6 +443,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.0" + hive: + dependency: transitive + description: + name: hive + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4+1" http: dependency: transitive description: @@ -499,6 +562,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.5.1" + liquid_progress_indicator: + dependency: transitive + description: + name: liquid_progress_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" logging: dependency: transitive description: @@ -555,6 +625,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + normalize: + dependency: transitive + description: + name: normalize + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.7" package_config: dependency: transitive description: @@ -671,8 +748,8 @@ packages: dependency: "direct main" description: path: "." - ref: fd16946d18c84078e96c64e3dbc1b93061dc6802 - resolved-ref: fd16946d18c84078e96c64e3dbc1b93061dc6802 + ref: "28aff6c52cbc4fbdf22120f191b073ffd1faf3a9" + resolved-ref: "28aff6c52cbc4fbdf22120f191b073ffd1faf3a9" url: "https://github.com/AcalaNetwork/polkawallet_plugin_acala.git" source: git version: "0.1.6" @@ -680,8 +757,8 @@ packages: dependency: "direct main" description: path: "." - ref: "225f62ae68adfef0d50bdb4d2eb6a34e4f518269" - resolved-ref: "225f62ae68adfef0d50bdb4d2eb6a34e4f518269" + ref: "0692cbb02da9cfd59eae2856e6e2819c072d4cd3" + resolved-ref: "0692cbb02da9cfd59eae2856e6e2819c072d4cd3" url: "https://github.com/true-eye/polkawallet_plugin_chainx.git" source: git version: "0.0.1" @@ -689,26 +766,26 @@ packages: dependency: "direct main" description: path: "." - ref: e05ce06f0a459ae0879a7adf56295d5e25eba8be - resolved-ref: e05ce06f0a459ae0879a7adf56295d5e25eba8be + ref: "4e0d7dffee5222c493f70a310ce5f9b5b24f4d90" + resolved-ref: "4e0d7dffee5222c493f70a310ce5f9b5b24f4d90" url: "https://github.com/remzrn/polkawallet_plugin_edgeware.git" source: git - version: "0.0.1" + version: "0.1.6" polkawallet_plugin_kusama: dependency: "direct main" description: path: "." - ref: "5bd378a753df123014ed3dddd68ec644c23c6543" - resolved-ref: "5bd378a753df123014ed3dddd68ec644c23c6543" + ref: "8add53266eb2bc65aa94b378f0daeb456e39eee7" + resolved-ref: "8add53266eb2bc65aa94b378f0daeb456e39eee7" url: "https://github.com/polkawallet-io/polkawallet_plugin_kusama.git" source: git - version: "0.1.6" + version: "0.1.7" polkawallet_plugin_laminar: dependency: "direct main" description: path: "." - ref: "3011d23be5c005e088ddd7ce6c58d82ef31dca36" - resolved-ref: "3011d23be5c005e088ddd7ce6c58d82ef31dca36" + ref: "73b623a259fa6c31c0999625ebbfa7cdb84a6dcd" + resolved-ref: "73b623a259fa6c31c0999625ebbfa7cdb84a6dcd" url: "https://github.com/polkawallet-io/polkawallet_plugin_laminar.git" source: git version: "0.1.5" @@ -718,16 +795,16 @@ packages: name: polkawallet_sdk url: "https://pub.dartlang.org" source: hosted - version: "0.1.6" + version: "0.1.7" polkawallet_ui: dependency: "direct overridden" description: path: "." - ref: "797d2184fb18335895b95069f94b880b539d23f6" - resolved-ref: "797d2184fb18335895b95069f94b880b539d23f6" + ref: b68da4b7d56dec37ddc34844b204fd095a00f7df + resolved-ref: b68da4b7d56dec37ddc34844b204fd095a00f7df url: "https://github.com/polkawallet-io/ui.git" source: git - version: "0.1.5" + version: "0.1.7" pool: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a16d7da0..e8bd29cd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.0.4+2041 +version: 2.0.5+2053 environment: sdk: ">=2.10.0 <3.0.0" @@ -35,23 +35,23 @@ dependencies: polkawallet_plugin_kusama: git: url: https://github.com/polkawallet-io/polkawallet_plugin_kusama.git - ref: 5bd378a753df123014ed3dddd68ec644c23c6543 + ref: 8add53266eb2bc65aa94b378f0daeb456e39eee7 polkawallet_plugin_acala: git: url: https://github.com/AcalaNetwork/polkawallet_plugin_acala.git - ref: fd16946d18c84078e96c64e3dbc1b93061dc6802 + ref: 28aff6c52cbc4fbdf22120f191b073ffd1faf3a9 polkawallet_plugin_laminar: git: url: https://github.com/polkawallet-io/polkawallet_plugin_laminar.git - ref: 3011d23be5c005e088ddd7ce6c58d82ef31dca36 + ref: 73b623a259fa6c31c0999625ebbfa7cdb84a6dcd polkawallet_plugin_chainx: git: url: https://github.com/true-eye/polkawallet_plugin_chainx.git - ref: 225f62ae68adfef0d50bdb4d2eb6a34e4f518269 + ref: 0692cbb02da9cfd59eae2856e6e2819c072d4cd3 polkawallet_plugin_edgeware: git: url: https://github.com/remzrn/polkawallet_plugin_edgeware.git - ref: e05ce06f0a459ae0879a7adf56295d5e25eba8be + ref: 4e0d7dffee5222c493f70a310ce5f9b5b24f4d90 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -71,9 +71,9 @@ dependency_overrides: polkawallet_ui: git: url: https://github.com/polkawallet-io/ui.git - ref: 797d2184fb18335895b95069f94b880b539d23f6 + ref: b68da4b7d56dec37ddc34844b204fd095a00f7df # path: ../../coding/polkawallet/ui - polkawallet_sdk: ^0.1.6 + polkawallet_sdk: ^0.1.7 # polkawallet_sdk: # path: ../../coding/polkawallet/sdk @@ -127,6 +127,7 @@ flutter: - assets/images/public/banner_kar_plo.png - assets/images/public/kar_bg.png - assets/images/public/kar_logo.png + - assets/images/public/kar_crowd_loan.jpg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware.