fix: Chainflip swap status update (#2775)
Serhii committed
Dec 29, 2025 at 21:04 UTC
40abcef6f3cb8032e3f049f1721931078d6d3682
1 file changed
+16
-2
lib/exchange/provider/chainflip_exchange_provider.dart
+16
-2
@@ -202,7 +202,7 @@ class ChainflipExchangeProvider extends ExchangeProvider {
202
203
final swapResponse = await _openDepositChannel(swapParams);
204
205
- final id = '${swapResponse['issuedBlock']}-${swapResponse['network'].toString().toUpperCase()}-${swapResponse['channelId']}';
205
+ final id = '${swapResponse['issuedBlock']}-${swapResponse['network'].toString()}-${swapResponse['channelId']}';
206
207
ExchangeProviderLogger.logSuccess(
208
provider: description,
@@ -268,11 +268,13 @@ class ChainflipExchangeProvider extends ExchangeProvider {
268
Future<Trade> findTradeById({required String id}) async {
269
try {
270
final channelParts = id.split('-');
271
+ final network = channelParts[1];
272
+ final normalizedNetwork = _normalizeNetworkName(network);
273
274
final statusParams = {
275
'apiKey': _affiliateKey,
276
'issuedBlock': channelParts[0],
275
- 'network': channelParts[1],
277
+ 'network': normalizedNetwork,
278
'channelId': channelParts[2]
279
};
280
@@ -334,6 +336,18 @@ class ChainflipExchangeProvider extends ExchangeProvider {
336
return '$title.$tag';
337
}
338
339
+ String _normalizeNetworkName (String name) {
340
+ final networkName = switch (name) {
341
+ 'BITCOIN' => 'Bitcoin',
342
+ 'ETHEREUM' => 'Ethereum',
343
+ 'SOLANA' => 'Solana',
344
+ _ => name
345
+ };
346
+
347
+ return networkName;
348
+ }
349
+
350
+
351
CryptoCurrency? _toCurrency(String name) {
352
final currency = switch (name) {
353
'btc.btc' => CryptoCurrency.btc,