@@ -37,19 +37,19 @@ class HdKeyring {
3737 this . _initFromMnemonic ( bip39 . generateMnemonic ( wordlist ) ) ;
3838 }
3939
40- uint8ArrayToString ( mnemonic ) {
40+ _uint8ArrayToString ( mnemonic ) {
4141 const recoveredIndices = Array . from (
4242 new Uint16Array ( new Uint8Array ( mnemonic ) . buffer ) ,
4343 ) ;
4444 return recoveredIndices . map ( ( i ) => wordlist [ i ] ) . join ( ' ' ) ;
4545 }
4646
47- stringToUint8Array ( mnemonic ) {
47+ _stringToUint8Array ( mnemonic ) {
4848 const indices = mnemonic . split ( ' ' ) . map ( ( word ) => wordlist . indexOf ( word ) ) ;
4949 return new Uint8Array ( new Uint16Array ( indices ) . buffer ) ;
5050 }
5151
52- mnemonicToUint8Array ( mnemonic ) {
52+ _mnemonicToUint8Array ( mnemonic ) {
5353 let mnemonicData = mnemonic ;
5454 // when encrypted/decrypted, buffers get cast into js object with a property type set to buffer
5555 if ( mnemonic && mnemonic . type && mnemonic . type === 'Buffer' ) {
@@ -68,7 +68,7 @@ class HdKeyring {
6868 } else if ( Buffer . isBuffer ( mnemonicData ) ) {
6969 mnemonicAsString = mnemonicData . toString ( ) ;
7070 }
71- return this . stringToUint8Array ( mnemonicAsString ) ;
71+ return this . _stringToUint8Array ( mnemonicAsString ) ;
7272 } else if (
7373 mnemonicData instanceof Object &&
7474 ! ( mnemonicData instanceof Uint8Array )
@@ -81,7 +81,7 @@ class HdKeyring {
8181
8282 serialize ( ) {
8383 return Promise . resolve ( {
84- mnemonic : this . mnemonicToUint8Array ( this . mnemonic ) ,
84+ mnemonic : this . _mnemonicToUint8Array ( this . mnemonic ) ,
8585 numberOfAccounts : this . _wallets . length ,
8686 hdPath : this . hdPath ,
8787 } ) ;
@@ -278,7 +278,7 @@ class HdKeyring {
278278 ) ;
279279 }
280280
281- this . mnemonic = this . mnemonicToUint8Array ( mnemonic ) ;
281+ this . mnemonic = this . _mnemonicToUint8Array ( mnemonic ) ;
282282
283283 // validate before initializing
284284 const isValid = bip39 . validateMnemonic ( this . mnemonic , wordlist ) ;
0 commit comments