@imtbl/sdk 1.71.2 → 1.72.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.
Files changed (57) hide show
  1. package/dist/{blockchain_data-Bhqm0if8.js → blockchain_data-BhKkcXKA.js} +2 -2
  2. package/dist/blockchain_data.js +3 -3
  3. package/dist/browser/checkout/{AddTokensWidget-DKzImmC-.js → AddTokensWidget-H9uRs_pu.js} +20 -38
  4. package/dist/browser/checkout/{BridgeWidget-CzVsQchC.js → BridgeWidget-DBlVbfR0.js} +9 -9
  5. package/dist/browser/checkout/{CommerceWidget-CUasC3oE.js → CommerceWidget-BLbJSgWC.js} +17 -17
  6. package/dist/browser/checkout/{CryptoFiatProvider-DKXCDDGn.js → CryptoFiatProvider-BSRVFRoD.js} +1 -1
  7. package/dist/browser/checkout/{EllipsizedText-UC6tKNEL.js → EllipsizedText-4rf2JtZP.js} +1 -1
  8. package/dist/browser/checkout/{FeesBreakdown-BfPztUaH.js → FeesBreakdown-BQak-_iI.js} +1 -1
  9. package/dist/browser/checkout/{HandoverContent-B3LLoEOB.js → HandoverContent-FPHu2HkR.js} +1 -1
  10. package/dist/browser/checkout/{OnRampWidget-ByivbO-g.js → OnRampWidget-CEQJezLx.js} +3 -3
  11. package/dist/browser/checkout/{SaleWidget-Dk7eHdEM.js → SaleWidget-DvoH4z6w.js} +14 -14
  12. package/dist/browser/checkout/{SpendingCapHero-LcUg19at.js → SpendingCapHero-v3WRS9c2.js} +1 -1
  13. package/dist/browser/checkout/{SwapWidget-B5I4qbQ2.js → SwapWidget-C_9cjLEV.js} +9 -9
  14. package/dist/browser/checkout/{TokenImage-BV7fW6TT.js → TokenImage-C22RrN2b.js} +1 -1
  15. package/dist/browser/checkout/{TopUpView--9kYu60j.js → TopUpView-DwImDKAn.js} +3 -3
  16. package/dist/browser/checkout/{WalletApproveHero-CzkeZMMr.js → WalletApproveHero-BceSDZx_.js} +3 -3
  17. package/dist/browser/checkout/{WalletWidget-72Q5gtXg.js → WalletWidget-CZ_lw4_E.js} +4 -4
  18. package/dist/browser/checkout/{auto-track-BvpUU2wR.js → auto-track-CW8Ech72.js} +1 -1
  19. package/dist/browser/checkout/{index-bkapV3e8.js → index-B5NVM-4U.js} +1 -1
  20. package/dist/browser/checkout/{index-Ck7ANhMH.js → index-BceUl1li.js} +1 -1
  21. package/dist/browser/checkout/{index-Bct905Kz.js → index-BxckLE4O.js} +1 -1
  22. package/dist/browser/checkout/{index-OdSoW-FV.js → index-C8kOoOd-.js} +1 -1
  23. package/dist/browser/checkout/{index-B_P1u-VM.js → index-CXWnaooi.js} +1 -1
  24. package/dist/browser/checkout/{index-BAnpeiGZ.js → index-CkZRB4el.js} +2 -2
  25. package/dist/browser/checkout/{index-CIzNTZ1B.js → index-QbI5he3_.js} +1 -1
  26. package/dist/browser/checkout/{index-79qqSOkN.js → index-_RJ0jfOR.js} +1 -1
  27. package/dist/browser/checkout/{index-Crwefhg1.js → index-v748oxe1.js} +19 -19
  28. package/dist/browser/checkout/{index.umd-nRJL7rJq.js → index.umd-DJ42SoRS.js} +1 -1
  29. package/dist/browser/checkout/sdk.js +4 -4
  30. package/dist/browser/checkout/{useInterval-DutEDQ90.js → useInterval-BBIIMGa6.js} +1 -1
  31. package/dist/browser/checkout/widgets-esm.js +1 -1
  32. package/dist/browser/checkout/widgets.js +809 -882
  33. package/dist/{checkout-DasYybUZ.js → checkout-Bbw4lMvu.js} +40 -9
  34. package/dist/checkout.js +5 -5
  35. package/dist/{config-DCVDc3v8.js → config-Bx5cZVwN.js} +1 -1
  36. package/dist/config.js +1 -1
  37. package/dist/{index-TFa0owz-.js → index-2-9CaV4G.js} +1 -1
  38. package/dist/{index-COICsNsE.js → index-BCzTpky5.js} +1 -1
  39. package/dist/{index-BmVyhpJX.js → index-B_tA2AB3.js} +1 -1
  40. package/dist/{index-NtppN-aK.js → index-BjKQNmKU.js} +1 -1
  41. package/dist/{index-o5dSv0jt.js → index-DgAAcKgb.js} +4 -4
  42. package/dist/{index-L_TcRmaA.js → index-DgPFc11T.js} +3 -3
  43. package/dist/index.browser.js +4 -4
  44. package/dist/index.browser.js.map +1 -1
  45. package/dist/index.cjs +42 -11
  46. package/dist/index.js +14 -14
  47. package/dist/{minting_backend-Bg5AfM_R.js → minting_backend-DCIEgk4Y.js} +3 -3
  48. package/dist/minting_backend.js +5 -5
  49. package/dist/{orderbook-CEguKubj.js → orderbook-C99VLAwP.js} +1 -1
  50. package/dist/orderbook.js +2 -2
  51. package/dist/{passport-vGE_K8Y1.js → passport--cxG4DFA.js} +3 -3
  52. package/dist/passport.js +4 -4
  53. package/dist/{webhook-BCQEMed_.js → webhook-KbzH4ZI4.js} +1 -1
  54. package/dist/webhook.js +2 -2
  55. package/dist/{x-SjcnDDz3.js → x-D5yMtJYf.js} +3 -3
  56. package/dist/x.js +4 -4
  57. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { E as Environment$1, t as track, I as ImmutableConfiguration } from './index-BmVyhpJX.js';
1
+ import { E as Environment$1, t as track, I as ImmutableConfiguration } from './index-B_tA2AB3.js';
2
2
  import globalAxios, { HttpStatusCode as HttpStatusCode$1 } from 'axios';
3
3
  import { ethers, BigNumber as BigNumber$1, ContractFactory, utils as utils$2, Contract as Contract$1 } from 'ethers';
4
4
  import { Web3Provider, JsonRpcProvider } from '@ethersproject/providers';
@@ -8,8 +8,8 @@ import assert from 'assert';
8
8
  import { FeeAmount, Route, SwapQuoter, Pool, Trade, toHex as toHex$1, encodeRouteToPath } from '@uniswap/v3-sdk';
9
9
  import { keccak256 as keccak256$1 } from '@ethersproject/solidity';
10
10
  import { SwapRouter, PaymentsExtended } from '@uniswap/router-sdk';
11
- import { c as constants, O as OrderStatusName, a as Orderbook, A as ActionType, T as TransactionPurpose, S as SignablePurpose } from './index-COICsNsE.js';
12
- import { B as BlockchainData } from './index-L_TcRmaA.js';
11
+ import { c as constants, O as OrderStatusName, a as Orderbook, A as ActionType, T as TransactionPurpose, S as SignablePurpose } from './index-BCzTpky5.js';
12
+ import { B as BlockchainData } from './index-DgPFc11T.js';
13
13
  import detectEthereumProvider from '@metamask/detect-provider';
14
14
  import semver from 'semver';
15
15
 
@@ -19207,7 +19207,7 @@ const flattenProperties = (properties) => {
19207
19207
  };
19208
19208
 
19209
19209
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
19210
- const SDK_VERSION = '1.71.2';
19210
+ const SDK_VERSION = '1.72.0';
19211
19211
  const getFrameParentDomain = () => {
19212
19212
  if (isNode()) {
19213
19213
  return '';
@@ -24316,7 +24316,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
24316
24316
  maxPriorityFeePerGas: BigNumber$1.from(10e9),
24317
24317
  };
24318
24318
 
24319
- const SDK_VERSION_MARKER = '1.71.2';
24319
+ const SDK_VERSION_MARKER = '1.72.0';
24320
24320
  // This SDK version is replaced by the `yarn build` command ran on the root level
24321
24321
  const globalPackageVersion = () => SDK_VERSION_MARKER;
24322
24322
 
@@ -28925,6 +28925,31 @@ function validateAndBuildVersion(version) {
28925
28925
  }
28926
28926
  return validatedVersion;
28927
28927
  }
28928
+ /**
28929
+ * Fetches the latest version of the package from the NPM registry.
28930
+ * Loads a specific latest version instead of relying on the latest tag helps with caching issues.
28931
+ * Falls back to 'latest' if an error occurs or if the response is invalid.
28932
+ * @returns {Promise<string>} A promise resolving to the latest version string or 'latest'.
28933
+ */
28934
+ async function getLatestVersionFromNpm() {
28935
+ const npmRegistryUrl = 'https://registry.npmjs.org/@imtbl/sdk/latest';
28936
+ const fallbackVersion = 'latest';
28937
+ try {
28938
+ const response = await fetch(npmRegistryUrl);
28939
+ if (!response.ok) {
28940
+ return fallbackVersion;
28941
+ }
28942
+ const data = await response.json();
28943
+ const version = data.version?.trim();
28944
+ if (version) {
28945
+ return version;
28946
+ }
28947
+ return fallbackVersion;
28948
+ }
28949
+ catch (error) {
28950
+ return fallbackVersion;
28951
+ }
28952
+ }
28928
28953
  /**
28929
28954
  * Returns the latest compatible version based on the provided checkout version config.
28930
28955
  * If no compatible version markers are provided, it returns 'latest'.
@@ -28943,8 +28968,8 @@ function latestCompatibleVersion(validVersion, compatibleVersionMarkers) {
28943
28968
  * If the build version is an alpha, it uses that version.
28944
28969
  * Defaults to 'latest' if no compatible version markers are found.
28945
28970
  */
28946
- function determineWidgetsVersion(validatedBuildVersion, initVersionProvided, versionConfig) {
28947
- // If version is provided in widget init parms, use that
28971
+ async function determineWidgetsVersion(validatedBuildVersion, initVersionProvided, versionConfig) {
28972
+ // If version is provided in widget init params, use that
28948
28973
  if (initVersionProvided) {
28949
28974
  return validatedBuildVersion;
28950
28975
  }
@@ -28956,7 +28981,13 @@ function determineWidgetsVersion(validatedBuildVersion, initVersionProvided, ver
28956
28981
  if (!versionConfig || !Array.isArray(versionConfig.compatibleVersionMarkers)) {
28957
28982
  return validatedBuildVersion;
28958
28983
  }
28959
- return latestCompatibleVersion(validatedBuildVersion, versionConfig.compatibleVersionMarkers);
28984
+ const compatibleVersion = latestCompatibleVersion(validatedBuildVersion, versionConfig.compatibleVersionMarkers);
28985
+ // If `latest` is returned, query NPM registry for the actual latest version
28986
+ if (compatibleVersion === 'latest') {
28987
+ const latestVersion = await getLatestVersionFromNpm();
28988
+ return latestVersion;
28989
+ }
28990
+ return compatibleVersion;
28960
28991
  }
28961
28992
 
28962
28993
  var RiskAssessmentLevel;
@@ -29035,7 +29066,7 @@ class Checkout {
29035
29066
  // Determine the version of the widgets to load
29036
29067
  const validatedBuildVersion = validateAndBuildVersion(init.version);
29037
29068
  const initVersionProvided = init.version !== undefined;
29038
- const widgetsVersion = determineWidgetsVersion(validatedBuildVersion, initVersionProvided, versionConfig);
29069
+ const widgetsVersion = await determineWidgetsVersion(validatedBuildVersion, initVersionProvided, versionConfig);
29039
29070
  track('checkout_sdk', 'widgets', {
29040
29071
  sdkVersion: globalPackageVersion(),
29041
29072
  validatedSdkVersion: validatedBuildVersion,
package/dist/checkout.js CHANGED
@@ -1,5 +1,5 @@
1
- export { A as AddTokensEventType, B as BlockExplorerService, a as BridgeEventType, C as ChainId, b as ChainName, d as ChainSlug, e as Checkout, f as CheckoutConfiguration, g as CheckoutError, h as CheckoutErrorType, i as CheckoutStatus, j as CommerceEventType, k as CommerceFailureEventType, l as CommerceFlowType, m as CommerceSuccessEventType, n as CommerceUserActionEventType, o as ConnectEventType, p as ConnectTargetLayer, E as ExchangeType, F as FeeType, q as FundingStepType, G as GasEstimateType, r as GasTokenType, I as IMMUTABLE_API_BASE_URL, s as IMTBLWidgetEvents, t as ItemType, N as NetworkFilterTypes, O as OnRampEventType, u as OrchestrationEventType, P as ProviderEventType, R as RoutingOutcomeType, S as SaleEventType, v as SalePaymentTypes, w as SwapDirection, x as SwapEventType, T as TokenFilterTypes, y as TransactionOrGasType, W as WalletEventType, z as WalletFilterTypes, D as WalletProviderName, H as WalletProviderRdns, J as WidgetTheme, K as WidgetType, L as fetchRiskAssessment, M as getMetaMaskProviderDetail, Q as getPassportProviderDetail, U as isAddressSanctioned, V as validateProvider } from './checkout-DasYybUZ.js';
2
- import './index-BmVyhpJX.js';
1
+ export { A as AddTokensEventType, B as BlockExplorerService, a as BridgeEventType, C as ChainId, b as ChainName, d as ChainSlug, e as Checkout, f as CheckoutConfiguration, g as CheckoutError, h as CheckoutErrorType, i as CheckoutStatus, j as CommerceEventType, k as CommerceFailureEventType, l as CommerceFlowType, m as CommerceSuccessEventType, n as CommerceUserActionEventType, o as ConnectEventType, p as ConnectTargetLayer, E as ExchangeType, F as FeeType, q as FundingStepType, G as GasEstimateType, r as GasTokenType, I as IMMUTABLE_API_BASE_URL, s as IMTBLWidgetEvents, t as ItemType, N as NetworkFilterTypes, O as OnRampEventType, u as OrchestrationEventType, P as ProviderEventType, R as RoutingOutcomeType, S as SaleEventType, v as SalePaymentTypes, w as SwapDirection, x as SwapEventType, T as TokenFilterTypes, y as TransactionOrGasType, W as WalletEventType, z as WalletFilterTypes, D as WalletProviderName, H as WalletProviderRdns, J as WidgetTheme, K as WidgetType, L as fetchRiskAssessment, M as getMetaMaskProviderDetail, Q as getPassportProviderDetail, U as isAddressSanctioned, V as validateProvider } from './checkout-Bbw4lMvu.js';
2
+ import './index-B_tA2AB3.js';
3
3
  import 'axios';
4
4
  import 'lru-memorise';
5
5
  import 'global-const';
@@ -10,13 +10,13 @@ import 'assert';
10
10
  import '@uniswap/v3-sdk';
11
11
  import '@ethersproject/solidity';
12
12
  import '@uniswap/router-sdk';
13
- import './index-COICsNsE.js';
13
+ import './index-BCzTpky5.js';
14
14
  import 'form-data';
15
15
  import '@opensea/seaport-js/lib/constants';
16
16
  import 'ethers-v6';
17
17
  import 'merkletreejs';
18
18
  import '@opensea/seaport-js';
19
- import './index-L_TcRmaA.js';
20
- import './index-NtppN-aK.js';
19
+ import './index-DgPFc11T.js';
20
+ import './index-BjKQNmKU.js';
21
21
  import '@metamask/detect-provider';
22
22
  import 'semver';
@@ -1,4 +1,4 @@
1
- import { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-BmVyhpJX.js';
1
+ import { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-B_tA2AB3.js';
2
2
 
3
3
  var config = /*#__PURE__*/Object.freeze({
4
4
  __proto__: null,
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
- export { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-BmVyhpJX.js';
1
+ export { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-B_tA2AB3.js';
2
2
  import 'axios';
3
3
  import 'lru-memorise';
4
4
  import 'global-const';
@@ -1,5 +1,5 @@
1
1
  import MessageValidator from 'sns-validator';
2
- import { E as Environment } from './index-BmVyhpJX.js';
2
+ import { E as Environment } from './index-B_tA2AB3.js';
3
3
 
4
4
  const validator = new MessageValidator();
5
5
  const allowedTopicArnPrefix = {
@@ -1,4 +1,4 @@
1
- import { t as track, E as Environment } from './index-BmVyhpJX.js';
1
+ import { t as track, E as Environment } from './index-B_tA2AB3.js';
2
2
  import globalAxios from 'axios';
3
3
  import FormData from 'form-data';
4
4
  import { OrderType as OrderType$1, ItemType as ItemType$1 } from '@opensea/seaport-js/lib/constants';
@@ -158,7 +158,7 @@ const flattenProperties = (properties) => {
158
158
  };
159
159
 
160
160
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
161
- const SDK_VERSION = '1.71.2';
161
+ const SDK_VERSION = '1.72.0';
162
162
  const getFrameParentDomain = () => {
163
163
  if (isNode()) {
164
164
  return '';
@@ -14336,7 +14336,7 @@ class MultiRollupApiClients {
14336
14336
  }
14337
14337
 
14338
14338
  // eslint-disable-next-line @typescript-eslint/naming-convention
14339
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.71.2' };
14339
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.72.0' };
14340
14340
  const createConfig = ({ basePath, headers, }) => {
14341
14341
  if (!basePath.trim()) {
14342
14342
  throw Error('basePath can not be empty');
@@ -1,5 +1,5 @@
1
- import { d as index$2, I as ImxApiClients } from './index-NtppN-aK.js';
2
- import { a as addKeysToHeadersOverride, E as Environment, I as ImmutableConfiguration } from './index-BmVyhpJX.js';
1
+ import { d as index$2, I as ImxApiClients } from './index-BjKQNmKU.js';
2
+ import { a as addKeysToHeadersOverride, E as Environment, I as ImmutableConfiguration } from './index-B_tA2AB3.js';
3
3
  import globalAxios from 'axios';
4
4
  import { keccak256 } from '@ethersproject/keccak256';
5
5
  import { toUtf8Bytes } from '@ethersproject/strings';
@@ -16,7 +16,7 @@ import '@ethersproject/abstract-signer';
16
16
  /* eslint-disable @typescript-eslint/naming-convention */
17
17
  class ApiConfiguration extends index$2.Configuration {
18
18
  }
19
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.71.2' };
19
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.72.0' };
20
20
  /**
21
21
  * @dev use createImmutableXConfiguration instead
22
22
  */
@@ -57,7 +57,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
57
57
  coreContractAddress,
58
58
  registrationContractAddress,
59
59
  registrationV4ContractAddress,
60
- sdkVersion: 'ts-immutable-sdk-1.71.2',
60
+ sdkVersion: 'ts-immutable-sdk-1.72.0',
61
61
  baseConfig,
62
62
  });
63
63
  const production = ({ baseConfig }) => createImmutableXConfiguration({
@@ -1,5 +1,5 @@
1
- import { a as index$1 } from './index-NtppN-aK.js';
2
- import { E as Environment, a as addKeysToHeadersOverride } from './index-BmVyhpJX.js';
1
+ import { a as index$1 } from './index-BjKQNmKU.js';
2
+ import { E as Environment, a as addKeysToHeadersOverride } from './index-B_tA2AB3.js';
3
3
  import globalAxios from 'axios';
4
4
 
5
5
  /**
@@ -21,7 +21,7 @@ class APIError extends Error {
21
21
 
22
22
  /* eslint-disable implicit-arrow-linebreak */
23
23
  const defaultHeaders = {
24
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.71.2',
24
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.72.0',
25
25
  };
26
26
  /**
27
27
  * createAPIConfiguration to create a custom Configuration