Code Monkey home page Code Monkey logo

plug-controller's Introduction

Plug Controller - Controller functions for the Plug Extension

Fleek Discord

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 @psychedelic/plug-controller

To install the package you need to be authenticated to Github via npm login, ensure that you have:

  • A personal access token (create one here) with the repo and read:packages scopes to login to the GitHub Package Registry.

  • Have authenticated via npm login, using the personal access token as your password:

npm login --registry=https://npm.pkg.github.com --scope=@Psychedelic

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 '@psychedelic/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 @Psychedelic/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).

plug-controller's People

Contributors

rocky-fleek avatar alejo-acevedo-deel avatar chrilnth avatar heldrida avatar tomiir avatar maksym-boytsov avatar nicolaspoggi avatar jsonsivar avatar qti3e avatar b0xtch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.