Managing Orders
Build, approve, sign, fill, cancel and save orders with the Swap SDK.
There are two ways to build orders with the 0x v4 Swap SDK,
buildOrder
and buildNftAndErc20Order
buildOrder()
accepts the traditional order format (specifying maker and taker assets). import { NftSwapV4 } from '@traderxyz/nft-swap-sdk';
const nftSwapSdk = new NftSwapV4(provider, signer, chainId);
const CRYPTOPUNK_420 = {
tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb', // CryptoPunk contract address
tokenId: '420', // Token Id of the CryptoPunk we want to swap
type: 'ERC721', // Must be one of 'ERC20', 'ERC721', or 'ERC1155'
};