diff options
author | Jacob Evans <jacob@dekz.net> | 2018-04-11 18:51:31 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2018-04-11 18:59:17 +0800 |
commit | 63b941fbaf08167234cf7871e874c1a96e4347fa (patch) | |
tree | d8a1a896f04c39d47cbfdb2d876f819f8fa178e6 | |
parent | 916b4d3a26e6189c77634b0d2cde4d20bb4cb9a9 (diff) | |
download | dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.tar dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.tar.gz dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.tar.bz2 dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.tar.lz dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.tar.xz dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.tar.zst dexon-sol-tools-63b941fbaf08167234cf7871e874c1a96e4347fa.zip |
Update documentation and add to website docs
5 files changed, 27 insertions, 23 deletions
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 33aa5c1bf..06c115105 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -79,7 +79,7 @@ export class LedgerSubprovider extends BaseWalletSubprovider { } /** * Retrieve a users Ledger accounts. The accounts are derived from the derivationPath, - * master public key and chainCode. Because of this, you can request as many accounts + * master public key and chain code. Because of this, you can request as many accounts * as you wish and it only requires a single request to the Ledger device. This method * is automatically called when issuing a `eth_accounts` JSON RPC request via your providerEngine * instance. @@ -93,9 +93,9 @@ export class LedgerSubprovider extends BaseWalletSubprovider { return accounts; } /** - * Sign a transaction with the Ledger. If you've added the LedgerSubprovider 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 + * Signs a transaction on the Ledger with the account specificed by the `from` field in txParams. + * If you've added the LedgerSubprovider 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. * @param txParams Parameters of the transaction to sign * @return Signed transaction hex string @@ -149,8 +149,8 @@ export class LedgerSubprovider extends BaseWalletSubprovider { * 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. * If you are not using this via a ProviderEngine instance, you can call it directly. - * @param data Message to sign - * @param address Address to sign with + * @param data Hex string message to sign + * @param address Address of the account to sign with * @return Signature hex string (order: rsv) */ public async signPersonalMessageAsync(data: string, address: string): Promise<string> { diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts index 9a627b1ec..5dc1b3be7 100644 --- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts +++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts @@ -29,7 +29,7 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider { /** * Instantiates a MnemonicWalletSubprovider. Defaults to baseDerivationPath set to `44'/60'/0'/0`. * This is the default in TestRPC/Ganache, it can be overridden if desired. - * @param config Several available configurations + * @param config Configuration for the mnemonic wallet, must contain the mnemonic * @return MnemonicWalletSubprovider instance */ constructor(config: MnemonicWalletSubproviderConfigs) { @@ -88,9 +88,9 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider { } /** - * Signs a transaction with the from account specificed in txParams. + * Signs a transaction with the account specificed by the `from` field 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. + * 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. * @param txParams Parameters of the transaction to sign * @return Signed transaction hex string @@ -109,8 +109,8 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider { * 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. - * @param data Message to sign - * @param address Address to sign with + * @param data Hex string message to sign + * @param address Address of the account to sign with * @return Signature hex string (order: rsv) */ public async signPersonalMessageAsync(data: string, address: string): Promise<string> { diff --git a/packages/subproviders/src/subproviders/private_key_wallet.ts b/packages/subproviders/src/subproviders/private_key_wallet.ts index f3727039c..b3f48fd90 100644 --- a/packages/subproviders/src/subproviders/private_key_wallet.ts +++ b/packages/subproviders/src/subproviders/private_key_wallet.ts @@ -59,12 +59,12 @@ export class PrivateKeyWalletSubprovider extends BaseWalletSubprovider { } /** * Sign a personal Ethereum signed message. The signing address will be calculated from the private key. - * if an address is provided it must match the address calculated from the private key. + * The address must be provided it must match the address calculated from the private key. * If you've added this Subprovider 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. - * @param data Message to sign - * @param address Address to sign with + * @param data Hex string message to sign + * @param address Address of the account to sign with * @return Signature hex string (order: rsv) */ public async signPersonalMessageAsync(data: string, address: string): Promise<string> { diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index 467cae29b..baafd800b 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,19 +1,14 @@ [ { - "version": "0.1.1", - "changes": [ - { - "note": "Add types for HDKey", - "pr": 507 - } - ] - }, - { "version": "0.1.0", "changes": [ { "note": "Add types for more packages", "pr": 501 + }, + { + "note": "Add types for HDKey", + "pr": 507 } ] }, diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts index 7aa05f9a5..2462c4157 100644 --- a/packages/website/ts/containers/subproviders_documentation.ts +++ b/packages/website/ts/containers/subproviders_documentation.ts @@ -30,6 +30,8 @@ const docSections = { redundantRPCSubprovider: 'redundantRPCSubprovider', ganacheSubprovider: 'ganacheSubprovider', nonceTrackerSubprovider: 'nonceTrackerSubprovider', + privateKeyWalletSubprovider: 'privateKeyWalletSubprovider', + mnemonicWalletSubprovider: 'mnemonicWalletSubprovider', types: docConstants.TYPES_SECTION_NAME, }; @@ -44,6 +46,8 @@ const docsInfoConfig: DocsInfoConfig = { subprovider: [docSections.subprovider], ['ledger-subprovider']: [docSections.ledgerSubprovider], ['ledger-node-hid-issue']: [docSections.ledgerNodeHid], + ['private-key-wallet-subprovider']: [docSections.privateKeyWalletSubprovider], + ['mnemonic-wallet-subprovider']: [docSections.mnemonicWalletSubprovider], ['factory-methods']: [docSections.factoryMethods], ['emptyWallet-subprovider']: [docSections.emptyWalletSubprovider], ['fakeGasEstimate-subprovider']: [docSections.fakeGasEstimateSubprovider], @@ -61,6 +65,8 @@ const docsInfoConfig: DocsInfoConfig = { sectionNameToModulePath: { [docSections.subprovider]: ['"subproviders/src/subproviders/subprovider"'], [docSections.ledgerSubprovider]: ['"subproviders/src/subproviders/ledger"'], + [docSections.privateKeyWalletSubprovider]: ['"subproviders/src/subproviders/private_key_wallet"'], + [docSections.mnemonicWalletSubprovider]: ['"subproviders/src/subproviders/mnemonic_wallet"'], [docSections.factoryMethods]: ['"subproviders/src/index"'], [docSections.emptyWalletSubprovider]: ['"subproviders/src/subproviders/empty_wallet_subprovider"'], [docSections.fakeGasEstimateSubprovider]: ['"subproviders/src/subproviders/fake_gas_estimate_subprovider"'], @@ -75,6 +81,8 @@ const docsInfoConfig: DocsInfoConfig = { visibleConstructors: [ docSections.subprovider, docSections.ledgerSubprovider, + docSections.privateKeyWalletSubprovider, + docSections.mnemonicWalletSubprovider, docSections.emptyWalletSubprovider, docSections.fakeGasEstimateSubprovider, docSections.injectedWeb3Subprovider, @@ -97,6 +105,7 @@ const docsInfoConfig: DocsInfoConfig = { 'PartialTxParams', 'LedgerEthereumClient', 'LedgerSubproviderConfigs', + 'MnemonicWalletSubproviderConfigs', ], typeNameToExternalLink: { Web3: 'https://github.com/ethereum/wiki/wiki/JavaScript-API', |