From 2fadc5e57e8f5a7189c7728a2f49f1db77875bf8 Mon Sep 17 00:00:00 2001 From: shawn Date: Wed, 7 Feb 2024 21:31:42 +0800 Subject: [PATCH 1/5] CHANGELOG.md update --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ee703c..d730cd43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# [3.6.1-beta] +20240207 +1. bridge update. +2. acala/karura plugin update. + # [3.6.0-beta] 20240112 1. update DApp browser. From 311a3ae9de2361f637e7f62e5f484d5db1da5553 Mon Sep 17 00:00:00 2001 From: shawn Date: Wed, 21 Feb 2024 11:44:58 +0800 Subject: [PATCH 2/5] add XCM delivery fee support for bridge --- lib/pages/bridge/bridgePage.dart | 26 ++++++++++++++++++++++++++ lib/utils/i18n/en/public.dart | 1 + lib/utils/i18n/zh/public.dart | 1 + pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/lib/pages/bridge/bridgePage.dart b/lib/pages/bridge/bridgePage.dart index 4d5ed200..1d99558b 100644 --- a/lib/pages/bridge/bridgePage.dart +++ b/lib/pages/bridge/bridgePage.dart @@ -778,6 +778,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..32979939 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1100,10 +1100,10 @@ packages: dependency: "direct main" description: name: polkawallet_sdk - sha256: ad7482c43c5495f1cedbadea22791e90dd677d1044fd5ad220fb02f2ba7b162b + sha256: "789d7ae71770b0b6a44b827dc7664de58811c42dc66d9c3ce2c82480f71cda03" url: "https://pub.dev" source: hosted - version: "0.5.8+8" + version: "0.5.9" polkawallet_ui: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 9d64148f..21d50906 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 # polkawallet_ui: # path: ../../coding/polkawallet/ui # polkawallet_sdk: From abbb0b4fc73639855088e974ec49a1f54e58673f Mon Sep 17 00:00:00 2001 From: shawn Date: Mon, 11 Mar 2024 21:43:19 +0800 Subject: [PATCH 3/5] fix toAccount warning issue bridging to moonbeam --- lib/pages/bridge/bridgePage.dart | 35 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/pages/bridge/bridgePage.dart b/lib/pages/bridge/bridgePage.dart index 1d99558b..655f5689 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,10 @@ class _BridgePageState extends State { }, ), ErrorMessage( - !_useEVMAccount() - ? _accountToWarn ?? - (_accountToFocus - ? dic['bridge.address.warn'] - : null) - : null, + _accountToWarn ?? + (_accountToFocus + ? dic['bridge.address.warn'] + : null), margin: const EdgeInsets.only(left: 8), ), ], From 3f8d2b0e782996e75c84d031718a30d116f5896c Mon Sep 17 00:00:00 2001 From: shawn Date: Mon, 18 Mar 2024 19:01:02 +0800 Subject: [PATCH 4/5] bridge address input warning update --- lib/pages/bridge/bridgePage.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/bridge/bridgePage.dart b/lib/pages/bridge/bridgePage.dart index 655f5689..8f434f48 100644 --- a/lib/pages/bridge/bridgePage.dart +++ b/lib/pages/bridge/bridgePage.dart @@ -696,7 +696,8 @@ class _BridgePageState extends State { ), ErrorMessage( _accountToWarn ?? - (_accountToFocus + ((_accountToFocus && + !_useEVMAccount()) ? dic['bridge.address.warn'] : null), margin: const EdgeInsets.only(left: 8), From d6fc95f63e4f64a84553f1660cb351637dcdc9e3 Mon Sep 17 00:00:00 2001 From: shawn Date: Mon, 18 Mar 2024 19:42:50 +0800 Subject: [PATCH 5/5] bump polkawallet_sdk: 0.5.9+4 --- CHANGELOG.md | 5 +++++ ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ pubspec.lock | 4 ++-- pubspec.yaml | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d730cd43..2584db38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# [3.6.2-beta] +20240318 +1. bridge update. +2. polkadot/kusama plugin update. + # [3.6.1-beta] 20240207 1. bridge update. 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/pubspec.lock b/pubspec.lock index 32979939..223eaebb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1100,10 +1100,10 @@ packages: dependency: "direct main" description: name: polkawallet_sdk - sha256: "789d7ae71770b0b6a44b827dc7664de58811c42dc66d9c3ce2c82480f71cda03" + sha256: "65278e48fd10db1e8b4f682112ccbfa68dda311546b70dc9206e98d0fd5adf8f" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "0.5.9+4" polkawallet_ui: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 21d50906..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.9 + polkawallet_sdk: ^0.5.9+4 # polkawallet_ui: # path: ../../coding/polkawallet/ui # polkawallet_sdk: