Trezor Wallets
The kit also allows using Trezor wallets to both ask for the address and sign a transaction. The TrezorModule
is not included by default and you need to manually import it like this:
import { TrezorModule } from '@creit.tech/stellar-wallets-kit/modules/trezor.module';
const kit = new StellarWalletsKit({
selectedWalletId: XBULL_ID,
network: WalletNetwork.PUBLIC,
modules: [
new xBullModule(),
new FreighterModule(),
new AlbedoModule(),
new TrezorModule({
...params
}),
],
});
IMPORTANT: The Trezor module needs to load its dependencies before it can be used, this normally takes just a couple of seconds.
Constructor params
The Trezor library requires a few values before it can work, currently there are only two required parameters:
- url: this is the url from where the app is loading the Trezor library
- email: this is an email for the Trezor team, they will send an email if something important needs to be done.
You can check all the accepted parameters here;
Mnemonic paths
The Trezor library works by specifying the path to use when signing or getting the address from your device, for that reason all the kit's methods include the optional path
value which you can specify to let the device know which one to use.
But, we know this might not be the easiest way if you are also handling all other kind of wallets so for that reason the kit also includes a logic that takes care of that so you only need to make sure to call the getAddress
method before you request signing the transaction and so the kit will let the Trezor device know which path is the correct path for the account the user selected.