2.0.0 • Published 3 years ago

ic-stoic-identity v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Stoic Identity

Stoic Identity is an ICP Identity that works directly with the @dfinity/agent for signing canister messages using your StoicWallet.com account. Stoic Identity allows 3rd party dapps to connect to your wallet using a local-only bridge. Applications must request authorization to connect to your wallet, and can only access your wallet on your local PC with the web-wallet unlocked.

3rd party developers are not granted direct remote access - only local, and you can revoke local access directly from the StoicWallet app. Your private keys are not exposed, but if you authorize your wallet with an application than that application can sign any canister message on your behalf.

In future, we will add canister scopes to authorization requests, so applications must define which canister ID's they will use with their application.

screen-capture (5)

Installation

npm i ic-stoic-identity --save-dev

In the browser:

import {StoicIdentity} from "ic-stoic-identity";

Usage:

StoicIdentity.load().then(async identity => {
  if (identity !== false) {
    //ID is a already connected wallet!
  } else {
    //No existing connection, lets make one!
    identity = await StoicIdentity.connect();
  }
  
  //Lets display the connected principal!
  console.log(identity.getPrincipal().toText());
  
  //Create an actor canister
  const actor = Actor.createActor(idlFactory, {
    agent: new HttpAgent({
      identity,
    }),
    canisterId,
  });
  
  //Disconnect after
  StoicIdentity.disconnect();
})

Authorization in StoicWallet:

image

Manage Applications in StoicWallet:

image

2.0.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago