Enable DFX for polygon wallet (#1267)

This commit is contained in:
Omar Hatem 2024-01-23 01:53:20 +02:00 committed by GitHub
parent 1b65adce53
commit d83054eded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -46,6 +46,8 @@ class DFXBuyProvider extends BuyProvider {
return 'XMR';
case WalletType.ethereum:
return 'ETH';
case WalletType.polygon:
return 'MATIC';
default:
throw Exception("WalletType is not available for DFX ${wallet.type}");
}
@ -61,6 +63,8 @@ class DFXBuyProvider extends BuyProvider {
return 'Monero';
case WalletType.ethereum:
return 'Ethereum';
case WalletType.polygon:
return 'Polygon';
default:
throw Exception("WalletType is not available for DFX ${wallet.type}");
}
@ -141,6 +145,7 @@ class DFXBuyProvider extends BuyProvider {
String getSignature(String message) {
switch (wallet.type) {
case WalletType.ethereum:
case WalletType.polygon:
return wallet.signMessage(message);
case WalletType.monero:
case WalletType.litecoin:

View file

@ -65,9 +65,10 @@ class ProvidersHelper {
case WalletType.litecoin:
case WalletType.bitcoinCash:
return [ProviderType.askEachTime, ProviderType.onramper, ProviderType.robinhood];
case WalletType.polygon:
return [ProviderType.askEachTime, ProviderType.dfx];
case WalletType.none:
case WalletType.haven:
case WalletType.polygon:
return [];
}
}
@ -76,17 +77,22 @@ class ProvidersHelper {
switch (walletType) {
case WalletType.bitcoin:
case WalletType.ethereum:
return [ProviderType.askEachTime, ProviderType.onramper,
ProviderType.moonpaySell, ProviderType.dfx];
return [
ProviderType.askEachTime,
ProviderType.onramper,
ProviderType.moonpaySell,
ProviderType.dfx,
];
case WalletType.litecoin:
case WalletType.bitcoinCash:
return [ProviderType.askEachTime, ProviderType.moonpaySell];
case WalletType.polygon:
return [ProviderType.askEachTime, ProviderType.dfx];
case WalletType.monero:
case WalletType.nano:
case WalletType.banano:
case WalletType.none:
case WalletType.haven:
case WalletType.polygon:
return [];
}
}