diff options
author | Jacob Evans <jacob@dekz.net> | 2018-04-11 12:11:16 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2018-04-11 12:12:38 +0800 |
commit | 4aa67e292504fea307a4e5f15a124349fc769da6 (patch) | |
tree | 0fcee5bedc71ce70fff505a779021e8ce67c54d1 | |
parent | 260ab2d4134e24a3a2f3fab845fa72c1e1766a3e (diff) | |
download | dexon-sol-tools-4aa67e292504fea307a4e5f15a124349fc769da6.tar.gz dexon-sol-tools-4aa67e292504fea307a4e5f15a124349fc769da6.tar.zst dexon-sol-tools-4aa67e292504fea307a4e5f15a124349fc769da6.zip |
Update JSDoc for methods in ledger and mnemonic wallet
-rw-r--r-- | packages/subproviders/src/subproviders/ledger.ts | 6 | ||||
-rw-r--r-- | packages/subproviders/src/subproviders/mnemonic_wallet.ts | 12 | ||||
-rw-r--r-- | packages/subproviders/src/utils/wallet_utils.ts | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 975893f8a..0c037b488 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -140,8 +140,8 @@ export class LedgerSubprovider extends BaseWalletSubprovider { } } /** - * Sign a personal Ethereum signed message. The signing address will be the one - * the provided address. + * Sign a personal Ethereum signed message. The signing account will be the account + * associated with the provided address. * The Ledger adds the Ethereum signed message prefix on-device. If you've added * the LedgerSubprovider to your app's provider, you can simply send an `eth_sign` * or `personal_sign` JSON RPC request, and this method will be called auto-magically. @@ -217,7 +217,7 @@ export class LedgerSubprovider extends BaseWalletSubprovider { address: ledgerResponse.address, isChildKey: true, derivationBasePath: this._derivationBasePath, - derivationPath: `${this._derivationBasePath}/${0}`, + derivationPath: `${this._derivationBasePath}/0`, derivationIndex: 0, }; } diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts index 972f7e65e..855db21ad 100644 --- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts +++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts @@ -85,7 +85,7 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider { } /** - * Signs a transaction with the from account (if specificed in txParams) or the first account. + * Signs a transaction with the from account specificed in txParams. * If you've added this Subprovider to your app's provider, you can simply send * an `eth_sendTransaction` JSON RPC request, and * this method will be called auto-magically. * If you are not using this via a ProviderEngine instance, you can call it directly. @@ -93,13 +93,13 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider { * @return Signed transaction hex string */ public async signTransactionAsync(txParams: PartialTxParams): Promise<string> { - const privateKeyWallet = this._privateKeyWalletFromAddress(txParams.from); + const privateKeyWallet = this._privateKeyWalletForAddress(txParams.from); const signedTx = privateKeyWallet.signTransactionAsync(txParams); return signedTx; } /** - * Sign a personal Ethereum signed message. The signing address used will be - * address provided or the first address derived from the set path. + * Sign a personal Ethereum signed message. The signing account will be the account + * associated with the provided address. * If you've added the MnemonicWalletSubprovider to your app's provider, you can simply send an `eth_sign` * or `personal_sign` JSON RPC request, and this method will be called auto-magically. * If you are not using this via a ProviderEngine instance, you can call it directly. @@ -108,11 +108,11 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider { * @return Signature hex string (order: rsv) */ public async signPersonalMessageAsync(data: string, address: string): Promise<string> { - const privateKeyWallet = this._privateKeyWalletFromAddress(address); + const privateKeyWallet = this._privateKeyWalletForAddress(address); const sig = await privateKeyWallet.signPersonalMessageAsync(data, address); return sig; } - private _privateKeyWalletFromAddress(address: string): PrivateKeyWalletSubprovider { + private _privateKeyWalletForAddress(address: string): PrivateKeyWalletSubprovider { const derivedKey = this._findDerivedKeyByPublicAddress(address); const privateKeyHex = derivedKey.hdKey.privateKey.toString('hex'); const privateKeyWallet = new PrivateKeyWalletSubprovider(privateKeyHex); diff --git a/packages/subproviders/src/utils/wallet_utils.ts b/packages/subproviders/src/utils/wallet_utils.ts index 2d9d14e44..097d2b82f 100644 --- a/packages/subproviders/src/utils/wallet_utils.ts +++ b/packages/subproviders/src/utils/wallet_utils.ts @@ -52,9 +52,9 @@ class DerivedHDKeyIterator implements IterableIterator<DerivedHDKey> { export const walletUtils = { DEFAULT_ADDRESS_SEARCH_LIMIT, DEFAULT_NUM_ADDRESSES_TO_FETCH: 10, - calculateDerivedHDKeys(initialDerivedKey: DerivedHDKey, searchLimit: number): DerivedHDKey[] { + calculateDerivedHDKeys(initialDerivedKey: DerivedHDKey, numberOfKeys: number): DerivedHDKey[] { const derivedKeys: DerivedHDKey[] = []; - const derivedKeyIterator = new DerivedHDKeyIterator(initialDerivedKey, searchLimit); + const derivedKeyIterator = new DerivedHDKeyIterator(initialDerivedKey, numberOfKeys); for (const key of derivedKeyIterator) { derivedKeys.push(key); } |