@@ -5,11 +5,13 @@ import {
55 ChainState ,
66 ChequebookAddressResponse ,
77 ChequebookBalanceResponse ,
8+ DebugStatus ,
89 LastChequesResponse ,
910 NodeAddresses ,
1011 NodeInfo ,
1112 Peer ,
1213 PeerBalance ,
14+ RedistributionState ,
1315 Topology ,
1416 WalletBalance ,
1517} from '@ethersphere/bee-js'
@@ -49,6 +51,7 @@ interface ContextInterface {
4951 apiHealth : boolean
5052 nodeAddresses : NodeAddresses | null
5153 nodeInfo : NodeInfo | null
54+ nodeStatus : DebugStatus | null
5255 topology : Topology | null
5356 chequebookAddress : ChequebookAddressResponse | null
5457 peers : Peer [ ] | null
@@ -59,6 +62,7 @@ interface ContextInterface {
5962 settlements : AllSettlements | null
6063 chainState : ChainState | null
6164 walletBalance : WalletBalance | null
65+ redistributionState : RedistributionState | null
6266 latestBeeRelease : LatestBeeRelease | null
6367 isLoading : boolean
6468 lastUpdate : number | null
@@ -79,6 +83,7 @@ const initialValues: ContextInterface = {
7983 apiHealth : false ,
8084 nodeAddresses : null ,
8185 nodeInfo : null ,
86+ nodeStatus : null ,
8287 topology : null ,
8388 chequebookAddress : null ,
8489 stake : null ,
@@ -89,6 +94,7 @@ const initialValues: ContextInterface = {
8994 settlements : null ,
9095 chainState : null ,
9196 walletBalance : null ,
97+ redistributionState : null ,
9298 latestBeeRelease : null ,
9399 isLoading : true ,
94100 lastUpdate : null ,
@@ -172,6 +178,7 @@ export function Provider({ children }: Props): ReactElement {
172178 const [ apiHealth , setApiHealth ] = useState < boolean > ( false )
173179 const [ nodeAddresses , setNodeAddresses ] = useState < NodeAddresses | null > ( null )
174180 const [ nodeInfo , setNodeInfo ] = useState < NodeInfo | null > ( null )
181+ const [ nodeStatus , setNodeStatus ] = useState < DebugStatus | null > ( null )
175182 const [ topology , setNodeTopology ] = useState < Topology | null > ( null )
176183 const [ chequebookAddress , setChequebookAddress ] = useState < ChequebookAddressResponse | null > ( null )
177184 const [ peers , setPeers ] = useState < Peer [ ] | null > ( null )
@@ -182,6 +189,7 @@ export function Provider({ children }: Props): ReactElement {
182189 const [ settlements , setSettlements ] = useState < AllSettlements | null > ( null )
183190 const [ chainState , setChainState ] = useState < ChainState | null > ( null )
184191 const [ walletBalance , setWalletBalance ] = useState < WalletBalance | null > ( null )
192+ const [ redistributionState , setRedistributionState ] = useState < RedistributionState | null > ( null )
185193 const [ startedAt ] = useState ( Date . now ( ) )
186194
187195 const { latestBeeRelease } = useLatestBeeRelease ( )
@@ -257,6 +265,12 @@ export function Provider({ children }: Props): ReactElement {
257265 . then ( setNodeInfo )
258266 . catch ( ( ) => setNodeInfo ( null ) ) ,
259267
268+ // NodeDebugInfo
269+ beeApi
270+ . getStatus ( { timeout : TIMEOUT } )
271+ . then ( setNodeStatus )
272+ . catch ( ( ) => setNodeInfo ( null ) ) ,
273+
260274 // Network Topology
261275 beeApi
262276 . getTopology ( { timeout : TIMEOUT } )
@@ -304,6 +318,12 @@ export function Provider({ children }: Props): ReactElement {
304318 . then ( stake => setStake ( stake ) )
305319 . catch ( ( ) => setStake ( null ) ) ,
306320
321+ // Redistribution stats
322+ beeApi
323+ . getRedistributionState ( { timeout : TIMEOUT } )
324+ . then ( setRedistributionState )
325+ . catch ( ( ) => setRedistributionState ( null ) ) ,
326+
307327 // Peer balances
308328 beeApi
309329 . getAllBalances ( { timeout : TIMEOUT } )
@@ -362,6 +382,7 @@ export function Provider({ children }: Props): ReactElement {
362382 apiHealth,
363383 nodeAddresses,
364384 nodeInfo,
385+ nodeStatus,
365386 topology,
366387 chequebookAddress,
367388 peers,
@@ -372,6 +393,7 @@ export function Provider({ children }: Props): ReactElement {
372393 settlements,
373394 chainState,
374395 walletBalance,
396+ redistributionState,
375397 latestBeeRelease,
376398 isLoading,
377399 lastUpdate,
0 commit comments