@funded-labs/plug-controller
TypeScript icon, indicating that this package has built-in type declarations

0.28.3 • Public • Published

Plug Controller - Controller functions for the Plug Extension

Introduction

The Plug Controller is a package that provides utility & logic to the Plug browser wallet extension, as well as the account creation and management. It handles the interactions between the extension and the Internet Computer as users interact with accounts, balances, canisters, and the network.

Installation

npm install @funded-labs/plug-controller

Plug KeyRing

A Plug Keyring is a class that manages the user's accounts and allow you to create/import a mnemonic and its keypair.

import PlugController from '@funded-labs/plug-controller';

const keyRing = new PlugController.PlugKeyRing();

// Initialize keyring and load state from extension storage
await keyRing.init();

Keyring Creation

// Creates the keyring and returns the default wallet
const wallet: PlugWallet = await keyRing.create(password);

Mnemonic Import

// Creates the keyring using the provided mnemonic and returns the default wallet
const wallet: PlugWallet = await keyRing.importFromMnemonic(mnemonic, password);

Documentation

Interface and Type definitions documents for the @funded-labs/plug-controller implementation is provided in the following location.

These are based in the main release branch and provide a good overview of the whole package (modules, IDL's, utils, etc).

/@funded-labs/plug-controller/

    Package Sidebar

    Install

    npm i @funded-labs/plug-controller

    Weekly Downloads

    1

    Version

    0.28.3

    License

    MIT

    Unpacked Size

    709 kB

    Total Files

    175

    Last publish

    Collaborators

    • mzibara