@imtbl/sdk 0.26.0 → 0.27.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.
package/dist/index.js CHANGED
@@ -3533,7 +3533,7 @@ class MultiRollupApiClients {
3533
3533
  }
3534
3534
 
3535
3535
  // eslint-disable-next-line @typescript-eslint/naming-convention
3536
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.26.0' };
3536
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.0' };
3537
3537
  const createConfig = ({ basePath, headers, }) => {
3538
3538
  if (!basePath.trim()) {
3539
3539
  throw Error('basePath can not be empty');
@@ -3593,7 +3593,7 @@ class APIError extends Error {
3593
3593
 
3594
3594
  /* eslint-disable implicit-arrow-linebreak */
3595
3595
  const defaultHeaders = {
3596
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.26.0',
3596
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.0',
3597
3597
  };
3598
3598
  /**
3599
3599
  * createAPIConfiguration to create a custom Configuration
@@ -3997,7 +3997,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
3997
3997
  chainID,
3998
3998
  coreContractAddress,
3999
3999
  registrationContractAddress,
4000
- sdkVersion: 'ts-immutable-sdk-0.26.0',
4000
+ sdkVersion: 'ts-immutable-sdk-0.27.0',
4001
4001
  });
4002
4002
  /**
4003
4003
  * Sets `sdkVersion` at the time of build
@@ -32018,15 +32018,6 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
32018
32018
  fundingRoutes: []
32019
32019
  };
32020
32020
  let priority = 0;
32021
- if (bridgeFundingStep) {
32022
- priority++;
32023
- response.fundingRoutes.push({
32024
- priority: priority,
32025
- steps: [
32026
- bridgeFundingStep
32027
- ]
32028
- });
32029
- }
32030
32021
  if (swapFundingSteps.length > 0) {
32031
32022
  priority++;
32032
32023
  swapFundingSteps.forEach((swapFundingStep)=>{
@@ -32038,6 +32029,15 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
32038
32029
  });
32039
32030
  });
32040
32031
  }
32032
+ if (bridgeFundingStep) {
32033
+ priority++;
32034
+ response.fundingRoutes.push({
32035
+ priority: priority,
32036
+ steps: [
32037
+ bridgeFundingStep
32038
+ ]
32039
+ });
32040
+ }
32041
32041
  if (onRampFundingStep) {
32042
32042
  priority++;
32043
32043
  response.fundingRoutes.push({
@@ -32085,12 +32085,10 @@ const $0e7419077c373b24$export$9e073f9ada8c81e6 = async (config, provider, itemR
32085
32085
  };
32086
32086
  const availableRoutingOptions = await ($7f2e17f026d4fc8d$export$86d9f998ddda013e)(config, provider);
32087
32087
  const routingOutcome = await ($c16168a9c28ae4fd$export$92606e71d0a264ff)(config, ownerAddress, balanceCheckResult, availableRoutingOptions);
32088
- const isPassport = provider.provider?.isPassport || false;
32089
32088
  return {
32090
32089
  sufficient: sufficient,
32091
32090
  transactionRequirements: transactionRequirements,
32092
32091
  router: {
32093
- isPassport: isPassport,
32094
32092
  availableRoutingOptions: availableRoutingOptions,
32095
32093
  routingOutcome: routingOutcome
32096
32094
  }
@@ -32304,7 +32302,7 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32304
32302
  let order;
32305
32303
  let spenderAddress = "";
32306
32304
  const gasLimit = (constants).estimatedFulfillmentGasGwei;
32307
- if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were passed in, must pass at least one order", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR);
32305
+ if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were provided to the orders array. Please provide at least one order.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR);
32308
32306
  const { id: id, takerFees: takerFees } = orders[0];
32309
32307
  try {
32310
32308
  orderbook = await $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
@@ -32380,9 +32378,7 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32380
32378
  status: ($4b58188d47aafe8d$export$de7bcda3c490bf18).FAILED,
32381
32379
  transactionHash: approvalResult.transactionHash,
32382
32380
  reason: approvalResult.reason,
32383
- smartCheckoutResult: [
32384
- smartCheckoutResult
32385
- ]
32381
+ smartCheckoutResult: smartCheckoutResult
32386
32382
  };
32387
32383
  try {
32388
32384
  if (unsignedFulfillmentTransactions.length === 0) unsignedFulfillmentTransactions = await (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions);
@@ -32396,22 +32392,16 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32396
32392
  status: ($4b58188d47aafe8d$export$de7bcda3c490bf18).FAILED,
32397
32393
  transactionHash: fulfillmentResult.transactionHash,
32398
32394
  reason: fulfillmentResult.reason,
32399
- smartCheckoutResult: [
32400
- smartCheckoutResult
32401
- ]
32395
+ smartCheckoutResult: smartCheckoutResult
32402
32396
  };
32403
32397
  return {
32404
32398
  status: ($4b58188d47aafe8d$export$de7bcda3c490bf18).SUCCESS,
32405
- smartCheckoutResult: [
32406
- smartCheckoutResult
32407
- ]
32399
+ smartCheckoutResult: smartCheckoutResult
32408
32400
  };
32409
32401
  }
32410
32402
  return {
32411
32403
  status: ($4b58188d47aafe8d$export$de7bcda3c490bf18).INSUFFICIENT_FUNDS,
32412
- smartCheckoutResult: [
32413
- smartCheckoutResult
32414
- ]
32404
+ smartCheckoutResult: smartCheckoutResult
32415
32405
  };
32416
32406
  };
32417
32407
 
@@ -32425,7 +32415,7 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32425
32415
 
32426
32416
  const $9c3db1bb9c8b69d3$export$70b61ad426ddbe54 = async (config, provider, orderIds)=>{
32427
32417
  let unsignedCancelOrderTransaction;
32428
- if (orderIds.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orderIds were passed in, must pass at least one orderId to cancel", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CANCEL_ORDER_LISTING_ERROR);
32418
+ if (orderIds.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orderIds were provided to the orderIds array. Please provide at least one orderId.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CANCEL_ORDER_LISTING_ERROR);
32429
32419
  // Update this when bulk cancel is supported
32430
32420
  const orderId = orderIds[0];
32431
32421
  try {
@@ -32486,7 +32476,7 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
32486
32476
  let orderbook;
32487
32477
  let listing;
32488
32478
  let spenderAddress = "";
32489
- if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were parsed, must parse at least one order", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PREPARE_ORDER_LISTING_ERROR);
32479
+ if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were provided to the orders array. Please provide at least one order.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PREPARE_ORDER_LISTING_ERROR);
32490
32480
  const { buyToken: buyToken, sellToken: sellToken, makerFees: makerFees } = orders[0];
32491
32481
  let decimals = 18;
32492
32482
  if (buyToken.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20) {
@@ -32533,9 +32523,7 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
32533
32523
  status: ($4b58188d47aafe8d$export$de7bcda3c490bf18).FAILED,
32534
32524
  transactionHash: approvalResult.transactionHash,
32535
32525
  reason: approvalResult.reason,
32536
- smartCheckoutResult: [
32537
- smartCheckoutResult
32538
- ]
32526
+ smartCheckoutResult: smartCheckoutResult
32539
32527
  };
32540
32528
  const unsignedMessage = ($a7367d01c6e76b1c$export$d62081fac18000c2)(listing.orderHash, listing.orderComponents, listing.actions);
32541
32529
  if (!unsignedMessage) // For sell it is expected the orderbook will always return an unsigned message
@@ -32572,16 +32560,12 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
32572
32560
  orderIds: [
32573
32561
  orderId
32574
32562
  ],
32575
- smartCheckoutResult: [
32576
- smartCheckoutResult
32577
- ]
32563
+ smartCheckoutResult: smartCheckoutResult
32578
32564
  };
32579
32565
  }
32580
32566
  return {
32581
32567
  status: ($4b58188d47aafe8d$export$de7bcda3c490bf18).INSUFFICIENT_FUNDS,
32582
- smartCheckoutResult: [
32583
- smartCheckoutResult
32584
- ]
32568
+ smartCheckoutResult: smartCheckoutResult
32585
32569
  };
32586
32570
  };
32587
32571
 
@@ -32938,7 +32922,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
32938
32922
  })($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
32939
32923
 
32940
32924
 
32941
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.26.0";
32925
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.0";
32942
32926
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
32943
32927
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
32944
32928
 
@@ -33072,7 +33056,7 @@ var $207ed853f11d19d5$export$5a0ace85cae72d45;
33072
33056
  IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
33073
33057
  IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
33074
33058
  IMTBLWidgetEvents["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
33075
- IMTBLWidgetEvents["IMTBL_PRIMARY_REVENUE_WIDGET_EVENT"] = "imtbl-primary-revenue-widget";
33059
+ IMTBLWidgetEvents["IMTBL_PRIMARY_REVENUE_WIDGET_EVENT"] = "imtbl-sale-widget";
33076
33060
  })($207ed853f11d19d5$export$5a0ace85cae72d45 || ($207ed853f11d19d5$export$5a0ace85cae72d45 = {}));
33077
33061
 
33078
33062
 
@@ -33112,18 +33096,18 @@ $parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => $53d219e7f6bf0c
33112
33096
  })($53d219e7f6bf0cd6$export$140a49745ab55563 || ($53d219e7f6bf0cd6$export$140a49745ab55563 = {}));
33113
33097
 
33114
33098
 
33115
- var $8c83f59522c4ca40$exports = {};
33099
+ var $9b3189b6b155842e$exports = {};
33116
33100
 
33117
- $parcel$export($8c83f59522c4ca40$exports, "PrimaryRevenueEventType", () => $8c83f59522c4ca40$export$b33478ffb988bd5e);
33101
+ $parcel$export($9b3189b6b155842e$exports, "SaleEventType", () => $9b3189b6b155842e$export$881881ffb3bd733e);
33118
33102
  /**
33119
- * Enum representing possible Primary Revenue Widget event types.
33120
- */ var $8c83f59522c4ca40$export$b33478ffb988bd5e;
33121
- (function(PrimaryRevenueEventType) {
33122
- PrimaryRevenueEventType["CLOSE_WIDGET"] = "close-widget";
33123
- PrimaryRevenueEventType["SUCCESS"] = "success";
33124
- PrimaryRevenueEventType["FAILURE"] = "failure";
33125
- PrimaryRevenueEventType["REJECTED"] = "rejected";
33126
- })($8c83f59522c4ca40$export$b33478ffb988bd5e || ($8c83f59522c4ca40$export$b33478ffb988bd5e = {}));
33103
+ * Enum representing possible Sale Widget event types.
33104
+ */ var $9b3189b6b155842e$export$881881ffb3bd733e;
33105
+ (function(SaleEventType) {
33106
+ SaleEventType["CLOSE_WIDGET"] = "close-widget";
33107
+ SaleEventType["SUCCESS"] = "success";
33108
+ SaleEventType["FAILURE"] = "failure";
33109
+ SaleEventType["REJECTED"] = "rejected";
33110
+ })($9b3189b6b155842e$export$881881ffb3bd733e || ($9b3189b6b155842e$export$881881ffb3bd733e = {}));
33127
33111
 
33128
33112
 
33129
33113
  var $15cc9e120aa6f3bf$exports = {};
@@ -33371,7 +33355,7 @@ var checkout_widgets = /*#__PURE__*/Object.freeze({
33371
33355
  get OnRampEventType () { return $d882ddc5600b1284$export$66ec39c0924078d8; },
33372
33356
  OnRampReact: $f94f63f2c041a04c$export$9e363c61ea99bbb4,
33373
33357
  get OrchestrationEventType () { return $ad06b030b1a3ba34$export$b80d2daf830437b9; },
33374
- get PrimaryRevenueEventType () { return $8c83f59522c4ca40$export$b33478ffb988bd5e; },
33358
+ get SaleEventType () { return $9b3189b6b155842e$export$881881ffb3bd733e; },
33375
33359
  get SwapEventType () { return $53d219e7f6bf0cd6$export$140a49745ab55563; },
33376
33360
  SwapReact: $a4fbb8e3a6aeff58$export$971e031379577f4,
33377
33361
  UpdateConfig: $430e3eda76fa4d5f$export$bf1548ba7e61c17f,
package/dist/passport.js CHANGED
@@ -2067,7 +2067,7 @@ class MultiRollupApiClients {
2067
2067
  }
2068
2068
 
2069
2069
  // eslint-disable-next-line @typescript-eslint/naming-convention
2070
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.26.0' };
2070
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.27.0' };
2071
2071
  const createConfig = ({ basePath, headers, }) => {
2072
2072
  if (!basePath.trim()) {
2073
2073
  throw Error('basePath can not be empty');
@@ -2123,7 +2123,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
2123
2123
  chainID,
2124
2124
  coreContractAddress,
2125
2125
  registrationContractAddress,
2126
- sdkVersion: 'ts-immutable-sdk-0.26.0',
2126
+ sdkVersion: 'ts-immutable-sdk-0.27.0',
2127
2127
  });
2128
2128
  /**
2129
2129
  * 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.26.0",
4
+ "version": "0.27.0",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",