File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,16 @@ export async function getStakeActivation(
33
33
} ) ( ) ,
34
34
] ) ;
35
35
36
- const { effective, activating, deactivating } =
36
+ const { effective, activating, deactivating } = stakeAccount . stake ?
37
37
getStakeActivatingAndDeactivating (
38
38
stakeAccount . stake . delegation ,
39
39
BigInt ( epochInfo . epoch ) ,
40
40
stakeHistory
41
- ) ;
41
+ ) : {
42
+ effective : BigInt ( 0 ) ,
43
+ activating : BigInt ( 0 ) ,
44
+ deactivating : BigInt ( 0 ) ,
45
+ } ;
42
46
43
47
let status ;
44
48
if ( deactivating > 0 ) {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export type StakeAccount = {
31
31
stake : {
32
32
delegation : Delegation ,
33
33
creditsObserved : bigint
34
- }
34
+ } | null
35
35
}
36
36
37
37
export const getStakeHistory = function ( parsedData : RpcResponseAndContext < AccountInfo < ParsedAccountData | Buffer > | null > ) : StakeHistoryEntry [ ] {
@@ -77,14 +77,14 @@ export const getStakeAccount = function (parsedData: RpcResponseAndContext<Accou
77
77
custodian : parsedData . value . data . parsed . info . meta . lockup . custodian
78
78
}
79
79
} ,
80
- stake : {
80
+ stake : parsedData . value . data . parsed . info . stake ? {
81
81
delegation : {
82
82
voterPubkey : parsedData . value . data . parsed . info . stake . delegation . voterPubkey ,
83
83
stake : BigInt ( parsedData . value . data . parsed . info . stake . delegation . stake ) ,
84
84
activationEpoch : BigInt ( parsedData . value . data . parsed . info . stake . delegation . activationEpoch ) ,
85
85
deactivationEpoch : BigInt ( parsedData . value . data . parsed . info . stake . delegation . deactivationEpoch ) ,
86
86
} ,
87
87
creditsObserved : BigInt ( parsedData . value . data . parsed . info . stake . creditsObserved )
88
- }
88
+ } : null
89
89
}
90
90
}
You can’t perform that action at this time.
0 commit comments