Validate NFT order
validate a NFT order

EndPoint

POST api/v3/nft/validateOrder

Header

​
Field
Description
Example
X-API-KEY
ApiKey
"HlkcGxbqBeaF76j4rvPaOasyfPwnkQ6B6DQ6THZWbvrAGxzEdulXQvOKLrRWZLnN"

Request

​
Query Param
Description
Example
exchange
exchangeAddress in exchange info​
​
accountId
accountId
10110
storageId
​storageId of sell tokenId in
2
sellToken
​NftTokenAmountInfo, NFT token if sell NFT order else erc20 token like USDT
​
buyToken
​NftTokenAmountInfo, NFT token if buy NFT order else erc20 token like USDT
​
validUntil
Timestamp for transfer to become invalid, seconds
​
normally current time + 2 months
maxFeeBips
Maximum order fee that the user can accept, value range (in ten thousandths) 1 ~ 5000
100, means 1%
eddsaSignature
​eddsa signature of the eddsa hash​
​
clientOrderId
(Optional) An arbitrary, client-set unique order identifier, max length is 120 bytes
"test"
affiliate
(Optional) An accountID who will receive a share of the fee of this order at the end of monthly distribution. Need contact us to add the accountId in whitelist.
10110

Response

​
Field
Description
Example
hash
The hash identifier set by the user at the time of submission, can use this hash to get the transfer info
"0x1d923ca7834dc90484fa2eb611f0f0bc7e741bb107007ebea19ba8caeab4f9d3"
status
Whether the order was successfully submitted or not, please note, user may query after a while to get real process status, as most offchain requests are async processed Allowable : ['received', 'processing', 'processed', 'failed']
"received"
isIdempotent
Idempotent of submit transfer response, submit same transfer again idempotent will be true
false

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"

Compute eddsa hash

const inputs = [
new BN(ethUtil.toBuffer(request.exchange)).toString(),
request.storageId,
request.accountId,
request.sellToken.tokenId,
request.buyToken.tokenId,
request.sellToken.volume,
request.buyToken.volume,
request.validUntil,
request.maxFeeBips,
request.fillAmountBOrS ? 1 : 0,
new BN(ethUtil.toBuffer(request.taker)).toString(),
];
const hasher = Poseidon.createHash(12, 6, 53);
const hash = hasher(inputs).toString(10)

Example

Header

X-API-KEY = oiZ57EvM34rsHMRTjPElpZaFAt2fuKZNh6hOSELC5vRLnIvXuarRM8RuNr0apM2q

Request

POST api/v3/nft/validateOrder
{
"exchange": "0x2e76EBd1c7c0C8e7c2B875b6d505a260C525d25e",
"accountId": 12454,
"storageId": 52,
"sellToken": {
"tokenId": 1,
"amount": "10000000000000"
},
"buyToken": {
"tokenId": 32768,
"nftData": "0x1a2001aac7a1fd00cef07889cdb67b1355f86e5bc9df71cfa44fa1c7b49f598f",
"amount": "1"
},
"fillAmountBOrS": true,
"allOrNone": false,
"validUntil": 1656169134,
"maxFeeBips": 100,
"eddsaSignature": "0x0199d712c7388d35cd84ab9568142e4852937c1afff3d564f39815527575f4fb0ee9db7bede135878e18421cadac15861f70eab532693cbfd6b8369f37fcd9f92da57b8000bf227b8e2a94fdb7cf27a9be71eafbacb29d7d65ce2c42f8c61dd3"
}

Response

{
"hash": "0x1c12b93ee4fc9f6bfa3784137ef145c23396c4dc921d611505b5e284cb1ba4bd",
"status": "",
"isIdempotent": false,
"accountId": 12454,
"tokens": [1],
"storageId": 52
}
​
Copy link
On this page
EndPoint
Header
Request
Response
Model
NftTokenAmountInfo
Compute eddsa hash
Example
Header
Request
Response