(algorithm: string)
| 205 | } |
| 206 | |
| 207 | private async ensureAlgorithmSupported(algorithm: string): Promise<void> { |
| 208 | if (SECP256K1_ALGORITHMS.has(algorithm)) return |
| 209 | try { |
| 210 | await this.version() |
| 211 | } catch { |
| 212 | throw new Error(`algorithm "${algorithm}" is not supported: OS version too old (Version RPC unavailable)`) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | async getKey(path: string, purpose: string = '', algorithm: string = 'secp256k1'): Promise<GetKeyResponse> { |
| 217 | await this.ensureAlgorithmSupported(algorithm) |