Polygon-Wallet-fixes (#1222)

* fix: Fix issues surrounding polygon release

* Add polygon generation command to pubspec script

* Remove unnecesary cast

* fix: Remove unneeded code

* fix: Adjust workflow file to pick polygonScan apikey

* fix: Issues noticed while testing

* fix: Issues noticed while testing

* fix: Transaction should reflect the token name

* fix: Remove unused import

* feat: Add alchemy node to default migration settings

* Fix sending Polygon delay
Remove alchemy node
Minor Enhancements

* Remove scrolling from multiple choices settings row and make them fill the whole space [skip ci]

* Add USDT poly
Add icon for USDC.e

* Fix ERC20 tokens overriding old wallets
Add USDC.e to exchange

* - Remove unnecessary code
- Minor Enhancements

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Adegoke David
2023-12-13 16:03:07 +02:00
committed by GitHub
co-authored by Omar Hatem
parent 7ce387c130
commit ef7762eaca
57 changed files with 320 additions and 271 deletions
@@ -159,8 +159,8 @@ class SideShiftExchangeProvider extends ExchangeProvider {
url = apiBaseUrl + orderPath + '/fixed';
} else {
url = apiBaseUrl + orderPath + '/variable';
body["depositCoin"] = request.fromCurrency.title.toLowerCase();
body["settleCoin"] = request.toCurrency.title.toLowerCase();
body["depositCoin"] = _normalizeCurrency(request.fromCurrency);
body["settleCoin"] = _normalizeCurrency(request.toCurrency);
body["settleNetwork"] = _networkFor(request.toCurrency);
body["depositNetwork"] = _networkFor(request.fromCurrency);
}
@@ -248,8 +248,8 @@ class SideShiftExchangeProvider extends ExchangeProvider {
final url = apiBaseUrl + quotePath;
final headers = {'Content-Type': 'application/json'};
final body = {
'depositCoin': request.fromCurrency.title.toLowerCase(),
'settleCoin': request.toCurrency.title.toLowerCase(),
'depositCoin': _normalizeCurrency(request.fromCurrency),
'settleCoin': _normalizeCurrency(request.toCurrency),
'affiliateId': affiliateId,
'settleAmount': request.toAmount,
'settleNetwork': _networkFor(request.toCurrency),
@@ -274,6 +274,15 @@ class SideShiftExchangeProvider extends ExchangeProvider {
return responseJSON['id'] as String;
}
String _normalizeCurrency(CryptoCurrency currency) {
switch (currency) {
case CryptoCurrency.usdcEPoly:
return 'usdc';
default:
return currency.title.toLowerCase();
}
}
String _networkFor(CryptoCurrency currency) =>
currency.tag != null ? _normalizeTag(currency.tag!) : 'mainnet';
@@ -222,6 +222,10 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
return 'usdttrc20';
case CryptoCurrency.usdcpoly:
return 'usdcpoly';
case CryptoCurrency.usdtPoly:
return 'usdtpoly';
case CryptoCurrency.usdcEPoly:
return 'usdcepoly';
case CryptoCurrency.usdcsol:
return 'usdcspl';
case CryptoCurrency.matic:
@@ -271,6 +271,8 @@ class TrocadorExchangeProvider extends ExchangeProvider {
case CryptoCurrency.maticpoly:
return 'Mainnet';
case CryptoCurrency.usdcpoly:
case CryptoCurrency.usdtPoly:
case CryptoCurrency.usdcEPoly:
return 'MATIC';
case CryptoCurrency.zec:
return 'Mainnet';
@@ -283,6 +285,8 @@ class TrocadorExchangeProvider extends ExchangeProvider {
switch (currency) {
case CryptoCurrency.zec:
return 'zec';
case CryptoCurrency.usdcEPoly:
return 'usdce';
default:
return currency.title.toLowerCase();
}