MCPcopy Create free account
hub / github.com/dfinity/orbit / loadIdentity

Method loadIdentity

apps/wallet/src/core/ic-agent.core.ts:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 async loadIdentity(): Promise<void> {
32 const authService = new AuthService();
33 const identity = (await authService.identity()) ?? new AnonymousIdentity();
34
35 await this.init();
36
37 icAgent.get().replaceIdentity(identity);
38 if (identity.getPrincipal().isAnonymous()) {
39 logger.warn('Using anonymous identity, make sure to sign in');
40 }
41 }
42}
43
44const icAgent = new IcAgent();

Callers 2

runMethod · 0.80
runMethod · 0.80

Calls 3

identityMethod · 0.95
initMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected