How to import an actor

I created two actors in the motoko playground and one needs to call the other. What is the proper syntax for doing so?

Interesting, never tried before :wink:

I think you need two playgrounds, one for each actor.
Then, deploy first actor and import the canister in the second actor (see screenshot).

Finally, you can import the first canister in the second canister

import Echo "canister:main";


First Actor → Motoko Playground - DFINITY

Second Actor → Motoko Playground - DFINITY


Thank you spiderman! this is super helpful!

1 Like