From afb3c7ddaf44bd52cc818790d115567fa05b2635 Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Mon, 27 Feb 2023 11:43:07 -0600 Subject: [PATCH 1/7] Add fiat currencies Adds: AED, ARS, BDT, CLP, COP, EGP, GHS, GTQ, IRR, MAD, NGN, PKR, SAR, THB, TRY, UAH, VND This may mess things up because of TRY, so I'll test the PR and make changes as needed --- assets/images/flags/are.png | Bin 0 -> 287 bytes assets/images/flags/arg.png | Bin 0 -> 340 bytes assets/images/flags/bgd.png | Bin 0 -> 446 bytes assets/images/flags/chl.png | Bin 0 -> 351 bytes assets/images/flags/col.png | Bin 0 -> 217 bytes assets/images/flags/egy.png | Bin 0 -> 431 bytes assets/images/flags/gha.png | Bin 0 -> 432 bytes assets/images/flags/gtm.png | Bin 0 -> 477 bytes assets/images/flags/irn.png | Bin 0 -> 615 bytes assets/images/flags/mar.png | Bin 0 -> 429 bytes assets/images/flags/nga.png | Bin 0 -> 193 bytes assets/images/flags/twn.png | Bin 0 -> 373 bytes assets/images/flags/vnm.png | Bin 0 -> 448 bytes lib/entities/fiat_currency.dart | 59 +++++++++++++++++++++++++------- 14 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 assets/images/flags/are.png create mode 100644 assets/images/flags/arg.png create mode 100644 assets/images/flags/bgd.png create mode 100644 assets/images/flags/chl.png create mode 100644 assets/images/flags/col.png create mode 100644 assets/images/flags/egy.png create mode 100644 assets/images/flags/gha.png create mode 100644 assets/images/flags/gtm.png create mode 100644 assets/images/flags/irn.png create mode 100644 assets/images/flags/mar.png create mode 100644 assets/images/flags/nga.png create mode 100644 assets/images/flags/twn.png create mode 100644 assets/images/flags/vnm.png diff --git a/assets/images/flags/are.png b/assets/images/flags/are.png new file mode 100644 index 0000000000000000000000000000000000000000..ae68c4ff2a1768cadb388223715b2f0dc75642df GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3HD`?mYJmNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^D%=PdAuEM{QfI}E~%$MaXD00p;rx;TbJxF<`nDvKI8Wg7h8ciV9=TThJb zZAGbpulR*(!FP6Q8n!PEu5ez-+qT^KKlA2W_v`B=C0?{nWboYiPgq{uxv*O4uzH-{ z3Xa@^t9In=`0Y`o(Y!)~`S8})JUmK=0vK;GxhXUlo%C4z|G%T;7uLl)=iN$>u%0qg z^3(!-g|!t)>FFBZJ}_MV!mv7QtNn{1`Jpz0}Tuav6FIs(X@rhT9Prm*S0{_0hef<9JiH}dN-P_%JaelgpT+y^?3zb&dGGD+yErfW;=G8(Ctd>$TX{@F2}ntl1o;Jn&A}uX z&I;?j0;=IG@Q5sCVBk9p!i>lBSEK+13q4&NLoEESUOdUwpdiwkxLHO@X4Ap%^_La; z8WW4mb^jC;Ka77d)pgVVAh!z%w*(cQ>i?}R@@Stk!OOEzQFD3KoM*1d9$hOpo~ush zb<wn>X~kpFh7oHSu()$H($e-eoTJOAO;ayjFXwZ&ErLXgPzY LtDnm{r-UW|t%;#5 literal 0 HcmV?d00001 diff --git a/assets/images/flags/bgd.png b/assets/images/flags/bgd.png new file mode 100644 index 0000000000000000000000000000000000000000..0f8c5cfe543515fb1c5b2e9520656dbc2783beb3 GIT binary patch literal 446 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`D*}8%Tp6jjdJ;fA zoCO|{#S9F5he4R}c>anMpx|sz7sn6_|E-r^@--Oa-AF8!18XjzB xvG?B8RJCz?e)rl9>$?x{Yw>-e87#eWtE#f1n{TytM!T literal 0 HcmV?d00001 diff --git a/assets/images/flags/chl.png b/assets/images/flags/chl.png new file mode 100644 index 0000000000000000000000000000000000000000..73a38f406dcf90e3faebc0be75ad62082c76c2a5 GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`!vlOmTp28viF&Pl_3p?2|Nr@1RB9d{>3#N_bol>TXK-udbyCrY*qI~FYZ14^Y+bA9j)Vf+BdBYZ`m4M*OmvG zou@x_6OfWE3GxdDnv4@LM7BN80xIMz@Q5sCVBk9p!i>lBSEK+1Gdx`!LoEE?p5M-O zz<|f~qDb_+!m6+T>(h-S_DFo@^kYJ@1h5rq^#}W#nhqT}!_`J|q5;^~>c&B5PQ9AF@r54V9B- S6Hx=&$>8bg=d#Wzp$Pz4<(P2* literal 0 HcmV?d00001 diff --git a/assets/images/flags/col.png b/assets/images/flags/col.png new file mode 100644 index 0000000000000000000000000000000000000000..9a0fc6ac169953ac83b00dbcdef14529a6242e0f GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`B?5dxT>qbCcy)kV)V7Afpj}Y6VY{&D2?0HzWXq&w4}cU$NswRge+Xc> z*St3pD8^af5n0T@z;_sg8IR|$NC66(dAc};Sops^wUd{@fQQ-e`PF~YyDu_a=kO4` zrjxic>cIMoRt(oUcjzfZnLnsvxX!&NXraqgsb|pwjmIy3SPC?O!PC{xWt~$(69A0L BN8tbf literal 0 HcmV?d00001 diff --git a/assets/images/flags/egy.png b/assets/images/flags/egy.png new file mode 100644 index 0000000000000000000000000000000000000000..062ee21cffb817a2175fc63e6feeffc3a923ecf2 GIT binary patch literal 431 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`>jHd2T+a!ro#jyI{>_N!JF%(%LEzul57)ncdHCY`!gmjM zzJId+{gVTCkCtBAe9jvD7udy2bFM1F~So;zc2xMbVkAm_vU%i8nZ@5oP>7veNWpXohsP;lzZZ>6>& zHLrHedv7Jt;@@o0b(o>~L*}Hk?Is5ma%SC^cMS})RQs_1n(yte{ya@zmP#GVtm2no jdAa7{{$StgB|&<=8CeUry$hKKbPt24tDnm{r-UW|um;*( literal 0 HcmV?d00001 diff --git a/assets/images/flags/gha.png b/assets/images/flags/gha.png new file mode 100644 index 0000000000000000000000000000000000000000..8d6801e816e465426525c8b78e3ca509e0b7cb19 GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`O9OmDT+a!ro#j)z8>DzINb$Ol!r#kc|F4Oy=;ix!QSA2xvF~Taew`O{ zw`TisPHaXUubnZgsSYbU8{?0&Vq2#P$Vq~%`gK9<^C?jcMP?y>rvH~j|6dW?JyRgs zi~aT%q0nB#us%bF8vUSdLxxNThAan$Y*ltb__vSfin$JCxm@chPN#aSWcWelF{r5}E+EySQ}# literal 0 HcmV?d00001 diff --git a/assets/images/flags/gtm.png b/assets/images/flags/gtm.png new file mode 100644 index 0000000000000000000000000000000000000000..2083ad806201dab8c664d23f312a03005a84ae58 GIT binary patch literal 477 zcmV<30V4j1P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0dh%1K~z{r?UqkV z0znvuf4gd{tC>O&YKJHyAp%LSdG`zS8R`?+7w8gQ>e3;^z)R3SBPk`+wlFO=(sFIv z7PoC3f=&rDfzUjcci8zcJp0Zt3^@N4fmDY~wrG*zuT1#d*jQa~>M(TPOss8HoH{If z>xpkak<^igi?W7`vWA(cWeqM2!+b~I>N{hWFcH01737X~U>F+e^1a?6Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0sKisK~z{r?NmW) z6G0UIW@dMjHkT+xu=G$BBGf}~y$Sva^{juO*Zzebd-3YUi+Jr15WMx4TS+lq#2^F- zfh8MfcEpiaNZ%-5p^ixMrmjYOI#_1NEzwp z&AE>cn(1lHg*Ekb=J&LZPcPoj{4E%L(|#8o-+3sUH{lH#yqP2OnsQ8sXD)-$28oH0 z+L0KF=zx(U9@V7ZI{R-u@su_5dXtFm%kV2+KY6~~DBY;=^W?wvB#5rT6F z<1sW1M6gyu@9fAr@*IfhP2@XGgKO{UO|vpY+{3@XN_`yv?*B_a>mzQjuW|S6Y`M|y z!9j=*4~26xiPvf`ZX1=+3KdEL@C&cMcXNVJ|C9g#002ovPDHLkV1m^= BADsXI literal 0 HcmV?d00001 diff --git a/assets/images/flags/mar.png b/assets/images/flags/mar.png new file mode 100644 index 0000000000000000000000000000000000000000..65b31c8922927a7de8b332a4ddf9af8c22f061e8 GIT binary patch literal 429 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`a{_!qTo0=29#+?#X{>idO*hQL;E=lRQ8nESI(kVi21^X|;$00goD7QX z^}W3f{k;tLYv@ie(+~7CXtL4|@-$edt9MvUcekc)vWtOrfMK?yL7S!i7HwV2K*PzV zdQ(jGavcqJXzA|M(%q+_3$*a`(uX!cN~I*oFZe%Uz!0Is%L`P`S>O>_%)r2R7=#&* z=dVZs3eNI$aSXBWzkB{PU$cUML!gM`(d|u-ZlC)9KUvyJ(bwAd#*U2lY%}HvC>-1U zTI1sj{tSUO#+=xAjb0_LXmKaW=Qe(merz<5xM`>9?K(|7HS)`?Pu_0;QT zrL4-*PMxpVb(hLju{NhmsFuvxGVj>-{)HuRM|O3kwkfv+ZhhMxw7vFo#evLTtG5SR jgZ9WTnHTHWyOa5&v_*(i>NO6aD;Ydp{an^LB{Ts53(lu; literal 0 HcmV?d00001 diff --git a/assets/images/flags/nga.png b/assets/images/flags/nga.png new file mode 100644 index 0000000000000000000000000000000000000000..ebfd82449d575856a0f2622a4cb1dacd2a8c8107 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1``2&1HTp8K}MJFb_`ugGj|NlU-HHv!^fD~&O!RVdW437PqN=TC$;DyMmM$ eb*F6Fz`$_p497z6Nn{1`V*`9bTp1XqiZXP*WZ?P7z`)KvgNbRHgv5Mi=4m1#b1N&4$H(tsV3=ZU zy{@$M*!1aFu3ULrQgYPVdMyXX3_H8^4GpKheEIeN|Nqj`qaq9)q6{6H47INrxL+}F z|6yPR+A#Ii<8mM+UlQaO3{-{(Fr1Yv696jZEbxddW?liAS lxR#%7@O1TaS?83{1OP(Cm7xFt literal 0 HcmV?d00001 diff --git a/assets/images/flags/vnm.png b/assets/images/flags/vnm.png new file mode 100644 index 0000000000000000000000000000000000000000..3cbbf878f49fb4e71c9cb2a85ce3896d9fd2c55e GIT binary patch literal 448 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktt!3-q7rQ00=QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`a{_!qTyLq$-cpu*7$|;IN%q4Ep1bDKzh5xl)|R=gC38z%_C=-8|NjiP zRAe6oiGSI{`SUjGj~lE%uCxAm$8^t1>it5Ve?J%>g^K@rz;eex`qzDyXE`Dtmhybr z&-wiv`{PKlTWYe;ONDOh$UH9*0$RxZx8ov^QYi`Y3;s_SFhuC^@&eU!7I;J!GcfQS z24TkI`72U@f@?ip978Pp&rZC_*KEMUVi?Z!tgS$P>CgZ5I$Ok=)I9bm82a~_MrF!6 z$33&Vy5m4_sDbZ-!pAOKb8asJQl&B17Zy5)N4A9Qlizu(vRDGbR!2_VaN1^NsQKz!SH7r}th&1Bg;nF*k8!uI)JZTN zTR8v4U+3jk>nm3>fBsz&m8bP0 Hl+XkKu%*pp literal 0 HcmV?d00001 diff --git a/lib/entities/fiat_currency.dart b/lib/entities/fiat_currency.dart index 9cad6f468..b8f0a63bd 100644 --- a/lib/entities/fiat_currency.dart +++ b/lib/entities/fiat_currency.dart @@ -9,76 +9,109 @@ class FiatCurrency extends EnumerableItem with Serializable { static List get all => _all.values.toList(); static List get currenciesAvailableToBuyWith => - [aud, brl, cad, chf, czk, eur, dkk, gbp, hkd, ils, jpy, krw, mxn, myr, nok, nzd, pln, sek, sgd, thb, usd, zar]; + [aed, aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, try, twd, usd, vnd, zar]; + static const aed = FiatCurrency(symbol: 'AED', countryCode: "are", fullName: "United Arab Emirates Dirham"); + static const ars = FiatCurrency(symbol: 'ARS', countryCode: "arg", fullName: "Argentine Peso"); static const aud = FiatCurrency(symbol: 'AUD', countryCode: "aus", fullName: "Australian Dollar"); + static const bdt = FiatCurrency(symbol: 'BDT', countryCode: "bgd", fullName: "Bangladeshi Taka"); static const bgn = FiatCurrency(symbol: 'BGN', countryCode: "bgr", fullName: "Bulgarian Lev"); static const brl = FiatCurrency(symbol: 'BRL', countryCode: "bra", fullName: "Brazilian Real"); static const cad = FiatCurrency(symbol: 'CAD', countryCode: "cad", fullName: "Canadian Dollar"); static const chf = FiatCurrency(symbol: 'CHF', countryCode: "che", fullName: "Swiss Franc"); + static const clp = FiatCurrency(symbol: 'CLP', countryCode: "chl", fullName: "Chilean Peso"); static const cny = FiatCurrency(symbol: 'CNY', countryCode: "chn", fullName: "Chinese Yuan"); + static const cop = FiatCurrency(symbol: 'COP', countryCode: "col", fullName: "Colombian Peso"); static const czk = FiatCurrency(symbol: 'CZK', countryCode: "czk", fullName: "Czech Koruna"); - static const eur = FiatCurrency(symbol: 'EUR', countryCode: "eur", fullName: "Euro"); static const dkk = FiatCurrency(symbol: 'DKK', countryCode: "dnk", fullName: "Danish Krone"); - static const gbp = FiatCurrency(symbol: 'GBP', countryCode: "gbr", fullName: "Pound sterling"); + static const egp = FiatCurrency(symbol: 'EGP', countryCode: "egy", fullName: "Egyptian Pound"); + static const eur = FiatCurrency(symbol: 'EUR', countryCode: "eur", fullName: "Euro"); + static const gbp = FiatCurrency(symbol: 'GBP', countryCode: "gbr", fullName: "Pound Sterling"); + static const ghs = FiatCurrency(symbol: 'GHS', countryCode: "gha", fullName: "Ghanaian Cedi"); + static const gtq = FiatCurrency(symbol: 'GTQ', countryCode: "gtm", fullName: "Guatemalan Quetzal"); static const hkd = FiatCurrency(symbol: 'HKD', countryCode: "hkg", fullName: "Hong Kong Dollar"); static const hrk = FiatCurrency(symbol: 'HRK', countryCode: "hrv", fullName: "Croatian Kuna"); static const huf = FiatCurrency(symbol: 'HUF', countryCode: "hun", fullName: "Hungarian Forint"); static const idr = FiatCurrency(symbol: 'IDR', countryCode: "idn", fullName: "Indonesian Rupiah"); static const ils = FiatCurrency(symbol: 'ILS', countryCode: "isr", fullName: "Israeli New Shekel"); static const inr = FiatCurrency(symbol: 'INR', countryCode: "ind", fullName: "Indian Rupee"); - static const isk = FiatCurrency(symbol: 'ISK', countryCode: "isl", fullName: "Icelandic Króna"); - static const jpy = FiatCurrency(symbol: 'JPY', countryCode: "jpn", fullName: "Japanese Yen equals"); - static const krw = FiatCurrency(symbol: 'KRW', countryCode: "kor", fullName: "South Korean won"); + static const irr = FiatCurrency(symbol: 'IRR', countryCode: "irn", fullName: "Iranian Rial"); + static const isk = FiatCurrency(symbol: 'ISK', countryCode: "isl", fullName: "Icelandic Krona Króna"); + static const jpy = FiatCurrency(symbol: 'JPY', countryCode: "jpn", fullName: "Japanese Yen"); + static const krw = FiatCurrency(symbol: 'KRW', countryCode: "kor", fullName: "South Korean Won"); + static const mad = FiatCurrency(symbol: 'MAD', countryCode: "mar", fullName: "Moroccan Dirham"); static const mxn = FiatCurrency(symbol: 'MXN', countryCode: "mex", fullName: "Mexican Peso"); static const myr = FiatCurrency(symbol: 'MYR', countryCode: "mys", fullName: "Malaysian Ringgit"); + static const ngn = FiatCurrency(symbol: 'NGN', countryCode: "nga", fullName: "Nigerian Naira"); static const nok = FiatCurrency(symbol: 'NOK', countryCode: "nor", fullName: "Norwegian Krone"); static const nzd = FiatCurrency(symbol: 'NZD', countryCode: "nzl", fullName: "New Zealand Dollar"); - static const php = FiatCurrency(symbol: 'PHP', countryCode: "phl", fullName: "Philippine peso"); - static const pln = FiatCurrency(symbol: 'PLN', countryCode: "pol", fullName: "Poland złoty"); + static const php = FiatCurrency(symbol: 'PHP', countryCode: "phl", fullName: "Philippine Peso"); + static const pkr = FiatCurrency(symbol: 'PKR', countryCode: "pak", fullName: "Pakistani Rupee"); + static const pln = FiatCurrency(symbol: 'PLN', countryCode: "pol", fullName: "Poland Zloty złoty"); static const ron = FiatCurrency(symbol: 'RON', countryCode: "rou", fullName: "Romanian Leu"); static const rub = FiatCurrency(symbol: 'RUB', countryCode: "rus", fullName: "Russian Ruble"); + static const sar = FiatCurrency(symbol: 'SAR', countryCode: "sau", fullName: "Saudi Riyal"); static const sek = FiatCurrency(symbol: 'SEK', countryCode: "swe", fullName: "Swedish Krona"); static const sgd = FiatCurrency(symbol: 'SGD', countryCode: "sgp", fullName: "Singapore Dollar"); - static const thb = FiatCurrency(symbol: 'THB', countryCode: "tha", fullName: "Thai Baht"); + static const thb = FiatCurrency(symbol: 'THB', countryCode: "tha", fullName: "New Thaiwan Dollar"); + static const try = FiatCurrency(symbol: 'TRY', countryCode: "tur", fullName: "Turkish Lira"); + static const twd = FiatCurrency(symbol: 'TWD', countryCode: "twn", fullName: "Thai Baht"); + static const uah = FiatCurrency(symbol: 'UAH', countryCode: "ukr", fullName: "Ukrainian Hryvnia"); static const usd = FiatCurrency(symbol: 'USD', countryCode: "usa", fullName: "United States Dollar"); + static const vef = FiatCurrency(symbol: 'VEF', countryCode: "ven", fullName: "Venezuelan Bolivar Bolívar"); + static const vnd = FiatCurrency(symbol: 'VND', countryCode: "vnm", fullName: "Vietnamese Dong đồng"); static const zar = FiatCurrency(symbol: 'ZAR', countryCode: "saf", fullName: "South African Rand"); - static const vef = FiatCurrency(symbol: 'VEF', countryCode: "ven", fullName: "Venezuelan Bolívar"); static final _all = { + FiatCurrency.aed.raw: FiatCurrency.aed, + FiatCurrency.ars.raw: FiatCurrency.ars, FiatCurrency.aud.raw: FiatCurrency.aud, + FiatCurrency.bdt.raw: FiatCurrency.bdt, FiatCurrency.bgn.raw: FiatCurrency.bgn, FiatCurrency.brl.raw: FiatCurrency.brl, FiatCurrency.cad.raw: FiatCurrency.cad, FiatCurrency.chf.raw: FiatCurrency.chf, FiatCurrency.cny.raw: FiatCurrency.cny, + FiatCurrency.cop.raw: FiatCurrency.cop, FiatCurrency.czk.raw: FiatCurrency.czk, - FiatCurrency.eur.raw: FiatCurrency.eur, FiatCurrency.dkk.raw: FiatCurrency.dkk, + FiatCurrency.egp.raw: FiatCurrency.egp, + FiatCurrency.eur.raw: FiatCurrency.eur, FiatCurrency.gbp.raw: FiatCurrency.gbp, + FiatCurrency.ghs.raw: FiatCurrency.ghs, + FiatCurrency.gtq.raw: FiatCurrency.gtq, FiatCurrency.hkd.raw: FiatCurrency.hkd, FiatCurrency.hrk.raw: FiatCurrency.hrk, FiatCurrency.huf.raw: FiatCurrency.huf, FiatCurrency.idr.raw: FiatCurrency.idr, FiatCurrency.ils.raw: FiatCurrency.ils, FiatCurrency.inr.raw: FiatCurrency.inr, + FiatCurrency.irr.raw: FiatCurrency.irr, FiatCurrency.isk.raw: FiatCurrency.isk, FiatCurrency.jpy.raw: FiatCurrency.jpy, FiatCurrency.krw.raw: FiatCurrency.krw, + FiatCurrency.mad.raw: FiatCurrency.mad, FiatCurrency.mxn.raw: FiatCurrency.mxn, FiatCurrency.myr.raw: FiatCurrency.myr, + FiatCurrency.ngn.raw: FiatCurrency.ngn, FiatCurrency.nok.raw: FiatCurrency.nok, FiatCurrency.nzd.raw: FiatCurrency.nzd, FiatCurrency.php.raw: FiatCurrency.php, + FiatCurrency.pkr.raw: FiatCurrency.pkr, FiatCurrency.pln.raw: FiatCurrency.pln, FiatCurrency.ron.raw: FiatCurrency.ron, FiatCurrency.rub.raw: FiatCurrency.rub, + FiatCurrency.sar.raw: FiatCurrency.sar, FiatCurrency.sek.raw: FiatCurrency.sek, FiatCurrency.sgd.raw: FiatCurrency.sgd, FiatCurrency.thb.raw: FiatCurrency.thb, + FiatCurrency.try.raw: FiatCurrency.try, + FiatCurrency.twd.raw: FiatCurrency.twd, + FiatCurrency.uah.raw: FiatCurrency.uah, FiatCurrency.usd.raw: FiatCurrency.usd, - FiatCurrency.zar.raw: FiatCurrency.zar, - FiatCurrency.vef.raw: FiatCurrency.vef + FiatCurrency.vef.raw: FiatCurrency.vef, + FiatCurrency.vnd.raw: FiatCurrency.vnd, + FiatCurrency.zar.raw: FiatCurrency.zar }; static FiatCurrency deserialize({required String raw}) => _all[raw]!; From b5005400728bcdde02214ca594b8dc8d2bc13f62 Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Mon, 27 Feb 2023 11:55:01 -0600 Subject: [PATCH 2/7] Test fix for TRY As suspected: https://github.com/cake-tech/cake_wallet/actions/runs/4285241568/jobs/7463282181#step:13:306 This might not work depending on how the const is used, so will test the build --- lib/entities/fiat_currency.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/entities/fiat_currency.dart b/lib/entities/fiat_currency.dart index b8f0a63bd..3dc1e49a5 100644 --- a/lib/entities/fiat_currency.dart +++ b/lib/entities/fiat_currency.dart @@ -9,7 +9,7 @@ class FiatCurrency extends EnumerableItem with Serializable { static List get all => _all.values.toList(); static List get currenciesAvailableToBuyWith => - [aed, aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, try, twd, usd, vnd, zar]; + [aed, aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, turtry, twd, usd, vnd, zar]; static const aed = FiatCurrency(symbol: 'AED', countryCode: "are", fullName: "United Arab Emirates Dirham"); static const ars = FiatCurrency(symbol: 'ARS', countryCode: "arg", fullName: "Argentine Peso"); @@ -54,7 +54,7 @@ class FiatCurrency extends EnumerableItem with Serializable { static const sek = FiatCurrency(symbol: 'SEK', countryCode: "swe", fullName: "Swedish Krona"); static const sgd = FiatCurrency(symbol: 'SGD', countryCode: "sgp", fullName: "Singapore Dollar"); static const thb = FiatCurrency(symbol: 'THB', countryCode: "tha", fullName: "New Thaiwan Dollar"); - static const try = FiatCurrency(symbol: 'TRY', countryCode: "tur", fullName: "Turkish Lira"); + static const turtry = FiatCurrency(symbol: 'TRY', countryCode: "tur", fullName: "Turkish Lira"); static const twd = FiatCurrency(symbol: 'TWD', countryCode: "twn", fullName: "Thai Baht"); static const uah = FiatCurrency(symbol: 'UAH', countryCode: "ukr", fullName: "Ukrainian Hryvnia"); static const usd = FiatCurrency(symbol: 'USD', countryCode: "usa", fullName: "United States Dollar"); @@ -105,7 +105,7 @@ class FiatCurrency extends EnumerableItem with Serializable { FiatCurrency.sek.raw: FiatCurrency.sek, FiatCurrency.sgd.raw: FiatCurrency.sgd, FiatCurrency.thb.raw: FiatCurrency.thb, - FiatCurrency.try.raw: FiatCurrency.try, + FiatCurrency.turtry.raw: FiatCurrency.turtry, FiatCurrency.twd.raw: FiatCurrency.twd, FiatCurrency.uah.raw: FiatCurrency.uah, FiatCurrency.usd.raw: FiatCurrency.usd, From c6f6ab0bc963f37112428a1288fae7fa247a4b1e Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Mon, 27 Feb 2023 12:29:05 -0600 Subject: [PATCH 3/7] Add missing clp --- lib/entities/fiat_currency.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/entities/fiat_currency.dart b/lib/entities/fiat_currency.dart index 3dc1e49a5..6d871bf48 100644 --- a/lib/entities/fiat_currency.dart +++ b/lib/entities/fiat_currency.dart @@ -71,6 +71,7 @@ class FiatCurrency extends EnumerableItem with Serializable { FiatCurrency.brl.raw: FiatCurrency.brl, FiatCurrency.cad.raw: FiatCurrency.cad, FiatCurrency.chf.raw: FiatCurrency.chf, + FiatCurrency.clp.raw: FiatCurrency.clp, FiatCurrency.cny.raw: FiatCurrency.cny, FiatCurrency.cop.raw: FiatCurrency.cop, FiatCurrency.czk.raw: FiatCurrency.czk, From 7ba88699d4ba758355dd17a05e35fc0c0511c435 Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Tue, 28 Feb 2023 10:02:23 -0600 Subject: [PATCH 4/7] [skip ci] Remove AED --- lib/entities/fiat_currency.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/entities/fiat_currency.dart b/lib/entities/fiat_currency.dart index 6d871bf48..895219143 100644 --- a/lib/entities/fiat_currency.dart +++ b/lib/entities/fiat_currency.dart @@ -9,9 +9,8 @@ class FiatCurrency extends EnumerableItem with Serializable { static List get all => _all.values.toList(); static List get currenciesAvailableToBuyWith => - [aed, aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, turtry, twd, usd, vnd, zar]; + [aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, turtry, twd, usd, vnd, zar]; - static const aed = FiatCurrency(symbol: 'AED', countryCode: "are", fullName: "United Arab Emirates Dirham"); static const ars = FiatCurrency(symbol: 'ARS', countryCode: "arg", fullName: "Argentine Peso"); static const aud = FiatCurrency(symbol: 'AUD', countryCode: "aus", fullName: "Australian Dollar"); static const bdt = FiatCurrency(symbol: 'BDT', countryCode: "bgd", fullName: "Bangladeshi Taka"); @@ -63,7 +62,6 @@ class FiatCurrency extends EnumerableItem with Serializable { static const zar = FiatCurrency(symbol: 'ZAR', countryCode: "saf", fullName: "South African Rand"); static final _all = { - FiatCurrency.aed.raw: FiatCurrency.aed, FiatCurrency.ars.raw: FiatCurrency.ars, FiatCurrency.aud.raw: FiatCurrency.aud, FiatCurrency.bdt.raw: FiatCurrency.bdt, From dfcdfd87d18092788a4580cab1f2240588c6c28c Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Tue, 28 Feb 2023 10:03:31 -0600 Subject: [PATCH 5/7] [skip ci] Remove Haven USD hardcode --- lib/reactions/on_current_wallet_change.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/reactions/on_current_wallet_change.dart b/lib/reactions/on_current_wallet_change.dart index 270415820..89b096d86 100644 --- a/lib/reactions/on_current_wallet_change.dart +++ b/lib/reactions/on_current_wallet_change.dart @@ -66,11 +66,6 @@ void startCurrentWalletChangeReaction(AppStore appStore, PreferencesKey.currentWalletType, serializeToInt(wallet.type)); await wallet.connectToNode(node: node); - if (wallet.type == WalletType.haven) { - settingsStore.fiatCurrency = FiatCurrency.usd; - await updateHavenRate(fiatConversionStore); - } - if (wallet.walletInfo.address?.isEmpty ?? true) { wallet.walletInfo.address = wallet.walletAddresses.address; From c9726403ec9175bf716d1afded7e1563b6d06fa1 Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Tue, 28 Feb 2023 12:51:44 -0600 Subject: [PATCH 6/7] Remove TRY Ideally this asset would be supported, but it's not worth devoting effort to fix this 1 currency right now --- lib/entities/fiat_currency.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/entities/fiat_currency.dart b/lib/entities/fiat_currency.dart index 895219143..12ceff92a 100644 --- a/lib/entities/fiat_currency.dart +++ b/lib/entities/fiat_currency.dart @@ -9,7 +9,7 @@ class FiatCurrency extends EnumerableItem with Serializable { static List get all => _all.values.toList(); static List get currenciesAvailableToBuyWith => - [aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, turtry, twd, usd, vnd, zar]; + [aud, bgn, brl, cad, chf, clp, cop, czk, dkk, egp, eur, gbp, gtq, hkd, hrk, huf, idr, ils, inr, isk, jpy, krw, mad, mxn, myr, ngn, nok, nzd, php, pkr, pln, ron, sek, sgd, thb, twd, usd, vnd, zar]; static const ars = FiatCurrency(symbol: 'ARS', countryCode: "arg", fullName: "Argentine Peso"); static const aud = FiatCurrency(symbol: 'AUD', countryCode: "aus", fullName: "Australian Dollar"); @@ -53,7 +53,6 @@ class FiatCurrency extends EnumerableItem with Serializable { static const sek = FiatCurrency(symbol: 'SEK', countryCode: "swe", fullName: "Swedish Krona"); static const sgd = FiatCurrency(symbol: 'SGD', countryCode: "sgp", fullName: "Singapore Dollar"); static const thb = FiatCurrency(symbol: 'THB', countryCode: "tha", fullName: "New Thaiwan Dollar"); - static const turtry = FiatCurrency(symbol: 'TRY', countryCode: "tur", fullName: "Turkish Lira"); static const twd = FiatCurrency(symbol: 'TWD', countryCode: "twn", fullName: "Thai Baht"); static const uah = FiatCurrency(symbol: 'UAH', countryCode: "ukr", fullName: "Ukrainian Hryvnia"); static const usd = FiatCurrency(symbol: 'USD', countryCode: "usa", fullName: "United States Dollar"); @@ -104,7 +103,6 @@ class FiatCurrency extends EnumerableItem with Serializable { FiatCurrency.sek.raw: FiatCurrency.sek, FiatCurrency.sgd.raw: FiatCurrency.sgd, FiatCurrency.thb.raw: FiatCurrency.thb, - FiatCurrency.turtry.raw: FiatCurrency.turtry, FiatCurrency.twd.raw: FiatCurrency.twd, FiatCurrency.uah.raw: FiatCurrency.uah, FiatCurrency.usd.raw: FiatCurrency.usd, From 2a48d645aec2a6ab229134097e335dc09b5141e4 Mon Sep 17 00:00:00 2001 From: Justin Ehrenhofer Date: Thu, 2 Mar 2023 17:47:10 -0600 Subject: [PATCH 7/7] Revert part of the Haven change --- lib/reactions/on_current_wallet_change.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/reactions/on_current_wallet_change.dart b/lib/reactions/on_current_wallet_change.dart index 89b096d86..e44973c5f 100644 --- a/lib/reactions/on_current_wallet_change.dart +++ b/lib/reactions/on_current_wallet_change.dart @@ -66,6 +66,10 @@ void startCurrentWalletChangeReaction(AppStore appStore, PreferencesKey.currentWalletType, serializeToInt(wallet.type)); await wallet.connectToNode(node: node); + if (wallet.type == WalletType.haven) { + await updateHavenRate(fiatConversionStore); + } + if (wallet.walletInfo.address?.isEmpty ?? true) { wallet.walletInfo.address = wallet.walletAddresses.address;