( canisterId: string, network: string, identity: Identity, )
| 33 | }; |
| 34 | |
| 35 | export const createStationActor = async ( |
| 36 | canisterId: string, |
| 37 | network: string, |
| 38 | identity: Identity, |
| 39 | ): Promise<ActorSubclass> => { |
| 40 | const host = await resolveHost(network); |
| 41 | const agent = new HttpAgent({ host, identity }); |
| 42 | if (network !== 'ic') { |
| 43 | // Local replicas need their root key fetched to verify certificates. |
| 44 | await agent.fetchRootKey(); |
| 45 | } |
| 46 | return Actor.createActor(idlFactory, { agent, canisterId }); |
| 47 | }; |
no test coverage detected