Skip to content
Closed
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 src/orders/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type OrderV2 = {
/** The hash of the order. */
orderHash: string | null;
/** The account that created the order. */
maker: OpenSeaAccount;
maker: OpenSeaAccount | null;
/** The account that filled the order. */
taker: OpenSeaAccount | null;
/** The protocol data for the order. Only 'seaport' is currently supported. */
Expand Down
2 changes: 1 addition & 1 deletion src/orders/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const deserializeOrder = (order: SerializedOrderV2): OrderV2 => {
listingTime: order.listing_time,
expirationTime: order.expiration_time,
orderHash: order.order_hash,
maker: accountFromJSON(order.maker),
maker: order.maker ? accountFromJSON(order.maker) : null,
taker: order.taker ? accountFromJSON(order.taker) : null,
protocolData: order.protocol_data,
protocolAddress: order.protocol_address,
Expand Down
3 changes: 3 additions & 0 deletions src/sdk/fulfillment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ export class FulfillmentManager {
* @throws Error if the order's protocol address is not supported by OpenSea. See {@link isValidProtocol}.
*/
async approveOrder(order: OrderV2, domain?: string) {
if (!order.maker) {
throw new Error("Order maker is required to approve an order");
}
await this.context.requireAccountIsAvailable(order.maker.address);
requireValidProtocol(order.protocolAddress);

Expand Down
4 changes: 2 additions & 2 deletions test/integration/bulkOrders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ suite("SDK: bulk order posting", () => {
}
expectValidOrder(order);
expect(order.expirationTime).to.equal(expirationTime);
expect(order.maker.address.toLowerCase()).to.equal(
expect(order.maker!.address.toLowerCase()).to.equal(
walletAddress.toLowerCase(),
);
});
Expand Down Expand Up @@ -273,7 +273,7 @@ suite("SDK: bulk order posting", () => {
}
expectValidOrder(order);
expect(order.expirationTime).to.equal(expirationTime);
expect(order.maker.address.toLowerCase()).to.equal(
expect(order.maker!.address.toLowerCase()).to.equal(
walletAddress.toLowerCase(),
);
expect(order.side).to.equal("ask");
Expand Down
2 changes: 1 addition & 1 deletion test/orders/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ suite("Orders: utils", () => {
expect(result.listingTime).to.equal(1704067200);
expect(result.expirationTime).to.equal(1735689599);
expect(result.orderHash).to.equal("0xOrderHash");
expect(result.maker.address).to.equal("0xMaker");
expect(result.maker!.address).to.equal("0xMaker");
expect(result.taker?.address).to.equal("0xTaker");
expect(result.protocolAddress).to.equal("0xProtocol");
expect(result.currentPrice).to.equal(BigInt("1000000000000000000"));
Expand Down