Help on deploying a wallet canister for an identity

I just created a new identity on the command line and I would like to deploy a wallet canister for it. What kind of a canister should this be? I can just use any canister of my own that is live on the main network and convert it to a wallet canister? Even if it already have some code?

To use a wallet canister with dfx it has to support a certain interface. It’s probably easiest to just use the code that’s shipped with dfx. If you have other code already installed in your canister then you have to first uninstall that with dfx canister uninstall-code <canister id>. Then you can dfx identity deploy-wallet <canister id> to install the wallet code and set it as your identity’s wallet.

If you already have a cycles wallet on a different identity and would like to use it with both identities let me know and I’ll write the steps out for that

2 Likes

Okay thank you, and yes I have a cycles wallet associated with another identity and I would like to use it with my new identity as well. Please go ahead and help me with the steps for that. That’s actually what I really wanted.

If you want the second identity to have full control over the wallet then I’d add it as a controller too. You can do that with dfx canister update-settings <wallet id> --add-controller <new principal>.

Then, to authorise a new identity you have to call authorize on the wallet: dfx canister call <wallet id> authorize '(principal "<new identity principal")'

And as a final step configure the new identity to use the wallet: dfx identity set-wallet <wallet id>

3 Likes