ghost-keychain/packages/extension-inject
Bartłomiej Rutkowski eeac2c1064
Allow account creation by derivation from existing one (#296)
* Allow specifying derivation path on account creation (#57)

* Allow specifying derivation path on account creation

* Improve linting and formatting

* Highlight input field when der-path is invalid

* Fix header

* Hide advanced options

* Add tests

* Fix name

* Improve styling

* Change names

* Fix case

* Add arrow icon

* Add smooth transition

* Refactor tests

Co-authored-by: Bartłomiej Rutkowski <bar.rutkow@gmail.com>

* [CI Skip]  0.22.0-beta.7

skip-checks: true

* Import account derivation path (#59)

* Import account derivation path

* Fix test

* fix scroll

* Lint fix

* add tests to importSeed

Co-authored-by: Bartłomiej Rutkowski <bartek@ethworks.io>
Co-authored-by: Kamil <kamil@ethworks.io>

* [CI Skip]  0.22.0-beta.8

skip-checks: true

* Hover and copy button (#58)

* copy button and change hover

* working on

* add Toast

* chage address width

* Minor fixes

* Add cursor: hand

* Finish merge

Co-authored-by: Kamil <kamil@ethworks.io>
Co-authored-by: ivan <ivanruch@gmail.com>

* [CI Skip]  0.22.0-beta.9

skip-checks: true

* Fix build

* [CI Skip]  0.23.0-beta.0

skip-checks: true

* [CI Skip] Undo Github Actions version bump

* [CI Skip] 0.23.0-beta.5

skip-checks: true

* Add derive screen (#60)

* Add derivation screen

* Remove "///password" from derivation path placeholder

* Refactor tests

Co-authored-by: Bartłomiej Rutkowski <bar.rutkow@gmail.com>
Co-authored-by: Anze1m <bartek@ethworks.io>

* Improve account menu; fix linting (#61)

* Fix test

* Fix account menu

* Fix linting

* [CI Skip] 0.23.0-beta.6

skip-checks: true

* Add proper account decoding (#62)

* Add proper account decoding

* Improve tests and error handling

* Fix linting

* Add refactoring

* Update packages/extension/src/background/handlers/Extension.ts

Co-Authored-By: Ivan Rukhavets <ivanruch@gmail.com>

* Fix test

* Fix linting

* Fix actions

* Slight UX improvement

* Add big red button

* Change red button to orange

* Wrap in useCallback

* Fix linting

* Add proper password checking method

* Fix linting

Co-authored-by: Ivan Rukhavets <ivanruch@gmail.com>

* [CI Skip] 0.23.0-beta.7

skip-checks: true

* Apply merge fixes (#65)

* Fix linting

* CI

* [CI Skip] 0.24.0-beta.1

skip-checks: true

* CR requests

* [CI Skip] 0.24.0-beta.2

skip-checks: true

* [CI Skip] 0.24.0-beta.2

skip-checks: true

Co-authored-by: Ivan Rukhavets <ivanruch@gmail.com>
Co-authored-by: Github Actions <action@github.com>
Co-authored-by: Kamil <kamil@ethworks.io>
2020-03-30 16:55:53 +02:00
..
src Provide metadata from external source (#288) 2020-03-26 11:01:33 +01:00
LICENSE extension-inject (no direct globals for extension/dapp) (#75) 2019-07-12 21:22:06 +02:00
package.json Allow account creation by derivation from existing one (#296) 2020-03-30 16:55:53 +02:00
README.md extension-inject (no direct globals for extension/dapp) (#75) 2019-07-12 21:22:06 +02:00

@polkadot/extension-inject

This is a basic extension injector that manages access to the global objects available. As an extension developer, you don't need to manage access to the windo object manually, by just calling enable here, the global object is setup and managed properly. From here any dapp can access it with the @polkadot/extension-dapp package;

Usage

import { injectExtension } from '@polkadot/extension-inject';

// this a the function that will be exposed to be callable by the dapp. It resolves a promise
// with the injected interface, (see `Injected`) when the dapp at `originName` (url) is allowed
// to access functionality
function enableFn (originName: string): Promise<Injected> {
  ...
}

// injects the extension into the page
injectExtension(enableFn, { name: 'myExtension', version: '1.0.1' });