How to check the ICP token address of my user?

Having an Internet Identity account, in my code I want to determine the ICP token address of the user.

At least, I want to check the given ICP token address, whether it belongs to the current user.


What language are you trying to do this in? Every library that provides an interface to the ledger should be able to do this. If you want to do it manually, use dfx ledger account-id --of-principal <principal>

I am trying to do it in Motoko language.

The best I know for Motoko is this file: examples/motoko/ledger-transfer/src/ledger_transfer/ at master · dfinity/examples · GitHub