Loopring Dev Docs
  • Introduction
  • Endpoints
  • SDK
    • SDK Guides
    • Test Mock Data
      • Mock Account
      • Mock provider
      • Mock ERC20 Token Map
      • Mock AMM MAP
      • Mock EIP712 Typed Data
      • Mock Generate eddsaKey
  • Glossary
  • 🗳️Loopring Account
    • Introduction
    • SDK Guides
      • Setup a Loopring Account
      • Unlock Account (Login)
    • API References
      • Get Account info
        • Sample code
      • Update EddsaKey
        • Sample code
      • Get apiKey
        • Sample code
      • Update apiKey
        • Sample code
  • 🎨CounterFactual NFT
    • Introduction
      • Compute NFT Address API
      • When to deploy counterfactual NFT contracts?
    • SDK Guides
      • Deposit NFT
      • Create Collection
      • Mint Counterfactual NFT
      • Transfer NFT
      • Deploy NFT
      • Withdraw NFT
      • Trade NFT
        • Validate NFT Order
      • Meta & IPFS
    • API References
      • NFT Collection
        • Create collection
          • Sample code
        • Edit collection
          • Sample code
        • Delete collection
          • Sample code
        • List owned collections
          • Sample code
        • List user's NFTs under one collection
          • Sample code
        • List user's NFT balances group by Collection ID
          • Sample code
        • List all NFTs of a collection
          • Sample code
        • Get collection by Collection ID
          • Sample code
        • Get collections by contract address
          • Sample code
      • Get NFT Assets
        • Sample code
      • Get NFT Balances
        • Sample code
      • Mint NFT
        • Sample code
      • Transfer NFT
        • Sample code
      • Validate NFT Order
        • Sample code
      • Trade NFT
        • Sample code
      • Deploy NFT TokenAddress
        • Sample code
      • Withdraw NFT
        • Sample code
      • Get NFT Transactions
        • Sample code
      • Get NFT Trade History
        • Sample code
      • Get AvailableBroker
        • Sample code
      • Get NFT Info
        • Sample code
      • Get NFT Data
        • Sample code
      • Get NFT Holders
        • Sample code
  • 🪙ERC20 Tokens
    • Introduction
    • SDK Guides
      • Transfer ERC20
      • Withdraw ERC20
      • Deposit ERC20
      • Order ERC20
    • API References
      • Get Assets
        • Sample code
      • Transfer
        • Sample code
      • Submit Order
        • Sample code
      • Cancel Order
        • Sample code
      • Withdraw
        • Sample code
      • Get Transactions
        • Sample code
      • Get Orders
        • Sample code
      • Get Trade History
        • Sample code
  • 🔬Resources
    • Advanced
      • UpdateAccount with custom seed
      • Pay payee updateAccount fee
      • Common error and solutions
      • Submit erc20 order
    • Common Info
      • Get relayer current time
        • Sample code
      • Get exchange info
        • Sample code
      • Get token info
        • Sample code
      • Get markets info
        • Sample code
    • Error codes
    • Fees
      • GET ERC20 Offchain Fee
        • Sample code
      • GET ERC20 Order Fee
        • Sample code
      • GET NFT Offchain Fee
        • Sample code
      • GET NFT Order Fee
        • Sample code
      • SDK Fees
    • Layer 2 block info
      • Get pending transactions
    • Request signing
      • Special API Request Signatures
      • Off-chain Request Signatures
      • Extra ECDSA authentic in header
    • Signature
      • ECDSA signature
        • ECDSA key generation
        • ECDSA sign
        • ECDSA verify signature
      • EdDSA signature
        • EdDSA key generation
        • EdDSA sign
        • EdDSA verify signature
      • SDK Signature
        • Mock Signature
    • Smart Contracts
    • Storage Id
      • Sample code
    • WebSocket
      • Account Notification
      • Order Notification
      • Orderbook Notification
      • Trade Notification
      • Ticker Notification
      • Candlestick Notification
      • AMM Pool Snapshot Notification
      • Block Generation Notification
    • Loopring Smart Wallet
      • Signature and verification
Powered by GitBook
On this page
  • EndPoint
  • Header
  • Request
  • Response
  • Model
  • NftTokenAmountInfo
  • NftTradeFill
  • Compute EdDSA hash

Was this helpful?

  1. CounterFactual NFT
  2. API References

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

makerFeeBips

100, means 1%

taker

takerFeeBips

100, means 1%

matchByTaker

(Optional) use taker price to match the nft trade

true

Response

Field
Description
Example

makerFills

/

takerFills

/

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);
PreviousSample codeNextSample code

Last updated 1 year ago

Was this helpful?

,

, NFT maker order

maxFeeBips in maker object, should not smaller than royaltyPercentage of the , value range (in ten thousandths) 1 ~ 5000. the value = royaltyPercentage + extraFee. the extraFee is for nft submitter

, NFT taker order

The taker feeBips, maxFeeBips in takers order. value range (in ten thousandths) 1 ~ 5000. taker fee need cover the trade fee and not smaller than 100. You can get the tradeCost in , the value = ceiling(tradeCost/buyAmount)

, The fill status of the maker order

, The fill status of the taker order

🎨
EDDSA Signature
sign the whole request
NftTradeFil
NftTradeFil
NFT info
NFTOrderRequest
NFTOrderRequest
get NFT order fee