thirdweb 5.55.0 → 5.55.1-nightly-b2a2c9784a33394dffbcd32bbd28b2c612a4e603-20240915000420
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/contract/deployment/deploy-with-abi.js +17 -6
- package/dist/cjs/contract/deployment/deploy-with-abi.js.map +1 -1
- package/dist/cjs/exports/deploys.js +2 -2
- package/dist/cjs/exports/deploys.js.map +1 -1
- package/dist/cjs/exports/extensions/marketplace.js +14 -3
- package/dist/cjs/exports/extensions/marketplace.js.map +1 -1
- package/dist/cjs/extensions/marketplace/direct-listings/read/getListing.js +18 -2
- package/dist/cjs/extensions/marketplace/direct-listings/read/getListing.js.map +1 -1
- package/dist/cjs/extensions/marketplace/direct-listings/write/buyFromListing.js +21 -4
- package/dist/cjs/extensions/marketplace/direct-listings/write/buyFromListing.js.map +1 -1
- package/dist/cjs/extensions/marketplace/direct-listings/write/createListing.js +18 -2
- package/dist/cjs/extensions/marketplace/direct-listings/write/createListing.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/read/getAuction.js +18 -2
- package/dist/cjs/extensions/marketplace/english-auctions/read/getAuction.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/read/getWinningBid.js +19 -3
- package/dist/cjs/extensions/marketplace/english-auctions/read/getWinningBid.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/write/bidInAuction.js +27 -8
- package/dist/cjs/extensions/marketplace/english-auctions/write/bidInAuction.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/write/cancelAuction.js +19 -2
- package/dist/cjs/extensions/marketplace/english-auctions/write/cancelAuction.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/write/createAuction.js +18 -2
- package/dist/cjs/extensions/marketplace/english-auctions/write/createAuction.js.map +1 -1
- package/dist/cjs/extensions/prebuilts/deploy-published.js +6 -1
- package/dist/cjs/extensions/prebuilts/deploy-published.js.map +1 -1
- package/dist/cjs/extensions/prebuilts/get-required-transactions.js +110 -23
- package/dist/cjs/extensions/prebuilts/get-required-transactions.js.map +1 -1
- package/dist/cjs/gas/fee-data.js +2 -2
- package/dist/cjs/gas/fee-data.js.map +1 -1
- package/dist/cjs/utils/abi/normalizeFunctionParams.js +6 -6
- package/dist/cjs/utils/abi/normalizeFunctionParams.js.map +1 -1
- package/dist/cjs/utils/any-evm/deploy-metadata.js +2 -1
- package/dist/cjs/utils/any-evm/deploy-metadata.js.map +1 -1
- package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js +2 -2
- package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
- package/dist/cjs/utils/contract/parse-abi-params.js +3 -0
- package/dist/cjs/utils/contract/parse-abi-params.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/contract/deployment/deploy-with-abi.js +17 -6
- package/dist/esm/contract/deployment/deploy-with-abi.js.map +1 -1
- package/dist/esm/exports/deploys.js +1 -1
- package/dist/esm/exports/deploys.js.map +1 -1
- package/dist/esm/exports/extensions/marketplace.js +9 -8
- package/dist/esm/exports/extensions/marketplace.js.map +1 -1
- package/dist/esm/extensions/marketplace/direct-listings/read/getListing.js +17 -2
- package/dist/esm/extensions/marketplace/direct-listings/read/getListing.js.map +1 -1
- package/dist/esm/extensions/marketplace/direct-listings/write/buyFromListing.js +20 -4
- package/dist/esm/extensions/marketplace/direct-listings/write/buyFromListing.js.map +1 -1
- package/dist/esm/extensions/marketplace/direct-listings/write/createListing.js +17 -2
- package/dist/esm/extensions/marketplace/direct-listings/write/createListing.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/read/getAuction.js +17 -2
- package/dist/esm/extensions/marketplace/english-auctions/read/getAuction.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/read/getWinningBid.js +19 -4
- package/dist/esm/extensions/marketplace/english-auctions/read/getWinningBid.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/write/bidInAuction.js +26 -8
- package/dist/esm/extensions/marketplace/english-auctions/write/bidInAuction.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/write/cancelAuction.js +19 -3
- package/dist/esm/extensions/marketplace/english-auctions/write/cancelAuction.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/write/createAuction.js +17 -2
- package/dist/esm/extensions/marketplace/english-auctions/write/createAuction.js.map +1 -1
- package/dist/esm/extensions/prebuilts/deploy-published.js +6 -1
- package/dist/esm/extensions/prebuilts/deploy-published.js.map +1 -1
- package/dist/esm/extensions/prebuilts/get-required-transactions.js +108 -22
- package/dist/esm/extensions/prebuilts/get-required-transactions.js.map +1 -1
- package/dist/esm/gas/fee-data.js +2 -2
- package/dist/esm/gas/fee-data.js.map +1 -1
- package/dist/esm/utils/abi/normalizeFunctionParams.js +6 -6
- package/dist/esm/utils/abi/normalizeFunctionParams.js.map +1 -1
- package/dist/esm/utils/any-evm/deploy-metadata.js +2 -1
- package/dist/esm/utils/any-evm/deploy-metadata.js.map +1 -1
- package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js +1 -1
- package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
- package/dist/esm/utils/contract/parse-abi-params.js +3 -0
- package/dist/esm/utils/contract/parse-abi-params.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/contract/deployment/deploy-with-abi.d.ts.map +1 -1
- package/dist/types/exports/deploys.d.ts +1 -1
- package/dist/types/exports/deploys.d.ts.map +1 -1
- package/dist/types/exports/extensions/marketplace.d.ts +9 -8
- package/dist/types/exports/extensions/marketplace.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/read/getListing.d.ts +15 -2
- package/dist/types/extensions/marketplace/direct-listings/read/getListing.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/write/buyFromListing.d.ts +13 -0
- package/dist/types/extensions/marketplace/direct-listings/write/buyFromListing.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/write/createListing.d.ts +13 -0
- package/dist/types/extensions/marketplace/direct-listings/write/createListing.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/read/getAuction.d.ts +15 -2
- package/dist/types/extensions/marketplace/english-auctions/read/getAuction.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/read/getWinningBid.d.ts +15 -2
- package/dist/types/extensions/marketplace/english-auctions/read/getWinningBid.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/write/bidInAuction.d.ts +13 -0
- package/dist/types/extensions/marketplace/english-auctions/write/bidInAuction.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/write/cancelAuction.d.ts +13 -0
- package/dist/types/extensions/marketplace/english-auctions/write/cancelAuction.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/write/createAuction.d.ts +13 -0
- package/dist/types/extensions/marketplace/english-auctions/write/createAuction.d.ts.map +1 -1
- package/dist/types/extensions/prebuilts/deploy-published.d.ts.map +1 -1
- package/dist/types/extensions/prebuilts/get-required-transactions.d.ts +8 -8
- package/dist/types/extensions/prebuilts/get-required-transactions.d.ts.map +1 -1
- package/dist/types/utils/abi/normalizeFunctionParams.d.ts.map +1 -1
- package/dist/types/utils/any-evm/deploy-metadata.d.ts +27 -1
- package/dist/types/utils/any-evm/deploy-metadata.d.ts.map +1 -1
- package/dist/types/utils/any-evm/get-init-bytecode-with-salt.d.ts +1 -1
- package/dist/types/utils/any-evm/get-init-bytecode-with-salt.d.ts.map +1 -1
- package/dist/types/utils/contract/parse-abi-params.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/contract/deployment/deploy-with-abi.ts +19 -6
- package/src/exports/deploys.ts +1 -1
- package/src/exports/extensions/marketplace.ts +10 -0
- package/src/extensions/marketplace/direct-listings/read/getListing.ts +19 -7
- package/src/extensions/marketplace/direct-listings/write/buyFromListing.ts +23 -4
- package/src/extensions/marketplace/direct-listings/write/createListing.ts +18 -2
- package/src/extensions/marketplace/english-auctions/read/getAuction.ts +19 -7
- package/src/extensions/marketplace/english-auctions/read/getWinningBid.ts +21 -8
- package/src/extensions/marketplace/english-auctions/write/bidInAuction.ts +29 -8
- package/src/extensions/marketplace/english-auctions/write/cancelAuction.ts +25 -3
- package/src/extensions/marketplace/english-auctions/write/createAuction.ts +18 -2
- package/src/extensions/prebuilts/deploy-published.ts +7 -1
- package/src/extensions/prebuilts/get-required-transactions.test.ts +13 -11
- package/src/extensions/prebuilts/get-required-transactions.ts +149 -32
- package/src/gas/fee-data.ts +5 -1
- package/src/utils/abi/normalizeFunctionParams.ts +24 -19
- package/src/utils/any-evm/deploy-metadata.ts +33 -2
- package/src/utils/any-evm/get-init-bytecode-with-salt.ts +2 -2
- package/src/utils/contract/parse-abi-params.ts +3 -0
- package/src/version.ts +1 -1
@@ -29,4 +29,17 @@ export type BidInAuctionParams = {
|
|
29
29
|
* ```
|
30
30
|
*/
|
31
31
|
export declare function bidInAuction(options: BaseTransactionOptions<BidInAuctionParams>): import("../../../../transaction/prepare-transaction.js").PreparedTransaction<any, import("abitype").AbiFunction, import("../../../../transaction/prepare-transaction.js").PrepareTransactionOptions>;
|
32
|
+
/**
|
33
|
+
* Checks if the `bidInAuction` method is supported by the given contract.
|
34
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
35
|
+
* @returns A boolean indicating if the `bidInAuction` method is supported.
|
36
|
+
* @extension MARKETPLACE
|
37
|
+
* @example
|
38
|
+
* ```ts
|
39
|
+
* import { isBidInAuctionSupported } from "thirdweb/extensions/marketplace";
|
40
|
+
*
|
41
|
+
* const supported = isBidInAuctionSupported(["0x..."]);
|
42
|
+
* ```
|
43
|
+
*/
|
44
|
+
export declare function isBidInAuctionSupported(availableSelectors: string[]): boolean;
|
32
45
|
//# sourceMappingURL=bidInAuction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bidInAuction.d.ts","sourceRoot":"","sources":["../../../../../../src/extensions/marketplace/english-auctions/write/bidInAuction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAM/E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,CACA;IACE,YAAY,EAAE,MAAM,CAAC;CACtB,GACD;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,wMAoEpD"}
|
1
|
+
{"version":3,"file":"bidInAuction.d.ts","sourceRoot":"","sources":["../../../../../../src/extensions/marketplace/english-auctions/write/bidInAuction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAM/E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,CACA;IACE,YAAY,EAAE,MAAM,CAAC;CACtB,GACD;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,wMAoEpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAOnE"}
|
@@ -26,4 +26,17 @@ export type CancelAuctionParams = {
|
|
26
26
|
* ```
|
27
27
|
*/
|
28
28
|
export declare function cancelAuction(options: BaseTransactionOptions<CancelAuctionParams>): import("../../../../transaction/prepare-transaction.js").PreparedTransaction<any, import("abitype").AbiFunction, import("../../../../transaction/prepare-transaction.js").PrepareTransactionOptions>;
|
29
|
+
/**
|
30
|
+
* Checks if the `cancelAuction` method is supported by the given contract.
|
31
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
32
|
+
* @returns A boolean indicating if the `cancelAuction` method is supported.
|
33
|
+
* @extension MARKETPLACE
|
34
|
+
* @example
|
35
|
+
* ```ts
|
36
|
+
* import { isCancelAuctionSupported } from "thirdweb/extensions/marketplace";
|
37
|
+
*
|
38
|
+
* const supported = isCancelAuctionSupported(["0x..."]);
|
39
|
+
* ```
|
40
|
+
*/
|
41
|
+
export declare function isCancelAuctionSupported(availableSelectors: string[]): boolean;
|
29
42
|
//# sourceMappingURL=cancelAuction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cancelAuction.d.ts","sourceRoot":"","sources":["../../../../../../src/extensions/marketplace/english-auctions/write/cancelAuction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
1
|
+
{"version":3,"file":"cancelAuction.d.ts","sourceRoot":"","sources":["../../../../../../src/extensions/marketplace/english-auctions/write/cancelAuction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAO/E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,wMAoBrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAKpE"}
|
@@ -95,5 +95,18 @@ export type CreateAuctionParams = {
|
|
95
95
|
* ```
|
96
96
|
*/
|
97
97
|
export declare function createAuction(options: BaseTransactionOptions<CreateAuctionParams>): import("../../../../transaction/prepare-transaction.js").PreparedTransaction<any, import("abitype").AbiFunction, import("../../../../transaction/prepare-transaction.js").PrepareTransactionOptions>;
|
98
|
+
/**
|
99
|
+
* Checks if the `createAuction` method is supported by the given contract.
|
100
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
101
|
+
* @returns A boolean indicating if the `createAuction` method is supported.
|
102
|
+
* @extension MARKETPLACE
|
103
|
+
* @example
|
104
|
+
* ```ts
|
105
|
+
* import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace";
|
106
|
+
*
|
107
|
+
* const supported = isCreateAuctionSupported(["0x..."]);
|
108
|
+
* ```
|
109
|
+
*/
|
110
|
+
export declare function isCreateAuctionSupported(availableSelectors: string[]): boolean;
|
98
111
|
export {};
|
99
112
|
//# sourceMappingURL=createAuction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createAuction.d.ts","sourceRoot":"","sources":["../../../../../../src/extensions/marketplace/english-auctions/write/createAuction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAM/E;;GAEG;AACH,KAAK,gBAAgB,GACjB;IACE;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEN;;GAEG;AACH,KAAK,eAAe,GAChB;IACE;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB,GACD;IACE;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IAEpB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,gBAAgB,GAClB,eAAe,CAAC;AAElB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,wMA+HrD"}
|
1
|
+
{"version":3,"file":"createAuction.d.ts","sourceRoot":"","sources":["../../../../../../src/extensions/marketplace/english-auctions/write/createAuction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAM/E;;GAEG;AACH,KAAK,gBAAgB,GACjB;IACE;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEN;;GAEG;AACH,KAAK,eAAe,GAChB;IACE;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB,GACD;IACE;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IAEpB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,gBAAgB,GAClB,eAAe,CAAC;AAElB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,wMA+HrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAEpE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deploy-published.d.ts","sourceRoot":"","sources":["../../../../src/extensions/prebuilts/deploy-published.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAc7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAGxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;
|
1
|
+
{"version":3,"file":"deploy-published.d.ts","sourceRoot":"","sources":["../../../../src/extensions/prebuilts/deploy-published.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAc7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAGxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAGlE;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,MAAM,CAAC,CA4BjB;AAED;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,yBAAyB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,CAAC,EAAE;QACR,cAAc,EAAE,yBAAyB,CAAC;QAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5C,EAAE,CAAC;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,uCAAuC,GAC/C,OAAO,CAAC,MAAM,CAAC,CAkHjB"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { Chain } from "../../chains/types.js";
|
2
2
|
import type { ThirdwebClient } from "../../client/client.js";
|
3
|
-
import type {
|
3
|
+
import type { DeployContractfromDeployMetadataOptions } from "./deploy-published.js";
|
4
4
|
/**
|
5
5
|
* @internal
|
6
6
|
*/
|
7
|
-
export type DeployTransactionType = "infra" | "implementation" | "module" | "proxy";
|
7
|
+
export type DeployTransactionType = "infra" | "implementation" | "module" | "extension" | "proxy";
|
8
8
|
/**
|
9
9
|
* @internal
|
10
10
|
*/
|
@@ -15,12 +15,12 @@ export type DeployTransactionResult = {
|
|
15
15
|
/**
|
16
16
|
* @internal
|
17
17
|
*/
|
18
|
-
export declare function
|
18
|
+
export declare function getRequiredTransactions(options: Omit<DeployContractfromDeployMetadataOptions, "account" | "initializeParams">): Promise<DeployTransactionResult[]>;
|
19
|
+
export declare function getAllDefaultConstructorParamsForImplementation(args: {
|
19
20
|
chain: Chain;
|
20
21
|
client: ThirdwebClient;
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}): Promise<DeployTransactionResult[]>;
|
22
|
+
}): Promise<{
|
23
|
+
trustedForwarder: string;
|
24
|
+
nativeTokenWrapper: string;
|
25
|
+
}>;
|
26
26
|
//# sourceMappingURL=get-required-transactions.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-required-transactions.d.ts","sourceRoot":"","sources":["../../../../src/extensions/prebuilts/get-required-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
1
|
+
{"version":3,"file":"get-required-transactions.d.ts","sourceRoot":"","sources":["../../../../src/extensions/prebuilts/get-required-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAO7D,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,uBAAuB,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,OAAO,GACP,gBAAgB,GAChB,QAAQ,GACR,WAAW,GACX,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,IAAI,CACX,uCAAuC,EACvC,SAAS,GAAG,kBAAkB,CAC/B,GACA,OAAO,CAAC,uBAAuB,EAAE,CAAC,CA2EpC;AA8FD,wBAAsB,+CAA+C,CAAC,IAAI,EAAE;IAC1E,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;CACxB;;;GAkBA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"normalizeFunctionParams.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/normalizeFunctionParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"normalizeFunctionParams.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/normalizeFunctionParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3D,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,GAAG,cAAc,GAAG,SAAS,EACrD,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACnC,OAAO,EAAE,CA2BX"}
|
@@ -17,7 +17,33 @@ export declare function fetchDeployMetadata(options: FetchDeployMetadataOptions)
|
|
17
17
|
type ParsedCompilerMetadata = {
|
18
18
|
name: string;
|
19
19
|
abi: Abi;
|
20
|
-
metadata:
|
20
|
+
metadata: {
|
21
|
+
compiler: {
|
22
|
+
version: string;
|
23
|
+
};
|
24
|
+
language: string;
|
25
|
+
output: {
|
26
|
+
abi: Abi;
|
27
|
+
devdoc: Record<string, unknown>;
|
28
|
+
userdoc: Record<string, unknown>;
|
29
|
+
};
|
30
|
+
settings: {
|
31
|
+
compilationTarget: Record<string, unknown>;
|
32
|
+
evmVersion: string;
|
33
|
+
libraries: Record<string, string>;
|
34
|
+
optimizer: Record<string, unknown>;
|
35
|
+
remappings: string[];
|
36
|
+
};
|
37
|
+
sources: Record<string, {
|
38
|
+
keccak256: string;
|
39
|
+
} & ({
|
40
|
+
content: string;
|
41
|
+
} | {
|
42
|
+
urls: string[];
|
43
|
+
license?: string;
|
44
|
+
})>;
|
45
|
+
[key: string]: unknown;
|
46
|
+
};
|
21
47
|
info: {
|
22
48
|
title?: string;
|
23
49
|
author?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deploy-metadata.d.ts","sourceRoot":"","sources":["../../../../src/utils/any-evm/deploy-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,0BAA0B,GAAG;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAC/D,gBAAgB,CAAC;AAEnB;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,yBAAyB,CAAC,
|
1
|
+
{"version":3,"file":"deploy-metadata.d.ts","sourceRoot":"","sources":["../../../../src/utils/any-evm/deploy-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC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AG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-init-bytecode-with-salt.d.ts","sourceRoot":"","sources":["../../../../src/utils/any-evm/get-init-bytecode-with-salt.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"get-init-bytecode-with-salt.d.ts","sourceRoot":"","sources":["../../../../src/utils/any-evm/get-init-bytecode-with-salt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAmB,MAAM,oBAAoB,CAAC;AAI/D,KAAK,+BAA+B,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,GAAG,GAAG,UAAU,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,+BAA+B,GACvC,GAAG,CAeL"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parse-abi-params.d.ts","sourceRoot":"","sources":["../../../../src/utils/contract/parse-abi-params.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,qBAAqB,EAAE,MAAM,EAAE,EAC/B,sBAAsB,EAAE,OAAO,EAAE,GAChC,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,
|
1
|
+
{"version":3,"file":"parse-abi-params.d.ts","sourceRoot":"","sources":["../../../../src/utils/contract/parse-abi-params.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,qBAAqB,EAAE,MAAM,EAAE,EAC/B,sBAAsB,EAAE,OAAO,EAAE,GAChC,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CA4ElC"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.55.
|
1
|
+
export declare const version = "5.55.1-nightly-b2a2c9784a33394dffbcd32bbd28b2c612a4e603-20240915000420";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,2EAA2E,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.55.
|
3
|
+
"version": "5.55.1-nightly-b2a2c9784a33394dffbcd32bbd28b2c612a4e603-20240915000420",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -349,7 +349,7 @@
|
|
349
349
|
"dev": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm --watch",
|
350
350
|
"dev:cjs": "printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json && tsc --noCheck --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false --watch",
|
351
351
|
"dev:esm": "printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json && tsc --noCheck --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm --watch",
|
352
|
-
"build": "pnpm clean && pnpm build:
|
352
|
+
"build": "pnpm clean && pnpm build:types && pnpm build:cjs && pnpm build:esm",
|
353
353
|
"build:cjs": "tsc --noCheck --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
|
354
354
|
"build:esm": "tsc --noCheck --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
|
355
355
|
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
@@ -5,12 +5,14 @@ import { encodeAbiParameters } from "../../utils/abi/encodeAbiParameters.js";
|
|
5
5
|
import { normalizeFunctionParams } from "../../utils/abi/normalizeFunctionParams.js";
|
6
6
|
import { computeDeploymentAddress } from "../../utils/any-evm/compute-deployment-address.js";
|
7
7
|
import { computeDeploymentInfoFromBytecode } from "../../utils/any-evm/compute-published-contract-deploy-info.js";
|
8
|
+
import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js";
|
8
9
|
import { ensureBytecodePrefix } from "../../utils/bytecode/prefix.js";
|
9
10
|
import { concatHex } from "../../utils/encoding/helpers/concat-hex.js";
|
10
11
|
import { type Hex, isHex } from "../../utils/encoding/hex.js";
|
11
12
|
import type { Prettify } from "../../utils/type-utils.js";
|
12
13
|
import type { ClientAndChain } from "../../utils/types.js";
|
13
14
|
import type { Account } from "../../wallets/interfaces/wallet.js";
|
15
|
+
import { getContract } from "../contract.js";
|
14
16
|
|
15
17
|
/**
|
16
18
|
* @extension DEPLOY
|
@@ -122,6 +124,22 @@ export async function deployContract(
|
|
122
124
|
if (options.salt !== undefined) {
|
123
125
|
// Deploy with CREATE2 if salt is provided
|
124
126
|
const info = await computeDeploymentInfoFromBytecode(options);
|
127
|
+
const address = computeDeploymentAddress({
|
128
|
+
bytecode: options.bytecode,
|
129
|
+
encodedArgs: info.encodedArgs,
|
130
|
+
create2FactoryAddress: info.create2FactoryAddress,
|
131
|
+
salt: options.salt,
|
132
|
+
});
|
133
|
+
const isDeployed = await isContractDeployed(
|
134
|
+
getContract({
|
135
|
+
client: options.client,
|
136
|
+
chain: options.chain,
|
137
|
+
address,
|
138
|
+
}),
|
139
|
+
);
|
140
|
+
if (isDeployed) {
|
141
|
+
throw new Error(`Contract already deployed at address: ${address}`);
|
142
|
+
}
|
125
143
|
await sendAndConfirmTransaction({
|
126
144
|
account: options.account,
|
127
145
|
transaction: prepareTransaction({
|
@@ -131,12 +149,7 @@ export async function deployContract(
|
|
131
149
|
data: info.initBytecodeWithsalt,
|
132
150
|
}),
|
133
151
|
});
|
134
|
-
return
|
135
|
-
bytecode: options.bytecode,
|
136
|
-
encodedArgs: info.encodedArgs,
|
137
|
-
create2FactoryAddress: info.create2FactoryAddress,
|
138
|
-
salt: options.salt,
|
139
|
-
});
|
152
|
+
return address;
|
140
153
|
}
|
141
154
|
|
142
155
|
const deployTx = prepareDirectDeployTransaction(options);
|
package/src/exports/deploys.ts
CHANGED
@@ -46,4 +46,4 @@ export {
|
|
46
46
|
type PrepareDirectDeployTransactionOptions,
|
47
47
|
} from "../contract/deployment/deploy-with-abi.js";
|
48
48
|
export { computePublishedContractAddress } from "../utils/any-evm/compute-published-contract-address.js";
|
49
|
-
export {
|
49
|
+
export { getRequiredTransactions } from "../extensions/prebuilts/get-required-transactions.js";
|
@@ -9,6 +9,7 @@ export { totalListings } from "../../extensions/marketplace/__generated__/IDirec
|
|
9
9
|
export {
|
10
10
|
getListing,
|
11
11
|
type GetListingParams,
|
12
|
+
isGetListingSupported,
|
12
13
|
} from "../../extensions/marketplace/direct-listings/read/getListing.js";
|
13
14
|
export {
|
14
15
|
getAllListings,
|
@@ -31,10 +32,13 @@ export {
|
|
31
32
|
type CurrencyPriceForListingParams,
|
32
33
|
} from "../../extensions/marketplace/direct-listings/read/currencyPriceForListing.js";
|
33
34
|
|
35
|
+
export { isCancelListingSupported } from "../../extensions/marketplace/__generated__/IDirectListings/write/cancelListing.js";
|
36
|
+
|
34
37
|
// WRITE
|
35
38
|
export {
|
36
39
|
createListing,
|
37
40
|
type CreateListingParams,
|
41
|
+
isCreateListingSupported,
|
38
42
|
} from "../../extensions/marketplace/direct-listings/write/createListing.js";
|
39
43
|
export {
|
40
44
|
updateListing,
|
@@ -47,6 +51,7 @@ export {
|
|
47
51
|
export {
|
48
52
|
buyFromListing,
|
49
53
|
type BuyFromListingParams,
|
54
|
+
isBuyFromListingSupported,
|
50
55
|
} from "../../extensions/marketplace/direct-listings/write/buyFromListing.js";
|
51
56
|
export {
|
52
57
|
approveBuyerForListing,
|
@@ -94,6 +99,7 @@ export { totalAuctions } from "../../extensions/marketplace/__generated__/IEngli
|
|
94
99
|
export {
|
95
100
|
getAuction,
|
96
101
|
type GetAuctionParams,
|
102
|
+
isGetAuctionSupported,
|
97
103
|
} from "../../extensions/marketplace/english-auctions/read/getAuction.js";
|
98
104
|
export {
|
99
105
|
getAllAuctions,
|
@@ -106,6 +112,7 @@ export {
|
|
106
112
|
export {
|
107
113
|
getWinningBid,
|
108
114
|
type GetWinningBidParams,
|
115
|
+
isGetWinningBidSupported,
|
109
116
|
} from "../../extensions/marketplace/english-auctions/read/getWinningBid.js";
|
110
117
|
export {
|
111
118
|
isNewWinningBid,
|
@@ -116,14 +123,17 @@ export {
|
|
116
123
|
export {
|
117
124
|
createAuction,
|
118
125
|
type CreateAuctionParams,
|
126
|
+
isCreateAuctionSupported,
|
119
127
|
} from "../../extensions/marketplace/english-auctions/write/createAuction.js";
|
120
128
|
export {
|
121
129
|
bidInAuction,
|
122
130
|
type BidInAuctionParams,
|
131
|
+
isBidInAuctionSupported,
|
123
132
|
} from "../../extensions/marketplace/english-auctions/write/bidInAuction.js";
|
124
133
|
export {
|
125
134
|
cancelAuction,
|
126
135
|
type CancelAuctionParams,
|
136
|
+
isCancelAuctionSupported,
|
127
137
|
} from "../../extensions/marketplace/__generated__/IEnglishAuctions/write/cancelAuction.js";
|
128
138
|
export {
|
129
139
|
buyoutAuction,
|
@@ -1,18 +1,14 @@
|
|
1
1
|
import { eth_getBlockByNumber } from "../../../../rpc/actions/eth_getBlockByNumber.js";
|
2
2
|
import { getRpcClient } from "../../../../rpc/rpc.js";
|
3
3
|
import type { BaseTransactionOptions } from "../../../../transaction/types.js";
|
4
|
-
|
5
|
-
import {
|
6
|
-
type GetListingParams as GetListingParamsGenerated,
|
7
|
-
getListing as getListingGenerated,
|
8
|
-
} from "../../__generated__/IDirectListings/read/getListing.js";
|
4
|
+
import * as GetListing from "../../__generated__/IDirectListings/read/getListing.js";
|
9
5
|
import type { DirectListing } from "../types.js";
|
10
6
|
import { mapDirectListing } from "../utils.js";
|
11
7
|
|
12
8
|
/**
|
13
9
|
* @extension MARKETPLACE
|
14
10
|
*/
|
15
|
-
export type GetListingParams =
|
11
|
+
export type GetListingParams = GetListing.GetListingParams;
|
16
12
|
|
17
13
|
/**
|
18
14
|
* Retrieves a direct listing based on the provided options.
|
@@ -32,7 +28,7 @@ export async function getListing(
|
|
32
28
|
): Promise<DirectListing> {
|
33
29
|
const rpcClient = getRpcClient(options.contract);
|
34
30
|
const [rawListing, latestBlock] = await Promise.all([
|
35
|
-
|
31
|
+
GetListing.getListing(options),
|
36
32
|
eth_getBlockByNumber(rpcClient, {
|
37
33
|
blockTag: "latest",
|
38
34
|
}),
|
@@ -44,3 +40,19 @@ export async function getListing(
|
|
44
40
|
rawListing,
|
45
41
|
});
|
46
42
|
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Checks if the `isGetListingSupported` method is supported by the given contract.
|
46
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
47
|
+
* @returns A boolean indicating if the `isGetListingSupported` method is supported.
|
48
|
+
* @extension MARKETPLACE
|
49
|
+
* @example
|
50
|
+
* ```ts
|
51
|
+
* import { isGetListingSupported } from "thirdweb/extensions/marketplace";
|
52
|
+
*
|
53
|
+
* const supported = isGetListingSupported(["0x..."]);
|
54
|
+
* ```
|
55
|
+
*/
|
56
|
+
export function isGetListingSupported(availableSelectors: string[]) {
|
57
|
+
return GetListing.isGetListingSupported(availableSelectors);
|
58
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { Address } from "abitype";
|
2
2
|
import { isNativeTokenAddress } from "../../../../constants/addresses.js";
|
3
3
|
import type { BaseTransactionOptions } from "../../../../transaction/types.js";
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import * as BuyFromListing from "../../__generated__/IDirectListings/write/buyFromListing.js";
|
5
|
+
import * as GetListing from "../read/getListing.js";
|
6
6
|
import { isListingValid } from "../utils.js";
|
7
7
|
|
8
8
|
/**
|
@@ -38,10 +38,10 @@ export type BuyFromListingParams = {
|
|
38
38
|
export function buyFromListing(
|
39
39
|
options: BaseTransactionOptions<BuyFromListingParams>,
|
40
40
|
) {
|
41
|
-
return
|
41
|
+
return BuyFromListing.buyFromListing({
|
42
42
|
contract: options.contract,
|
43
43
|
asyncParams: async () => {
|
44
|
-
const listing = await getListing({
|
44
|
+
const listing = await GetListing.getListing({
|
45
45
|
contract: options.contract,
|
46
46
|
listingId: options.listingId,
|
47
47
|
});
|
@@ -71,3 +71,22 @@ export function buyFromListing(
|
|
71
71
|
},
|
72
72
|
});
|
73
73
|
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Checks if the `buyFromListing` method is supported by the given contract.
|
77
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
78
|
+
* @returns A boolean indicating if the `buyFromListing` method is supported.
|
79
|
+
* @extension MARKETPLACE
|
80
|
+
* @example
|
81
|
+
* ```ts
|
82
|
+
* import { isBuyFromListingSupported } from "thirdweb/extensions/marketplace";
|
83
|
+
*
|
84
|
+
* const supported = isBuyFromListingSupported(["0x..."]);
|
85
|
+
* ```
|
86
|
+
*/
|
87
|
+
export function isBuyFromListingSupported(availableSelectors: string[]) {
|
88
|
+
return (
|
89
|
+
BuyFromListing.isBuyFromListingSupported(availableSelectors) &&
|
90
|
+
GetListing.isGetListingSupported(availableSelectors)
|
91
|
+
);
|
92
|
+
}
|
@@ -10,7 +10,7 @@ import type { BaseTransactionOptions } from "../../../../transaction/types.js";
|
|
10
10
|
import { toUnits } from "../../../../utils/units.js";
|
11
11
|
import { isERC721 } from "../../../erc721/read/isERC721.js";
|
12
12
|
import { isERC1155 } from "../../../erc1155/read/isERC1155.js";
|
13
|
-
import
|
13
|
+
import * as CreateListing from "../../__generated__/IDirectListings/write/createListing.js";
|
14
14
|
|
15
15
|
/**
|
16
16
|
* @extension MARKETPLACE
|
@@ -88,7 +88,7 @@ export type CreateListingParams = {
|
|
88
88
|
export function createListing(
|
89
89
|
options: BaseTransactionOptions<CreateListingParams>,
|
90
90
|
) {
|
91
|
-
return
|
91
|
+
return CreateListing.createListing({
|
92
92
|
contract: options.contract,
|
93
93
|
asyncParams: async () => {
|
94
94
|
const assetContract = getContract({
|
@@ -182,3 +182,19 @@ export function createListing(
|
|
182
182
|
},
|
183
183
|
});
|
184
184
|
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Checks if the `createListing` method is supported by the given contract.
|
188
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
189
|
+
* @returns A boolean indicating if the `createListing` method is supported.
|
190
|
+
* @extension MARKETPLACE
|
191
|
+
* @example
|
192
|
+
* ```ts
|
193
|
+
* import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace";
|
194
|
+
*
|
195
|
+
* const supported = isCreateAuctionSupported(["0x..."]);
|
196
|
+
* ```
|
197
|
+
*/
|
198
|
+
export function isCreateListingSupported(availableSelectors: string[]) {
|
199
|
+
return CreateListing.isCreateListingSupported(availableSelectors);
|
200
|
+
}
|
@@ -1,18 +1,14 @@
|
|
1
1
|
import { eth_getBlockByNumber } from "../../../../rpc/actions/eth_getBlockByNumber.js";
|
2
2
|
import { getRpcClient } from "../../../../rpc/rpc.js";
|
3
3
|
import type { BaseTransactionOptions } from "../../../../transaction/types.js";
|
4
|
-
|
5
|
-
import {
|
6
|
-
type GetAuctionParams as GetAuctionParamsGenerated,
|
7
|
-
getAuction as getAuctionGenerated,
|
8
|
-
} from "../../__generated__/IEnglishAuctions/read/getAuction.js";
|
4
|
+
import * as GetAuction from "../../__generated__/IEnglishAuctions/read/getAuction.js";
|
9
5
|
import type { EnglishAuction } from "../types.js";
|
10
6
|
import { mapEnglishAuction } from "../utils.js";
|
11
7
|
|
12
8
|
/**
|
13
9
|
* @extension MARKETPLACE
|
14
10
|
*/
|
15
|
-
export type GetAuctionParams =
|
11
|
+
export type GetAuctionParams = GetAuction.GetAuctionParams;
|
16
12
|
|
17
13
|
/**
|
18
14
|
* Retrieves an auction listing based on the provided options.
|
@@ -32,7 +28,7 @@ export async function getAuction(
|
|
32
28
|
): Promise<EnglishAuction> {
|
33
29
|
const rpcClient = getRpcClient(options.contract);
|
34
30
|
const [rawAuction, latestBlock] = await Promise.all([
|
35
|
-
|
31
|
+
GetAuction.getAuction(options),
|
36
32
|
eth_getBlockByNumber(rpcClient, {
|
37
33
|
blockTag: "latest",
|
38
34
|
}),
|
@@ -44,3 +40,19 @@ export async function getAuction(
|
|
44
40
|
rawAuction,
|
45
41
|
});
|
46
42
|
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Checks if the `getAuction` method is supported by the given contract.
|
46
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
47
|
+
* @returns A boolean indicating if the `getAuction` method is supported.
|
48
|
+
* @extension MARKETPLACE
|
49
|
+
* @example
|
50
|
+
* ```ts
|
51
|
+
* import { isGetAuctionSupported } from "thirdweb/extensions/marketplace";
|
52
|
+
*
|
53
|
+
* const supported = isGetAuctionSupported(["0x..."]);
|
54
|
+
* ```
|
55
|
+
*/
|
56
|
+
export function isGetAuctionSupported(availableSelectors: string[]) {
|
57
|
+
return GetAuction.isGetAuctionSupported(availableSelectors);
|
58
|
+
}
|
@@ -1,15 +1,12 @@
|
|
1
|
-
import {
|
1
|
+
import { ZERO_ADDRESS } from "../../../../constants/addresses.js";
|
2
2
|
import type { BaseTransactionOptions } from "../../../../transaction/types.js";
|
3
3
|
import { resolveCurrencyValue } from "../../../../utils/extensions/resolve-currency-value.js";
|
4
|
-
import
|
5
|
-
type GetWinningBidParams as GeneratedWinningBidParams,
|
6
|
-
getWinningBid as getWinningBidGenerated,
|
7
|
-
} from "../../__generated__/IEnglishAuctions/read/getWinningBid.js";
|
4
|
+
import * as GetWinningBid from "../../__generated__/IEnglishAuctions/read/getWinningBid.js";
|
8
5
|
|
9
6
|
/**
|
10
7
|
* @extension MARKETPLACE
|
11
8
|
*/
|
12
|
-
export type GetWinningBidParams =
|
9
|
+
export type GetWinningBidParams = GetWinningBid.GetWinningBidParams;
|
13
10
|
|
14
11
|
/**
|
15
12
|
* Retrieves the winning bid information for a given auction.
|
@@ -31,9 +28,9 @@ export async function getWinningBid(
|
|
31
28
|
options: BaseTransactionOptions<GetWinningBidParams>,
|
32
29
|
) {
|
33
30
|
const [bidderAddress, currencyAddress, bidAmountWei] =
|
34
|
-
await
|
31
|
+
await GetWinningBid.getWinningBid(options);
|
35
32
|
|
36
|
-
if (bidderAddress ===
|
33
|
+
if (bidderAddress === ZERO_ADDRESS) {
|
37
34
|
return undefined;
|
38
35
|
}
|
39
36
|
|
@@ -49,3 +46,19 @@ export async function getWinningBid(
|
|
49
46
|
}),
|
50
47
|
};
|
51
48
|
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Checks if the `getWinningBid` method is supported by the given contract.
|
52
|
+
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
|
53
|
+
* @returns A boolean indicating if the `getWinningBid` method is supported.
|
54
|
+
* @extension MARKETPLACE
|
55
|
+
* @example
|
56
|
+
* ```ts
|
57
|
+
* import { isGetWinningBidSupported } from "thirdweb/extensions/marketplace";
|
58
|
+
*
|
59
|
+
* const supported = isGetWinningBidSupported(["0x..."]);
|
60
|
+
* ```
|
61
|
+
*/
|
62
|
+
export function isGetWinningBidSupported(availableSelectors: string[]) {
|
63
|
+
return GetWinningBid.isGetWinningBidSupported(availableSelectors);
|
64
|
+
}
|