@imtbl/sdk 0.39.4 → 0.39.6

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/checkout.js CHANGED
@@ -19737,6 +19737,9 @@ class Fees {
19737
19737
  const IMMUTABLE_TESTNET_RPC_URL = 'https://rpc.testnet.immutable.com';
19738
19738
  const IMMUTABLE_TESTNET_CHAIN_ID = 13473;
19739
19739
 
19740
+ const IMMUTABLE_MAINNET_RPC_URL = 'https://rpc.immutable.com';
19741
+ const IMMUTABLE_MAINNET_CHAIN_ID = 13371;
19742
+
19740
19743
  const NATIVE_IMX_IMMUTABLE_TESTNET = {
19741
19744
  chainId: IMMUTABLE_TESTNET_CHAIN_ID,
19742
19745
  decimals: 18,
@@ -19756,6 +19759,34 @@ const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS = [
19756
19759
  WIMX_IMMUTABLE_TESTNET,
19757
19760
  ];
19758
19761
 
19762
+ const NATIVE_IMX_IMMUTABLE_MAINNET = {
19763
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
19764
+ decimals: 18,
19765
+ symbol: 'IMX',
19766
+ name: 'Immutable Token',
19767
+ type: 'native',
19768
+ };
19769
+ const WIMX_IMMUTABLE_MAINNET = {
19770
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
19771
+ address: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
19772
+ decimals: 18,
19773
+ symbol: 'WIMX',
19774
+ name: 'Wrapped Immutable Token',
19775
+ type: 'erc20',
19776
+ };
19777
+ const ETH_IMMUTABLE_MAINNET = {
19778
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
19779
+ address: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
19780
+ decimals: 18,
19781
+ symbol: 'ETH',
19782
+ name: 'Ethereum',
19783
+ type: 'erc20',
19784
+ };
19785
+ const IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS = [
19786
+ WIMX_IMMUTABLE_MAINNET,
19787
+ ETH_IMMUTABLE_MAINNET,
19788
+ ];
19789
+
19759
19790
  const zeroNativeCurrencyValue = '0x00';
19760
19791
  const multicallWithDeadlineFunctionSignature = 'multicall(uint256,bytes[])';
19761
19792
  function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn, amountOut, routerContract, paymentsContract) {
@@ -20049,6 +20080,13 @@ const CONTRACTS_FOR_CHAIN_ID = {
20049
20080
  swapRouter: '0x0b012055F770AE7BB7a8303968A7Fb6088A2296e',
20050
20081
  immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
20051
20082
  },
20083
+ [IMMUTABLE_MAINNET_CHAIN_ID]: {
20084
+ multicall: '0xc7efb32470dEE601959B15f1f923e017C6A918cA',
20085
+ coreFactory: '0x56c2162254b0E4417288786eE402c2B41d4e181e',
20086
+ quoter: '0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd',
20087
+ swapRouter: '0xE5a02c2Be08406c3fB36F9Aa29bF7C7A09CAe50B',
20088
+ immutableSwapProxy: '0xD67cc11151dBccCC424A16F8963ece3D0539BD61',
20089
+ },
20052
20090
  };
20053
20091
  const SUPPORTED_SANDBOX_CHAINS = {
20054
20092
  [IMMUTABLE_TESTNET_CHAIN_ID]: {
@@ -20060,7 +20098,16 @@ const SUPPORTED_SANDBOX_CHAINS = {
20060
20098
  wrappedNativeToken: WIMX_IMMUTABLE_TESTNET,
20061
20099
  },
20062
20100
  };
20063
- const SUPPORTED_PRODUCTION_CHAINS = {};
20101
+ const SUPPORTED_PRODUCTION_CHAINS = {
20102
+ [IMMUTABLE_MAINNET_CHAIN_ID]: {
20103
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
20104
+ rpcUrl: IMMUTABLE_MAINNET_RPC_URL,
20105
+ contracts: CONTRACTS_FOR_CHAIN_ID[IMMUTABLE_MAINNET_CHAIN_ID],
20106
+ commonRoutingTokens: IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS,
20107
+ nativeToken: NATIVE_IMX_IMMUTABLE_MAINNET,
20108
+ wrappedNativeToken: WIMX_IMMUTABLE_MAINNET,
20109
+ },
20110
+ };
20064
20111
  const SUPPORTED_CHAIN_IDS_FOR_ENVIRONMENT = {
20065
20112
  [Environment$1.SANDBOX]: SUPPORTED_SANDBOX_CHAINS,
20066
20113
  [Environment$1.PRODUCTION]: SUPPORTED_PRODUCTION_CHAINS,
@@ -25801,7 +25848,7 @@ class APIError extends Error {
25801
25848
 
25802
25849
  /* eslint-disable implicit-arrow-linebreak */
25803
25850
  const defaultHeaders = {
25804
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.4',
25851
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.6',
25805
25852
  };
25806
25853
  /**
25807
25854
  * createAPIConfiguration to create a custom Configuration
@@ -26813,6 +26860,7 @@ const ZKEVM_NATIVE_TOKEN = {
26813
26860
  name: 'IMX',
26814
26861
  symbol: 'IMX',
26815
26862
  decimals: DEFAULT_TOKEN_DECIMALS$1,
26863
+ address: NATIVE,
26816
26864
  };
26817
26865
  /**
26818
26866
  * Base URL for the Immutable API based on the environment.
@@ -27150,7 +27198,7 @@ const GAS_OVERRIDES = {
27150
27198
  maxPriorityFeePerGas: BigNumber$1.from(101e9),
27151
27199
  };
27152
27200
 
27153
- const SDK_VERSION_MARKER = '0.39.4';
27201
+ const SDK_VERSION_MARKER = '0.39.6';
27154
27202
  // This SDK version is replaced by the `yarn build` command ran on the root level
27155
27203
  const globalPackageVersion = () => SDK_VERSION_MARKER;
27156
27204
 
@@ -28467,11 +28515,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
28467
28515
  type: ItemType.NATIVE,
28468
28516
  balance: BigNumber$1.from(0),
28469
28517
  formattedBalance: '0',
28470
- token: {
28471
- name,
28472
- symbol,
28473
- decimals: DEFAULT_TOKEN_DECIMALS$1,
28474
- },
28518
+ token: ZKEVM_NATIVE_TOKEN,
28475
28519
  };
28476
28520
  }
28477
28521
  return {
@@ -29740,13 +29784,19 @@ const bridgeAndSwapRoute = async (config, readOnlyProviders, availableRoutingOpt
29740
29784
  };
29741
29785
 
29742
29786
  const onRampRoute = async (config, availableRoutingOptions, balanceRequirement) => {
29743
- if (balanceRequirement.type !== ItemType.ERC20 && balanceRequirement.type !== ItemType.NATIVE)
29787
+ // Only check for ERC20 and NATIVE
29788
+ if (![ItemType.ERC20, ItemType.NATIVE].includes(balanceRequirement.type))
29744
29789
  return undefined;
29745
29790
  const { required, current, delta } = balanceRequirement;
29746
29791
  let hasAllowList = false;
29747
29792
  const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
29748
29793
  onRampAllowList.forEach((token) => {
29749
- if (token.address === required.token?.address) {
29794
+ if (!token.address)
29795
+ return;
29796
+ if (!required.token)
29797
+ return;
29798
+ if (isNativeToken(required.token.address)
29799
+ || token.address.toLowerCase() === required.token.address?.toLowerCase()) {
29750
29800
  hasAllowList = true;
29751
29801
  }
29752
29802
  });
@@ -17,7 +17,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
17
17
  chainID,
18
18
  coreContractAddress,
19
19
  registrationContractAddress,
20
- sdkVersion: 'ts-immutable-sdk-0.39.4',
20
+ sdkVersion: 'ts-immutable-sdk-0.39.6',
21
21
  });
22
22
  /**
23
23
  * Sets `sdkVersion` at the time of build