diff --git a/README.md b/README.md index 22f6905..18455db 100644 --- a/README.md +++ b/README.md @@ -82,29 +82,15 @@ Please go to [./docs/classes/ethereumhdkey.md](./docs/classes/ethereumhdkey.md) ## Provider Engine -The Wallet can be easily plugged into [provider-engine](https://github.com/metamask/provider-engine) to provide signing: +Provider Engine is +[not very actively maintained](https://github.com/MetaMask/web3-provider-engine#web3-providerengine) +and support has been removed along `v1.0.0` release, see +issue [#115](https://github.com/ethereumjs/ethereumjs-wallet/issues/115) for context. -Node.js / ES5: - -```js -const { WalletSubprovider } = require('ethereumjs-wallet') - -.addProvider(new WalletSubprovider()) -``` - -ESM / TypeScript: - -```js -import { WalletSubprovider } from 'ethereumjs-wallet' - -.addProvider(new WalletSubprovider()) -``` - -Note it only supports the basic wallet. With a HD Wallet, call `getWallet()` first. - -Please go to [./docs/classes/walletsubprovider.md](./docs/README.md) for more info. +You can use the the old `src/provider-engine.ts` code (see associated PR) as some boilerplate +for your own integration if needed. -### Remarks about `toV3` +## Remarks about `toV3` The `options` is an optional object hash, where all the serialization parameters can be fine tuned: diff --git a/docs/README.md b/docs/README.md index d23f44c..30ac5c0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,6 @@ - [EthereumHDKey](classes/ethereumhdkey.md) - [Wallet](classes/wallet.md) -- [WalletSubprovider](classes/walletsubprovider.md) ### Interfaces @@ -30,9 +29,7 @@ ▸ **fromEtherCamp**(passphrase: _`string`_): [Wallet](classes/wallet.md) -_Defined in [thirdparty.ts:169](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L169)_ - -Third Party API: Import a brain wallet used by Ether.Camp +_Defined in [thirdparty.ts:169](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L169)_ **Parameters:** @@ -50,7 +47,7 @@ Third Party API: Import a brain wallet used by Ether.Camp ▸ **fromEtherWallet**(input: _`string` \| [EtherWalletOptions](interfaces/etherwalletoptions.md)_, password: _`string`_): [Wallet](classes/wallet.md) -_Defined in [thirdparty.ts:121](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L121)_ +_Defined in [thirdparty.ts:121](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L121)_ **Parameters:** @@ -69,9 +66,7 @@ _Defined in [thirdparty.ts:121](https://github.com/ethereumjs/ethereumjs-wallet/ ▸ **fromKryptoKit**(entropy: _`string`_, password: _`string`_): [Wallet](classes/wallet.md) -_Defined in [thirdparty.ts:176](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L176)_ - -Third Party API: Import a wallet from a KryptoKit seed +_Defined in [thirdparty.ts:176](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L176)_ **Parameters:** @@ -90,9 +85,7 @@ Third Party API: Import a wallet from a KryptoKit seed ▸ **fromQuorumWallet**(passphrase: _`string`_, userid: _`string`_): [Wallet](classes/wallet.md) -_Defined in [thirdparty.ts:265](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L265)_ - -Third Party API: Import a brain wallet used by Quorum Wallet +_Defined in [thirdparty.ts:265](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L265)_ **Parameters:** diff --git a/docs/classes/ethereumhdkey.md b/docs/classes/ethereumhdkey.md index ded79f9..5c1a545 100644 --- a/docs/classes/ethereumhdkey.md +++ b/docs/classes/ethereumhdkey.md @@ -34,9 +34,9 @@ ### constructor -⊕ **new EthereumHDKey**(\_hdkey?: _`any`_): [EthereumHDKey](ethereumhdkey.md) +⊕ **new EthereumHDKey**(\_hdkey: _`any`_): [EthereumHDKey](ethereumhdkey.md) -_Defined in [hdkey.ts:21](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L21)_ +_Defined in [hdkey.ts:21](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L21)_ **Parameters:** @@ -56,7 +56,7 @@ _Defined in [hdkey.ts:21](https://github.com/ethereumjs/ethereumjs-wallet/blob/c **● \_hdkey**: _`any`_ -_Defined in [hdkey.ts:23](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L23)_ +_Defined in [hdkey.ts:23](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L23)_ --- @@ -68,9 +68,7 @@ _Defined in [hdkey.ts:23](https://github.com/ethereumjs/ethereumjs-wallet/blob/c ▸ **deriveChild**(index: _`number`_): [EthereumHDKey](ethereumhdkey.md) -_Defined in [hdkey.ts:52](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L52)_ - -Derive a node based on a child index +_Defined in [hdkey.ts:52](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L52)_ **Parameters:** @@ -88,9 +86,7 @@ Derive a node based on a child index ▸ **derivePath**(path: _`string`_): [EthereumHDKey](ethereumhdkey.md) -_Defined in [hdkey.ts:45](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L45)_ - -Derives a node based on a path (e.g. m/44'/0'/0/1) +_Defined in [hdkey.ts:45](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L45)_ **Parameters:** @@ -108,9 +104,7 @@ Derives a node based on a path (e.g. m/44'/0'/0/1) ▸ **getWallet**(): [Wallet](wallet.md) -_Defined in [hdkey.ts:59](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L59)_ - -Return a `Wallet` instance as seen above +_Defined in [hdkey.ts:59](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L59)_ **Returns:** [Wallet](wallet.md) @@ -122,9 +116,7 @@ Return a `Wallet` instance as seen above ▸ **privateExtendedKey**(): `Buffer` -_Defined in [hdkey.ts:28](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L28)_ - -Returns a BIP32 extended private key (xprv) +_Defined in [hdkey.ts:28](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L28)_ **Returns:** `Buffer` @@ -136,9 +128,7 @@ Returns a BIP32 extended private key (xprv) ▸ **publicExtendedKey**(): `Buffer` -_Defined in [hdkey.ts:38](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L38)_ - -Return a BIP32 extended public key (xpub) +_Defined in [hdkey.ts:38](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L38)_ **Returns:** `Buffer` @@ -150,9 +140,7 @@ Return a BIP32 extended public key (xpub) ▸ **fromExtendedKey**(base58Key: _`string`_): [EthereumHDKey](ethereumhdkey.md) -_Defined in [hdkey.ts:19](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L19)_ - -Create an instance based on a BIP32 extended private or public key. +_Defined in [hdkey.ts:19](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L19)_ **Parameters:** @@ -170,11 +158,7 @@ Create an instance based on a BIP32 extended private or public key. ▸ **fromMasterSeed**(seedBuffer: _`Buffer`_): [EthereumHDKey](ethereumhdkey.md) -_Defined in [hdkey.ts:12](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/hdkey.ts#L12)_ - -Creates an instance based on a seed. - -For the seed we suggest to use [bip39](https://npmjs.org/package/bip39) to create one from a BIP39 mnemonic. +_Defined in [hdkey.ts:12](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/hdkey.ts#L12)_ **Parameters:** diff --git a/docs/classes/wallet.md b/docs/classes/wallet.md index 381df17..babfec8 100644 --- a/docs/classes/wallet.md +++ b/docs/classes/wallet.md @@ -52,9 +52,9 @@ ### constructor -⊕ **new Wallet**(privateKey?: _`Buffer` \| `undefined`_, publicKey?: _`Buffer` \| `undefined`_): [Wallet](wallet.md) +⊕ **new Wallet**(privateKey: _`Buffer` \| `undefined`_, publicKey?: _`Buffer` \| `undefined`_): [Wallet](wallet.md) -_Defined in [index.ts:230](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L230)_ +_Defined in [index.ts:229](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L229)_ **Parameters:** @@ -75,7 +75,7 @@ _Defined in [index.ts:230](https://github.com/ethereumjs/ethereumjs-wallet/blob/ **● privateKey**: _`Buffer` \| `undefined`_ -_Defined in [index.ts:232](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L232)_ +_Defined in [index.ts:231](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L231)_ --- @@ -85,7 +85,7 @@ _Defined in [index.ts:232](https://github.com/ethereumjs/ethereumjs-wallet/blob/ **● publicKey**: _`Buffer` \| `undefined`_ -_Defined in [index.ts:233](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L233)_ +_Defined in [index.ts:232](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L232)_ --- @@ -95,13 +95,9 @@ _Defined in [index.ts:233](https://github.com/ethereumjs/ethereumjs-wallet/blob/ ### `` privKey -**get privKey**(): `Buffer` +**privKey**: -_Defined in [index.ts:481](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L481)_ - -Returns the wallet's private key. - -**Returns:** `Buffer` +_Defined in [index.ts:480](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L480)_ --- @@ -109,13 +105,9 @@ Returns the wallet's private key. ### `` pubKey -**get pubKey**(): `Buffer` +**pubKey**: -_Defined in [index.ts:471](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L471)_ - -Returns the wallet's public key. - -**Returns:** `Buffer` +_Defined in [index.ts:470](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L470)_ --- @@ -127,9 +119,7 @@ Returns the wallet's public key. ▸ **getAddress**(): `Buffer` -_Defined in [index.ts:521](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L521)_ - -Returns the wallet's address. +_Defined in [index.ts:520](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L520)_ **Returns:** `Buffer` @@ -141,9 +131,7 @@ Returns the wallet's address. ▸ **getAddressString**(): `string` -_Defined in [index.ts:528](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L528)_ - -Returns the wallet's address as a "0x" prefixed hex string +_Defined in [index.ts:527](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L527)_ **Returns:** `string` @@ -155,9 +143,7 @@ Returns the wallet's address as a "0x" prefixed hex string ▸ **getChecksumAddressString**(): `string` -_Defined in [index.ts:536](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L536)_ - -Returns the wallet's private key as a "0x" prefixed hex string checksummed according to [EIP 55](https://github.com/ethereum/EIPs/issues/55). +_Defined in [index.ts:535](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L535)_ **Returns:** `string` @@ -169,9 +155,7 @@ Returns the wallet's private key as a "0x" prefixed hex string checksummed accor ▸ **getPrivateKey**(): `Buffer` -_Defined in [index.ts:495](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L495)_ - -Returns the wallet's private key. +_Defined in [index.ts:494](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L494)_ **Returns:** `Buffer` @@ -183,7 +167,7 @@ Returns the wallet's private key. ▸ **getPrivateKeyString**(): `string` -_Defined in [index.ts:499](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L499)_ +_Defined in [index.ts:498](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L498)_ **Returns:** `string` @@ -195,9 +179,7 @@ _Defined in [index.ts:499](https://github.com/ethereumjs/ethereumjs-wallet/blob/ ▸ **getPublicKey**(): `Buffer` -_Defined in [index.ts:507](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L507)_ - -Returns the wallet's public key. +_Defined in [index.ts:506](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L506)_ **Returns:** `Buffer` @@ -209,9 +191,7 @@ Returns the wallet's public key. ▸ **getPublicKeyString**(): `string` -_Defined in [index.ts:514](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L514)_ - -Returns the wallet's public key as a "0x" prefixed hex string +_Defined in [index.ts:513](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L513)_ **Returns:** `string` @@ -221,11 +201,9 @@ Returns the wallet's public key as a "0x" prefixed hex string ### getV3Filename -▸ **getV3Filename**(timestamp?: _`undefined` \| `number`_): `string` +▸ **getV3Filename**(timestamp: _`undefined` \| `number`_): `string` -_Defined in [index.ts:618](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L618)_ - -Return the suggested filename for V3 keystores. +_Defined in [index.ts:617](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L617)_ **Parameters:** @@ -241,11 +219,9 @@ Return the suggested filename for V3 keystores. ### toV3 -▸ **toV3**(password: _`string`_, opts?: _`Partial`<`V3Params`>_): `V3Keystore` - -_Defined in [index.ts:546](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L546)_ +▸ **toV3**(password: _`string`_, opts: _`Partial`<`V3Params`>_): `V3Keystore` -Returns an Etherem Version 3 Keystore Format object representing the wallet +_Defined in [index.ts:545](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L545)_ **Parameters:** @@ -262,9 +238,9 @@ Returns an Etherem Version 3 Keystore Format object representing the wallet ### toV3String -▸ **toV3String**(password: _`string`_, opts?: _`Partial`<`V3Params`>_): `string` +▸ **toV3String**(password: _`string`_, opts: _`Partial`<`V3Params`>_): `string` -_Defined in [index.ts:636](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L636)_ +_Defined in [index.ts:635](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L635)_ **Parameters:** @@ -283,7 +259,7 @@ _Defined in [index.ts:636](https://github.com/ethereumjs/ethereumjs-wallet/blob/ ▸ **fromEthSale**(input: _`string` \| `EthSaleKeystore`_, password: _`string`_): [Wallet](wallet.md) -_Defined in [index.ts:445](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L445)_ +_Defined in [index.ts:444](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L444)_ **Parameters:** @@ -302,9 +278,7 @@ _Defined in [index.ts:445](https://github.com/ethereumjs/ethereumjs-wallet/blob/ ▸ **fromExtendedPrivateKey**(extendedPrivateKey: _`string`_): [Wallet](wallet.md) -_Defined in [index.ts:322](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L322)_ - -Create an instance based on a BIP32 extended private key (xprv) +_Defined in [index.ts:321](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L321)_ **Parameters:** @@ -322,9 +296,7 @@ Create an instance based on a BIP32 extended private key (xprv) ▸ **fromExtendedPublicKey**(extendedPublicKey: _`string`_): [Wallet](wallet.md) -_Defined in [index.ts:303](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L303)_ - -Create an instance based on a BIP32 extended public key (xpub) +_Defined in [index.ts:302](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L302)_ **Parameters:** @@ -342,9 +314,7 @@ Create an instance based on a BIP32 extended public key (xpub) ▸ **fromPrivateKey**(privateKey: _`Buffer`_): [Wallet](wallet.md) -_Defined in [index.ts:315](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L315)_ - -Create an instance based on a raw private key +_Defined in [index.ts:314](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L314)_ **Parameters:** @@ -362,11 +332,7 @@ Create an instance based on a raw private key ▸ **fromPublicKey**(publicKey: _`Buffer`_, nonStrict?: _`boolean`_): [Wallet](wallet.md) -_Defined in [index.ts:293](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L293)_ - -Create an instance based on a public key (certain methods will not be available) - -This method only accepts uncompressed Ethereum-style public keys, unless the `nonStrict` flag is set to true. +_Defined in [index.ts:292](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L292)_ **Parameters:** @@ -385,9 +351,7 @@ This method only accepts uncompressed Ethereum-style public keys, unless the `no ▸ **fromV1**(input: _`string` \| `V1Keystore`_, password: _`string`_): [Wallet](wallet.md) -_Defined in [index.ts:339](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L339)_ - -Import a wallet (Version 1 of the Ethereum wallet format). +_Defined in [index.ts:338](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L338)_ **Parameters:** @@ -406,9 +370,7 @@ Import a wallet (Version 1 of the Ethereum wallet format). ▸ **fromV3**(input: _`string` \| `V3Keystore`_, password: _`string`_, nonStrict?: _`boolean`_): [Wallet](wallet.md) -_Defined in [index.ts:379](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L379)_ - -Import a wallet (Version 3 of the Ethereum wallet format). Set `nonStrict` true to accept files with mixed-caps. +_Defined in [index.ts:378](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L378)_ **Parameters:** @@ -428,9 +390,7 @@ Import a wallet (Version 3 of the Ethereum wallet format). Set `nonStrict` true ▸ **generate**(icapDirect?: _`boolean`_): [Wallet](wallet.md) -_Defined in [index.ts:255](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L255)_ - -Create an instance based on a new random key. +_Defined in [index.ts:254](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L254)_ **Parameters:** @@ -448,9 +408,7 @@ Create an instance based on a new random key. ▸ **generateVanityAddress**(pattern: _`RegExp` \| `string`_): [Wallet](wallet.md) -_Defined in [index.ts:272](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/index.ts#L272)_ - -Create an instance where the address is valid against the supplied pattern (**this will be very slow**) +_Defined in [index.ts:271](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/index.ts#L271)_ **Parameters:** diff --git a/docs/classes/walletsubprovider.md b/docs/classes/walletsubprovider.md deleted file mode 100644 index 4e767e5..0000000 --- a/docs/classes/walletsubprovider.md +++ /dev/null @@ -1,38 +0,0 @@ -[ethereumjs-wallet](../README.md) > [WalletSubprovider](../classes/walletsubprovider.md) - -# Class: WalletSubprovider - -## Hierarchy - -`any` - -**↳ WalletSubprovider** - -## Index - -### Constructors - -- [constructor](walletsubprovider.md#constructor) - ---- - -## Constructors - - - -### constructor - -⊕ **new WalletSubprovider**(wallet: _[Wallet](wallet.md)_, opts?: _`any`_): [WalletSubprovider](walletsubprovider.md) - -_Defined in [provider-engine.ts:5](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/provider-engine.ts#L5)_ - -**Parameters:** - -| Name | Type | -| --------------- | ------------------- | -| wallet | [Wallet](wallet.md) | -| `Optional` opts | `any` | - -**Returns:** [WalletSubprovider](walletsubprovider.md) - ---- diff --git a/docs/interfaces/etherwalletoptions.md b/docs/interfaces/etherwalletoptions.md index 3ccb292..0b34282 100644 --- a/docs/interfaces/etherwalletoptions.md +++ b/docs/interfaces/etherwalletoptions.md @@ -27,7 +27,7 @@ **● address**: _`string`_ -_Defined in [thirdparty.ts:108](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L108)_ +_Defined in [thirdparty.ts:108](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L108)_ --- @@ -37,7 +37,7 @@ _Defined in [thirdparty.ts:108](https://github.com/ethereumjs/ethereumjs-wallet/ **● encrypted**: _`boolean`_ -_Defined in [thirdparty.ts:109](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L109)_ +_Defined in [thirdparty.ts:109](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L109)_ --- @@ -47,7 +47,7 @@ _Defined in [thirdparty.ts:109](https://github.com/ethereumjs/ethereumjs-wallet/ **● hash**: _`string`_ -_Defined in [thirdparty.ts:111](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L111)_ +_Defined in [thirdparty.ts:111](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L111)_ --- @@ -57,7 +57,7 @@ _Defined in [thirdparty.ts:111](https://github.com/ethereumjs/ethereumjs-wallet/ **● locked**: _`boolean`_ -_Defined in [thirdparty.ts:110](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L110)_ +_Defined in [thirdparty.ts:110](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L110)_ --- @@ -67,7 +67,7 @@ _Defined in [thirdparty.ts:110](https://github.com/ethereumjs/ethereumjs-wallet/ **● private**: _`string`_ -_Defined in [thirdparty.ts:112](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L112)_ +_Defined in [thirdparty.ts:112](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L112)_ --- @@ -77,6 +77,6 @@ _Defined in [thirdparty.ts:112](https://github.com/ethereumjs/ethereumjs-wallet/ **● public**: _`string`_ -_Defined in [thirdparty.ts:113](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L113)_ +_Defined in [thirdparty.ts:113](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L113)_ --- diff --git a/docs/interfaces/evpkdfopts.md b/docs/interfaces/evpkdfopts.md index 3e6d4b6..d6fb5a2 100644 --- a/docs/interfaces/evpkdfopts.md +++ b/docs/interfaces/evpkdfopts.md @@ -25,7 +25,7 @@ **● count**: _`number`_ -_Defined in [thirdparty.ts:17](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L17)_ +_Defined in [thirdparty.ts:17](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L17)_ --- @@ -35,7 +35,7 @@ _Defined in [thirdparty.ts:17](https://github.com/ethereumjs/ethereumjs-wallet/b **● digest**: _`string`_ -_Defined in [thirdparty.ts:20](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L20)_ +_Defined in [thirdparty.ts:20](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L20)_ --- @@ -45,7 +45,7 @@ _Defined in [thirdparty.ts:20](https://github.com/ethereumjs/ethereumjs-wallet/b **● ivsize**: _`number`_ -_Defined in [thirdparty.ts:19](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L19)_ +_Defined in [thirdparty.ts:19](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L19)_ --- @@ -55,6 +55,6 @@ _Defined in [thirdparty.ts:19](https://github.com/ethereumjs/ethereumjs-wallet/b **● keysize**: _`number`_ -_Defined in [thirdparty.ts:18](https://github.com/ethereumjs/ethereumjs-wallet/blob/c748f97/src/thirdparty.ts#L18)_ +_Defined in [thirdparty.ts:18](https://github.com/ethereumjs/ethereumjs-wallet/blob/13fb20d/src/thirdparty.ts#L18)_ --- diff --git a/package.json b/package.json index 4025fd7..4d36ad5 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,7 @@ "hdkey": "^1.1.1", "randombytes": "^2.0.6", "utf8": "^3.0.0", - "uuid": "^3.3.2", - "web3-provider-engine": "^15.0.7" + "uuid": "^3.3.2" }, "devDependencies": { "@ethereumjs/config-nyc": "^1.1.1", diff --git a/src/index.ts b/src/index.ts index 7bc14b1..25c83d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,6 @@ import * as crypto from 'crypto' import * as ethUtil from 'ethereumjs-util' export { default as hdkey } from './hdkey' -export { default as WalletSubprovider } from './provider-engine' export { default as thirdparty } from './thirdparty' const bs58check = require('bs58check') diff --git a/src/provider-engine.ts b/src/provider-engine.ts deleted file mode 100644 index f27ed96..0000000 --- a/src/provider-engine.ts +++ /dev/null @@ -1,22 +0,0 @@ -import Wallet from './index' - -const HookedWalletEthTxSubprovider = require('web3-provider-engine/subproviders/hooked-wallet-ethtx') - -export default class WalletSubprovider extends HookedWalletEthTxSubprovider { - constructor(wallet: Wallet, opts?: any) { - if (!opts) { - opts = {} - } - - opts.getAccounts = (cb: any) => cb(null, [wallet.getAddressString()]) - - opts.getPrivateKey = (address: string, cb: any) => { - if (address !== wallet.getAddressString()) { - cb(new Error('Account not found')) - } else { - cb(null, wallet.getPrivateKey()) - } - } - super(opts) - } -}