@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/index.cjs CHANGED
@@ -4256,7 +4256,7 @@ class MultiRollupApiClients {
4256
4256
  }
4257
4257
 
4258
4258
  // eslint-disable-next-line @typescript-eslint/naming-convention
4259
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.4' };
4259
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.6' };
4260
4260
  const createConfig = ({ basePath, headers, }) => {
4261
4261
  if (!basePath.trim()) {
4262
4262
  throw Error('basePath can not be empty');
@@ -4316,7 +4316,7 @@ class APIError extends Error {
4316
4316
 
4317
4317
  /* eslint-disable implicit-arrow-linebreak */
4318
4318
  const defaultHeaders = {
4319
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.4',
4319
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.6',
4320
4320
  };
4321
4321
  /**
4322
4322
  * createAPIConfiguration to create a custom Configuration
@@ -4755,7 +4755,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4755
4755
  chainID,
4756
4756
  coreContractAddress,
4757
4757
  registrationContractAddress,
4758
- sdkVersion: 'ts-immutable-sdk-0.39.4',
4758
+ sdkVersion: 'ts-immutable-sdk-0.39.6',
4759
4759
  });
4760
4760
  /**
4761
4761
  * Sets `sdkVersion` at the time of build
@@ -34020,6 +34020,9 @@ class Fees {
34020
34020
  const IMMUTABLE_TESTNET_RPC_URL = 'https://rpc.testnet.immutable.com';
34021
34021
  const IMMUTABLE_TESTNET_CHAIN_ID = 13473;
34022
34022
 
34023
+ const IMMUTABLE_MAINNET_RPC_URL = 'https://rpc.immutable.com';
34024
+ const IMMUTABLE_MAINNET_CHAIN_ID = 13371;
34025
+
34023
34026
  const NATIVE_IMX_IMMUTABLE_TESTNET = {
34024
34027
  chainId: IMMUTABLE_TESTNET_CHAIN_ID,
34025
34028
  decimals: 18,
@@ -34039,6 +34042,34 @@ const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS = [
34039
34042
  WIMX_IMMUTABLE_TESTNET,
34040
34043
  ];
34041
34044
 
34045
+ const NATIVE_IMX_IMMUTABLE_MAINNET = {
34046
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34047
+ decimals: 18,
34048
+ symbol: 'IMX',
34049
+ name: 'Immutable Token',
34050
+ type: 'native',
34051
+ };
34052
+ const WIMX_IMMUTABLE_MAINNET = {
34053
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34054
+ address: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
34055
+ decimals: 18,
34056
+ symbol: 'WIMX',
34057
+ name: 'Wrapped Immutable Token',
34058
+ type: 'erc20',
34059
+ };
34060
+ const ETH_IMMUTABLE_MAINNET = {
34061
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34062
+ address: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
34063
+ decimals: 18,
34064
+ symbol: 'ETH',
34065
+ name: 'Ethereum',
34066
+ type: 'erc20',
34067
+ };
34068
+ const IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS = [
34069
+ WIMX_IMMUTABLE_MAINNET,
34070
+ ETH_IMMUTABLE_MAINNET,
34071
+ ];
34072
+
34042
34073
  const zeroNativeCurrencyValue = '0x00';
34043
34074
  const multicallWithDeadlineFunctionSignature = 'multicall(uint256,bytes[])';
34044
34075
  function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn, amountOut, routerContract, paymentsContract) {
@@ -34332,6 +34363,13 @@ const CONTRACTS_FOR_CHAIN_ID = {
34332
34363
  swapRouter: '0x0b012055F770AE7BB7a8303968A7Fb6088A2296e',
34333
34364
  immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
34334
34365
  },
34366
+ [IMMUTABLE_MAINNET_CHAIN_ID]: {
34367
+ multicall: '0xc7efb32470dEE601959B15f1f923e017C6A918cA',
34368
+ coreFactory: '0x56c2162254b0E4417288786eE402c2B41d4e181e',
34369
+ quoter: '0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd',
34370
+ swapRouter: '0xE5a02c2Be08406c3fB36F9Aa29bF7C7A09CAe50B',
34371
+ immutableSwapProxy: '0xD67cc11151dBccCC424A16F8963ece3D0539BD61',
34372
+ },
34335
34373
  };
34336
34374
  const SUPPORTED_SANDBOX_CHAINS = {
34337
34375
  [IMMUTABLE_TESTNET_CHAIN_ID]: {
@@ -34343,7 +34381,16 @@ const SUPPORTED_SANDBOX_CHAINS = {
34343
34381
  wrappedNativeToken: WIMX_IMMUTABLE_TESTNET,
34344
34382
  },
34345
34383
  };
34346
- const SUPPORTED_PRODUCTION_CHAINS = {};
34384
+ const SUPPORTED_PRODUCTION_CHAINS = {
34385
+ [IMMUTABLE_MAINNET_CHAIN_ID]: {
34386
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34387
+ rpcUrl: IMMUTABLE_MAINNET_RPC_URL,
34388
+ contracts: CONTRACTS_FOR_CHAIN_ID[IMMUTABLE_MAINNET_CHAIN_ID],
34389
+ commonRoutingTokens: IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS,
34390
+ nativeToken: NATIVE_IMX_IMMUTABLE_MAINNET,
34391
+ wrappedNativeToken: WIMX_IMMUTABLE_MAINNET,
34392
+ },
34393
+ };
34347
34394
  const SUPPORTED_CHAIN_IDS_FOR_ENVIRONMENT = {
34348
34395
  [Environment$1.SANDBOX]: SUPPORTED_SANDBOX_CHAINS,
34349
34396
  [Environment$1.PRODUCTION]: SUPPORTED_PRODUCTION_CHAINS,
@@ -35145,6 +35192,7 @@ const ZKEVM_NATIVE_TOKEN = {
35145
35192
  name: 'IMX',
35146
35193
  symbol: 'IMX',
35147
35194
  decimals: DEFAULT_TOKEN_DECIMALS$1,
35195
+ address: NATIVE,
35148
35196
  };
35149
35197
  /**
35150
35198
  * Base URL for the Immutable API based on the environment.
@@ -35482,7 +35530,7 @@ const GAS_OVERRIDES = {
35482
35530
  maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
35483
35531
  };
35484
35532
 
35485
- const SDK_VERSION_MARKER = '0.39.4';
35533
+ const SDK_VERSION_MARKER = '0.39.6';
35486
35534
  // This SDK version is replaced by the `yarn build` command ran on the root level
35487
35535
  const globalPackageVersion = () => SDK_VERSION_MARKER;
35488
35536
 
@@ -36799,11 +36847,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
36799
36847
  type: ItemType.NATIVE,
36800
36848
  balance: ethers.BigNumber.from(0),
36801
36849
  formattedBalance: '0',
36802
- token: {
36803
- name,
36804
- symbol,
36805
- decimals: DEFAULT_TOKEN_DECIMALS$1,
36806
- },
36850
+ token: ZKEVM_NATIVE_TOKEN,
36807
36851
  };
36808
36852
  }
36809
36853
  return {
@@ -38072,13 +38116,19 @@ const bridgeAndSwapRoute = async (config, readOnlyProviders, availableRoutingOpt
38072
38116
  };
38073
38117
 
38074
38118
  const onRampRoute = async (config, availableRoutingOptions, balanceRequirement) => {
38075
- if (balanceRequirement.type !== ItemType.ERC20 && balanceRequirement.type !== ItemType.NATIVE)
38119
+ // Only check for ERC20 and NATIVE
38120
+ if (![ItemType.ERC20, ItemType.NATIVE].includes(balanceRequirement.type))
38076
38121
  return undefined;
38077
38122
  const { required, current, delta } = balanceRequirement;
38078
38123
  let hasAllowList = false;
38079
38124
  const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
38080
38125
  onRampAllowList.forEach((token) => {
38081
- if (token.address === required.token?.address) {
38126
+ if (!token.address)
38127
+ return;
38128
+ if (!required.token)
38129
+ return;
38130
+ if (isNativeToken(required.token.address)
38131
+ || token.address.toLowerCase() === required.token.address?.toLowerCase()) {
38082
38132
  hasAllowList = true;
38083
38133
  }
38084
38134
  });
package/dist/index.js CHANGED
@@ -4234,7 +4234,7 @@ class MultiRollupApiClients {
4234
4234
  }
4235
4235
 
4236
4236
  // eslint-disable-next-line @typescript-eslint/naming-convention
4237
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.4' };
4237
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.6' };
4238
4238
  const createConfig = ({ basePath, headers, }) => {
4239
4239
  if (!basePath.trim()) {
4240
4240
  throw Error('basePath can not be empty');
@@ -4294,7 +4294,7 @@ class APIError extends Error {
4294
4294
 
4295
4295
  /* eslint-disable implicit-arrow-linebreak */
4296
4296
  const defaultHeaders = {
4297
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.4',
4297
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.6',
4298
4298
  };
4299
4299
  /**
4300
4300
  * createAPIConfiguration to create a custom Configuration
@@ -4733,7 +4733,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4733
4733
  chainID,
4734
4734
  coreContractAddress,
4735
4735
  registrationContractAddress,
4736
- sdkVersion: 'ts-immutable-sdk-0.39.4',
4736
+ sdkVersion: 'ts-immutable-sdk-0.39.6',
4737
4737
  });
4738
4738
  /**
4739
4739
  * Sets `sdkVersion` at the time of build
@@ -33998,6 +33998,9 @@ class Fees {
33998
33998
  const IMMUTABLE_TESTNET_RPC_URL = 'https://rpc.testnet.immutable.com';
33999
33999
  const IMMUTABLE_TESTNET_CHAIN_ID = 13473;
34000
34000
 
34001
+ const IMMUTABLE_MAINNET_RPC_URL = 'https://rpc.immutable.com';
34002
+ const IMMUTABLE_MAINNET_CHAIN_ID = 13371;
34003
+
34001
34004
  const NATIVE_IMX_IMMUTABLE_TESTNET = {
34002
34005
  chainId: IMMUTABLE_TESTNET_CHAIN_ID,
34003
34006
  decimals: 18,
@@ -34017,6 +34020,34 @@ const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS = [
34017
34020
  WIMX_IMMUTABLE_TESTNET,
34018
34021
  ];
34019
34022
 
34023
+ const NATIVE_IMX_IMMUTABLE_MAINNET = {
34024
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34025
+ decimals: 18,
34026
+ symbol: 'IMX',
34027
+ name: 'Immutable Token',
34028
+ type: 'native',
34029
+ };
34030
+ const WIMX_IMMUTABLE_MAINNET = {
34031
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34032
+ address: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
34033
+ decimals: 18,
34034
+ symbol: 'WIMX',
34035
+ name: 'Wrapped Immutable Token',
34036
+ type: 'erc20',
34037
+ };
34038
+ const ETH_IMMUTABLE_MAINNET = {
34039
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34040
+ address: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
34041
+ decimals: 18,
34042
+ symbol: 'ETH',
34043
+ name: 'Ethereum',
34044
+ type: 'erc20',
34045
+ };
34046
+ const IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS = [
34047
+ WIMX_IMMUTABLE_MAINNET,
34048
+ ETH_IMMUTABLE_MAINNET,
34049
+ ];
34050
+
34020
34051
  const zeroNativeCurrencyValue = '0x00';
34021
34052
  const multicallWithDeadlineFunctionSignature = 'multicall(uint256,bytes[])';
34022
34053
  function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn, amountOut, routerContract, paymentsContract) {
@@ -34310,6 +34341,13 @@ const CONTRACTS_FOR_CHAIN_ID = {
34310
34341
  swapRouter: '0x0b012055F770AE7BB7a8303968A7Fb6088A2296e',
34311
34342
  immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
34312
34343
  },
34344
+ [IMMUTABLE_MAINNET_CHAIN_ID]: {
34345
+ multicall: '0xc7efb32470dEE601959B15f1f923e017C6A918cA',
34346
+ coreFactory: '0x56c2162254b0E4417288786eE402c2B41d4e181e',
34347
+ quoter: '0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd',
34348
+ swapRouter: '0xE5a02c2Be08406c3fB36F9Aa29bF7C7A09CAe50B',
34349
+ immutableSwapProxy: '0xD67cc11151dBccCC424A16F8963ece3D0539BD61',
34350
+ },
34313
34351
  };
34314
34352
  const SUPPORTED_SANDBOX_CHAINS = {
34315
34353
  [IMMUTABLE_TESTNET_CHAIN_ID]: {
@@ -34321,7 +34359,16 @@ const SUPPORTED_SANDBOX_CHAINS = {
34321
34359
  wrappedNativeToken: WIMX_IMMUTABLE_TESTNET,
34322
34360
  },
34323
34361
  };
34324
- const SUPPORTED_PRODUCTION_CHAINS = {};
34362
+ const SUPPORTED_PRODUCTION_CHAINS = {
34363
+ [IMMUTABLE_MAINNET_CHAIN_ID]: {
34364
+ chainId: IMMUTABLE_MAINNET_CHAIN_ID,
34365
+ rpcUrl: IMMUTABLE_MAINNET_RPC_URL,
34366
+ contracts: CONTRACTS_FOR_CHAIN_ID[IMMUTABLE_MAINNET_CHAIN_ID],
34367
+ commonRoutingTokens: IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS,
34368
+ nativeToken: NATIVE_IMX_IMMUTABLE_MAINNET,
34369
+ wrappedNativeToken: WIMX_IMMUTABLE_MAINNET,
34370
+ },
34371
+ };
34325
34372
  const SUPPORTED_CHAIN_IDS_FOR_ENVIRONMENT = {
34326
34373
  [Environment$1.SANDBOX]: SUPPORTED_SANDBOX_CHAINS,
34327
34374
  [Environment$1.PRODUCTION]: SUPPORTED_PRODUCTION_CHAINS,
@@ -35123,6 +35170,7 @@ const ZKEVM_NATIVE_TOKEN = {
35123
35170
  name: 'IMX',
35124
35171
  symbol: 'IMX',
35125
35172
  decimals: DEFAULT_TOKEN_DECIMALS$1,
35173
+ address: NATIVE,
35126
35174
  };
35127
35175
  /**
35128
35176
  * Base URL for the Immutable API based on the environment.
@@ -35460,7 +35508,7 @@ const GAS_OVERRIDES = {
35460
35508
  maxPriorityFeePerGas: BigNumber$1.from(101e9),
35461
35509
  };
35462
35510
 
35463
- const SDK_VERSION_MARKER = '0.39.4';
35511
+ const SDK_VERSION_MARKER = '0.39.6';
35464
35512
  // This SDK version is replaced by the `yarn build` command ran on the root level
35465
35513
  const globalPackageVersion = () => SDK_VERSION_MARKER;
35466
35514
 
@@ -36777,11 +36825,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
36777
36825
  type: ItemType.NATIVE,
36778
36826
  balance: BigNumber$1.from(0),
36779
36827
  formattedBalance: '0',
36780
- token: {
36781
- name,
36782
- symbol,
36783
- decimals: DEFAULT_TOKEN_DECIMALS$1,
36784
- },
36828
+ token: ZKEVM_NATIVE_TOKEN,
36785
36829
  };
36786
36830
  }
36787
36831
  return {
@@ -38050,13 +38094,19 @@ const bridgeAndSwapRoute = async (config, readOnlyProviders, availableRoutingOpt
38050
38094
  };
38051
38095
 
38052
38096
  const onRampRoute = async (config, availableRoutingOptions, balanceRequirement) => {
38053
- if (balanceRequirement.type !== ItemType.ERC20 && balanceRequirement.type !== ItemType.NATIVE)
38097
+ // Only check for ERC20 and NATIVE
38098
+ if (![ItemType.ERC20, ItemType.NATIVE].includes(balanceRequirement.type))
38054
38099
  return undefined;
38055
38100
  const { required, current, delta } = balanceRequirement;
38056
38101
  let hasAllowList = false;
38057
38102
  const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
38058
38103
  onRampAllowList.forEach((token) => {
38059
- if (token.address === required.token?.address) {
38104
+ if (!token.address)
38105
+ return;
38106
+ if (!required.token)
38107
+ return;
38108
+ if (isNativeToken(required.token.address)
38109
+ || token.address.toLowerCase() === required.token.address?.toLowerCase()) {
38060
38110
  hasAllowList = true;
38061
38111
  }
38062
38112
  });
package/dist/passport.js CHANGED
@@ -2349,7 +2349,7 @@ class MultiRollupApiClients {
2349
2349
  }
2350
2350
 
2351
2351
  // eslint-disable-next-line @typescript-eslint/naming-convention
2352
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.39.4' };
2352
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.39.6' };
2353
2353
  const createConfig = ({ basePath, headers, }) => {
2354
2354
  if (!basePath.trim()) {
2355
2355
  throw Error('basePath can not be empty');
@@ -2405,7 +2405,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
2405
2405
  chainID,
2406
2406
  coreContractAddress,
2407
2407
  registrationContractAddress,
2408
- sdkVersion: 'ts-immutable-sdk-0.39.4',
2408
+ sdkVersion: 'ts-immutable-sdk-0.39.6',
2409
2409
  });
2410
2410
  /**
2411
2411
  * 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.39.4",
4
+ "version": "0.39.6",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",