diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0c265ebe..5e6af5ab6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -62,7 +62,7 @@ jobs: - name: Build run: | npm run build -- --cache-dir=".turbo" - - run: cd e2e && docker-compose build && cd .. + - run: cd e2e && docker compose build && cd .. # In this step, this action saves a list of existing images, # the cache is created without them in the post run. # It also restores the cache if it exists. diff --git a/e2e/run-e2e-services.cmd b/e2e/run-e2e-services.cmd index c351acc25..a350f67d1 100644 --- a/e2e/run-e2e-services.cmd +++ b/e2e/run-e2e-services.cmd @@ -5,14 +5,14 @@ call npm ci cd .. cd e2e -docker-compose up -d +docker compose up -d echo *** Waiting for services... *** timeout /t 15 /nobreak >nul echo. echo *** Deploying contracts... *** -docker-compose exec hardhat-node npm run deploy +docker compose exec hardhat-node npm run deploy if %ERRORLEVEL% NEQ 0 ( echo Contracts couldn't be deployed exit /B 1 @@ -34,6 +34,6 @@ echo *** Successfully deployed subgraph *** echo. set /p DUMMY=*** Press any key to shutdown services *** -docker-compose down -v +docker compose down -v rmdir /S /Q .\data cd .. \ No newline at end of file diff --git a/e2e/run-e2e-services.sh b/e2e/run-e2e-services.sh index ec7f286f6..3d3ea54d1 100755 --- a/e2e/run-e2e-services.sh +++ b/e2e/run-e2e-services.sh @@ -3,7 +3,7 @@ trap cleanup EXIT INT TERM function cleanup() { - docker-compose down -v + docker compose down -v rm -rf ./data exit } @@ -14,7 +14,7 @@ npm ci cd .. cd e2e -docker-compose up -d #--build +docker compose up -d #--build echo "Waiting for services..." sleep 15 diff --git a/e2e/run-e2e-suite.cmd b/e2e/run-e2e-suite.cmd index ca26a55a0..5b7890e6c 100644 --- a/e2e/run-e2e-suite.cmd +++ b/e2e/run-e2e-suite.cmd @@ -5,14 +5,14 @@ call npm ci cd .. cd e2e -docker-compose up -d +docker compose up -d echo *** Waiting for services... *** timeout /t 15 /nobreak >nul echo. echo *** Deploying contracts... *** -docker-compose exec hardhat-node npm run deploy +docker compose exec hardhat-node npm run deploy if %ERRORLEVEL% NEQ 0 ( echo Contracts couldn't be deployed exit /B 1 @@ -35,6 +35,6 @@ call npm run e2e:test -- --no-cache set EXIT_STATUS=%ERRORLEVEL% cd e2e -docker-compose down -v +docker compose down -v cd .. exit %EXIT_STATUS% \ No newline at end of file diff --git a/e2e/run-e2e-suite.sh b/e2e/run-e2e-suite.sh index a8af24b8d..53e70cdfc 100755 --- a/e2e/run-e2e-suite.sh +++ b/e2e/run-e2e-suite.sh @@ -5,7 +5,7 @@ trap cleanup EXIT INT TERM function cleanup() { exit_status=$? cd e2e - docker-compose down -v + docker compose down -v exit "$exit_status" } @@ -15,7 +15,7 @@ npm ci cd .. cd e2e -docker-compose up -d +docker compose up -d echo "Waiting for services..." sleep 15 diff --git a/e2e/tests/opensea-price-discovery.test.ts b/e2e/tests/opensea-price-discovery.test.ts index dafc2c455..176d424d2 100644 --- a/e2e/tests/opensea-price-discovery.test.ts +++ b/e2e/tests/opensea-price-discovery.test.ts @@ -532,13 +532,11 @@ describe("Opensea Price Discovery", () => { sellerCoreSDK ); // Call commitToPriceDiscoveryOffer, that will fulfil the Order on Seaport - const fulfilmentData = await openseaSdkSeller.generateFulfilmentData( - { - contract: voucherContract, - tokenId: listing.asset.tokenId - }, - true // withWrapper - ); + const fulfilmentData = await openseaSdkSeller.generateFulfilmentData({ + contract: voucherContract, + tokenId: listing.asset.tokenId, + withWrapper: true + }); const txCommit = await sellerCoreSDK.commitToPriceDiscoveryOffer( buyerWallet.address, listing.asset.tokenId, diff --git a/package-lock.json b/package-lock.json index bba4b40e9..ebdaaded3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42904,7 +42904,7 @@ }, "packages/core-sdk": { "name": "@bosonprotocol/core-sdk", - "version": "1.41.0-alpha.0", + "version": "1.41.0-alpha.8", "license": "Apache-2.0", "dependencies": { "@bosonprotocol/common": "^1.28.1", @@ -43007,7 +43007,7 @@ }, "packages/ipfs-storage": { "name": "@bosonprotocol/ipfs-storage", - "version": "1.11.4", + "version": "1.12.0-alpha.6", "license": "Apache-2.0", "dependencies": { "@bosonprotocol/metadata-storage": "^1.0.1", @@ -43048,13 +43048,13 @@ }, "packages/react-kit": { "name": "@bosonprotocol/react-kit", - "version": "0.33.1-alpha.2", + "version": "0.34.0-alpha.6", "license": "Apache-2.0", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.41.0-alpha.0", + "@bosonprotocol/core-sdk": "^1.41.0-alpha.8", "@bosonprotocol/ethers-sdk": "^1.14.5", - "@bosonprotocol/ipfs-storage": "^1.11.4", + "@bosonprotocol/ipfs-storage": "^1.12.0-alpha.6", "@davatar/react": "1.11.1", "@ethersproject/units": "5.6.0", "@glidejs/glide": "3.6.0", @@ -43846,7 +43846,7 @@ }, "packages/subgraph": { "name": "@bosonprotocol/subgraph", - "version": "1.34.0-alpha.0", + "version": "1.34.0-alpha.8", "license": "Apache-2.0", "dependencies": { "@graphprotocol/graph-cli": "0.68.5", diff --git a/packages/core-sdk/package.json b/packages/core-sdk/package.json index e5f970c5b..0b2f4f0e9 100644 --- a/packages/core-sdk/package.json +++ b/packages/core-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/core-sdk", - "version": "1.41.0-alpha.0", + "version": "1.41.0-alpha.8", "description": "Facilitates interaction with the contracts and subgraphs of the Boson Protocol", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/packages/core-sdk/src/erc20/handler.ts b/packages/core-sdk/src/erc20/handler.ts index 211d92e58..9348c9c9a 100644 --- a/packages/core-sdk/src/erc20/handler.ts +++ b/packages/core-sdk/src/erc20/handler.ts @@ -1,4 +1,4 @@ -import { Web3LibAdapter } from "@bosonprotocol/common"; +import { Web3LibAdapter, TransactionRequest } from "@bosonprotocol/common"; import { BigNumber, BigNumberish } from "@ethersproject/bignumber"; import { erc20Iface } from "./interface"; @@ -7,8 +7,10 @@ export async function approve(args: { spender: string; value: BigNumberish; web3Lib: Web3LibAdapter; + txRequest?: TransactionRequest; }) { return args.web3Lib.sendTransaction({ + ...args.txRequest, to: args.contractAddress, data: erc20Iface.encodeFunctionData("approve", [args.spender, args.value]) }); @@ -74,6 +76,7 @@ export async function ensureAllowance(args: { contractAddress: string; value: BigNumberish; web3Lib: Web3LibAdapter; + txRequest?: TransactionRequest; }) { const allowance = await getAllowance(args); if (BigNumber.from(allowance).lt(args.value)) { diff --git a/packages/core-sdk/src/erc721/handler.ts b/packages/core-sdk/src/erc721/handler.ts index d20f67480..ce4f37815 100644 --- a/packages/core-sdk/src/erc721/handler.ts +++ b/packages/core-sdk/src/erc721/handler.ts @@ -1,4 +1,4 @@ -import { Web3LibAdapter } from "@bosonprotocol/common"; +import { TransactionRequest, Web3LibAdapter } from "@bosonprotocol/common"; import { BigNumberish } from "@ethersproject/bignumber"; import { erc721Iface } from "./interface"; @@ -101,8 +101,10 @@ export async function setApprovalForAll(args: { operator: string; approved: boolean; web3Lib: Web3LibAdapter; + txRequest?: TransactionRequest; }) { return args.web3Lib.sendTransaction({ + ...args.txRequest, to: args.contractAddress, data: erc721Iface.encodeFunctionData("setApprovalForAll", [ args.operator, diff --git a/packages/core-sdk/src/index.ts b/packages/core-sdk/src/index.ts index 0cb9dc2c8..53795b072 100644 --- a/packages/core-sdk/src/index.ts +++ b/packages/core-sdk/src/index.ts @@ -14,6 +14,7 @@ export * as groups from "./groups"; export * as forwarder from "./forwarder"; export * as voucher from "./voucher"; export * as seaport from "./seaport"; +export * as marketplaces from "./marketplaces"; export { envConfigs, diff --git a/packages/core-sdk/src/marketplaces/index.ts b/packages/core-sdk/src/marketplaces/index.ts new file mode 100644 index 000000000..eea524d65 --- /dev/null +++ b/packages/core-sdk/src/marketplaces/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/core-sdk/src/marketplaces/opensea.ts b/packages/core-sdk/src/marketplaces/opensea.ts index 9a8d9e013..cd2d32a39 100644 --- a/packages/core-sdk/src/marketplaces/opensea.ts +++ b/packages/core-sdk/src/marketplaces/opensea.ts @@ -4,7 +4,6 @@ import { FulfillmentDataResponse, GetNFTResponse, OrderAPIOptions, - OrderSide, OrderV2, OrdersQueryOptions, ProtocolData @@ -18,6 +17,8 @@ import { Marketplace, MarketplaceType, Order, + OrderFilterOptions, + OrderSide, SignedOrder, Wrapper } from "./types"; @@ -68,6 +69,9 @@ export type OpenSeaSDKHandler = { api: { apiBaseUrl: string; getOrder(order: Omit): Promise; + getOrders( + order: Omit + ): Promise<{ orders: OrderV2[] }>; generateFulfillmentData( fulfillerAddress: string, orderHash: string, @@ -253,7 +257,7 @@ export class OpenSeaMarketplace extends Marketplace { const protocolAddress = listing.protocolAddress || this._contracts.seaport; if (!protocolAddress) { throw new Error( - `Seaport protocol address must be specified in Lsiting or CoreSDK config` + `Seaport protocol address must be specified in Listing or CoreSDK config` ); } @@ -265,18 +269,26 @@ export class OpenSeaMarketplace extends Marketplace { return this.convertOsOrder(osOrder); } - public async buildAdvancedOrder(asset: { - contract: string; - tokenId: string; - }): Promise { - // Asumption: we're fulfilling a Bid Order (don't know if it makes sense with an Ask order) + public async buildAdvancedOrder( + asset: { + contract: string; + tokenId: string; + withWrapper?: boolean; + }, + filter: OrderFilterOptions = {} + ): Promise { + // Assumption: we're fulfilling a Bid Order (don't know if it makes sense with an Ask order) const osOrder = await this._handler.api.getOrder({ assetContractAddress: asset.contract, tokenId: asset.tokenId, - side: OrderSide.BID + side: OrderSide.BID, + ...filter }); + const fulfillerAddress = asset.withWrapper + ? asset.contract // If the token is wrapped, the fulfiller is the wrapper contract itself + : this._contracts.priceDiscoveryClient; // otherwise the address of the PriceDiscoveryClient contract const ffd = await this._handler.api.generateFulfillmentData( - this._contracts.priceDiscoveryClient, // the address of the PriceDiscoveryClient contract, which will call the fulfilment method + fulfillerAddress, osOrder.orderHash, osOrder.protocolAddress, osOrder.side @@ -291,13 +303,12 @@ export class OpenSeaMarketplace extends Marketplace { return inputData.orders[0]; } - public async generateFulfilmentData( - asset: { - contract: string; - tokenId: string; - }, - withWrapper = false - ): Promise { + public async generateFulfilmentData(asset: { + contract: string; + tokenId: string; + withWrapper?: boolean; + }): Promise { + const withWrapper = !!asset.withWrapper; const wrapper = withWrapper ? await this.getOrCreateVouchersWrapper(asset.contract) : undefined; @@ -583,12 +594,14 @@ export class OpenSeaMarketplace extends Marketplace { contract: string; tokenId: string; }, - side: Side + side: Side, + filter: OrderFilterOptions = {} ): Promise { const osOrder = await this._handler.api.getOrder({ assetContractAddress: asset.contract, tokenId: asset.tokenId, - side: side === Side.Ask ? OrderSide.ASK : OrderSide.BID + side: side === Side.Ask ? OrderSide.ASK : OrderSide.BID, + ...filter }); return osOrder ? { @@ -597,4 +610,24 @@ export class OpenSeaMarketplace extends Marketplace { } : undefined; } + + public async getOrders( + asset: { + contract: string; + tokenIds: string[]; + }, + side: Side, + filter: OrderFilterOptions = {} + ): Promise { + const { orders } = await this._handler.api.getOrders({ + assetContractAddress: asset.contract, + tokenIds: asset.tokenIds, + side: side === Side.Ask ? OrderSide.ASK : OrderSide.BID, + ...filter + }); + return orders.map((osOrder) => ({ + ...this.convertOsOrder(osOrder), + signature: osOrder.protocolData?.signature + })); + } } diff --git a/packages/core-sdk/src/marketplaces/types.ts b/packages/core-sdk/src/marketplaces/types.ts index 5d2dca774..f324079a8 100644 --- a/packages/core-sdk/src/marketplaces/types.ts +++ b/packages/core-sdk/src/marketplaces/types.ts @@ -16,7 +16,10 @@ export enum MarketplaceType { OPENSEA } -export enum OrderSide {} +export enum OrderSide { + ASK = "ask", + BID = "bid" +} export type MarketplaceHandler = OpenSeaSDKHandler | DefaultHandler; @@ -64,6 +67,12 @@ export abstract class Wrapper { public abstract get address(): string; } +export type OrderFilterOptions = { + maker?: string; + listedAfter?: number | string; + listedBefore?: number | string; +}; + export abstract class Marketplace { constructor(protected _type: MarketplaceType) {} public abstract createListing(listing: Listing): Promise; @@ -73,19 +82,30 @@ export abstract class Marketplace { contract: string; tokenId: string; }, - side: Side + side: Side, + filter?: OrderFilterOptions ): Promise; - public abstract generateFulfilmentData( + public abstract getOrders( asset: { contract: string; - tokenId: string; + tokenIds: string[]; }, - withWrapper?: boolean - ): Promise; - public abstract buildAdvancedOrder(asset: { + side: Side, + filter?: OrderFilterOptions + ): Promise; + public abstract generateFulfilmentData(asset: { contract: string; tokenId: string; - }): Promise; + withWrapper?: boolean; + }): Promise; + public abstract buildAdvancedOrder( + asset: { + contract: string; + tokenId: string; + withWrapper?: boolean; + }, + filter?: OrderFilterOptions + ): Promise; public abstract wrapVouchers( contract: string, tokenIds: string[] diff --git a/packages/ipfs-storage/package.json b/packages/ipfs-storage/package.json index 660ac76fa..0deb8bb20 100644 --- a/packages/ipfs-storage/package.json +++ b/packages/ipfs-storage/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/ipfs-storage", - "version": "1.11.4", + "version": "1.12.0-alpha.6", "description": "IPFS metadata storage implementation for building on top of the Boson Protocol.", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/packages/ipfs-storage/src/ipfs/base.ts b/packages/ipfs-storage/src/ipfs/base.ts index aa2fef422..02f1069cd 100644 --- a/packages/ipfs-storage/src/ipfs/base.ts +++ b/packages/ipfs-storage/src/ipfs/base.ts @@ -21,7 +21,11 @@ export class BaseIpfsStorage { return cid; } - public async get(uriOrHash: string, asJson = true): Promise { + public async get( + uriOrHash: string, + asJson = true, + asBlob = false + ): Promise { let cid: CID = null; try { cid = CID.parse( @@ -34,30 +38,79 @@ export class BaseIpfsStorage { } const value = await (cid - ? this.getByCID(cid.toString(), asJson) - : this.getByURL(uriOrHash, asJson)); + ? this.getByCID(cid.toString(), asJson, asBlob) + : this.getByURL(uriOrHash, asJson, asBlob)); return value; } - - public async getByCID(cid: string, asJson = true): Promise { + public async getByCID( + cid: string, + asJson: true, + asBlob: false + ): Promise; + public async getByCID( + cid: string, + asJson: false, + asBlob: true + ): Promise; + public async getByCID( + cid: string, + asJson: false, + asBlob: false + ): Promise; + public async getByCID( + cid: string, + asJson: boolean, + asBlob: boolean + ): Promise; + public async getByCID( + cid: string, + asJson = true, + asBlob = false + ): Promise { const chunks = []; for await (const chunk of this.ipfsClient.cat(cid)) { chunks.push(chunk); } const data = concat(chunks); - if (!asJson) { - return data as unknown as T; + if (!asJson && asBlob) { + return new Blob([data]); + } else if (!asJson) { + return data; } const dataStr = toString(data); - return JSON.parse(dataStr); + return JSON.parse(dataStr) as T; } - - public async getByURL(url: string, asJson = true): Promise { + public async getByURL( + url: string, + asJson: true, + asBlob: false + ): Promise; + public async getByURL( + url: string, + asJson: false, + asBlob: true + ): Promise; + public async getByURL( + url: string, + asJson: false, + asBlob: false + ): Promise; + public async getByURL( + url: string, + asJson: boolean, + asBlob: boolean + ): Promise; + public async getByURL( + url: string, + asJson = true, + asBlob = false + ): Promise { const response = await fetch(url); - - if (!asJson) { + if (!asJson && asBlob) { + return response.blob(); + } else if (!asJson) { return response.text(); } - return response.json(); + return response.json() as T; } } diff --git a/packages/ipfs-storage/src/ipfs/metadata.ts b/packages/ipfs-storage/src/ipfs/metadata.ts index 405cbe5c7..8dba80cf7 100644 --- a/packages/ipfs-storage/src/ipfs/metadata.ts +++ b/packages/ipfs-storage/src/ipfs/metadata.ts @@ -41,9 +41,9 @@ export class IpfsMetadataStorage * @returns Offer metadata. */ public async getMetadata(metadataUriOrHash: string): Promise { - const metadata = (await this.get( + const metadata = (await this.get( metadataUriOrHash - )) as ERC721Metadata; + )) as unknown as ERC721Metadata; if (metadata.type) { this.validateMetadata(metadata); } diff --git a/packages/react-kit/package.json b/packages/react-kit/package.json index d8cb2697d..ca7a74d9c 100644 --- a/packages/react-kit/package.json +++ b/packages/react-kit/package.json @@ -1,7 +1,7 @@ { "name": "@bosonprotocol/react-kit", "description": "React toolkit with smart components and hooks for building on top of the Boson Protocol.", - "version": "0.33.1-alpha.2", + "version": "0.34.0-alpha.6", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/cjs/index.d.ts", @@ -15,9 +15,9 @@ "license": "Apache-2.0", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.41.0-alpha.0", + "@bosonprotocol/core-sdk": "^1.41.0-alpha.8", "@bosonprotocol/ethers-sdk": "^1.14.5", - "@bosonprotocol/ipfs-storage": "^1.11.4", + "@bosonprotocol/ipfs-storage": "^1.12.0-alpha.6", "@davatar/react": "1.11.1", "@ethersproject/units": "5.6.0", "@glidejs/glide": "3.6.0", diff --git a/packages/react-kit/src/components/form/Upload/WithUploadToIpfs.tsx b/packages/react-kit/src/components/form/Upload/WithUploadToIpfs.tsx index 468bc9f48..45c063fa6 100644 --- a/packages/react-kit/src/components/form/Upload/WithUploadToIpfs.tsx +++ b/packages/react-kit/src/components/form/Upload/WithUploadToIpfs.tsx @@ -24,8 +24,8 @@ export interface WithUploadToIpfsProps { saveToIpfs: ( files: File[] | null ) => Promise; - loadMedia: (src: string) => string; - removeFile: (src: string) => void; + loadMedia: (src: string) => Promise; + removeFile: (src: string) => Promise; } export function WithUploadToIpfs

( WrappedComponent: React.ComponentType

diff --git a/packages/react-kit/src/components/form/index.ts b/packages/react-kit/src/components/form/index.ts index 753be94f8..93556b7b6 100644 --- a/packages/react-kit/src/components/form/index.ts +++ b/packages/react-kit/src/components/form/index.ts @@ -12,3 +12,5 @@ export * from "./BaseTagsInput"; export * from "./BaseTextArea"; export { default as BaseUpload, BaseUploadProps } from "./Upload/BaseUpload"; export { Upload, UploadProps } from "./Upload/Upload"; +export * from "./types"; +export * from "./Field.styles"; diff --git a/packages/react-kit/src/components/queryClient/withQueryClientProvider.tsx b/packages/react-kit/src/components/queryClient/withQueryClientProvider.tsx index f03cbea24..d78dabaa4 100644 --- a/packages/react-kit/src/components/queryClient/withQueryClientProvider.tsx +++ b/packages/react-kit/src/components/queryClient/withQueryClientProvider.tsx @@ -1,30 +1,5 @@ -import { - QueryClient, - QueryClientProvider, - QueryClientProviderProps -} from "react-query"; - import React from "react"; - -const queryClient = new QueryClient({ - defaultOptions: { - queries: { - refetchOnWindowFocus: false - } - } -}); - -type QueryClientProviderCustomProps = Partial; - -export const QueryClientProviderCustom: React.FC< - QueryClientProviderCustomProps -> = ({ ...props }) => { - return ( - - {props.children} - - ); -}; +import { QueryClientProviderCustom } from "./QueryClientProviderCustom"; export const withQueryClientProvider =

( WrappedComponent: React.ComponentType

diff --git a/packages/react-kit/src/hooks/index.ts b/packages/react-kit/src/hooks/index.ts index 65284554e..8642bea8d 100644 --- a/packages/react-kit/src/hooks/index.ts +++ b/packages/react-kit/src/hooks/index.ts @@ -25,3 +25,6 @@ export * from "./ipfs/useIpfsStorage"; export * from "./location/buildUseSearchParams"; export * from "./form/useForm"; export * from "./useBreakpoints"; +export * from "./useSignerAddress"; +export * from "./useMetaTx"; +export { useCtaClickHandler } from "./useCtaClickHandler"; diff --git a/packages/react-kit/src/hooks/useCtaClickHandler.ts b/packages/react-kit/src/hooks/useCtaClickHandler.ts index 638b3f73e..668478fff 100644 --- a/packages/react-kit/src/hooks/useCtaClickHandler.ts +++ b/packages/react-kit/src/hooks/useCtaClickHandler.ts @@ -20,7 +20,10 @@ export function useCtaClickHandler({ successPayload }: { waitBlocks: number; - coreSdk: CoreSDK; + coreSdk: Pick< + CoreSDK, + "relayNativeMetaTransaction" | "relayMetaTransaction" | "parseError" + >; useMetaTx: boolean; actions: Action[]; successPayload: T | ((receipt: providers.TransactionReceipt) => T); diff --git a/packages/react-kit/src/hooks/useMetaTx.ts b/packages/react-kit/src/hooks/useMetaTx.ts index a8bf319ff..acc68375a 100644 --- a/packages/react-kit/src/hooks/useMetaTx.ts +++ b/packages/react-kit/src/hooks/useMetaTx.ts @@ -1,7 +1,9 @@ import { CoreSDK } from "@bosonprotocol/core-sdk"; import { useSignerAddress } from "./useSignerAddress"; -export function useMetaTx(coreSdk: CoreSDK | undefined) { +export function useMetaTx( + coreSdk: Pick | undefined +) { const { signerAddress, signerContract } = useSignerAddress(coreSdk?.web3Lib); const isMetaTx = coreSdk ? Boolean(coreSdk.isMetaTxConfigSet && signerAddress && !signerContract) diff --git a/packages/react-kit/src/hooks/useRenderTemplate.ts b/packages/react-kit/src/hooks/useRenderTemplate.ts index 489e11ba2..5fdcb8487 100644 --- a/packages/react-kit/src/hooks/useRenderTemplate.ts +++ b/packages/react-kit/src/hooks/useRenderTemplate.ts @@ -28,10 +28,11 @@ export function useRenderTemplate( setRenderStatus(ProgressStatus.LOADING); if (ipfsMetadataStorage && coreSDK) { try { - const rawTemplate = await ipfsMetadataStorage.get( + const rawTemplate = (await ipfsMetadataStorage.get( templateUrl, + false, false - ); + )) as Uint8Array; const template = Buffer.from(rawTemplate).toString("utf-8"); let theOfferData = offerData; // If the offerData is not specified, retrieve the data from offerId diff --git a/packages/react-kit/src/index.tsx b/packages/react-kit/src/index.tsx index 9db4658b7..4f0757d0b 100644 --- a/packages/react-kit/src/index.tsx +++ b/packages/react-kit/src/index.tsx @@ -3,6 +3,7 @@ export * from "./components/buttons/BurgerButton"; export * from "./components/buttons/Button"; export * from "./components/buttons/CommitButtonView"; export * from "./components/config/ConfigProvider"; +export * from "./components/cta/common/types"; export * from "./components/cta/dispute/DecideDisputeButton"; export * from "./components/cta/dispute/EscalateDisputeButton"; export * from "./components/cta/dispute/ExpireDisputeButton"; @@ -45,6 +46,8 @@ export * from "./components/modal/components/Redeem/DetailView/ExternalExchangeD export * from "./components/portal/Portal"; export * from "./components/productCard/const"; export * from "./components/productCard/ProductCard"; +export * from "./components/queryClient/withQueryClientProvider"; +export * from "./components/queryClient/QueryClientProviderCustom"; export * from "./components/scroll/ScrollToID"; export * from "./components/scroll/ScrollToTop"; export * from "./components/searchBar/SearchBar"; @@ -85,6 +88,7 @@ export * from "./lib/magicLink/logout"; export * from "./lib/magicLink/provider"; export * from "./lib/offer/filter"; export * from "./lib/offer/getIsOfferExpired"; +export * from "./lib/opensea/getOpenSeaUrl"; export * from "./lib/promises/promises"; export * from "./lib/url/url"; export * from "./theme"; diff --git a/packages/react-kit/src/lib/base64/base64.ts b/packages/react-kit/src/lib/base64/base64.ts index 2816de864..5ce7a6658 100644 --- a/packages/react-kit/src/lib/base64/base64.ts +++ b/packages/react-kit/src/lib/base64/base64.ts @@ -48,10 +48,8 @@ export const fetchIpfsBase64Media = async ( return []; } const fetchPromises = ipfsLinks.map(async (src) => { - const imgData = await ipfsMetadataStorage.get(src, false); - const base64str = await blobToBase64( - new Blob([imgData as unknown as BlobPart]) - ); + const imgData = await ipfsMetadataStorage.get(src, false, true); + const base64str = await blobToBase64(new Blob([imgData])); if (!String(base64str).includes("base64")) { throw new Error("Decoded image is not in base64"); } diff --git a/packages/react-kit/src/stories/buttons/Upload.stories.tsx b/packages/react-kit/src/stories/buttons/Upload.stories.tsx index 5e2d0fc8d..4230e0c3a 100644 --- a/packages/react-kit/src/stories/buttons/Upload.stories.tsx +++ b/packages/react-kit/src/stories/buttons/Upload.stories.tsx @@ -1,11 +1,9 @@ -import { fn } from "@storybook/test"; import React from "react"; import { Meta } from "@storybook/react"; -import { Upload } from "../.."; +import { QueryClientProviderCustom, Upload } from "../.."; import { EnvironmentProvider } from "../../components/environment/EnvironmentProvider"; import { IpfsProvider } from "../../components/ipfs/IpfsProvider"; import { Formik } from "formik"; -import { QueryClientProviderCustom } from "../../components/queryClient/withQueryClientProvider"; import { bosonButtonThemeKeys, bosonButtonThemes diff --git a/packages/subgraph/package.json b/packages/subgraph/package.json index 4b1e091bb..c05c81008 100644 --- a/packages/subgraph/package.json +++ b/packages/subgraph/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/subgraph", - "version": "1.34.0-alpha.0", + "version": "1.34.0-alpha.8", "dependencies": { "@graphprotocol/graph-cli": "0.68.5", "@graphprotocol/graph-ts": "0.33.0" diff --git a/scripts/opensea/fulfil-order.ts b/scripts/opensea/fulfil-order.ts index f9774c4f9..7fdf75570 100644 --- a/scripts/opensea/fulfil-order.ts +++ b/scripts/opensea/fulfil-order.ts @@ -94,13 +94,11 @@ async function main() { ); } console.log("ORDER TO BE FULFILLED", order); - const priceDiscoveryStruct = await openseaSdkSeller.generateFulfilmentData( - { - contract: nftContract, - tokenId - }, - wrapped - ); + const priceDiscoveryStruct = await openseaSdkSeller.generateFulfilmentData({ + contract: nftContract, + tokenId, + withWrapper: wrapped + }); const BOSON_PROTOCOL = defaultConfig.contracts.protocolDiamond;