Fix all /docs/{pkg} links to /docs/tools/{pkg}
This commit is contained in:
@@ -18,7 +18,7 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
|
||||
|
||||
## Usage
|
||||
|
||||
- [Docs](https://0xproject.com/docs/connect)
|
||||
- [Docs](https://0xproject.com/docs/tools/connect)
|
||||
- [Tutorials](https://0x.org/docs/guides/using-the-standard-relayer-api)
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ContextInterface } from './index';
|
||||
export const context: ContextInterface = {
|
||||
title: 'sol-compiler',
|
||||
name: 'compiler',
|
||||
docLink: 'https://0x.org/docs/sol-compiler',
|
||||
docLink: 'https://0x.org/docs/tools/sol-compiler',
|
||||
subtitle: 'Solidity compilation that just works',
|
||||
tagline: 'Seamlessly compile an entire solidity project and generate customisable artifacts',
|
||||
icon: Icon,
|
||||
|
||||
@@ -6,7 +6,7 @@ export const context: ContextInterface = {
|
||||
title: 'sol-coverage',
|
||||
name: 'coverage',
|
||||
subtitle: 'Solidity code coverage',
|
||||
docLink: 'https://0x.org/docs/sol-coverage',
|
||||
docLink: 'https://0x.org/docs/tools/sol-coverage',
|
||||
tagline: 'Measure Solidity code coverage',
|
||||
icon: Icon,
|
||||
colors: {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ContextInterface } from './index';
|
||||
export const context: ContextInterface = {
|
||||
title: 'sol-profiler',
|
||||
name: 'profiler',
|
||||
docLink: 'https://0x.org/docs/sol-profiler',
|
||||
docLink: 'https://0x.org/docs/tools/sol-profiler',
|
||||
subtitle: 'Gas profiling for Solidity',
|
||||
tagline: "Implement data-guided optimizations by profiling your contract's gas usage",
|
||||
icon: Icon,
|
||||
|
||||
@@ -6,7 +6,7 @@ export const context: ContextInterface = {
|
||||
title: 'sol-trace',
|
||||
name: 'trace',
|
||||
subtitle: 'Human-readable stack traces',
|
||||
docLink: 'https://0x.org/docs/sol-trace',
|
||||
docLink: 'https://0x.org/docs/tools/sol-trace',
|
||||
tagline: 'Immediately locate Solidity errors and rapidly debug failed transactions',
|
||||
icon: Icon,
|
||||
colors: {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Contains 0x-related json schemas
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/json-schemas).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/json-schemas).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ async function confirmDocPagesRenderAsync(packagesWithDocs: Package[]): Promise<
|
||||
_.each(packagesWithDocs, pkg => {
|
||||
const name = pkg.packageJson.name;
|
||||
const nameWithoutPrefix = _.startsWith(name, NPM_NAMESPACE) ? name.split('@0x/')[1] : name;
|
||||
const link = `${constants.stagingWebsite}/docs/${nameWithoutPrefix}`;
|
||||
const link = `${constants.stagingWebsite}/docs/tools/${nameWithoutPrefix}`;
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
opn(link);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
0x order-related utilities for those developing on top of 0x protocol.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/order-utils).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/order-utils).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Sol-compiler is a wrapper around [solc-js](https://www.npmjs.com/package/solc) t
|
||||
- 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).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/sol-compiler).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A Solidity code coverage tool.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-coverage).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/sol-coverage).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Solidity line-by-line gas profiler.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-profiler).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/sol-profiler).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Prints a stack trace when a revert is encountered.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-trace).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/sol-trace).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export const api: OpenApiSpec = {
|
||||
{
|
||||
name: 'makerAssetProxyId',
|
||||
in: 'query',
|
||||
description: `The maker [asset proxy id](https://0xproject.com/docs/0x.js#types-AssetProxyId) (example: "0xf47261b0" for ERC20, "0x02571792" for ERC721).`,
|
||||
description: `The maker asset proxy id (example: "0xf47261b0" for ERC20, "0x02571792" for ERC721).`,
|
||||
example: '0xf47261b0',
|
||||
schema: {
|
||||
$ref: '#/components/schemas/hexSchema',
|
||||
@@ -72,7 +72,7 @@ export const api: OpenApiSpec = {
|
||||
{
|
||||
name: 'takerAssetProxyId',
|
||||
in: 'query',
|
||||
description: `The taker asset [asset proxy id](https://0xproject.com/docs/0x.js#types-AssetProxyId) (example: "0xf47261b0" for ERC20, "0x02571792" for ERC721).`,
|
||||
description: `The taker asset asset proxy id (example: "0xf47261b0" for ERC20, "0x02571792" for ERC721).`,
|
||||
example: '0x02571792',
|
||||
schema: {
|
||||
$ref: '#/components/schemas/hexSchema',
|
||||
|
||||
@@ -169,7 +169,7 @@ Validation error codes:
|
||||
|
||||
# Asset Data Encoding
|
||||
|
||||
As we now support multiple [token transfer proxies](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy), the identifier of which proxy to use for the token transfer must be encoded, along with the token information. Each proxy in 0x v2 has a unique identifier. If you're using 0x.js there will be helper methods for this [encoding](https://0xproject.com/docs/0x.js#zeroEx-encodeERC20AssetData) and [decoding](https://0xproject.com/docs/0x.js#zeroEx-decodeAssetProxyId).
|
||||
As we now support multiple [token transfer proxies](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy), the identifier of which proxy to use for the token transfer must be encoded, along with the token information. Each proxy in 0x v2 has a unique identifier. If you're using 0x.js there will be helper methods for this encoding and decoding.
|
||||
|
||||
The identifier for the Proxy uses a similar scheme to [ABI function selectors](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI#function-selector).
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ A few useful web3 subproviders including a LedgerSubprovider useful for adding L
|
||||
|
||||
We have written up a [guide](https://0x.org/docs/guides/web3-provider-explained#web3-provider-examples) article detailing some use cases of this subprovider package.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/subproviders).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/subproviders).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
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).
|
||||
### Read the [Documentation](https://0xproject.com/docs/tools/web3-wrapper).
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ Every Ethereum node exposes an API that let's the outside world interact with it
|
||||
- [Ethers.js](https://github.com/ethers-io/ethers.js/) (Typescript/Javascript)
|
||||
- [Web3.j](https://github.com/web3j/web3j) (Java)
|
||||
|
||||
In addition to being the API for interacting with Ethereum nodes, Ethereum JSON-RPC has also become the interface through which 0x libraries interact with Ethereum nodes and signers. Many of our methods and classes will require that you pass in a "provider", which is an instance of a class that exposes a single method through which JSON-RPC requests can be made. JSON-RPC requests that interact with the Ethereum network such as [eth_sendTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendTransaction) will get proxied through the provider to an Ethereum node, however requests to sign a transaction such as [eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign) can be sent to any signer you desire (e.g., [Metamask](https://metamask.io/), [Coinbase wallet](https://wallet.coinbase.com/), a [Ledger hardware wallet](https://www.ledger.com/), a private key signer, a mnemonic signer, etc...). Typescript developers can use the [@0x/subproviders](https://0x.org/docs/subproviders) library to construct a provider, and Python developers can use [0x-middlewares](https://github.com/0xProject/0x-monorepo/tree/development/python-packages/middlewares).
|
||||
In addition to being the API for interacting with Ethereum nodes, Ethereum JSON-RPC has also become the interface through which 0x libraries interact with Ethereum nodes and signers. Many of our methods and classes will require that you pass in a "provider", which is an instance of a class that exposes a single method through which JSON-RPC requests can be made. JSON-RPC requests that interact with the Ethereum network such as [eth_sendTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendTransaction) will get proxied through the provider to an Ethereum node, however requests to sign a transaction such as [eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign) can be sent to any signer you desire (e.g., [Metamask](https://metamask.io/), [Coinbase wallet](https://wallet.coinbase.com/), a [Ledger hardware wallet](https://www.ledger.com/), a private key signer, a mnemonic signer, etc...). Typescript developers can use the [@0x/subproviders](https://0x.org/docs/tools/subproviders) library to construct a provider, and Python developers can use [0x-middlewares](https://github.com/0xProject/0x-monorepo/tree/development/python-packages/middlewares).
|
||||
|
||||
### Interacting with 0x on Ethereum
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ The 0x Core team have deployed the Forwarder contract on all networks, though th
|
||||
**Related Links**
|
||||
|
||||
- [0x Instant](https://0x.org/instant)
|
||||
- [AssetBuyer](https://0x.org/docs/asset-buyer)
|
||||
- [AssetBuyer](https://0x.org/docs/tools/asset-buyer)
|
||||
- [0x Starter Project](https://github.com/0xProject/0x-starter-project/blob/master/src/scenarios/forwarder_buy_erc20_tokens.ts#L19)
|
||||
- [Forwarder Source Code](https://github.com/0xProject/0x-monorepo/blob/development/contracts/exchange-forwarder/contracts/src/MixinForwarderCore.sol)
|
||||
|
||||
@@ -41,7 +41,7 @@ The 0x Core team have deployed the Forwarder contract on all networks, though th
|
||||
|
||||
The price of an asset decreases over time and the buyer submits a matching order when they believe the asset is appropriately priced. The Dutch Auction contract guarantees the asset is exchanged for the current price, given the block time. The Dutch Auction contract is an example of an extension which validates some state before matching two orders.
|
||||
|
||||
The Dutch Auction contract is powered by the 0x Exchange contracts [matchOrders function](https://0x.org/docs/contracts#Exchange-matchOrders) and extends the order format to include additional data. When using match orders, two orders are passed in as parameters, known as the sell order and the buy order. The seller of the asset creates an order for the asset at the lowest price. When a buyer decides the asset is at an acceptable price, they create a matching order for that amount. The buyer submits both the sell order and the buy order to the Dutch Auction contract.
|
||||
The Dutch Auction contract is powered by the 0x Exchange contracts `matchOrders` function and extends the order format to include additional data. When using match orders, two orders are passed in as parameters, known as the sell order and the buy order. The seller of the asset creates an order for the asset at the lowest price. When a buyer decides the asset is at an acceptable price, they create a matching order for that amount. The buyer submits both the sell order and the buy order to the Dutch Auction contract.
|
||||
|
||||
<img width="825" src="https://user-images.githubusercontent.com/27389/53460197-4a2c1e00-3a0a-11e9-9cbe-1a143d31cd01.png" />
|
||||
|
||||
@@ -55,7 +55,7 @@ The Dutch Auction encodes additional parameters into the maker asset data, param
|
||||
|
||||
<img width="624" src="https://user-images.githubusercontent.com/27389/53460005-99be1a00-3a09-11e9-8f6b-d446672887f7.png" />
|
||||
|
||||
Encoding of the additional parameters is provided on the [Dutch Auction contract wrapper](https://0x.org/docs/contract-wrappers#DutchAuctionWrapper-encodeDutchAuctionAssetData).
|
||||
Encoding of the additional parameters is provided on the [Dutch Auction contract wrapper](https://0x.org/docs/tools/contract-wrappers#DutchAuctionWrapper-encodeDutchAuctionAssetData).
|
||||
|
||||
```typescript
|
||||
// Additional data is encoded in the maker asset data, this includes the begin time and begin amount
|
||||
@@ -100,7 +100,7 @@ require(isWhitelisted[takerAddress], 'TAKER_NOT_WHITELISTED');
|
||||
EXCHANGE.executeTransaction(salt, signerAddress, signedExchangeTransaction, signature);
|
||||
```
|
||||
|
||||
In order to implement an on-chain whitelist, the contract would first query if the user is present in a list, if the user is present then the 0x transaction is executed. Our contract wrappers package exposes a [transaction encoder](https://0x.org/docs/contract-wrappers#TransactionEncoder) to encode 0x transactions. An detailed example of encoding and executing 0x transactions can be found in our [0x-starter-project](https://github.com/0xProject/0x-starter-project/blob/master/src/scenarios/execute_transaction.ts#L20).
|
||||
In order to implement an on-chain whitelist, the contract would first query if the user is present in a list, if the user is present then the 0x transaction is executed. Our contract wrappers package exposes a [transaction encoder](https://0x.org/docs/tools/contract-wrappers#TransactionEncoder) to encode 0x transactions. An detailed example of encoding and executing 0x transactions can be found in our [0x-starter-project](https://github.com/0xProject/0x-starter-project/blob/master/src/scenarios/execute_transaction.ts#L20).
|
||||
|
||||
```typescript
|
||||
// The transaction encoder provides helpers in encoding 0x Exchange transactions to allow
|
||||
|
||||
@@ -8,7 +8,7 @@ Check out a live example on [mainnet](http://0x-instant-staging.s3-website-us-ea
|
||||
|
||||
## Libraries
|
||||
|
||||
0x Instant has two main libraries: the `0x Instant UI component` that users will see and the `Asset Buyer` library, a JavaScript / TypeScript library that abstracts out many of the complexities of sourcing orders and performing market buys. Most developers who want to add simple token access will just use the out-of-the-box package that includes the UI and Asset Buyer, but teams may also write their own custom UI and just plug into the Asset Buyer as they see fit. Check out the `@0x/asset-buyer` documentation [here](https://0x.org/docs/asset-buyer).
|
||||
0x Instant has two main libraries: the `0x Instant UI component` that users will see and the `Asset Buyer` library, a JavaScript / TypeScript library that abstracts out many of the complexities of sourcing orders and performing market buys. Most developers who want to add simple token access will just use the out-of-the-box package that includes the UI and Asset Buyer, but teams may also write their own custom UI and just plug into the Asset Buyer as they see fit. Check out the `@0x/asset-buyer` documentation [here](https://0x.org/docs/tools/asset-buyer).
|
||||
|
||||
## Orders
|
||||
|
||||
@@ -55,7 +55,7 @@ Codepen [example](https://codepen.io/bmillman19/pen/qQzQQK)
|
||||
|
||||
| Option | Description |
|
||||
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| orderSource | Accepts either a [Standard Relayer API HTTP endpoint](https://github.com/0xProject/standard-relayer-api/blob/master/http/v2.md) or an array of signed 0x [orders](https://0x.org/docs/order-utils#types-SignedOrder) |
|
||||
| orderSource | Accepts either a [Standard Relayer API HTTP endpoint](https://github.com/0xProject/standard-relayer-api/blob/master/http/v2.md) or an array of signed 0x [orders](https://0x.org/docs/tools/order-utils#types-SignedOrder) |
|
||||
|
||||
## Optional
|
||||
|
||||
@@ -161,7 +161,7 @@ zeroExInstant.render(
|
||||
|
||||
## Providing a Custom Token
|
||||
|
||||
Your token may not be currently supported by Instant by default. Check [here](https://github.com/0xProject/0x-monorepo/blob/development/packages/instant/src/data/asset_meta_data_map.ts) for a list of tokens supported by default. Check "What is assetMetaData?" in [the questions section](#faqs), but teams may optionally source liquidity themselves and pass in specific [SignedOrders](#faqs) for more information about the object being passed in. For the `orderSource` parameter you will likely need to pass in an array of [`SignedOrder`](https://0x.org/docs/order-utils#types-SignedOrder)s, unless you are running your own relayer, or know of a relayer that has liquidity for your custom token.
|
||||
Your token may not be currently supported by Instant by default. Check [here](https://github.com/0xProject/0x-monorepo/blob/development/packages/instant/src/data/asset_meta_data_map.ts) for a list of tokens supported by default. Check "What is assetMetaData?" in [the questions section](#faqs), but teams may optionally source liquidity themselves and pass in specific [SignedOrders](#faqs) for more information about the object being passed in. For the `orderSource` parameter you will likely need to pass in an array of [`SignedOrder`](https://0x.org/docs/tools/order-utils#types-SignedOrder)s, unless you are running your own relayer, or know of a relayer that has liquidity for your custom token.
|
||||
|
||||
```javascript
|
||||
const erc20TokenAddress = '0xe41d2489571d322189246dafa5ebde1f4699f498';
|
||||
@@ -188,7 +188,7 @@ zeroExInstant.render(
|
||||
|
||||
## Providing a NFT / ERC721
|
||||
|
||||
Instant does not come bundled with any NFT data, so you must provide the `additionalAssetMetaDataMap` parameter to make the integration work (Check "What is assetMetaData?" in [the questions section](#faqs), but teams may optionally source liquidity themselves and pass in specific [SignedOrders](#faqs) for more information about the object being passed in.) You must also provide the `defaultSelectedAssetData` parameter to open instant with the NFT you are selling. For the `orderSource` parameter you will likely need to pass in an array of [`SignedOrder`](https://0x.org/docs/order-utils#types-SignedOrder)s, unless you are running your own relayer, or know of a relayer that has liquidity for your custom token.
|
||||
Instant does not come bundled with any NFT data, so you must provide the `additionalAssetMetaDataMap` parameter to make the integration work (Check "What is assetMetaData?" in [the questions section](#faqs), but teams may optionally source liquidity themselves and pass in specific [SignedOrders](#faqs) for more information about the object being passed in.) You must also provide the `defaultSelectedAssetData` parameter to open instant with the NFT you are selling. For the `orderSource` parameter you will likely need to pass in an array of [`SignedOrder`](https://0x.org/docs/tools/order-utils#types-SignedOrder)s, unless you are running your own relayer, or know of a relayer that has liquidity for your custom token.
|
||||
|
||||
```javascript
|
||||
const erc721TokenAddress = '0xf5b0a3efb8e8e4c201e2a935f110eaaf3ffecb8d';
|
||||
@@ -367,7 +367,7 @@ zeroExInstant.render(
|
||||
|
||||
### Q: What is a SignedOrder?
|
||||
|
||||
A SignedOrder is a basic primitive of the 0x protocol. You can think of the SignedOrder as a set of parameters that define the terms of a trade, plus a signature that proves that the creator (also known as the 'maker') of an order has approved the trade. For example, a SignedOrder can specify: address A wants to trade 5 REP tokens in exchange for 1 WETH token. The order also includes signature produced by address A's private key and a hash of the order parameters. For exact JavaScript / TypeScript definition of a SignedOrder, refer to our [docs](https://0x.org/docs/0x.js#types-SignedOrder).
|
||||
A SignedOrder is a basic primitive of the 0x protocol. You can think of the SignedOrder as a set of parameters that define the terms of a trade, plus a signature that proves that the creator (also known as the 'maker') of an order has approved the trade. For example, a SignedOrder can specify: address A wants to trade 5 REP tokens in exchange for 1 WETH token. The order also includes signature produced by address A's private key and a hash of the order parameters. For exact JavaScript / TypeScript definition of a SignedOrder, refer to our [docs](https://github.com/0xProject/0x-monorepo/blob/development/packages/types/src/index.ts#L40).
|
||||
|
||||
### Q: What is the Standard Relayer API?
|
||||
|
||||
@@ -485,7 +485,7 @@ To prevent massive price ranges, 0x Instant calculates a maximum amount of asset
|
||||
|
||||
### Q: Can Instant be used to sell tokens that are not available on a relayer?
|
||||
|
||||
Even if an ERC20 token is not listed on a relayer, 0x Instant can be configured to source liquidity from a static set of orders, by providing an array of [`SignedOrder`](https://0x.org/docs/order-utils#types-SignedOrder)s as the `orderSource`.
|
||||
Even if an ERC20 token is not listed on a relayer, 0x Instant can be configured to source liquidity from a static set of orders, by providing an array of [`SignedOrder`](https://0x.org/docs/tools/order-utils#types-SignedOrder)s as the `orderSource`.
|
||||
|
||||
### Q: How can I get help integrating Instant?
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ In both models, the relayer never has custody over a trader's assets.
|
||||
|
||||
## Creating orders
|
||||
|
||||
0x orders only exist off-chain and are completely free to create. In order to create a valid 0x order, you can use the [@0x/order-utils](https://0xproject.com/docs/order-utils) Typescript/Javascript library, or alternatively the [0x-order-utils.py](http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/) Python library. These libraries will help you:
|
||||
0x orders only exist off-chain and are completely free to create. In order to create a valid 0x order, you can use the [@0x/order-utils](https://0xproject.com/docs/tools/order-utils) Typescript/Javascript library, or alternatively the [0x-order-utils.py](http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/) Python library. These libraries will help you:
|
||||
|
||||
1. Generate an order in the proper format (e.g encoding/decoding [`assetData`](https://0x.org/docs/guides/v2-specification#assetdata))
|
||||
2. Generating a proper hash for the order contents
|
||||
@@ -46,9 +46,9 @@ For a set of scenarios show-casing the above steps, as well as allowance setting
|
||||
|
||||
Note that the `salt` field of an order should be set to the current unix timestamp in milliseconds for full compatibility with the [`cancelOrdersUpTo`](#cancelling-orders) function. For low level details of how an order is created, please reference the [orders](https://0x.org/docs/guides/v2-specification#orders) section of the protocol specification.
|
||||
|
||||
Once you have a valid 0x order, it can be submitted to a relayer. You can use the [POST /v2/order](https://github.com/0xProject/standard-relayer-api/blob/master/http/v2.md#post-v2order) endpoint of the Standard Relayer API for this purpose (see: [submitOrderAsync in 0x Connect](https://0xproject.com/docs/connect#HttpClient-submitOrderAsync)).
|
||||
Once you have a valid 0x order, it can be submitted to a relayer. You can use the [POST /v2/order](https://github.com/0xProject/standard-relayer-api/blob/master/http/v2.md#post-v2order) endpoint of the Standard Relayer API for this purpose (see: [submitOrderAsync in 0x Connect](https://0xproject.com/docs/tools/connect#HttpClient-submitOrderAsync)).
|
||||
|
||||
If you want to be notified whenever the order is filled by a trader, you should also submit the order to an [OrderWatcher](https://0xproject.com/docs/order-watcher) instance you are running.
|
||||
If you want to be notified whenever the order is filled by a trader, you should also submit the order to a [0x Mesh node](https://0x-org.gitbook.io/mesh/) instance you are running.
|
||||
|
||||
## Filling orders
|
||||
|
||||
@@ -96,7 +96,7 @@ Explicitly cancelling orders always requires an on-chain transaction. However, y
|
||||
|
||||
## Fetching off-chain orders
|
||||
|
||||
Since 0x orders live off-chain, they must be fetched from relayers. All relayers host APIs that allow you to pull orders from their orderbook. In order to make life easier for traders, many implement the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/), allowing you to use a single client to fetch orders from multiple relayers. Standard Relayer API clients exist in [Python](https://pypi.org/project/0x-sra-client/) and [Typescript/Javascript](https://0xproject.com/docs/connect).
|
||||
Since 0x orders live off-chain, they must be fetched from relayers. All relayers host APIs that allow you to pull orders from their orderbook. In order to make life easier for traders, many implement the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/), allowing you to use a single client to fetch orders from multiple relayers. Standard Relayer API clients exist in [Python](https://pypi.org/project/0x-sra-client/) and [Typescript/Javascript](https://0xproject.com/docs/tools/connect).
|
||||
|
||||
To learn more about fetching orders from relayers, check out our [How to use the Standard Relayer API tutorial](https://0x.org/docs/guides/using-the-standard-relayer-api).
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ In order to use `CoverageSubprovider` with your favorite framework you need to p
|
||||
|
||||
## Sol-compiler
|
||||
|
||||
If you are generating your artifacts with [@0x/sol-compiler](https://0x.org/docs/sol-compiler) you can use the `SolCompilerArtifactAdapter` we've implemented for you.
|
||||
If you are generating your artifacts with [@0x/sol-compiler](https://0x.org/docs/tools/sol-compiler) you can use the `SolCompilerArtifactAdapter` we've implemented for you.
|
||||
|
||||
```typescript
|
||||
import { SolCompilerArtifactAdapter } from '@0x/sol-coverage';
|
||||
|
||||
@@ -6,7 +6,7 @@ In this tutorial, we will show you how you can use the [@0x/connect](https://git
|
||||
- find the best orders in the orderbook
|
||||
- fill orders from the orderbook using `0x.js`
|
||||
|
||||
You can find all the `@0x/connect` documentation [here](https://0x.org/docs/connect).
|
||||
You can find all the `@0x/connect` documentation [here](https://0x.org/docs/tools/connect).
|
||||
|
||||
You can find a list of relayers that comply with the Standard Relayer API [here](https://github.com/0xProject/0x-relayer-registry)
|
||||
|
||||
@@ -282,7 +282,7 @@ if (response.asks.total === 0) {
|
||||
|
||||
## Filling an order
|
||||
|
||||
`OrderbookResponse` contains two fields, `bids` and `asks`. `Bids` is a [`PaginatedCollection`](https://0x.org/docs/connect#types-PaginatedCollection) of [`APIOrder`](https://0x.org/docs/connect#types-APIOrder)s where for each order, the `makerAssetData` field is equal to the `quoteAssetData` provided by the `OrderbookRequest` and the `takerAssetData` field is equal to `baseAssetData`. `Asks` is the opposite of `bids`. For each order, the `makerAssetData` field is equal to the `baseAssetData` and the `takerAssetData` field is equal to `quoteAssetData`.
|
||||
`OrderbookResponse` contains two fields, `bids` and `asks`. `Bids` is a [`PaginatedCollection`](https://0x.org/docs/tools/connect#types-PaginatedCollection) of [`APIOrder`](https://0x.org/docs/connect#types-APIOrder)s where for each order, the `makerAssetData` field is equal to the `quoteAssetData` provided by the `OrderbookRequest` and the `takerAssetData` field is equal to `baseAssetData`. `Asks` is the opposite of `bids`. For each order, the `makerAssetData` field is equal to the `baseAssetData` and the `takerAssetData` field is equal to `quoteAssetData`.
|
||||
|
||||
The Standard Relayer API guarantees that the orders are sorted by price, and then by _taker fee price_ which is defined as the `takerFee` divided by `takerAmount`. After _taker fee price_, orders are to be sorted by expiration in ascending order.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Many people use browser extension wallets (e.g [Metamask](https://metamask.io/))
|
||||
|
||||
## Updating the provider used by `@0x/contract-wrappers`
|
||||
|
||||
If at some point the provider used by your dApp changes (e.g if your user wants to use their Ledger Nano S to sign orders), it is important that you update the provider used by your `@0x/contract-wrappers`. You can do this by calling [setProvider](https://0x.org/docs/contract-wrappers#ContractWrappers-setProvider).
|
||||
If at some point the provider used by your dApp changes (e.g if your user wants to use their Ledger Nano S to sign orders), it is important that you update the provider used by your `@0x/contract-wrappers`. You can do this by calling [setProvider](https://0x.org/docs/tools/contract-wrappers#ContractWrappers-setProvider).
|
||||
|
||||
```typescript
|
||||
await contractWrappers.setProvider(newProvider, networkId);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import {
|
||||
ArticlesBySection,
|
||||
WebsiteBackendCFLMetricsData,
|
||||
WebsiteBackendGasInfo,
|
||||
WebsiteBackendJobInfo,
|
||||
|
||||
Reference in New Issue
Block a user