Trezor
Wallet module for connecting Trezor hardware wallets to web3-onboard

@web3-onboard/trezor

Install

npm i @web3-onboard/trezor

Options

1
type TrezorOptions = {
2
email: string
3
appUrl: string
4
customNetwork?: CustomNetwork
5
}
6
7
interface CustomNetwork {
8
networkId: number
9
genesis: GenesisBlock
10
hardforks: Hardfork[]
11
bootstrapNodes: BootstrapNode[]
12
}
13
14
interface GenesisBlock {
15
hash: string
16
timestamp: string | null
17
gasLimit: number
18
difficulty: number
19
nonce: string
20
extraData: string
21
stateRoot: string
22
}
23
24
interface Hardfork {
25
name: string
26
block: number | null
27
}
28
29
interface BootstrapNode {
30
ip: string
31
port: number | string
32
network?: string
33
chainId?: number
34
id: string
35
location: string
36
comment: string
37
}
Copied!

Usage

1
import Onboard from '@web3-onboard/core'
2
import trezorModule from '@web3-onboard/trezor'
3
4
const trezor = trezorModule({
5
email: '<EMAIL_CONTACT>',
6
appUrl: '<APP_URL>'
7
})
8
9
const onboard = Onboard({
10
// ... other Onboard options
11
wallets: [
12
trezor
13
//... other wallets
14
]
15
})
16
17
const connectedWallets = await onboard.connectWallet()
18
console.log(connectedWallets)
Copied!
Last modified 2mo ago
Copy link