From 49c8cc828d8bc3c6a8eda4f805a72897d0f5b68a Mon Sep 17 00:00:00 2001 From: Joshua Schmidt <123490974+JoshuaSchmidt-OpenSea@users.noreply.github.com> Date: Mon, 15 May 2023 11:23:43 -0500 Subject: [PATCH] Remove seaport 1.4 from package (#954) * Remove seaport 1.4 from package * Update package version * Update code owner --- .github/CODEOWNERS | 2 +- package.json | 4 ++-- src/__tests__/utils/utils.ts | 8 +++++--- src/sdk.ts | 10 ---------- src/utils/utils.ts | 8 +++----- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f62f32760..ebed9e7b8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @ProjectOpenSea/developer-api +* @ProjectOpenSea/protocol diff --git a/package.json b/package.json index 93603e949..6e4e37a7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensea-js", - "version": "5.0.0", + "version": "5.0.1", "description": "JavaScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data!", "license": "MIT", "author": "OpenSea Developers", @@ -34,7 +34,7 @@ }, "types": "lib/index.d.ts", "dependencies": { - "@opensea/seaport-js": "^1.0.10", + "@opensea/seaport-js": "^1.2.1", "ajv": "8.11.0", "axios": "^1.3.4", "bignumber.js": "9.0.2", diff --git a/src/__tests__/utils/utils.ts b/src/__tests__/utils/utils.ts index 531bcad8d..18a5cdbab 100644 --- a/src/__tests__/utils/utils.ts +++ b/src/__tests__/utils/utils.ts @@ -14,15 +14,17 @@ suite("Utils: utils", () => { const randomAddress = "0x1F7Cf51573Bf5270323a395F0bb5Fd3c3a4DB867"; assert.isTrue(isValidProtocol(seaport_v1_5)); - assert.isTrue(isValidProtocol(seaport_v_1_4)); + assert.isFalse(isValidProtocol(seaport_v_1_4)); assert.isFalse(isValidProtocol(randomAddress)); assert.isTrue(isValidProtocol(seaport_v1_5.toLowerCase())); - assert.isTrue(isValidProtocol(seaport_v_1_4.toLowerCase())); + assert.isFalse(isValidProtocol(seaport_v_1_4.toLowerCase())); assert.isFalse(isValidProtocol(randomAddress.toLowerCase())); assert.isTrue(isValidProtocol(Web3.utils.toChecksumAddress(seaport_v1_5))); - assert.isTrue(isValidProtocol(Web3.utils.toChecksumAddress(seaport_v_1_4))); + assert.isFalse( + isValidProtocol(Web3.utils.toChecksumAddress(seaport_v_1_4)) + ); assert.isFalse( isValidProtocol(Web3.utils.toChecksumAddress(randomAddress)) ); diff --git a/src/sdk.ts b/src/sdk.ts index 0a994252d..d61e0a75f 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -121,8 +121,6 @@ export class OpenSeaSDK { public web3ReadOnly: Web3; // Ethers provider public ethersProvider: providers.Web3Provider; - // Seaport v1.4 client - public seaport_v1_4: Seaport; // Seaport v1.5 client public seaport_v1_5: Seaport; // Logger function to use when debugging @@ -184,14 +182,6 @@ export class OpenSeaSDK { const providerOrSinger = wallet ? wallet : this.ethersProvider; - this.seaport_v1_4 = new Seaport(providerOrSinger, { - conduitKeyToConduit: CONDUIT_KEYS_TO_CONDUIT, - overrides: { - defaultConduitKey: CROSS_CHAIN_DEFAULT_CONDUIT_KEY, - }, - seaportVersion: "1.4", - }); - this.seaport_v1_5 = new Seaport(providerOrSinger, { conduitKeyToConduit: CONDUIT_KEYS_TO_CONDUIT, overrides: { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index f571ab08a..158fe3fa3 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,5 +1,4 @@ import { - CROSS_CHAIN_SEAPORT_V1_4_ADDRESS, CROSS_CHAIN_SEAPORT_V1_5_ADDRESS, ItemType, } from "@opensea/seaport-js/lib/constants"; @@ -1219,9 +1218,8 @@ export const feesToBasisPoints = ( */ export const isValidProtocol = (protocolAddress: string): boolean => { const checkSumAddress = Web3.utils.toChecksumAddress(protocolAddress); - const validProtocolAddresses = [ - CROSS_CHAIN_SEAPORT_V1_5_ADDRESS, - CROSS_CHAIN_SEAPORT_V1_4_ADDRESS, - ].map((address) => Web3.utils.toChecksumAddress(address)); + const validProtocolAddresses = [CROSS_CHAIN_SEAPORT_V1_5_ADDRESS].map( + (address) => Web3.utils.toChecksumAddress(address) + ); return validProtocolAddresses.includes(checkSumAddress); };