You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Web3Core/KeystoreManager/BIP44.swift
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ import Foundation
7
7
8
8
publicprotocolBIP44{
9
9
/**
10
-
Derive an `HDNode` based on the provided `path`. The function will throws `BIP44Error.warning` if it was invoked with `warns` as true and the root key doesn't have a previous child with at least one transaction, using false the child node will be derived directly not throwing. This function needs to query the blockchain history when `warns`is true, so it can throw network errors.
11
-
- Parameter path: valid BIP32 path.
12
-
- Parameter warns: true to be warned about following BIP44 standard, false otherwise.
13
-
- Throws: `BIP44Error.warning` if the child key shouldn't be used according to BIP44 standard.
14
-
- Returns: an HDNode child key for the provided `path` if it can be created, otherwise nil
15
-
*/
10
+
Derive an `HDNode` based on the provided `path`. The function will throws `BIP44Error.warning` if it was invoked with `warns` as true and the root key doesn't have a previous child with at least one transaction, using false the child node will be derived directly not throwing. This function needs to query the blockchain history when `warns`is true, so it can throw network errors.
11
+
- Parameter path: valid BIP32 path.
12
+
- Parameter warns: true to be warned about following BIP44 standard, false otherwise.
13
+
- Throws: `BIP44Error.warning` if the child key shouldn't be used according to BIP44 standard.
14
+
- Returns: an HDNode child key for the provided `path` if it can be created, otherwise nil
Transforms a bip44 path into a new one changing `account` & `index`. The resulting one will have the change value equal to `0` to represent external chain. Format `m/44'/coin_type'/account'/change/address_index`
97
-
- Parameter account: the new `account` to use
98
-
- Parameter addressIndex: the new `addressIndex` to use
99
-
- Returns: a valid bip44 path with the provided `account`, `addressIndex`and external `change` or nil otherwise
96
+
Transforms a bip44 path into a new one changing `account` & `index`. The resulting one will have the change value equal to `0` to represent external chain. Format `m/44'/coin_type'/account'/change/address_index`
97
+
- Parameter account: the new `account` to use
98
+
- Parameter addressIndex: the new `addressIndex` to use
99
+
- Returns: a valid bip44 path with the provided `account`, `addressIndex`and external `change` or nil otherwise
0 commit comments