diff --git a/assets/images/dcr_icon.png b/assets/images/dcr_icon.png new file mode 100644 index 000000000..609873611 Binary files /dev/null and b/assets/images/dcr_icon.png differ diff --git a/assets/images/husd_icon.png b/assets/images/husd_icon.png new file mode 100644 index 000000000..071027099 Binary files /dev/null and b/assets/images/husd_icon.png differ diff --git a/assets/images/kmd_icon.png b/assets/images/kmd_icon.png new file mode 100644 index 000000000..dc07f5802 Binary files /dev/null and b/assets/images/kmd_icon.png differ diff --git a/assets/images/mana_icon.png b/assets/images/mana_icon.png new file mode 100644 index 000000000..ad9d7b1b1 Binary files /dev/null and b/assets/images/mana_icon.png differ diff --git a/assets/images/matic_icon.png b/assets/images/matic_icon.png new file mode 100644 index 000000000..7f5493343 Binary files /dev/null and b/assets/images/matic_icon.png differ diff --git a/assets/images/mkr_icon.png b/assets/images/mkr_icon.png new file mode 100644 index 000000000..66c06446d Binary files /dev/null and b/assets/images/mkr_icon.png differ diff --git a/assets/images/near_icon.png b/assets/images/near_icon.png new file mode 100644 index 000000000..667ea45c3 Binary files /dev/null and b/assets/images/near_icon.png differ diff --git a/assets/images/oxt_icon.png b/assets/images/oxt_icon.png new file mode 100644 index 000000000..43228e189 Binary files /dev/null and b/assets/images/oxt_icon.png differ diff --git a/assets/images/paxg_icon.png b/assets/images/paxg_icon.png new file mode 100644 index 000000000..17f093303 Binary files /dev/null and b/assets/images/paxg_icon.png differ diff --git a/assets/images/pivx_icon.png b/assets/images/pivx_icon.png new file mode 100644 index 000000000..0b3b80eb1 Binary files /dev/null and b/assets/images/pivx_icon.png differ diff --git a/assets/images/rune_icon.png b/assets/images/rune_icon.png new file mode 100644 index 000000000..96d8bf40c Binary files /dev/null and b/assets/images/rune_icon.png differ diff --git a/assets/images/rvn_icon.png b/assets/images/rvn_icon.png new file mode 100644 index 000000000..24c5c1d41 Binary files /dev/null and b/assets/images/rvn_icon.png differ diff --git a/assets/images/scrt_icon.png b/assets/images/scrt_icon.png new file mode 100644 index 000000000..ce38dcc58 Binary files /dev/null and b/assets/images/scrt_icon.png differ diff --git a/assets/images/stx_icon.png b/assets/images/stx_icon.png new file mode 100644 index 000000000..76571a7c8 Binary files /dev/null and b/assets/images/stx_icon.png differ diff --git a/assets/images/uni_icon.png b/assets/images/uni_icon.png new file mode 100644 index 000000000..01ffcf726 Binary files /dev/null and b/assets/images/uni_icon.png differ diff --git a/cw_core/lib/crypto_currency.dart b/cw_core/lib/crypto_currency.dart index 1da753667..c6e0c02c2 100644 --- a/cw_core/lib/crypto_currency.dart +++ b/cw_core/lib/crypto_currency.dart @@ -51,6 +51,23 @@ class CryptoCurrency extends EnumerableItem with Serializable { CryptoCurrency.zec, CryptoCurrency.zen, CryptoCurrency.xvg, + CryptoCurrency.usdcpoly, + CryptoCurrency.dcr, + CryptoCurrency.husd, + CryptoCurrency.kmd, + CryptoCurrency.mana, + CryptoCurrency.maticpoly, + CryptoCurrency.matic, + CryptoCurrency.mkr, + CryptoCurrency.near, + CryptoCurrency.oxt, + CryptoCurrency.paxg, + CryptoCurrency.pivx, + CryptoCurrency.rune, + CryptoCurrency.rvn, + CryptoCurrency.scrt, + CryptoCurrency.uni, + CryptoCurrency.stx, ]; static const xmr = CryptoCurrency(title: 'XMR', iconPath: 'assets/images/monero_icon.png', name: 'Monero', raw: 0); @@ -102,6 +119,26 @@ class CryptoCurrency extends EnumerableItem with Serializable { static const zen = CryptoCurrency(title: 'ZEN', iconPath: 'assets/images/zen_icon.png', raw: 44); static const xvg = CryptoCurrency(title: 'XVG', name: 'Verge', iconPath: 'assets/images/xvg_icon.png', raw: 45); + static const usdcpoly = CryptoCurrency(title: 'USDC', iconPath: 'assets/images/usdc_icon.png', tag: 'POLY', raw: 46); + static const dcr = CryptoCurrency(title: 'DCR', iconPath: 'assets/images/dcr_icon.png', raw: 47); + static const husd = CryptoCurrency(title: 'HUSD', iconPath: 'assets/images/husd_icon.png', tag: 'ETH', raw: 48); + static const kmd = CryptoCurrency(title: 'KMD', iconPath: 'assets/images/kmd_icon.png', raw: 49); + static const mana = CryptoCurrency(title: 'MANA', iconPath: 'assets/images/mana_icon.png', tag: 'ETH', raw: 50); + static const maticpoly = CryptoCurrency(title: 'MATIC', iconPath: 'assets/images/matic_icon.png', tag: 'POLY', raw: 51); + static const matic = CryptoCurrency(title: 'MATIC', iconPath: 'assets/images/matic_icon.png', tag: 'ETH', raw: 52); + static const mkr = CryptoCurrency(title: 'MKR', iconPath: 'assets/images/mkr_icon.png', tag: 'ETH', raw: 53); + static const near = CryptoCurrency(title: 'NEAR', iconPath: 'assets/images/near_icon.png', raw: 54); + static const oxt = CryptoCurrency(title: 'OXT', iconPath: 'assets/images/oxt_icon.png', tag: 'ETH', raw: 55); + static const paxg = CryptoCurrency(title: 'PAXG', iconPath: 'assets/images/paxg_icon.png', tag: 'ETH', raw: 56); + static const pivx = CryptoCurrency(title: 'PIVX', iconPath: 'assets/images/pivx_icon.png', raw: 57); + static const rune = CryptoCurrency(title: 'RUNE', iconPath: 'assets/images/rune_icon.png', raw: 58); + static const rvn = CryptoCurrency(title: 'RVN', iconPath: 'assets/images/rvn_icon.png', raw: 59); + static const scrt = CryptoCurrency(title: 'SCRT', iconPath: 'assets/images/scrt_icon.png', raw: 60); + static const uni = CryptoCurrency(title: 'UNI', iconPath: 'assets/images/uni_icon.png', tag: 'ETH', raw: 61); + static const stx = CryptoCurrency(title: 'STX', iconPath: 'assets/images/stx_icon.png', raw: 62); + + + static CryptoCurrency deserialize({required int raw}) { switch (raw) { case 0: @@ -196,6 +233,40 @@ class CryptoCurrency extends EnumerableItem with Serializable { return CryptoCurrency.zen; case 45: return CryptoCurrency.xvg; + case 46: + return CryptoCurrency.usdcpoly; + case 47: + return CryptoCurrency.dcr; + case 48: + return CryptoCurrency.husd; + case 49: + return CryptoCurrency.kmd; + case 50: + return CryptoCurrency.mana; + case 51: + return CryptoCurrency.maticpoly; + case 52: + return CryptoCurrency.matic; + case 53: + return CryptoCurrency.mkr; + case 54: + return CryptoCurrency.near; + case 55: + return CryptoCurrency.oxt; + case 56: + return CryptoCurrency.paxg; + case 57: + return CryptoCurrency.pivx; + case 58: + return CryptoCurrency.rune; + case 59: + return CryptoCurrency.rvn; + case 60: + return CryptoCurrency.scrt; + case 61: + return CryptoCurrency.uni; + case 62: + return CryptoCurrency.stx; default: throw Exception('Unexpected token: $raw for CryptoCurrency deserialize'); } @@ -295,6 +366,40 @@ class CryptoCurrency extends EnumerableItem with Serializable { return CryptoCurrency.zen; case 'xvg': return CryptoCurrency.xvg; + case 'usdcpoly': + return CryptoCurrency.usdcpoly; + case 'dcr': + return CryptoCurrency.dcr; + case 'husd': + return CryptoCurrency.husd; + case 'kmd': + return CryptoCurrency.kmd; + case 'mana': + return CryptoCurrency.mana; + case 'maticpoly': + return CryptoCurrency.maticpoly; + case 'matic': + return CryptoCurrency.matic; + case 'mkr': + return CryptoCurrency.mkr; + case 'near': + return CryptoCurrency.near; + case 'oxt': + return CryptoCurrency.oxt; + case 'paxg': + return CryptoCurrency.paxg; + case 'pivx': + return CryptoCurrency.pivx; + case 'rune': + return CryptoCurrency.rune; + case 'rvn': + return CryptoCurrency.rvn; + case 'scrt': + return CryptoCurrency.scrt; + case 'uni': + return CryptoCurrency.uni; + case 'stx': + return CryptoCurrency.stx; default: throw Exception('Unexpected token: $raw for CryptoCurrency fromString'); } diff --git a/lib/core/address_validator.dart b/lib/core/address_validator.dart index e3c4ed334..9d7b0e3b5 100644 --- a/lib/core/address_validator.dart +++ b/lib/core/address_validator.dart @@ -17,39 +17,25 @@ class AddressValidator extends TextValidator { case CryptoCurrency.ada: return '^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{104}\$' '|^[0-9a-zA-Z]{105}\$|^addr1[0-9a-zA-Z]{98}\$'; - case CryptoCurrency.ape: - return '0x[0-9a-zA-Z]'; - case CryptoCurrency.avaxc: - return '0x[0-9a-zA-Z]'; - case CryptoCurrency.bch: - return '[0-9a-zA-Z]'; - case CryptoCurrency.bnb: - return '[0-9a-zA-Z]'; case CryptoCurrency.btc: return '^1[0-9a-zA-Z]{32}\$|^1[0-9a-zA-Z]{33}\$|^3[0-9a-zA-Z]{32}\$' '|^3[0-9a-zA-Z]{33}\$|^bc1[0-9a-zA-Z]{39}\$|^bc1[0-9a-zA-Z]{59}\$'; - case CryptoCurrency.dai: - return '[0-9a-zA-Z]'; - case CryptoCurrency.dash: - return '[0-9a-zA-Z]'; - case CryptoCurrency.eos: - return '[0-9a-zA-Z]'; - case CryptoCurrency.eth: - return '0x[0-9a-zA-Z]'; - case CryptoCurrency.ltc: - return '[0-9a-zA-Z]'; case CryptoCurrency.nano: return '[0-9a-zA-Z_]'; - case CryptoCurrency.trx: - return '[0-9a-zA-Z]'; case CryptoCurrency.usdc: + case CryptoCurrency.usdcpoly: + case CryptoCurrency.husd: + case CryptoCurrency.ape: + case CryptoCurrency.avaxc: + case CryptoCurrency.eth: + case CryptoCurrency.mana: + case CryptoCurrency.matic: + case CryptoCurrency.maticpoly: + case CryptoCurrency.mkr: + case CryptoCurrency.oxt: + case CryptoCurrency.paxg: + case CryptoCurrency.uni: return '0x[0-9a-zA-Z]'; - case CryptoCurrency.usdt: - return '[0-9a-zA-Z]'; - case CryptoCurrency.usdterc20: - return '[0-9a-zA-Z]'; - case CryptoCurrency.xlm: - return '[0-9a-zA-Z]'; case CryptoCurrency.xrp: return '^[0-9a-zA-Z]{34}\$|^X[0-9a-zA-Z]{46}\$'; case CryptoCurrency.xhv: @@ -67,6 +53,16 @@ class AddressValidator extends TextValidator { case CryptoCurrency.xnok: case CryptoCurrency.xnzd: case CryptoCurrency.xusd: + case CryptoCurrency.usdt: + case CryptoCurrency.usdterc20: + case CryptoCurrency.xlm: + case CryptoCurrency.trx: + case CryptoCurrency.dai: + case CryptoCurrency.dash: + case CryptoCurrency.eos: + case CryptoCurrency.ltc: + case CryptoCurrency.bch: + case CryptoCurrency.bnb: return '[0-9a-zA-Z]'; case CryptoCurrency.hbar: return '[0-9a-zA-Z.]'; @@ -74,6 +70,22 @@ class AddressValidator extends TextValidator { return '^zs[0-9a-zA-Z]{75}'; case CryptoCurrency.zec: return '^t1[0-9a-zA-Z]{33}\$|^t3[0-9a-zA-Z]{33}\$'; + case CryptoCurrency.dcr: + return 'D[ksecS]([0-9a-zA-Z])+'; + case CryptoCurrency.rvn: + return '[Rr]([1-9a-km-zA-HJ-NP-Z]){33}'; + case CryptoCurrency.near: + return '[0-9a-f]{64}'; + case CryptoCurrency.rune: + return 'thor1[0-9a-z]{38}'; + case CryptoCurrency.scrt: + return 'secret1[0-9a-z]{38}'; + case CryptoCurrency.stx: + return 'S[MP][0-9a-zA-Z]+'; + case CryptoCurrency.kmd: + return 'R[0-9a-zA-Z]{33}'; + case CryptoCurrency.pivx: + return 'D([1-9a-km-zA-HJ-NP-Z]){33}'; default: return '[0-9a-zA-Z]'; } @@ -160,6 +172,30 @@ class AddressValidator extends TextValidator { return null; case CryptoCurrency.zec: return null; + case CryptoCurrency.kmd: + case CryptoCurrency.pivx: + case CryptoCurrency.rvn: + return [34]; + case CryptoCurrency.dcr: + return [35]; + case CryptoCurrency.stx: + return [40, 41, 42]; + case CryptoCurrency.usdcpoly: + case CryptoCurrency.husd: + case CryptoCurrency.mana: + case CryptoCurrency.matic: + case CryptoCurrency.maticpoly: + case CryptoCurrency.mkr: + case CryptoCurrency.oxt: + case CryptoCurrency.paxg: + case CryptoCurrency.uni: + return [42]; + case CryptoCurrency.rune: + return [43]; + case CryptoCurrency.scrt: + return [45]; + case CryptoCurrency.near: + return [64]; default: return []; } diff --git a/lib/exchange/sideshift/sideshift_exchange_provider.dart b/lib/exchange/sideshift/sideshift_exchange_provider.dart index ff489aa83..a732f7ef2 100644 --- a/lib/exchange/sideshift/sideshift_exchange_provider.dart +++ b/lib/exchange/sideshift/sideshift_exchange_provider.dart @@ -16,16 +16,7 @@ import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; class SideShiftExchangeProvider extends ExchangeProvider { - SideShiftExchangeProvider() - : super( - pairList: CryptoCurrency.all - .where((i) => i != CryptoCurrency.xhv) - .map((i) => CryptoCurrency.all - .where((i) => i != CryptoCurrency.xhv) - .map((k) => ExchangePair(from: i, to: k, reverse: true)) - .where((c) => c != null)) - .expand((i) => i) - .toList()); + SideShiftExchangeProvider() : super(pairList: _supportedPairs()); static const affiliateId = secrets.sideShiftAffiliateId; static const apiBaseUrl = 'https://sideshift.ai/api'; @@ -34,6 +25,35 @@ class SideShiftExchangeProvider extends ExchangeProvider { static const quotePath = '/v1/quotes'; static const permissionPath = '/v1/permissions'; + static const List _notSupported = [ + CryptoCurrency.xhv, + CryptoCurrency.dcr, + CryptoCurrency.husd, + CryptoCurrency.kmd, + CryptoCurrency.mkr, + CryptoCurrency.near, + CryptoCurrency.oxt, + CryptoCurrency.paxg, + CryptoCurrency.pivx, + CryptoCurrency.rune, + CryptoCurrency.rvn, + CryptoCurrency.scrt, + CryptoCurrency.stx, + ]; + + static List _supportedPairs() { + final supportedCurrencies = CryptoCurrency.all + .where((element) => !_notSupported.contains(element)) + .toList(); + + return supportedCurrencies + .map((i) => supportedCurrencies + .map((k) => ExchangePair(from: i, to: k, reverse: true)) + .where((c) => c != null)) + .expand((i) => i) + .toList(); + } + @override ExchangeProviderDescription get description => ExchangeProviderDescription.sideShift; @@ -270,6 +290,14 @@ class SideShiftExchangeProvider extends ExchangeProvider { return currency.tag!.toLowerCase(); case CryptoCurrency.usdterc20: return 'usdtErc20'; + case CryptoCurrency.usdttrc20: + return 'usdtTrc20'; + case CryptoCurrency.usdcpoly: + return 'usdcpolygon'; + case CryptoCurrency.usdcsol: + return 'usdcsol'; + case CryptoCurrency.maticpoly: + return 'polygon'; default: return currency.title.toLowerCase(); } diff --git a/lib/exchange/simpleswap/simpleswap_exchange_provider.dart b/lib/exchange/simpleswap/simpleswap_exchange_provider.dart index bd1e27f75..e31d8fb6b 100644 --- a/lib/exchange/simpleswap/simpleswap_exchange_provider.dart +++ b/lib/exchange/simpleswap/simpleswap_exchange_provider.dart @@ -93,7 +93,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { final response = await post(uri, headers: headers, body: json.encode(body)); - if (response.statusCode != 200) { + if (response.statusCode != 200 && response.statusCode != 201) { if (response.statusCode == 400) { final responseJSON = json.decode(response.body) as Map; final error = responseJSON['message'] as String; @@ -217,7 +217,13 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { case CryptoCurrency.bnb: return currency.tag!.toLowerCase(); case CryptoCurrency.usdterc20: - return 'usdterc'; + return 'usdterc20'; + case CryptoCurrency.usdttrc20: + return 'usdttrc20'; + case CryptoCurrency.usdcpoly: + return 'usdcpoly'; + case CryptoCurrency.usdcsol: + return 'usdcspl'; default: return currency.title.toLowerCase(); } diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index bcb8ef231..311913329 100755 --- a/scripts/android/app_env.sh +++ b/scripts/android/app_env.sh @@ -14,14 +14,14 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_ANDROID_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.1.0" -MONERO_COM_BUILD_NUMBER=19 +MONERO_COM_VERSION="1.1.1" +MONERO_COM_BUILD_NUMBER=20 MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_PACKAGE="com.monero.app" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.4.6" -CAKEWALLET_BUILD_NUMBER=118 +CAKEWALLET_VERSION="4.4.7" +CAKEWALLET_BUILD_NUMBER=119 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 5d99e66c2..236482b05 100755 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_IOS_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.1.0" -MONERO_COM_BUILD_NUMBER=21 +MONERO_COM_VERSION="1.1.1" +MONERO_COM_BUILD_NUMBER=22 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.4.6" -CAKEWALLET_BUILD_NUMBER=117 +CAKEWALLET_VERSION="4.4.7" +CAKEWALLET_BUILD_NUMBER=118 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven"