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 Nov 15, 2024
2 parents 3be9696 + 2413ff8 commit 1b2f33c
Show file tree
Hide file tree
Showing 72 changed files with 1,074 additions and 545 deletions.
2 changes: 1 addition & 1 deletion e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
context: ../.
dockerfile: ./e2e/opensea-api-mock/Dockerfile
user: "node:node"
image: opensea-api-mock:202518061227
image: opensea-api-mock:202410071017
ports:
- "3334:3334"
environment:
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",
"version": "1.7.10-alpha.31",
"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",
"@bosonprotocol/common": "^1.29.0-alpha.26",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"ethers": "^5.7.0",
Expand Down
6 changes: 3 additions & 3 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",
"version": "1.0.5-alpha.31",
"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",
"@bosonprotocol/common": "^1.29.0-alpha.26",
"@opensea/seaport-js": "^4.0.0",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
Expand All @@ -32,7 +32,7 @@
"express": "^4.18.1",
"express-validator": "^6.14.2",
"morgan": "^1.10.0",
"opensea-js": "^7.1.3",
"opensea-js": "^7.1.13",
"ts-command-line-args": "^2.3.1",
"winston": "^3.8.2"
},
Expand Down
14 changes: 7 additions & 7 deletions e2e/opensea-api-mock/src/services/opensea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export async function computeFulfillmentData(
function getOrderSide(sidePath: string): OrderSide {
switch (sidePath) {
case "listings": {
return OrderSide.ASK;
return OrderSide.LISTING;
}
case "offers": {
return OrderSide.BID;
return OrderSide.OFFER;
}
default:
throw new Error(`Invalid sidePath '${sidePath}'`);
Expand Down Expand Up @@ -151,17 +151,17 @@ function extractOrderInfo(
(c) => c.itemType === ItemType.ERC721
);
const nftAsk = parameters.offer.find((c) => c.itemType === ItemType.ERC721);
if (side === OrderSide.BID && !nftBid) {
if (side === OrderSide.OFFER && !nftBid) {
throw new Error(`NFT not found in order consideration`);
}
if (side === OrderSide.ASK && !nftAsk) {
if (side === OrderSide.LISTING && !nftAsk) {
throw new Error(`NFT not found in order offer`);
}
if (!side) {
if (nftBid && !nftAsk) {
side = OrderSide.BID;
side = OrderSide.OFFER;
} else if (!nftBid && nftAsk) {
side = OrderSide.ASK;
side = OrderSide.LISTING;
} else if (nftBid && nftAsk) {
throw new Error(
`NFT found in both consideration and offer. Unable to detect the order side`
Expand All @@ -172,7 +172,7 @@ function extractOrderInfo(
);
}
}
if (side === OrderSide.BID) {
if (side === OrderSide.OFFER) {
price = parameters.offer
.filter((c) => c.itemType === ItemType.ERC20)
.reduce(
Expand Down
47 changes: 24 additions & 23 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"graphql": "^16.8.1",
"ipfs-utils": "^9.0.14",
"lerna": "^5.5.1",
"opensea-js": "^7.1.5",
"opensea-js": "^7.1.13",
"prettier": "^3.2.5",
"run-script-os": "^1.1.6",
"ts-jest": "29.1.1",
Expand Down
2 changes: 1 addition & 1 deletion 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",
"version": "1.29.0-alpha.26",
"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
13 changes: 13 additions & 0 deletions packages/common/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
chainId: 31337,
configId: "local-31337-0",
sellersBlackList: "",
offersWhiteList: "",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(31337),
nativeCoin: chainIdToInfo.get(31337),
Expand Down Expand Up @@ -49,6 +50,8 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
configId: "testing-80002-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/testing-80002-0/sellers/blacklist.json",
offersWhiteList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/refs/heads/main/bosonApp.io/testing-80002-0/offers/whitelist.json",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(80002),
nativeCoin: chainIdToInfo.get(80002),
Expand Down Expand Up @@ -79,6 +82,8 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
configId: "testing-11155111-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/testing-11155111-0/sellers/blacklist.json",
offersWhiteList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/refs/heads/main/bosonApp.io/testing-11155111-0/offers/whitelist.json",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(11155111),
nativeCoin: chainIdToInfo.get(11155111),
Expand Down Expand Up @@ -107,6 +112,8 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
configId: "staging-80002-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/staging-80002-0/sellers/blacklist.json",
offersWhiteList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/refs/heads/main/bosonApp.io/staging-80002-0/offers/whitelist.json",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(80002),
nativeCoin: chainIdToInfo.get(80002),
Expand Down Expand Up @@ -137,6 +144,8 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
configId: "staging-11155111-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/staging-11155111-0/sellers/blacklist.json",
offersWhiteList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/refs/heads/main/bosonApp.io/staging-11155111-0/offers/whitelist.json",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(11155111),
nativeCoin: chainIdToInfo.get(11155111),
Expand Down Expand Up @@ -164,6 +173,8 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
configId: "production-137-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/production-137-0/sellers/blacklist.json",
offersWhiteList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/refs/heads/main/bosonApp.io/production-137-0/offers/whitelist.json",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(137),
nativeCoin: chainIdToInfo.get(137),
Expand Down Expand Up @@ -193,6 +204,8 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
configId: "production-1-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/production-1-0/sellers/blacklist.json",
offersWhiteList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/refs/heads/main/bosonApp.io/production-1-0/offers/whitelist.json",
defaultDisputeResolverId: "1",
defaultTokens: chainIdToDefaultTokens.get(1),
nativeCoin: chainIdToInfo.get(1),
Expand Down
6 changes: 6 additions & 0 deletions packages/common/src/types/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type ProtocolConfig = {
defaultTokens: Token[] | undefined;
defaultDisputeResolverId: string;
sellersBlackList: string;
offersWhiteList: string;
chainId: ChainId;
nativeCoin:
| undefined
Expand All @@ -75,3 +76,8 @@ export type ProtocolConfig = {
metaTx?: Partial<MetaTxConfig>;
lens: Lens | undefined;
};

export type CoreProtocolConfig = Pick<
ProtocolConfig,
"envName" | "chainId" | "configId"
>;
1 change: 1 addition & 0 deletions packages/common/src/types/web3-lib-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface Web3LibAdapter {
addressOrName: string,
blockNumber?: string | number
): Promise<BigNumberish>;
estimateGas(transactionRequest: TransactionRequest): Promise<BigNumberish>;
sendTransaction(
transactionRequest: TransactionRequest
): Promise<TransactionResponse>;
Expand Down
4 changes: 4 additions & 0 deletions packages/common/tests/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ export class MockWeb3LibAdapter implements Web3LibAdapter {
return this._returnValues.getBalance;
}

async estimateGas() {
return 1234;
}

async sendTransaction(args: TransactionRequest) {
this.sendTransactionArgs.push(args);
return this._returnValues.sendTransaction;
Expand Down
6 changes: 3 additions & 3 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.41.0-alpha.8",
"version": "1.41.0-alpha.40",
"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",
"@bosonprotocol/common": "^1.29.0-alpha.26",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
Expand All @@ -46,7 +46,7 @@
"graphql": "^16.5.0",
"graphql-request": "^4.3.0",
"mustache": "^4.2.0",
"opensea-js": "^7.1.5",
"opensea-js": "^7.1.13",
"schema-to-yup": "^1.11.11",
"yup": "^0.32.11"
},
Expand Down
1 change: 1 addition & 0 deletions packages/core-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export {
ConfigId,
MetaTxConfig,
ProtocolConfig,
CoreProtocolConfig,
abis
} from "@bosonprotocol/common";

Expand Down
Loading

0 comments on commit 1b2f33c

Please sign in to comment.