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";

Example:

First Actor → Motoko Playground - DFINITY

Second Actor → Motoko Playground - DFINITY

4 Likes

Thank you spiderman! this is super helpful!

1 Like