@trezor/connect-web v9.5.2
@trezor/connect-web
This package is bundled into web implementations.
Contains minimum of code required to:
- Define
TrezorConnectAPI object - Create and handle communication between
@trezor/connect-iframehosted onhttps://connect.trezor.io/<version>/iframe.html - Create and handle communication and lifecycle of
@trezor/connect-popuphosted onhttps://connect.trezor.io/<version>/popup.html
Usage
yarn add @trezor/connect-webimport TrezorConnect from '@trezor/connect-web';
// set manifest once anywhere in your app index
TrezorConnect.manifest({
appUrl: 'https://my.app.com',
email: 'developer@email.com',
});
function getAddress() {
const btcAddress = await TrezorConnect.getAddress({ path: "m/84'/0'/'0'/0/0", coin: 'btc' });
if (btcAddress.success) {
return btcAddress.payload; // { address: "xxx" }
}
}For more examples see TrezorConnect API documentation
NPM publish:
Follow instructions how to publish @trezor package to npm registry.
Dev
It is possible to run local dev server with iframe and popup using:
yarn workspace @trezor/connect-web dev
Note: don't forget to visit https://localhost:8088/ and allow self-signed certificate. No UI is displayed here.
With dev server running, you may initialize TrezorConnect like this
import TrezorConnect from '@trezor/connect-web';
const connectOptions = {
connectSrc: 'https://localhost:8088/',
manifest: {
email: 'info@trezor.io',
appUrl: '@trezor/suite',
},
};8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
8 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago