Get assets canister cycles balance

Hello developers!

If there is a possibility to ask the asset canister ({“type”: “assets”} in dfx.json) for it’s cycles balance programmatically?

I would like to monitor cycles balance in Prometheus.
Currently all my Motoko canisters has a public query method to return cycles using ExperimentalCycles module.
Is there is a way to do it with asset canisters?

Only way I know is to get it using “dfx” command line.

I am thinking… I can fork “certified-assets” repo and add additional logic to it…

1 Like

For any canister you can add the blackhole canister as an additional controller and then anyone can query the cycle balance through that canister.

In fact, that should be considered best practice for anyone who don’t mind the public to see this data. And then pages like (pinging @wang) can display cycle balances, maybe even graph them over time…

1 Like