Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensea-js",
"version": "8.0.1",
"version": "8.0.2",
"description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data",
"license": "MIT",
"author": "OpenSea Developers",
Expand Down
7 changes: 7 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ export const GUNZILLA_SEAPORT_1_6_ADDRESS =
export const GUNZILLA_SIGNED_ZONE_V2_ADDRESS =
"0xdfe0000000005ce3008800300037e4c803ed08c7";

// =============================================================================
// Somnia-Specific Constants
// =============================================================================

export const SOMNIA_FEE_RECIPIENT =
"0xdfe1593dca6ad8a20eeb418643e48577c1626f7c";

// =============================================================================
// Token & Helper Addresses
// =============================================================================
Expand Down
5 changes: 5 additions & 0 deletions src/utils/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
OPENSEA_CONDUIT_KEY_2,
OPENSEA_FEE_RECIPIENT,
SIGNED_ZONE,
SOMNIA_FEE_RECIPIENT,
WPOL_ADDRESS,
} from "../constants";
import { Chain } from "../types";
Expand Down Expand Up @@ -193,6 +194,7 @@ export const getDefaultConduit = (
export const getSeaportAddress = (chain: Chain): string => {
switch (chain) {
case Chain.Gunzilla:
case Chain.Somnia:
return GUNZILLA_SEAPORT_1_6_ADDRESS;
default:
return CROSS_CHAIN_SEAPORT_V1_6_ADDRESS;
Expand All @@ -207,6 +209,7 @@ export const getSeaportAddress = (chain: Chain): string => {
export const getSignedZone = (chain: Chain): string => {
switch (chain) {
case Chain.Gunzilla:
case Chain.Somnia:
return GUNZILLA_SIGNED_ZONE_V2_ADDRESS;
default:
return SIGNED_ZONE;
Expand All @@ -222,6 +225,8 @@ export const getFeeRecipient = (chain: Chain): string => {
switch (chain) {
case Chain.Gunzilla:
return GUNZILLA_FEE_RECIPIENT;
case Chain.Somnia:
return SOMNIA_FEE_RECIPIENT;
default:
return OPENSEA_FEE_RECIPIENT;
}
Expand Down
17 changes: 17 additions & 0 deletions test/utils/chain.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SIGNED_ZONE,
OPENSEA_FEE_RECIPIENT,
GUNZILLA_FEE_RECIPIENT,
SOMNIA_FEE_RECIPIENT,
} from "../../src/constants";
import { Chain } from "../../src/types";
import {
Expand Down Expand Up @@ -316,6 +317,12 @@ suite("Utils: chain", () => {
);
});

test("returns Gunzilla Seaport 1.6 for Somnia", () => {
expect(getSeaportAddress(Chain.Somnia)).to.equal(
GUNZILLA_SEAPORT_1_6_ADDRESS,
);
});

test("returns cross-chain Seaport 1.6 for other chains", () => {
const otherChains = [
Chain.Polygon,
Expand Down Expand Up @@ -344,6 +351,12 @@ suite("Utils: chain", () => {
);
});

test("returns Gunzilla signed zone for Somnia", () => {
expect(getSignedZone(Chain.Somnia)).to.equal(
GUNZILLA_SIGNED_ZONE_V2_ADDRESS,
);
});

test("returns OpenSea signed zone for other chains", () => {
const otherChains = [
Chain.Polygon,
Expand All @@ -367,6 +380,10 @@ suite("Utils: chain", () => {
expect(getFeeRecipient(Chain.Gunzilla)).to.equal(GUNZILLA_FEE_RECIPIENT);
});

test("returns Somnia fee recipient for Somnia", () => {
expect(getFeeRecipient(Chain.Somnia)).to.equal(SOMNIA_FEE_RECIPIENT);
});

test("returns OpenSea fee recipient for other chains", () => {
const otherChains = [
Chain.Polygon,
Expand Down