Skip to content

Releases: trader-xyz/nft-swap-sdk

v0.33.0 - 🔵 Add Base Mainnet and Base Goerli Testnet to supported chains

31 Jul 18:26
Compare
Choose a tag to compare
  • Adds chains 8453 (Base Mainnet) and 84531 (Base Goerli) to the supported Swap SDK chains.

Includes following PRs:

v0.32.0 - Add custom ERC20 approval amount support

12 Jun 22:06
Compare
Choose a tag to compare

Context

Originally, the NFT swap sdk defaulted to max approvals to make it easier to use and for convenience of users. However, wallets are now being more aggressive in the way they notify/allow users to set approvals. MetaMask is specifically only recommending minimum viable approval to complete the transaction, so this PR adds first class support for custom approval amounts, both loading/fetching an approval and constructing an approval transaction. In the future, a breaking v1 release will prioritize minimum required approvals over max approvals by default, but to maintain maximum backwards compatibility, custom/minimum approvals are opt-in.

Changes

  • Added a new function loadApprovalStatusForOrder that will check exact approval amounts for an order.
  • loadApprovalStatus now supports a custom approval amount, but still defaults to max approval to maintain backwards comaptability until v1 release, in which we will default to minimum approval amount necessary for all interactions.

Prefer loadApprovalStatusForOrder over loadApprovalStatus, as it is easier to use right now because the order contains everything required to determine approval data:

const approvalStatus = await this.loadApprovalStatusForOrder(
  order,
  "MAKER" // or 'TAKER'
);

approvalStatus result will take into consideration minimum approval amount required by default, as it uses the order object to infer what approvals is required to make the swap successful.

You can optionally continue to use loadApprovalStatus, but note that this requires providing a custom approval amount since there is no order context to infer the amount from:

const approvalStatus = await nftSwap.loadApprovalStatus(asset, walletAddress, undefined, {
  approvalAmount: CUSTOM_APPROVAL_AMOUNT_TO_CHECK,
});

v0.31 - EIP-1271 Support

24 Jan 22:46
Compare
Choose a tag to compare

NFT Swap SDK now includes first-class support for EIP-127, mainly for contract wallets (Sequence, Gnosis Multisig, etc)

Special thanks to @arilotter for the PR!
#98

v0.29 First-class Goerli testnet support

05 Sep 13:58
Compare
Choose a tag to compare

Previously you could provide the Goerli 0x v4 exchange contract address to use the NFT Swap SDK.

This release enables Goerli to automagically work without knowing any contract addresses, just bring a Goerli RPC and the SDK will work.
Also enables managed orderbook service support for Goerli.

v0.26.0 - Batch buy NFTs

19 May 05:19
Compare
Choose a tag to compare

Adds support for buying multiple NFTs in single transaction using the SDK.

Docs: https://docs.swapsdk.xyz/readme/batch-buy-nfts

Build shopping cart functionality in your NFT marketplace!

Usage:

const fillTx = await nftSwap.batchBuyNfts([
  signedOrder_1,
  signedOrder_2,
])

v0.25.0 - Adds Polygon Mumbai Testnet support

12 May 02:16
Compare
Choose a tag to compare

Adds support for Polygon Mumbai testnet (chain 80001)

  • Adds 0x v4 Polygon Mumbai testnet deployment address for the ExchangeProxy
  • Enables support on the open orderbook for Polygon Mumbai orders and order watching

v0.24 - Advanced orderbook filtering

27 Apr 04:28
Compare
Choose a tag to compare

Adds more search filtering options for the public orderbook.
Notably, passing in arrays for token addresses and ids, as well as chains is now supported.

interface SearchOrdersParams {
  nftTokenId: string | string[];
  erc20Token: string | string[];
  nftToken: string | string[];
  nftType: 'ERC721' | 'ERC1155';
  chainId: string | number | string[] | number[];
  maker: string;
  taker: string;
  nonce: string | string[];
  offset: string | number;
  limit: string | number;
  sellOrBuyNft: 'sell' | 'buy';
  direction: '0' | '1';
  // Defaults to only 'open' orders
  status: 'open' | 'filled' | 'expired' | 'cancelled' | 'all';
  visibility: 'public' | 'private';
  valid: 'valid' | 'all';
}

v0.23.0 - Integrator attribution

21 Apr 01:52
Compare
Choose a tag to compare

Adds support for integrator attribution, so integrator fill volume can show up in dune dashboards

Opt-in by default, of course

Uses the 256bit nonce, divides it into a [128bit attribution][128bit random nonce for order], and that will be the canonical 0x v4 standard schema for nonces.

To add an app identifier to your app, instantiate the sdk with an appId that is an unique positive integer (up to 2**126 -1)

const nftSwapSdk = new NftSwapV4(
  provider,
  signer,
  chainId,
  { appId: '69420' },
)

v0.22.0 - Fixes v4 orders with native token & fees

14 Apr 05:09
Compare
Choose a tag to compare

Also removes FAKE_ETH_ADDRESS from exports, use ETH_ADDRESS_AS_ERC20 instead.

v0.21.0 - Support raw unix timestamp for expiry order field

08 Apr 02:16
Compare
Choose a tag to compare

Not a breaking change. Just adds proper support in buildOrder() for passing expiry a unix timestamp directly (e.g. 1897016400). expiry still also supports a Date().