parent
e0e795665c
commit
9737c8551b
21
README.md
21
README.md
@ -2,23 +2,26 @@
|
||||
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
A very simple scaffolding browser extension that injects a [@polkadot/api](https://github.com/polkadot-js/api) Signer into a page, along with any associated accounts, allowing for use by the application. This is an extensible POC implementation of a Polkadot/Substrate browser signer.
|
||||
A very simple scaffolding browser extension that injects a [@polkadot/api](https://github.com/polkadot-js/api) Signer into a page, along with any associated accounts, allowing for use by any dapp. This is an extensible POC implementation of a Polkadot/Substrate browser signer.
|
||||
|
||||
As it stands, it does one thing: it _only_ manages accounts and allows the signing of transactions with those accounts. (It does not inject providers for use by dapps, not does it perform the function of a wallet where it submits txs to the network).
|
||||
As it stands, it does one thing: it _only_ manages accounts and allows the signing of transactions with those accounts. It does not inject providers for use by dapps at this early point, nor does it perform wallet functions where it constructs and submits txs to the network.
|
||||
|
||||
# Running
|
||||
|
||||
Currently is not packaged since it is under heavy development. To use -
|
||||
Currently is not packaged since it is under heavy development. As such you need to build it yourself. To use -
|
||||
|
||||
1. Build via `yarn build` or `yarn watch`
|
||||
2. Add the extension under `chrome://extensions/` (ensure you have the Development flag set) and "Load unpacked"
|
||||
3. When visiting `http://localhost:3000` or `https://polkadot.js.org/apps/` it will inject (the menifest currently only lists these 2 endpoints)
|
||||
2. Add the extension under `chrome://extensions/`
|
||||
- ensure you have the Development flag set
|
||||
- "Load unpacked" and point to `packages/extension/build`
|
||||
- if developing, after making changes - refresh the extension
|
||||
3. When visiting `http://localhost:3000` or `https://polkadot.js.org/apps/` it will inject the extension (the manifest currently only lists these 2 endpoints)
|
||||
|
||||
Once added, you can create an account (via a generated seed) or import via an existing seed.
|
||||
Once added, you can create an account (via a generated seed) or import via an existing seed. The UI, when loaded, will show these accounts as `<account name> (extension)`
|
||||
|
||||
## Overview
|
||||
## Technical
|
||||
|
||||
It injects `injectedWeb3` into the global `window` object, exposing the following:
|
||||
The extension injects `injectedWeb3` into the global `window` object, exposing the following:
|
||||
|
||||
```js
|
||||
// a version that identifies the actual injection version (future-use)
|
||||
@ -32,7 +35,7 @@ interface Account {
|
||||
|
||||
// exposes accounts
|
||||
interface Accounts {
|
||||
readonly all: Array<Account>;
|
||||
get: () => Promise<Array<Account>>;
|
||||
}
|
||||
|
||||
// a signer that communicates with the extension via sendMessage
|
||||
|
||||
Loading…
Reference in New Issue
Block a user