Skip to content

Commit fd68edb

Browse files
authored
Fix code block rendering (#729)
1 parent e5e1393 commit fd68edb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/guides/nft_guide.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Create an ERC721Order
1515
The following code snippet shows how to construct a basic ERC721 sell order in JavaScript. In the following example, the seller indicates that they would like to receive ether by providing the sentinel value `0xeee...`` as the `erc20Token`.
1616

1717
.. code-block:: javascript
18+
1819
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
1920
const utils = require("@0x/utils");
2021
@@ -48,6 +49,7 @@ The following code snippet shows how to construct a basic ERC721 sell order in J
4849
An ERC721 sell order can be created similarly. Note that buy orders must use WETH instead of ether, because the ERC20 `transferFrom` functionality is needed to execute a buy order.
4950

5051
.. code-block:: javascript
52+
5153
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
5254
const utils = require("@0x/utils");
5355
@@ -97,6 +99,7 @@ Fees are paid by the **buyer**, denominated in the asset paid by the buyer, and
9799
The following code snippet shows how to create an ERC721 order with a single fee. Multiple fees can be specified by providing multiple fee objects in the order fees field.
98100

99101
.. code-block:: javascript
102+
100103
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
101104
const utils = require("@0x/utils");
102105
@@ -130,6 +133,7 @@ The following code snippet shows how to create an ERC721 order with a single fee
130133
In 0x V4, it is possible to create a bid for any NFT in a particular collection. The following code snippet shows how to create an order to buy any CryptoCoven $WITCH.
131134

132135
.. code-block:: javascript
136+
133137
const { ERC721Order, NFTOrder } = require("@0x/protocol-utils");
134138
const utils = require("@0x/utils");
135139
@@ -169,6 +173,7 @@ Off-chain orders must be signed by the order maker to be filled. For on-chain or
169173
Signing an order with a private key is easy: the `ERC721Order` and `ERC1155Order` classes from `@0x/protocol-utils` expose a `getSignatureWithKey` function that take a 0x-prefixed private key string.
170174
171175
.. code-block:: javascript
176+
172177
const { ERC721Order, NFTOrder, SignatureType } = require("@0x/protocol-utils");
173178
const utils = require("@0x/utils");
174179
@@ -196,6 +201,7 @@ Signing an order with a private key is easy: the `ERC721Order` and `ERC1155Order
196201
**Signing with ethers**
197202

198203
.. code-block:: javascript
204+
199205
const { ERC721Order, NFTOrder, SignatureType } = require("@0x/protocol-utils");
200206
const utils = require("@0x/utils");
201207
const { ethers } = require("ethers");
@@ -243,6 +249,7 @@ Signing an order with a private key is easy: the `ERC721Order` and `ERC1155Order
243249
Orders can be simultaneously "signed" and listed on-chain using the `preSignERC721Order` or `preSignERC1155Order` functions. Orders can only be signed by the maker address specified in the order.
244250

245251
.. code-block:: solidity
252+
246253
/// @dev Approves an ERC721 order on-chain. After pre-signing
247254
/// the order, the `PRESIGNED` signature type will become
248255
/// valid for that order and signer.
@@ -260,6 +267,7 @@ Orders can be simultaneously "signed" and listed on-chain using the `preSignERC7
260267
If an order has been pre-signed, it can be filled by providing a “null” signature with the PRESIGNED signature type (see `LibSignature.sol <https://github.com/0xProject/protocol/blob/refactor/nft-orders/contracts/zero-ex/contracts/src/features/libs/LibSignature.sol#L42-L61>`_):
261268

262269
.. code-block:: solidity
270+
263271
LibSignature.Signature({
264272
signatureType: LibSignature.SignatureType.PRESIGNED,
265273
v: uint8(0),
@@ -270,6 +278,7 @@ If an order has been pre-signed, it can be filled by providing a “null” sign
270278
The pre-sign functions emit the entire order as an event, so that the order is easily indexable by subgraphs and thus easily indexable by subgraphs and thus easily discoverable without the need for an off-chain database.
271279

272280
.. code-block:: solidity
281+
273282
/// @dev Emitted when an `ERC721Order` is pre-signed.
274283
/// Contains all the fields of the order.
275284
event ERC721OrderPreSigned(
@@ -311,6 +320,7 @@ Filling an ERC721 Order
311320
The basic functions used for filling NFT orders are the following:
312321

313322
.. code-block:: solidity
323+
314324
/// @dev Sells an ERC721 asset to fill the given order.
315325
/// @param buyOrder The ERC721 buy order.
316326
/// @param signature The order signature from the maker.
@@ -407,6 +417,7 @@ Cancelling an ERC721 Order
407417
All orders, whether off-chain or on-chain, can only be cancelled on-chain. The following contract functions are used to cancel individual ERC721 and ERC1155 orders.
408418

409419
.. code-block:: solidity
420+
410421
/// @dev Cancel a single ERC721 order by its nonce. The caller
411422
/// should be the maker of the order. Silently succeeds if
412423
/// an order with the same nonce has already been filled or
@@ -427,6 +438,7 @@ Note that if there are multiple outstanding orders with the same nonce, calling
427438
The following functions can be used to cancel multiple orders.
428439

429440
.. code-block:: solidity
441+
430442
/// @dev Cancel multiple ERC721 orders by their nonces. The caller
431443
/// should be the maker of the orders. Silently succeeds if
432444
/// an order with the same nonce has already been filled or

0 commit comments

Comments
 (0)