Create a p2p order
You can notice the difference between p2p and normal limit orders by looking at the path.
POST /nft/p2p/:chainId/
Examples
The process of composing the order and the payload to POST to API endpoint is pretty much the same as with usual non-p2p orders.
The only differences are:
slightly different route (
/nft/p2p/...instead of/nft/orders/...)taker should contain Augustus Swapper address
the intended order taker is encoded in the nonceAndMeta field````
curl -X POST \
'https://api.paraswap.io/nft/p2p/137' \
--header 'Content-Type: application/json' \
--data-raw '{
"nonceAndMeta": "1490585846052014974250870934243084527261268076495",
"expiry": 1665643036,
"makerAsset": "1697426235576502185006439320944601702126017005923",
"takerAsset": "611382286831621467233887798921843936019654057231",
"maker": "0x7BA594DF3161729BF2E68A9d0A11dceB57A2e306",
"taker": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
"makerAmount": "1",
"takerAmount": "8000000000000000000",
"makerAssetId": "7772759950848685723459796247330971791008072228632493699501910275462086524929",
"takerAssetId": "0",
"signature": "0x292e484328f98ea5e59b0d57b8d0fc41ac67fc275146f43c0d005c1422d639014bd69dcd447eb583315dc578f7b087f0ad60711237b9fc4b518f22a0d09fc9341c"
}'Query parameters:
chainId:network id (Ethereum Mainnet = 1)
Body parameters
nonceAndMeta: needs to include the actual taker as described here:
makerAssetandtakerAssetneeds to be encode as packed field containing address of an ERC20/721/1155 token that maker want to sell to the taker (between0-19 bits). Token type encoded as show above on20-21 bits.
Example encoding in JavaScript:
Response
Understand the response by checking our dedicated page:
Data structure in our centralized systemLast updated