node v20
NPM: npm install @enkryptcom/hw-wallets @enkryptcom/types
Yarn: yarn add @enkryptcom/hw-wallets @enkryptcom/types
PNPM pnpm add @enkryptcom/hw-wallets @enkryptcom/types
- Create an instance of
HWwalletManager
import HWwalletManager from @enkryptcom/hw-wallets
const hwManager = new HWwalletManager()
- Call methods within class, passing network names and providers. Class automatically handles which wallet to use.
Returns wallet address based off of the path provided in the getAddressRequest.
Signs personal message.
Returns an RPC sign you can then add to a transaction object.
Returns supported paths based on options provided.
Checks network name support.
Checks connection status.
Closes all HW wallet connections
NetworkNames: https://github.com/enkryptcom/enKrypt/blob/main/packages/types/src/networks.ts#L1
getAddressRequest: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L74
AddressResponse: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L31
SignMessageRequest: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L54
SignTransactionRequest: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L65
isConnectedRequest: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L78
Navigate to src/configs.ts and add your new derivation path at the bottom.
Make sure to follow the configuration in that file.
Import path in the corresponding Trezor provider config.ts.
See src/trezor/ethereum/configs.ts for example.
Connection request to hardware wallet actually happens on getAddress() request.
Ledger can't have any paths as each paths are defined by the corresponding app.
ref/reactive will mess with how Vue compiles these classes because of how Vue utilizes proxies. If you want to store an instance into a ref or reactive, use makeRaw.