diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ee703c..2584db38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5316e847..101b7025 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -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; @@ -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)"; @@ -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; @@ -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 = ""; @@ -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; @@ -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)"; diff --git a/lib/pages/bridge/bridgePage.dart b/lib/pages/bridge/bridgePage.dart index 4d5ed200..8f434f48 100644 --- a/lib/pages/bridge/bridgePage.dart +++ b/lib/pages/bridge/bridgePage.dart @@ -316,7 +316,13 @@ class _BridgePageState extends State { } 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; @@ -388,6 +394,13 @@ class _BridgePageState extends State { Future _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 || @@ -398,8 +411,6 @@ class _BridgePageState extends State { } 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) { @@ -441,6 +452,14 @@ class _BridgePageState extends State { Future _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() && @@ -676,12 +695,11 @@ class _BridgePageState extends State { }, ), ErrorMessage( - !_useEVMAccount() - ? _accountToWarn ?? - (_accountToFocus - ? dic['bridge.address.warn'] - : null) - : null, + _accountToWarn ?? + ((_accountToFocus && + !_useEVMAccount()) + ? dic['bridge.address.warn'] + : null), margin: const EdgeInsets.only(left: 8), ), ], @@ -778,6 +796,32 @@ class _BridgePageState extends State { ], ), ), + 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), diff --git a/lib/utils/i18n/en/public.dart b/lib/utils/i18n/en/public.dart index 602bb2a4..16dbce73 100644 --- a/lib/utils/i18n/en/public.dart +++ b/lib/utils/i18n/en/public.dart @@ -129,6 +129,7 @@ const Map 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.', diff --git a/lib/utils/i18n/zh/public.dart b/lib/utils/i18n/zh/public.dart index 26ed4a56..ab7ecebe 100644 --- a/lib/utils/i18n/zh/public.dart +++ b/lib/utils/i18n/zh/public.dart @@ -118,6 +118,7 @@ const Map zhPublic = { 'hub.selectToken': '选择代币', 'hub.origin.transfer.fee': '源链转账手续费', 'hub.destination.transfer.fee': '目的链转账手续费', + 'hub.xcm.fee': '跨链费用', 'hub.transfer': '转账', 'hub.cover.bridge': '桥接不同的网络,您可以跨平行链转移代币。', 'input.empty': '输入不能为空', diff --git a/pubspec.lock b/pubspec.lock index e926d1bc..223eaebb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index 9d64148f..34b51e1b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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" @@ -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: