Calling functions with the wallet vs. the identity principal

Can we get a 0.7.0 update on this topic: [dfx] How to call a canister as the identity's wallet canister Principal

I’ve figured out that I can deploy my code with my identity’s principal by using --no-wallet, but when I try to call a function I don’t know how to make that request not go through the wallet.

I’ve tried:

dfx --identity alice canister call DIP20 transfer '(principal "2xfbh-2kl3t-zjqah-cxkrg-2zq5u-rid2q-sf2i6-bqxs2-2qxri-l5z4b-jae", 42)'

but I see the wallet ID when I do a D.print(debug_show(msg));

[Canister rwlgt-iiaaa-aaaaa-aaaaa-cai] {caller = ryjl3-tyaaa-aaaaa-aaaba-cai}

Maybe I shouldn’t be deploying with --no-wallet? Can I assume that all principals will have a wallet?

The principal and the wallet id look like fundamentally different structures and I’m not sure if they are equivalent.

I’m basically trying to duplicate the ERC20 standard and I need to know what principle I should be using for my map[ID, amount]. Should I use the principal created with dfx identity new alice; dfx identity get-principal; or dfx identity new alice; dfx identity get-wallet;?

If I later want to assign my tokens to canisters will they have a wallet? What will come through as msg.caller?

cc @dpdp

dfx --identity alice canister --network devnet --no-wallet call some_canister whoami

It works for me

There are existing token standards you can check out as well, based on ERC20 e.g.: GitHub - enzoh/motoko-token: The Token Package

Another one, which I prefer, is more similar to a multi-token standard: proposals/ at master · sailfish-app/proposals · GitHub

1 Like

When I move from dfx to making these calls from a web interface, are the calls going to go through my principal or my wallet? How do you distinguish between the two?

1 Like