@@ -3,7 +3,7 @@ import 'package:cosmos_sdk/src/utils/quick.dart';
33class ThoreNodeQouteSwapResponse {
44 final String inboundAddress;
55 final BigInt ? inboundConfirmationBlocks;
6- final BigInt ? inboundConfirmationSeconds;
6+ final int inboundConfirmationSeconds;
77 final BigInt ? outboundDelayBlocks;
88 final BigInt ? outboundDelaySeconds;
99 final String ? router;
@@ -16,10 +16,10 @@ class ThoreNodeQouteSwapResponse {
1616 final String ? gasRateUnits;
1717 final String ? memo;
1818 final BigInt expectedAmountOut;
19- final BigInt ? maxStreamingQuantity;
20- final BigInt ? streamingSwapBlocks;
21- final BigInt ? streamingSwapSeconds;
22- final int ? totalSwapSeconds;
19+ final int maxStreamingQuantity;
20+ final int streamingSwapBlocks;
21+ final int streamingSwapSeconds;
22+ final int totalSwapSeconds;
2323 final ThoreNodeQouteSwapFeeResponse fees;
2424 ThoreNodeQouteSwapResponse (
2525 {required this .inboundAddress,
@@ -48,7 +48,7 @@ class ThoreNodeQouteSwapResponse {
4848 inboundAddress: json.as ("inbound_address" ),
4949 inboundConfirmationBlocks: json.asBigInt ("inbound_confirmation_blocks" ),
5050 inboundConfirmationSeconds:
51- json.asBigInt ("inbound_confirmation_seconds" ),
51+ json.asInt < int ?> ("inbound_confirmation_seconds" ) ?? 0 ,
5252 outboundDelayBlocks: json.asBigInt ("outbound_delay_blocks" ),
5353 outboundDelaySeconds: json.asBigInt ("outbound_delay_seconds" ),
5454 router: json.as ("router" ),
@@ -61,17 +61,17 @@ class ThoreNodeQouteSwapResponse {
6161 gasRateUnits: json.as ("gas_rate_units" ),
6262 memo: json.as ("memo" ),
6363 expectedAmountOut: json.asBigInt ("expected_amount_out" ),
64- maxStreamingQuantity: json.asBigInt ("max_streaming_quantity" ),
65- streamingSwapBlocks: json.asBigInt ("streaming_swap_blocks" ),
66- streamingSwapSeconds: json.asBigInt ("streaming_swap_seconds" ),
67- totalSwapSeconds: json.asInt ("total_swap_seconds" ),
64+ maxStreamingQuantity: json.asInt < int ?> ("max_streaming_quantity" ) ?? 0 ,
65+ streamingSwapBlocks: json.asInt < int ?> ("streaming_swap_blocks" ) ?? 0 ,
66+ streamingSwapSeconds: json.asInt < int ?> ("streaming_swap_seconds" ) ?? 0 ,
67+ totalSwapSeconds: json.asInt < int ?> ("total_swap_seconds" ) ?? 0 ,
6868 fees: ThoreNodeQouteSwapFeeResponse .fromJson (json.asMap ("fees" )));
6969 }
7070 Map <String , dynamic > toJson () {
7171 return {
7272 "inbound_address" : inboundAddress,
7373 "inbound_confirmation_blocks" : inboundConfirmationBlocks? .toString (),
74- "inbound_confirmation_seconds" : inboundConfirmationSeconds? .toString (),
74+ "inbound_confirmation_seconds" : inboundConfirmationSeconds.toString (),
7575 "outbound_delay_blocks" : outboundDelayBlocks? .toString (),
7676 "outbound_delay_seconds" : outboundDelaySeconds? .toString (),
7777 "router" : router,
@@ -84,10 +84,10 @@ class ThoreNodeQouteSwapResponse {
8484 "gas_rate_units" : gasRateUnits,
8585 "memo" : memo,
8686 "expected_amount_out" : expectedAmountOut.toString (),
87- "max_streaming_quantity" : maxStreamingQuantity? . toString () ,
88- "streaming_swap_blocks" : streamingSwapBlocks? . toString () ,
89- "streaming_swap_seconds" : streamingSwapSeconds? . toString () ,
90- "total_swap_seconds" : totalSwapSeconds? . toString () ,
87+ "max_streaming_quantity" : maxStreamingQuantity,
88+ "streaming_swap_blocks" : streamingSwapBlocks,
89+ "streaming_swap_seconds" : streamingSwapSeconds,
90+ "total_swap_seconds" : totalSwapSeconds,
9191 "fees" : fees.toJson (),
9292 };
9393 }
@@ -99,8 +99,8 @@ class ThoreNodeQouteSwapFeeResponse {
9999 final String ? outbound;
100100 final String liquidity;
101101 final String total;
102- final BigInt slippageBps;
103- final BigInt totalBps;
102+ final int slippageBps;
103+ final int totalBps;
104104 const ThoreNodeQouteSwapFeeResponse (
105105 {required this .asset,
106106 required this .affiliate,
@@ -116,8 +116,8 @@ class ThoreNodeQouteSwapFeeResponse {
116116 outbound: json.as ("outbound" ),
117117 liquidity: json.as ("liquidity" ),
118118 total: json.as ("total" ),
119- slippageBps: json.asBigInt ("slippage_bps" ),
120- totalBps: json.asBigInt ("total_bps" ));
119+ slippageBps: json.asInt ("slippage_bps" ),
120+ totalBps: json.asInt ("total_bps" ));
121121 }
122122 Map <String , dynamic > toJson () {
123123 return {
@@ -126,8 +126,8 @@ class ThoreNodeQouteSwapFeeResponse {
126126 "outbound" : outbound,
127127 "liquidity" : liquidity,
128128 "total" : total,
129- "slippage_bps" : slippageBps. toString () ,
130- "total_bps" : totalBps. toString () ,
129+ "slippage_bps" : slippageBps,
130+ "total_bps" : totalBps,
131131 };
132132 }
133133}
0 commit comments