(canisterName: string, host = DEFAULT_HOST)
| 31 | }; |
| 32 | // Exports |
| 33 | const getCanister = (canisterName: string, host = DEFAULT_HOST) => { |
| 34 | const candid = eval(getCandid(canisterName)); |
| 35 | const canisterId = getCanisterId(canisterName); |
| 36 | const config = { fetch, host }; |
| 37 | if (credentials.name && credentials.password) { |
| 38 | // @ts-ignore |
| 39 | config.credentials = credentials; |
| 40 | } |
| 41 | const agent = new HttpAgent(config); |
| 42 | agent.addTransform(makeNonceTransform()); |
| 43 | agent.addTransform(makeExpiryTransform(5 * 60 * 1000)); |
| 44 | |
| 45 | return makeActorFactory(candid)({ canisterId, agent }); |
| 46 | }; |
| 47 | |
| 48 | // Helpers |
| 49 |
no test coverage detected