Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/seaport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ export class Seaport {
* Defaults to the zero address which means the offer goes to the fulfiller
* @param input.domain optional domain to be hashed and appended to calldata
* @param input.exactApproval optional boolean to indicate whether the approval should be exact or not
* @param input.overrides any transaction overrides the client wants, ignored if not set
* @returns a use case containing the set of approval actions and fulfillment action
*/
public async fulfillOrders({
Expand All @@ -946,6 +947,7 @@ export class Seaport {
recipientAddress = ethers.ZeroAddress,
domain,
exactApproval = false,
overrides,
}: {
fulfillOrderDetails: {
order: OrderWithCounter
Expand All @@ -960,6 +962,7 @@ export class Seaport {
recipientAddress?: string
domain?: string
exactApproval?: boolean
overrides?: Overrides
}) {
if (
fulfillOrderDetails.some(orderDetails => !orderDetails.order.signature)
Expand Down Expand Up @@ -1064,6 +1067,7 @@ export class Seaport {
recipientAddress,
domain,
exactApproval,
overrides,
})
}

Expand Down
6 changes: 4 additions & 2 deletions src/utils/fulfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export function fulfillAvailableOrders({
recipientAddress,
exactApproval,
domain,
overrides,
}: {
ordersMetadata: FulfillOrdersMetadata
seaportContract: SeaportContract
Expand All @@ -564,6 +565,7 @@ export function fulfillAvailableOrders({
recipientAddress: string
exactApproval: boolean
domain?: string
overrides?: Overrides
}): OrderUseCase<
ExchangeAction<
ContractMethodReturnType<SeaportContract, "fulfillAvailableAdvancedOrders">
Expand Down Expand Up @@ -715,7 +717,7 @@ export function fulfillAvailableOrders({
},
)

const overrides = { value: totalNativeAmount }
const transactionOverrides = { ...overrides, value: totalNativeAmount }

const approvalActions = getApprovalActions(
totalInsufficientApprovals,
Expand Down Expand Up @@ -777,7 +779,7 @@ export function fulfillAvailableOrders({
conduitKey,
recipientAddress,
advancedOrdersWithTips.length,
overrides,
transactionOverrides,
],
domain,
),
Expand Down
11 changes: 6 additions & 5 deletions test/fulfill-orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ describeWithFixture(

const thirdOrder = await thirdOrderUseCase.executeAllActions()

const gasLimit = 10_000_000n
const { actions } = await seaport.fulfillOrders({
fulfillOrderDetails: [
{ order: firstOrder },
Expand All @@ -136,17 +137,17 @@ describeWithFixture(
],
accountAddress: await fulfiller.getAddress(),
domain: OPENSEA_DOMAIN,
overrides: { gasLimit },
})

expect(actions.length).to.eq(1)

const action = actions[0]
expect(action.type).eq("exchange")
expect(
(await action.transactionMethods.buildTransaction()).data?.slice(
-8,
),
).to.eq(OPENSEA_DOMAIN_TAG)
const transactionRequest =
await action.transactionMethods.buildTransaction()
expect(transactionRequest.data?.slice(-8)).to.eq(OPENSEA_DOMAIN_TAG)
expect(transactionRequest.gasLimit).to.eq(gasLimit)

const transaction = await action.transactionMethods.transact()
expect(transaction.data.slice(-8)).to.eq(OPENSEA_DOMAIN_TAG)
Expand Down