-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cli add custom derivation path option
- Loading branch information
1 parent
bb1db2b
commit 9ba53be
Showing
8 changed files
with
184 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
export type MakeKeychainResult = { | ||
mnemonic: string, | ||
keyInfo: { | ||
privateKey: string; | ||
address: string; | ||
btcAddress: string; | ||
wif: string; | ||
index: number; | ||
}; | ||
}; | ||
|
||
export type WalletKeyInfoResult = { | ||
privateKey: string; | ||
address: string; | ||
btcAddress: string; | ||
wif: string; | ||
index: number; | ||
}; | ||
|
||
export const makekeychainTests: Array<[string, MakeKeychainResult]> = [ | ||
[ | ||
// Derivation Path | ||
"m/44'/5757'/0'/0/0", | ||
// Expected result | ||
{ | ||
mnemonic: 'vivid oxygen neutral wheat find thumb cigar wheel board kiwi portion business', | ||
keyInfo: { | ||
privateKey: 'd1124855494c883c5e1df0201be40a835f08ae5fc3a6520224b2239db94a818001', | ||
address: 'ST1J28031BYDX19TYXSNDG9Q4HDB2TBDAM921Y7MS', | ||
btcAddress: 'mpeSzfUTBba7qzKNcg8ojNm4GAfwmNPX8X', | ||
wif: 'L4E7pXmqdm8C8TakpX7YDDmFopaQw32Ak6V5BpRFNDJmo7wjGVqc', | ||
index: 0 | ||
} | ||
} | ||
], | ||
[ | ||
// Derivation Path | ||
"m/888'/0'/0", | ||
// Expected result | ||
{ | ||
mnemonic: 'vivid oxygen neutral wheat find thumb cigar wheel board kiwi portion business', | ||
keyInfo: { | ||
privateKey: 'd4d30d4fdaa59e166865b836548015c2780063b82e7b2a364c8a2e32df7139ce01', | ||
address: 'ST1WT20920NVRQ892MS535R7XEMV6KD6M6X2HQPK3', | ||
btcAddress: 'mrc4w3oQZ39Yvkimk9DDJQnHFjv1e336mg', | ||
wif: 'L4MQx6c6ZmoiwFYUHnmt39THRGeQnPmfA2AFobwWmssZJabi3qXm', | ||
index: 0 | ||
} | ||
} | ||
] | ||
]; | ||
|
||
export const keyInfoTests: Array<[string, WalletKeyInfoResult]> = [ | ||
[ | ||
// Derivation Path | ||
"m/44'/5757'/0'/0/0", | ||
// Expected result | ||
{ | ||
privateKey: 'd1124855494c883c5e1df0201be40a835f08ae5fc3a6520224b2239db94a818001', | ||
address: 'ST1J28031BYDX19TYXSNDG9Q4HDB2TBDAM921Y7MS', | ||
btcAddress: 'mpeSzfUTBba7qzKNcg8ojNm4GAfwmNPX8X', | ||
wif: 'L4E7pXmqdm8C8TakpX7YDDmFopaQw32Ak6V5BpRFNDJmo7wjGVqc', | ||
index: 0 | ||
} | ||
], | ||
[ | ||
// Derivation Path | ||
"m/888'/0'/0", | ||
// Expected result | ||
{ | ||
privateKey: 'd4d30d4fdaa59e166865b836548015c2780063b82e7b2a364c8a2e32df7139ce01', | ||
address: 'ST1WT20920NVRQ892MS535R7XEMV6KD6M6X2HQPK3', | ||
btcAddress: 'mrc4w3oQZ39Yvkimk9DDJQnHFjv1e336mg', | ||
wif: 'L4MQx6c6ZmoiwFYUHnmt39THRGeQnPmfA2AFobwWmssZJabi3qXm', | ||
index: 0 | ||
} | ||
] | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { WalletKeyInfoResult } from './keychain'; | ||
|
||
export const keyInfoTests: Array<[string, WalletKeyInfoResult]> = [ | ||
[ | ||
// Derivation path | ||
"m/44'/5757'/0'/0/0", | ||
// Expected result | ||
{ | ||
privateKey: '25899fab1b9b95cc2d1692529f00fb788e85664df3d14db1a660f33c5f96d8ab01', | ||
address: 'SP3RBZ4TZ3EK22SZRKGFZYBCKD7WQ5B8FFS0AYVF7', | ||
btcAddress: '1Nwxfx7VoYAg2mEN35dTRw4H7gte8ajFki', | ||
wif: 'KxUgLbeVeFZEUUQpc3ncYn5KFB3WH5MVRv3SJ2g5yPwkrXs3QRaP', | ||
index: 0 | ||
} | ||
], | ||
[ | ||
// Derivation path | ||
"m/888'/0'/0", | ||
// Expected result | ||
{ | ||
privateKey: '0f0936f59a7d55be6bcd1820f798460ac4b3aa50f26c8fa76beb82a19af5110901', | ||
address: 'SPGJAPK47Z9XY7E7BCEJFAEX9C7WGB0YB74A54MA', | ||
btcAddress: '142G3fnfn1WZPtnYLYiVGt8aU55GZYxeVP', | ||
wif: 'KwiwQgTK2412XSdBfcRWJ4xQFbevUHCwGnRCuvjeHjSqceNwS1wW', | ||
index: 0 | ||
} | ||
] | ||
]; | ||
|
||
export { WalletKeyInfoResult }; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9ba53be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: