|
1 | 1 | # @enkryptcom/hw-wallets |
2 | 2 |
|
| 3 | +## v0.0.5 |
| 4 | + |
3 | 5 | ## Hardware wallet manager for enkrypt |
| 6 | + |
| 7 | +### Getting started |
| 8 | + |
| 9 | +#### Minimum Node version |
| 10 | + |
| 11 | +`node v20` |
| 12 | + |
| 13 | +#### Installation |
| 14 | + |
| 15 | +NPM: `npm install @enkryptcom/hw-wallets @enkryptcom/types` |
| 16 | +Yarn: `yarn add @enkryptcom/hw-wallets @enkryptcom/types` |
| 17 | +PNPM `pnpm add @enkryptcom/hw-wallets @enkryptcom/types` |
| 18 | + |
| 19 | +### How to use |
| 20 | + |
| 21 | +1. Create an instance of `HWwalletManager` |
| 22 | + |
| 23 | +``` |
| 24 | +import HWwalletManager from @enkryptcom/hw-wallets |
| 25 | +
|
| 26 | +const hwManager = new HWwalletManager() |
| 27 | +``` |
| 28 | + |
| 29 | +2. Call methods within class, passing network names and providers. Class automatically handles which wallet to use. |
| 30 | + |
| 31 | +### API |
| 32 | + |
| 33 | +#### `getAddress(options: getAddressRequest): Promise<AddressResponse>` |
| 34 | + |
| 35 | +Returns wallet address based off of the path provided in the `getAddressRequest`. |
| 36 | + |
| 37 | +#### `signPersonalMessage(options: SignMessageRequest): Promise<string>` |
| 38 | + |
| 39 | +Signs personal message. |
| 40 | + |
| 41 | +#### `signTransaction(options: SignTransactionRequest): Promise<string>` |
| 42 | + |
| 43 | +Signs transaction. |
| 44 | + |
| 45 | +#### `getSupportedPaths(options: isConnectedRequest): Promise<PathType[]>` |
| 46 | + |
| 47 | +Returns supported paths based on options provided. |
| 48 | + |
| 49 | +#### `isNetworkSupported(networkName: NetworkNames): boolean` |
| 50 | + |
| 51 | +Checks network name support. |
| 52 | + |
| 53 | +#### `isConnected(options: isConnectedRequest): Promise<boolean>` |
| 54 | + |
| 55 | +Checks connection status. |
| 56 | + |
| 57 | +#### `close(): Promise<void>` |
| 58 | + |
| 59 | +Closes all HW wallet connections |
| 60 | + |
| 61 | +### Types |
| 62 | + |
| 63 | +`NetworkNames`: https://github.com/enkryptcom/enKrypt/blob/main/packages/types/src/networks.ts#L1 |
| 64 | +`getAddressRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L74 |
| 65 | +`AddressResponse`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L31 |
| 66 | +`SignMessageRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L54 |
| 67 | +`SignTransactionRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L65 |
| 68 | +`isConnectedRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L78 |
| 69 | + |
| 70 | +### Examples |
| 71 | + |
| 72 | +TO BE ADDED |
0 commit comments