Settle down an NFT trade which has two matched orders

Rate limit: every seconds

API Overview


HTTP method

POST

Path

/api/v3/nft/trade

Summary

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

API description


HTTP Header

Field Type Required Description Example
X-API-KEY string Y ApiKey "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ
6B6DQ6THZWbvrAGxzEdulXQvOKLrRW
ZLnN"
X-API-SIG string Y EDDSA Signature "0xeb14773e8a07d19bc4fe56e36d041dcb
0026bf21e05c7652f7e92160deaf5ea9
c4fe56e34773e86d041dcbeb1a07d19b
002652f7e92160deaf5e6bf21e05c7a9
002652f7e92160deaf5e6bf21e05c7a9
eb14773e8a07d19bc4fe56e36d041dcb"

Request parameters

Field Type Required Description Example
maker Submit
NftOrder
Request
V3
Y The makers NFT order /
makerFeeBips integer Y The maker feeBips, should <= maxFeeBips in makers order 100
taker Submit
NftOrder
Request
V3
Y The takers NFT order /
takerFeeBips integer Y The taker feeBips, should <= maxFeeBips in takers order 100
ignoreFees Result
Info
N If this trade ignores the fees config of each order, only whitelisted user can set this flag. "true"

Request example

HTTP
CURL
POST https://api3.loopring.io/api/v3/nft/trade HTTP/1.1
Host: api3.loopring.io
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh,en;q=0.9
X-API-KEY: sra1aavfa
X-API-SIG: dkkfinfasdf
Content-Type: application/json

{
  "maker" : {
    "exchange" : "1",
    "accountId" : 1,
    "storageId" : 1,
    "sellToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "buyToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "allOrNone" : "false",
    "fillAmountBOrS" : "true",
    "validUntil" : 1567053142,
    "maxFeeBips" : 20,
    "eddsaSignature" : "13375450901292179417154974849571793069911517354720397125027633242680470075859",
    "clientOrderId" : "1",
    "orderType" : "LIMIT_ORDER",
    "tradeChannel" : "ORDER_BOOK",
    "taker" : "0x506d67A6f22927a2DAa20a9510EA73D5E66Baf18",
    "affiliate" : "10068"
  },
  "makerFeeBips" : 100,
  "taker" : {
    "exchange" : "1",
    "accountId" : 1,
    "storageId" : 1,
    "sellToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "buyToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "allOrNone" : "false",
    "fillAmountBOrS" : "true",
    "validUntil" : 1567053142,
    "maxFeeBips" : 20,
    "eddsaSignature" : "13375450901292179417154974849571793069911517354720397125027633242680470075859",
    "clientOrderId" : "1",
    "orderType" : "LIMIT_ORDER",
    "tradeChannel" : "ORDER_BOOK",
    "taker" : "0x506d67A6f22927a2DAa20a9510EA73D5E66Baf18",
    "affiliate" : "10068"
  },
  "takerFeeBips" : 100,
  "ignoreFees" : true
}
curl -X POST -H "X-API-KEY:sra1aavfa" -H "X-API-SIG:dkkfinfasdf" -H "Content-Type:application/json" https://api3.loopring.io/api/v3/nft/trade -d \
'{
  "maker" : {
    "exchange" : "1",
    "accountId" : 1,
    "storageId" : 1,
    "sellToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "buyToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "allOrNone" : "false",
    "fillAmountBOrS" : "true",
    "validUntil" : 1567053142,
    "maxFeeBips" : 20,
    "eddsaSignature" : "13375450901292179417154974849571793069911517354720397125027633242680470075859",
    "clientOrderId" : "1",
    "orderType" : "LIMIT_ORDER",
    "tradeChannel" : "ORDER_BOOK",
    "taker" : "0x506d67A6f22927a2DAa20a9510EA73D5E66Baf18",
    "affiliate" : "10068"
  },
  "makerFeeBips" : 100,
  "taker" : {
    "exchange" : "1",
    "accountId" : 1,
    "storageId" : 1,
    "sellToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "buyToken" : {
      "tokenId" : 0,
      "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
      "amount" : "1"
    },
    "allOrNone" : "false",
    "fillAmountBOrS" : "true",
    "validUntil" : 1567053142,
    "maxFeeBips" : 20,
    "eddsaSignature" : "13375450901292179417154974849571793069911517354720397125027633242680470075859",
    "clientOrderId" : "1",
    "orderType" : "LIMIT_ORDER",
    "tradeChannel" : "ORDER_BOOK",
    "taker" : "0x506d67A6f22927a2DAa20a9510EA73D5E66Baf18",
    "affiliate" : "10068"
  },
  "takerFeeBips" : 100,
  "ignoreFees" : true
}'

Response fields

Field Type Required Description Example
makerFills NftTrade
Fill
Y The fill status of the maker order /
takerFills NftTrade
Fill
Y The fill status of the taker order /
tradeHash string Y The trade hash which can be queried in loopring scan web. "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"

Response example

{
  "makerFills" : {
    "orderHash" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
    "sellFilled" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
    "buyFilled" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
    "fee" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085"
  },
  "takerFills" : {
    "orderHash" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
    "sellFilled" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
    "buyFilled" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
    "fee" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085"
  },
  "tradeHash" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085"
}

Status code

Value Description
100000 Unknown error
100001 Invalid argument
102001 Exchange ID is incorrect
102021 Nonce is invalid
102022 Transfer sender is invalid
102023 Transfer receiver is invalid
102024 Fee token is unsupported
102025 Transfer token isnt consistent with fee token

Model


SubmitNftOrderRequestV3

Submit an NFT order

Field Type Required Description Example
exchange string Y The adderss of the exchange which has to process this order "1"
accountId integer Y Loopring's account ID 1
storageId integer Y The unique identifier of the L2 Merkle tree storage slot where the burn made in order to exit the pool will or has been stored. 1
sellToken NftToken
Amount
Info
Y NFT token if sell NFT order else erc20 token like USDT "NftTokenAmou
nt{tokenId: 0, amount: 1234}"
buyToken NftToken
Amount
Info
Y NFT token if buy NFT order else erc20 token like USDT "NftTokenAmou
nt{tokenId: 0, amount: 1234}"
allOrNone string Y Whether the order supports partial fills or not.Currently only supports false as a valid value "false"
fillAmountBOrS string Y Fill size by buy token or by sell token "true"
validUntil integer Y Order expiration time, accuracy is in seconds 1567053142
maxFeeBips integer Y Maximum order fee that the user can accept, value range (in ten thousandths) 1 ~ 63 20
eddsaSignature string Y The orders EdDSA signature. The signature is a hexadecimal string obtained by signing the order itself and concatenating the resulting signature parts (Rx, Ry, and S). Used to authenticate and authorize the operation. "133754509012
921794171549
748495717930
699115173547
203971250276
332426804700
75859"
clientOrderId string N An arbitrary, client-set unique order identifier, max length is 120 bytes "1"
orderType string N Order types, can be AMM, LIMIT_ORDER, MAKER_ONLY, TAKER_ONLY
Allowable : ['LIMIT_ORDER', 'TAKER_ONLY', 'MAKER_ONLY', 'AMM']
"LIMIT_ORDER"
tradeChannel string N Order channel, can be ORDER_BOOK, AMM_POOL, MIXED
Allowable : ['ORDER_BOOK', 'AMM_POOL', 'MIXED']
"ORDER_BOOK"
taker string N Used by the P2P order which user specify the taker, so far its 0x0000000000000000000000000000000000000000 "0x506d67A6f2
2927a2DAa20a
9510EA73D5E6
6Baf18"
affiliate string N An accountID who will recieve a share of the fee of this order "10068"

NftTokenAmountInfo

Wrapper object used to describe a NFT token associated with a certain quantity.

Field Type Required Description Example
tokenId integer Y The Loopring's NFT token identifier. 0
nftData string N The Loopring's NFT token data identifier which is a hash string of NFT token address and NFT_ID "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
amount string Y The amount of the NFT token "1"

NftTradeFill

Nft trade fill status

Field Type Required Description Example
orderHash string Y The order hash "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
sellFilled string Y The orders sell fill "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
buyFilled string Y The orders buy fill "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
fee string Y The orders fee "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"

results matching ""

    No results matching ""