Update the MDX files for each tool
This commit is contained in:
@@ -1,83 +0,0 @@
|
||||
## @0x/asset-buyer
|
||||
|
||||
Convenience package for buying assets represented on the Ethereum blockchain using 0x. In its simplest form, the package helps in the usage of the [0x forwarder contract](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md), which allows users to execute [Wrapped Ether](https://weth.io/) based 0x orders without having to set allowances, wrap Ether or own ZRX, meaning they can buy tokens with Ether alone. Given some liquidity (0x signed orders), it helps estimate the Ether cost of buying a certain asset (giving a range) and then buying that asset.
|
||||
|
||||
In its more advanced and useful form, it integrates with the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api) and takes care of sourcing liquidity for you given an SRA compliant endpoint. The final result is a library that tells you what assets are available, provides an Ether based quote for any asset desired, and allows you to buy that asset using Ether alone.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/asset-buyer
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { AssetBuyer } from '@0x/asset-buyer';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var AssetBuyer = require('@0x/asset-buyer').AssetBuyer;
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/asset-buyer yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/asset-buyer yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,84 +0,0 @@
|
||||
## @0x/asset-swapper
|
||||
|
||||
Convenience package for swapping assets represented on the Ethereum blockchain using 0x. The package helps to perform all the off-chain computations to execute a marketBuy or marketSell function execution with 0x exchange contracts, or 0x extension contracts. Given some liquidity (0x signed orders), it helps estimate the cost of buying or selling a certain asset (giving a range) and then provide varying consumable outputs to execute the buy or sell.
|
||||
|
||||
Asset-swapper integrates with the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)(in the future Mesh as well) and takes care of sourcing liquidity, order-pruning, and order-validation. The final result is a library that tells you what assets are available, provides a quote based on specified assets, and provide varying consumable metadata that can be used both on-chain in smart contracts or off-chain through web3 to swap a desired amount of ERC20 for another ERC20 asset.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/asset-swapper
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { SwapQuoter } from '@0x/asset-swapper';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var SwapQuoter = require('@0x/asset-swapper').SwapQuoter;
|
||||
var SwapQuoteConsumer = require('@0x/asset-swapper').SwapQuoteConsumer;
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/asset-swapper yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/asset-swapper yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,74 +0,0 @@
|
||||
## @0x/connect
|
||||
|
||||
This repository contains a Javascript library that makes it easy to interact with Relayers that conform to the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/connect
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
- [Docs](https://0xproject.com/docs/connect)
|
||||
- [Tutorials](https://0xproject.com/wiki#connect)
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/connect yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/connect yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
@@ -1,647 +0,0 @@
|
||||
> # Class: HttpClient
|
||||
|
||||
This class includes all the functionality related to interacting with a set of HTTP endpoints
|
||||
that implement the standard relayer API v2
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **HttpClient**
|
||||
|
||||
## Implements
|
||||
|
||||
* [Client](#interface-client)
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [getAssetPairsAsync](#getassetpairsasync)
|
||||
* [getFeeRecipientsAsync](#getfeerecipientsasync)
|
||||
* [getOrderAsync](#getorderasync)
|
||||
* [getOrderConfigAsync](#getorderconfigasync)
|
||||
* [getOrderbookAsync](#getorderbookasync)
|
||||
* [getOrdersAsync](#getordersasync)
|
||||
* [submitOrderAsync](#submitorderasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new HttpClient**(`url`: string): *[HttpClient](#class-httpclient)*
|
||||
|
||||
*Defined in [http_client.ts:44](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L44)*
|
||||
|
||||
Instantiates a new HttpClient instance
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`url` | string | The relayer API base HTTP url you would like to interact with |
|
||||
|
||||
**Returns:** *[HttpClient](#class-httpclient)*
|
||||
|
||||
An instance of HttpClient
|
||||
|
||||
## Methods
|
||||
|
||||
### getAssetPairsAsync
|
||||
|
||||
▸ **getAssetPairsAsync**(`requestOpts?`: `RequestOpts` & `AssetPairsRequestOpts` & `PagedRequestOpts`): *`Promise<AssetPairsResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:59](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L59)*
|
||||
|
||||
Retrieve assetData pair info from the API
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`requestOpts?` | `RequestOpts` & `AssetPairsRequestOpts` & `PagedRequestOpts` | Options specifying assetData information to retrieve, page information, and network id. |
|
||||
|
||||
**Returns:** *`Promise<AssetPairsResponse>`*
|
||||
|
||||
The resulting AssetPairsResponse that match the request
|
||||
|
||||
___
|
||||
|
||||
### getFeeRecipientsAsync
|
||||
|
||||
▸ **getFeeRecipientsAsync**(`requestOpts?`: `RequestOpts` & `PagedRequestOpts`): *`Promise<FeeRecipientsResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:160](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L160)*
|
||||
|
||||
Retrieve the list of fee recipient addresses used by the relayer.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`requestOpts?` | `RequestOpts` & `PagedRequestOpts` | Options specifying page information, and network id. |
|
||||
|
||||
**Returns:** *`Promise<FeeRecipientsResponse>`*
|
||||
|
||||
The resulting FeeRecipientsResponse
|
||||
|
||||
___
|
||||
|
||||
### getOrderAsync
|
||||
|
||||
▸ **getOrderAsync**(`orderHash`: string, `requestOpts?`: `RequestOpts`): *`Promise<APIOrder>`*
|
||||
|
||||
*Defined in [http_client.ts:99](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L99)*
|
||||
|
||||
Retrieve a specific order from the API
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`orderHash` | string | An orderHash generated from the desired order |
|
||||
`requestOpts?` | `RequestOpts` | - |
|
||||
|
||||
**Returns:** *`Promise<APIOrder>`*
|
||||
|
||||
The APIOrder that matches the supplied orderHash
|
||||
|
||||
___
|
||||
|
||||
### getOrderConfigAsync
|
||||
|
||||
▸ **getOrderConfigAsync**(`request`: `OrderConfigRequest`, `requestOpts?`: `RequestOpts`): *`Promise<OrderConfigResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:139](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L139)*
|
||||
|
||||
Retrieve fee information from the API
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`request` | `OrderConfigRequest` | A OrderConfigRequest instance describing the specific fees to retrieve |
|
||||
`requestOpts?` | `RequestOpts` | Options specifying network id. |
|
||||
|
||||
**Returns:** *`Promise<OrderConfigResponse>`*
|
||||
|
||||
The resulting OrderConfigResponse that matches the request
|
||||
|
||||
___
|
||||
|
||||
### getOrderbookAsync
|
||||
|
||||
▸ **getOrderbookAsync**(`request`: `OrderbookRequest`, `requestOpts?`: `RequestOpts` & `PagedRequestOpts`): *`Promise<OrderbookResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:117](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L117)*
|
||||
|
||||
Retrieve an orderbook from the API
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`request` | `OrderbookRequest` | An OrderbookRequest instance describing the specific orderbook to retrieve |
|
||||
`requestOpts?` | `RequestOpts` & `PagedRequestOpts` | Options specifying page information, and network id. |
|
||||
|
||||
**Returns:** *`Promise<OrderbookResponse>`*
|
||||
|
||||
The resulting OrderbookResponse that matches the request
|
||||
|
||||
___
|
||||
|
||||
### getOrdersAsync
|
||||
|
||||
▸ **getOrdersAsync**(`requestOpts?`: `RequestOpts` & `OrdersRequestOpts` & `PagedRequestOpts`): *`Promise<OrdersResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:79](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L79)*
|
||||
|
||||
Retrieve orders from the API
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`requestOpts?` | `RequestOpts` & `OrdersRequestOpts` & `PagedRequestOpts` | Options specifying orders to retrieve and page information, page information, and network id. |
|
||||
|
||||
**Returns:** *`Promise<OrdersResponse>`*
|
||||
|
||||
The resulting OrdersResponse that match the request
|
||||
|
||||
___
|
||||
|
||||
### submitOrderAsync
|
||||
|
||||
▸ **submitOrderAsync**(`signedOrder`: `SignedOrder`, `requestOpts?`: `RequestOpts`): *`Promise<void>`*
|
||||
|
||||
*Defined in [http_client.ts:177](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L177)*
|
||||
|
||||
Submit a signed order to the API
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`signedOrder` | `SignedOrder` | A SignedOrder instance to submit |
|
||||
`requestOpts?` | `RequestOpts` | Options specifying network id. |
|
||||
|
||||
**Returns:** *`Promise<void>`*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Class: WebSocketOrdersChannel
|
||||
|
||||
This class includes all the functionality related to interacting with a websocket endpoint
|
||||
that implements the standard relayer API v0
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **WebSocketOrdersChannel**
|
||||
|
||||
## Implements
|
||||
|
||||
* [OrdersChannel](#interface-orderschannel)
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [close](#close)
|
||||
* [subscribe](#subscribe)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new WebSocketOrdersChannel**(`client`: `w3cwebsocket`, `handler`: [OrdersChannelHandler](#class-websocketorderschannel)*
|
||||
|
||||
*Defined in [ws_orders_channel.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/ws_orders_channel.ts#L21)*
|
||||
|
||||
Instantiates a new WebSocketOrdersChannel instance
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`client` | `w3cwebsocket` | A WebSocket client |
|
||||
`handler` | [OrdersChannelHandler](#interface-orderschannelhandler) | An OrdersChannelHandler instance that responds to various channel updates |
|
||||
|
||||
**Returns:** *[WebSocketOrdersChannel](#class-websocketorderschannel)*
|
||||
|
||||
An instance of WebSocketOrdersChannel
|
||||
|
||||
## Methods
|
||||
|
||||
### close
|
||||
|
||||
▸ **close**(): *void*
|
||||
|
||||
*Defined in [ws_orders_channel.ts:66](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/ws_orders_channel.ts#L66)*
|
||||
|
||||
Close the websocket and stop receiving updates
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### subscribe
|
||||
|
||||
▸ **subscribe**(`subscriptionOpts`: `OrdersChannelSubscriptionOpts`): *void*
|
||||
|
||||
*Defined in [ws_orders_channel.ts:50](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/ws_orders_channel.ts#L50)*
|
||||
|
||||
Subscribe to orderbook snapshots and updates from the websocket
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`subscriptionOpts` | `OrdersChannelSubscriptionOpts` | An OrdersChannelSubscriptionOpts instance describing which assetData pair to subscribe to |
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Enumeration: HttpRequestType
|
||||
|
||||
## Index
|
||||
|
||||
### Enumeration members
|
||||
|
||||
* [Get](#get)
|
||||
* [Post](#post)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### Get
|
||||
|
||||
• **Get**: = "GET"
|
||||
|
||||
*Defined in [types.ts:46](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L46)*
|
||||
|
||||
___
|
||||
|
||||
### Post
|
||||
|
||||
• **Post**: = "POST"
|
||||
|
||||
*Defined in [types.ts:47](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L47)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: Client
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **Client**
|
||||
|
||||
## Implemented by
|
||||
|
||||
* [HttpClient](#class-httpclient)
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [getAssetPairsAsync](#getassetpairsasync)
|
||||
* [getFeeRecipientsAsync](#getfeerecipientsasync)
|
||||
* [getOrderAsync](#getorderasync)
|
||||
* [getOrderConfigAsync](#getorderconfigasync)
|
||||
* [getOrderbookAsync](#getorderbookasync)
|
||||
* [getOrdersAsync](#getordersasync)
|
||||
* [submitOrderAsync](#submitorderasync)
|
||||
|
||||
## Properties
|
||||
|
||||
### getAssetPairsAsync
|
||||
|
||||
• **getAssetPairsAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:18](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L18)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`requestOpts?`: `AssetPairsRequestOpts` & `PagedRequestOpts`): *`Promise<PaginatedCollection<AssetPairsItem>>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`requestOpts?` | `AssetPairsRequestOpts` & `PagedRequestOpts` |
|
||||
|
||||
___
|
||||
|
||||
### getFeeRecipientsAsync
|
||||
|
||||
• **getFeeRecipientsAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:25](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L25)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`requestOpts?`: `PagedRequestOpts`): *`Promise<FeeRecipientsResponse>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`requestOpts?` | `PagedRequestOpts` |
|
||||
|
||||
___
|
||||
|
||||
### getOrderAsync
|
||||
|
||||
• **getOrderAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:22](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L22)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`orderHash`: string): *`Promise<APIOrder>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`orderHash` | string |
|
||||
|
||||
___
|
||||
|
||||
### getOrderConfigAsync
|
||||
|
||||
• **getOrderConfigAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:24](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L24)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`request`: `OrderConfigRequest`): *`Promise<OrderConfigResponse>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`request` | `OrderConfigRequest` |
|
||||
|
||||
___
|
||||
|
||||
### getOrderbookAsync
|
||||
|
||||
• **getOrderbookAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:23](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L23)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`request`: `OrderbookRequest`, `requestOpts?`: `PagedRequestOpts`): *`Promise<OrderbookResponse>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`request` | `OrderbookRequest` |
|
||||
`requestOpts?` | `PagedRequestOpts` |
|
||||
|
||||
___
|
||||
|
||||
### getOrdersAsync
|
||||
|
||||
• **getOrdersAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L21)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`requestOpts?`: `OrdersRequestOpts` & `PagedRequestOpts`): *`Promise<PaginatedCollection<APIOrder>>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`requestOpts?` | `OrdersRequestOpts` & `PagedRequestOpts` |
|
||||
|
||||
___
|
||||
|
||||
### submitOrderAsync
|
||||
|
||||
• **submitOrderAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:26](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L26)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`signedOrder`: `SignedOrder`): *`Promise<void>`*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`signedOrder` | `SignedOrder` |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: HttpRequestOptions
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **HttpRequestOptions**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [params](#optional-params)
|
||||
* [payload](#optional-payload)
|
||||
|
||||
## Properties
|
||||
|
||||
### `Optional` params
|
||||
|
||||
• **params**? : *undefined | object*
|
||||
|
||||
*Defined in [types.ts:41](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
### `Optional` payload
|
||||
|
||||
• **payload**? : *undefined | object*
|
||||
|
||||
*Defined in [types.ts:42](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L42)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: OrdersChannel
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **OrdersChannel**
|
||||
|
||||
## Implemented by
|
||||
|
||||
* [WebSocketOrdersChannel](#class-websocketorderschannel)
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [close](#close)
|
||||
* [subscribe](#subscribe)
|
||||
|
||||
## Properties
|
||||
|
||||
### close
|
||||
|
||||
• **close**: *function*
|
||||
|
||||
*Defined in [types.ts:31](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L31)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (): *void*
|
||||
|
||||
___
|
||||
|
||||
### subscribe
|
||||
|
||||
• **subscribe**: *function*
|
||||
|
||||
*Defined in [types.ts:30](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L30)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`subscriptionOpts`: `OrdersChannelSubscriptionOpts`): *void*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`subscriptionOpts` | `OrdersChannelSubscriptionOpts` |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: OrdersChannelHandler
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **OrdersChannelHandler**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [onClose](#onclose)
|
||||
* [onError](#onerror)
|
||||
* [onUpdate](#onupdate)
|
||||
|
||||
## Properties
|
||||
|
||||
### onClose
|
||||
|
||||
• **onClose**: *function*
|
||||
|
||||
*Defined in [types.ts:37](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L37)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`channel`: [OrdersChannel](#interface-orderschannel)): *void*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`channel` | [OrdersChannel](#interface-orderschannel) |
|
||||
|
||||
___
|
||||
|
||||
### onError
|
||||
|
||||
• **onError**: *function*
|
||||
|
||||
*Defined in [types.ts:36](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L36)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`channel`: [OrdersChannel](#interface-orderschannel), `err`: `Error`, `subscriptionOpts?`: `OrdersChannelSubscriptionOpts`): *void*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`channel` | [OrdersChannel](#interface-orderschannel) |
|
||||
`err` | `Error` |
|
||||
`subscriptionOpts?` | `OrdersChannelSubscriptionOpts` |
|
||||
|
||||
___
|
||||
|
||||
### onUpdate
|
||||
|
||||
• **onUpdate**: *function*
|
||||
|
||||
*Defined in [types.ts:35](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L35)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
▸ (`channel`: [OrdersChannel](#interface-orderschannel), `subscriptionOpts`: `OrdersChannelSubscriptionOpts`, `orders`: `APIOrder`[]): *void*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`channel` | [OrdersChannel](#interface-orderschannel) |
|
||||
`subscriptionOpts` | `OrdersChannelSubscriptionOpts` |
|
||||
`orders` | `APIOrder`[] |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: OrdersChannelSubscriptionOptsMap
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **OrdersChannelSubscriptionOptsMap**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **key**: *string*\]: `OrdersChannelSubscriptionOpts`
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [http_client](modules/_http_client_.md)
|
||||
* [http_client.HttpClient](#class-httpclient)
|
||||
* [index](modules/_index_.md)
|
||||
* [orders_channel_factory](modules/_orders_channel_factory_.md)
|
||||
* [types](modules/_types_.md)
|
||||
* [types.HttpRequestType](#class-httprequesttype)
|
||||
* [types.Client](#class-client)
|
||||
* [types.HttpRequestOptions](#class-httprequestoptions)
|
||||
* [types.OrdersChannel](#class-orderschannel)
|
||||
* [types.OrdersChannelHandler](#class-orderschannelhandler)
|
||||
* [utils/assert](modules/_utils_assert_.md)
|
||||
* [utils/orders_channel_message_parser](modules/_utils_orders_channel_message_parser_.md)
|
||||
* [utils/relayer_response_json_parsers](modules/_utils_relayer_response_json_parsers_.md)
|
||||
* [utils/type_converters](modules/_utils_type_converters_.md)
|
||||
* [ws_orders_channel](modules/_ws_orders_channel_.md)
|
||||
* [ws_orders_channel.WebSocketOrdersChannel](#class-websocketorderschannel)
|
||||
* [ws_orders_channel.OrdersChannelSubscriptionOptsMap](#class-orderschannelsubscriptionoptsmap)
|
||||
* [Classes]()
|
||||
* [http_client.HttpClient](#class-httpclient)
|
||||
* [ws_orders_channel.WebSocketOrdersChannel](#class-websocketorderschannel)
|
||||
* [Enums]()
|
||||
* [types.HttpRequestType](#class-httprequesttype)
|
||||
* [Interfaces]()
|
||||
* [types.Client](#class-client)
|
||||
* [types.HttpRequestOptions](#class-httprequestoptions)
|
||||
* [types.OrdersChannel](#class-orderschannel)
|
||||
* [types.OrdersChannelHandler](#class-orderschannelhandler)
|
||||
* [ws_orders_channel.OrdersChannelSubscriptionOptsMap](#class-orderschannelsubscriptionoptsmap)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,39 +1,24 @@
|
||||
> # Class: HttpClient
|
||||
# Class: HttpClient
|
||||
|
||||
This class includes all the functionality related to interacting with a set of HTTP endpoints
|
||||
that implement the standard relayer API v2
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **HttpClient**
|
||||
|
||||
## Implements
|
||||
### Implements
|
||||
|
||||
* [Client](#interface-client)
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [getAssetPairsAsync](#getassetpairsasync)
|
||||
* [getFeeRecipientsAsync](#getfeerecipientsasync)
|
||||
* [getOrderAsync](#getorderasync)
|
||||
* [getOrderConfigAsync](#getorderconfigasync)
|
||||
* [getOrderbookAsync](#getorderbookasync)
|
||||
* [getOrdersAsync](#getordersasync)
|
||||
* [submitOrderAsync](#submitorderasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
## constructer
|
||||
|
||||
\+ **new HttpClient**(`url`: string): *[HttpClient](#class-httpclient)*
|
||||
|
||||
*Defined in [http_client.ts:44](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L44)*
|
||||
*Defined in [http_client.ts:44](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L44)*
|
||||
|
||||
Instantiates a new HttpClient instance
|
||||
|
||||
@@ -47,13 +32,13 @@ Name | Type | Description |
|
||||
|
||||
An instance of HttpClient
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### getAssetPairsAsync
|
||||
## getAssetPairsAsync
|
||||
|
||||
▸ **getAssetPairsAsync**(`requestOpts?`: `RequestOpts` & `AssetPairsRequestOpts` & `PagedRequestOpts`): *`Promise<AssetPairsResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:59](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L59)*
|
||||
*Defined in [http_client.ts:59](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L59)*
|
||||
|
||||
Retrieve assetData pair info from the API
|
||||
|
||||
@@ -69,11 +54,11 @@ The resulting AssetPairsResponse that match the request
|
||||
|
||||
___
|
||||
|
||||
### getFeeRecipientsAsync
|
||||
## getFeeRecipientsAsync
|
||||
|
||||
▸ **getFeeRecipientsAsync**(`requestOpts?`: `RequestOpts` & `PagedRequestOpts`): *`Promise<FeeRecipientsResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:160](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L160)*
|
||||
*Defined in [http_client.ts:160](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L160)*
|
||||
|
||||
Retrieve the list of fee recipient addresses used by the relayer.
|
||||
|
||||
@@ -89,11 +74,11 @@ The resulting FeeRecipientsResponse
|
||||
|
||||
___
|
||||
|
||||
### getOrderAsync
|
||||
## getOrderAsync
|
||||
|
||||
▸ **getOrderAsync**(`orderHash`: string, `requestOpts?`: `RequestOpts`): *`Promise<APIOrder>`*
|
||||
|
||||
*Defined in [http_client.ts:99](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L99)*
|
||||
*Defined in [http_client.ts:99](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L99)*
|
||||
|
||||
Retrieve a specific order from the API
|
||||
|
||||
@@ -110,11 +95,11 @@ The APIOrder that matches the supplied orderHash
|
||||
|
||||
___
|
||||
|
||||
### getOrderConfigAsync
|
||||
## getOrderConfigAsync
|
||||
|
||||
▸ **getOrderConfigAsync**(`request`: `OrderConfigRequest`, `requestOpts?`: `RequestOpts`): *`Promise<OrderConfigResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:139](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L139)*
|
||||
*Defined in [http_client.ts:139](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L139)*
|
||||
|
||||
Retrieve fee information from the API
|
||||
|
||||
@@ -131,11 +116,11 @@ The resulting OrderConfigResponse that matches the request
|
||||
|
||||
___
|
||||
|
||||
### getOrderbookAsync
|
||||
## getOrderbookAsync
|
||||
|
||||
▸ **getOrderbookAsync**(`request`: `OrderbookRequest`, `requestOpts?`: `RequestOpts` & `PagedRequestOpts`): *`Promise<OrderbookResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:117](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L117)*
|
||||
*Defined in [http_client.ts:117](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L117)*
|
||||
|
||||
Retrieve an orderbook from the API
|
||||
|
||||
@@ -152,11 +137,11 @@ The resulting OrderbookResponse that matches the request
|
||||
|
||||
___
|
||||
|
||||
### getOrdersAsync
|
||||
## getOrdersAsync
|
||||
|
||||
▸ **getOrdersAsync**(`requestOpts?`: `RequestOpts` & `OrdersRequestOpts` & `PagedRequestOpts`): *`Promise<OrdersResponse>`*
|
||||
|
||||
*Defined in [http_client.ts:79](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L79)*
|
||||
*Defined in [http_client.ts:79](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L79)*
|
||||
|
||||
Retrieve orders from the API
|
||||
|
||||
@@ -172,11 +157,11 @@ The resulting OrdersResponse that match the request
|
||||
|
||||
___
|
||||
|
||||
### submitOrderAsync
|
||||
## submitOrderAsync
|
||||
|
||||
▸ **submitOrderAsync**(`signedOrder`: `SignedOrder`, `requestOpts?`: `RequestOpts`): *`Promise<void>`*
|
||||
|
||||
*Defined in [http_client.ts:177](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/http_client.ts#L177)*
|
||||
*Defined in [http_client.ts:177](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/http_client.ts#L177)*
|
||||
|
||||
Submit a signed order to the API
|
||||
|
||||
@@ -191,37 +176,27 @@ Name | Type | Description |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Class: WebSocketOrdersChannel
|
||||
# Class: WebSocketOrdersChannel
|
||||
|
||||
This class includes all the functionality related to interacting with a websocket endpoint
|
||||
that implements the standard relayer API v0
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **WebSocketOrdersChannel**
|
||||
|
||||
## Implements
|
||||
### Implements
|
||||
|
||||
* [OrdersChannel](#interface-orderschannel)
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
## constructer
|
||||
|
||||
### Methods
|
||||
\+ **new WebSocketOrdersChannel**(`client`: `w3cwebsocket`, `handler`: [OrdersChannelHandler](#interface-orderschannelhandler)): *[WebSocketOrdersChannel](#class-websocketorderschannel)*
|
||||
|
||||
* [close](#close)
|
||||
* [subscribe](#subscribe)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new WebSocketOrdersChannel**(`client`: `w3cwebsocket`, `handler`: [OrdersChannelHandler](#class-websocketorderschannel)*
|
||||
|
||||
*Defined in [ws_orders_channel.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/ws_orders_channel.ts#L21)*
|
||||
*Defined in [ws_orders_channel.ts:21](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/ws_orders_channel.ts#L21)*
|
||||
|
||||
Instantiates a new WebSocketOrdersChannel instance
|
||||
|
||||
@@ -236,13 +211,13 @@ Name | Type | Description |
|
||||
|
||||
An instance of WebSocketOrdersChannel
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### close
|
||||
## close
|
||||
|
||||
▸ **close**(): *void*
|
||||
|
||||
*Defined in [ws_orders_channel.ts:66](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/ws_orders_channel.ts#L66)*
|
||||
*Defined in [ws_orders_channel.ts:66](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/ws_orders_channel.ts#L66)*
|
||||
|
||||
Close the websocket and stop receiving updates
|
||||
|
||||
@@ -250,11 +225,11 @@ Close the websocket and stop receiving updates
|
||||
|
||||
___
|
||||
|
||||
### subscribe
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(`subscriptionOpts`: `OrdersChannelSubscriptionOpts`): *void*
|
||||
|
||||
*Defined in [ws_orders_channel.ts:50](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/ws_orders_channel.ts#L50)*
|
||||
*Defined in [ws_orders_channel.ts:50](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/ws_orders_channel.ts#L50)*
|
||||
|
||||
Subscribe to orderbook snapshots and updates from the websocket
|
||||
|
||||
@@ -268,62 +243,45 @@ Name | Type | Description |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Enumeration: HttpRequestType
|
||||
# Enumeration: HttpRequestType
|
||||
|
||||
## Index
|
||||
|
||||
### Enumeration members
|
||||
|
||||
* [Get](#get)
|
||||
* [Post](#post)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### Get
|
||||
## Get
|
||||
|
||||
• **Get**: = "GET"
|
||||
|
||||
*Defined in [types.ts:46](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L46)*
|
||||
*Defined in [types.ts:46](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L46)*
|
||||
|
||||
___
|
||||
|
||||
### Post
|
||||
## Post
|
||||
|
||||
• **Post**: = "POST"
|
||||
|
||||
*Defined in [types.ts:47](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L47)*
|
||||
*Defined in [types.ts:47](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L47)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: Client
|
||||
# Interface: Client
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **Client**
|
||||
|
||||
## Implemented by
|
||||
### Implemented by
|
||||
|
||||
* [HttpClient](#class-httpclient)
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [getAssetPairsAsync](#getassetpairsasync)
|
||||
* [getFeeRecipientsAsync](#getfeerecipientsasync)
|
||||
* [getOrderAsync](#getorderasync)
|
||||
* [getOrderConfigAsync](#getorderconfigasync)
|
||||
* [getOrderbookAsync](#getorderbookasync)
|
||||
* [getOrdersAsync](#getordersasync)
|
||||
* [submitOrderAsync](#submitorderasync)
|
||||
|
||||
## Properties
|
||||
|
||||
### getAssetPairsAsync
|
||||
## getAssetPairsAsync
|
||||
|
||||
• **getAssetPairsAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:18](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L18)*
|
||||
*Defined in [types.ts:18](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L18)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -337,11 +295,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### getFeeRecipientsAsync
|
||||
## getFeeRecipientsAsync
|
||||
|
||||
• **getFeeRecipientsAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:25](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L25)*
|
||||
*Defined in [types.ts:25](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L25)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -355,11 +313,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### getOrderAsync
|
||||
## getOrderAsync
|
||||
|
||||
• **getOrderAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:22](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L22)*
|
||||
*Defined in [types.ts:22](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L22)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -373,11 +331,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### getOrderConfigAsync
|
||||
## getOrderConfigAsync
|
||||
|
||||
• **getOrderConfigAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:24](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L24)*
|
||||
*Defined in [types.ts:24](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L24)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -391,11 +349,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### getOrderbookAsync
|
||||
## getOrderbookAsync
|
||||
|
||||
• **getOrderbookAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:23](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L23)*
|
||||
*Defined in [types.ts:23](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L23)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -410,11 +368,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### getOrdersAsync
|
||||
## getOrdersAsync
|
||||
|
||||
• **getOrdersAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L21)*
|
||||
*Defined in [types.ts:21](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L21)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -428,11 +386,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### submitOrderAsync
|
||||
## submitOrderAsync
|
||||
|
||||
• **submitOrderAsync**: *function*
|
||||
|
||||
*Defined in [types.ts:26](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L26)*
|
||||
*Defined in [types.ts:26](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L26)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -446,61 +404,49 @@ Name | Type |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: HttpRequestOptions
|
||||
# Interface: HttpRequestOptions
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **HttpRequestOptions**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [params](#optional-params)
|
||||
* [payload](#optional-payload)
|
||||
|
||||
## Properties
|
||||
|
||||
### `Optional` params
|
||||
## `Optional` params
|
||||
|
||||
• **params**? : *undefined | object*
|
||||
|
||||
*Defined in [types.ts:41](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L41)*
|
||||
*Defined in [types.ts:41](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
### `Optional` payload
|
||||
## `Optional` payload
|
||||
|
||||
• **payload**? : *undefined | object*
|
||||
|
||||
*Defined in [types.ts:42](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L42)*
|
||||
*Defined in [types.ts:42](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L42)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: OrdersChannel
|
||||
# Interface: OrdersChannel
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **OrdersChannel**
|
||||
|
||||
## Implemented by
|
||||
### Implemented by
|
||||
|
||||
* [WebSocketOrdersChannel](#class-websocketorderschannel)
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [close](#close)
|
||||
* [subscribe](#subscribe)
|
||||
|
||||
## Properties
|
||||
|
||||
### close
|
||||
## close
|
||||
|
||||
• **close**: *function*
|
||||
|
||||
*Defined in [types.ts:31](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L31)*
|
||||
*Defined in [types.ts:31](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L31)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -508,11 +454,11 @@ ___
|
||||
|
||||
___
|
||||
|
||||
### subscribe
|
||||
## subscribe
|
||||
|
||||
• **subscribe**: *function*
|
||||
|
||||
*Defined in [types.ts:30](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L30)*
|
||||
*Defined in [types.ts:30](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L30)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -526,27 +472,20 @@ Name | Type |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: OrdersChannelHandler
|
||||
# Interface: OrdersChannelHandler
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **OrdersChannelHandler**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [onClose](#onclose)
|
||||
* [onError](#onerror)
|
||||
* [onUpdate](#onupdate)
|
||||
|
||||
## Properties
|
||||
|
||||
### onClose
|
||||
## onClose
|
||||
|
||||
• **onClose**: *function*
|
||||
|
||||
*Defined in [types.ts:37](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L37)*
|
||||
*Defined in [types.ts:37](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L37)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -560,11 +499,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### onError
|
||||
## onError
|
||||
|
||||
• **onError**: *function*
|
||||
|
||||
*Defined in [types.ts:36](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L36)*
|
||||
*Defined in [types.ts:36](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L36)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -580,11 +519,11 @@ Name | Type |
|
||||
|
||||
___
|
||||
|
||||
### onUpdate
|
||||
## onUpdate
|
||||
|
||||
• **onUpdate**: *function*
|
||||
|
||||
*Defined in [types.ts:35](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/connect/src/types.ts#L35)*
|
||||
*Defined in [types.ts:35](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/connect/src/types.ts#L35)*
|
||||
|
||||
#### Type declaration:
|
||||
|
||||
@@ -600,48 +539,15 @@ Name | Type |
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: OrdersChannelSubscriptionOptsMap
|
||||
# Interface: OrdersChannelSubscriptionOptsMap
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **OrdersChannelSubscriptionOptsMap**
|
||||
|
||||
## Indexable
|
||||
### Indexable
|
||||
|
||||
● \[▪ **key**: *string*\]: `OrdersChannelSubscriptionOpts`
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [http_client](modules/_http_client_.md)
|
||||
* [http_client.HttpClient](#class-httpclient)
|
||||
* [index](modules/_index_.md)
|
||||
* [orders_channel_factory](modules/_orders_channel_factory_.md)
|
||||
* [types](modules/_types_.md)
|
||||
* [types.HttpRequestType](#class-httprequesttype)
|
||||
* [types.Client](#class-client)
|
||||
* [types.HttpRequestOptions](#class-httprequestoptions)
|
||||
* [types.OrdersChannel](#class-orderschannel)
|
||||
* [types.OrdersChannelHandler](#class-orderschannelhandler)
|
||||
* [utils/assert](modules/_utils_assert_.md)
|
||||
* [utils/orders_channel_message_parser](modules/_utils_orders_channel_message_parser_.md)
|
||||
* [utils/relayer_response_json_parsers](modules/_utils_relayer_response_json_parsers_.md)
|
||||
* [utils/type_converters](modules/_utils_type_converters_.md)
|
||||
* [ws_orders_channel](modules/_ws_orders_channel_.md)
|
||||
* [ws_orders_channel.WebSocketOrdersChannel](#class-websocketorderschannel)
|
||||
* [ws_orders_channel.OrdersChannelSubscriptionOptsMap](#class-orderschannelsubscriptionoptsmap)
|
||||
* [Classes]()
|
||||
* [http_client.HttpClient](#class-httpclient)
|
||||
* [ws_orders_channel.WebSocketOrdersChannel](#class-websocketorderschannel)
|
||||
* [Enums]()
|
||||
* [types.HttpRequestType](#class-httprequesttype)
|
||||
* [Interfaces]()
|
||||
* [types.Client](#class-client)
|
||||
* [types.HttpRequestOptions](#class-httprequestoptions)
|
||||
* [types.OrdersChannel](#class-orderschannel)
|
||||
* [types.OrdersChannelHandler](#class-orderschannelhandler)
|
||||
* [ws_orders_channel.OrdersChannelSubscriptionOptsMap](#class-orderschannelsubscriptionoptsmap)
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
## @0x/contract-wrappers
|
||||
|
||||
Smart TS wrappers for 0x smart contracts. The wrappers have simplified interfaces, perform client-side validation on transactions and throw helpful error messages.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/0x.js).
|
||||
|
||||
## Installation
|
||||
|
||||
**Install**
|
||||
|
||||
```bash
|
||||
npm install @0x/contract-wrappers --save
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```javascript
|
||||
import { ContractWrappers } from '@0x/contract-wrappers';
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/contract-wrappers yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/contract-wrappers yarn watch
|
||||
```
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,83 +0,0 @@
|
||||
## @0x/json-schemas
|
||||
|
||||
Contains 0x-related json schemas
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/json-schemas).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/json-schemas
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { SchemaValidator, ValidatorResult, schemas } from '@0x/json-schemas';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var schemas = require('@0x/json-schemas').schemas;
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/json-schemas yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/json-schemas yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
@@ -1,107 +0,0 @@
|
||||
> # Class: SchemaValidator
|
||||
|
||||
A validator for [JSON-schemas](http://json-schema.org/)
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **SchemaValidator**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [addSchema](#addschema)
|
||||
* [isValid](#isvalid)
|
||||
* [validate](#validate)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new SchemaValidator**(): *[SchemaValidator](#class-schemavalidator)*
|
||||
|
||||
*Defined in [schema_validator.ts:15](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L15)*
|
||||
|
||||
Instantiates a SchemaValidator instance
|
||||
|
||||
**Returns:** *[SchemaValidator](#class-schemavalidator)*
|
||||
|
||||
## Methods
|
||||
|
||||
### addSchema
|
||||
|
||||
▸ **addSchema**(`schema`: `Schema`): *void*
|
||||
|
||||
*Defined in [schema_validator.ts:32](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L32)*
|
||||
|
||||
Add a schema to the validator. All schemas and sub-schemas must be added to
|
||||
the validator before the `validate` and `isValid` methods can be called with
|
||||
instances of that schema.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`schema` | `Schema` | The schema to add |
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### isValid
|
||||
|
||||
▸ **isValid**(`instance`: any, `schema`: `Schema`): *boolean*
|
||||
|
||||
*Defined in [schema_validator.ts:57](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L57)*
|
||||
|
||||
Check whether an instance properly adheres to a JSON schema
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`instance` | any | JS object in question |
|
||||
`schema` | `Schema` | Schema to check against |
|
||||
|
||||
**Returns:** *boolean*
|
||||
|
||||
Whether or not the instance adheres to the schema
|
||||
|
||||
___
|
||||
|
||||
### validate
|
||||
|
||||
▸ **validate**(`instance`: any, `schema`: `Schema`): *`ValidatorResult`*
|
||||
|
||||
*Defined in [schema_validator.ts:46](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L46)*
|
||||
|
||||
Validate the JS object conforms to a specific JSON schema
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`instance` | any | JS object in question |
|
||||
`schema` | `Schema` | Schema to check against |
|
||||
|
||||
**Returns:** *`ValidatorResult`*
|
||||
|
||||
The results of the validation
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [index](modules/_index_.md)
|
||||
* [schema_validator](modules/_schema_validator_.md)
|
||||
* [schema_validator.SchemaValidator](#class-schemavalidator)
|
||||
* [schemas](modules/_schemas_.md)
|
||||
* [Classes]()
|
||||
* [schema_validator.SchemaValidator](#class-schemavalidator)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,42 +1,31 @@
|
||||
> # Class: SchemaValidator
|
||||
# Class: SchemaValidator
|
||||
|
||||
A validator for [JSON-schemas](http://json-schema.org/)
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **SchemaValidator**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [addSchema](#addschema)
|
||||
* [isValid](#isvalid)
|
||||
* [validate](#validate)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
## constructer
|
||||
|
||||
\+ **new SchemaValidator**(): *[SchemaValidator](#class-schemavalidator)*
|
||||
|
||||
*Defined in [schema_validator.ts:15](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L15)*
|
||||
*Defined in [schema_validator.ts:15](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/json-schemas/src/schema_validator.ts#L15)*
|
||||
|
||||
Instantiates a SchemaValidator instance
|
||||
|
||||
**Returns:** *[SchemaValidator](#class-schemavalidator)*
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### addSchema
|
||||
## addSchema
|
||||
|
||||
▸ **addSchema**(`schema`: `Schema`): *void*
|
||||
|
||||
*Defined in [schema_validator.ts:32](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L32)*
|
||||
*Defined in [schema_validator.ts:32](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/json-schemas/src/schema_validator.ts#L32)*
|
||||
|
||||
Add a schema to the validator. All schemas and sub-schemas must be added to
|
||||
the validator before the `validate` and `isValid` methods can be called with
|
||||
@@ -52,11 +41,11 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### isValid
|
||||
## isValid
|
||||
|
||||
▸ **isValid**(`instance`: any, `schema`: `Schema`): *boolean*
|
||||
|
||||
*Defined in [schema_validator.ts:57](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L57)*
|
||||
*Defined in [schema_validator.ts:57](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/json-schemas/src/schema_validator.ts#L57)*
|
||||
|
||||
Check whether an instance properly adheres to a JSON schema
|
||||
|
||||
@@ -73,11 +62,11 @@ Whether or not the instance adheres to the schema
|
||||
|
||||
___
|
||||
|
||||
### validate
|
||||
## validate
|
||||
|
||||
▸ **validate**(`instance`: any, `schema`: `Schema`): *`ValidatorResult`*
|
||||
|
||||
*Defined in [schema_validator.ts:46](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/json-schemas/src/schema_validator.ts#L46)*
|
||||
*Defined in [schema_validator.ts:46](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/json-schemas/src/schema_validator.ts#L46)*
|
||||
|
||||
Validate the JS object conforms to a specific JSON schema
|
||||
|
||||
@@ -94,14 +83,3 @@ The results of the validation
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [index](modules/_index_.md)
|
||||
* [schema_validator](modules/_schema_validator_.md)
|
||||
* [schema_validator.SchemaValidator](#class-schemavalidator)
|
||||
* [schemas](modules/_schemas_.md)
|
||||
* [Classes]()
|
||||
* [schema_validator.SchemaValidator](#class-schemavalidator)
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
## Migrations
|
||||
|
||||
Migrate the 0x system of smart contracts on the network of your choice using these migrations.
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/migrations yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/migrations yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Migrate
|
||||
|
||||
#### V2 smart contracts
|
||||
|
||||
In order to migrate the V2 0x smart contracts to TestRPC/Ganache running at `http://localhost:8545`, run:
|
||||
|
||||
```bash
|
||||
yarn migrate:v2
|
||||
```
|
||||
|
||||
### Publish
|
||||
|
||||
#### 0x Ganache Snapshot
|
||||
|
||||
The 0x Ganache snapshot can be generated and published in this package. In order to build the snapshot for this version of migrations run:
|
||||
|
||||
```bash
|
||||
yarn build:snapshot
|
||||
```
|
||||
|
||||
This will run the migrations in Ganache and output a zip file to be uploaded to the s3 bucket. For example, after running this command you will have created `0x_ganache_snapshot-2.2.2.zip`. To publish the zip file to the s3 bucket run:
|
||||
|
||||
```bash
|
||||
yarn publish:snapshot
|
||||
```
|
||||
|
||||
This snapshot will now be publicly available at http://ganache-snapshots.0x.org.s3.amazonaws.com/0x_ganache_snapshot-latest.zip and also versioned with the package.json version.
|
||||
|
||||
#### 0x Ganache Docker Image
|
||||
|
||||
We also publish a simple docker image which downloads the latest snapshot, extracts and runs Ganache. This is not required to be built when migrations change as it always downloads and runs the latest zip file. If you have made changes to the Dockerfile then a publish of the image is required. To do this run:
|
||||
|
||||
```bash
|
||||
yarn build:snapshot:docker
|
||||
yarn publish:snapshot:docker
|
||||
```
|
||||
|
||||
The result is a published docker image to the 0xorg docker registry. To start the docker image run:
|
||||
|
||||
```bash
|
||||
docker run -p 8545:8545 -ti 0xorg/ganache-cli:latest
|
||||
```
|
||||
|
||||
This will pull the latest zip in the s3 bucket, extract and start Ganache with the snapshot.
|
||||
|
||||
In the event you need a specific version of the published Ganache snapshot run the following specifying the VERSION environment variable:
|
||||
|
||||
```bash
|
||||
docker run -e VERSION=2.2.2 -p 8545:8545 -ti 0xorg/ganache-cli:latest
|
||||
```
|
||||
|
||||
#### Production
|
||||
|
||||
If deploying contract changes to mainnet, `@0x/contract-artifacts` should also be updated and published. The artifacts must be copied from each `contracts/{package-name}/generated-artifacts/{contract}.json`.
|
||||
@@ -1,228 +0,0 @@
|
||||
> # Enumeration: ContractName
|
||||
|
||||
## Index
|
||||
|
||||
### Enumeration members
|
||||
|
||||
* [AccountLevels](#accountlevels)
|
||||
* [Arbitrage](#arbitrage)
|
||||
* [DummyToken](#dummytoken)
|
||||
* [EtherDelta](#etherdelta)
|
||||
* [Exchange](#exchange)
|
||||
* [MultiSigWalletWithTimeLock](#multisigwalletwithtimelock)
|
||||
* [MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress](#multisigwalletwithtimelockexceptremoveauthorizedaddress)
|
||||
* [TokenRegistry](#tokenregistry)
|
||||
* [TokenTransferProxy](#tokentransferproxy)
|
||||
* [WETH9](#weth9)
|
||||
* [ZRXToken](#zrxtoken)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### AccountLevels
|
||||
|
||||
• **AccountLevels**: = "AccountLevels"
|
||||
|
||||
*Defined in [types.ts:26](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L26)*
|
||||
|
||||
___
|
||||
|
||||
### Arbitrage
|
||||
|
||||
• **Arbitrage**: = "Arbitrage"
|
||||
|
||||
*Defined in [types.ts:28](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L28)*
|
||||
|
||||
___
|
||||
|
||||
### DummyToken
|
||||
|
||||
• **DummyToken**: = "DummyToken"
|
||||
|
||||
*Defined in [types.ts:23](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L23)*
|
||||
|
||||
___
|
||||
|
||||
### EtherDelta
|
||||
|
||||
• **EtherDelta**: = "EtherDelta"
|
||||
|
||||
*Defined in [types.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L27)*
|
||||
|
||||
___
|
||||
|
||||
### Exchange
|
||||
|
||||
• **Exchange**: = "Exchange"
|
||||
|
||||
*Defined in [types.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L21)*
|
||||
|
||||
___
|
||||
|
||||
### MultiSigWalletWithTimeLock
|
||||
|
||||
• **MultiSigWalletWithTimeLock**: = "MultiSigWalletWithTimeLock"
|
||||
|
||||
*Defined in [types.ts:20](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L20)*
|
||||
|
||||
___
|
||||
|
||||
### MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress
|
||||
|
||||
• **MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress**: = "MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress"
|
||||
|
||||
*Defined in [types.ts:25](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L25)*
|
||||
|
||||
___
|
||||
|
||||
### TokenRegistry
|
||||
|
||||
• **TokenRegistry**: = "TokenRegistry"
|
||||
|
||||
*Defined in [types.ts:19](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
### TokenTransferProxy
|
||||
|
||||
• **TokenTransferProxy**: = "TokenTransferProxy"
|
||||
|
||||
*Defined in [types.ts:18](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L18)*
|
||||
|
||||
___
|
||||
|
||||
### WETH9
|
||||
|
||||
• **WETH9**: = "WETH9"
|
||||
|
||||
*Defined in [types.ts:24](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L24)*
|
||||
|
||||
___
|
||||
|
||||
### ZRXToken
|
||||
|
||||
• **ZRXToken**: = "ZRXToken"
|
||||
|
||||
*Defined in [types.ts:22](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L22)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ERC20Token
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **ERC20Token**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [address](#optional-address)
|
||||
* [decimals](#decimals)
|
||||
* [ipfsHash](#ipfshash)
|
||||
* [name](#name)
|
||||
* [swarmHash](#swarmhash)
|
||||
* [symbol](#symbol)
|
||||
|
||||
## Properties
|
||||
|
||||
### `Optional` address
|
||||
|
||||
• **address**? : *undefined | string*
|
||||
|
||||
*Defined in [types.ts:4](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L4)*
|
||||
|
||||
___
|
||||
|
||||
### decimals
|
||||
|
||||
• **decimals**: *`BigNumber`*
|
||||
|
||||
*Defined in [types.ts:7](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L7)*
|
||||
|
||||
___
|
||||
|
||||
### ipfsHash
|
||||
|
||||
• **ipfsHash**: *string*
|
||||
|
||||
*Defined in [types.ts:8](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L8)*
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Defined in [types.ts:5](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L5)*
|
||||
|
||||
___
|
||||
|
||||
### swarmHash
|
||||
|
||||
• **swarmHash**: *string*
|
||||
|
||||
*Defined in [types.ts:9](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L9)*
|
||||
|
||||
___
|
||||
|
||||
### symbol
|
||||
|
||||
• **symbol**: *string*
|
||||
|
||||
*Defined in [types.ts:6](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L6)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ERC721Token
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **ERC721Token**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [name](#name)
|
||||
* [symbol](#symbol)
|
||||
|
||||
## Properties
|
||||
|
||||
### name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Defined in [types.ts:13](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L13)*
|
||||
|
||||
___
|
||||
|
||||
### symbol
|
||||
|
||||
• **symbol**: *string*
|
||||
|
||||
*Defined in [types.ts:14](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L14)*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [cli](modules/_cli_.md)
|
||||
* [index](modules/_index_.md)
|
||||
* [migrate](modules/_migrate_.md)
|
||||
* [migrate_snapshot](modules/_migrate_snapshot_.md)
|
||||
* [migration](modules/_migration_.md)
|
||||
* [types](modules/_types_.md)
|
||||
* [types.ContractName](#class-contractname)
|
||||
* [types.ERC20Token](#class-erc20token)
|
||||
* [types.ERC721Token](#class-erc721token)
|
||||
* [utils/constants](modules/_utils_constants_.md)
|
||||
* [utils/provider_factory](modules/_utils_provider_factory_.md)
|
||||
* [utils/token_info](modules/_utils_token_info_.md)
|
||||
* [Enums]()
|
||||
* [types.ContractName](#class-contractname)
|
||||
* [Interfaces]()
|
||||
* [types.ERC20Token](#class-erc20token)
|
||||
* [types.ERC721Token](#class-erc721token)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,228 +1,175 @@
|
||||
> # Enumeration: ContractName
|
||||
# Enumeration: ContractName
|
||||
|
||||
## Index
|
||||
|
||||
### Enumeration members
|
||||
|
||||
* [AccountLevels](#accountlevels)
|
||||
* [Arbitrage](#arbitrage)
|
||||
* [DummyToken](#dummytoken)
|
||||
* [EtherDelta](#etherdelta)
|
||||
* [Exchange](#exchange)
|
||||
* [MultiSigWalletWithTimeLock](#multisigwalletwithtimelock)
|
||||
* [MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress](#multisigwalletwithtimelockexceptremoveauthorizedaddress)
|
||||
* [TokenRegistry](#tokenregistry)
|
||||
* [TokenTransferProxy](#tokentransferproxy)
|
||||
* [WETH9](#weth9)
|
||||
* [ZRXToken](#zrxtoken)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### AccountLevels
|
||||
## AccountLevels
|
||||
|
||||
• **AccountLevels**: = "AccountLevels"
|
||||
|
||||
*Defined in [types.ts:26](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L26)*
|
||||
*Defined in [types.ts:26](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L26)*
|
||||
|
||||
___
|
||||
|
||||
### Arbitrage
|
||||
## Arbitrage
|
||||
|
||||
• **Arbitrage**: = "Arbitrage"
|
||||
|
||||
*Defined in [types.ts:28](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L28)*
|
||||
*Defined in [types.ts:28](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L28)*
|
||||
|
||||
___
|
||||
|
||||
### DummyToken
|
||||
## DummyToken
|
||||
|
||||
• **DummyToken**: = "DummyToken"
|
||||
|
||||
*Defined in [types.ts:23](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L23)*
|
||||
*Defined in [types.ts:23](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L23)*
|
||||
|
||||
___
|
||||
|
||||
### EtherDelta
|
||||
## EtherDelta
|
||||
|
||||
• **EtherDelta**: = "EtherDelta"
|
||||
|
||||
*Defined in [types.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L27)*
|
||||
*Defined in [types.ts:27](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L27)*
|
||||
|
||||
___
|
||||
|
||||
### Exchange
|
||||
## Exchange
|
||||
|
||||
• **Exchange**: = "Exchange"
|
||||
|
||||
*Defined in [types.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L21)*
|
||||
*Defined in [types.ts:21](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L21)*
|
||||
|
||||
___
|
||||
|
||||
### MultiSigWalletWithTimeLock
|
||||
## MultiSigWalletWithTimeLock
|
||||
|
||||
• **MultiSigWalletWithTimeLock**: = "MultiSigWalletWithTimeLock"
|
||||
|
||||
*Defined in [types.ts:20](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L20)*
|
||||
*Defined in [types.ts:20](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L20)*
|
||||
|
||||
___
|
||||
|
||||
### MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress
|
||||
## MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress
|
||||
|
||||
• **MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress**: = "MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress"
|
||||
|
||||
*Defined in [types.ts:25](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L25)*
|
||||
*Defined in [types.ts:25](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L25)*
|
||||
|
||||
___
|
||||
|
||||
### TokenRegistry
|
||||
## TokenRegistry
|
||||
|
||||
• **TokenRegistry**: = "TokenRegistry"
|
||||
|
||||
*Defined in [types.ts:19](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L19)*
|
||||
*Defined in [types.ts:19](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
### TokenTransferProxy
|
||||
## TokenTransferProxy
|
||||
|
||||
• **TokenTransferProxy**: = "TokenTransferProxy"
|
||||
|
||||
*Defined in [types.ts:18](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L18)*
|
||||
*Defined in [types.ts:18](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L18)*
|
||||
|
||||
___
|
||||
|
||||
### WETH9
|
||||
## WETH9
|
||||
|
||||
• **WETH9**: = "WETH9"
|
||||
|
||||
*Defined in [types.ts:24](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L24)*
|
||||
*Defined in [types.ts:24](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L24)*
|
||||
|
||||
___
|
||||
|
||||
### ZRXToken
|
||||
## ZRXToken
|
||||
|
||||
• **ZRXToken**: = "ZRXToken"
|
||||
|
||||
*Defined in [types.ts:22](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L22)*
|
||||
*Defined in [types.ts:22](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L22)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ERC20Token
|
||||
# Interface: ERC20Token
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **ERC20Token**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [address](#optional-address)
|
||||
* [decimals](#decimals)
|
||||
* [ipfsHash](#ipfshash)
|
||||
* [name](#name)
|
||||
* [swarmHash](#swarmhash)
|
||||
* [symbol](#symbol)
|
||||
|
||||
## Properties
|
||||
|
||||
### `Optional` address
|
||||
## `Optional` address
|
||||
|
||||
• **address**? : *undefined | string*
|
||||
|
||||
*Defined in [types.ts:4](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L4)*
|
||||
*Defined in [types.ts:4](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L4)*
|
||||
|
||||
___
|
||||
|
||||
### decimals
|
||||
## decimals
|
||||
|
||||
• **decimals**: *`BigNumber`*
|
||||
|
||||
*Defined in [types.ts:7](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L7)*
|
||||
*Defined in [types.ts:7](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L7)*
|
||||
|
||||
___
|
||||
|
||||
### ipfsHash
|
||||
## ipfsHash
|
||||
|
||||
• **ipfsHash**: *string*
|
||||
|
||||
*Defined in [types.ts:8](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L8)*
|
||||
*Defined in [types.ts:8](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L8)*
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
## name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Defined in [types.ts:5](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L5)*
|
||||
*Defined in [types.ts:5](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L5)*
|
||||
|
||||
___
|
||||
|
||||
### swarmHash
|
||||
## swarmHash
|
||||
|
||||
• **swarmHash**: *string*
|
||||
|
||||
*Defined in [types.ts:9](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L9)*
|
||||
*Defined in [types.ts:9](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L9)*
|
||||
|
||||
___
|
||||
|
||||
### symbol
|
||||
## symbol
|
||||
|
||||
• **symbol**: *string*
|
||||
|
||||
*Defined in [types.ts:6](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L6)*
|
||||
*Defined in [types.ts:6](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L6)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ERC721Token
|
||||
# Interface: ERC721Token
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **ERC721Token**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [name](#name)
|
||||
* [symbol](#symbol)
|
||||
|
||||
## Properties
|
||||
|
||||
### name
|
||||
## name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Defined in [types.ts:13](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L13)*
|
||||
*Defined in [types.ts:13](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L13)*
|
||||
|
||||
___
|
||||
|
||||
### symbol
|
||||
## symbol
|
||||
|
||||
• **symbol**: *string*
|
||||
|
||||
*Defined in [types.ts:14](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/migrations/src/types.ts#L14)*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [cli](modules/_cli_.md)
|
||||
* [index](modules/_index_.md)
|
||||
* [migrate](modules/_migrate_.md)
|
||||
* [migrate_snapshot](modules/_migrate_snapshot_.md)
|
||||
* [migration](modules/_migration_.md)
|
||||
* [types](modules/_types_.md)
|
||||
* [types.ContractName](#class-contractname)
|
||||
* [types.ERC20Token](#class-erc20token)
|
||||
* [types.ERC721Token](#class-erc721token)
|
||||
* [utils/constants](modules/_utils_constants_.md)
|
||||
* [utils/provider_factory](modules/_utils_provider_factory_.md)
|
||||
* [utils/token_info](modules/_utils_token_info_.md)
|
||||
* [Enums]()
|
||||
* [types.ContractName](#class-contractname)
|
||||
* [Interfaces]()
|
||||
* [types.ERC20Token](#class-erc20token)
|
||||
* [types.ERC721Token](#class-erc721token)
|
||||
*Defined in [types.ts:14](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/migrations/src/types.ts#L14)*
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
## @0x/order-utils
|
||||
|
||||
0x order-related utilities for those developing on top of 0x protocol.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/order-utils).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/order-utils
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/order-utils yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/order-utils yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,97 +0,0 @@
|
||||
## @0x/sol-compiler
|
||||
|
||||
Sol-compiler is a wrapper around [solc-js](https://www.npmjs.com/package/solc) that adds:
|
||||
|
||||
- Smart re-compilation: Only recompiles when smart contracts have changed
|
||||
- Ability to compile an entire project instead of only individual `.sol` files
|
||||
- Compilation using the Solidity version specified at the top of each individual `.sol` file
|
||||
- Proper parsing of Solidity version ranges
|
||||
- Support for the standard [input description](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#input-description) for what information you'd like added to the resulting `artifacts` file (i.e 100% configurable artifacts content).
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-compiler).
|
||||
|
||||
## Installation
|
||||
|
||||
#### CLI Installation
|
||||
|
||||
```bash
|
||||
yarn global add @0x/sol-compiler
|
||||
```
|
||||
|
||||
#### API Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/sol-compiler
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { Compiler } from '@0x/sol-compiler';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var Compiler = require('@0x/sol-compiler').Compiler;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-compiler yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-compiler yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
@@ -1,401 +0,0 @@
|
||||
> # Class: Compiler
|
||||
|
||||
The Compiler facilitates compiling Solidity smart contracts and saves the results
|
||||
to artifact files.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **Compiler**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [compileAsync](#compileasync)
|
||||
* [getCompilerOutputsAsync](#getcompileroutputsasync)
|
||||
* [watchAsync](#watchasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new Compiler**(`opts?`: `CompilerOptions`): *[Compiler](#class-compiler)*
|
||||
|
||||
*Defined in [compiler.ts:94](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L94)*
|
||||
|
||||
Instantiates a new instance of the Compiler class.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Description |
|
||||
------ | ------ | ------ |
|
||||
`opts?` | `CompilerOptions` | Optional compiler options |
|
||||
|
||||
**Returns:** *[Compiler](#class-compiler)*
|
||||
|
||||
An instance of the Compiler class.
|
||||
|
||||
## Methods
|
||||
|
||||
### compileAsync
|
||||
|
||||
▸ **compileAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [compiler.ts:132](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L132)*
|
||||
|
||||
Compiles selected Solidity files found in `contractsDir` and writes JSON artifacts to `artifactsDir`.
|
||||
|
||||
**Returns:** *`Promise<void>`*
|
||||
|
||||
___
|
||||
|
||||
### getCompilerOutputsAsync
|
||||
|
||||
▸ **getCompilerOutputsAsync**(): *`Promise<StandardOutput[]>`*
|
||||
|
||||
*Defined in [compiler.ts:145](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L145)*
|
||||
|
||||
Compiles Solidity files specified during instantiation, and returns the
|
||||
compiler output given by solc. Return value is an array of outputs:
|
||||
Solidity modules are batched together by version required, and each
|
||||
element of the returned array corresponds to a compiler version, and
|
||||
each element contains the output for all of the modules compiled with
|
||||
that version.
|
||||
|
||||
**Returns:** *`Promise<StandardOutput[]>`*
|
||||
|
||||
___
|
||||
|
||||
### watchAsync
|
||||
|
||||
▸ **watchAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [compiler.ts:149](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L149)*
|
||||
|
||||
**Returns:** *`Promise<void>`*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Class: CompilationError
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* `Error`
|
||||
|
||||
* **CompilationError**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
* [errorsCount](#errorscount)
|
||||
* [message](#message)
|
||||
* [name](#name)
|
||||
* [stack](#optional-stack)
|
||||
* [typeName](#typename)
|
||||
* [Error](#static-error)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new CompilationError**(`errorsCount`: number): *[CompilationError](#class-compilationerror)*
|
||||
|
||||
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L39)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type |
|
||||
------ | ------ |
|
||||
`errorsCount` | number |
|
||||
|
||||
**Returns:** *[CompilationError](#class-compilationerror)*
|
||||
|
||||
## Properties
|
||||
|
||||
### errorsCount
|
||||
|
||||
• **errorsCount**: *number*
|
||||
|
||||
*Defined in [utils/types.ts:38](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L38)*
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• **message**: *string*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:973
|
||||
|
||||
___
|
||||
|
||||
### `Optional` stack
|
||||
|
||||
• **stack**? : *undefined | string*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:975
|
||||
|
||||
___
|
||||
|
||||
### typeName
|
||||
|
||||
• **typeName**: *string* = "CompilationError"
|
||||
|
||||
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L39)*
|
||||
|
||||
___
|
||||
|
||||
### `Static` Error
|
||||
|
||||
▪ **Error**: *`ErrorConstructor`*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:984
|
||||
|
||||
<hr />
|
||||
|
||||
> # Enumeration: AbiType
|
||||
|
||||
## Index
|
||||
|
||||
### Enumeration members
|
||||
|
||||
* [Constructor](#constructor)
|
||||
* [Event](#event)
|
||||
* [Fallback](#fallback)
|
||||
* [Function](#function)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### Constructor
|
||||
|
||||
• **Constructor**: = "constructor"
|
||||
|
||||
*Defined in [utils/types.ts:3](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L3)*
|
||||
|
||||
___
|
||||
|
||||
### Event
|
||||
|
||||
• **Event**: = "event"
|
||||
|
||||
*Defined in [utils/types.ts:4](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L4)*
|
||||
|
||||
___
|
||||
|
||||
### Fallback
|
||||
|
||||
• **Fallback**: = "fallback"
|
||||
|
||||
*Defined in [utils/types.ts:5](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L5)*
|
||||
|
||||
___
|
||||
|
||||
### Function
|
||||
|
||||
• **Function**: = "function"
|
||||
|
||||
*Defined in [utils/types.ts:2](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L2)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: BinaryPaths
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **BinaryPaths**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **key**: *string*\]: string
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ContractSourceData
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **ContractSourceData**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **contractName**: *string*\]: [ContractSpecificSourceData](#class-contractspecificsourcedata)
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ContractSpecificSourceData
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **ContractSpecificSourceData**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [solcVersionRange](#solcversionrange)
|
||||
* [sourceHash](#sourcehash)
|
||||
* [sourceTreeHash](#sourcetreehash)
|
||||
|
||||
## Properties
|
||||
|
||||
### solcVersionRange
|
||||
|
||||
• **solcVersionRange**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L21)*
|
||||
|
||||
___
|
||||
|
||||
### sourceHash
|
||||
|
||||
• **sourceHash**: *`Buffer`*
|
||||
|
||||
*Defined in [utils/types.ts:22](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L22)*
|
||||
|
||||
___
|
||||
|
||||
### sourceTreeHash
|
||||
|
||||
• **sourceTreeHash**: *`Buffer`*
|
||||
|
||||
*Defined in [utils/types.ts:23](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L23)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: SolcErrors
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **SolcErrors**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **key**: *string*\]: boolean
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: Token
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **Token**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [address](#optional-address)
|
||||
* [decimals](#decimals)
|
||||
* [ipfsHash](#ipfshash)
|
||||
* [name](#name)
|
||||
* [swarmHash](#swarmhash)
|
||||
* [symbol](#symbol)
|
||||
|
||||
## Properties
|
||||
|
||||
### `Optional` address
|
||||
|
||||
• **address**? : *undefined | string*
|
||||
|
||||
*Defined in [utils/types.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L27)*
|
||||
|
||||
___
|
||||
|
||||
### decimals
|
||||
|
||||
• **decimals**: *number*
|
||||
|
||||
*Defined in [utils/types.ts:30](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L30)*
|
||||
|
||||
___
|
||||
|
||||
### ipfsHash
|
||||
|
||||
• **ipfsHash**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:31](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L31)*
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:28](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L28)*
|
||||
|
||||
___
|
||||
|
||||
### swarmHash
|
||||
|
||||
• **swarmHash**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:32](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L32)*
|
||||
|
||||
___
|
||||
|
||||
### symbol
|
||||
|
||||
• **symbol**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:29](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L29)*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [cli](modules/_cli_.md)
|
||||
* [compiler](modules/_compiler_.md)
|
||||
* [compiler.Compiler](#class-compiler)
|
||||
* [index](modules/_index_.md)
|
||||
* [schemas/compiler_options_schema](modules/_schemas_compiler_options_schema_.md)
|
||||
* [utils/compiler](modules/_utils_compiler_.md)
|
||||
* [utils/constants](modules/_utils_constants_.md)
|
||||
* [utils/encoder](modules/_utils_encoder_.md)
|
||||
* [utils/fs_wrapper](modules/_utils_fs_wrapper_.md)
|
||||
* [utils/types](modules/_utils_types_.md)
|
||||
* [utils/types.AbiType](#class-abitype)
|
||||
* [utils/types.CompilationError](#class-compilationerror)
|
||||
* [utils/types.BinaryPaths](#class-binarypaths)
|
||||
* [utils/types.ContractSourceData](#class-contractsourcedata)
|
||||
* [utils/types.ContractSpecificSourceData](#class-contractspecificsourcedata)
|
||||
* [utils/types.SolcErrors](#class-solcerrors)
|
||||
* [utils/types.Token](#class-token)
|
||||
* [utils/utils](modules/_utils_utils_.md)
|
||||
* [Classes]()
|
||||
* [compiler.Compiler](#class-compiler)
|
||||
* [utils/types.CompilationError](#class-compilationerror)
|
||||
* [Enums]()
|
||||
* [utils/types.AbiType](#class-abitype)
|
||||
* [Interfaces]()
|
||||
* [utils/types.BinaryPaths](#class-binarypaths)
|
||||
* [utils/types.ContractSourceData](#class-contractsourcedata)
|
||||
* [utils/types.ContractSpecificSourceData](#class-contractspecificsourcedata)
|
||||
* [utils/types.SolcErrors](#class-solcerrors)
|
||||
* [utils/types.Token](#class-token)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,31 +1,20 @@
|
||||
> # Class: Compiler
|
||||
# Class: Compiler
|
||||
|
||||
The Compiler facilitates compiling Solidity smart contracts and saves the results
|
||||
to artifact files.
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **Compiler**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [compileAsync](#compileasync)
|
||||
* [getCompilerOutputsAsync](#getcompileroutputsasync)
|
||||
* [watchAsync](#watchasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
## constructer
|
||||
|
||||
\+ **new Compiler**(`opts?`: `CompilerOptions`): *[Compiler](#class-compiler)*
|
||||
|
||||
*Defined in [compiler.ts:94](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L94)*
|
||||
*Defined in [compiler.ts:94](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L94)*
|
||||
|
||||
Instantiates a new instance of the Compiler class.
|
||||
|
||||
@@ -39,13 +28,13 @@ Name | Type | Description |
|
||||
|
||||
An instance of the Compiler class.
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### compileAsync
|
||||
## compileAsync
|
||||
|
||||
▸ **compileAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [compiler.ts:132](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L132)*
|
||||
*Defined in [compiler.ts:132](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L132)*
|
||||
|
||||
Compiles selected Solidity files found in `contractsDir` and writes JSON artifacts to `artifactsDir`.
|
||||
|
||||
@@ -53,11 +42,11 @@ Compiles selected Solidity files found in `contractsDir` and writes JSON artifac
|
||||
|
||||
___
|
||||
|
||||
### getCompilerOutputsAsync
|
||||
## getCompilerOutputsAsync
|
||||
|
||||
▸ **getCompilerOutputsAsync**(): *`Promise<StandardOutput[]>`*
|
||||
|
||||
*Defined in [compiler.ts:145](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L145)*
|
||||
*Defined in [compiler.ts:145](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L145)*
|
||||
|
||||
Compiles Solidity files specified during instantiation, and returns the
|
||||
compiler output given by solc. Return value is an array of outputs:
|
||||
@@ -70,46 +59,32 @@ that version.
|
||||
|
||||
___
|
||||
|
||||
### watchAsync
|
||||
## watchAsync
|
||||
|
||||
▸ **watchAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [compiler.ts:149](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/compiler.ts#L149)*
|
||||
*Defined in [compiler.ts:149](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L149)*
|
||||
|
||||
**Returns:** *`Promise<void>`*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Class: CompilationError
|
||||
# Class: CompilationError
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* `Error`
|
||||
|
||||
* **CompilationError**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
* [errorsCount](#errorscount)
|
||||
* [message](#message)
|
||||
* [name](#name)
|
||||
* [stack](#optional-stack)
|
||||
* [typeName](#typename)
|
||||
* [Error](#static-error)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
## constructer
|
||||
|
||||
\+ **new CompilationError**(`errorsCount`: number): *[CompilationError](#class-compilationerror)*
|
||||
|
||||
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L39)*
|
||||
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L39)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -119,283 +94,203 @@ Name | Type |
|
||||
|
||||
**Returns:** *[CompilationError](#class-compilationerror)*
|
||||
|
||||
## Properties
|
||||
### Properties
|
||||
|
||||
### errorsCount
|
||||
## errorsCount
|
||||
|
||||
• **errorsCount**: *number*
|
||||
|
||||
*Defined in [utils/types.ts:38](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L38)*
|
||||
*Defined in [utils/types.ts:38](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L38)*
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
## message
|
||||
|
||||
• **message**: *string*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974
|
||||
|
||||
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
## name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:973
|
||||
|
||||
|
||||
|
||||
___
|
||||
|
||||
### `Optional` stack
|
||||
## `Optional` stack
|
||||
|
||||
• **stack**? : *undefined | string*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:975
|
||||
|
||||
|
||||
___
|
||||
|
||||
### typeName
|
||||
## typeName
|
||||
|
||||
• **typeName**: *string* = "CompilationError"
|
||||
|
||||
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L39)*
|
||||
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L39)*
|
||||
|
||||
___
|
||||
|
||||
### `Static` Error
|
||||
## `Static` Error
|
||||
|
||||
▪ **Error**: *`ErrorConstructor`*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:984
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
> # Enumeration: AbiType
|
||||
# Enumeration: AbiType
|
||||
|
||||
## Index
|
||||
|
||||
### Enumeration members
|
||||
|
||||
* [Constructor](#constructor)
|
||||
* [Event](#event)
|
||||
* [Fallback](#fallback)
|
||||
* [Function](#function)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### Constructor
|
||||
## Constructor
|
||||
|
||||
• **Constructor**: = "constructor"
|
||||
|
||||
*Defined in [utils/types.ts:3](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L3)*
|
||||
*Defined in [utils/types.ts:3](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L3)*
|
||||
|
||||
___
|
||||
|
||||
### Event
|
||||
## Event
|
||||
|
||||
• **Event**: = "event"
|
||||
|
||||
*Defined in [utils/types.ts:4](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L4)*
|
||||
*Defined in [utils/types.ts:4](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L4)*
|
||||
|
||||
___
|
||||
|
||||
### Fallback
|
||||
## Fallback
|
||||
|
||||
• **Fallback**: = "fallback"
|
||||
|
||||
*Defined in [utils/types.ts:5](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L5)*
|
||||
*Defined in [utils/types.ts:5](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L5)*
|
||||
|
||||
___
|
||||
|
||||
### Function
|
||||
## Function
|
||||
|
||||
• **Function**: = "function"
|
||||
|
||||
*Defined in [utils/types.ts:2](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L2)*
|
||||
*Defined in [utils/types.ts:2](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L2)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: BinaryPaths
|
||||
# Interface: BinaryPaths
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **BinaryPaths**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **key**: *string*\]: string
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ContractSourceData
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **ContractSourceData**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **contractName**: *string*\]: [ContractSpecificSourceData](#class-contractspecificsourcedata)
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: ContractSpecificSourceData
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **ContractSpecificSourceData**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [solcVersionRange](#solcversionrange)
|
||||
* [sourceHash](#sourcehash)
|
||||
* [sourceTreeHash](#sourcetreehash)
|
||||
|
||||
## Properties
|
||||
|
||||
### solcVersionRange
|
||||
## solcVersionRange
|
||||
|
||||
• **solcVersionRange**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:21](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L21)*
|
||||
*Defined in [utils/types.ts:21](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L21)*
|
||||
|
||||
___
|
||||
|
||||
### sourceHash
|
||||
## sourceHash
|
||||
|
||||
• **sourceHash**: *`Buffer`*
|
||||
|
||||
*Defined in [utils/types.ts:22](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L22)*
|
||||
*Defined in [utils/types.ts:22](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L22)*
|
||||
|
||||
___
|
||||
|
||||
### sourceTreeHash
|
||||
## sourceTreeHash
|
||||
|
||||
• **sourceTreeHash**: *`Buffer`*
|
||||
|
||||
*Defined in [utils/types.ts:23](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L23)*
|
||||
*Defined in [utils/types.ts:23](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L23)*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: SolcErrors
|
||||
# Interface: SolcErrors
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **SolcErrors**
|
||||
|
||||
## Indexable
|
||||
|
||||
● \[▪ **key**: *string*\]: boolean
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: Token
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **Token**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [address](#optional-address)
|
||||
* [decimals](#decimals)
|
||||
* [ipfsHash](#ipfshash)
|
||||
* [name](#name)
|
||||
* [swarmHash](#swarmhash)
|
||||
* [symbol](#symbol)
|
||||
|
||||
## Properties
|
||||
|
||||
### `Optional` address
|
||||
## `Optional` address
|
||||
|
||||
• **address**? : *undefined | string*
|
||||
|
||||
*Defined in [utils/types.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L27)*
|
||||
*Defined in [utils/types.ts:27](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L27)*
|
||||
|
||||
___
|
||||
|
||||
### decimals
|
||||
## decimals
|
||||
|
||||
• **decimals**: *number*
|
||||
|
||||
*Defined in [utils/types.ts:30](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L30)*
|
||||
*Defined in [utils/types.ts:30](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L30)*
|
||||
|
||||
___
|
||||
|
||||
### ipfsHash
|
||||
## ipfsHash
|
||||
|
||||
• **ipfsHash**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:31](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L31)*
|
||||
*Defined in [utils/types.ts:31](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L31)*
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
## name
|
||||
|
||||
• **name**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:28](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L28)*
|
||||
*Defined in [utils/types.ts:28](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L28)*
|
||||
|
||||
___
|
||||
|
||||
### swarmHash
|
||||
## swarmHash
|
||||
|
||||
• **swarmHash**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:32](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L32)*
|
||||
*Defined in [utils/types.ts:32](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L32)*
|
||||
|
||||
___
|
||||
|
||||
### symbol
|
||||
## symbol
|
||||
|
||||
• **symbol**: *string*
|
||||
|
||||
*Defined in [utils/types.ts:29](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-compiler/src/utils/types.ts#L29)*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [cli](modules/_cli_.md)
|
||||
* [compiler](modules/_compiler_.md)
|
||||
* [compiler.Compiler](#class-compiler)
|
||||
* [index](modules/_index_.md)
|
||||
* [schemas/compiler_options_schema](modules/_schemas_compiler_options_schema_.md)
|
||||
* [utils/compiler](modules/_utils_compiler_.md)
|
||||
* [utils/constants](modules/_utils_constants_.md)
|
||||
* [utils/encoder](modules/_utils_encoder_.md)
|
||||
* [utils/fs_wrapper](modules/_utils_fs_wrapper_.md)
|
||||
* [utils/types](modules/_utils_types_.md)
|
||||
* [utils/types.AbiType](#class-abitype)
|
||||
* [utils/types.CompilationError](#class-compilationerror)
|
||||
* [utils/types.BinaryPaths](#class-binarypaths)
|
||||
* [utils/types.ContractSourceData](#class-contractsourcedata)
|
||||
* [utils/types.ContractSpecificSourceData](#class-contractspecificsourcedata)
|
||||
* [utils/types.SolcErrors](#class-solcerrors)
|
||||
* [utils/types.Token](#class-token)
|
||||
* [utils/utils](modules/_utils_utils_.md)
|
||||
* [Classes]()
|
||||
* [compiler.Compiler](#class-compiler)
|
||||
* [utils/types.CompilationError](#class-compilationerror)
|
||||
* [Enums]()
|
||||
* [utils/types.AbiType](#class-abitype)
|
||||
* [Interfaces]()
|
||||
* [utils/types.BinaryPaths](#class-binarypaths)
|
||||
* [utils/types.ContractSourceData](#class-contractsourcedata)
|
||||
* [utils/types.ContractSpecificSourceData](#class-contractspecificsourcedata)
|
||||
* [utils/types.SolcErrors](#class-solcerrors)
|
||||
* [utils/types.Token](#class-token)
|
||||
*Defined in [utils/types.ts:29](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L29)*
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
## @0x/sol-coverage
|
||||
|
||||
A Solidity code coverage tool.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-coverage).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/sol-coverage
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```javascript
|
||||
import { CoverageSubprovider } from '@0x/sol-coverage';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var CoverageSubprovider = require('@0x/sol-coverage').CoverageSubprovider;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-coverage yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-coverage yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
@@ -1,212 +0,0 @@
|
||||
> # Class: CoverageSubprovider
|
||||
|
||||
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
||||
It's used to compute your code coverage while running solidity tests.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* `TraceInfoSubprovider`
|
||||
|
||||
* **CoverageSubprovider**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [emitPayloadAsync](#emitpayloadasync)
|
||||
* [handleRequest](#handlerequest)
|
||||
* [setEngine](#setengine)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
* [writeCoverageAsync](#writecoverageasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new CoverageSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `partialConfig`: [CoverageSubproviderPartialConfig](#class-coveragesubprovider)*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:44](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L44)*
|
||||
|
||||
Instantiates a CoverageSubprovider instance
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Default | Description |
|
||||
------ | ------ | ------ | ------ |
|
||||
`artifactAdapter` | `AbstractArtifactAdapter` | - | Adapter for used artifacts format (0x, truffle, giveth, etc.) |
|
||||
`defaultFromAddress` | string | - | default from address to use when sending transactions |
|
||||
`partialConfig` | [CoverageSubproviderPartialConfig](#coveragesubproviderpartialconfig) | {} | Partial configuration object |
|
||||
|
||||
**Returns:** *[CoverageSubprovider](#class-coveragesubprovider)*
|
||||
|
||||
## Methods
|
||||
|
||||
### emitPayloadAsync
|
||||
|
||||
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/subproviders/lib/src/subproviders/subprovider.d.ts:25
|
||||
|
||||
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`, `_end`: `ErrorCallback`): *`Promise<void>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
||||
|
||||
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` | Callback to call if this subprovider decides not to handle the request |
|
||||
`_end` | `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 void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
||||
|
||||
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*
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
|
||||
▸ **start**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
||||
|
||||
Starts trace collection
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
|
||||
▸ **stop**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
||||
|
||||
Stops trace collection
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### writeCoverageAsync
|
||||
|
||||
▸ **writeCoverageAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:78](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L78)*
|
||||
|
||||
Write the test coverage results to a file in Istanbul format.
|
||||
|
||||
**Returns:** *`Promise<void>`*
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: CoverageSubproviderConfig
|
||||
|
||||
This type defines the schema of the config object that could be passed to CoverageSubprovider
|
||||
isVerbose: If true - will log any unknown transactions. Defaults to true.
|
||||
ignoreFilesGlobs: The list of globs matching the file names of the files we want to ignore coverage for. Defaults to [].
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* **CoverageSubproviderConfig**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [ignoreFilesGlobs](#ignorefilesglobs)
|
||||
* [isVerbose](#isverbose)
|
||||
|
||||
## Properties
|
||||
|
||||
### ignoreFilesGlobs
|
||||
|
||||
• **ignoreFilesGlobs**: *string[]*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:28](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L28)*
|
||||
|
||||
___
|
||||
|
||||
### isVerbose
|
||||
|
||||
• **isVerbose**: *boolean*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L27)*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [coverage_subprovider](modules/_coverage_subprovider_.md)
|
||||
* [coverage_subprovider.CoverageSubprovider](#class-coveragesubprovider)
|
||||
* [coverage_subprovider.CoverageSubproviderConfig](#class-coveragesubproviderconfig)
|
||||
* [index](modules/_index_.md)
|
||||
* [Classes]()
|
||||
* [coverage_subprovider.CoverageSubprovider](#class-coveragesubprovider)
|
||||
* [Interfaces]()
|
||||
* [coverage_subprovider.CoverageSubproviderConfig](#class-coveragesubproviderconfig)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,38 +1,24 @@
|
||||
> # Class: CoverageSubprovider
|
||||
# Class: CoverageSubprovider
|
||||
|
||||
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
||||
It's used to compute your code coverage while running solidity tests.
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* `TraceInfoSubprovider`
|
||||
|
||||
* **CoverageSubprovider**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
## constructer
|
||||
|
||||
### Methods
|
||||
|
||||
* [emitPayloadAsync](#emitpayloadasync)
|
||||
* [handleRequest](#handlerequest)
|
||||
* [setEngine](#setengine)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
* [writeCoverageAsync](#writecoverageasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new CoverageSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `partialConfig`: [CoverageSubproviderPartialConfig](#class-coveragesubprovider)*
|
||||
\+ **new CoverageSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `partialConfig`: [CoverageSubproviderPartialConfig](#coveragesubproviderpartialconfig)): *[CoverageSubprovider](#class-coveragesubprovider)*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:44](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L44)*
|
||||
*Defined in [coverage_subprovider.ts:44](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-coverage/src/coverage_subprovider.ts#L44)*
|
||||
|
||||
Instantiates a CoverageSubprovider instance
|
||||
|
||||
@@ -46,15 +32,15 @@ Name | Type | Default | Description |
|
||||
|
||||
**Returns:** *[CoverageSubprovider](#class-coveragesubprovider)*
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### emitPayloadAsync
|
||||
## emitPayloadAsync
|
||||
|
||||
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/subproviders/lib/src/subproviders/subprovider.d.ts:25
|
||||
|
||||
|
||||
|
||||
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
|
||||
@@ -72,15 +58,15 @@ JSON RPC response payload
|
||||
|
||||
___
|
||||
|
||||
### handleRequest
|
||||
## handleRequest
|
||||
|
||||
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: `NextCallback`, `_end`: `ErrorCallback`): *`Promise<void>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
||||
|
||||
|
||||
This method conforms to the web3-provider-engine interface.
|
||||
It is called internally by the ProviderEngine when it is this subproviders
|
||||
@@ -98,15 +84,15 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### setEngine
|
||||
## setEngine
|
||||
|
||||
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
||||
|
||||
|
||||
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
|
||||
@@ -122,13 +108,13 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
## start
|
||||
|
||||
▸ **start**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
||||
|
||||
|
||||
|
||||
Starts trace collection
|
||||
|
||||
@@ -136,13 +122,13 @@ Starts trace collection
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
## stop
|
||||
|
||||
▸ **stop**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
||||
|
||||
|
||||
|
||||
Stops trace collection
|
||||
|
||||
@@ -150,11 +136,11 @@ Stops trace collection
|
||||
|
||||
___
|
||||
|
||||
### writeCoverageAsync
|
||||
## writeCoverageAsync
|
||||
|
||||
▸ **writeCoverageAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:78](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L78)*
|
||||
*Defined in [coverage_subprovider.ts:78](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-coverage/src/coverage_subprovider.ts#L78)*
|
||||
|
||||
Write the test coverage results to a file in Istanbul format.
|
||||
|
||||
@@ -162,51 +148,32 @@ Write the test coverage results to a file in Istanbul format.
|
||||
|
||||
<hr />
|
||||
|
||||
> # Interface: CoverageSubproviderConfig
|
||||
# Interface: CoverageSubproviderConfig
|
||||
|
||||
This type defines the schema of the config object that could be passed to CoverageSubprovider
|
||||
isVerbose: If true - will log any unknown transactions. Defaults to true.
|
||||
ignoreFilesGlobs: The list of globs matching the file names of the files we want to ignore coverage for. Defaults to [].
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* **CoverageSubproviderConfig**
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [ignoreFilesGlobs](#ignorefilesglobs)
|
||||
* [isVerbose](#isverbose)
|
||||
|
||||
## Properties
|
||||
|
||||
### ignoreFilesGlobs
|
||||
## ignoreFilesGlobs
|
||||
|
||||
• **ignoreFilesGlobs**: *string[]*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:28](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L28)*
|
||||
*Defined in [coverage_subprovider.ts:28](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-coverage/src/coverage_subprovider.ts#L28)*
|
||||
|
||||
___
|
||||
|
||||
### isVerbose
|
||||
## isVerbose
|
||||
|
||||
• **isVerbose**: *boolean*
|
||||
|
||||
*Defined in [coverage_subprovider.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-coverage/src/coverage_subprovider.ts#L27)*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [coverage_subprovider](modules/_coverage_subprovider_.md)
|
||||
* [coverage_subprovider.CoverageSubprovider](#class-coveragesubprovider)
|
||||
* [coverage_subprovider.CoverageSubproviderConfig](#class-coveragesubproviderconfig)
|
||||
* [index](modules/_index_.md)
|
||||
* [Classes]()
|
||||
* [coverage_subprovider.CoverageSubprovider](#class-coveragesubprovider)
|
||||
* [Interfaces]()
|
||||
* [coverage_subprovider.CoverageSubproviderConfig](#class-coveragesubproviderconfig)
|
||||
*Defined in [coverage_subprovider.ts:27](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-coverage/src/coverage_subprovider.ts#L27)*
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
## @0x/sol-profiler
|
||||
|
||||
Solidity line-by-line gas profiler.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-profiler).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/sol-profiler
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```javascript
|
||||
import { ProfilerSubprovider } from '@0x/sol-profiler';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var ProfilerSubprovider = require('@0x/sol-profiler').ProfilerSubprovider;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-profiler yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-profiler yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
@@ -1,175 +0,0 @@
|
||||
> # Class: ProfilerSubprovider
|
||||
|
||||
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
||||
ProfilerSubprovider is used to profile Solidity code while running tests.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* `TraceInfoSubprovider`
|
||||
|
||||
* **ProfilerSubprovider**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [emitPayloadAsync](#emitpayloadasync)
|
||||
* [handleRequest](#handlerequest)
|
||||
* [setEngine](#setengine)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
* [writeProfilerOutputAsync](#writeprofileroutputasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new ProfilerSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `isVerbose`: boolean): *[ProfilerSubprovider](#class-profilersubprovider)*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
*Defined in [profiler_subprovider.ts:30](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-profiler/src/profiler_subprovider.ts#L30)*
|
||||
|
||||
Instantiates a ProfilerSubprovider instance
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Default | Description |
|
||||
------ | ------ | ------ | ------ |
|
||||
`artifactAdapter` | `AbstractArtifactAdapter` | - | Adapter for used artifacts format (0x, truffle, giveth, etc.) |
|
||||
`defaultFromAddress` | string | - | default from address to use when sending transactions |
|
||||
`isVerbose` | boolean | true | If true, we will log any unknown transactions. Otherwise we will ignore them |
|
||||
|
||||
**Returns:** *[ProfilerSubprovider](#class-profilersubprovider)*
|
||||
|
||||
## Methods
|
||||
|
||||
### emitPayloadAsync
|
||||
|
||||
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/subproviders/lib/src/subproviders/subprovider.d.ts:25
|
||||
|
||||
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`, `_end`: `ErrorCallback`): *`Promise<void>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
||||
|
||||
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` | Callback to call if this subprovider decides not to handle the request |
|
||||
`_end` | `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 void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
||||
|
||||
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*
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
|
||||
▸ **start**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
||||
|
||||
Starts trace collection
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
|
||||
▸ **stop**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
||||
|
||||
Stops trace collection
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### writeProfilerOutputAsync
|
||||
|
||||
▸ **writeProfilerOutputAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [profiler_subprovider.ts:104](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-profiler/src/profiler_subprovider.ts#L104)*
|
||||
|
||||
Write the test profiler results to a file in Istanbul format.
|
||||
|
||||
**Returns:** *`Promise<void>`*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [cost_utils](modules/_cost_utils_.md)
|
||||
* [index](modules/_index_.md)
|
||||
* [profiler_subprovider](modules/_profiler_subprovider_.md)
|
||||
* [profiler_subprovider.ProfilerSubprovider](#class-profilersubprovider)
|
||||
* [Classes]()
|
||||
* [profiler_subprovider.ProfilerSubprovider](#class-profilersubprovider)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,38 +1,24 @@
|
||||
> # Class: ProfilerSubprovider
|
||||
# Class: ProfilerSubprovider
|
||||
|
||||
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
||||
ProfilerSubprovider is used to profile Solidity code while running tests.
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* `TraceInfoSubprovider`
|
||||
|
||||
* **ProfilerSubprovider**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [emitPayloadAsync](#emitpayloadasync)
|
||||
* [handleRequest](#handlerequest)
|
||||
* [setEngine](#setengine)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
* [writeProfilerOutputAsync](#writeprofileroutputasync)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
## constructer
|
||||
|
||||
\+ **new ProfilerSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `isVerbose`: boolean): *[ProfilerSubprovider](#class-profilersubprovider)*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
*Defined in [profiler_subprovider.ts:30](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-profiler/src/profiler_subprovider.ts#L30)*
|
||||
*Defined in [profiler_subprovider.ts:30](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-profiler/src/profiler_subprovider.ts#L30)*
|
||||
|
||||
Instantiates a ProfilerSubprovider instance
|
||||
|
||||
@@ -46,15 +32,15 @@ Name | Type | Default | Description |
|
||||
|
||||
**Returns:** *[ProfilerSubprovider](#class-profilersubprovider)*
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### emitPayloadAsync
|
||||
## emitPayloadAsync
|
||||
|
||||
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/subproviders/lib/src/subproviders/subprovider.d.ts:25
|
||||
|
||||
|
||||
|
||||
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
|
||||
@@ -72,15 +58,15 @@ JSON RPC response payload
|
||||
|
||||
___
|
||||
|
||||
### handleRequest
|
||||
## handleRequest
|
||||
|
||||
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: `NextCallback`, `_end`: `ErrorCallback`): *`Promise<void>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
||||
|
||||
|
||||
This method conforms to the web3-provider-engine interface.
|
||||
It is called internally by the ProviderEngine when it is this subproviders
|
||||
@@ -98,15 +84,15 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### setEngine
|
||||
## setEngine
|
||||
|
||||
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
||||
|
||||
|
||||
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
|
||||
@@ -122,13 +108,13 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
## start
|
||||
|
||||
▸ **start**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
||||
|
||||
|
||||
|
||||
Starts trace collection
|
||||
|
||||
@@ -136,13 +122,13 @@ Starts trace collection
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
## stop
|
||||
|
||||
▸ **stop**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
||||
|
||||
|
||||
|
||||
Stops trace collection
|
||||
|
||||
@@ -150,11 +136,11 @@ Stops trace collection
|
||||
|
||||
___
|
||||
|
||||
### writeProfilerOutputAsync
|
||||
## writeProfilerOutputAsync
|
||||
|
||||
▸ **writeProfilerOutputAsync**(): *`Promise<void>`*
|
||||
|
||||
*Defined in [profiler_subprovider.ts:104](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-profiler/src/profiler_subprovider.ts#L104)*
|
||||
*Defined in [profiler_subprovider.ts:104](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-profiler/src/profiler_subprovider.ts#L104)*
|
||||
|
||||
Write the test profiler results to a file in Istanbul format.
|
||||
|
||||
@@ -162,14 +148,3 @@ Write the test profiler results to a file in Istanbul format.
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [cost_utils](modules/_cost_utils_.md)
|
||||
* [index](modules/_index_.md)
|
||||
* [profiler_subprovider](modules/_profiler_subprovider_.md)
|
||||
* [profiler_subprovider.ProfilerSubprovider](#class-profilersubprovider)
|
||||
* [Classes]()
|
||||
* [profiler_subprovider.ProfilerSubprovider](#class-profilersubprovider)
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
## @0x/sol-trace
|
||||
|
||||
Prints a stack trace when a revert is encountered.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-trace).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/sol-trace
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```javascript
|
||||
import { RevertTraceSubprovider } from '@0x/sol-trace';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var RevertTraceSubprovider = require('@0x/sol-trace').RevertTraceSubprovider;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-trace yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/sol-trace yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
@@ -1,161 +0,0 @@
|
||||
> # Class: RevertTraceSubprovider
|
||||
|
||||
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
||||
It is used to report call stack traces whenever a revert occurs.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
* `TraceCollectionSubprovider`
|
||||
|
||||
* **RevertTraceSubprovider**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [emitPayloadAsync](#emitpayloadasync)
|
||||
* [handleRequest](#handlerequest)
|
||||
* [setEngine](#setengine)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
\+ **new RevertTraceSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `isVerbose`: boolean): *[RevertTraceSubprovider](#class-reverttracesubprovider)*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
*Defined in [revert_trace_subprovider.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-trace/src/revert_trace_subprovider.ts#L27)*
|
||||
|
||||
Instantiates a RevertTraceSubprovider instance
|
||||
|
||||
**Parameters:**
|
||||
|
||||
Name | Type | Default | Description |
|
||||
------ | ------ | ------ | ------ |
|
||||
`artifactAdapter` | `AbstractArtifactAdapter` | - | Adapter for used artifacts format (0x, truffle, giveth, etc.) |
|
||||
`defaultFromAddress` | string | - | default from address to use when sending transactions |
|
||||
`isVerbose` | boolean | true | If true, we will log any unknown transactions. Otherwise we will ignore them |
|
||||
|
||||
**Returns:** *[RevertTraceSubprovider](#class-reverttracesubprovider)*
|
||||
|
||||
## Methods
|
||||
|
||||
### emitPayloadAsync
|
||||
|
||||
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/subproviders/lib/src/subproviders/subprovider.d.ts:25
|
||||
|
||||
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`, `_end`: `ErrorCallback`): *`Promise<void>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
||||
|
||||
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` | Callback to call if this subprovider decides not to handle the request |
|
||||
`_end` | `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 void*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
||||
|
||||
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*
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
|
||||
▸ **start**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
||||
|
||||
Starts trace collection
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
|
||||
▸ **stop**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
||||
|
||||
Stops trace collection
|
||||
|
||||
**Returns:** *void*
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [index](modules/_index_.md)
|
||||
* [revert_trace_subprovider](modules/_revert_trace_subprovider_.md)
|
||||
* [revert_trace_subprovider.RevertTraceSubprovider](#class-reverttracesubprovider)
|
||||
* [Classes]()
|
||||
* [revert_trace_subprovider.RevertTraceSubprovider](#class-reverttracesubprovider)
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1,37 +1,24 @@
|
||||
> # Class: RevertTraceSubprovider
|
||||
# Class: RevertTraceSubprovider
|
||||
|
||||
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
||||
It is used to report call stack traces whenever a revert occurs.
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
* `TraceCollectionSubprovider`
|
||||
|
||||
* **RevertTraceSubprovider**
|
||||
|
||||
## Index
|
||||
|
||||
### Constructors
|
||||
|
||||
* [constructor](#constructor)
|
||||
|
||||
### Methods
|
||||
|
||||
* [emitPayloadAsync](#emitpayloadasync)
|
||||
* [handleRequest](#handlerequest)
|
||||
* [setEngine](#setengine)
|
||||
* [start](#start)
|
||||
* [stop](#stop)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
## constructer
|
||||
|
||||
\+ **new RevertTraceSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `isVerbose`: boolean): *[RevertTraceSubprovider](#class-reverttracesubprovider)*
|
||||
|
||||
*Overrides void*
|
||||
|
||||
*Defined in [revert_trace_subprovider.ts:27](https://github.com/0xProject/0x-monorepo/blob/6dd77d5c8/packages/sol-trace/src/revert_trace_subprovider.ts#L27)*
|
||||
*Defined in [revert_trace_subprovider.ts:27](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-trace/src/revert_trace_subprovider.ts#L27)*
|
||||
|
||||
Instantiates a RevertTraceSubprovider instance
|
||||
|
||||
@@ -45,15 +32,15 @@ Name | Type | Default | Description |
|
||||
|
||||
**Returns:** *[RevertTraceSubprovider](#class-reverttracesubprovider)*
|
||||
|
||||
## Methods
|
||||
### Methods
|
||||
|
||||
### emitPayloadAsync
|
||||
## emitPayloadAsync
|
||||
|
||||
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/subproviders/lib/src/subproviders/subprovider.d.ts:25
|
||||
|
||||
|
||||
|
||||
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
|
||||
@@ -71,15 +58,15 @@ JSON RPC response payload
|
||||
|
||||
___
|
||||
|
||||
### handleRequest
|
||||
## handleRequest
|
||||
|
||||
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: `NextCallback`, `_end`: `ErrorCallback`): *`Promise<void>`*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
||||
|
||||
|
||||
This method conforms to the web3-provider-engine interface.
|
||||
It is called internally by the ProviderEngine when it is this subproviders
|
||||
@@ -97,15 +84,15 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### setEngine
|
||||
## setEngine
|
||||
|
||||
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
|
||||
*Overrides void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
||||
|
||||
|
||||
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
|
||||
@@ -121,13 +108,13 @@ Name | Type | Description |
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
## start
|
||||
|
||||
▸ **start**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
||||
|
||||
|
||||
|
||||
Starts trace collection
|
||||
|
||||
@@ -135,13 +122,13 @@ Starts trace collection
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
## stop
|
||||
|
||||
▸ **stop**(): *void*
|
||||
|
||||
*Inherited from void*
|
||||
|
||||
Defined in /Users/rickmorty/Documents/projects/0x/0x-monorepo/packages/sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
||||
|
||||
|
||||
|
||||
Stops trace collection
|
||||
|
||||
@@ -149,13 +136,3 @@ Stops trace collection
|
||||
|
||||
<hr />
|
||||
|
||||
* [Globals](globals.md)
|
||||
* [External Modules]()
|
||||
* [index](modules/_index_.md)
|
||||
* [revert_trace_subprovider](modules/_revert_trace_subprovider_.md)
|
||||
* [revert_trace_subprovider.RevertTraceSubprovider](#class-reverttracesubprovider)
|
||||
* [Classes]()
|
||||
* [revert_trace_subprovider.RevertTraceSubprovider](#class-reverttracesubprovider)
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
## @0x/subproviders
|
||||
|
||||
A few useful web3 subproviders including a LedgerSubprovider useful for adding Ledger Nano S support.
|
||||
|
||||
We have written up a [Wiki](https://0xproject.com/wiki#Web3-Provider-Examples) article detailing some use cases of this subprovider package.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/subproviders).
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
yarn add @0x/subproviders
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/subproviders yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/subproviders yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run tests
|
||||
|
||||
#### Unit tests
|
||||
|
||||
```bash
|
||||
yarn run test:unit
|
||||
```
|
||||
|
||||
#### Integration tests
|
||||
|
||||
In order to run the integration tests, make sure you have a Ledger Nano S available.
|
||||
|
||||
- Setup your Ledger with the development mnemonic seed: `concert load couple harbor equip island argue ramp clarify fence smart topic`
|
||||
- Plug it into your computer
|
||||
- Unlock the device
|
||||
- Open the on-device Ethereum app
|
||||
- Make sure "browser support" and "contract data" are disabled
|
||||
- Start [TestRPC](https://github.com/trufflesuite/ganache-cli) locally at port `8545`
|
||||
|
||||
Then run:
|
||||
|
||||
```
|
||||
yarn test:integration
|
||||
```
|
||||
|
||||
**Note:** We assume a derivation path of `m/44'/60'/0'/0` which is already configured in the tests. With this setup and derivation path, your first account should be `0x5409ed021d9299bf6814279a6a1411a7e866a631`, exactly like TestRPC.
|
||||
|
||||
#### All tests
|
||||
|
||||
```bash
|
||||
yarn run test:all
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,71 +0,0 @@
|
||||
## @0x/web3-wrapper
|
||||
|
||||
Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternative to [Web3.js](https://github.com/ethereum/web3.js/) written in TypeScript.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/web3-wrapper).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @0x/web3-wrapper
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
|
||||
```json
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
|
||||
|
||||
```bash
|
||||
PKG=@0x/web3-wrapper yarn build
|
||||
```
|
||||
|
||||
Or continuously rebuild on change:
|
||||
|
||||
```bash
|
||||
PKG=@0x/web3-wrapper yarn watch
|
||||
```
|
||||
|
||||
### Clean
|
||||
|
||||
```bash
|
||||
yarn clean
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Run Tests
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -107,11 +107,11 @@ async function processMdxAsync(algoliaIndex: any, file: File, indexName: string)
|
||||
await remark()
|
||||
.use(slug) // slugify heading text as ids
|
||||
.use(mdx)
|
||||
.use(() => (tree: Node[]) => processContentTree(tree, file, algoliaIndex, indexName))
|
||||
.use(() => async (tree: Node[]) => { await processContentTreeAsync(tree, file, algoliaIndex, indexName); })
|
||||
.process(content);
|
||||
}
|
||||
|
||||
function processContentTree(tree: Node[], file: File, algoliaIndex: any, indexName: string): void {
|
||||
async function processContentTreeAsync(tree: Node[], file: File, algoliaIndex: any, indexName: string): Promise<void> {
|
||||
const modify = modifyChildren(modifier);
|
||||
// We first modify the tree to get slugified ids from headings to all text nodes
|
||||
// This is done to be able to link to a certain section in a doc after clicking a search suggestion
|
||||
@@ -127,7 +127,7 @@ function processContentTree(tree: Node[], file: File, algoliaIndex: any, indexNa
|
||||
// Adds meta and formats information on all formatted text nodes
|
||||
const content = getContent(file, formattedTextNodes, indexName);
|
||||
|
||||
void pushObjectsToAlgoliaAsync(algoliaIndex, content);
|
||||
await pushObjectsToAlgoliaAsync(algoliaIndex, content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
"tags": ["Trader", "Protocol Developer"],
|
||||
"type": "Typescript Libraries",
|
||||
"path": "tools/@0x/asset-swapper/v1.0.1/reference.mdx",
|
||||
"versions": ["v1.0.1", "v1.0.0"]
|
||||
"versions": ["v1.0.1"]
|
||||
},
|
||||
"0x-js": {
|
||||
"title": "0x.js",
|
||||
@@ -110,7 +110,7 @@
|
||||
"tags": ["Trader", "Relayer"],
|
||||
"type": "Typescript Libraries",
|
||||
"path": "tools/@0x/connect/v5.0.16/reference.mdx",
|
||||
"versions": ["v5.0.16", "v5.0.15"]
|
||||
"versions": ["v5.0.16"]
|
||||
},
|
||||
"subproviders": {
|
||||
"title": "@0x/subproviders",
|
||||
@@ -122,7 +122,7 @@
|
||||
"tags": ["Relayer", "Trader"],
|
||||
"type": "Typescript Libraries",
|
||||
"path": "tools/@0x/subproviders/v5.0.1/reference.mdx",
|
||||
"versions": ["v5.0.1", "v5.0.0"]
|
||||
"versions": ["v5.0.1"]
|
||||
},
|
||||
"asset-buyer": {
|
||||
"title": "@0x/asset-buyer",
|
||||
@@ -134,7 +134,7 @@
|
||||
"tags": ["Trader", "Protocol Developer"],
|
||||
"type": "Typescript Libraries",
|
||||
"path": "tools/@0x/asset-buyer/v6.1.11/reference.mdx",
|
||||
"versions": ["v6.1.11", "v6.1.10"],
|
||||
"versions": ["v6.1.11"],
|
||||
"isHidden": true
|
||||
},
|
||||
"ethereum-types": {
|
||||
@@ -161,7 +161,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/contract-wrappers/v11.0.0/reference.mdx",
|
||||
"versions": ["v11.0.0", "v10.1.0"]
|
||||
"versions": ["v11.0.0"]
|
||||
},
|
||||
"json-schemas": {
|
||||
"title": "@0x/json-schemas",
|
||||
@@ -174,7 +174,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/json-schemas/v3.1.13/reference.mdx",
|
||||
"versions": ["v3.1.13", "v3.1.12"]
|
||||
"versions": ["v3.1.13"]
|
||||
},
|
||||
"order-utils": {
|
||||
"title": "@0x/order-utils",
|
||||
@@ -187,7 +187,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/order-utils/v8.2.5/reference.mdx",
|
||||
"versions": ["v8.2.5", "v8.2.4"]
|
||||
"versions": ["v8.2.5"]
|
||||
},
|
||||
"sol-compiler": {
|
||||
"title": "@0x/sol-compiler",
|
||||
@@ -200,7 +200,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/sol-compiler/v3.1.12/reference.mdx",
|
||||
"versions": ["v3.1.12", "v3.1.11"]
|
||||
"versions": ["v3.1.12"]
|
||||
},
|
||||
"sol-coverage": {
|
||||
"title": "@0x/sol-coverage",
|
||||
@@ -213,7 +213,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/sol-coverage/v3.0.9/reference.mdx",
|
||||
"versions": ["v3.0.9", "v3.0.8"]
|
||||
"versions": ["v3.0.9"]
|
||||
},
|
||||
"sol-profiler": {
|
||||
"title": "@0x/sol-profiler",
|
||||
@@ -226,7 +226,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/sol-profiler/v3.1.11/reference.mdx",
|
||||
"versions": ["v3.1.11", "v3.1.10"]
|
||||
"versions": ["v3.1.11"]
|
||||
},
|
||||
"sol-trace": {
|
||||
"title": "@0x/sol-trace",
|
||||
@@ -239,7 +239,7 @@
|
||||
"type": "Typescript Libraries",
|
||||
"isHidden": true,
|
||||
"path": "tools/@0x/sol-trace/v2.0.17/reference.mdx",
|
||||
"versions": ["v2.0.17", "v2.0.16"]
|
||||
"versions": ["v2.0.17"]
|
||||
},
|
||||
"web3-wrapper": {
|
||||
"title": "@0x/web3-wrapper",
|
||||
@@ -423,7 +423,7 @@
|
||||
"tags": ["Protocol Developer", "Relayer"],
|
||||
"type": "Command-line tool",
|
||||
"path": "tools/@0x/migrations/v4.2.0/reference.mdx",
|
||||
"versions": ["v4.2.0", "v4.1.11"]
|
||||
"versions": ["v4.2.0"]
|
||||
},
|
||||
"launch-kit-wizard": {
|
||||
"title": "@0x/launch-kit-wizard",
|
||||
@@ -459,4 +459,4 @@
|
||||
"externalUrl": "https://github.com/0xProject/0x-coordinator-server"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user