@dcentralab/wc-trezor
v2.0.34
Published
Trezor connector
Downloads
855
Readme
Trezor Cold Wallet connector
Instalation
npm install @dcentralab/wc-trezor
or
yarn add @dcentralab/wc-trezor
Getting started
Trezor wallet connector for web3-wc-modal, package that implement wallet connection with Trezor Cold Wallet https://trezor.io/
CREATE-REACT-APP
To support hardware wallets in create-react-app
you need to use react-app-rewired
const NodePolyfill = require('node-polyfill-webpack-plugin');
module.exports = function override (config, env) {
console.log('override')
config.plugins.push(new NodePolyfill())
return config
}
Interface
export type TConnect = (connectingWalletType: string, options?: IConnectionOptions) => void
export type TDisconnect = (clearDerivationPath?: boolean) => void
export interface IConnectionOptions {
rpcUrl?: string
networkId?: number
derivationPath?: string
blockchainType?: BLOCKCHAIN_TYPE
connectionType?: TWalletType
onConnectStart?: () => void
savePath?: boolean
removeLSKey?: boolean,
showModalOnError?: boolean,
showToast?: (msg: string, duration?: number) => any
connectWallet?: TConnect
disconnectWallet?: TDisconnect
internal?: boolean
}
export interface IConnectionResult {
provider: any
providerName?: string
}
export interface IConnector {
type: TWalletType,
blockchainType: BLOCKCHAIN_TYPE
mobile: boolean
enabled: () => boolean;
connector: (opts: IConnectionOptions) => Promise<IConnectionResult>
disconnector?: () => Promise<void>
getAccount: (provider: AbstractProvider | IBinanceProvider | ICardanoProvider) => Promise<string | undefined>
getBalance: (provider: AbstractProvider | IBinanceProvider | ICardanoProvider, address: string) => Promise<string | undefined>
getHWAccounts?: (opts: IGetHWAccounts) => Promise<string[]>
showToast?: (msg: string, duration?: number) => void
localStorageKey?: string
connectWallet?: TConnect
disconnectWallet?: TDisconnect
unsubscribeEvents?: () => void
}