Skip to content

Commit

Permalink
plug wallet canisterId
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin-icnaming committed May 24, 2022
1 parent 5667d2f commit 728efbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/canisters/actorFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ActorFactory {
canisterDid: any,
canisterId: string | Principal
): Promise<ActorSubclass<T>> {
console.log('factory', canisterId)
switch (ActorFactory._wallet?.type) {
case WalletType.II: {
const agent = this.getAgent(ActorFactory._wallet.identity);
Expand All @@ -29,8 +30,12 @@ class ActorFactory {
});
}
case WalletType.Plug: {
let plugCanisterId = ''
if (typeof canisterId !== 'string') {
plugCanisterId = canisterId?.toText()
}
return await window.ic.plug.createActor({
canisterId: canisterId,
canisterId: plugCanisterId,
interfaceFactory: canisterDid,
});
}
Expand Down

0 comments on commit 728efbc

Please sign in to comment.