@imtbl/sdk 0.27.12 → 0.27.13

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/dist/index.cjs CHANGED
@@ -3632,7 +3632,7 @@ class MultiRollupApiClients {
3632
3632
  }
3633
3633
 
3634
3634
  // eslint-disable-next-line @typescript-eslint/naming-convention
3635
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.12' };
3635
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.13' };
3636
3636
  const createConfig = ({ basePath, headers, }) => {
3637
3637
  if (!basePath.trim()) {
3638
3638
  throw Error('basePath can not be empty');
@@ -3692,7 +3692,7 @@ class APIError extends Error {
3692
3692
 
3693
3693
  /* eslint-disable implicit-arrow-linebreak */
3694
3694
  const defaultHeaders = {
3695
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.12',
3695
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.13',
3696
3696
  };
3697
3697
  /**
3698
3698
  * createAPIConfiguration to create a custom Configuration
@@ -4103,7 +4103,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4103
4103
  chainID,
4104
4104
  coreContractAddress,
4105
4105
  registrationContractAddress,
4106
- sdkVersion: 'ts-immutable-sdk-0.27.12',
4106
+ sdkVersion: 'ts-immutable-sdk-0.27.13',
4107
4107
  });
4108
4108
  /**
4109
4109
  * Sets `sdkVersion` at the time of build
@@ -29652,6 +29652,7 @@ var $e055e79256bbc1dd$export$80f4da0d409a629d;
29652
29652
  CheckoutErrorType["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
29653
29653
  CheckoutErrorType["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
29654
29654
  CheckoutErrorType["API_ERROR"] = "API_ERROR";
29655
+ CheckoutErrorType["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
29655
29656
  })($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
29656
29657
  class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
29657
29658
  message;
@@ -32735,16 +32736,24 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32735
32736
  let unsignedApprovalTransactions = [];
32736
32737
  let unsignedFulfillmentTransactions = [];
32737
32738
  let orderActions = [];
32738
- const fulfillOrderStartTime = new Date().getTime();
32739
+ const fulfillOrderStartTime = performance.now();
32739
32740
  try {
32740
32741
  const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
32741
32742
  const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
32742
32743
  orderActions = actions;
32743
32744
  unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
32744
32745
  } catch (err) {
32745
- // Silently ignore error as this is usually thrown if user does not have enough balance
32746
- const elapsedTimeInSeconds = (new Date().getTime() - fulfillOrderStartTime) / 1000;
32746
+ const elapsedTimeInSeconds = (performance.now() - fulfillOrderStartTime) / 1000;
32747
32747
  ($458d407830d66110$export$e6a390ea6399b7d8)(config, "Time to call fulfillOrder from the orderbook", elapsedTimeInSeconds);
32748
+ if (err.message.includes((OrderStatusName).EXPIRED)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Order is expired", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).ORDER_EXPIRED_ERROR, {
32749
+ orderId: id
32750
+ });
32751
+ // The balances error will be handled by bulk order fulfillment but for now we
32752
+ // need to assert on this string to check that the error is not a balances error
32753
+ if (!err.message.includes("The fulfiller does not have the balances needed to fulfill")) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error occurred while trying to fulfill the order", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR, {
32754
+ orderId: id,
32755
+ message: err.message
32756
+ });
32748
32757
  }
32749
32758
  try {
32750
32759
  unsignedFulfillmentTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned fulfillment transactions", (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions));
@@ -33329,7 +33338,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
33329
33338
  })($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
33330
33339
 
33331
33340
 
33332
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.12";
33341
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.13";
33333
33342
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
33334
33343
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
33335
33344
 
package/dist/index.d.ts CHANGED
@@ -16406,7 +16406,7 @@ type ERC20BuyToken = {
16406
16406
  contractAddress: string;
16407
16407
  };
16408
16408
  /**
16409
- * Interface of the SellToken
16409
+ * The SellToken type
16410
16410
  * @property {string} id - The ERC721 token id
16411
16411
  * @property {string} collectionAddress - The ERC721 collection address
16412
16412
  */
@@ -16737,9 +16737,9 @@ type UserBalance = {
16737
16737
  * Represents the transaction requirement for a transaction.
16738
16738
  * @property {ItemType} type - The type of the transaction requirement.
16739
16739
  * @property {boolean} sufficient - If the user address has sufficient funds to cover the transaction.
16740
- * @property {TransactionRequirementItem} required - The required item balance.
16741
- * @property {TransactionRequirementItem} current - The current item balance.
16742
- * @property {TransactionRequirementDelta} delta - The delta between the required and current balances.
16740
+ * @property {ItemBalance} required - The required item balance.
16741
+ * @property {ItemBalance} current - The current item balance.
16742
+ * @property {BalanceDelta} delta - The delta between the required and current balances.
16743
16743
  */
16744
16744
  type TransactionRequirement = {
16745
16745
  type: ItemType;
@@ -16750,6 +16750,7 @@ type TransactionRequirement = {
16750
16750
  };
16751
16751
  /**
16752
16752
  * Represents the balance for either a native or ERC20 token.
16753
+ * @property {ItemType.NATIVE | ItemType.ERC20} type - Type to indicate this is a native or ERC20 token.
16753
16754
  * @property {BigNumber} balance - The balance of the item.
16754
16755
  * @property {string} formattedBalance - The formatted balance of the item.
16755
16756
  * @property {TokenInfo} token - The token info of the item.
@@ -16761,18 +16762,20 @@ type TokenBalance = {
16761
16762
  token: TokenInfo;
16762
16763
  };
16763
16764
  /**
16764
- * Represents the balance for an ERC20.
16765
+ * Represents the balance for an ERC721.
16766
+ * @property {ItemType.ERC721} type - Type to indicate this is an ERC721 token.
16765
16767
  * @property {BigNumber} balance - The balance of the item.
16766
16768
  * @property {string} formattedBalance - The formatted balance of the item.
16767
- * @property {TokenInfo} token - The token info of the item.
16769
+ * @property {string} contractAddress - The contract address of the ERC721 collection.
16770
+ * @property {string} id - The ID of the ERC721 in the collection.
16768
16771
  */
16769
- interface ERC721Balance {
16772
+ type ERC721Balance = {
16770
16773
  type: ItemType.ERC721;
16771
16774
  balance: BigNumber;
16772
16775
  formattedBalance: string;
16773
16776
  contractAddress: string;
16774
16777
  id: string;
16775
- }
16778
+ };
16776
16779
  /**
16777
16780
  * Type representing the balance of an item.
16778
16781
  */
@@ -16789,6 +16792,9 @@ type BalanceDelta = {
16789
16792
  /**
16790
16793
  * A type representing the Smart Checkout routing options available for a user
16791
16794
  * if they are configured and enabled (not geo-blocked etc.)
16795
+ * @property {boolean | undefined} onRamp - If the user can use onramp
16796
+ * @property {boolean | undefined} swap - If the user can use swap
16797
+ * @property {boolean | undefined} bridge - If the user can use bridge
16792
16798
  */
16793
16799
  type AvailableRoutingOptions = {
16794
16800
  onRamp?: boolean;
@@ -17311,7 +17317,8 @@ declare enum CheckoutErrorType {
17311
17317
  BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
17312
17318
  ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
17313
17319
  ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR",
17314
- API_ERROR = "API_ERROR"
17320
+ API_ERROR = "API_ERROR",
17321
+ ORDER_EXPIRED_ERROR = "ORDER_EXPIRED_ERROR"
17315
17322
  }
17316
17323
  /**
17317
17324
  * Represents an error object with a specific type, optional message, and optional data.
package/dist/index.js CHANGED
@@ -3610,7 +3610,7 @@ class MultiRollupApiClients {
3610
3610
  }
3611
3611
 
3612
3612
  // eslint-disable-next-line @typescript-eslint/naming-convention
3613
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.12' };
3613
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.13' };
3614
3614
  const createConfig = ({ basePath, headers, }) => {
3615
3615
  if (!basePath.trim()) {
3616
3616
  throw Error('basePath can not be empty');
@@ -3670,7 +3670,7 @@ class APIError extends Error {
3670
3670
 
3671
3671
  /* eslint-disable implicit-arrow-linebreak */
3672
3672
  const defaultHeaders = {
3673
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.12',
3673
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.13',
3674
3674
  };
3675
3675
  /**
3676
3676
  * createAPIConfiguration to create a custom Configuration
@@ -4081,7 +4081,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4081
4081
  chainID,
4082
4082
  coreContractAddress,
4083
4083
  registrationContractAddress,
4084
- sdkVersion: 'ts-immutable-sdk-0.27.12',
4084
+ sdkVersion: 'ts-immutable-sdk-0.27.13',
4085
4085
  });
4086
4086
  /**
4087
4087
  * Sets `sdkVersion` at the time of build
@@ -29630,6 +29630,7 @@ var $e055e79256bbc1dd$export$80f4da0d409a629d;
29630
29630
  CheckoutErrorType["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
29631
29631
  CheckoutErrorType["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
29632
29632
  CheckoutErrorType["API_ERROR"] = "API_ERROR";
29633
+ CheckoutErrorType["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
29633
29634
  })($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
29634
29635
  class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
29635
29636
  message;
@@ -32713,16 +32714,24 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32713
32714
  let unsignedApprovalTransactions = [];
32714
32715
  let unsignedFulfillmentTransactions = [];
32715
32716
  let orderActions = [];
32716
- const fulfillOrderStartTime = new Date().getTime();
32717
+ const fulfillOrderStartTime = performance.now();
32717
32718
  try {
32718
32719
  const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
32719
32720
  const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
32720
32721
  orderActions = actions;
32721
32722
  unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
32722
32723
  } catch (err) {
32723
- // Silently ignore error as this is usually thrown if user does not have enough balance
32724
- const elapsedTimeInSeconds = (new Date().getTime() - fulfillOrderStartTime) / 1000;
32724
+ const elapsedTimeInSeconds = (performance.now() - fulfillOrderStartTime) / 1000;
32725
32725
  ($458d407830d66110$export$e6a390ea6399b7d8)(config, "Time to call fulfillOrder from the orderbook", elapsedTimeInSeconds);
32726
+ if (err.message.includes((OrderStatusName).EXPIRED)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Order is expired", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).ORDER_EXPIRED_ERROR, {
32727
+ orderId: id
32728
+ });
32729
+ // The balances error will be handled by bulk order fulfillment but for now we
32730
+ // need to assert on this string to check that the error is not a balances error
32731
+ if (!err.message.includes("The fulfiller does not have the balances needed to fulfill")) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error occurred while trying to fulfill the order", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR, {
32732
+ orderId: id,
32733
+ message: err.message
32734
+ });
32726
32735
  }
32727
32736
  try {
32728
32737
  unsignedFulfillmentTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned fulfillment transactions", (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions));
@@ -33307,7 +33316,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
33307
33316
  })($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
33308
33317
 
33309
33318
 
33310
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.12";
33319
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.13";
33311
33320
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
33312
33321
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
33313
33322
 
package/dist/passport.js CHANGED
@@ -2072,7 +2072,7 @@ class MultiRollupApiClients {
2072
2072
  }
2073
2073
 
2074
2074
  // eslint-disable-next-line @typescript-eslint/naming-convention
2075
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.27.12' };
2075
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.27.13' };
2076
2076
  const createConfig = ({ basePath, headers, }) => {
2077
2077
  if (!basePath.trim()) {
2078
2078
  throw Error('basePath can not be empty');
@@ -2128,7 +2128,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
2128
2128
  chainID,
2129
2129
  coreContractAddress,
2130
2130
  registrationContractAddress,
2131
- sdkVersion: 'ts-immutable-sdk-0.27.12',
2131
+ sdkVersion: 'ts-immutable-sdk-0.27.13',
2132
2132
  });
2133
2133
  /**
2134
2134
  * Sets `sdkVersion` at the time of build
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "0.27.12",
4
+ "version": "0.27.13",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",