@imtbl/sdk 0.18.3 → 0.20.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.
@@ -16673,7 +16673,7 @@ class ImmutableApiClient {
16673
16673
  ...listTradesParams,
16674
16674
  });
16675
16675
  }
16676
- async createListing({ orderHash, orderComponents, orderSignature, makerFee, }) {
16676
+ async createListing({ orderHash, orderComponents, orderSignature, makerFees, }) {
16677
16677
  if (orderComponents.offer.length !== 1) {
16678
16678
  throw new Error('Only one item can be listed at a time');
16679
16679
  }
@@ -16702,11 +16702,11 @@ class ImmutableApiClient {
16702
16702
  contract_address: orderComponents.consideration[0].token,
16703
16703
  },
16704
16704
  ],
16705
- fee: makerFee ? {
16706
- amount: makerFee.amount,
16705
+ fees: makerFees.map((x) => ({
16706
+ amount: x.amount,
16707
16707
  fee_type: FeeType.MAKER_MARKETPLACE,
16708
- recipient: makerFee.recipient,
16709
- } : undefined,
16708
+ recipient: x.recipient,
16709
+ })),
16710
16710
  end_time: new Date(parseInt(`${orderComponents.endTime.toString()}000`, 10)).toISOString(),
16711
16711
  protocol_data: {
16712
16712
  order_type: ProtocolData.order_type.FULL_RESTRICTED,
@@ -16896,15 +16896,8 @@ class Orderbook {
16896
16896
  * @return {ListingResult} The result of the order created in the Immutable services.
16897
16897
  */
16898
16898
  async createListing(createListingParams) {
16899
- const makerFee = createListingParams.makerFee
16900
- ? {
16901
- ...createListingParams.makerFee,
16902
- type: FeeType.MAKER_MARKETPLACE,
16903
- }
16904
- : undefined;
16905
16899
  const apiListingResponse = await this.apiClient.createListing({
16906
16900
  ...createListingParams,
16907
- makerFee,
16908
16901
  });
16909
16902
  return {
16910
16903
  result: mapFromOpenApiOrder(apiListingResponse.result),
@@ -16918,17 +16911,15 @@ class Orderbook {
16918
16911
  * @param {string} fulfillerAddress - The address of the account fulfilling the order.
16919
16912
  * @return {FulfillOrderResponse} Approval and fulfilment transactions.
16920
16913
  */
16921
- async fulfillOrder(listingId, takerAddress, takerFee) {
16914
+ async fulfillOrder(listingId, takerAddress, takerFees) {
16922
16915
  const fulfillmentDataRes = await this.apiClient.fulfillmentData([
16923
16916
  {
16924
16917
  order_id: listingId,
16925
- fee: takerFee
16926
- ? {
16927
- amount: takerFee.amount,
16928
- fee_type: FeeType.TAKER_MARKETPLACE,
16929
- recipient: takerFee.recipient,
16930
- }
16931
- : undefined,
16918
+ fees: takerFees.map((fee) => ({
16919
+ amount: fee.amount,
16920
+ fee_type: FeeType.TAKER_MARKETPLACE,
16921
+ recipient: fee.recipient,
16922
+ })),
16932
16923
  },
16933
16924
  ]);
16934
16925
  if (fulfillmentDataRes.result.length !== 1) {
@@ -19537,7 +19528,7 @@ class APIError extends Error {
19537
19528
 
19538
19529
  /* eslint-disable implicit-arrow-linebreak */
19539
19530
  const defaultHeaders = {
19540
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.3',
19531
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.20.0',
19541
19532
  };
19542
19533
  /**
19543
19534
  * createAPIConfiguration to create a custom Configuration
@@ -22745,7 +22736,7 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
22745
22736
  };
22746
22737
  try {
22747
22738
  const fulfillerAddress = await provider.getSigner().getAddress();
22748
- const { actions: actions } = await orderbook.fulfillOrder(orderId, fulfillerAddress);
22739
+ const { actions: actions } = await orderbook.fulfillOrder(orderId, fulfillerAddress, []);
22749
22740
  unsignedTransactions = await (0, $a7367d01c6e76b1c$export$b087719c36e0f2dc)(actions);
22750
22741
  } catch {
22751
22742
  // Silently ignore error as this is usually thrown if user does not have enough balance
@@ -22996,14 +22987,13 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
22996
22987
  const createListingParams = {
22997
22988
  orderComponents: signedMessage.orderComponents,
22998
22989
  orderHash: signedMessage.orderHash,
22999
- orderSignature: signedMessage.signedMessage
22990
+ orderSignature: signedMessage.signedMessage,
22991
+ makerFees: []
23000
22992
  };
23001
22993
  if (makerFees !== undefined) {
23002
22994
  const orderBookFees = ($9051cee080948594$export$1e69c9cfc42e28d8)(makerFees, buyTokenOrNative.amount, decimals);
23003
- // @TODO add support for an array of fees when the orderbook enables it
23004
22995
  if (orderBookFees.length !== makerFees.length) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("One of the fees is too small, must be greater than 0.000001", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CREATE_ORDER_LISTING_ERROR);
23005
- const [makerFee] = orderBookFees;
23006
- createListingParams.makerFee = makerFee;
22996
+ createListingParams.makerFees = orderBookFees;
23007
22997
  }
23008
22998
  try {
23009
22999
  const order = await orderbook.createListing(createListingParams);
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
4
4
  function $parcel$export(e, n, v, s) {
5
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
6
  }
7
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.3";
7
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.20.0";
8
8
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
9
9
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
10
10
 
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
16
16
  chainID,
17
17
  coreContractAddress,
18
18
  registrationContractAddress,
19
- sdkVersion: 'ts-immutable-sdk-0.18.3',
19
+ sdkVersion: 'ts-immutable-sdk-0.20.0',
20
20
  });
21
21
  /**
22
22
  * Sets `sdkVersion` at the time of build