Take Order Parameter

Example JS Code

await niftyConnectExchangeInst.takeOrder_(
    [   // address[16] addrs,
        //buy order
        NiftyConnectExchange.address,                       // exchange
        buyer,                                              // maker
        "0x0000000000000000000000000000000000000000",       // taker
        makerRelayerFeeRecipient,                           // makerRelayerFeeRecipient
        "0x0000000000000000000000000000000000000000",       // takerRelayerFeeRecipient
        TestERC721.address,                                 // nftAddress
        "0x0000000000000000000000000000000000000000",       // staticTarget
        TestERC20.address,                                  // paymentToken

        //sell order
        NiftyConnectExchange.address,                       // exchange
        nftOwner,                                           // maker
        buyer,                                              // taker
        "0x0000000000000000000000000000000000000000",       // makerRelayerFeeRecipient
        takerRelayerFeeRecipient,                           // takerRelayerFeeRecipient
        TestERC721.address,                                 // nftAddress
        "0x0000000000000000000000000000000000000000",       // staticTarget
        TestERC20.address,                                  // paymentToken
    ],
    [   // uint[12] uints,
        //buy
        exchangePrice,                // uint basePrice
        web3.utils.toBN(0),           // uint extra
        timestamp,                    // uint listingTime
        expireTime,                   // uint expirationTime
        web3.utils.toBN(salt),        // uint salt
        tokenId,                      // uint tokenId
        //sell
        exchangePrice,                // uint basePrice
        web3.utils.toBN(0),           // uint extra
        timestamp,                    // uint listingTime
        expireTime,                   // uint expirationTime
        web3.utils.toBN(salt),        // uint salt
        tokenId,                      // uint tokenId
    ],
    [   // uint8[4] sidesKinds,
        0, 0,
        1, 0
    ],
    buyCalldata, // bytes calldataBuy,
    sellCalldata, // bytes calldataSell,
    buyReplacementPattern, // bytes replacementPatternBuy,
    sellReplacementPattern, // bytes replacementPatternSell,
    [],// bytes staticExtradataBuy,
    [],// bytes staticExtradataSell,
    "0x0000000000000000000000000000000000000000000000000000000000000000", // bytes32 rssMetadata, hex encoding ipfsHash
    {from: buyer}
);

Parameter Details

nametypedescription

addrs

address[16]

// buy order addrs[0]: exchange addrs[1]: maker addrs[2]: taker addrs[3]: makerRelayerFeeRecipient addrs[4]: takerRelayerFeeRecipient addrs[5]: nftAddress addrs[6]: staticTarget addrs[7]: paymentToken // sell order addrs[8]: exchange addrs[9]: maker addrs[10]: taker addrs[11]: makerRelayerFeeRecipient addrs[12]: takerRelayerFeeRecipient addrs[13]: nftAddress addrs[14]: staticTarget addrs[15]: paymentToken

uints

uint[12]

// buy order uints[0]: basePrice uints[1]: extra, endPrice in Dutch auction uints[2]: listing iime uints[3]: expirationTime uints[4]: salt uints[5]: tokenId //sell order uints[6]: basePrice uints[7]: extra, endPrice in Dutch auction uints[8]: listing iime uints[9]: expirationTime uints[10]: salt uints[11]: tokenId

sidesKinds

uint8[4]

// buy order sidesKinds[0]: side sidesKinds[1]: saleKind // sell order sidesKinds[2]: side sidesKinds[3]: saleKind

buyCalldata

bytes

buy order calldata

sellCalldata

bytes

sell order calldata

buyReplacementPattern

bytes

buy order replacementPattern

sellReplacementPattern

bytes

sell order replacementPattern

staticExtradataBuy

bytes

calldata of static target contract in buy order

staticExtradataSell

bytes

calldata of static target contract in sell order

rssMetadata

bytes32

metadata, suggested value is hex encoding IPFS hash

Last updated