Trade NFT
Settle down an NFT trade which has two matched orders

EndPoint

POST api/v3/nft/trade

Header

​
Field
Description
Example
X-API-KEY
ApiKey
"HlkcGxbqBeaF76j4rvPaOasyfPwnkQ6B6DQ6THZWbvrAGxzEdulXQvOKLrRWZLnN"
X-API-SIG
"0xccf0a141fce2dc5cbbd4f802c52220e9e2ce260e86704d6258603eb346eefe2d 4a450005c362b223b2842d087f7065ea5eee0314531adf6a580fce64c25dca81c"

Request

​
Query Param
Description
Example
maker
​NFTOrderRequest, NFT maker order
​
makerFeeBips
maxFeeBips in maker object, should not smaller than royalty_percentage fof th, value range (in ten thousandths) 1 ~ 10000
100, means 1%
taker
​NFTOrderRequest, NFT taker order
​
takerFeeBips
The taker feeBips, maxFeeBips in takers order. value range (in ten thousandths) 1 ~ 10000. taker fee need cover the trade fee and not smaller than 100. You can get the tradeCost in get NFT order fee​
100, means 1%

Response

​
Field
Description
Example
makerFills
​NftTradeFil, The fill status of the maker order
/
takerFills
​NftTradeFil, The fill status of the taker order
/
tradeHash
The trade hash which can be queried in loopring scan web.
"0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085"

Model

NftTokenAmountInfo

Wrapper object used to describe a token associated with a certain quantity.
Field
Description
Example
tokenId
The Loopring's NFT token identifier.
32769
amount
The amount of the NFT
token
"2"
nftData
The Loopring's NFT token data identifier which is a hash string of NFT token address and NFT_ID
"0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa 8ca7100400f7c31085"

NftTradeFill

Nft trade fill status
Field
Description
Example
orderHash
The order hash
​
sellFilled
The orders sell fill
​
buyFilled
The orders buy fill
​
fee
The orders fee
​

Compute eddsa hash

const inputs = [
request.taker.accountId,
request.taker.sellToken.tokenId,
request.taker.storageId,
request.maker.accountId,
request.maker.sellToken.tokenId,
request.maker.storageId,
];
const hasher = Poseidon.createHash(7, 6, 52);
const hash = hasher(inputs).toString(10);

Example

Header

X-API-KEY = oiZ57EvM34rsHMRTjPElpZaFAt2fuKZNh6hOSELC5vRLnIvXuarRM8RuNr0apM2q
X-API-SIG = 0x087c3042fed0657680b4d589b6d90a0e67fa681466ab7fb20559aee53f668816279b53752b0e134f76eb62793968c59e56b59c70a12278129047d5f79431e2060eb5ee318aed84042cac70b70c32f1d5d906efd86171990d7af3da045013bc19

Request

POST api/v3/nft/trade
{
"maker": {
"exchange": "0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e",
"accountId": 12454,
"storageId": 54,
"sellToken": {
"tokenId": 32768,
"nftData": "0x1a2001aac7a1fd00cef07889cdb67b1355f86e5bc9df71cfa44fa1c7b49f598f",
"amount": "1"
},
"buyToken": {
"tokenId": 1,
"amount": "1000000000000000000"
},
"allOrNone": false,
"fillAmountBOrS": false,
"validUntil": 1656227891,
"maxFeeBips": 1000,
"eddsaSignature": "0x21f5aca209539726541d3e7165eef62c3ecfdbff6b9aa19d8793a28b08f22515258b53969cf558dfd7a221bf25082fc22f33c9b431ff6bd6847e9eb7c09de4992f6baa4ba5b5e4ee22ac7e0256c877caac31056834fc0f035bca5c230d8f532b"
},
"makerFeeBips": 1000,
"taker": {
"exchange": "0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e",
"accountId": 10488,
"storageId": 64,
"sellToken": {
"tokenId": 1,
"amount": "1000000000000000000"
},
"buyToken": {
"tokenId": 32768,
"nftData": "0x1a2001aac7a1fd00cef07889cdb67b1355f86e5bc9df71cfa44fa1c7b49f598f",
"amount": "1"
},
"allOrNone": false,
"fillAmountBOrS": true,
"validUntil": 1656227891,
"maxFeeBips": 100,
"eddsaSignature": "0x0d8606d2c3e31a3a93151954b3ba37e26188498490a0e382c0a0b5858693f3ee26e7d51a098f56320620c9cf1fe4f2790b280842a57e87b5b60abf729f61c16027e5cc88f09cf6f7fdd5c6e7eff254e6513f803059734723d60f91ba3be35a4d"
},
"takerFeeBips": 100
}

Response

{
"makerFills": {
"orderHash": "0x199af4d4dcfbb7acae35d3b55a0ad99a0759f37dcef3388497e07008ec91a7d1",
"sellFilled": {
"tokenId": 32768,
"nftData": "0x1a2001aac7a1fd00cef07889cdb67b1355f86e5bc9df71cfa44fa1c7b49f598f",
"amount": "1"
},
"buyFilled": {
"tokenId": 1,
"amount": "1000000000000000000"
},
"fee": {
"tokenId": 1,
"amount": "100000000000000000"
}
},
"takerFills": {
"orderHash": "0x28b8415bd05dd7c68385e37870b6d9177cf7f8c2ba2e8ab151661114d546e799",
"sellFilled": {
"tokenId": 1,
"amount": "1000000000000000000"
},
"buyFilled": {
"tokenId": 32774,
"nftData": "0x1a2001aac7a1fd00cef07889cdb67b1355f86e5bc9df71cfa44fa1c7b49f598f",
"amount": "1"
},
"fee": {
"tokenId": 1,
"amount": "10000000000000000"
}
},
"tradeHash": "0x2d4dcc071cb511cca912574aecb0076ba57e057b0716efb849b62da50926aa57",
}
​
Copy link
On this page
EndPoint
Header
Request
Response
Model
NftTokenAmountInfo
NftTradeFill
Compute eddsa hash
Example
Header
Request
Response