@@ -177,11 +177,54 @@ pub fn register_submit_swap_order(module: &mut RpcModule<RpcContext>) {
177
177
PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
178
178
) ) ) ;
179
179
} ;
180
+
181
+ let Some ( gas_type_base) = user_trade_info_data. gas_type_base else {
182
+ log:: error!( "Response data.gas_type_base of call get_user_trade_info is none" ) ;
183
+ return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: ServerError (
184
+ PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
185
+ ) ) ) ;
186
+ } ;
187
+
188
+ let Some ( gas_type_bsc) = user_trade_info_data. gas_type_bsc else {
189
+ log:: error!( "Response data.gas_type_bsc of call get_user_trade_info is none" ) ;
190
+ return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: ServerError (
191
+ PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
192
+ ) ) ) ;
193
+ } ;
194
+
195
+ let Some ( gas_type_eth) = user_trade_info_data. gas_type_eth else {
196
+ log:: error!( "Response data.gas_type_eth of call get_user_trade_info is none" ) ;
197
+ return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: ServerError (
198
+ PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
199
+ ) ) ) ;
200
+ } ;
201
+
202
+ let Some ( is_anti_mev) = user_trade_info_data. is_anti_mev else {
203
+ log:: error!( "Response data.is_anti_mev of call get_user_trade_info is none" ) ;
204
+ return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: ServerError (
205
+ PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
206
+ ) ) ) ;
207
+ } ;
208
+
209
+ let Some ( is_auto_slippage) = user_trade_info_data. is_auto_slippage else {
210
+ log:: error!( "Response data.is_auto_slippage of call get_user_trade_info is none" ) ;
211
+ return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: ServerError (
212
+ PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
213
+ ) ) ) ;
214
+ } ;
215
+
216
+ let Some ( slippage) = user_trade_info_data. slippage else {
217
+ log:: error!( "Response data.slippage of call get_user_trade_info is none" ) ;
218
+ return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: ServerError (
219
+ PUMPX_API_GET_ACCOUNT_USER_ID_FAILED_CODE ,
220
+ ) ) ) ;
221
+ } ;
222
+
180
223
let gas_type = match params. to_chain_id {
181
- BASE_CHAIN_ID => user_trade_info_data . gas_type_base . to_number ( ) as u32 ,
182
- ETHEREUM_CHAIN_ID => user_trade_info_data . gas_type_eth . to_number ( ) as u32 ,
183
- BSC_CHAIN_ID => user_trade_info_data . gas_type_bsc . to_number ( ) as u32 ,
184
- SOLANA_CHAIN_ID => user_trade_info_data . gas_type_base . to_number ( ) as u32 ,
224
+ BASE_CHAIN_ID => gas_type_base. to_number ( ) as u32 ,
225
+ ETHEREUM_CHAIN_ID => gas_type_eth. to_number ( ) as u32 ,
226
+ BSC_CHAIN_ID => gas_type_bsc. to_number ( ) as u32 ,
227
+ SOLANA_CHAIN_ID => gas_type_base. to_number ( ) as u32 ,
185
228
_ => {
186
229
log:: error!( "Unsupported chain id: {}" , params. to_chain_id) ;
187
230
return Err ( PumpxRpcError :: from_error_code ( ErrorCode :: InvalidParams ) ) ;
@@ -238,10 +281,10 @@ pub fn register_submit_swap_order(module: &mut RpcModule<RpcContext>) {
238
281
) ?,
239
282
double_out : params. double_out ,
240
283
is_one_click : params. is_one_click ,
241
- is_anti_mev : user_trade_info_data . is_anti_mev ,
242
- is_auto_slippage : user_trade_info_data . is_auto_slippage ,
284
+ is_anti_mev,
285
+ is_auto_slippage,
243
286
gas_type,
244
- slippage : user_trade_info_data . slippage ,
287
+ slippage,
245
288
wallet_index : params. wallet_index ,
246
289
token_cap,
247
290
price_usd,
0 commit comments