mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: Chainflip swap status update (#2775)
This commit is contained in:
@@ -202,7 +202,7 @@ class ChainflipExchangeProvider extends ExchangeProvider {
|
||||
|
||||
final swapResponse = await _openDepositChannel(swapParams);
|
||||
|
||||
final id = '${swapResponse['issuedBlock']}-${swapResponse['network'].toString().toUpperCase()}-${swapResponse['channelId']}';
|
||||
final id = '${swapResponse['issuedBlock']}-${swapResponse['network'].toString()}-${swapResponse['channelId']}';
|
||||
|
||||
ExchangeProviderLogger.logSuccess(
|
||||
provider: description,
|
||||
@@ -268,11 +268,13 @@ class ChainflipExchangeProvider extends ExchangeProvider {
|
||||
Future<Trade> findTradeById({required String id}) async {
|
||||
try {
|
||||
final channelParts = id.split('-');
|
||||
final network = channelParts[1];
|
||||
final normalizedNetwork = _normalizeNetworkName(network);
|
||||
|
||||
final statusParams = {
|
||||
'apiKey': _affiliateKey,
|
||||
'issuedBlock': channelParts[0],
|
||||
'network': channelParts[1],
|
||||
'network': normalizedNetwork,
|
||||
'channelId': channelParts[2]
|
||||
};
|
||||
|
||||
@@ -334,6 +336,18 @@ class ChainflipExchangeProvider extends ExchangeProvider {
|
||||
return '$title.$tag';
|
||||
}
|
||||
|
||||
String _normalizeNetworkName (String name) {
|
||||
final networkName = switch (name) {
|
||||
'BITCOIN' => 'Bitcoin',
|
||||
'ETHEREUM' => 'Ethereum',
|
||||
'SOLANA' => 'Solana',
|
||||
_ => name
|
||||
};
|
||||
|
||||
return networkName;
|
||||
}
|
||||
|
||||
|
||||
CryptoCurrency? _toCurrency(String name) {
|
||||
final currency = switch (name) {
|
||||
'btc.btc' => CryptoCurrency.btc,
|
||||
|
||||
Reference in New Issue
Block a user