Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Apr 24, 2021
2 parents bd4c586 + ffa9c9c commit 85708b1
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 65 deletions.
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
5 changes: 2 additions & 3 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class _WalletAppState extends State<WalletApp> {
Future<void> _startPlugin() async {
// _initWalletConnect();

_service.assets.fetchMarketPrice();

setState(() {
_connectedNode = null;
});
Expand Down Expand Up @@ -211,8 +213,6 @@ class _WalletAppState extends State<WalletApp> {
});

_startPlugin();

_service.assets.fetchMarketPrice();
}

Future<void> _changeToKusamaForKar() async {
Expand Down Expand Up @@ -331,7 +331,6 @@ class _WalletAppState extends State<WalletApp> {
);

_startPlugin();
_service.assets.fetchMarketPrice();
}

return _keyring.allAccounts.length;
Expand Down
4 changes: 2 additions & 2 deletions lib/common/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
3 changes: 2 additions & 1 deletion lib/pages/assets/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ class _AssetsState extends State<AssetsPage> {
child: ListTile(
leading: Container(
height: 36,
width: 45,
width: 37,
margin: EdgeInsets.only(right: 8),
child: widget.service.plugin.tokenIcons[symbol],
),
title: Text(symbol),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/assets/transfer/transferPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
14 changes: 4 additions & 10 deletions lib/pages/networkSelectPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
],
),
Expand Down
25 changes: 13 additions & 12 deletions lib/pages/profile/account/accountManagePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@ class _AccountManagePageState extends State<AccountManagePage> {
Future<void> _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);
Expand Down
11 changes: 6 additions & 5 deletions lib/service/apiAssets.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:app/service/index.dart';
import 'package:app/service/walletApi.dart';

class ApiAssets {
ApiAssets(this.apiRoot);
Expand Down Expand Up @@ -33,13 +34,13 @@ class ApiAssets {
Future<void> 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']);
}
}
15 changes: 15 additions & 0 deletions lib/service/walletApi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ class WalletApi {
}
}

static Future<Map> 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<Map> getKarCrowdLoanStarted() async {
try {
final res = await get('$_endpoint/crowdloan/health');
Expand Down
30 changes: 15 additions & 15 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -671,44 +671,44 @@ 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"
polkawallet_plugin_edgeware:
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"
polkawallet_plugin_kusama:
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"
Expand All @@ -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"
Expand Down
31 changes: 18 additions & 13 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down

0 comments on commit 85708b1

Please sign in to comment.