JSPM

  • Created
  • Published
  • Downloads 241
  • Score
    100M100P100Q91174F
  • License SEE LICENSE IN LICENSE.md

High-level javascript interface for Trezor hardware wallet in webextension serviceworker environment.

Package Exports

  • @trezor/connect-webextension
  • @trezor/connect-webextension/build/trezor-connect-webextension.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@trezor/connect-webextension) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@trezor/connect-webextension BETA

Build Status NPM Known Vulnerabilities

This package contains @trezor/connect implementation suitable for webextensions. In short it:

  • works in service worker
  • provides access to TrezorConnect api
  • handles opening of popup page on trezor.io domain when user is expected to approve some operations
  • returns result to the caller.

Beta

This package is currently in beta. If you find anything not working or not suiting your needs, please open an issue.

How to use

At the moment only bundles build/trezor-connect-webextension.js and build/trezor-connect-webextension.min.js are published.

One way how it can be used is

importScripts('<path>/trezor-connect-webextension.js');

There are still some open questions, let us know!

  • should we publish also src? it would require some postinstall build steps however
  • should we publish other build targets (now te)

Development

  • yarn
  • yarn build:libs
  • yarn workspace @trezor/connect-webextension build
  • yarn workspace @trezor/connect-iframe build:core-module
  • yarn workspace @trezor/connect-popup dev

Now you should be able to import from this package, or use directly build/trezor-connect-webextension.js. Popup is running on your localhost, just use it in TrezorConnect.init({ connectSrc: ... })

Roadmap

  • merge to develop branch
  • release to npm under beta channel
  • public release