@opensea/seaport-js 1.0.0 → 1.0.1-beta.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.
- package/lib/abi/ERC1155.d.ts +29 -29
- package/lib/abi/ERC20.d.ts +29 -29
- package/lib/abi/ERC721.d.ts +29 -29
- package/lib/abi/Seaport.d.ts +112 -112
- package/lib/constants.d.ts +49 -49
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.mjs +2 -0
- package/lib/index.esm.mjs.map +1 -0
- package/lib/index.js +2 -6
- package/lib/index.js.map +1 -1
- package/lib/index.modern.mjs +2 -0
- package/lib/index.modern.mjs.map +1 -0
- package/lib/index.umd.js +2 -0
- package/lib/index.umd.js.map +1 -0
- package/lib/seaport.d.ts +181 -181
- package/lib/types.d.ts +207 -207
- package/lib/utils/approval.d.ts +9 -9
- package/lib/utils/balance.d.ts +4 -4
- package/lib/utils/balanceAndApprovalCheck.d.ts +108 -108
- package/lib/utils/criteria.d.ts +13 -14
- package/lib/utils/fulfill.d.ts +84 -84
- package/lib/utils/gcd.d.ts +3 -3
- package/lib/utils/item.d.ts +30 -29
- package/lib/utils/match.d.ts +49 -49
- package/lib/utils/merkletree.d.ts +11 -11
- package/lib/utils/order.d.ts +37 -37
- package/lib/utils/usecase.d.ts +4 -4
- package/package.json +4 -2
- package/lib/abi/ERC1155.js +0 -319
- package/lib/abi/ERC1155.js.map +0 -1
- package/lib/abi/ERC20.js +0 -317
- package/lib/abi/ERC20.js.map +0 -1
- package/lib/abi/ERC721.js +0 -337
- package/lib/abi/ERC721.js.map +0 -1
- package/lib/abi/Seaport.js +0 -2585
- package/lib/abi/Seaport.js.map +0 -1
- package/lib/constants.js +0 -73
- package/lib/constants.js.map +0 -1
- package/lib/seaport.js +0 -720
- package/lib/seaport.js.map +0 -1
- package/lib/typechain/ERC1155.d.ts +0 -189
- package/lib/typechain/ERC1155.js +0 -3
- package/lib/typechain/ERC1155.js.map +0 -1
- package/lib/typechain/ERC20.d.ts +0 -209
- package/lib/typechain/ERC20.js +0 -3
- package/lib/typechain/ERC20.js.map +0 -1
- package/lib/typechain/ERC721.d.ts +0 -220
- package/lib/typechain/ERC721.js +0 -3
- package/lib/typechain/ERC721.js.map +0 -1
- package/lib/typechain/Seaport.d.ts +0 -686
- package/lib/typechain/Seaport.js +0 -3
- package/lib/typechain/Seaport.js.map +0 -1
- package/lib/typechain/common.d.ts +0 -21
- package/lib/typechain/common.js +0 -3
- package/lib/typechain/common.js.map +0 -1
- package/lib/types.js +0 -3
- package/lib/types.js.map +0 -1
- package/lib/utils/approval.js +0 -108
- package/lib/utils/approval.js.map +0 -1
- package/lib/utils/balance.js +0 -86
- package/lib/utils/balance.js.map +0 -1
- package/lib/utils/balanceAndApprovalCheck.js +0 -322
- package/lib/utils/balanceAndApprovalCheck.js.map +0 -1
- package/lib/utils/criteria.js +0 -91
- package/lib/utils/criteria.js.map +0 -1
- package/lib/utils/fulfill.js +0 -573
- package/lib/utils/fulfill.js.map +0 -1
- package/lib/utils/gcd.js +0 -25
- package/lib/utils/gcd.js.map +0 -1
- package/lib/utils/item.js +0 -136
- package/lib/utils/item.js.map +0 -1
- package/lib/utils/match.js +0 -56
- package/lib/utils/match.js.map +0 -1
- package/lib/utils/merkletree.js +0 -32
- package/lib/utils/merkletree.js.map +0 -1
- package/lib/utils/order.js +0 -224
- package/lib/utils/order.js.map +0 -1
- package/lib/utils/usecase.js +0 -158
- package/lib/utils/usecase.js.map +0 -1
package/lib/seaport.d.ts
CHANGED
|
@@ -1,181 +1,181 @@
|
|
|
1
|
-
import { BigNumberish, PayableOverrides, providers } from "ethers";
|
|
2
|
-
import type { SeaportConfig, CreateOrderAction, CreateOrderInput, ExchangeAction, InputCriteria, Order, OrderComponents, OrderParameters, OrderStatus, OrderUseCase, OrderWithCounter, TipInputItem, TransactionMethods, ContractMethodReturnType, MatchOrdersFulfillment, SeaportContract } from "./types";
|
|
3
|
-
export declare class Seaport {
|
|
4
|
-
contract: SeaportContract;
|
|
5
|
-
private provider;
|
|
6
|
-
private multicallProvider;
|
|
7
|
-
private config;
|
|
8
|
-
private defaultConduitKey;
|
|
9
|
-
/**
|
|
10
|
-
* @param provider - The provider to use for web3-related calls
|
|
11
|
-
* @param considerationConfig - A config to provide flexibility in the usage of Seaport
|
|
12
|
-
*/
|
|
13
|
-
constructor(provider: providers.JsonRpcProvider, { overrides, ascendingAmountFulfillmentBuffer, balanceAndApprovalChecksOnOrderCreation, conduitKeyToConduit, }?: SeaportConfig);
|
|
14
|
-
/**
|
|
15
|
-
* Returns the corresponding order type based on whether it allows partial fills and is restricted by zone
|
|
16
|
-
*
|
|
17
|
-
* @param input
|
|
18
|
-
* @param input.allowPartialFills Whether or not the order can be partially filled
|
|
19
|
-
* @param input.restrictedByZone Whether or not the order can only be filled/cancelled by the zone
|
|
20
|
-
* @returns the order type
|
|
21
|
-
*/
|
|
22
|
-
private _getOrderTypeFromOrderOptions;
|
|
23
|
-
/**
|
|
24
|
-
* Returns a use case that will create an order.
|
|
25
|
-
* The use case will contain the list of actions necessary to finish creating an order.
|
|
26
|
-
* The list of actions will either be an approval if approvals are necessary
|
|
27
|
-
* or a signature request that will then be supplied into the final Order struct, ready to be fulfilled.
|
|
28
|
-
*
|
|
29
|
-
* @param input
|
|
30
|
-
* @param input.conduitKey The conduitKey key to derive where to source your approvals from. Defaults to 0 which refers to the Seaport contract.
|
|
31
|
-
* Another special value is address(1) will refer to the legacy proxy. All other must derive to the specified address.
|
|
32
|
-
* @param input.zone The zone of the order. Defaults to the zero address.
|
|
33
|
-
* @param input.startTime The start time of the order. Defaults to the current unix time.
|
|
34
|
-
* @param input.endTime The end time of the order. Defaults to "never end".
|
|
35
|
-
* It is HIGHLY recommended to pass in an explicit end time
|
|
36
|
-
* @param input.offer The items you are willing to offer. This is a condensed version of the Seaport struct OfferItem for convenience
|
|
37
|
-
* @param input.consideration The items that will go to their respective recipients upon receiving your offer.
|
|
38
|
-
* @param input.counter The counter from which to create the order with. Automatically fetched from the contract if not provided
|
|
39
|
-
* @param input.allowPartialFills Whether to allow the order to be partially filled
|
|
40
|
-
* @param input.restrictedByZone Whether the order should be restricted by zone
|
|
41
|
-
* @param input.fees Convenience array to apply fees onto the order. The fees will be deducted from the
|
|
42
|
-
* existing consideration items and then tacked on as new consideration items
|
|
43
|
-
* @param input.salt Random salt
|
|
44
|
-
* @param input.offerer The order's creator address. Defaults to the first address on the provider.
|
|
45
|
-
* @param accountAddress Optional address for which to create the order with
|
|
46
|
-
* @returns a use case containing the list of actions needed to be performed in order to create the order
|
|
47
|
-
*/
|
|
48
|
-
createOrder({ conduitKey, zone, startTime, endTime, offer, consideration, counter, allowPartialFills, restrictedByZone, fees, salt, }: CreateOrderInput, accountAddress?: string): Promise<OrderUseCase<CreateOrderAction>>;
|
|
49
|
-
/**
|
|
50
|
-
* Returns the domain data used when signing typed data
|
|
51
|
-
* @returns domain data
|
|
52
|
-
*/
|
|
53
|
-
private _getDomainData;
|
|
54
|
-
/**
|
|
55
|
-
* Returns a raw message to be signed using EIP-712
|
|
56
|
-
* @param orderParameters order parameter struct
|
|
57
|
-
* @param counter counter of the order
|
|
58
|
-
* @returns JSON string of the message to be signed
|
|
59
|
-
*/
|
|
60
|
-
private _getMessageToSign;
|
|
61
|
-
/**
|
|
62
|
-
* Submits a request to your provider to sign the order. Signed orders are used for off-chain order books.
|
|
63
|
-
* @param orderParameters standard order parameter struct
|
|
64
|
-
* @param counter counter of the offerer
|
|
65
|
-
* @param accountAddress optional account address from which to sign the order with.
|
|
66
|
-
* @returns the order signature
|
|
67
|
-
*/
|
|
68
|
-
signOrder(orderParameters: OrderParameters, counter: number, accountAddress?: string): Promise<string>;
|
|
69
|
-
/**
|
|
70
|
-
* Cancels a list of orders so that they are no longer fulfillable.
|
|
71
|
-
*
|
|
72
|
-
* @param orders list of order components
|
|
73
|
-
* @param accountAddress optional account address from which to cancel the orders from.
|
|
74
|
-
* @returns the set of transaction methods that can be used
|
|
75
|
-
*/
|
|
76
|
-
cancelOrders(orders: OrderComponents[], accountAddress?: string): TransactionMethods<ContractMethodReturnType<SeaportContract, "cancel">>;
|
|
77
|
-
/**
|
|
78
|
-
* Bulk cancels all existing orders for a given account
|
|
79
|
-
* @param offerer the account to bulk cancel orders on
|
|
80
|
-
* @returns the set of transaction methods that can be used
|
|
81
|
-
*/
|
|
82
|
-
bulkCancelOrders(offerer?: string): TransactionMethods<ContractMethodReturnType<SeaportContract, "incrementCounter">>;
|
|
83
|
-
/**
|
|
84
|
-
* Approves a list of orders on-chain. This allows accounts to fulfill the order without requiring
|
|
85
|
-
* a signature. Can also check if an order is valid using `callStatic`
|
|
86
|
-
* @param orders list of order structs
|
|
87
|
-
* @param accountAddress optional account address to approve orders.
|
|
88
|
-
* @returns the set of transaction methods that can be used
|
|
89
|
-
*/
|
|
90
|
-
validate(orders: Order[], accountAddress?: string): TransactionMethods<ContractMethodReturnType<SeaportContract, "validate">>;
|
|
91
|
-
/**
|
|
92
|
-
* Returns the order status given an order hash
|
|
93
|
-
* @param orderHash the hash of the order
|
|
94
|
-
* @returns an order status struct
|
|
95
|
-
*/
|
|
96
|
-
getOrderStatus(orderHash: string): Promise<OrderStatus>;
|
|
97
|
-
/**
|
|
98
|
-
* Gets the counter of a given offerer
|
|
99
|
-
* @param offerer the offerer to get the counter of
|
|
100
|
-
* @returns counter as a number
|
|
101
|
-
*/
|
|
102
|
-
getCounter(offerer: string): Promise<number>;
|
|
103
|
-
/**
|
|
104
|
-
* Calculates the order hash of order components so we can forgo executing a request to the contract
|
|
105
|
-
* This saves us RPC calls and latency.
|
|
106
|
-
*/
|
|
107
|
-
getOrderHash: (orderComponents: OrderComponents) => string;
|
|
108
|
-
/**
|
|
109
|
-
* Fulfills an order through either the basic method or the standard method
|
|
110
|
-
* Units to fill are denominated by the max possible size of the order, which is the greatest common denominator (GCD).
|
|
111
|
-
* We expose a helper to get this: getMaximumSizeForOrder
|
|
112
|
-
* i.e. If the maximum size of an order is 4, supplying 2 as the units to fulfill will fill half of the order: ;
|
|
113
|
-
* @param input
|
|
114
|
-
* @param input.order The standard order struct
|
|
115
|
-
* @param input.unitsToFill the number of units to fill for the given order. Only used if you wish to partially fill an order
|
|
116
|
-
* @param input.offerCriteria an array of criteria with length equal to the number of offer criteria items
|
|
117
|
-
* @param input.considerationCriteria an array of criteria with length equal to the number of consideration criteria items
|
|
118
|
-
* @param input.tips an array of optional condensed consideration items to be added onto a fulfillment
|
|
119
|
-
* @param input.extraData extra data supplied to the order
|
|
120
|
-
* @param input.accountAddress optional address from which to fulfill the order from
|
|
121
|
-
* @param input.conduitKey the conduitKey to source approvals from
|
|
122
|
-
* @param input.recipientAddress optional recipient to forward the offer to as opposed to the fulfiller.
|
|
123
|
-
* Defaults to the zero address which means the offer goes to the fulfiller
|
|
124
|
-
* @returns a use case containing the set of approval actions and fulfillment action
|
|
125
|
-
*/
|
|
126
|
-
fulfillOrder({ order, unitsToFill, offerCriteria, considerationCriteria, tips, extraData, accountAddress, conduitKey, recipientAddress, }: {
|
|
127
|
-
order: OrderWithCounter;
|
|
128
|
-
unitsToFill?: BigNumberish;
|
|
129
|
-
offerCriteria?: InputCriteria[];
|
|
130
|
-
considerationCriteria?: InputCriteria[];
|
|
131
|
-
tips?: TipInputItem[];
|
|
132
|
-
extraData?: string;
|
|
133
|
-
accountAddress?: string;
|
|
134
|
-
conduitKey?: string;
|
|
135
|
-
recipientAddress?: string;
|
|
136
|
-
}): Promise<OrderUseCase<ExchangeAction<ContractMethodReturnType<SeaportContract, "fulfillBasicOrder" | "fulfillOrder" | "fulfillAdvancedOrder">>>>;
|
|
137
|
-
/**
|
|
138
|
-
* Fulfills an order through best-effort fashion. Orders that fail will not revert the whole transaction
|
|
139
|
-
* unless there's an issue with approvals or balance checks
|
|
140
|
-
* @param input
|
|
141
|
-
* @param input.fulfillOrderDetails list of helper order details
|
|
142
|
-
* @param input.accountAddress the account to fulfill orders on
|
|
143
|
-
* @param input.conduitKey the key from which to source approvals from
|
|
144
|
-
* @param input.recipientAddress optional recipient to forward the offer to as opposed to the fulfiller.
|
|
145
|
-
* Defaults to the zero address which means the offer goes to the fulfiller
|
|
146
|
-
* @returns a use case containing the set of approval actions and fulfillment action
|
|
147
|
-
*/
|
|
148
|
-
fulfillOrders({ fulfillOrderDetails, accountAddress, conduitKey, recipientAddress, }: {
|
|
149
|
-
fulfillOrderDetails: {
|
|
150
|
-
order: OrderWithCounter;
|
|
151
|
-
unitsToFill?: BigNumberish;
|
|
152
|
-
offerCriteria?: InputCriteria[];
|
|
153
|
-
considerationCriteria?: InputCriteria[];
|
|
154
|
-
tips?: TipInputItem[];
|
|
155
|
-
extraData?: string;
|
|
156
|
-
}[];
|
|
157
|
-
accountAddress?: string;
|
|
158
|
-
conduitKey?: string;
|
|
159
|
-
recipientAddress?: string;
|
|
160
|
-
}): Promise<OrderUseCase<ExchangeAction<[boolean[], import("./typechain/Seaport").ExecutionStructOutput[]] & {
|
|
161
|
-
availableOrders: boolean[];
|
|
162
|
-
executions: import("./typechain/Seaport").ExecutionStructOutput[];
|
|
163
|
-
}>>>;
|
|
164
|
-
/**
|
|
165
|
-
* NOTE: Largely incomplete. Does NOT do any balance or approval checks.
|
|
166
|
-
* Just exposes the bare bones matchOrders where clients will have to supply
|
|
167
|
-
* their own overrides as needed.
|
|
168
|
-
* @param input
|
|
169
|
-
* @param input.orders the list of orders to match
|
|
170
|
-
* @param input.fulfillments the list of fulfillments to match offer and considerations
|
|
171
|
-
* @param input.overrides any overrides the client wants, will need to pass in value for matching orders with ETH.
|
|
172
|
-
* @param input.accountAddress Optional address for which to match the order with
|
|
173
|
-
* @returns set of transaction methods for matching orders
|
|
174
|
-
*/
|
|
175
|
-
matchOrders({ orders, fulfillments, overrides, accountAddress, }: {
|
|
176
|
-
orders: (OrderWithCounter | Order)[];
|
|
177
|
-
fulfillments: MatchOrdersFulfillment[];
|
|
178
|
-
overrides?: PayableOverrides;
|
|
179
|
-
accountAddress?: string;
|
|
180
|
-
}): TransactionMethods<ContractMethodReturnType<SeaportContract, "matchOrders">>;
|
|
181
|
-
}
|
|
1
|
+
import { BigNumberish, PayableOverrides, providers } from "ethers";
|
|
2
|
+
import type { SeaportConfig, CreateOrderAction, CreateOrderInput, ExchangeAction, InputCriteria, Order, OrderComponents, OrderParameters, OrderStatus, OrderUseCase, OrderWithCounter, TipInputItem, TransactionMethods, ContractMethodReturnType, MatchOrdersFulfillment, SeaportContract } from "./types";
|
|
3
|
+
export declare class Seaport {
|
|
4
|
+
contract: SeaportContract;
|
|
5
|
+
private provider;
|
|
6
|
+
private multicallProvider;
|
|
7
|
+
private config;
|
|
8
|
+
private defaultConduitKey;
|
|
9
|
+
/**
|
|
10
|
+
* @param provider - The provider to use for web3-related calls
|
|
11
|
+
* @param considerationConfig - A config to provide flexibility in the usage of Seaport
|
|
12
|
+
*/
|
|
13
|
+
constructor(provider: providers.JsonRpcProvider, { overrides, ascendingAmountFulfillmentBuffer, balanceAndApprovalChecksOnOrderCreation, conduitKeyToConduit, }?: SeaportConfig);
|
|
14
|
+
/**
|
|
15
|
+
* Returns the corresponding order type based on whether it allows partial fills and is restricted by zone
|
|
16
|
+
*
|
|
17
|
+
* @param input
|
|
18
|
+
* @param input.allowPartialFills Whether or not the order can be partially filled
|
|
19
|
+
* @param input.restrictedByZone Whether or not the order can only be filled/cancelled by the zone
|
|
20
|
+
* @returns the order type
|
|
21
|
+
*/
|
|
22
|
+
private _getOrderTypeFromOrderOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a use case that will create an order.
|
|
25
|
+
* The use case will contain the list of actions necessary to finish creating an order.
|
|
26
|
+
* The list of actions will either be an approval if approvals are necessary
|
|
27
|
+
* or a signature request that will then be supplied into the final Order struct, ready to be fulfilled.
|
|
28
|
+
*
|
|
29
|
+
* @param input
|
|
30
|
+
* @param input.conduitKey The conduitKey key to derive where to source your approvals from. Defaults to 0 which refers to the Seaport contract.
|
|
31
|
+
* Another special value is address(1) will refer to the legacy proxy. All other must derive to the specified address.
|
|
32
|
+
* @param input.zone The zone of the order. Defaults to the zero address.
|
|
33
|
+
* @param input.startTime The start time of the order. Defaults to the current unix time.
|
|
34
|
+
* @param input.endTime The end time of the order. Defaults to "never end".
|
|
35
|
+
* It is HIGHLY recommended to pass in an explicit end time
|
|
36
|
+
* @param input.offer The items you are willing to offer. This is a condensed version of the Seaport struct OfferItem for convenience
|
|
37
|
+
* @param input.consideration The items that will go to their respective recipients upon receiving your offer.
|
|
38
|
+
* @param input.counter The counter from which to create the order with. Automatically fetched from the contract if not provided
|
|
39
|
+
* @param input.allowPartialFills Whether to allow the order to be partially filled
|
|
40
|
+
* @param input.restrictedByZone Whether the order should be restricted by zone
|
|
41
|
+
* @param input.fees Convenience array to apply fees onto the order. The fees will be deducted from the
|
|
42
|
+
* existing consideration items and then tacked on as new consideration items
|
|
43
|
+
* @param input.salt Random salt
|
|
44
|
+
* @param input.offerer The order's creator address. Defaults to the first address on the provider.
|
|
45
|
+
* @param accountAddress Optional address for which to create the order with
|
|
46
|
+
* @returns a use case containing the list of actions needed to be performed in order to create the order
|
|
47
|
+
*/
|
|
48
|
+
createOrder({ conduitKey, zone, startTime, endTime, offer, consideration, counter, allowPartialFills, restrictedByZone, fees, salt, }: CreateOrderInput, accountAddress?: string): Promise<OrderUseCase<CreateOrderAction>>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the domain data used when signing typed data
|
|
51
|
+
* @returns domain data
|
|
52
|
+
*/
|
|
53
|
+
private _getDomainData;
|
|
54
|
+
/**
|
|
55
|
+
* Returns a raw message to be signed using EIP-712
|
|
56
|
+
* @param orderParameters order parameter struct
|
|
57
|
+
* @param counter counter of the order
|
|
58
|
+
* @returns JSON string of the message to be signed
|
|
59
|
+
*/
|
|
60
|
+
private _getMessageToSign;
|
|
61
|
+
/**
|
|
62
|
+
* Submits a request to your provider to sign the order. Signed orders are used for off-chain order books.
|
|
63
|
+
* @param orderParameters standard order parameter struct
|
|
64
|
+
* @param counter counter of the offerer
|
|
65
|
+
* @param accountAddress optional account address from which to sign the order with.
|
|
66
|
+
* @returns the order signature
|
|
67
|
+
*/
|
|
68
|
+
signOrder(orderParameters: OrderParameters, counter: number, accountAddress?: string): Promise<string>;
|
|
69
|
+
/**
|
|
70
|
+
* Cancels a list of orders so that they are no longer fulfillable.
|
|
71
|
+
*
|
|
72
|
+
* @param orders list of order components
|
|
73
|
+
* @param accountAddress optional account address from which to cancel the orders from.
|
|
74
|
+
* @returns the set of transaction methods that can be used
|
|
75
|
+
*/
|
|
76
|
+
cancelOrders(orders: OrderComponents[], accountAddress?: string): TransactionMethods<ContractMethodReturnType<SeaportContract, "cancel">>;
|
|
77
|
+
/**
|
|
78
|
+
* Bulk cancels all existing orders for a given account
|
|
79
|
+
* @param offerer the account to bulk cancel orders on
|
|
80
|
+
* @returns the set of transaction methods that can be used
|
|
81
|
+
*/
|
|
82
|
+
bulkCancelOrders(offerer?: string): TransactionMethods<ContractMethodReturnType<SeaportContract, "incrementCounter">>;
|
|
83
|
+
/**
|
|
84
|
+
* Approves a list of orders on-chain. This allows accounts to fulfill the order without requiring
|
|
85
|
+
* a signature. Can also check if an order is valid using `callStatic`
|
|
86
|
+
* @param orders list of order structs
|
|
87
|
+
* @param accountAddress optional account address to approve orders.
|
|
88
|
+
* @returns the set of transaction methods that can be used
|
|
89
|
+
*/
|
|
90
|
+
validate(orders: Order[], accountAddress?: string): TransactionMethods<ContractMethodReturnType<SeaportContract, "validate">>;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the order status given an order hash
|
|
93
|
+
* @param orderHash the hash of the order
|
|
94
|
+
* @returns an order status struct
|
|
95
|
+
*/
|
|
96
|
+
getOrderStatus(orderHash: string): Promise<OrderStatus>;
|
|
97
|
+
/**
|
|
98
|
+
* Gets the counter of a given offerer
|
|
99
|
+
* @param offerer the offerer to get the counter of
|
|
100
|
+
* @returns counter as a number
|
|
101
|
+
*/
|
|
102
|
+
getCounter(offerer: string): Promise<number>;
|
|
103
|
+
/**
|
|
104
|
+
* Calculates the order hash of order components so we can forgo executing a request to the contract
|
|
105
|
+
* This saves us RPC calls and latency.
|
|
106
|
+
*/
|
|
107
|
+
getOrderHash: (orderComponents: OrderComponents) => string;
|
|
108
|
+
/**
|
|
109
|
+
* Fulfills an order through either the basic method or the standard method
|
|
110
|
+
* Units to fill are denominated by the max possible size of the order, which is the greatest common denominator (GCD).
|
|
111
|
+
* We expose a helper to get this: getMaximumSizeForOrder
|
|
112
|
+
* i.e. If the maximum size of an order is 4, supplying 2 as the units to fulfill will fill half of the order: ;
|
|
113
|
+
* @param input
|
|
114
|
+
* @param input.order The standard order struct
|
|
115
|
+
* @param input.unitsToFill the number of units to fill for the given order. Only used if you wish to partially fill an order
|
|
116
|
+
* @param input.offerCriteria an array of criteria with length equal to the number of offer criteria items
|
|
117
|
+
* @param input.considerationCriteria an array of criteria with length equal to the number of consideration criteria items
|
|
118
|
+
* @param input.tips an array of optional condensed consideration items to be added onto a fulfillment
|
|
119
|
+
* @param input.extraData extra data supplied to the order
|
|
120
|
+
* @param input.accountAddress optional address from which to fulfill the order from
|
|
121
|
+
* @param input.conduitKey the conduitKey to source approvals from
|
|
122
|
+
* @param input.recipientAddress optional recipient to forward the offer to as opposed to the fulfiller.
|
|
123
|
+
* Defaults to the zero address which means the offer goes to the fulfiller
|
|
124
|
+
* @returns a use case containing the set of approval actions and fulfillment action
|
|
125
|
+
*/
|
|
126
|
+
fulfillOrder({ order, unitsToFill, offerCriteria, considerationCriteria, tips, extraData, accountAddress, conduitKey, recipientAddress, }: {
|
|
127
|
+
order: OrderWithCounter;
|
|
128
|
+
unitsToFill?: BigNumberish;
|
|
129
|
+
offerCriteria?: InputCriteria[];
|
|
130
|
+
considerationCriteria?: InputCriteria[];
|
|
131
|
+
tips?: TipInputItem[];
|
|
132
|
+
extraData?: string;
|
|
133
|
+
accountAddress?: string;
|
|
134
|
+
conduitKey?: string;
|
|
135
|
+
recipientAddress?: string;
|
|
136
|
+
}): Promise<OrderUseCase<ExchangeAction<ContractMethodReturnType<SeaportContract, "fulfillBasicOrder" | "fulfillOrder" | "fulfillAdvancedOrder">>>>;
|
|
137
|
+
/**
|
|
138
|
+
* Fulfills an order through best-effort fashion. Orders that fail will not revert the whole transaction
|
|
139
|
+
* unless there's an issue with approvals or balance checks
|
|
140
|
+
* @param input
|
|
141
|
+
* @param input.fulfillOrderDetails list of helper order details
|
|
142
|
+
* @param input.accountAddress the account to fulfill orders on
|
|
143
|
+
* @param input.conduitKey the key from which to source approvals from
|
|
144
|
+
* @param input.recipientAddress optional recipient to forward the offer to as opposed to the fulfiller.
|
|
145
|
+
* Defaults to the zero address which means the offer goes to the fulfiller
|
|
146
|
+
* @returns a use case containing the set of approval actions and fulfillment action
|
|
147
|
+
*/
|
|
148
|
+
fulfillOrders({ fulfillOrderDetails, accountAddress, conduitKey, recipientAddress, }: {
|
|
149
|
+
fulfillOrderDetails: {
|
|
150
|
+
order: OrderWithCounter;
|
|
151
|
+
unitsToFill?: BigNumberish;
|
|
152
|
+
offerCriteria?: InputCriteria[];
|
|
153
|
+
considerationCriteria?: InputCriteria[];
|
|
154
|
+
tips?: TipInputItem[];
|
|
155
|
+
extraData?: string;
|
|
156
|
+
}[];
|
|
157
|
+
accountAddress?: string;
|
|
158
|
+
conduitKey?: string;
|
|
159
|
+
recipientAddress?: string;
|
|
160
|
+
}): Promise<OrderUseCase<ExchangeAction<[boolean[], import("./typechain/Seaport").ExecutionStructOutput[]] & {
|
|
161
|
+
availableOrders: boolean[];
|
|
162
|
+
executions: import("./typechain/Seaport").ExecutionStructOutput[];
|
|
163
|
+
}>>>;
|
|
164
|
+
/**
|
|
165
|
+
* NOTE: Largely incomplete. Does NOT do any balance or approval checks.
|
|
166
|
+
* Just exposes the bare bones matchOrders where clients will have to supply
|
|
167
|
+
* their own overrides as needed.
|
|
168
|
+
* @param input
|
|
169
|
+
* @param input.orders the list of orders to match
|
|
170
|
+
* @param input.fulfillments the list of fulfillments to match offer and considerations
|
|
171
|
+
* @param input.overrides any overrides the client wants, will need to pass in value for matching orders with ETH.
|
|
172
|
+
* @param input.accountAddress Optional address for which to match the order with
|
|
173
|
+
* @returns set of transaction methods for matching orders
|
|
174
|
+
*/
|
|
175
|
+
matchOrders({ orders, fulfillments, overrides, accountAddress, }: {
|
|
176
|
+
orders: (OrderWithCounter | Order)[];
|
|
177
|
+
fulfillments: MatchOrdersFulfillment[];
|
|
178
|
+
overrides?: PayableOverrides;
|
|
179
|
+
accountAddress?: string;
|
|
180
|
+
}): TransactionMethods<ContractMethodReturnType<SeaportContract, "matchOrders">>;
|
|
181
|
+
}
|