Skip to content

Commit

Permalink
feat: [TD-1158] Add taker_address to fulfillment data request (#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfportal authored Jan 15, 2024
1 parent e7764e1 commit d79993d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Fee>;
};

5 changes: 4 additions & 1 deletion packages/orderbook/src/orderbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d79993d

Please sign in to comment.