How to query the canister controlled by the current principal

I recently used CMC’s notify_create_canister to create a canister, and the return value contained this canister id.

However, for fault tolerance reasons, I would like to know how I can find the ID of the created canister if I did not store it.

Or, how can I query the list of canisters currently controlled by the principal?

  • If you have the height for the ICP transfer used in canister creation then you can call the end point again and it should return the canister id. The CMC caches this information for a (long) while.

  • The protocol does not offer the functionality to list canisters controlled by a certain principal

I understand that for privacy reasons, it should not be possible to query the list of canisters controlled by a particular principal.

But shouldn’t it be possible for the currently logged-in account to query the list of canisters it controls?

However, thank you for suggesting the method of querying the return value by block height, which should be very useful.