CW-306 New assets for exchange and cleanup (#993)

* CW-306 New assets for exchange and cleanup * Remove 1inch

Justin Ehrenhofer committed Jul 13, 2023 at 09:31 UTC d7fa9991e140bbc2c248f9b69fbc8cb8a30af909
41 files changed +112 -31
assets/images/aave_icon.png
Binary files /dev/null and b/assets/images/aave_icon.png differ
assets/images/arb_icon.png
Binary files /dev/null and b/assets/images/arb_icon.png differ
assets/images/bat_icon.png
Binary files /dev/null and b/assets/images/bat_icon.png differ
assets/images/bttbsc_icon.png
Binary files a/assets/images/bttbsc_icon.png and /dev/null differ
assets/images/cake_icon.png
Binary files /dev/null and b/assets/images/cake_icon.png differ
assets/images/china.png
Binary files a/assets/images/china.png and /dev/null differ
assets/images/comp_icon.png
Binary files /dev/null and b/assets/images/comp_icon.png differ
assets/images/cro_icon.png
Binary files /dev/null and b/assets/images/cro_icon.png differ
assets/images/dydx_icon.png
Binary files /dev/null and b/assets/images/dydx_icon.png differ
assets/images/ens_icon.png
Binary files /dev/null and b/assets/images/ens_icon.png differ
assets/images/france.png
Binary files a/assets/images/france.png and /dev/null differ
assets/images/frax_icon.png
Binary files /dev/null and b/assets/images/frax_icon.png differ
assets/images/ftm_icon.png
Binary files /dev/null and b/assets/images/ftm_icon.png differ
assets/images/germany.png
Binary files a/assets/images/germany.png and /dev/null differ
assets/images/grt_icon.png
Binary files /dev/null and b/assets/images/grt_icon.png differ
assets/images/gtc_icon.png
Binary files /dev/null and b/assets/images/gtc_icon.png differ
assets/images/gusd_icon.png
Binary files /dev/null and b/assets/images/gusd_icon.png differ
assets/images/holland.png
Binary files a/assets/images/holland.png and /dev/null differ
assets/images/india.png
Binary files a/assets/images/india.png and /dev/null differ
assets/images/italy.png
Binary files a/assets/images/italy.png and /dev/null differ
assets/images/japan.png
Binary files a/assets/images/japan.png and /dev/null differ
assets/images/ldo_icon.png
Binary files /dev/null and b/assets/images/ldo_icon.png differ
assets/images/nexo_icon.png
Binary files /dev/null and b/assets/images/nexo_icon.png differ
assets/images/pepe_icon.png
Binary files /dev/null and b/assets/images/pepe_icon.png differ
assets/images/poland.png
Binary files a/assets/images/poland.png and /dev/null differ
assets/images/portugal.png
Binary files a/assets/images/portugal.png and /dev/null differ
assets/images/russia.png
Binary files a/assets/images/russia.png and /dev/null differ
assets/images/south_korea.png
Binary files a/assets/images/south_korea.png and /dev/null differ
assets/images/spain.png
Binary files a/assets/images/spain.png and /dev/null differ
assets/images/steth_icon.png
Binary files /dev/null and b/assets/images/steth_icon.png differ
assets/images/storj_icon.png
Binary files /dev/null and b/assets/images/storj_icon.png differ
assets/images/tusd_icon.png
Binary files /dev/null and b/assets/images/tusd_icon.png differ
assets/images/usa.png
Binary files a/assets/images/usa.png and /dev/null differ
assets/images/usdcsol_icon.png
Binary files a/assets/images/usdcsol_icon.png and /dev/null differ
assets/images/wbtc_icon.png
Binary files /dev/null and b/assets/images/wbtc_icon.png differ
assets/images/weth_icon.png
Binary files /dev/null and b/assets/images/weth_icon.png differ
assets/images/zaddr_icon.png
Binary files a/assets/images/zaddr_icon.png and /dev/null differ
assets/images/zrx_icon.png
Binary files /dev/null and b/assets/images/zrx_icon.png differ
cw_core/lib/crypto_currency.dart
+50 -4
@@ -67,6 +67,29 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
67 CryptoCurrency.uni,
68 CryptoCurrency.stx,
69 CryptoCurrency.btcln,
70 + CryptoCurrency.shib,
71 + CryptoCurrency.aave,
72 + CryptoCurrency.arb,
73 + CryptoCurrency.bat,
74 + CryptoCurrency.comp,
75 + CryptoCurrency.cro,
76 + CryptoCurrency.ens,
77 + CryptoCurrency.ftm,
78 + CryptoCurrency.frax,
79 + CryptoCurrency.gusd,
80 + CryptoCurrency.gtc,
81 + CryptoCurrency.grt,
82 + CryptoCurrency.ldo,
83 + CryptoCurrency.nexo,
84 + CryptoCurrency.cake,
85 + CryptoCurrency.pepe,
86 + CryptoCurrency.storj,
87 + CryptoCurrency.tusd,
88 + CryptoCurrency.wbtc,
89 + CryptoCurrency.weth,
90 + CryptoCurrency.zrx,
91 + CryptoCurrency.dydx,
92 + CryptoCurrency.steth,
93 ];
94
95 static const havenCurrencies = [
@@ -121,7 +144,7 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
144 static const ape = CryptoCurrency(title: 'APE', tag: 'ETH', fullName: 'ApeCoin', raw: 30, name: 'ape', iconPath: 'assets/images/ape_icon.png');
145 static const avaxc = CryptoCurrency(title: 'AVAX', tag: 'AVAXC', raw: 31, name: 'avaxc', iconPath: 'assets/images/avaxc_icon.png');
146 static const btt = CryptoCurrency(title: 'BTT', tag: 'ETH', fullName: 'BitTorrent', raw: 32, name: 'btt', iconPath: 'assets/images/btt_icon.png');
124 - static const bttc = CryptoCurrency(title: 'BTTC', tag: 'TRX', fullName: 'BitTorrent-NEW', raw: 33, name: 'bttc', iconPath: 'assets/images/bttbsc_icon.png');
147 + static const bttc = CryptoCurrency(title: 'BTTC', tag: 'TRX', fullName: 'BitTorrent-NEW', raw: 33, name: 'bttc', iconPath: 'assets/images/btt_icon.png');
148 static const doge = CryptoCurrency(title: 'DOGE', fullName: 'Dogecoin', raw: 34, name: 'doge', iconPath: 'assets/images/doge_icon.png');
149 static const firo = CryptoCurrency(title: 'FIRO', raw: 35, name: 'firo', iconPath: 'assets/images/firo_icon.png');
150 static const usdttrc20 = CryptoCurrency(title: 'USDT', tag: 'TRX', fullName: 'USDT Tether', raw: 36, name: 'usdttrc20', iconPath: 'assets/images/usdttrc20_icon.png');
@@ -129,9 +152,9 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
152 static const sc = CryptoCurrency(title: 'SC', fullName: 'Siacoin', raw: 38, name: 'sc', iconPath: 'assets/images/sc_icon.png');
153 static const sol = CryptoCurrency(title: 'SOL', fullName: 'Solana', raw: 39, name: 'sol', iconPath: 'assets/images/sol_icon.png');
154 static const usdc = CryptoCurrency(title: 'USDC', tag: 'ETH', fullName: 'USD Coin', raw: 40, name: 'usdc', iconPath: 'assets/images/usdc_icon.png');
132 - static const usdcsol = CryptoCurrency(title: 'USDC', tag: 'SOL', fullName: 'USDC Coin', raw: 41, name: 'usdcsol', iconPath: 'assets/images/usdcsol_icon.png');
133 - static const zaddr = CryptoCurrency(title: 'ZZEC', tag: 'ZEC', fullName: 'Shielded Zcash', iconPath: 'assets/images/zaddr_icon.png', raw: 42, name: 'zaddr');
134 - static const zec = CryptoCurrency(title: 'TZEC', tag: 'ZEC', fullName: 'Transparent Zcash', iconPath: 'assets/images/zec_icon.png', raw: 43, name: 'zec');
155 + static const usdcsol = CryptoCurrency(title: 'USDC', tag: 'SOL', fullName: 'USDC Coin', raw: 41, name: 'usdcsol', iconPath: 'assets/images/usdc_icon.png');
156 + static const zaddr = CryptoCurrency(title: 'ZZEC', tag: 'ZEC', fullName: 'Shielded Zcash', raw: 42, name: 'zaddr', iconPath: 'assets/images/zec_icon.png');
157 + static const zec = CryptoCurrency(title: 'TZEC', tag: 'ZEC', fullName: 'Transparent Zcash', raw: 43, name: 'zec', iconPath: 'assets/images/zec_icon.png');
158 static const zen = CryptoCurrency(title: 'ZEN', fullName: 'Horizen', raw: 44, name: 'zen', iconPath: 'assets/images/zen_icon.png');
159 static const xvg = CryptoCurrency(title: 'XVG', fullName: 'Verge', raw: 45, name: 'xvg', iconPath: 'assets/images/xvg_icon.png');
160
@@ -152,6 +175,29 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
175 static const uni = CryptoCurrency(title: 'UNI', tag: 'ETH', fullName: 'Uniswap', raw: 60, name: 'uni', iconPath: 'assets/images/uni_icon.png');
176 static const stx = CryptoCurrency(title: 'STX', fullName: 'Stacks', raw: 61, name: 'stx', iconPath: 'assets/images/stx_icon.png');
177 static const btcln = CryptoCurrency(title: 'BTC', tag: 'LN', fullName: 'Bitcoin Lightning Network', raw: 62, name: 'btcln', iconPath: 'assets/images/btc.png');
178 + static const shib = CryptoCurrency(title: 'SHIB', tag: 'ETH', fullName: 'Shiba Inu', raw: 63, name: 'shib', iconPath: 'assets/images/shib_icon.png');
179 + static const aave = CryptoCurrency(title: 'AAVE', tag: 'ETH', fullName: 'Aave', raw: 64, name: 'aave', iconPath: 'assets/images/aave_icon.png');
180 + static const arb = CryptoCurrency(title: 'ARB', fullName: 'Arbitrum', raw: 65, name: 'arb', iconPath: 'assets/images/arb_icon.png');
181 + static const bat = CryptoCurrency(title: 'BAT', tag: 'ETH', fullName: 'Basic Attention Token', raw: 66, name: 'bat', iconPath: 'assets/images/bat_icon.png');
182 + static const comp = CryptoCurrency(title: 'COMP', tag: 'ETH', fullName: 'Compound', raw: 67, name: 'comp', iconPath: 'assets/images/comp_icon.png');
183 + static const cro = CryptoCurrency(title: 'CRO', tag: 'ETH', fullName: 'Crypto.com Cronos', raw: 68, name: 'cro', iconPath: 'assets/images/cro_icon.png');
184 + static const ens = CryptoCurrency(title: 'ENS', tag: 'ETH', fullName: 'Ethereum Name Service', raw: 69, name: 'ens', iconPath: 'assets/images/ens_icon.png');
185 + static const ftm = CryptoCurrency(title: 'FTM', tag: 'ETH', fullName: 'Fantom', raw: 70, name: 'ftm', iconPath: 'assets/images/ftm_icon.png');
186 + static const frax = CryptoCurrency(title: 'FRAX', tag: 'ETH', fullName: 'Frax', raw: 71, name: 'frax', iconPath: 'assets/images/frax_icon.png');
187 + static const gusd = CryptoCurrency(title: 'GUSD', tag: 'ETH', fullName: 'Gemini USD', raw: 72, name: 'gusd', iconPath: 'assets/images/gusd_icon.png');
188 + static const gtc = CryptoCurrency(title: 'GTC', tag: 'ETH', fullName: 'Gitcoin', raw: 73, name: 'gtc', iconPath: 'assets/images/gtc_icon.png');
189 + static const grt = CryptoCurrency(title: 'GRT', tag: 'ETH', fullName: 'The Graph', raw: 74, name: 'grt', iconPath: 'assets/images/grt_icon.png');
190 + static const ldo = CryptoCurrency(title: 'LDO', tag: 'ETH', fullName: 'Lido DAO', raw: 75, name: 'ldo', iconPath: 'assets/images/ldo_icon.png');
191 + static const nexo = CryptoCurrency(title: 'NEXO', tag: 'ETH', fullName: 'Nexo', raw: 76, name: 'nexo', iconPath: 'assets/images/nexo_icon.png');
192 + static const cake = CryptoCurrency(title: 'CAKE', tag: 'BSC', fullName: 'PancakeSwap', raw: 77, name: 'cake', iconPath: 'assets/images/cake_icon.png');
193 + static const pepe = CryptoCurrency(title: 'PEPE', tag: 'ETH', fullName: 'Pepe', raw: 78, name: 'pepe', iconPath: 'assets/images/pepe_icon.png');
194 + static const storj = CryptoCurrency(title: 'STORJ', tag: 'ETH', fullName: 'Storj', raw: 79, name: 'storj', iconPath: 'assets/images/stroj_icon.png');
195 + static const tusd = CryptoCurrency(title: 'TUSD', tag: 'ETH', fullName: 'TrueUSD', raw: 80, name: 'tusd', iconPath: 'assets/images/tusd_icon.png');
196 + static const wbtc = CryptoCurrency(title: 'WBTC', tag: 'ETH', fullName: 'Wrapped Bitcoin', raw: 81, name: 'wbtc', iconPath: 'assets/images/wbtc_icon.png');
197 + static const weth = CryptoCurrency(title: 'WETH', tag: 'ETH', fullName: 'Wrapped Ethereum', raw: 82, name: 'weth', iconPath: 'assets/images/weth_icon.png');
198 + static const zrx = CryptoCurrency(title: 'ZRX', tag: 'ETH', fullName: '0x Protocol', raw: 83, name: 'zrx', iconPath: 'assets/images/zrx_icon.png');
199 + static const dydx = CryptoCurrency(title: 'DYDX', tag: 'ETH', fullName: 'dYdX', raw: 84, name: 'dydx', iconPath: 'assets/images/dydx_icon.png');
200 + static const steth = CryptoCurrency(title: 'STETH', tag: 'ETH', fullName: 'Lido Staked Ethereum', raw: 85, name: 'steth', iconPath: 'assets/images/steth_icon.png');
201
202
203 static final Map<int, CryptoCurrency> _rawCurrencyMap =
lib/core/address_validator.dart
+52 -17
@@ -36,6 +36,26 @@ class AddressValidator extends TextValidator {
36 case CryptoCurrency.oxt:
37 case CryptoCurrency.paxg:
38 case CryptoCurrency.uni:
39 + case CryptoCurrency.aave:
40 + case CryptoCurrency.bat:
41 + case CryptoCurrency.comp:
42 + case CryptoCurrency.cro:
43 + case CryptoCurrency.ens:
44 + case CryptoCurrency.ftm:
45 + case CryptoCurrency.frax:
46 + case CryptoCurrency.gusd:
47 + case CryptoCurrency.gtc:
48 + case CryptoCurrency.grt:
49 + case CryptoCurrency.ldo:
50 + case CryptoCurrency.nexo:
51 + case CryptoCurrency.pepe:
52 + case CryptoCurrency.storj:
53 + case CryptoCurrency.tusd:
54 + case CryptoCurrency.wbtc:
55 + case CryptoCurrency.weth:
56 + case CryptoCurrency.zrx:
57 + case CryptoCurrency.dydx:
58 + case CryptoCurrency.steth:
59 return '0x[0-9a-zA-Z]';
60 case CryptoCurrency.xrp:
61 return '^[0-9a-zA-Z]{34}\$|^X[0-9a-zA-Z]{46}\$';
@@ -101,8 +121,6 @@ class AddressValidator extends TextValidator {
121 return null;
122 case CryptoCurrency.ada:
123 return null;
104 - case CryptoCurrency.ape:
105 - return [42];
124 case CryptoCurrency.avaxc:
125 return [42];
126 case CryptoCurrency.bch:
@@ -111,13 +129,43 @@ class AddressValidator extends TextValidator {
129 return [42];
130 case CryptoCurrency.btc:
131 return null;
114 - case CryptoCurrency.dai:
115 - return [42];
132 case CryptoCurrency.dash:
133 return [34];
134 case CryptoCurrency.eos:
135 return [42];
136 case CryptoCurrency.eth:
137 + case CryptoCurrency.usdcpoly:
138 + case CryptoCurrency.mana:
139 + case CryptoCurrency.matic:
140 + case CryptoCurrency.maticpoly:
141 + case CryptoCurrency.mkr:
142 + case CryptoCurrency.oxt:
143 + case CryptoCurrency.paxg:
144 + case CryptoCurrency.uni:
145 + case CryptoCurrency.dai:
146 + case CryptoCurrency.ape:
147 + case CryptoCurrency.usdc:
148 + case CryptoCurrency.usdterc20:
149 + case CryptoCurrency.aave:
150 + case CryptoCurrency.bat:
151 + case CryptoCurrency.comp:
152 + case CryptoCurrency.cro:
153 + case CryptoCurrency.ens:
154 + case CryptoCurrency.ftm:
155 + case CryptoCurrency.frax:
156 + case CryptoCurrency.gusd:
157 + case CryptoCurrency.gtc:
158 + case CryptoCurrency.grt:
159 + case CryptoCurrency.ldo:
160 + case CryptoCurrency.nexo:
161 + case CryptoCurrency.pepe:
162 + case CryptoCurrency.storj:
163 + case CryptoCurrency.tusd:
164 + case CryptoCurrency.wbtc:
165 + case CryptoCurrency.weth:
166 + case CryptoCurrency.zrx:
167 + case CryptoCurrency.dydx:
168 + case CryptoCurrency.steth:
169 return [42];
170 case CryptoCurrency.ltc:
171 return [34, 43, 63];
@@ -129,14 +177,10 @@ class AddressValidator extends TextValidator {
177 return [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44];
178 case CryptoCurrency.trx:
179 return [34];
132 - case CryptoCurrency.usdc:
133 - return [42];
180 case CryptoCurrency.usdcsol:
181 return [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44];
182 case CryptoCurrency.usdt:
183 return [34];
138 - case CryptoCurrency.usdterc20:
139 - return [42];
184 case CryptoCurrency.usdttrc20:
185 return [34];
186 case CryptoCurrency.xlm:
@@ -184,15 +228,6 @@ class AddressValidator extends TextValidator {
228 return [35];
229 case CryptoCurrency.stx:
230 return [40, 41, 42];
187 - case CryptoCurrency.usdcpoly:
188 - case CryptoCurrency.mana:
189 - case CryptoCurrency.matic:
190 - case CryptoCurrency.maticpoly:
191 - case CryptoCurrency.mkr:
192 - case CryptoCurrency.oxt:
193 - case CryptoCurrency.paxg:
194 - case CryptoCurrency.uni:
195 - return [42];
231 case CryptoCurrency.rune:
232 return [43];
233 case CryptoCurrency.scrt:
lib/src/screens/seed_language/widgets/seed_language_picker.dart
+10 -10
@@ -4,16 +4,16 @@ import 'package:flutter/cupertino.dart';
4 import 'package:cake_wallet/generated/i18n.dart';
5
6 List<Image> flagImages = [
7 - Image.asset('assets/images/usa.png'),
8 - Image.asset('assets/images/china.png'),
9 - Image.asset('assets/images/holland.png'),
10 - Image.asset('assets/images/germany.png'),
11 - Image.asset('assets/images/japan.png'),
12 - Image.asset('assets/images/portugal.png'),
13 - Image.asset('assets/images/russia.png'),
14 - Image.asset('assets/images/spain.png'),
15 - Image.asset('assets/images/france.png'),
16 - Image.asset('assets/images/italy.png'),
7 + Image.asset('assets/images/flags/usa.png'),
8 + Image.asset('assets/images/flags/chn.png'),
9 + Image.asset('assets/images/flags/nld.png'),
10 + Image.asset('assets/images/flags/deu.png'),
11 + Image.asset('assets/images/flags/jpn.png'),
12 + Image.asset('assets/images/flags/prt.png'),
13 + Image.asset('assets/images/flags/rus.png'),
14 + Image.asset('assets/images/flags/esp.png'),
15 + Image.asset('assets/images/flags/fra.png'),
16 + Image.asset('assets/images/flags/ita.png'),
17 ];
18
19 const List<String> languageCodes = [