You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: mdx/api/index.mdx
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ We offer hosted versions for different Ethereum networks. Requests for more netw
16
16
| Avalanche |https://avalanche.api.0x.org/|
17
17
| Fantom |https://fantom.api.0x.org/|
18
18
| Celo |https://celo.api.0x.org/|
19
+
| Optimism |https://optimism.api.0x.org/|
19
20
20
21
## Versioning
21
22
@@ -58,6 +59,32 @@ And will only document the objects in the `records` field.
58
59
If a query provides an unreasonable (ie. too high) `perPage` value, the response can return a validation error as specified in the [errors section](#errors).
59
60
If the query specifies a `page` that does not exist (ie. there are not enough `records`), the response will return an empty `records` array.
60
61
62
+
63
+
## Allowance Targets
64
+
Some interactions with 0x require or are improved by setting [token allowances](https://tokenallowance.io/), or in other words, giving 0x's smart contracts permission to move certain tokens on your behalf. Some examples include -
65
+
66
+
* Submitting a 0x API quote selling ERC20 tokens, you will need to give an allowance to the contract address. This address can be found either as the value of `allowanceTarget` returned in the quote response or in the ExchangeProxy Address column in the (#addresses by network) table below.
67
+
* Trading ERC20 tokens using the Exchange contract, you will have to give an allowance to the [ERC20Proxy](https://0x.org/docs/guides/v3-specification#assetproxy) contract.
68
+
* Paying protocol fees in WETH, you will need to give a WETH allowance to the [StakingProxy](https://0x.org/docs/guides/v3-staking-specification#architecture)
69
+
***Note:** For swaps with "ETH" as sellToken, wrapping "ETH" to "WETH" or unwrapping "WETH" to "ETH" no allowance is needed, a null address of `0x0000000000000000000000000000000000000000` is then returned instead.
70
+
71
+
Refer to this guide for [how to set your token allowances](https://0x.org/docs/guides/how-to-set-your-token-allowances).
72
+
73
+
### Addresses by Network
74
+
75
+
The following table includes commonly used contract addresses. For a full list of our smart contract deployments address, see the [0x cheat sheet](https://0x.org/docs/guides/0x-cheat-sheet).
Unless the spec defines otherwise, errors to bad requests should respond with HTTP 4xx or status codes.
@@ -709,7 +736,10 @@ Nearly identical to [`/swap/v1/quote`](#get-swapv1quote), but with a few key dif
709
736
710
737
### Request
711
738
712
-
Identical to the request schema for `/swap/v1/quote`, with one exception: the `skipValidation` parameter will always be considered to be `true`, even when a `takerAddress` has been specified.
739
+
Identical to the request schema for `/swap/v1/quote`, with one exception: the `skipValidation` parameter -
740
+
* On Mainnet, `skipValidation` is always considered `true`, even when a `takerAddress` has been specified. Note that this will change soon to behave as it does on Ropsten.
741
+
* On Ropsten, `skipValidation` behaves identically to that on `/swap/v1/quote`. For details, see the `skipValidation` parameter in the [/swap/v1/quote Request](https://0x.org/docs/api#request-1) section.
0 commit comments