Xianny a57dd427ca
Merge development into 3.0 (#2170)
* Added longer timeout for algolia admin operations. Added an option to apply hidden and custom labels to filters from algolia. Added sorting guides (alphabetically) and tools (by community maintenance and alphabetically).

* Fixed some types in guides

* Updated webpack, webpack-dev-server, webpack-bundle-analyzer, webpack-cli versions

* Updated / cleaned up babel and mdx packages

* Updated terser webpack plugin; Removed uglify plugin (unused). Added parallel option for terser. Added target browsers and cache directory option for babel-loader

* Webpack changes: using eval-source-map for development, added parallel option to Terser plugin, added cache loader and caching directory to mdx / babel loaders.

* Removed unusued pkg: body-scroll-lock

* Removed unused jsonschema / @types/jsonschema packages

* Removed unused less node package, adjusted less loader rules to match other loaders in webpack config

* Removed unusued node-sass package. Left sass-loader for webpack intact.

* Removed unused package react-lazyload

* Removed unused package react-typist

* Removed react-tap-event types as it's not used anymore. Reinstalled node-sass as a dev dependency as it's needed by sass-loader

* Moves @0x/types and @0x/typescript-typings to devDependencies

* Replaced react loadable (only used in Icon) with the native react lazy / suspense. Removed loadable nad its types from package.json

* Removed unused make-promises-safe package

* Moved animations to public and compressed files

* Added opening step links in new tab if the url is valid

* Moved @0x/types back to dependencies.

* Added animation wrapper with positioning props. Updated animations for core concepts.

* Replaced images for core concepts. Fixed a bug causing duplicate props on image and its container in mdx

* Remove legacy FAQ

* Update yarn.lock

* Add MD docs diff test to CI

* Remove unused dep

* Update docs to latest format

* Update yarn.lock

* Update ts-doc-gen with fix for multi-link lines

* Final docs gen

* Fix home route

* Update yarn.lock

* Add Golang Mesh RPC package and update versions

* Update the tools MDX files from authoritative S3 before build and dev server start

* Gitignore the tool MDX files in website repo

* Redirect old docs pages and wiki to new doc pages

* Move out Algolia indexing command-line tool out of website and remove need to expose admin key

* Add updating tools from S3 and indexing content on Algolia to deployment commands

* Add note about admin API env var needed for indexing docs

* Remove scripts gitignore since we don't have monorepo scripts in each package anymore

* Segregate indexes by environment

* Fixed 404 display for docs pages

* Removed webpack bundle analyzer

* Fix search and indexing

* Use `yarn` because otherwise the flags don't get passed down properly

* Improve indexing comment

* Remove legacy doc pages

* Fix linter errors

* Fix clean command to remove bundles recursively

* Revert react and react-dom versions in Instant

* Remove old doc md files

* Fix links

* Fix prettier

* Combine @0x/utils exports

* Update doc links

* Remove unused components

* Fix TS error

* Add missing new line

* Update Guides

* Ignore auto-generated MDX in website repo

* Prettier fix

* Add all guides to the sitemap.txt

* Add MMing guide

* Fix Get Started links

* Add 0x Extensions guide

* Replace all links to wiki with links to guides section

* Fix all /docs/{pkg} links to /docs/tools/{pkg}

* Remove deployer endpoint that is no longer used

* Fix links in Core Concepts

* Fixed regex to not remove hashes on links beyond the initial one

* Fixed huge width on instant screenshot

* Cleaned up core concept illustrations

* Started updating tool titles

* Fixed sectionizing headings in docs: Nested sections do not get wrapped in parent sections anymore; only sectionizing headings that need to be sectionized (i.e. that appear in the table of contents)

* Stylstic fix for the new way we sectionize headings / table of contents

* Change CoordinatorWrapper constructor to take a provider

* Added autolinking headings in mdx docs

* Refactor doc generation script to only generate MD docs and to have them reflect what is exported in their respective index.ts files

* Update ts-doc-gen

* Pass in provider, not Web3Wrapper

* Add back logic to prune out private methods

* Write algolia_metadata to utils dir

* Remove duplicate algolia_meta

* Add more packages to those we generate docs for and remove unused flags

* Update reference.mdx files

* Hide tools from homepage that have isHidden flag

* Link 0x.js to it's reference page

* Update tool naming to be more human readable

* Remove order-watcher reference doc

* Add blurb about on-chain API Explorer

* Add "On-chain" prefix to section name

* Remove committed reference file

* Sorting guides by difficulty and alphabetically

* Pushed sorting guides titles case-insensitive

* Sorting tools by difficulty and alphabetically. Removed icons from featured tools. Extracted common difficultyOrder constant

* Update ts-doc-gen so that it properly converts module relative links to anchor links

* Update doc references

* Remove "Relayers" topic/tag

* Prettier fix

* Remove hr so we don't have a bunch in a row

* Cleaned up CLI tag and added link to tools on API page

* Cleaned up some Guide titles

* Added bug bounty program guide

* Fixed a bug in algolia_meta

* Thrid level of nesting / temporary webpack config

* Open help link in new tab

* Link Python tools to doc pages not PyPi

* Fix links in guides

* Remove unused variables

* Revert webpack config

* Extracted common styles for levels of nesting deeper than 1 in the mdx table of contents

* Smoother animation on active table of contents state change

* Autolink headings in mdx only up to h3. Added heading sizes (in px) for h4,h5,h6 in mdx headings

* Fix prettier

* Adjusted font-size for paragraph, ordered and unordered lists. Fixed line-heights and colors too.

* Update ts-doc-gen and the reference docs

* Replace 0xproject.com urls with 0x.org

* Update README links

* Fix header sizes to display optimally in sidebar

* Fixed an issue with other nodes than text being parsed incorrectly in the table of contents

* Fixed styles for table of contents

* Use a different babel plugin that works in a production webpack build

* Unbroke build process / generating toc

* Changed line-height to 1.6 for paragraph

* Adjust scrollbar / toc height to available space

* Fixed some types

* Remove unnecessary link

* Fix casing on TypeScript

* Fix casing of PyPI

* Remove doc gen from abi-gen-wrappers since it'll be tested via contract-wrappers

* Fix MD docs and make sure generated contract wrappers are being rendered

* Remove generated docs in clean

* Correctly copying code samples

* Several additional fixes to the reference MDX docs

* Changed tools to Tools & Libraries - top nav left as just tools

* Changed references from Asset Buyer to Asset Swapper

* Changed trader keyword to trading

* Nevermind, changed back to Trader

* Sneaking in updated product dropdown menu titles based on Will's feedback

* Removed the word wiki from resources dropdown

* Open legal guide in same window

* Removed the isCommunity filter / custom filter labels functionality (only used for that before)

* Update ts-doc-gen version to one that fixes issues with Object Literals and removes Hierarchy sections and Module headers

* update yarn.lock

* Remove unused code

* Remove unused import

* Remove unused imports

* Remove unused import

* Fix prettier

* Update outdating dep version

* Created a color scheme for code snippets. Fixed language not being passed to some code blocks in two guides.

* Update abi-gen-wrappers dep version

* Update Algolia to production account

* Fix prettier

* Fix prettier in algolia_meta

* Remove packages/dev-tools-pages folder and update yarn.lock

* Remove other random references to dev-tools-pages

* Fix website

* Changed the order of indices in search suggestions

* Removed a comment

* Added scrollbar size adjustment on resize / scroll

* Rendering sidebar on mobile without any event listeners / taxing calculations / changes in height

* Added a performance comment

* Simplified table of contents

* Update ganache-cli to later version

* Remove bundle dirs too

* Added keeping active link in view when scrolling content in the docs

* Increase available memory for webpack

* Update contract addresses

* Update market-making guide to mention Mesh as an alternative to SRA

* Update Web3 Provider Explained guide

* Re-wrote Ganache Setup guide into a Setting up a local 0x testnet guide

* Export more of abi-gen-wrappers from contract-wrappers

* Final update of reference docs

* Add contract-wrappers MD docs and update it's index.ts so that no types are missing

* Fix prettier

* Increase the memory allocation for building the website

* Remove use of remove type

* Check if link is a valid url in mdx inline link: if so, open in a new tab, if not, same tab.

* Print out which snapshot version is being downloaded

* Updated CHANGELOGS & MD docs

* Publish

 - @0x/contracts-asset-proxy@2.2.7
 - @0x/contracts-coordinator@2.0.12
 - @0x/contracts-dev-utils@0.0.9
 - @0x/contracts-erc1155@1.1.14
 - @0x/contracts-erc20@2.2.13
 - @0x/contracts-erc721@2.1.14
 - @0x/contracts-exchange-forwarder@3.0.11
 - @0x/contracts-exchange-libs@3.0.7
 - @0x/contracts-exchange@2.1.13
 - @0x/contracts-extensions@4.0.7
 - @0x/contracts-multisig@3.1.13
 - @0x/contracts-test-utils@3.1.15
 - @0x/contracts-utils@3.2.3
 - 0x.js@7.0.1
 - @0x/abi-gen-wrappers@5.3.1
 - @0x/abi-gen@4.2.0
 - @0x/assert@2.1.5
 - @0x/asset-buyer@6.1.13
 - @0x/asset-swapper@1.0.3
 - @0x/base-contract@5.3.3
 - @0x/connect@5.0.18
 - @0x/contract-artifacts@2.2.1
 - @0x/contract-wrappers@12.0.0
 - @0x/contracts-gen@1.0.14
 - @0x/dev-tools-pages@0.0.30
 - @0x/dev-utils@2.3.2
 - ethereum-types@2.1.5
 - @0x/fill-scenarios@3.0.18
 - @0x/instant@1.0.30
 - @0x/json-schemas@4.0.1
 - @0x/migrations@4.3.1
 - @0x/monorepo-scripts@1.0.36
 - @0x/order-utils@8.3.1
 - @0x/sol-compiler@3.1.14
 - @0x/sol-coverage@3.0.11
 - @0x/sol-doc@2.0.18
 - @0x/sol-profiler@3.1.13
 - @0x/sol-resolver@2.0.10
 - @0x/sol-trace@2.0.19
 - @0x/sol-tracing-utils@6.0.18
 - @0x/sra-spec@2.0.16
 - @0x/subproviders@5.0.3
 - @0x/testnet-faucets@1.0.86
 - @0x/types@2.4.2
 - @0x/typescript-typings@4.2.5
 - @0x/utils@4.5.1
 - @0x/web3-wrapper@6.0.12
 - @0x/website@0.0.89

* Remove the website from the monorepo

* Update yarn.lock

* Remove website files that were accidentally merged back in

* Use local EVM for pure functions (#2108)

* add local evm for pure functions

* increase container size to >=8gb for static-tests

* increase max bundle size because of ethereumjs-vm dependency

* add declarations for ethereumjs-vm in @0x/typescript-typings

* Make `OrdersChannelSubscriptionOpts` conform to SRAv2

* Make it easier to use validateOrderFillableOrThrowAsync (#2096)

* make it easier to use validateOrderFillableOrThrowAsync

* add unit tests, use DevUtils

* remove dependency on @0x/order-utils from @0x/migrations

* add devUtils to contract-wrappers (#2146)

* Delete docs in S3 bucket before uploading latest version so we only ever have one version uploaded at a time

* Update to new ts-doc-gen version that fixes links in "Inherited from" lines

* try to fix instant build

* Remove redoc-cli as a dep from sra-spec

* Smooth out some last incompatible types

* Fix prettier

* Add terser-webpack-plugin to 0x.js deps

* @0x/orderbook

* AssetSwapper to use @0x/orderbook

* Remove unused imported type

* Prevent double websocket connections

* Fix build error

* fixed consumer inconsistency bug

* linted + added convenience functionality

* minor changes/typo fixes

* updated websocket

* updated for prettier

* Fix versions and exported types

* move log tests to @0x/abi-gen; delete exchange_wrapper_test (#2160)

* Remove unused exported types

* Fix exports from asset-swapper

* Update exported types for docs

* Update mesh client dep

* Move perPage and 18 precision lower to re-use

* fix ABI encoding/decoding functions (#2165)

* Fix typo at contract import (#2102)

* Updated CHANGELOGS & MD docs

* Publish

 - @0x/contracts-asset-proxy@2.2.8
 - @0x/contracts-coordinator@2.0.13
 - @0x/contracts-dev-utils@0.0.10
 - @0x/contracts-erc1155@1.1.15
 - @0x/contracts-erc20@2.2.14
 - @0x/contracts-erc721@2.1.15
 - @0x/contracts-exchange-forwarder@3.0.12
 - @0x/contracts-exchange-libs@3.0.8
 - @0x/contracts-exchange@2.1.14
 - @0x/contracts-extensions@4.0.8
 - @0x/contracts-multisig@3.1.14
 - @0x/contracts-test-utils@3.1.16
 - @0x/contracts-utils@3.2.4
 - 0x.js@7.0.2
 - @0x/abi-gen-wrappers@5.3.2
 - @0x/abi-gen@4.2.1
 - @0x/assert@2.1.6
 - @0x/asset-buyer@6.1.14
 - @0x/asset-swapper@2.0.0
 - @0x/base-contract@5.4.0
 - @0x/connect@5.0.19
 - @0x/contract-addresses@3.2.0
 - @0x/contract-artifacts@2.2.2
 - @0x/contract-wrappers@12.1.0
 - @0x/contracts-gen@1.0.15
 - @0x/dev-utils@2.3.3
 - ethereum-types@2.1.6
 - @0x/fill-scenarios@3.0.19
 - @0x/instant@1.0.31
 - @0x/json-schemas@4.0.2
 - @0x/migrations@4.3.2
 - @0x/monorepo-scripts@1.0.37
 - @0x/order-utils@8.4.0
 - @0x/orderbook@0.0.2
 - @0x/sol-compiler@3.1.15
 - @0x/sol-coverage@3.0.12
 - @0x/sol-doc@2.0.19
 - @0x/sol-profiler@3.1.14
 - @0x/sol-resolver@2.0.11
 - @0x/sol-trace@2.0.20
 - @0x/sol-tracing-utils@6.0.19
 - @0x/sra-spec@2.0.17
 - @0x/subproviders@5.0.4
 - @0x/testnet-faucets@1.0.87
 - @0x/types@2.4.3
 - @0x/typescript-typings@4.3.0
 - @0x/utils@4.5.2
 - @0x/web3-wrapper@6.0.13

* fix circleci diff

* update changelog
2019-09-19 19:43:08 -07:00

3152 lines
84 KiB
Plaintext

# Class: FakeGasEstimateSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
It intercepts the `eth_estimateGas` JSON RPC call and always returns a constant gas amount when queried.
## Constructors
\+ **new FakeGasEstimateSubprovider**(`constantGasAmount`: number): *[FakeGasEstimateSubprovider](#class-fakegasestimatesubprovider)*
*Defined in [subproviders/src/subproviders/fake_gas_estimate_subprovider.ts:17](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts#L17)*
Instantiates an instance of the FakeGasEstimateSubprovider
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`constantGasAmount` | number | The constant gas amount you want returned |
**Returns:** *[FakeGasEstimateSubprovider](#class-fakegasestimatesubprovider)*
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/fake_gas_estimate_subprovider.ts:35](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts#L35)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: GanacheSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
It intercepts all JSON RPC requests and relays them to an in-process ganache instance.
## Constructors
\+ **new GanacheSubprovider**(`opts`: `GanacheOpts`): *[GanacheSubprovider](#class-ganachesubprovider)*
*Defined in [subproviders/src/subproviders/ganache.ts:13](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ganache.ts#L13)*
Instantiates a GanacheSubprovider
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`opts` | `GanacheOpts` | The desired opts with which to instantiate the Ganache provider |
**Returns:** *[GanacheSubprovider](#class-ganachesubprovider)*
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `_next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/ganache.ts:31](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ganache.ts#L31)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`_next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: LedgerSubprovider
Subprovider for interfacing with a user's [Ledger Nano S](https://www.ledgerwallet.com/products/ledger-nano-s).
This subprovider intercepts all account related RPC requests (e.g message/transaction signing, etc...) and
re-routes them to a Ledger device plugged into the users computer.
## Constructors
\+ **new LedgerSubprovider**(`config`: [LedgerSubproviderConfigs](#interface-ledgersubproviderconfigs)): *[LedgerSubprovider](#class-ledgersubprovider)*
*Defined in [subproviders/src/subproviders/ledger.ts:41](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L41)*
Instantiates a LedgerSubprovider. Defaults to derivationPath set to `44'/60'/0'`.
TestRPC/Ganache defaults to `m/44'/60'/0'/0`, so set this in the configs if desired.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`config` | [LedgerSubproviderConfigs](#interface-ledgersubproviderconfigs) | Several available configurations |
**Returns:** *[LedgerSubprovider](#class-ledgersubprovider)*
LedgerSubprovider instance
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### getAccountsAsync
▸ **getAccountsAsync**(`numberOfAccounts`: number): *`Promise<string[]>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/ledger.ts:87](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L87)*
Retrieve a users Ledger accounts. The accounts are derived from the derivationPath,
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.
**Parameters:**
Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`numberOfAccounts` | number | DEFAULT_NUM_ADDRESSES_TO_FETCH | Number of accounts to retrieve (default: 10) |
**Returns:** *`Promise<string[]>`*
An array of accounts
___
### getPath
▸ **getPath**(): *string*
*Defined in [subproviders/src/subproviders/ledger.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L68)*
Retrieve the set derivation path
**Returns:** *string*
derivation path
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/base_wallet_subprovider.ts:37](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts#L37)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
___
### setPath
▸ **setPath**(`basDerivationPath`: string): *void*
*Defined in [subproviders/src/subproviders/ledger.ts:75](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L75)*
Set a desired derivation path when computing the available user addresses
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`basDerivationPath` | string | The desired derivation path (e.g `44'/60'/0'`) |
**Returns:** *void*
___
### signPersonalMessageAsync
▸ **signPersonalMessageAsync**(`data`: string, `address`: string): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/ledger.ts:158](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L158)*
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.
If you are not using this via a ProviderEngine instance, you can call it directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`data` | string | Hex string message to sign |
`address` | string | Address of the account to sign with |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
___
### signTransactionAsync
▸ **signTransactionAsync**(`txParams`: [PartialTxParams](#interface-partialtxparams)): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/ledger.ts:101](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L101)*
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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`txParams` | [PartialTxParams](#interface-partialtxparams) | Parameters of the transaction to sign |
**Returns:** *`Promise<string>`*
Signed transaction hex string
___
### signTypedDataAsync
▸ **signTypedDataAsync**(`address`: string, `typedData`: any): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/ledger.ts:196](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/ledger.ts#L196)*
eth_signTypedData is currently not supported on Ledger devices.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`address` | string | Address of the account to sign with |
`typedData` | any | - |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
<hr />
# Class: MetamaskSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine)
subprovider interface and the provider sendAsync interface.
It handles inconsistencies with Metamask implementations of various JSON RPC methods.
It forwards JSON RPC requests involving the domain of a signer (getAccounts,
sendTransaction, signMessage etc...) to the provider instance supplied at instantiation. All other requests
are passed onwards for subsequent subproviders to handle.
## Constructors
\+ **new MetamaskSubprovider**(`supportedProvider`: [SupportedProvider](#supportedprovider)): *[MetamaskSubprovider](#class-metamasksubprovider)*
*Defined in [subproviders/src/subproviders/metamask_subprovider.ts:19](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/metamask_subprovider.ts#L19)*
Instantiates a new MetamaskSubprovider
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`supportedProvider` | [SupportedProvider](#supportedprovider) | Web3 provider that should handle all user account related requests |
**Returns:** *[MetamaskSubprovider](#class-metamasksubprovider)*
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/metamask_subprovider.ts:39](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/metamask_subprovider.ts#L39)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### sendAsync
▸ **sendAsync**(`payload`: `JSONRPCRequestPayload`, `callback`: [ErrorCallback](#errorcallback)): *void*
*Defined in [subproviders/src/subproviders/metamask_subprovider.ts:117](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/metamask_subprovider.ts#L117)*
This method conforms to the provider sendAsync interface.
Allowing the MetamaskSubprovider to be used as a generic provider (outside of Web3ProviderEngine) with the
addition of wrapping the inconsistent Metamask behaviour
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`callback` | [ErrorCallback](#errorcallback) | - |
**Returns:** *void*
The contents nested under the result key of the response body
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: MnemonicWalletSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
This subprovider intercepts all account related RPC requests (e.g message/transaction signing, etc...) and handles
all requests with accounts derived from the supplied mnemonic.
## Constructors
\+ **new MnemonicWalletSubprovider**(`config`: [MnemonicWalletSubproviderConfigs](#interface-mnemonicwalletsubproviderconfigs)): *[MnemonicWalletSubprovider](#class-mnemonicwalletsubprovider)*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:27](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L27)*
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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`config` | [MnemonicWalletSubproviderConfigs](#interface-mnemonicwalletsubproviderconfigs) | Configuration for the mnemonic wallet, must contain the mnemonic |
**Returns:** *[MnemonicWalletSubprovider](#class-mnemonicwalletsubprovider)*
MnemonicWalletSubprovider instance
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### getAccountsAsync
▸ **getAccountsAsync**(`numberOfAccounts`: number): *`Promise<string[]>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:70](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L70)*
Retrieve the accounts associated with the mnemonic.
This method is implicitly called when issuing a `eth_accounts` JSON RPC request
via your providerEngine instance.
**Parameters:**
Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`numberOfAccounts` | number | DEFAULT_NUM_ADDRESSES_TO_FETCH | Number of accounts to retrieve (default: 10) |
**Returns:** *`Promise<string[]>`*
An array of accounts
___
### getPath
▸ **getPath**(): *string*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:52](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L52)*
Retrieve the set derivation path
**Returns:** *string*
derivation path
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/base_wallet_subprovider.ts:37](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts#L37)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
___
### setPath
▸ **setPath**(`baseDerivationPath`: string): *void*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:59](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L59)*
Set a desired derivation path when computing the available user addresses
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`baseDerivationPath` | string | The desired derivation path (e.g `44'/60'/0'`) |
**Returns:** *void*
___
### signPersonalMessageAsync
▸ **signPersonalMessageAsync**(`data`: string, `address`: string): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:102](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L102)*
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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`data` | string | Hex string message to sign |
`address` | string | Address of the account to sign with |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
___
### signTransactionAsync
▸ **signTransactionAsync**(`txParams`: [PartialTxParams](#interface-partialtxparams)): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:84](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L84)*
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.
If you are not using this via a ProviderEngine instance, you can call it directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`txParams` | [PartialTxParams](#interface-partialtxparams) | Parameters of the transaction to sign |
**Returns:** *`Promise<string>`*
Signed transaction hex string
___
### signTypedDataAsync
▸ **signTypedDataAsync**(`address`: string, `typedData`: `EIP712TypedData`): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/mnemonic_wallet.ts:122](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/mnemonic_wallet.ts#L122)*
Sign an EIP712 Typed Data message. The signing account will be the account
associated with the provided address. If you've added this MnemonicWalletSubprovider to
your app's provider, you can simply send an `eth_signTypedData` 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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`address` | string | Address of the account to sign with |
`typedData` | `EIP712TypedData` | - |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
<hr />
# Class: NonceTrackerSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
It is heavily inspired by the [NonceSubprovider](https://github.com/MetaMask/provider-engine/blob/master/subproviders/nonce-tracker.js).
We added the additional feature of clearing the cached nonce value when a `nonce value too low` error occurs.
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [NextCallback](#nextcallback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/nonce_tracker.ts:57](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/nonce_tracker.ts#L57)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [NextCallback](#nextcallback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: PrivateKeyWalletSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
This subprovider intercepts all account related RPC requests (e.g message/transaction signing, etc...) and handles
all requests with the supplied Ethereum private key.
## Constructors
\+ **new PrivateKeyWalletSubprovider**(`privateKey`: string): *[PrivateKeyWalletSubprovider](#class-privatekeywalletsubprovider)*
*Defined in [subproviders/src/subproviders/private_key_wallet.ts:19](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/private_key_wallet.ts#L19)*
Instantiates a PrivateKeyWalletSubprovider.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`privateKey` | string | The corresponding private key to an Ethereum address |
**Returns:** *[PrivateKeyWalletSubprovider](#class-privatekeywalletsubprovider)*
PrivateKeyWalletSubprovider instance
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### getAccountsAsync
▸ **getAccountsAsync**(): *`Promise<string[]>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/private_key_wallet.ts:37](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/private_key_wallet.ts#L37)*
Retrieve the account associated with the supplied private key.
This method is implicitly called when issuing a `eth_accounts` JSON RPC request
via your providerEngine instance.
**Returns:** *`Promise<string[]>`*
An array of accounts
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/base_wallet_subprovider.ts:37](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts#L37)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
___
### signPersonalMessageAsync
▸ **signPersonalMessageAsync**(`data`: string, `address`: string): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/private_key_wallet.ts:72](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/private_key_wallet.ts#L72)*
Sign a personal Ethereum signed message. The signing address will be 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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`data` | string | Hex string message to sign |
`address` | string | Address of the account to sign with |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
___
### signTransactionAsync
▸ **signTransactionAsync**(`txParams`: [PartialTxParams](#interface-partialtxparams)): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/private_key_wallet.ts:48](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/private_key_wallet.ts#L48)*
Sign a transaction with the private key. 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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`txParams` | [PartialTxParams](#interface-partialtxparams) | Parameters of the transaction to sign |
**Returns:** *`Promise<string>`*
Signed transaction hex string
___
### signTypedDataAsync
▸ **signTypedDataAsync**(`address`: string, `typedData`: `EIP712TypedData`): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/private_key_wallet.ts:99](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/private_key_wallet.ts#L99)*
Sign an EIP712 Typed Data message. The signing address will be 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_signTypedData`
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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`address` | string | Address of the account to sign with |
`typedData` | `EIP712TypedData` | - |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
<hr />
# Class: RedundantSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
It attempts to handle each JSON RPC request by sequentially attempting to receive a valid response from one of a
set of JSON RPC endpoints.
## Constructors
\+ **new RedundantSubprovider**(`subproviders`: [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md)[]): *[RedundantSubprovider](#class-redundantsubprovider)*
*Defined in [subproviders/src/subproviders/redundant_subprovider.ts:33](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/redundant_subprovider.ts#L33)*
Instantiates a new RedundantSubprovider
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`subproviders` | [Subprovider](#class-subprovider)[] | Subproviders to attempt the request with |
**Returns:** *[RedundantSubprovider](#class-redundantsubprovider)*
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: function): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/redundant_subprovider.ts:51](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/redundant_subprovider.ts#L51)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
▪ **payload**: *`JSONRPCRequestPayload`*
JSON RPC payload
▪ **next**: *[Callback](#callback)*
Callback to call if this subprovider decides not to handle the request
▪ **end**: *function*
Callback to call if subprovider handled the request and wants to pass back the request.
▸ (`err`: `Error` | null, `data?`: any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`err` | `Error` \| null |
`data?` | any |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: RPCSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
It forwards on JSON RPC requests to the supplied `rpcUrl` endpoint
## Constructors
\+ **new RPCSubprovider**(`rpcUrl`: string, `requestTimeoutMs`: number): *[RPCSubprovider](#class-rpcsubprovider)*
*Defined in [subproviders/src/subproviders/rpc_subprovider.ts:17](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/rpc_subprovider.ts#L17)*
**Parameters:**
Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`rpcUrl` | string | - | URL to the backing Ethereum node to which JSON RPC requests should be sent |
`requestTimeoutMs` | number | 20000 | Amount of miliseconds to wait before timing out the JSON RPC request |
**Returns:** *[RPCSubprovider](#class-rpcsubprovider)*
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `_next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/rpc_subprovider.ts:38](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/rpc_subprovider.ts#L38)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`_next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: SignerSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine)
subprovider interface. It forwards JSON RPC requests involving the domain of a signer (getAccounts,
sendTransaction, signMessage etc...) to the provider instance supplied at instantiation. All other requests
are passed onwards for subsequent subproviders to handle.
## Constructors
\+ **new SignerSubprovider**(`supportedProvider`: [SupportedProvider](#supportedprovider)): *[SignerSubprovider](#class-signersubprovider)*
*Defined in [subproviders/src/subproviders/signer.ts:15](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/signer.ts#L15)*
Instantiates a new SignerSubprovider.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`supportedProvider` | [SupportedProvider](#supportedprovider) | Web3 provider that should handle all user account related requests |
**Returns:** *[SignerSubprovider](#class-signersubprovider)*
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/signer.ts:33](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/signer.ts#L33)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: Subprovider
A altered version of the base class Subprovider found in [web3-provider-engine](https://github.com/MetaMask/provider-engine).
This one has an async/await `emitPayloadAsync` and also defined types.
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### `Abstract` handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Defined in [subproviders/src/subproviders/subprovider.ts:42](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L42)*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC request payload |
`next` | [Callback](#callback) | A callback to pass the request to the next subprovider in the stack |
`end` | [ErrorCallback](#errorcallback) | A callback called once the subprovider is done handling the request |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Class: TrezorSubprovider
## Constructors
\+ **new TrezorSubprovider**(`config`: [TrezorSubproviderConfig](#interface-trezorsubproviderconfig)): *[TrezorSubprovider](#class-trezorsubprovider)*
*Defined in [subproviders/src/subproviders/trezor.ts:32](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/trezor.ts#L32)*
Instantiates a TrezorSubprovider. Defaults to private key path set to `44'/60'/0'/0/`.
Must be initialized with trezor-connect API module https://github.com/trezor/connect.
**Parameters:**
Name | Type |
------ | ------ |
`config` | [TrezorSubproviderConfig](#interface-trezorsubproviderconfig) |
**Returns:** *[TrezorSubprovider](#class-trezorsubprovider)*
TrezorSubprovider instance
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### getAccountsAsync
▸ **getAccountsAsync**(`numberOfAccounts`: number): *`Promise<string[]>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/trezor.ts:56](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/trezor.ts#L56)*
Retrieve a users Trezor account. This method is automatically called
when issuing a `eth_accounts` JSON RPC request via your providerEngine
instance.
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`numberOfAccounts` | number | DEFAULT_NUM_ADDRESSES_TO_FETCH |
**Returns:** *`Promise<string[]>`*
An array of accounts
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/base_wallet_subprovider.ts:37](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts#L37)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
___
### signPersonalMessageAsync
▸ **signPersonalMessageAsync**(`data`: string, `address`: string): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/trezor.ts:129](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/trezor.ts#L129)*
Sign a personal Ethereum signed message. The signing account will be the account
associated with the provided address. If you've added the TrezorSubprovider 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.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`data` | string | Hex string message to sign |
`address` | string | Address of the account to sign with |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
___
### signTransactionAsync
▸ **signTransactionAsync**(`txData`: [PartialTxParams](#interface-partialtxparams)): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/trezor.ts:70](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/trezor.ts#L70)*
Signs a transaction on the Trezor with the account specificed by the `from` field in txParams.
If you've added the TrezorSubprovider 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.
**Parameters:**
Name | Type |
------ | ------ |
`txData` | [PartialTxParams](#interface-partialtxparams) |
**Returns:** *`Promise<string>`*
Signed transaction hex string
___
### signTypedDataAsync
▸ **signTypedDataAsync**(`address`: string, `typedData`: any): *`Promise<string>`*
*Overrides void*
*Defined in [subproviders/src/subproviders/trezor.ts:161](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/trezor.ts#L161)*
TODO:: eth_signTypedData is currently not supported on Trezor devices.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`address` | string | Address of the account to sign with |
`typedData` | any | - |
**Returns:** *`Promise<string>`*
Signature hex string (order: rsv)
<hr />
# Enumeration: NonceSubproviderErrors
## Enumeration members
### CannotDetermineAddressFromPayload
• **CannotDetermineAddressFromPayload**: = "CANNOT_DETERMINE_ADDRESS_FROM_PAYLOAD"
*Defined in [subproviders/src/types.ts:121](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L121)*
___
### EmptyParametersFound
• **EmptyParametersFound**: = "EMPTY_PARAMETERS_FOUND"
*Defined in [subproviders/src/types.ts:120](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L120)*
<hr />
## Type aliases
### EIP712ObjectValue
Ƭ **EIP712ObjectValue**: *string | number | [EIP712Object](#interface-eip712object)*
*Defined in [types/src/index.ts:719](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L719)*
___
# Interface: EIP1193Provider
## Properties
### isEIP1193
• **isEIP1193**: *boolean*
*Defined in [ethereum-types/src/index.ts:73](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L73)*
## Methods
### on
▸ **on**(`event`: [EIP1193Event](#eip1193event), `listener`: function): *this*
*Defined in [ethereum-types/src/index.ts:75](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L75)*
**Parameters:**
▪ **event**: *[EIP1193Event](#eip1193event)*
▪ **listener**: *function*
▸ (`result`: any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`result` | any |
**Returns:** *this*
___
### send
▸ **send**(`method`: string, `params?`: any[]): *`Promise<any>`*
*Defined in [ethereum-types/src/index.ts:74](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L74)*
**Parameters:**
Name | Type |
------ | ------ |
`method` | string |
`params?` | any[] |
**Returns:** *`Promise<any>`*
<hr />
# Interface: GanacheProvider
## Methods
### sendAsync
▸ **sendAsync**(`payload`: [JSONRPCRequestPayload](_ethereum_types_src_index_.jsonrpcrequestpayload.md), `callback`: [JSONRPCErrorCallback](#jsonrpcerrorcallback)): *void*
*Defined in [ethereum-types/src/index.ts:14](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L14)*
**Parameters:**
Name | Type |
------ | ------ |
`payload` | [JSONRPCRequestPayload](#class-jsonrpcrequestpayload) |
`callback` | [JSONRPCErrorCallback](#jsonrpcerrorcallback) |
**Returns:** *void*
<hr />
# Interface: JSONRPCRequestPayload
## Properties
### id
• **id**: *number*
*Defined in [ethereum-types/src/index.ts:324](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L324)*
___
### jsonrpc
• **jsonrpc**: *string*
*Defined in [ethereum-types/src/index.ts:325](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L325)*
___
### method
• **method**: *string*
*Defined in [ethereum-types/src/index.ts:323](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L323)*
___
### params
• **params**: *any[]*
*Defined in [ethereum-types/src/index.ts:322](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L322)*
<hr />
# Interface: JSONRPCResponseError
## Properties
### code
• **code**: *number*
*Defined in [ethereum-types/src/index.ts:330](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L330)*
___
### message
• **message**: *string*
*Defined in [ethereum-types/src/index.ts:329](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L329)*
<hr />
# Interface: JSONRPCResponsePayload
## Properties
### `Optional` error
• **error**? : *[JSONRPCResponseError](#class-jsonrpcresponseerror)*
*Defined in [ethereum-types/src/index.ts:337](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L337)*
___
### id
• **id**: *number*
*Defined in [ethereum-types/src/index.ts:335](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L335)*
___
### jsonrpc
• **jsonrpc**: *string*
*Defined in [ethereum-types/src/index.ts:336](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L336)*
___
### result
• **result**: *any*
*Defined in [ethereum-types/src/index.ts:334](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L334)*
<hr />
# Interface: Web3JsV1Provider
Web3.js version 1 provider interface
This provider interface was implemented in the pre-1.0Beta releases for Web3.js.
This interface allowed sending synchonous requests, support for which was later dropped.
## Methods
### send
▸ **send**(`payload`: [JSONRPCRequestPayload](_ethereum_types_src_index_.jsonrpcrequestpayload.md)): *[JSONRPCResponsePayload](#class-jsonrpcresponsepayload)*
*Defined in [ethereum-types/src/index.ts:45](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L45)*
**Parameters:**
Name | Type |
------ | ------ |
`payload` | [JSONRPCRequestPayload](#class-jsonrpcrequestpayload) |
**Returns:** *[JSONRPCResponsePayload](#class-jsonrpcresponsepayload)*
___
### sendAsync
▸ **sendAsync**(`payload`: [JSONRPCRequestPayload](_ethereum_types_src_index_.jsonrpcrequestpayload.md), `callback`: [JSONRPCErrorCallback](#jsonrpcerrorcallback)): *void*
*Defined in [ethereum-types/src/index.ts:44](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L44)*
**Parameters:**
Name | Type |
------ | ------ |
`payload` | [JSONRPCRequestPayload](#class-jsonrpcrequestpayload) |
`callback` | [JSONRPCErrorCallback](#jsonrpcerrorcallback) |
**Returns:** *void*
<hr />
# Interface: Web3JsV2Provider
Web3.js version 2 provider interface
This provider interface was used in a couple of Web3.js 1.0 beta releases
before the first attempts to conform to EIP1193
## Methods
### send
▸ **send**(`payload`: [JSONRPCRequestPayload](_ethereum_types_src_index_.jsonrpcrequestpayload.md), `callback`: [JSONRPCErrorCallback](#jsonrpcerrorcallback)): *void*
*Defined in [ethereum-types/src/index.ts:54](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L54)*
**Parameters:**
Name | Type |
------ | ------ |
`payload` | [JSONRPCRequestPayload](#class-jsonrpcrequestpayload) |
`callback` | [JSONRPCErrorCallback](#jsonrpcerrorcallback) |
**Returns:** *void*
<hr />
# Interface: Web3JsV3Provider
Web3.js version 3 provider interface
This provider interface was implemented with the hopes for conforming to the EIP1193 spec,
however it does not conform entirely.
## Methods
### send
▸ **send**(`method`: string, `params?`: any[]): *`Promise<any>`*
*Defined in [ethereum-types/src/index.ts:63](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L63)*
**Parameters:**
Name | Type |
------ | ------ |
`method` | string |
`params?` | any[] |
**Returns:** *`Promise<any>`*
<hr />
# Interface: ZeroExProvider
The interface for the provider used internally by 0x libraries
Any property we use from any SupportedProvider should we explicitly
add here
## Properties
### `Optional` isMetaMask
• **isMetaMask**? : *undefined | false | true*
*Defined in [ethereum-types/src/index.ts:31](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L31)*
___
### `Optional` isParity
• **isParity**? : *undefined | false | true*
*Defined in [ethereum-types/src/index.ts:32](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L32)*
___
### `Optional` isZeroExProvider
• **isZeroExProvider**? : *undefined | false | true*
*Defined in [ethereum-types/src/index.ts:30](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L30)*
## Methods
### `Optional` enable
▸ **enable**(): *`Promise<void>`*
*Defined in [ethereum-types/src/index.ts:34](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L34)*
**Returns:** *`Promise<void>`*
___
### sendAsync
▸ **sendAsync**(`payload`: [JSONRPCRequestPayload](_ethereum_types_src_index_.jsonrpcrequestpayload.md), `callback`: [JSONRPCErrorCallback](#jsonrpcerrorcallback)): *void*
*Defined in [ethereum-types/src/index.ts:35](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L35)*
**Parameters:**
Name | Type |
------ | ------ |
`payload` | [JSONRPCRequestPayload](#class-jsonrpcrequestpayload) |
`callback` | [JSONRPCErrorCallback](#jsonrpcerrorcallback) |
**Returns:** *void*
___
### `Optional` stop
▸ **stop**(): *void*
*Defined in [ethereum-types/src/index.ts:33](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L33)*
**Returns:** *void*
<hr />
# Interface: AccountFetchingConfigs
addressSearchLimit: The maximum number of addresses to search through, defaults to 1000
numAddressesToReturn: Number of addresses to return from 'eth_accounts' call
shouldAskForOnDeviceConfirmation: Whether you wish to prompt the user on their Ledger
before fetching their addresses
## Properties
### `Optional` addressSearchLimit
• **addressSearchLimit**? : *undefined | number*
*Defined in [subproviders/src/types.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L55)*
___
### `Optional` numAddressesToReturn
• **numAddressesToReturn**? : *undefined | number*
*Defined in [subproviders/src/types.ts:56](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L56)*
___
### `Optional` shouldAskForOnDeviceConfirmation
• **shouldAskForOnDeviceConfirmation**? : *undefined | false | true*
*Defined in [subproviders/src/types.ts:57](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L57)*
<hr />
# Interface: ECSignatureString
## Properties
### r
• **r**: *string*
*Defined in [subproviders/src/types.ts:29](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L29)*
___
### s
• **s**: *string*
*Defined in [subproviders/src/types.ts:30](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L30)*
___
### v
• **v**: *string*
*Defined in [subproviders/src/types.ts:28](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L28)*
<hr />
# Interface: JSONRPCRequestPayloadWithMethod
## Properties
### id
• **id**: *number*
Defined in ethereum-types/lib/index.d.ts:262
___
### jsonrpc
• **jsonrpc**: *string*
Defined in ethereum-types/lib/index.d.ts:263
___
### method
• **method**: *string*
*Overrides void*
*Defined in [subproviders/src/types.ts:136](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L136)*
___
### params
• **params**: *any[]*
Defined in ethereum-types/lib/index.d.ts:260
<hr />
# Interface: LedgerEthereumClient
Elliptic Curve signature
The LedgerEthereumClient sends Ethereum-specific requests to the Ledger Nano S
It uses an internal LedgerCommunicationClient to relay these requests. Currently
NodeJs and Browser communication are supported.
## Properties
### getAddress
• **getAddress**: *function*
*Defined in [subproviders/src/types.ts:17](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L17)*
#### Type declaration:
▸ (`derivationPath`: string, `askForDeviceConfirmation`: boolean, `shouldGetChainCode`: true): *`Promise<LedgerGetAddressResult>`*
**Parameters:**
Name | Type |
------ | ------ |
`derivationPath` | string |
`askForDeviceConfirmation` | boolean |
`shouldGetChainCode` | true |
___
### signPersonalMessage
• **signPersonalMessage**: *function*
*Defined in [subproviders/src/types.ts:23](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L23)*
#### Type declaration:
▸ (`derivationPath`: string, `messageHex`: string): *`Promise<ECSignature>`*
**Parameters:**
Name | Type |
------ | ------ |
`derivationPath` | string |
`messageHex` | string |
___
### signTransaction
• **signTransaction**: *function*
*Defined in [subproviders/src/types.ts:22](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L22)*
#### Type declaration:
▸ (`derivationPath`: string, `rawTxHex`: string): *`Promise<ECSignatureString>`*
**Parameters:**
Name | Type |
------ | ------ |
`derivationPath` | string |
`rawTxHex` | string |
___
### transport
• **transport**: *[LedgerCommunicationClient](#class-ledgercommunicationclient)*
*Defined in [subproviders/src/types.ts:24](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L24)*
<hr />
# Interface: LedgerGetAddressResult
## Properties
### address
• **address**: *string*
*Defined in [subproviders/src/types.ts:79](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L79)*
___
### chainCode
• **chainCode**: *string*
*Defined in [subproviders/src/types.ts:81](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L81)*
___
### publicKey
• **publicKey**: *string*
*Defined in [subproviders/src/types.ts:80](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L80)*
<hr />
# Interface: LedgerSubproviderConfigs
networkId: The ethereum networkId to set as the chainId from EIP155
ledgerConnectionType: Environment in which you wish to connect to Ledger (nodejs or browser)
derivationPath: Initial derivation path to use e.g 44'/60'/0'
accountFetchingConfigs: configs related to fetching accounts from a Ledger
## Properties
### `Optional` accountFetchingConfigs
• **accountFetchingConfigs**? : *[AccountFetchingConfigs](#class-accountfetchingconfigs)*
*Defined in [subproviders/src/types.ts:45](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L45)*
___
### `Optional` baseDerivationPath
• **baseDerivationPath**? : *undefined | string*
*Defined in [subproviders/src/types.ts:44](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L44)*
___
### ledgerEthereumClientFactoryAsync
• **ledgerEthereumClientFactoryAsync**: *[LedgerEthereumClientFactoryAsync](#ledgerethereumclientfactoryasync)*
*Defined in [subproviders/src/types.ts:43](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L43)*
___
### networkId
• **networkId**: *number*
*Defined in [subproviders/src/types.ts:42](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L42)*
<hr />
# Interface: MnemonicWalletSubproviderConfigs
mnemonic: The string mnemonic seed
addressSearchLimit: The maximum number of addresses to search through, defaults to 1000
baseDerivationPath: The base derivation path (e.g 44'/60'/0'/0)
## Properties
### `Optional` addressSearchLimit
• **addressSearchLimit**? : *undefined | number*
*Defined in [subproviders/src/types.ts:67](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L67)*
___
### `Optional` baseDerivationPath
• **baseDerivationPath**? : *undefined | string*
*Defined in [subproviders/src/types.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L68)*
___
### mnemonic
• **mnemonic**: *string*
*Defined in [subproviders/src/types.ts:66](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L66)*
<hr />
# Interface: PartialTxParams
## Properties
### chainId
• **chainId**: *number*
*Defined in [subproviders/src/types.ts:92](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L92)*
___
### `Optional` data
• **data**? : *undefined | string*
*Defined in [subproviders/src/types.ts:91](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L91)*
___
### from
• **from**: *string*
*Defined in [subproviders/src/types.ts:89](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L89)*
___
### gas
• **gas**: *string*
*Defined in [subproviders/src/types.ts:87](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L87)*
___
### `Optional` gasPrice
• **gasPrice**? : *undefined | string*
*Defined in [subproviders/src/types.ts:86](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L86)*
___
### nonce
• **nonce**: *string*
*Defined in [subproviders/src/types.ts:85](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L85)*
___
### to
• **to**: *string*
*Defined in [subproviders/src/types.ts:88](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L88)*
___
### `Optional` value
• **value**? : *undefined | string*
*Defined in [subproviders/src/types.ts:90](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L90)*
<hr />
# Class: EmptyWalletSubprovider
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
It intercepts the `eth_accounts` JSON RPC requests and never returns any addresses when queried.
## Methods
### emitPayloadAsync
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
*Inherited from [Subprovider](#interface-subprovider).[emitPayloadAsync](#emitpayloadasync)*
*Defined in [subproviders/src/subproviders/subprovider.ts:55](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L55)*
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
this subprovider is a part of. The payload will cascade down the subprovider middleware
stack until finding the responsible entity for handling the request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
**Returns:** *`Promise<JSONRPCResponsePayload>`*
JSON RPC response payload
___
### handleRequest
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [Callback](#callback), `end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
*Overrides [Subprovider](_subproviders_src_subproviders_subprovider_.subprovider.md).[handleRequest](#abstract-handlerequest)*
*Defined in [subproviders/src/subproviders/empty_wallet_subprovider.ts:21](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts#L21)*
This method conforms to the web3-provider-engine interface.
It is called internally by the ProviderEngine when it is this subproviders
turn to handle a JSON RPC request.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
`next` | [Callback](#callback) | Callback to call if this subprovider decides not to handle the request |
`end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
**Returns:** *`Promise<void>`*
___
### setEngine
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
*Inherited from [Subprovider](#interface-subprovider).[setEngine](#setengine)*
*Defined in [subproviders/src/subproviders/subprovider.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/subproviders/subprovider.ts#L68)*
Set's the subprovider's engine to the ProviderEngine it is added to.
This is only called within the ProviderEngine source code, do not call
directly.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
**Returns:** *void*
<hr />
# Interface: TrezorSubproviderConfig
## Properties
### accountFetchingConfigs
• **accountFetchingConfigs**: *[AccountFetchingConfigs](#class-accountfetchingconfigs)*
*Defined in [subproviders/src/types.ts:140](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L140)*
___
### networkId
• **networkId**: *number*
*Defined in [subproviders/src/types.ts:142](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L142)*
___
### trezorConnectClientApi
• **trezorConnectClientApi**: *any*
*Defined in [subproviders/src/types.ts:141](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L141)*
<hr />
# Interface: ECSignature
Elliptic Curve signature
## Properties
### r
• **r**: *string*
*Defined in [types/src/index.ts:68](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L68)*
___
### s
• **s**: *string*
*Defined in [types/src/index.ts:69](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L69)*
___
### v
• **v**: *number*
*Defined in [types/src/index.ts:67](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L67)*
<hr />
# Interface: EIP712Object
## Hierarchy
* **EIP712Parameter**
## Properties
### name
• **name**: *string*
*Defined in [types/src/index.ts:711](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L711)*
___
### type
• **type**: *string*
*Defined in [types/src/index.ts:712](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L712)*
<hr />
# Interface: EIP712TypedData
## Properties
### domain
• **domain**: *[EIP712Object](#class-eip712object)*
*Defined in [types/src/index.ts:727](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L727)*
___
### message
• **message**: *[EIP712Object](#class-eip712object)*
*Defined in [types/src/index.ts:728](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L728)*
___
### primaryType
• **primaryType**: *string*
*Defined in [types/src/index.ts:729](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L729)*
___
### types
• **types**: *[EIP712Types](#class-eip712types)*
*Defined in [types/src/index.ts:726](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L726)*
<hr />
# Interface: EIP712Types
## Hierarchy
* **ElementType**
## Properties
### name
• **name**: *string*
*Defined in [types/src/index.ts:665](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L665)*
___
### typeDocType
• **typeDocType**: *[TypeDocTypes](#enumeration-typedoctypes)*
*Defined in [types/src/index.ts:666](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/types/src/index.ts#L666)*
<hr />
## Functions
### prependSubprovider
▸ **prependSubprovider**(`provider`: `Web3ProviderEngine`, `subprovider`: [Subprovider](#class-subprovider)): *void*
*Defined in [subproviders/src/utils/subprovider_utils.ts:10](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/utils/subprovider_utils.ts#L10)*
Prepends a subprovider to a provider
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`provider` | `Web3ProviderEngine` | Given provider |
`subprovider` | [Subprovider](#class-subprovider) | Subprovider to prepend |
**Returns:** *void*
<hr />
## Type aliases
### EIP1193Event
Ƭ **EIP1193Event**: *"accountsChanged" | "networkChanged" | "close" | "connect" | "notification"*
*Defined in [ethereum-types/src/index.ts:70](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L70)*
Interface for providers that conform to EIP 1193
Source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md
___
### JSONRPCErrorCallback
Ƭ **JSONRPCErrorCallback**: *function*
*Defined in [ethereum-types/src/index.ts:3](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L3)*
#### Type declaration:
▸ (`err`: `Error` | null, `result?`: [JSONRPCResponsePayload](#interface-jsonrpcresponsepayload)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`err` | `Error` \| null |
`result?` | [JSONRPCResponsePayload](#interface-jsonrpcresponsepayload) |
___
### SupportedProvider
Ƭ **SupportedProvider**: *[Web3JsProvider](_ethereum_types_src_index_.md#web3jsprovider) | [GanacheProvider](#interface-ganacheprovider) | [EIP1193Provider](#interface-eip1193provider) | [ZeroExProvider](#interface-zeroexprovider)*
*Defined in [ethereum-types/src/index.ts:9](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L9)*
Do not create your own provider. Use an existing provider from a Web3 or ProviderEngine library
Read more about Providers in the guides section of the 0x docs.
___
### Web3JsProvider
Ƭ **Web3JsProvider**: *[Web3JsV1Provider](#interface-web3jsv1provider) | [Web3JsV2Provider](#interface-web3jsv2provider) | [Web3JsV3Provider](#interface-web3jsv3provider)*
*Defined in [ethereum-types/src/index.ts:11](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/ethereum-types/src/index.ts#L11)*
<hr />
## Functions
### ledgerEthereumBrowserClientFactoryAsync
▸ **ledgerEthereumBrowserClientFactoryAsync**(): *`Promise<LedgerEthereumClient>`*
*Defined in [subproviders/src/index.ts:11](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/index.ts#L11)*
A factory method for creating a LedgerEthereumClient usable in a browser context.
**Returns:** *`Promise<LedgerEthereumClient>`*
LedgerEthereumClient A browser client for the LedgerSubprovider
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
<hr />
## Type aliases
### Callback
Ƭ **Callback**: *function*
*Defined in [subproviders/src/types.ts:131](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L131)*
#### Type declaration:
▸ (): *void*
___
### ErrorCallback
Ƭ **ErrorCallback**: *function*
*Defined in [subproviders/src/types.ts:130](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L130)*
#### Type declaration:
▸ (`err`: `Error` | null, `data?`: any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`err` | `Error` \| null |
`data?` | any |
___
### LedgerEthereumClientFactoryAsync
Ƭ **LedgerEthereumClientFactoryAsync**: *function*
*Defined in [subproviders/src/types.ts:33](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L33)*
#### Type declaration:
▸ (): *`Promise<LedgerEthereumClient>`*
___
### NextCallback
Ƭ **NextCallback**: *function*
*Defined in [subproviders/src/types.ts:133](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L133)*
#### Type declaration:
▸ (`callback?`: [OnNextCompleted](#onnextcompleted)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`callback?` | [OnNextCompleted](#onnextcompleted) |
___
### OnNextCompleted
Ƭ **OnNextCompleted**: *function*
*Defined in [subproviders/src/types.ts:132](https://github.com/0xProject/0x-monorepo/blob/23602ec6b/packages/subproviders/src/types.ts#L132)*
#### Type declaration:
▸ (`err`: `Error` | null, `result`: any, `cb`: [Callback](#callback)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`err` | `Error` \| null |
`result` | any |
`cb` | [Callback](#callback) |
<hr />