spinGreekGod / wallet

Proof of concept of in-browser wallet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wallet Beta

Partial implementation of the Wallet API, currently only works in Firefox and Chrome.

To install the extention, use about:debugging#/runtime/this-firefox page in Firefox.

Latest build can be found here.

API

interface Signer {
  getPublicKey(): Promise<Uint8Array>;
  signEd25519(data: Uint8Array): Promise<Uint8Array>;
}

interface Account extends Signer {
  getName(): Promise<string>;
  getDescription(): Promise<string>;
  getAddress(): Promise<string>;
  isCompromised(): bool // in case we want to filter out compromised keys
}

Example

const wallet = new Wallet(window);
let accounts;
try {
    accounts = await wallet.enable(); // should open a separate extension window that asks for the password
} catch (e) {
    console.log("Could not initialize wallet: " + e.toString());
    throw e;
}

const account = accounts[0];

Building

npm install npm run build

Running the tests

open ./extension/test/test.html

About

Proof of concept of in-browser wallet


Languages

Language:JavaScript 85.6%Language:HTML 6.7%Language:Svelte 5.4%Language:Shell 2.3%