Validate NFT Order

validate a NFT order

EndPoint

POST api/v3/nft/validateOrder
Field
Description
Example

X-API-KEY

ApiKey

"HlkcGxbqBeaF76j4rvPaOasyfPwnkQ6B6DQ6THZWbvrAGxzEdulXQvOKLrRWZLnN"

Request

Query Param
Description
Example

exchange

accountId

accountId

10110

storageId

2

sellToken

buyToken

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

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)

Last updated