Make Order Parameter

Example JS Code

await niftyConnectExchangeInst.makeOrder_(
    [   // address[9] addrs,
        NiftyConnectExchange.address,                       // exchange address
        nftOwner,                                           // maker address
        "0x0000000000000000000000000000000000000000",       // taker address
        makerRelayerFeeRecipient,                           // maker relayer fee recipient
        TestERC721.address,                                 // nft contract address
        "0x0000000000000000000000000000000000000000",       // staticTarget
        TestERC20.address,                                  // paymentToken
        nftOwner,                                           // from
        "0x0000000000000000000000000000000000000000"        // to
    ],
    [   // uint[9] uints,
        exchangePrice,          // uint basePrice
        web3.utils.toBN(0),     // uint extra
        listtime,               // uint listingTime
        expireTime,             // uint expirationTime
        web3.utils.toBN(salt),  // uint salt
        ERC721TransferSelector, // uint merkleValidatorSelector
        tokenId,                // uint tokenId
        ERC721_AMOUNT,          // uint amount
        0,                      // uint totalLeaf
    ],
    1,                      // side (0 buy,1 sell)
    0,                      // Kind of sale (0 fixPrice buy/sell, 1 Auction) 
    sellReplacementPattern, // replacementPattern
    [],                     // staticExtradata
    [
        "0x0000000000000000000000000000000000000000000000000000000000000000", // merkle root hash, for trait-based order
        "0x0000000000000000000000000000000000000000000000000000000000000000"  // ipfs hash which contain the metadata of merkle proof, for trait-based order
    ],                      // merkleData
    {from: nftOwner}
);

Parameter Details

nametypedescription

addrs

address[9]

addrs[0]: Exchange address addrs[1]: Order maker address addrs[2]: Order taker address addrs[3]: Maker relayer fee recipient, must not be zero addrs[4]: NFT contract address addrs[5]: StaticTarget address addrs[6]: Payment token addrs[7]: NFT owner address addrs[8]: NFT recipient address

uints

uint[9]

uints[0]: BasePrice uints[1]: EndPrice in the Dutch Auction uints[2]: Order listing time uints[3]: Order expire time uints[4]: Salt, random number uints[5]: NFT Transfer selector, refer to nft transfer selector uints[6]: NFT asset token id uints[7]: For ERC721, the amount must be 1. For ERC1155, its value should be no more than the nftOwner balance uints[8]: The nft array length, only useful in trait-based order, for others leave it to 0

side

uint8

0 buy, 1 sell

kind

uint8

Kind of sale (0 fixPrice buy/sell, 1 Auction)

replacementPattern

bytes

staticExtradata

bytes

Calldata of staticTarget contract

merkleData

bytes32[2]

merkleData[0]: merkle root hash, only used in trait-based order, leave it to zero for other scenarios merkleData[1]: ipfs hash which contain the metadata of merkle proof. Only used in trait-based order, leave it to empty for other scenarios Refer to merkle proof guide

Last updated