This repository was archived by the owner on Jan 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ Commands:
4242 meridian set-next-round-length < blocks> Set the next round length
4343 meridian set-round-reward < reward> Set the round reward
4444 meridian tick Trigger a tick
45+ meridian available-balance Get the balance available
4546
4647Options:
4748 -a, --address Contract address (or $MERIDIAN_ADDRESS ) [string] [required]
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121import { setNextRoundLength } from '../commands/set-next-round-length.js'
2222import { setRoundReward } from '../commands/set-round-reward.js'
2323import { tick } from '../commands/tick.js'
24+ import { availableBalance } from '../commands/available-balance.js'
2425
2526const pkg = JSON . parse (
2627 await fs . readFile (
@@ -119,6 +120,12 @@ yargs(hideBin(process.argv))
119120 yargs => yargs ,
120121 tick
121122 )
123+ . command (
124+ 'available-balance' ,
125+ 'Get the balance available' ,
126+ yargs => yargs ,
127+ availableBalance
128+ )
122129 . demandCommand ( )
123130 . version ( `${ pkg . name } : ${ pkg . version } ` )
124131 . alias ( 'v' , 'version' )
Original file line number Diff line number Diff line change 1+ import { createContract } from '../index.js'
2+ import { formatEther } from 'ethers'
3+
4+ export const availableBalance = async opts => {
5+ const { contract } = createContract ( opts )
6+ console . log ( formatEther ( await contract . availableBalance ( ) ) , 'FIL' )
7+ process . exit ( 0 )
8+ }
You can’t perform that action at this time.
0 commit comments