Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 3621 #442

Merged
merged 5 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# [3.6.2-beta]
20240318
1. bridge update.
2. polkadot/kusama plugin update.

# [3.6.1-beta]
20240207
1. bridge update.
2. acala/karura plugin update.

# [3.6.0-beta]
20240112
1. update DApp browser.
Expand Down
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3611;
CURRENT_PROJECT_VERSION = 3621;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
Expand All @@ -371,7 +371,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -500,7 +500,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3611;
CURRENT_PROJECT_VERSION = 3621;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
Expand All @@ -519,7 +519,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -541,7 +541,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3611;
CURRENT_PROJECT_VERSION = 3621;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
Expand All @@ -560,7 +560,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
62 changes: 53 additions & 9 deletions lib/pages/bridge/bridgePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ class _BridgePageState extends State<BridgePage> {
}

final config = await widget.service.plugin.sdk.api.bridge
.getAmountInputConfig(_chainFrom, _chainTo, _token, _accountTo.address,
.getAmountInputConfig(
_chainFrom,
_chainTo,
_token,
_useEVMAccount()
? '0x0000000000000000000000000000000000000000'
: _accountTo.address,
widget.service.keyring.current.address);
setState(() {
_config = config;
Expand Down Expand Up @@ -388,6 +394,13 @@ class _BridgePageState extends State<BridgePage> {
Future<String> _checkAccountTo(KeyPairData acc) async {
if (_props == null) return null;

final error =
I18n.of(context).getDic(i18n_full_dic_ui, 'account')['ss58.mismatch'];
if ((_useEVMAccount() && acc.address?.startsWith('0x') == false) ||
(!_useEVMAccount() && acc.address?.startsWith('0x') == true)) {
return error;
}

if (widget.service.keyring.allWithContacts
.indexWhere((e) => e.pubKey == acc.pubKey) >
-1 ||
Expand All @@ -398,8 +411,6 @@ class _BridgePageState extends State<BridgePage> {
}

if (acc.address?.startsWith('0x') == false) {
final error =
I18n.of(context).getDic(i18n_full_dic_ui, 'account')['ss58.mismatch'];
final res = await widget.service.plugin.sdk.api.bridge
.checkAddressFormat(acc.address, _chainInfo[_chainTo].ss58Prefix);
if (res != null && !res) {
Expand Down Expand Up @@ -441,6 +452,14 @@ class _BridgePageState extends State<BridgePage> {

Future<XcmTxConfirmParams> _getTxParams(
Widget chainFromIcon, TokenBalanceData feeToken) async {
final toError = await _checkAccountTo(_accountTo);
if (toError != null) {
setState(() {
_accountToWarn = toError;
});
return null;
}

if (_amountError == null &&
_amountCtrl.text.trim().isNotEmpty &&
_formKey.currentState.validate() &&
Expand Down Expand Up @@ -676,12 +695,11 @@ class _BridgePageState extends State<BridgePage> {
},
),
ErrorMessage(
!_useEVMAccount()
? _accountToWarn ??
(_accountToFocus
? dic['bridge.address.warn']
: null)
: null,
_accountToWarn ??
((_accountToFocus &&
!_useEVMAccount())
? dic['bridge.address.warn']
: null),
margin: const EdgeInsets.only(left: 8),
),
],
Expand Down Expand Up @@ -778,6 +796,32 @@ class _BridgePageState extends State<BridgePage> {
],
),
),
Visibility(
visible: _config != null &&
BigInt.parse(_config?.xcmFee ?? '0') >
BigInt.zero,
child: Padding(
padding: const EdgeInsets.only(top: 8),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Padding(
padding:
const EdgeInsets.only(right: 4),
child: Text(
'${dic['hub.xcm.fee']} ($_chainFrom)',
style: feeStyle),
),
),
Text(
'${Fmt.priceFloorBigInt(BigInt.parse(_config?.xcmFee ?? '0'), feeToken.decimals ?? 12, lengthMax: 6)} ${AppFmt.tokenView(feeToken.symbol ?? '')}',
style: feeStyle)
],
),
),
),
Padding(
padding:
EdgeInsets.only(top: 150.h, bottom: 38),
Expand Down
1 change: 1 addition & 0 deletions lib/utils/i18n/en/public.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const Map<String, String> enPublic = {
'hub.selectToken': 'SelectToken',
'hub.origin.transfer.fee': 'Origin Chain Transfer Fee',
'hub.destination.transfer.fee': 'Destination Chain Transfer Fee',
'hub.xcm.fee': 'Delivery Fee',
'hub.transfer': 'Transfer',
'hub.cover.bridge':
'A Bridge to connect different networks. You can transfer tokens across the parachains.',
Expand Down
1 change: 1 addition & 0 deletions lib/utils/i18n/zh/public.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const Map<String, String> zhPublic = {
'hub.selectToken': '选择代币',
'hub.origin.transfer.fee': '源链转账手续费',
'hub.destination.transfer.fee': '目的链转账手续费',
'hub.xcm.fee': '跨链费用',
'hub.transfer': '转账',
'hub.cover.bridge': '桥接不同的网络,您可以跨平行链转移代币。',
'input.empty': '输入不能为空',
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1100,10 +1100,10 @@ packages:
dependency: "direct main"
description:
name: polkawallet_sdk
sha256: ad7482c43c5495f1cedbadea22791e90dd677d1044fd5ad220fb02f2ba7b162b
sha256: "65278e48fd10db1e8b4f682112ccbfa68dda311546b70dc9206e98d0fd5adf8f"
url: "https://pub.dev"
source: hosted
version: "0.5.8+8"
version: "0.5.9+4"
polkawallet_ui:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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: 3.6.1+3611
version: 3.6.2+3621

environment:
sdk: ">=2.10.0 <3.0.0"
Expand Down Expand Up @@ -112,7 +112,7 @@ dependency_overrides:
# polkawallet_plugin_evm:
# path: ../../coding/polkawallet/polkawallet_plugin_evm
polkawallet_ui: ^0.5.5+1
polkawallet_sdk: ^0.5.8+8
polkawallet_sdk: ^0.5.9+4
# polkawallet_ui:
# path: ../../coding/polkawallet/ui
# polkawallet_sdk:
Expand Down