@imtbl/sdk 1.74.1 → 1.74.2-alpha.1

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-CHLz-AfG.js → blockchain_data-3lrULBa9.js} +2 -2
  2. package/dist/blockchain_data.js +3 -3
  3. package/dist/browser/checkout/{AddTokensWidget-CztPb9kb.js → AddTokensWidget-DzscKDRZ.js} +26 -9
  4. package/dist/browser/checkout/{BridgeWidget-xQL1f5RS.js → BridgeWidget-BD90bYmK.js} +9 -9
  5. package/dist/browser/checkout/{CommerceWidget-C8KSGQK9.js → CommerceWidget-BUQnn8XB.js} +17 -17
  6. package/dist/browser/checkout/{CryptoFiatProvider-BXgf9F-i.js → CryptoFiatProvider-Bf2odWR3.js} +1 -1
  7. package/dist/browser/checkout/{EllipsizedText-GAbpfSIS.js → EllipsizedText-CzPegcQu.js} +1 -1
  8. package/dist/browser/checkout/{FeesBreakdown-CzmMNfOp.js → FeesBreakdown-CzbrIDPC.js} +1 -1
  9. package/dist/browser/checkout/{HandoverContent-oTbSfNut.js → HandoverContent-DQwWgbvL.js} +1 -1
  10. package/dist/browser/checkout/{OnRampWidget-DP0RulBJ.js → OnRampWidget-BPuY7Qxm.js} +3 -3
  11. package/dist/browser/checkout/{SaleWidget-CSC_-ilt.js → SaleWidget-CC1taAhO.js} +14 -14
  12. package/dist/browser/checkout/{SpendingCapHero-CiBFQcDQ.js → SpendingCapHero-CNCuWYO1.js} +1 -1
  13. package/dist/browser/checkout/{SwapWidget-D8mdOJR1.js → SwapWidget-CwvTxKcv.js} +9 -9
  14. package/dist/browser/checkout/{TokenImage-D_qtgTRv.js → TokenImage-CGmq7Nr_.js} +1 -1
  15. package/dist/browser/checkout/{TopUpView-DX3C45bt.js → TopUpView-D2A5XJUs.js} +3 -3
  16. package/dist/browser/checkout/{WalletApproveHero-BcbsKhWu.js → WalletApproveHero-DbR2Ae3M.js} +3 -3
  17. package/dist/browser/checkout/{WalletWidget-2MPkYTAN.js → WalletWidget-DA9RyvqZ.js} +4 -4
  18. package/dist/browser/checkout/{auto-track-CQA82jwV.js → auto-track-B1Qy-yIq.js} +1 -1
  19. package/dist/browser/checkout/{index-DAPPGYKi.js → index-8Q4nQpgt.js} +19 -19
  20. package/dist/browser/checkout/{index-Djoor3yS.js → index-BuEXbHdo.js} +1 -1
  21. package/dist/browser/checkout/{index-a_9Zcvov.js → index-CN0O6yWI.js} +1 -1
  22. package/dist/browser/checkout/{index-jfUEm0oq.js → index-D_4OabDC.js} +2 -2
  23. package/dist/browser/checkout/{index-BnxGnuSX.js → index-DaTYeCyN.js} +1 -1
  24. package/dist/browser/checkout/{index-VmzpHG0_.js → index-Dpuw9krV.js} +1 -1
  25. package/dist/browser/checkout/{index-DJ3hhNKr.js → index-XzVOkgCN.js} +1 -1
  26. package/dist/browser/checkout/{index-hULlBSlo.js → index-Yuvtciip.js} +1 -1
  27. package/dist/browser/checkout/{index-rClMZmNK.js → index-x7-GWmgk.js} +1 -1
  28. package/dist/browser/checkout/{index.umd-kh0DU3OQ.js → index.umd-Dc18jIgK.js} +1 -1
  29. package/dist/browser/checkout/sdk.js +4 -4
  30. package/dist/browser/checkout/{useInterval-qyUn8AXV.js → useInterval-Dxbmqm_w.js} +1 -1
  31. package/dist/browser/checkout/widgets-esm.js +1 -1
  32. package/dist/browser/checkout/widgets.js +20 -3
  33. package/dist/{checkout-DNAmKsDR.js → checkout-DIeCaqFz.js} +5 -5
  34. package/dist/checkout.js +5 -5
  35. package/dist/{config-yR23aBtp.js → config-Dpo-kaQf.js} +1 -1
  36. package/dist/config.js +1 -1
  37. package/dist/{index-CJZB89Oy.js → index-BnL1Z_iW.js} +1 -1
  38. package/dist/{index-aRnpSCsU.js → index-BzoV3jeW.js} +3 -3
  39. package/dist/{index-DcU7MOEr.js → index-C8EWk0YW.js} +1 -1
  40. package/dist/{index-B_6J6Cxc.js → index-ClN_aZQZ.js} +1 -1
  41. package/dist/{index-Ck6iJKmC.js → index-Dk7ZYrMj.js} +4 -4
  42. package/dist/{index-BA1TogTR.js → index-Lbj5dTJZ.js} +1 -1
  43. package/dist/index.browser.js +4 -4
  44. package/dist/index.browser.js.map +1 -1
  45. package/dist/index.cjs +7 -7
  46. package/dist/index.js +14 -14
  47. package/dist/{minting_backend-6D2Zvuqi.js → minting_backend-D-TTb4Zv.js} +3 -3
  48. package/dist/minting_backend.js +5 -5
  49. package/dist/{orderbook-BHfXDVJD.js → orderbook-whvNZ1IE.js} +1 -1
  50. package/dist/orderbook.js +2 -2
  51. package/dist/{passport-DiCwBczL.js → passport-CbprFi2z.js} +3 -3
  52. package/dist/passport.js +4 -4
  53. package/dist/{webhook-ZLowlqwb.js → webhook-f7zaWXvV.js} +1 -1
  54. package/dist/webhook.js +2 -2
  55. package/dist/{x-R_O_MBpU.js → x-CzEWChjB.js} +3 -3
  56. package/dist/x.js +4 -4
  57. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { r as reactExports, dF as useBrowserLayoutEffect } from './index-DAPPGYKi.js';
1
+ import { r as reactExports, dF as useBrowserLayoutEffect } from './index-8Q4nQpgt.js';
2
2
 
3
3
  // Inspired by https://usehooks-ts.com/react-hook/use-interval
4
4
  function useInterval(callback, delay) {
@@ -1 +1 @@
1
- export { e9 as WidgetsFactory } from './index-DAPPGYKi.js';
1
+ export { e9 as WidgetsFactory } from './index-8Q4nQpgt.js';
@@ -244142,6 +244142,8 @@ function print() { __p += __j.call(arguments, '') }
244142
244142
  toTokenAddress,
244143
244143
  geoBlocked: !isSwapAvailable,
244144
244144
  },
244145
+ }).catch((err) => {
244146
+ trackError('commerce', 'addTokensLoaded', err);
244145
244147
  });
244146
244148
  }, [id, isSwapAvailable]);
244147
244149
  reactExports.useEffect(() => {
@@ -411481,8 +411483,11 @@ function print() { __p += __j.call(arguments, '') }
411481
411483
 
411482
411484
  const isSquidNativeToken = (token) => token.toLowerCase() === SQUID_NATIVE_TOKEN.toLowerCase();
411483
411485
 
411484
- const withMetricsAsync = async (fn, flowName, errorType) => {
411486
+ const withMetricsAsync = async (fn, flowName, anonymousId, errorType) => {
411485
411487
  const flow = trackFlow('commerce', flowName);
411488
+ if (anonymousId) {
411489
+ flow.addEvent(`anonymousId_${anonymousId}`);
411490
+ }
411486
411491
  try {
411487
411492
  return await fn(flow);
411488
411493
  }
@@ -411511,6 +411516,7 @@ function print() { __p += __j.call(arguments, '') }
411511
411516
  const TRANSACTION_NOT_COMPLETED = 'transaction not completed';
411512
411517
  const useExecute = (contextId, environment) => {
411513
411518
  const { showErrorHandover } = useError(environment);
411519
+ const { user } = useAnalytics();
411514
411520
  const { eventTargetState: { eventTarget }, } = reactExports.useContext(EventTargetContext);
411515
411521
  const waitForReceipt = async (provider, txHash, maxAttempts = 120) => {
411516
411522
  const result = await retry(async () => {
@@ -411632,10 +411638,19 @@ function print() { __p += __j.call(arguments, '') }
411632
411638
  flow.addEvent('transactionSent');
411633
411639
  return await waitForReceipt(provider, tx.hash);
411634
411640
  };
411641
+ const getAnonymousId = async () => {
411642
+ try {
411643
+ const userData = await user();
411644
+ return userData?.anonymousId() ?? undefined;
411645
+ }
411646
+ catch (error) {
411647
+ return undefined;
411648
+ }
411649
+ };
411635
411650
  const approve = async (fromProviderInfo, provider, routeResponse) => {
411636
411651
  try {
411637
411652
  if (!isSquidNativeToken(routeResponse?.route?.params.fromToken)) {
411638
- return await withMetricsAsync((flow) => callApprove(flow, fromProviderInfo, provider, routeResponse), `${UserJourney.ADD_TOKENS}_Approve`, (error) => (isRejectedError(error) ? 'rejected' : ''));
411653
+ return await withMetricsAsync((flow) => callApprove(flow, fromProviderInfo, provider, routeResponse), `${UserJourney.ADD_TOKENS}_Approve`, await getAnonymousId(), (error) => (isRejectedError(error) ? 'rejected' : ''));
411639
411654
  }
411640
411655
  return undefined;
411641
411656
  }
@@ -411658,7 +411673,7 @@ function print() { __p += __j.call(arguments, '') }
411658
411673
  throw new Error('provider does not have request method');
411659
411674
  }
411660
411675
  try {
411661
- return await withMetricsAsync((flow) => callExecute(flow, squid, fromProviderInfo, provider, routeResponse), `${UserJourney.ADD_TOKENS}_Execute`, (error) => (isRejectedError(error) ? 'rejected' : ''));
411676
+ return await withMetricsAsync((flow) => callExecute(flow, squid, fromProviderInfo, provider, routeResponse), `${UserJourney.ADD_TOKENS}_Execute`, await getAnonymousId(), (error) => (isRejectedError(error) ? 'rejected' : ''));
411662
411677
  }
411663
411678
  catch (error) {
411664
411679
  handleTransactionError(error);
@@ -412007,6 +412022,8 @@ function print() { __p += __j.call(arguments, '') }
412007
412022
  fromTokenSymbol: amountData?.fromToken.symbol,
412008
412023
  toTokenSymbol: amountData?.toToken.symbol,
412009
412024
  },
412025
+ }).catch((err) => {
412026
+ trackError('commerce', 'addTokensFundsAdded', err);
412010
412027
  });
412011
412028
  sendAddTokensSuccessEvent(eventTarget, executeTxnReceipt.transactionHash);
412012
412029
  if (toChain === fromChain) {
@@ -1,4 +1,4 @@
1
- import { E as Environment$1, t as track, I as ImmutableConfiguration } from './index-B_6J6Cxc.js';
1
+ import { E as Environment$1, t as track, I as ImmutableConfiguration } from './index-ClN_aZQZ.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-BA1TogTR.js';
12
- import { B as BlockchainData } from './index-aRnpSCsU.js';
11
+ import { c as constants, O as OrderStatusName, a as Orderbook, A as ActionType, T as TransactionPurpose, S as SignablePurpose } from './index-Lbj5dTJZ.js';
12
+ import { B as BlockchainData } from './index-BzoV3jeW.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.74.1';
19210
+ const SDK_VERSION = '1.74.2-alpha.1';
19211
19211
  const getFrameParentDomain = () => {
19212
19212
  if (isNode()) {
19213
19213
  return '';
@@ -24327,7 +24327,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
24327
24327
  maxPriorityFeePerGas: BigNumber$1.from(10e9),
24328
24328
  };
24329
24329
 
24330
- const SDK_VERSION_MARKER = '1.74.1';
24330
+ const SDK_VERSION_MARKER = '1.74.2-alpha.1';
24331
24331
  // This SDK version is replaced by the `yarn build` command ran on the root level
24332
24332
  const globalPackageVersion = () => SDK_VERSION_MARKER;
24333
24333
 
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, v as PurchaseEventType, R as RoutingOutcomeType, S as SaleEventType, w as SalePaymentTypes, x as SwapDirection, y as SwapEventType, T as TokenFilterTypes, z as TransactionOrGasType, W as WalletEventType, D as WalletFilterTypes, H as WalletProviderName, J as WalletProviderRdns, K as WidgetTheme, L as WidgetType, M as fetchRiskAssessment, Q as getMetaMaskProviderDetail, U as getPassportProviderDetail, V as isAddressSanctioned, X as validateProvider } from './checkout-DNAmKsDR.js';
2
- import './index-B_6J6Cxc.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, v as PurchaseEventType, R as RoutingOutcomeType, S as SaleEventType, w as SalePaymentTypes, x as SwapDirection, y as SwapEventType, T as TokenFilterTypes, z as TransactionOrGasType, W as WalletEventType, D as WalletFilterTypes, H as WalletProviderName, J as WalletProviderRdns, K as WidgetTheme, L as WidgetType, M as fetchRiskAssessment, Q as getMetaMaskProviderDetail, U as getPassportProviderDetail, V as isAddressSanctioned, X as validateProvider } from './checkout-DIeCaqFz.js';
2
+ import './index-ClN_aZQZ.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-BA1TogTR.js';
13
+ import './index-Lbj5dTJZ.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-aRnpSCsU.js';
20
- import './index-DcU7MOEr.js';
19
+ import './index-BzoV3jeW.js';
20
+ import './index-C8EWk0YW.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-B_6J6Cxc.js';
1
+ import { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-ClN_aZQZ.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-B_6J6Cxc.js';
1
+ export { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-ClN_aZQZ.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-B_6J6Cxc.js';
2
+ import { E as Environment } from './index-ClN_aZQZ.js';
3
3
 
4
4
  const validator = new MessageValidator();
5
5
  const allowedTopicArnPrefix = {
@@ -1,5 +1,5 @@
1
- import { a as index$1 } from './index-DcU7MOEr.js';
2
- import { E as Environment, a as addKeysToHeadersOverride } from './index-B_6J6Cxc.js';
1
+ import { a as index$1 } from './index-C8EWk0YW.js';
2
+ import { E as Environment, a as addKeysToHeadersOverride } from './index-ClN_aZQZ.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.74.1',
24
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.74.2-alpha.1',
25
25
  };
26
26
  /**
27
27
  * createAPIConfiguration to create a custom Configuration
@@ -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.74.1' };
14339
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.74.2-alpha.1' };
14340
14340
  const createConfig = ({ basePath, headers, }) => {
14341
14341
  if (!basePath.trim()) {
14342
14342
  throw Error('basePath can not be empty');
@@ -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.74.1';
161
+ const SDK_VERSION = '1.74.2-alpha.1';
162
162
  const getFrameParentDomain = () => {
163
163
  if (isNode()) {
164
164
  return '';
@@ -1,5 +1,5 @@
1
- import { d as index$2, I as ImxApiClients } from './index-DcU7MOEr.js';
2
- import { a as addKeysToHeadersOverride, E as Environment, I as ImmutableConfiguration } from './index-B_6J6Cxc.js';
1
+ import { d as index$2, I as ImxApiClients } from './index-C8EWk0YW.js';
2
+ import { a as addKeysToHeadersOverride, E as Environment, I as ImmutableConfiguration } from './index-ClN_aZQZ.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.74.1' };
19
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.74.2-alpha.1' };
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.74.1',
60
+ sdkVersion: 'ts-immutable-sdk-1.74.2-alpha.1',
61
61
  baseConfig,
62
62
  });
63
63
  const production = ({ baseConfig }) => createImmutableXConfiguration({
@@ -1,4 +1,4 @@
1
- import { t as track, E as Environment } from './index-B_6J6Cxc.js';
1
+ import { t as track, E as Environment } from './index-ClN_aZQZ.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';