Skip to content

Commit a4ceed5

Browse files
ryaniomontasaurus
andauthored
fix returning counter as string (#175)
* return counter toString * bump version to 1.0.10 * fix tests * fix test --------- Co-authored-by: Adam Montgomery <montgomery.adam@gmail.com>
1 parent 26aa66b commit a4ceed5

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
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/seaport-js",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "[Seaport](https://github.com/ProjectOpenSea/seaport) is a new marketplace protocol for safely and efficiently buying and selling NFTs. This is a JavaScript library intended to make interfacing with the contract reasonable and easy.",
55
"license": "MIT",
66
"author": "OpenSea Developers",

src/__tests__/create-bulk-orders.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { expect } from "chai";
2-
import { BigNumber } from "ethers";
32
import { ethers } from "hardhat";
43
import { ItemType, MAX_INT, NO_CONDUIT, OrderType } from "../constants";
54
import {
@@ -129,7 +128,7 @@ describeWithFixture(
129128
zone: ethers.constants.AddressZero,
130129
zoneHash: ethers.constants.HashZero,
131130
conduitKey: NO_CONDUIT,
132-
counter: BigNumber.from(0),
131+
counter: "0",
133132
},
134133
signature: order.signature,
135134
});

src/__tests__/create-order.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ItemType, MAX_INT, NO_CONDUIT, OrderType } from "../constants";
66
import { ApprovalAction, CreateOrderAction } from "../types";
77
import { generateRandomSalt } from "../utils/order";
88
import { describeWithFixture } from "./utils/setup";
9-
import { BigNumber } from "ethers";
109

1110
describeWithFixture("As a user I want to create an order", (fixture) => {
1211
it("should create the order after setting needed approvals", async () => {
@@ -104,7 +103,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => {
104103
zone: ethers.constants.AddressZero,
105104
zoneHash: ethers.constants.HashZero,
106105
conduitKey: NO_CONDUIT,
107-
counter: BigNumber.from(0),
106+
counter: "0",
108107
},
109108
signature: order.signature,
110109
});
@@ -219,7 +218,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => {
219218
zone: ethers.constants.AddressZero,
220219
zoneHash: ethers.constants.HashZero,
221220
conduitKey: NO_CONDUIT,
222-
counter: BigNumber.from(0),
221+
counter: "0",
223222
},
224223
signature: order.signature,
225224
});
@@ -383,7 +382,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => {
383382
zone: ethers.constants.AddressZero,
384383
zoneHash: ethers.constants.HashZero,
385384
conduitKey: NO_CONDUIT,
386-
counter: BigNumber.from(0),
385+
counter: "0",
387386
},
388387
signature: order.signature,
389388
});
@@ -595,7 +594,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => {
595594
zone: ethers.constants.AddressZero,
596595
zoneHash: ethers.constants.HashZero,
597596
conduitKey: NO_CONDUIT,
598-
counter: BigNumber.from(0),
597+
counter: "0",
599598
},
600599
signature: order.signature,
601600
});

src/seaport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export class Seaport {
378378
totalOriginalConsiderationItems: considerationItemsWithFees.length,
379379
salt: saltFollowingConditional,
380380
conduitKey,
381-
counter: counter ?? (await this.getCounter(offerer)),
381+
counter: (counter ?? (await this.getCounter(offerer))).toString(),
382382
};
383383

384384
const approvalActions: ApprovalAction[] = [];

0 commit comments

Comments
 (0)