Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/command/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Status extends RootCommand implements LeafCommand {
public readonly description = 'Check Bee status'

public async run(): Promise<void> {
await super.init()
super.init()

this.console.all(chalk.bold('Bee'))
process.stdout.write(createKeyValue('API', this.beeApiUrl))
Expand Down Expand Up @@ -44,6 +44,15 @@ export class Status extends RootCommand implements LeafCommand {
const { bzzBalance, nativeTokenBalance } = await this.bee.getWalletBalance()
this.console.all(createKeyValue('xBZZ', Numbers.fromDecimals(bzzBalance, 16)))
this.console.all(createKeyValue('xDAI', Numbers.fromDecimals(nativeTokenBalance, 18)))
this.console.all('')
this.console.all(chalk.bold('Chainsync'))
const { block, chainTip } = await this.bee.getChainState()
this.console.all(
createKeyValue(
'Block',
`${block.toLocaleString()} / ${chainTip.toLocaleString()} (Δ ${(chainTip - block).toLocaleString()})`,
),
)
}

if (nodeInfo.beeMode !== BeeModes.ULTRA_LIGHT && nodeInfo.beeMode !== BeeModes.DEV) {
Expand Down
11 changes: 11 additions & 0 deletions test/http-mock/cheque-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export function createChequeMockHttpServer(port: number): Server {
response.end(JSON.stringify(balance))
}

if (request.url === '/chainstate') {
response.end(JSON.stringify(chainstate))
}

if (request.url === '/wallet') {
response.end(JSON.stringify(wallet))
}
Expand Down Expand Up @@ -92,6 +96,13 @@ const lastCashoutCheque1 = {

const balance = { totalBalance: '100026853000000000', availableBalance: '100018560000000000' }

const chainstate = {
chainTip: 37439274,
block: 37439270,
totalAmount: '153434201871',
currentPrice: '27356',
}

const wallet = {
bzzBalance: '3904697022414848',
nativeTokenBalance: '96106482372132023',
Expand Down
Loading