@hypercerts-org/marketplace-sdk 0.3.37 → 0.4.1-alpha.0

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.
Files changed (28) hide show
  1. package/{LICENSE → LICENSE.md} +1 -0
  2. package/README.md +117 -85
  3. package/dist/HypercertExchangeClient.d.ts +19 -88
  4. package/dist/abis/IERC20.json +13 -0
  5. package/dist/abis/OrderValidatorV2A.json +13 -0
  6. package/dist/index.cjs.js +274 -399
  7. package/dist/index.d.ts +0 -2
  8. package/dist/index.esm.js +275 -400
  9. package/dist/typechain/@looksrare/contracts-exchange-v2/contracts/helpers/OrderValidatorV2A.d.ts +5 -1
  10. package/dist/typechain/@looksrare/contracts-libs/contracts/interfaces/generic/IERC20.d.ts +5 -1
  11. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/ExecutionManager__factory.d.ts +1 -1
  12. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol__factory.d.ts +1 -1
  13. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/StrategyManager__factory.d.ts +1 -1
  14. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/TransferSelectorNFT__factory.d.ts +1 -1
  15. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/helpers/OrderValidatorV2A__factory.d.ts +11 -1
  16. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/helpers/ProtocolHelpers__factory.d.ts +1 -1
  17. package/dist/typechain/factories/@looksrare/contracts-libs/contracts/interfaces/generic/IERC20__factory.d.ts +10 -0
  18. package/dist/typechain/factories/solmate/src/tokens/WETH__factory.d.ts +1 -1
  19. package/dist/typechain/factories/src/contracts/tests/Verifier__factory.d.ts +1 -1
  20. package/dist/types.d.ts +57 -28
  21. package/dist/utils/api.d.ts +55 -26
  22. package/dist/utils/calls/nonces.d.ts +0 -1
  23. package/dist/utils/calls/transferManager.d.ts +1 -2
  24. package/dist/utils/graphl.d.ts +4 -3
  25. package/package.json +9 -9
  26. package/LICENSE-APACHE +0 -10
  27. package/LICENSE-MIT +0 -21
  28. package/dist/utils/hypercerts-database-types.d.ts +0 -568
@@ -1,4 +1,5 @@
1
1
  This project is dual licensed under MIT and Apache-2.0.
2
2
 
3
3
  MIT: https://www.opensource.org/licenses/mit
4
+
4
5
  Apache-2.0: https://www.apache.org/licenses/license-2.0
package/README.md CHANGED
@@ -1,101 +1,133 @@
1
- # @looksrare/sdk-v2
1
+ # @hypercerts-org/marketplace-sdk
2
2
 
3
- ![GitHub package.json version](https://img.shields.io/github/package-json/v/LooksRare/sdk-v2) ![GitHub](https://img.shields.io/github/license/LooksRare/sdk-v2) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LooksRare/sdk-v2/build.yml) ![npm](https://img.shields.io/npm/dt/@looksrare/sdk-v2)
3
+ ![GitHub package.json version](https://img.shields.io/github/package-json/v/hypercerts-org/marketplace-sdk) ![GitHub](https://img.shields.io/github/license/hypercerts-org/marketplace-sdk) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/hypercerts-org/marketplace-sdk/build.yml) ![npm](https://img.shields.io/npm/dt/@hypercerts-org/marketplace-sdk)
4
4
 
5
- A collection of typescript tools to interact with LooksRare protocol V2 smart contracts 👀💎
5
+ A collection of TypeScript tools to interact with HypercertsExchange smart contracts, enabling users to sell and buy Hypercerts on the marketplace.
6
6
 
7
- ## Install
7
+ ## SDK usage
8
8
 
9
- This package has a peer dependency on [etherjs V5](https://docs.ethers.io/v5/).
9
+ <!-- TODO: Check if links still work on deployment -->
10
10
 
11
- ```bash
12
- yarn add @looksrare/sdk-v2 ethers
13
- ```
11
+ Read the [guides](./guides) if you need help with the implementation.
14
12
 
15
- ```bash
16
- npm install @looksrare/sdk-v2 ethers --save
17
- ```
13
+ You can also read the detailed [API documentation](./doc).
18
14
 
19
- ## Getting Started
15
+ ## SDK development
20
16
 
21
- The SDK expose a main class used to perform all the onchain operations:
17
+ ### Environment variables
22
18
 
23
- ```ts
24
- import { ChainId } from "@looksrare/sdk-v2";
25
- const looksrare = new LooksRare(ChainId.MAINNET, provider, signer);
26
- ```
19
+ No environment variables are required to run, build or run tests on the SDK.
27
20
 
28
- The signer is optional if you need access to read only data (:warning: Calls to function that need a signer will throw a `Signer is undefined` exception):
21
+ ### Local development
29
22
 
30
- ```ts
31
- import { ChainId } from "@looksrare/sdk-v2";
32
- const looksrare = new LooksRare(ChainId.MAINNET, provider);
33
- ```
23
+ The `HypercertExchangeClient()` allows you to override the API endpoint. This can be useful for developing against a local instance of the API.
34
24
 
35
- If you work on a hardhat setup, you can override the addresses as follow:
25
+ To use a locally built version of the SDK in another project, you can use `pnpm link`:
36
26
 
37
- ```ts
38
- import { Addresses } from "@looksrare/sdk-v2";
39
- const addresses: Addresses = {...};
40
- const looksrare = new LooksRare(ChainId.HARDHAT, provider, signer, addresses);
27
+ ```bash
28
+ cd marketplace-sdk
29
+ pnpm install && pnpm run build
30
+ cd ../your-project
31
+ pnpm link <path to marketplace sdk on you local filesystem>
41
32
  ```
42
33
 
43
- :information_source: Use [`JsonRpcProvider`](https://docs.ethers.org/v6/api/providers/jsonrpc/#JsonRpcApiProviderOptions) from `ethers v6` if you want to make batched RPC calls.
44
-
45
- ```ts
46
- import { JsonRpcProvider, Network } from "ethers";
47
-
48
- // Create a HTTP/HTTPS batch call provider
49
- const provider = new JsonRpcProvider(RPC_URL, CHAIN_ID, { staticNetwork: Network.from(CHAIN_ID) });
50
-
51
- // Create LooksRare instance using this provider
52
- const looksrare = new LooksRare(ChainId.HARDHAT, provider, signer, addresses);
34
+ ### Scripts
35
+
36
+ - `dev` - Run the SDK in development mode
37
+ - `build` - Build the SDK
38
+ - `test` - Run the tests
39
+ - `docs` - Generate the documentation into the `doc` folder
40
+ - `supabase:types:hypercerts` - Generate types for the `data-staging` database
41
+
42
+ ## Architecture
43
+
44
+ ### Lifecycle of an order
45
+
46
+ 1. User A creates maker order and signs it
47
+ 1. User A registers maker order with API
48
+ 1. Signature on maker order gets verified by API
49
+ 1. If verified correctly, order gets stored in data postgres DB
50
+ 1. Order will live in DB until deleted
51
+ 1. Order will be visible to other users as long as it's valid.
52
+ 1. An order being executed might render it being invalid. A user can invalidate their own orders on request. There are more possible reasons, see the `OrderValidatorCode` enum located in [src/types.ts](./src/types.ts#L266) and the guide on [order validation](./guides/orderValidation.md).
53
+ 1. User B fetches order from API
54
+ 1. User B creates taker order for maker order
55
+ 1. User B signs taker order against maker order using the `HypercertExchangeClient`, found in the marketplace SDK
56
+ 1. User B calls the `executeOrder` method on the `HypercertExchangeClient` with the taker order, which calls the `HypercertExchange` contract in turn.
57
+ 1. The `HypercertExchange` contract verifies the signature and executes the order
58
+ 1. The `HypercertExchange` contract will emit an event that the order has been executed, which is picked up by the indexer which revalidates the order. If the transaction rendered the order invalid for any further sales, the error codes and validity get updated in the DB.
59
+ 1. Once a maker order is invalidated it's only visible to User A.
60
+ 1. Maker order can be deleted or permanently rendered invalid by declaring the nonce invalid by User A at any time.
61
+
62
+ > [!WARNING]
63
+ >
64
+ > The indexer is not listing to the OrderExecuted event yet, so the order will not be updated in the DB, unless reverified manually.
65
+
66
+ ```mermaid
67
+ graph TD
68
+ subgraph User A
69
+ A1[Creates maker order and signs it]
70
+ A2[Registers maker order with API]
71
+ end
72
+
73
+ subgraph API
74
+ B1[Receives maker order]
75
+ B2[Verifies signature on maker order]
76
+ B3[Stores order in Postgres DB]
77
+ end
78
+
79
+ subgraph Postgres DB
80
+ C1[Stores order]
81
+ C2[Order visible to other users as long as it's valid]
82
+ C3[Order validity can be updated]
83
+ C4[Order can become invalid due to various reasons]
84
+ C5[Marks order as invalid and stores error codes]
85
+ end
86
+
87
+ subgraph User B
88
+ D1[Fetches order from API]
89
+ D2[Creates taker order for maker order]
90
+ D3[Signs taker order against maker order using HypercertExchangeClient]
91
+ D4[Calls executeOrder method on HypercertExchangeClient]
92
+ end
93
+
94
+ subgraph HypercertExchange Contract
95
+ E1[Verifies signature]
96
+ E2[Executes order]
97
+ E3[Emits OrderExecuted event]
98
+ end
99
+
100
+ subgraph Indexer
101
+ F1[Picks up OrderExecuted event]
102
+ F2[Revalidates order]
103
+ F3[Updates error codes and validity in DB]
104
+ end
105
+
106
+ subgraph User A
107
+ G1[Invalid order is only visible to User A]
108
+ G2[Can delete or render order permanently invalid]
109
+ end
110
+
111
+ A1 --> A2
112
+ A2 --> B1
113
+ B1 --> B2
114
+ B2 --> B3
115
+ B3 --> C1
116
+ C1 --> C2
117
+ C2 --> C3
118
+ C3 --> D1
119
+ C3 --> C4
120
+ C4 --> C5
121
+ C5 --> C6
122
+ D1 --> D2
123
+ D2 --> D3
124
+ D3 --> D4
125
+ D4 --> E1
126
+ E1 --> E2
127
+ E2 --> E3
128
+ E3 --> F1
129
+ F1 --> F2
130
+ F2 --> F3
131
+ C6 --> G1
132
+ G1 --> G2
53
133
  ```
54
-
55
- Prior to [`@looksrare/sdk-v2@0.9.2`](https://www.npmjs.com/package/@looksrare/sdk-v2/v/0.9.2?activeTab=readme), LooksRareSDK was making batched calls using `0xsequence/multicall`. But this is not natively supported since `@looksrare/sdk-v2@1.0.0`.
56
-
57
- ## Documentation
58
-
59
- Read the [guides](./guides) if you need help with the implementation.
60
-
61
- You can also read the detailed [api documentation](./doc).
62
-
63
- ## FAQ
64
-
65
- ### ❓ How to use ABIs
66
-
67
- The SDK exposes most of the LooksRare contract [ABIs](https://github.com/LooksRare/sdk-v2/tree/master/src/abis). For convenience, some commonly used ABIs are also exported.
68
-
69
- ```js
70
- import LooksRareProtocolABI from "@looksrare/sdk-v2/dist/abis/LooksRareProtocol.json";
71
- ```
72
-
73
- ### ❓ How to retrieve order nonce ?
74
-
75
- Call the public api endpoint [/orders/nonce](https://looksrare.dev/reference/getordernonce), and use this nonce directly.
76
-
77
- ### ❓ What to do when the order is created and signed ?
78
-
79
- Use the public api endpoint [/orders](https://looksrare.dev/reference/createorder) to push the order to the database. After that, the order will be visible by everyone using the API (looksrare.org, aggregators, etc..).
80
-
81
- ### ❓ When should I use merkle tree orders ?
82
-
83
- Merkle tree orders are used to create several orders with a single signature. You shouldn't use them when using a bot. Their main purpose is to facilitate orders creation using a user interface.
84
-
85
- ### ❓ Why do I need to call grantTransferManagerApproval ?
86
-
87
- When you approve a collection to be traded on LooksRare, you approve the TransferManager instead of the exchange. Calling `grantTransferManagerApproval` gives the exchange contract the right to call the transfer function on the TransferManager. You need to call this function only once, the first time you use the V2.
88
-
89
- ### ❓ What are subset nonces and how to use them ?
90
-
91
- tl;dr subset nonces allow you to cancel all the orders sharing the same subset nonce.
92
- Subset nonces allow you to group some orders together according to arbitrary rules (for example all your orders for a specific collection, all your orders above a certain threshold, etc). You can then cancel them all with a single call to `cancelSubsetOrders`.
93
- :information_source: Unlike order nonces, executing an order with a specific subset nonce doesn't invalidate other orders sharing the same subset nonce.
94
-
95
- ## Resources
96
-
97
- 🔗 [Developer documentation](https://docs.looksrare.org/developers/welcome)
98
-
99
- 🔗 [Public API documentation](https://looksrare.dev/reference/important-information)
100
-
101
- 🔗 [Developer discord](https://discord.gg/jJA4qM5dXz)
@@ -1,7 +1,6 @@
1
1
  import { BigNumberish, ContractTransactionResponse, Overrides, Provider, Signer, TypedDataDomain } from "ethers";
2
- import { Addresses, BatchTransferItem, ChainId, ContractMethods, CreateMakerAskOutput, CreateMakerBidOutput, CreateMakerCollectionOfferInput, CreateMakerCollectionOfferWithProofInput, CreateMakerInput, Currencies, Maker, MerkleTree, OrderValidatorCode, SignMerkleTreeOrdersOutput, StrategyInfo, StrategyType, Taker } from "./types";
2
+ import { Addresses, ChainId, ContractMethods, CreateDirectFractionsSaleMakerAskInput, CreateFractionalSaleMakerAskInput, CreateMakerAskOutput, CreateMakerBidOutput, CreateMakerInput, Currencies, Maker, MerkleTree, Order, OrderValidatorCode, SignMerkleTreeOrdersOutput, StrategyInfo, StrategyType, Taker } from "./types";
3
3
  import { ApiClient } from "./utils/api";
4
- import { Database } from "./utils/hypercerts-database-types";
5
4
  /**
6
5
  * HypercertExchange
7
6
  * This class provides helpers to interact with the HypercertExchange V2 contracts
@@ -27,10 +26,10 @@ export declare class HypercertExchangeClient {
27
26
  readonly provider: Provider;
28
27
  /**
29
28
  * HypercertExchange protocol main class
30
- * @param chainId Current app chain id
29
+ * @param chainId Chain id for contract interactions
31
30
  * @param provider Ethers provider
32
31
  * @param signer Ethers signer
33
- * @param overrides Override contract addresses or api endpoint used
32
+ * @param overrides Override contract addresses or API endpoint used
34
33
  */
35
34
  constructor(chainId: ChainId, provider: Provider, signer?: Signer, overrides?: {
36
35
  addresses: Addresses;
@@ -58,27 +57,13 @@ export declare class HypercertExchangeClient {
58
57
  * @param CreateMakerInput
59
58
  * @returns the maker object, isTransferManagerApproved, and isTransferManagerApproved
60
59
  */
61
- createMakerAsk({ collection, strategyId, collectionType, subsetNonce, orderNonce, endTime, price, itemIds, amounts, currency, startTime, additionalParameters, }: CreateMakerInput): Promise<CreateMakerAskOutput>;
60
+ createMakerAsk({ collection, strategyId, collectionType, subsetNonce, orderNonce, endTime, price, itemIds, currency, startTime, additionalParameters, }: CreateMakerInput): Promise<CreateMakerAskOutput>;
62
61
  /**
63
62
  * Create a maker bid object ready to be signed
64
63
  * @param CreateMakerInput
65
64
  * @returns the maker object, isCurrencyApproved, and isBalanceSufficient
66
65
  */
67
- createMakerBid({ collection, strategyId, collectionType, subsetNonce, orderNonce, endTime, price, itemIds, amounts, currency, startTime, additionalParameters, }: CreateMakerInput): Promise<CreateMakerBidOutput>;
68
- /**
69
- * Create a maker bid for collection offer.
70
- * @see this.createMakerBid
71
- * @param orderInputs Order data
72
- * @returns CreateMakerBidOutput
73
- */
74
- createMakerCollectionOffer(orderInputs: CreateMakerCollectionOfferInput): Promise<CreateMakerBidOutput>;
75
- /**
76
- * Create a maker bid for collection, with a list of item id that can be used for the taker order
77
- * @see this.createMakerBid
78
- * @param orderInputs Order data
79
- * @returns CreateMakerBidOutput
80
- */
81
- createMakerCollectionOfferWithProof(orderInputs: CreateMakerCollectionOfferWithProofInput): Promise<CreateMakerBidOutput>;
66
+ createMakerBid({ collection, strategyId, collectionType, subsetNonce, orderNonce, endTime, price, itemIds, currency, startTime, additionalParameters, }: CreateMakerInput): Promise<CreateMakerBidOutput>;
82
67
  /**
83
68
  * Create a taker ask ready to be executed against a maker bid
84
69
  * @param maker Maker order that will be used as counterparty for the taker
@@ -87,27 +72,6 @@ export declare class HypercertExchangeClient {
87
72
  * @returns Taker object
88
73
  */
89
74
  createTaker(maker: Maker, recipient?: string, additionalParameters?: any[]): Taker;
90
- /**
91
- * Create a taker ask order for collection order.
92
- * @see this.createTaker
93
- * @see this.createMakerCollectionOffer
94
- * @param maker Maker bid that will be used as counterparty for the taker
95
- * @param itemId Token id to use as a counterparty for the collection order
96
- * @param recipient Recipient address of the taker (if none, it will use the sender)
97
- * @returns Taker object
98
- */
99
- createTakerCollectionOffer(maker: Maker, itemId: BigNumberish, recipient?: string): Taker;
100
- /**
101
- * Create a taker ask to fulfill a collection order (maker bid) created with a whitelist of item ids
102
- * @see this.createTaker
103
- * @see this.createMakerCollectionOfferWithMerkleTree
104
- * @param maker Maker bid that will be used as counterparty for the taker
105
- * @param itemId Token id to use as a counterparty for the collection order
106
- * @param itemIds List of token ids used during the maker creation
107
- * @param recipient Recipient address of the taker (if none, it will use the sender)
108
- * @returns Taker object
109
- */
110
- createTakerCollectionOfferWithProof(maker: Maker, itemId: BigNumberish, itemIds: BigNumberish[], recipient?: string): Taker;
111
75
  /**
112
76
  * Sign a maker order using the signer provided in the constructor
113
77
  * @param maker Order to be signed by the user
@@ -126,7 +90,7 @@ export declare class HypercertExchangeClient {
126
90
  * @param maker Maker order
127
91
  * @param taker Taker order
128
92
  * @param signature Signature of the maker order
129
- * @param merkleTree If the maker has been signed with a merkle tree
93
+ * @param merkleTree Optional merkle tree
130
94
  * @returns ContractMethods
131
95
  */
132
96
  executeOrder(maker: Maker, taker: Taker, signature: string, merkleTree?: MerkleTree, overrides?: Overrides): ContractMethods;
@@ -155,19 +119,13 @@ export declare class HypercertExchangeClient {
155
119
  */
156
120
  cancelAllOrders(bid: boolean, ask: boolean, overrides?: Overrides): ContractMethods;
157
121
  /**
158
- * Cancel a list of specific orders
122
+ * Cancel a list of orders by nonce
159
123
  * @param nonces List of nonces to be cancelled
160
124
  * @returns ContractMethods
161
125
  */
162
126
  cancelOrders(nonces: BigNumberish[], overrides?: Overrides): ContractMethods;
163
127
  /**
164
- * Cancel a list of specific subset orders
165
- * @param nonces List of nonces to be cancelled
166
- * @returns ContractMethods
167
- */
168
- cancelSubsetOrders(nonces: BigNumberish[], overrides?: Overrides): ContractMethods;
169
- /**
170
- * Approve all the items of a collection, to eventually be traded on HypercertExchange
128
+ * Approve all the items of a collection, to eventually be traded on the Hypercert Exchange
171
129
  * The spender is the TransferManager.
172
130
  * @param collectionAddress Address of the collection to be approved.
173
131
  * @param approved true to approve, false to revoke the approval (default to true)
@@ -175,7 +133,7 @@ export declare class HypercertExchangeClient {
175
133
  */
176
134
  approveAllCollectionItems(collectionAddress: string, approved?: boolean, overrides?: Overrides): Promise<ContractTransactionResponse>;
177
135
  /**
178
- * Approve an ERC20 to be used as a currency on HypercertExchange.
136
+ * Approve an ERC20 to be used as a currency on the Hypercert Exchange.
179
137
  * The spender is the HypercertExchangeProtocol contract.
180
138
  * @param tokenAddress Address of the ERC20 to approve
181
139
  * @param amount Amount to be approved (default to MaxUint256)
@@ -202,13 +160,6 @@ export declare class HypercertExchangeClient {
202
160
  * @returns ContractMethods
203
161
  */
204
162
  revokeTransferManagerApproval(operators?: string[], overrides?: Overrides): ContractMethods;
205
- /**
206
- * Transfer a list of items across different collections
207
- * @param to Recipient address
208
- * @param collectionItems Each object in the array represent a list of items for a specific collection
209
- * @returns ContractMethods
210
- */
211
- transferItemsAcrossCollection(to: string, collectionItems: BatchTransferItem[], overrides?: Overrides): Promise<ContractMethods>;
212
163
  /**
213
164
  * Verify if a set of orders can be executed (i.e are valid)
214
165
  * @param makerOrders List of maker orders
@@ -222,11 +173,11 @@ export declare class HypercertExchangeClient {
222
173
  * @param orders List of orders to be checked
223
174
  * @param overrides Call overrides (optional)
224
175
  */
225
- checkOrdersValidity(orders: Database["public"]["Tables"]["marketplace_orders"]["Row"][], overrides?: Overrides): Promise<{
176
+ checkOrdersValidity(orders: Order[], overrides?: Overrides): Promise<{
226
177
  id: string;
227
178
  valid: boolean;
228
179
  validatorCodes: OrderValidatorCode[];
229
- order: Omit<Database["public"]["Tables"]["marketplace_orders"]["Row"], "id" | "createdAt" | "invalidated" | "validator_codes">;
180
+ order: Omit<Order, "id" | "createdAt" | "invalidated" | "validator_codes">;
230
181
  }[]>;
231
182
  /**
232
183
  * Retrieve strategy info
@@ -236,36 +187,16 @@ export declare class HypercertExchangeClient {
236
187
  strategyInfo(strategyId: StrategyType, overrides?: Overrides): Promise<StrategyInfo>;
237
188
  /**
238
189
  * Create a maker ask for a collection or singular offer of fractions
239
- * @param itemIds Token IDs of the fractions to be sold
240
- * @param price Price of the fractions in wei
241
- * @param startTime Timestamp in seconds when the order becomes valid
242
- * @param endTime Timestamp in seconds when the order becomes invalid
243
- * @param currency Currency used to buy the fractions (default to WETH)
244
- * @param additionalParameters Additional parameters used to support complex orders
190
+ * @param CreateDirectFractionsSaleMakerAskInput
245
191
  */
246
- createDirectFractionsSaleMakerAsk({ itemIds, price, startTime, endTime, currency, additionalParameters, }: Omit<CreateMakerInput, "strategyId" | "collectionType" | "collection" | "subsetNonce" | "orderNonce" | "amounts">): Promise<CreateMakerAskOutput>;
192
+ createDirectFractionsSaleMakerAsk({ itemIds, price, startTime, endTime, currency, additionalParameters, }: CreateDirectFractionsSaleMakerAskInput): Promise<CreateMakerAskOutput>;
247
193
  /**
248
- * Create a maker ask to let the buyer decide how much of the fraction they want to buy
249
- * @param itemIds Token IDs of the fractions to be sold
250
- * @param price Price of one unit in wei
251
- * @param startTime Timestamp in seconds when the order becomes valid
252
- * @param endTime Timestamp in seconds when the order becomes invalid
253
- * @param currency Currency used to buy the fractions (default to WETH)
254
- * @param maxUnitAmount Maximum amount of units that can be bought in a single transaction
255
- * @param minUnitAmount Minimum amount of units that can be bought in a single transaction
256
- * @param minUnitsToKeep Minimum amount of units that the seller wants to keep
257
- * @param sellLeftoverFraction Whether or not the seller wants to sell the leftover units
258
- * @param root Merkle tree root (optional)
194
+ * Create a maker ask to let the buyer decide how much of a fraction they want to buy
195
+ * @param CreateFractionalSaleMakerInput
259
196
  */
260
- createFractionalSaleMakerAsk({ itemIds, price, startTime, endTime, currency, maxUnitAmount, minUnitAmount, minUnitsToKeep, sellLeftoverFraction, root, }: Omit<CreateMakerInput, "strategyId" | "collectionType" | "collection" | "subsetNonce" | "orderNonce" | "amounts" | "additionalParameters"> & {
261
- minUnitAmount: BigNumberish;
262
- maxUnitAmount: BigNumberish;
263
- minUnitsToKeep: BigNumberish;
264
- sellLeftoverFraction: boolean;
265
- root?: string;
266
- }): Promise<CreateMakerAskOutput>;
197
+ createFractionalSaleMakerAsk({ itemIds, price, startTime, endTime, currency, maxUnitAmount, minUnitAmount, minUnitsToKeep, sellLeftoverFraction, root, }: CreateFractionalSaleMakerAskInput): Promise<CreateMakerAskOutput>;
267
198
  /**
268
- * Create a taker bid for buying a fraction of an open fractional sale
199
+ * Create a taker bid for buying part of a fraction
269
200
  * @param maker Maker order
270
201
  * @param recipient Recipient address of the taker (if none, it will use the sender)
271
202
  * @param unitAmount Amount of units to buy
@@ -273,7 +204,7 @@ export declare class HypercertExchangeClient {
273
204
  */
274
205
  createFractionalSaleTakerBid(maker: Maker, recipient: string | undefined, unitAmount: BigNumberish, pricePerUnit: BigNumberish): Taker;
275
206
  /**
276
- * Register the order with hypercerts marketplace API.
207
+ * Register the order with the hypercerts marketplace API
277
208
  * @param order Maker order
278
209
  * @param signature Signature of the maker order
279
210
  */
@@ -284,7 +215,7 @@ export declare class HypercertExchangeClient {
284
215
  success: boolean;
285
216
  }>;
286
217
  /**
287
- * Delete the order
218
+ * Delete the order from the hypercerts marketplace API
288
219
  * @param orderId Order ID
289
220
  */
290
221
  deleteOrder(orderId: string): Promise<boolean>;
@@ -116,6 +116,19 @@
116
116
  "stateMutability": "view",
117
117
  "type": "function"
118
118
  },
119
+ {
120
+ "inputs": [],
121
+ "name": "decimals",
122
+ "outputs": [
123
+ {
124
+ "internalType": "uint8",
125
+ "name": "",
126
+ "type": "uint8"
127
+ }
128
+ ],
129
+ "stateMutability": "view",
130
+ "type": "function"
131
+ },
119
132
  {
120
133
  "inputs": [],
121
134
  "name": "totalSupply",
@@ -394,6 +394,19 @@
394
394
  "stateMutability": "view",
395
395
  "type": "function"
396
396
  },
397
+ {
398
+ "inputs": [],
399
+ "name": "royaltyFeeRegistry",
400
+ "outputs": [
401
+ {
402
+ "internalType": "contract IRoyaltyFeeRegistry",
403
+ "name": "",
404
+ "type": "address"
405
+ }
406
+ ],
407
+ "stateMutability": "view",
408
+ "type": "function"
409
+ },
397
410
  {
398
411
  "inputs": [],
399
412
  "name": "transferManager",