Extract method name and canister prinicipal from a shared method

Maybe I don’t exactly understand what you are doing, but you should be able to query the candid in the system metadata for all modern canisters.

As far as the canister I’d, if it is a class you can set it equal to “this”.