I initialize user canister (canister installed specifically for the current user) this way:
persistent actor class Wallet({
user: Principal;
backend: Principal;
installationId: Nat;
}) = this {
I want to re-use the same Wallet
code for a regular (not user canister) installation. But then there is no values such as installationId
. So, I don’t know how to initialize it.
I could do like the following:
persistent actor class Wallet(?{
user: Principal;
backend: Principal;
installationId: Nat;
}) = this {
but this complicates my specification (standard) of initializing user canisters.
Is there a better way? maybe something related to to_candid
/from_candid
.