From d79993d8928de3ef7b7e503a8770685cc12d11c2 Mon Sep 17 00:00:00 2001 From: Leslie Fung Date: Mon, 15 Jan 2024 15:36:54 +1100 Subject: [PATCH] feat: [TD-1158] Add `taker_address` to fulfillment data request (#1351) --- .../src/openapi/sdk/models/FulfillmentDataRequest.ts | 4 ++++ packages/orderbook/src/orderbook.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/orderbook/src/openapi/sdk/models/FulfillmentDataRequest.ts b/packages/orderbook/src/openapi/sdk/models/FulfillmentDataRequest.ts index b5a3502681..a9956c6b8e 100644 --- a/packages/orderbook/src/openapi/sdk/models/FulfillmentDataRequest.ts +++ b/packages/orderbook/src/openapi/sdk/models/FulfillmentDataRequest.ts @@ -6,6 +6,10 @@ import type { Fee } from './Fee'; export type FulfillmentDataRequest = { order_id: string; + /** + * Address of the intended account fulfilling the order + */ + taker_address?: string; fees: Array; }; diff --git a/packages/orderbook/src/orderbook.ts b/packages/orderbook/src/orderbook.ts index 22b0110530..69c796db37 100644 --- a/packages/orderbook/src/orderbook.ts +++ b/packages/orderbook/src/orderbook.ts @@ -197,7 +197,8 @@ export class Orderbook { * transaction exists it must be signed and submitted to the chain before the fulfilment * transaction can be submitted or it will be reverted. * @param {string} listingId - The listingId to fulfil. - * @param {string} fulfillerAddress - The address of the account fulfilling the order. + * @param {string} takerAddress - The address of the account fulfilling the order. + * @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid. * @return {FulfillOrderResponse} Approval and fulfilment transactions. */ async fulfillOrder( @@ -208,6 +209,7 @@ export class Orderbook { const fulfillmentDataRes = await this.apiClient.fulfillmentData([ { order_id: listingId, + taker_address: takerAddress, fees: takerFees.map((fee) => ({ amount: fee.amount, type: @@ -244,6 +246,7 @@ export class Orderbook { const fulfillmentDataRes = await this.apiClient.fulfillmentData( listings.map((listingRequest) => ({ order_id: listingRequest.listingId, + taker_address: takerAddress, fees: listingRequest.takerFees.map((fee) => ({ amount: fee.amount, type: