@@ -403,7 +403,8 @@ pub_struct!(Deserialize; CreateBoostQuery {
403403pub struct ZkLendReward {
404404 pub amount : Amount ,
405405 pub claim_contract : FieldElement ,
406- pub claim_id : u64 ,
406+ #[ serde( default ) ]
407+ pub claim_id : Option < u64 > ,
407408 pub claimed : bool ,
408409 pub proof : Vec < String > ,
409410 pub recipient : String ,
@@ -466,12 +467,24 @@ pub struct NimboraRewards {
466467}
467468
468469// Ekubo Reward Structs
470+ use serde:: de:: { self , Deserializer } ;
471+
472+ fn string_or_null < ' de , D > ( deserializer : D ) -> Result < Option < String > , D :: Error >
473+ where
474+ D : Deserializer < ' de > ,
475+ {
476+ Option :: < String > :: deserialize ( deserializer)
477+ }
478+
469479#[ derive( Serialize , Deserialize , Debug ) ]
470480pub struct EkuboRewards {
471481 pub contract_address : FieldElement ,
472- pub token : String ,
473- pub start_date : String ,
474- pub end_date : String ,
482+ #[ serde( default , deserialize_with = "string_or_null" ) ]
483+ pub token : Option < String > ,
484+ #[ serde( default , deserialize_with = "string_or_null" ) ]
485+ pub start_date : Option < String > ,
486+ #[ serde( default , deserialize_with = "string_or_null" ) ]
487+ pub end_date : Option < String > ,
475488 pub claim : Claim ,
476489 pub proof : Vec < String > ,
477490}
@@ -495,6 +508,7 @@ pub struct VesuData {
495508pub struct VesuDistributorData {
496509 pub distributed_amount : String ,
497510 pub claimed_amount : String ,
511+ #[ serde( default ) ]
498512 pub call_data : Option < VesuCallData > ,
499513}
500514
0 commit comments