Skip to content

Commit 3491bab

Browse files
authored
feat: add monad support (#1827)
* feat: add `monad` support * use random address during fulfillment generation
1 parent 03409c1 commit 3491bab

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opensea-js",
3-
"version": "8.0.6",
3+
"version": "8.0.7",
44
"description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data",
55
"license": "MIT",
66
"author": "OpenSea Developers",

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export enum Chain {
135135
Gunzilla = "gunzilla",
136136
HyperEVM = "hyperevm",
137137
Somnia = "somnia",
138+
Monad = "monad",
138139
}
139140

140141
/**

src/utils/chain.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export const getChainId = (chain: Chain) => {
6363
return "999";
6464
case Chain.Somnia:
6565
return "5031";
66+
case Chain.Monad:
67+
return "143";
6668
default:
6769
throw new Error(`Unknown chainId for ${chain}`);
6870
}
@@ -111,6 +113,8 @@ export const getOfferPaymentToken = (chain: Chain) => {
111113
return "0x5555555555555555555555555555555555555555"; // WHYPE
112114
case Chain.Somnia:
113115
return "0x046ede9564a72571df6f5e44d0405360c0f4dcab"; // WSOMI
116+
case Chain.Monad:
117+
return "0x3bd359c1119da7da1d913d1c4d2b7c461115433a"; // WMON
114118
default:
115119
throw new Error(`Unknown offer currency for ${chain}`);
116120
}
@@ -135,6 +139,7 @@ export const getListingPaymentToken = (chain: Chain) => {
135139
case Chain.Abstract:
136140
case Chain.Shape:
137141
case Chain.Unichain:
142+
case Chain.Monad:
138143
return "0x0000000000000000000000000000000000000000"; // ETH
139144
case Chain.Polygon:
140145
return "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"; // WETH
@@ -168,6 +173,7 @@ export const getDefaultConduit = (
168173
switch (chain) {
169174
case Chain.Abstract:
170175
case Chain.HyperEVM:
176+
case Chain.Monad:
171177
return {
172178
key: OPENSEA_CONDUIT_KEY_2,
173179
address: OPENSEA_CONDUIT_ADDRESS_2,

test/api/fulfillment.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { assert } from "chai";
2+
import { ethers } from "ethers";
23
import { suite, test } from "mocha";
34
import { OrderSide } from "../../src/types";
45
import { api } from "../utils/sdk";
@@ -15,7 +16,7 @@ suite("Generating fulfillment data", () => {
1516
}
1617

1718
const fulfillment = await api.generateFulfillmentData(
18-
"0x000000000000000000000000000000000000dEaD",
19+
ethers.Wallet.createRandom().address,
1920
order.orderHash,
2021
order.protocolAddress,
2122
order.side,
@@ -35,7 +36,7 @@ suite("Generating fulfillment data", () => {
3536
}
3637

3738
const fulfillment = await api.generateFulfillmentData(
38-
"0x000000000000000000000000000000000000dEaD",
39+
ethers.Wallet.createRandom().address,
3940
order.orderHash,
4041
order.protocolAddress,
4142
order.side,
@@ -64,7 +65,7 @@ suite("Generating fulfillment data", () => {
6465
try {
6566
// Test with consideration parameters for criteria offers
6667
const fulfillment = await api.generateFulfillmentData(
67-
"0x000000000000000000000000000000000000dEaD",
68+
ethers.Wallet.createRandom().address,
6869
collectionOffer.order_hash,
6970
collectionOffer.protocol_address,
7071
OrderSide.OFFER,

0 commit comments

Comments
 (0)