11use std:: collections:: HashMap ;
22
3- use crate :: { DRepChoice , KeyHash , PoolId , PoolLiveStakeInfo , StakeAddress , TxIdentifier } ;
3+ use crate :: {
4+ DRepChoice , KeyHash , PoolId , PoolLiveStakeInfo , RewardType , StakeAddress , TxIdentifier ,
5+ } ;
46
57pub const DEFAULT_ACCOUNTS_QUERY_TOPIC : ( & str , & str ) =
68 ( "accounts-state-query-topic" , "cardano.query.accounts" ) ;
@@ -12,8 +14,8 @@ pub const DEFAULT_HISTORICAL_ACCOUNTS_QUERY_TOPIC: (&str, &str) = (
1214
1315#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
1416pub enum AccountsStateQuery {
15- GetAccountInfo { stake_address : StakeAddress } ,
16- GetAccountRewardHistory { stake_key : Vec < u8 > } ,
17+ GetAccountInfo { account : StakeAddress } ,
18+ GetAccountRewardHistory { account : StakeAddress } ,
1719 GetAccountHistory { stake_key : Vec < u8 > } ,
1820 GetAccountRegistrationHistory { account : StakeAddress } ,
1921 GetAccountDelegationHistory { account : StakeAddress } ,
@@ -47,7 +49,7 @@ pub enum AccountsStateQuery {
4749#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
4850pub enum AccountsStateQueryResponse {
4951 AccountInfo ( AccountInfo ) ,
50- AccountRewardHistory ( AccountRewardHistory ) ,
52+ AccountRewardHistory ( Vec < AccountReward > ) ,
5153 AccountHistory ( AccountHistory ) ,
5254 AccountRegistrationHistory ( Vec < RegistrationUpdate > ) ,
5355 AccountDelegationHistory ( Vec < DelegationUpdate > ) ,
@@ -91,9 +93,6 @@ pub struct AccountInfo {
9193 pub delegated_drep : Option < DRepChoice > ,
9294}
9395
94- #[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
95- pub struct AccountRewardHistory { }
96-
9796#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
9897pub struct AccountHistory { }
9998
@@ -150,6 +149,20 @@ pub struct AccountWithdrawal {
150149 pub amount : u64 ,
151150}
152151
152+ #[ derive(
153+ Debug , Clone , minicbor:: Decode , minicbor:: Encode , serde:: Serialize , serde:: Deserialize ,
154+ ) ]
155+ pub struct AccountReward {
156+ #[ n( 0 ) ]
157+ pub epoch : u32 ,
158+ #[ n( 1 ) ]
159+ pub amount : u64 ,
160+ #[ n( 2 ) ]
161+ pub pool : PoolId ,
162+ #[ n( 3 ) ]
163+ pub reward_type : RewardType ,
164+ }
165+
153166#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
154167pub struct AccountWithdrawalHistory { }
155168
0 commit comments