@slide-computer/signer
TypeScript icon, indicating that this package has built-in type declarations

1.8.0 • Public • Published

@slide-computer/signer

JavaScript and TypeScript library to interact with signers on the Internet Computer.


Installation

Using Signer:

npm i --save @slide-computer/signer

In the browser:

import { Signer } from "@slide-computer/signer";

To get started with the signer, run

let signerWindow;
const transport = new PostMessageTransport({
  origin: SIGNER_ORIGIN,
  getWindow: () => {
    if (!signerWindow || signerWindow.closed) {
      signerWindow = window.open(`${SIGNER_ORIGIN}/rpc`, SIGNER_WINDOW_NAME);
    } else {
      signerWindow.focus();
    }
    return signerWindow;
  }
});
const signer = new Signer({transport});

The signer can request permissions and use these permissions to get accounts with

const permissions = await signer.requestPermissions([createGetAccountsPermissionScope()]);
const accounts = await signer.getAccounts();

Package Sidebar

Install

npm i @slide-computer/signer

Weekly Downloads

8

Version

1.8.0

License

MIT

Unpacked Size

201 kB

Total Files

178

Last publish

Collaborators

  • sea-snake