11use std:: collections:: HashMap ;
22
3- use crate :: { DRepChoice , KeyHash , PoolId , PoolLiveStakeInfo , StakeAddress } ;
3+ use crate :: { DRepChoice , KeyHash , PoolId , PoolLiveStakeInfo , StakeAddress , TxIdentifier } ;
44
55pub const DEFAULT_ACCOUNTS_QUERY_TOPIC : ( & str , & str ) =
66 ( "accounts-state-query-topic" , "cardano.query.accounts" ) ;
@@ -15,10 +15,10 @@ pub enum AccountsStateQuery {
1515 GetAccountInfo { stake_address : StakeAddress } ,
1616 GetAccountRewardHistory { stake_key : Vec < u8 > } ,
1717 GetAccountHistory { stake_key : Vec < u8 > } ,
18- GetAccountDelegationHistory { stake_key : Vec < u8 > } ,
19- GetAccountRegistrationHistory { stake_key : Vec < u8 > } ,
18+ GetAccountRegistrationHistory { account : StakeAddress } ,
19+ GetAccountDelegationHistory { account : StakeAddress } ,
20+ GetAccountMIRHistory { account : StakeAddress } ,
2021 GetAccountWithdrawalHistory { stake_key : Vec < u8 > } ,
21- GetAccountMIRHistory { stake_key : Vec < u8 > } ,
2222 GetAccountAssociatedAddresses { stake_key : Vec < u8 > } ,
2323 GetAccountAssets { stake_key : Vec < u8 > } ,
2424 GetAccountAssetsTotals { stake_key : Vec < u8 > } ,
@@ -49,10 +49,10 @@ pub enum AccountsStateQueryResponse {
4949 AccountInfo ( AccountInfo ) ,
5050 AccountRewardHistory ( AccountRewardHistory ) ,
5151 AccountHistory ( AccountHistory ) ,
52- AccountDelegationHistory ( AccountDelegationHistory ) ,
53- AccountRegistrationHistory ( AccountRegistrationHistory ) ,
52+ AccountRegistrationHistory ( Vec < RegistrationUpdate > ) ,
53+ AccountDelegationHistory ( Vec < DelegationUpdate > ) ,
54+ AccountMIRHistory ( Vec < AccountWithdrawal > ) ,
5455 AccountWithdrawalHistory ( AccountWithdrawalHistory ) ,
55- AccountMIRHistory ( AccountMIRHistory ) ,
5656 AccountAssociatedAddresses ( AccountAssociatedAddresses ) ,
5757 AccountAssets ( AccountAssets ) ,
5858 AccountAssetsTotals ( AccountAssetsTotals ) ,
@@ -97,17 +97,52 @@ pub struct AccountRewardHistory {}
9797#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
9898pub struct AccountHistory { }
9999
100- #[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
101- pub struct AccountDelegationHistory { }
100+ #[ derive(
101+ Debug , Clone , serde:: Serialize , serde:: Deserialize , minicbor:: Decode , minicbor:: Encode ,
102+ ) ]
103+ pub struct DelegationUpdate {
104+ #[ n( 0 ) ]
105+ pub active_epoch : u32 ,
106+ #[ n( 1 ) ]
107+ pub tx_identifier : TxIdentifier ,
108+ #[ n( 2 ) ]
109+ pub amount : u64 ,
110+ #[ n( 3 ) ]
111+ pub pool : PoolId ,
112+ }
102113
103- #[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
104- pub struct AccountRegistrationHistory { }
114+ #[ derive(
115+ Debug , Clone , serde:: Serialize , serde:: Deserialize , minicbor:: Decode , minicbor:: Encode ,
116+ ) ]
117+ pub struct RegistrationUpdate {
118+ #[ n( 0 ) ]
119+ pub tx_identifier : TxIdentifier ,
120+ #[ n( 1 ) ]
121+ pub status : RegistrationStatus ,
122+ }
105123
106- #[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
107- pub struct AccountWithdrawalHistory { }
124+ #[ derive(
125+ Debug , Clone , serde:: Serialize , serde:: Deserialize , minicbor:: Decode , minicbor:: Encode ,
126+ ) ]
127+ pub enum RegistrationStatus {
128+ #[ n( 0 ) ]
129+ Registered ,
130+ #[ n( 1 ) ]
131+ Deregistered ,
132+ }
133+
134+ #[ derive(
135+ Debug , Clone , serde:: Serialize , serde:: Deserialize , minicbor:: Decode , minicbor:: Encode ,
136+ ) ]
137+ pub struct AccountWithdrawal {
138+ #[ n( 0 ) ]
139+ pub tx_identifier : TxIdentifier ,
140+ #[ n( 1 ) ]
141+ pub amount : u64 ,
142+ }
108143
109144#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
110- pub struct AccountMIRHistory { }
145+ pub struct AccountWithdrawalHistory { }
111146
112147#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
113148pub struct AccountAssociatedAddresses { }
0 commit comments