fix:near intents fixed-rate underpayment (#3247)
Serhii committed
May 26, 2026 at 16:08 UTC
d38db977da0c26a0ae7d8eb4e48ed93db7e27869
1 file changed
+6
-1
lib/exchange/provider/near_Intents_exchange_provider.dart
+6
-1
@@ -251,6 +251,11 @@ class NearIntentsExchangeProvider extends ExchangeProvider {
251
final quoteObj = quote['quote'] as Map<String, dynamic>;
252
final depositAddress = quoteObj['depositAddress'] as String;
253
final depositMemo = quoteObj['depositMemo'] as String?;
254
+ final depositAmount = quoteObj['amountInFormatted'] as String?;
255
+
256
+ if (depositAmount == null) {
257
+ throw Exception('Deposit amount is null in quote response');
258
+ }
259
260
final quoteRequest = quote['quoteRequest'] as Map<String, dynamic>;
261
final fromAssetId = quoteRequest['originAsset'] as String;
@@ -284,7 +289,7 @@ class NearIntentsExchangeProvider extends ExchangeProvider {
289
inputAddress: depositAddress,
290
payoutAddress: request.toAddress,
291
refundAddress: request.refundAddress,
287
- amount: request.fromAmount,
292
+ amount: depositAmount,
293
receiveAmount: quoteObj['amountOutFormatted']?.toString(),
294
memo: depositMemo,
295
isSendAll: isSendAll,