Skip to content

Commit

Permalink
Remove seaport 1.4 from package (#954)
Browse files Browse the repository at this point in the history
* Remove seaport 1.4 from package

* Update package version

* Update code owner
  • Loading branch information
JoshuaSchmidt-OpenSea authored May 15, 2023
1 parent fbf5964 commit 49c8cc8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @ProjectOpenSea/developer-api
* @ProjectOpenSea/protocol
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/__tests__/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
Expand Down
10 changes: 0 additions & 10 deletions src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: {
Expand Down
8 changes: 3 additions & 5 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
CROSS_CHAIN_SEAPORT_V1_4_ADDRESS,
CROSS_CHAIN_SEAPORT_V1_5_ADDRESS,
ItemType,
} from "@opensea/seaport-js/lib/constants";
Expand Down Expand Up @@ -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);
};

0 comments on commit 49c8cc8

Please sign in to comment.