Skip to content

Commit

Permalink
Merge branch 'main' into ormi-0xgraph-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
levalleux-ludo committed Aug 1, 2024
2 parents 108fd32 + 996c7b3 commit 86ee541
Show file tree
Hide file tree
Showing 32 changed files with 590 additions and 143 deletions.
8 changes: 8 additions & 0 deletions e2e/meta-tx-gateway/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.7.9](https://github.com/bosonprotocol/core-components/compare/meta-tx-gateway@1.7.8...meta-tx-gateway@1.7.9) (2024-07-29)

**Note:** Version bump only for package meta-tx-gateway





## [1.7.8](https://github.com/bosonprotocol/core-components/compare/meta-tx-gateway@1.7.7...meta-tx-gateway@1.7.8) (2024-06-11)

**Note:** Version bump only for package meta-tx-gateway
Expand Down
4 changes: 2 additions & 2 deletions e2e/meta-tx-gateway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meta-tx-gateway",
"version": "1.7.9-alpha.20",
"version": "1.7.9",
"description": "",
"main": "index.js",
"private": true,
Expand All @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/bosonprotocol/core-components#readme",
"dependencies": {
"@bosonprotocol/common": "^1.28.1-alpha.20",
"@bosonprotocol/common": "^1.28.1",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"ethers": "^5.7.0",
Expand Down
8 changes: 8 additions & 0 deletions e2e/opensea-api-mock/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.0.4](https://github.com/bosonprotocol/core-components/compare/opensea-api-mock@1.0.3...opensea-api-mock@1.0.4) (2024-07-29)

**Note:** Version bump only for package opensea-api-mock





## [1.0.3](https://github.com/bosonprotocol/core-components/compare/opensea-api-mock@1.0.2...opensea-api-mock@1.0.3) (2024-06-11)

**Note:** Version bump only for package opensea-api-mock
Expand Down
4 changes: 2 additions & 2 deletions e2e/opensea-api-mock/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensea-api-mock",
"version": "1.0.4-alpha.20",
"version": "1.0.4",
"description": "",
"main": "index.js",
"private": true,
Expand All @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/bosonprotocol/core-components#readme",
"dependencies": {
"@bosonprotocol/common": "^1.28.1-alpha.20",
"@bosonprotocol/common": "^1.28.1",
"@opensea/seaport-js": "^4.0.0",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
Expand Down
58 changes: 34 additions & 24 deletions e2e/tests/core-sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ jest.setTimeout(60_000);
describe("core-sdk", () => {
describe("core user flows", () => {
test("create seller and offer", async () => {
const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet(
seedWallet
);
const { coreSDK, fundedWallet } =
await initCoreSDKWithFundedWallet(seedWallet);

const createdOffer = await createSellerAndOffer(
coreSDK,
Expand All @@ -69,9 +68,8 @@ describe("core-sdk", () => {
});

test("create seller, then create offer", async () => {
const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet(
seedWallet
);
const { coreSDK, fundedWallet } =
await initCoreSDKWithFundedWallet(seedWallet);

const seller = await createSeller(coreSDK, fundedWallet.address);
expect(seller).toBeTruthy();
Expand All @@ -96,9 +94,8 @@ describe("core-sdk", () => {
});

test("void offer", async () => {
const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet(
seedWallet
);
const { coreSDK, fundedWallet } =
await initCoreSDKWithFundedWallet(seedWallet);

const createdOffer = await createSellerAndOffer(
coreSDK,
Expand Down Expand Up @@ -139,9 +136,8 @@ describe("core-sdk", () => {

test("Create a group for multiple offers", async () => {
const tokenID = Date.now().toString();
const { sellerCoreSDK, sellerWallet } = await initSellerAndBuyerSDKs(
seedWallet
);
const { sellerCoreSDK, sellerWallet } =
await initSellerAndBuyerSDKs(seedWallet);
await ensureCreatedSeller(sellerWallet);

// Create 3 offers
Expand Down Expand Up @@ -190,9 +186,8 @@ describe("core-sdk", () => {

test("createOfferWithCondition()", async () => {
const tokenID = Date.now().toString();
const { sellerCoreSDK, sellerWallet } = await initSellerAndBuyerSDKs(
seedWallet
);
const { sellerCoreSDK, sellerWallet } =
await initSellerAndBuyerSDKs(seedWallet);
await ensureCreatedSeller(sellerWallet);

// Ensure the condition token is minted
Expand Down Expand Up @@ -237,9 +232,8 @@ describe("core-sdk", () => {

test("createSellerAndOfferWithCondition()", async () => {
const tokenID = Date.now().toString();
const { sellerCoreSDK, sellerWallet } = await initSellerAndBuyerSDKs(
seedWallet
);
const { sellerCoreSDK, sellerWallet } =
await initSellerAndBuyerSDKs(seedWallet);

// Ensure the condition token is minted
await ensureMintedERC1155(sellerWallet, tokenID, "5");
Expand Down Expand Up @@ -1007,9 +1001,8 @@ describe("core-sdk", () => {
await ensureMintedAndAllowedTokens([buyerWallet], offerPrice, false);

// Check the allowance is not enough
const allowance = await buyerCoreSDK.getProtocolAllowance(
MOCK_ERC20_ADDRESS
);
const allowance =
await buyerCoreSDK.getProtocolAllowance(MOCK_ERC20_ADDRESS);
expect(BigNumber.from(allowance).lt(createdOffer.price)).toBe(true);

const exchange = await commitToOffer({
Expand Down Expand Up @@ -1111,6 +1104,12 @@ describe("core-sdk", () => {

expect(exchangeAfterComplete.state).toBe(ExchangeState.COMPLETED);
expect(exchangeAfterComplete.completedDate).toBeTruthy();
expect(exchangeAfterComplete.protocolFeeCollected).toBeTruthy();
expect(
BigNumber.from(exchangeAfterComplete.protocolFeeCollected?.amount).eq(
createdOffer.protocolFee
)
).toBe(true);
});

test("redeem + finalize batch", async () => {
Expand Down Expand Up @@ -1148,8 +1147,20 @@ describe("core-sdk", () => {

expect(exchangesAfterComplete[0].state).toBe(ExchangeState.COMPLETED);
expect(exchangesAfterComplete[0].completedDate).toBeTruthy();
expect(exchangesAfterComplete[0].protocolFeeCollected).toBeTruthy();
expect(
BigNumber.from(
exchangesAfterComplete[0].protocolFeeCollected?.amount
).eq(createdOffer.protocolFee)
).toBe(true);
expect(exchangesAfterComplete[1].state).toBe(ExchangeState.COMPLETED);
expect(exchangesAfterComplete[1].completedDate).toBeTruthy();
expect(exchangesAfterComplete[1].protocolFeeCollected).toBeTruthy();
expect(
BigNumber.from(
exchangesAfterComplete[1].protocolFeeCollected?.amount
).eq(createdOffer.protocolFee)
).toBe(true);
});

describe("disputes", () => {
Expand Down Expand Up @@ -1336,9 +1347,8 @@ describe("core-sdk", () => {

describe("getSellerByAddress()", () => {
test("getSellerByAddress() retrieve the seller using the address", async () => {
const { coreSDK, fundedWallet } = await initCoreSDKWithFundedWallet(
seedWallet
);
const { coreSDK, fundedWallet } =
await initCoreSDKWithFundedWallet(seedWallet);

const seller = await createSeller(coreSDK, fundedWallet.address);
expect(seller).toBeTruthy();
Expand Down
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.28.1](https://github.com/bosonprotocol/core-components/compare/@bosonprotocol/common@1.28.0...@bosonprotocol/common@1.28.1) (2024-07-29)

**Note:** Version bump only for package @bosonprotocol/common





# [1.28.0](https://github.com/bosonprotocol/core-components/compare/@bosonprotocol/common@1.27.3...@bosonprotocol/common@1.28.0) (2024-06-11)


Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/common",
"version": "1.28.1-alpha.20",
"version": "1.28.1",
"description": "Common configs, types, interfaces and utilities shared by the core components of the Boson Protocol.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -38,7 +38,7 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@bosonprotocol/metadata": "^1.16.2-alpha.15",
"@bosonprotocol/metadata": "^1.16.2",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/core-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.40.5](https://github.com/bosonprotocol/core-components/compare/@bosonprotocol/core-sdk@1.40.4...@bosonprotocol/core-sdk@1.40.5) (2024-07-29)

**Note:** Version bump only for package @bosonprotocol/core-sdk





## [1.40.4](https://github.com/bosonprotocol/core-components/compare/@bosonprotocol/core-sdk@1.40.3...@bosonprotocol/core-sdk@1.40.4) (2024-06-11)

**Note:** Version bump only for package @bosonprotocol/core-sdk
Expand Down
4 changes: 2 additions & 2 deletions packages/core-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/core-sdk",
"version": "1.40.5-alpha.20",
"version": "1.41.0-alpha.0",
"description": "Facilitates interaction with the contracts and subgraphs of the Boson Protocol",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
"access": "public"
},
"dependencies": {
"@bosonprotocol/common": "^1.28.1-alpha.20",
"@bosonprotocol/common": "^1.28.1",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
Expand Down
Loading

0 comments on commit 86ee541

Please sign in to comment.