diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 31dfdb89..7a20942f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -370,7 +370,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -509,7 +509,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -542,7 +542,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; 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 f3eb241d..9c307b4f 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -168,6 +168,8 @@ class _WalletAppState extends State { Future _startPlugin() async { // _initWalletConnect(); + _service.assets.fetchMarketPrice(); + setState(() { _connectedNode = null; }); @@ -211,8 +213,6 @@ class _WalletAppState extends State { }); _startPlugin(); - - _service.assets.fetchMarketPrice(); } Future _changeToKusamaForKar() async { @@ -331,7 +331,6 @@ class _WalletAppState extends State { ); _startPlugin(); - _service.assets.fetchMarketPrice(); } return _keyring.allAccounts.length; diff --git a/lib/common/consts.dart b/lib/common/consts.dart index 344c53a8..b18fa9aa 100644 --- a/lib/common/consts.dart +++ b/lib/common/consts.dart @@ -15,8 +15,8 @@ const prefixList = [ /// app versions enum BuildTargets { apk, playStore, dev } -const String app_beta_version = 'v2.0.3-beta.2'; -const int app_beta_version_code = 2032; +const String app_beta_version = 'v2.0.4-beta.1'; +const int app_beta_version_code = 2041; const show_guide_status_key = 'show_guide_status'; const show_banner_status_key = 'show_banner_status'; diff --git a/lib/pages/assets/index.dart b/lib/pages/assets/index.dart index 7c9951ef..2fa17c73 100644 --- a/lib/pages/assets/index.dart +++ b/lib/pages/assets/index.dart @@ -362,7 +362,8 @@ class _AssetsState extends State { child: ListTile( leading: Container( height: 36, - width: 45, + width: 37, + margin: EdgeInsets.only(right: 8), child: widget.service.plugin.tokenIcons[symbol], ), title: Text(symbol), diff --git a/lib/pages/assets/transfer/transferPage.dart b/lib/pages/assets/transfer/transferPage.dart index 07230239..0603ad48 100644 --- a/lib/pages/assets/transfer/transferPage.dart +++ b/lib/pages/assets/transfer/transferPage.dart @@ -5,10 +5,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:polkawallet_plugin_acala/pages/loan/loanPage.dart'; import 'package:polkawallet_ui/components/addressInputField.dart'; import 'package:polkawallet_ui/components/currencyWithIcon.dart'; import 'package:polkawallet_ui/components/tapTooltip.dart'; +import 'package:polkawallet_ui/components/tokenIcon.dart'; import 'package:polkawallet_ui/components/txButton.dart'; import 'package:polkawallet_ui/pages/scanPage.dart'; import 'package:polkawallet_sdk/api/types/txInfoData.dart'; diff --git a/lib/pages/networkSelectPage.dart b/lib/pages/networkSelectPage.dart index 00f519ed..d1db636f 100644 --- a/lib/pages/networkSelectPage.dart +++ b/lib/pages/networkSelectPage.dart @@ -271,22 +271,16 @@ class _NetworkItemActive extends StatelessWidget { ), Container( padding: EdgeInsets.all(8), - child: SizedBox( - child: icon, - width: 28, - ), + child: SizedBox(child: icon, height: 28, width: 28), decoration: BoxDecoration( borderRadius: const BorderRadius.all(const Radius.circular(24)), color: Theme.of(context).cardColor, boxShadow: [ BoxShadow( color: Colors.black12, - blurRadius: 12.0, // has the effect of softening the shadow - spreadRadius: 0, // has the effect of extending the shadow - offset: Offset( - 6.0, // horizontal, move right 10 - 1.0, // vertical, move down 10 - ), + blurRadius: 12.0, + spreadRadius: 0, + offset: Offset(6.0, 1.0), ) ], ), diff --git a/lib/pages/profile/account/accountManagePage.dart b/lib/pages/profile/account/accountManagePage.dart index f7281ca4..1584ed9f 100644 --- a/lib/pages/profile/account/accountManagePage.dart +++ b/lib/pages/profile/account/accountManagePage.dart @@ -48,20 +48,21 @@ class _AccountManagePageState extends State { Future _updateBiometricAuth(bool enable) async { print('enable: $enable'); final pubKey = widget.service.keyring.current.pubKey; + final password = await showCupertinoDialog( + context: context, + builder: (_) { + return PasswordInputDialog( + widget.service.plugin.sdk.api, + title: Text( + I18n.of(context).getDic(i18n_full_dic_app, 'account')['unlock']), + account: widget.service.keyring.current, + ); + }, + ); + if (password == null) return; + bool result = !enable; if (enable) { - final password = await showCupertinoDialog( - context: context, - builder: (_) { - return PasswordInputDialog( - widget.service.plugin.sdk.api, - title: Text(I18n.of(context) - .getDic(i18n_full_dic_app, 'account')['unlock']), - account: widget.service.keyring.current, - ); - }, - ); - try { print('write: $password'); await _authStorage.write(password); diff --git a/lib/service/apiAssets.dart b/lib/service/apiAssets.dart index d14c7290..cbc7c7dc 100644 --- a/lib/service/apiAssets.dart +++ b/lib/service/apiAssets.dart @@ -1,4 +1,5 @@ import 'package:app/service/index.dart'; +import 'package:app/service/walletApi.dart'; class ApiAssets { ApiAssets(this.apiRoot); @@ -33,13 +34,13 @@ class ApiAssets { Future fetchMarketPrice() async { if (apiRoot.plugin.basic.isTestNet) return; - final Map res = - await apiRoot.subScan.fetchTokenPriceAsync(apiRoot.plugin.basic.name); - if (res['token'] == null) { + final res = await WalletApi.getTokenPrice(apiRoot.plugin.basic.name); + if (res == null || res['data'] == null) { print('fetch market price failed'); return; } - final String token = res['token'][0]; - apiRoot.store.assets.setMarketPrices(token, res['detail'][token]['price']); + final symbol = res['data']['token'][0]; + apiRoot.store.assets + .setMarketPrices(symbol, res['data']['detail'][symbol]['price']); } } diff --git a/lib/service/walletApi.dart b/lib/service/walletApi.dart index 9c8a0093..f207b03e 100644 --- a/lib/service/walletApi.dart +++ b/lib/service/walletApi.dart @@ -100,6 +100,21 @@ class WalletApi { } } + static Future getTokenPrice(String network) async { + final url = 'https://${network.toLowerCase()}.subscan.io/api/scan/token'; + try { + Response res = await get(url); + if (res == null) { + return null; + } else { + return jsonDecode(utf8.decode(res.bodyBytes)); + } + } catch (err) { + print(err); + return null; + } + } + static Future getKarCrowdLoanStarted() async { try { final res = await get('$_endpoint/crowdloan/health'); diff --git a/pubspec.lock b/pubspec.lock index 63978428..1d5476e5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -671,17 +671,17 @@ packages: dependency: "direct main" description: path: "." - ref: "8714c27a4f46e3f0277ab58b42eea547f7d33095" - resolved-ref: "8714c27a4f46e3f0277ab58b42eea547f7d33095" + ref: fd16946d18c84078e96c64e3dbc1b93061dc6802 + resolved-ref: fd16946d18c84078e96c64e3dbc1b93061dc6802 url: "https://github.com/AcalaNetwork/polkawallet_plugin_acala.git" source: git - version: "0.1.3" + version: "0.1.6" polkawallet_plugin_chainx: dependency: "direct main" description: path: "." - ref: "07b601d0aaae0b173e7a18006f7502b9bb55b32d" - resolved-ref: "07b601d0aaae0b173e7a18006f7502b9bb55b32d" + ref: "225f62ae68adfef0d50bdb4d2eb6a34e4f518269" + resolved-ref: "225f62ae68adfef0d50bdb4d2eb6a34e4f518269" url: "https://github.com/true-eye/polkawallet_plugin_chainx.git" source: git version: "0.0.1" @@ -689,8 +689,8 @@ packages: dependency: "direct main" description: path: "." - ref: acdfd8bddce2075542e4678ef55855805700c752 - resolved-ref: acdfd8bddce2075542e4678ef55855805700c752 + ref: e05ce06f0a459ae0879a7adf56295d5e25eba8be + resolved-ref: e05ce06f0a459ae0879a7adf56295d5e25eba8be url: "https://github.com/remzrn/polkawallet_plugin_edgeware.git" source: git version: "0.0.1" @@ -698,17 +698,17 @@ packages: dependency: "direct main" description: path: "." - ref: a4ae23cc229016babf82fb0e6c85a6cb46ec16a3 - resolved-ref: a4ae23cc229016babf82fb0e6c85a6cb46ec16a3 + ref: "5bd378a753df123014ed3dddd68ec644c23c6543" + resolved-ref: "5bd378a753df123014ed3dddd68ec644c23c6543" url: "https://github.com/polkawallet-io/polkawallet_plugin_kusama.git" source: git - version: "0.1.4" + version: "0.1.6" polkawallet_plugin_laminar: dependency: "direct main" description: path: "." - ref: a6bcda75198f64b70e0f13f6c71f067b72d536b0 - resolved-ref: a6bcda75198f64b70e0f13f6c71f067b72d536b0 + ref: "3011d23be5c005e088ddd7ce6c58d82ef31dca36" + resolved-ref: "3011d23be5c005e088ddd7ce6c58d82ef31dca36" url: "https://github.com/polkawallet-io/polkawallet_plugin_laminar.git" source: git version: "0.1.5" @@ -718,13 +718,13 @@ packages: name: polkawallet_sdk url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.6" polkawallet_ui: dependency: "direct overridden" description: path: "." - ref: "51ebe9ffe2c9a0c524aadffc03cbe413d891fa57" - resolved-ref: "51ebe9ffe2c9a0c524aadffc03cbe413d891fa57" + ref: "797d2184fb18335895b95069f94b880b539d23f6" + resolved-ref: "797d2184fb18335895b95069f94b880b539d23f6" url: "https://github.com/polkawallet-io/ui.git" source: git version: "0.1.5" diff --git a/pubspec.yaml b/pubspec.yaml index fcca6b9b..a16d7da0 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.3+2032 +version: 2.0.4+2041 environment: sdk: ">=2.10.0 <3.0.0" @@ -35,40 +35,45 @@ dependencies: polkawallet_plugin_kusama: git: url: https://github.com/polkawallet-io/polkawallet_plugin_kusama.git - ref: a4ae23cc229016babf82fb0e6c85a6cb46ec16a3 -# path: ../../coding/polkawallet/polkawallet_plugin_kusama + ref: 5bd378a753df123014ed3dddd68ec644c23c6543 polkawallet_plugin_acala: git: url: https://github.com/AcalaNetwork/polkawallet_plugin_acala.git - ref: 8714c27a4f46e3f0277ab58b42eea547f7d33095 -# path: ../../coding/polkawallet/polkawallet_plugin_acala + ref: fd16946d18c84078e96c64e3dbc1b93061dc6802 polkawallet_plugin_laminar: git: url: https://github.com/polkawallet-io/polkawallet_plugin_laminar.git - ref: a6bcda75198f64b70e0f13f6c71f067b72d536b0 -# path: ../../coding/polkawallet/polkawallet_plugin_laminar + ref: 3011d23be5c005e088ddd7ce6c58d82ef31dca36 polkawallet_plugin_chainx: git: url: https://github.com/true-eye/polkawallet_plugin_chainx.git - ref: 07b601d0aaae0b173e7a18006f7502b9bb55b32d -# path: ../../coding/polkawallet/polkawallet_plugin_chainx + ref: 225f62ae68adfef0d50bdb4d2eb6a34e4f518269 polkawallet_plugin_edgeware: git: url: https://github.com/remzrn/polkawallet_plugin_edgeware.git - ref: acdfd8bddce2075542e4678ef55855805700c752 -# path: ../../coding/polkawallet/polkawallet_plugin_edgeware + ref: e05ce06f0a459ae0879a7adf56295d5e25eba8be # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 dependency_overrides: +# polkawallet_plugin_kusama: +# path: ../../coding/polkawallet/polkawallet_plugin_kusama +# polkawallet_plugin_acala: +# path: ../../coding/polkawallet/polkawallet_plugin_acala +# polkawallet_plugin_laminar: +# path: ../../coding/polkawallet/polkawallet_plugin_laminar +# polkawallet_plugin_chainx: +# path: ../../coding/polkawallet/polkawallet_plugin_chainx +# polkawallet_plugin_edgeware: +# path: ../../coding/polkawallet/polkawallet_plugin_edgeware polkawallet_ui: git: url: https://github.com/polkawallet-io/ui.git - ref: 51ebe9ffe2c9a0c524aadffc03cbe413d891fa57 + ref: 797d2184fb18335895b95069f94b880b539d23f6 # path: ../../coding/polkawallet/ui - polkawallet_sdk: ^0.1.5 + polkawallet_sdk: ^0.1.6 # polkawallet_sdk: # path: ../../coding/polkawallet/sdk