@imtbl/sdk 0.45.0 → 0.45.2

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
@@ -10641,7 +10641,7 @@ class MultiRollupApiClients {
10641
10641
  }
10642
10642
 
10643
10643
  // eslint-disable-next-line @typescript-eslint/naming-convention
10644
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.45.0' };
10644
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.45.2' };
10645
10645
  const createConfig = ({ basePath, headers, }) => {
10646
10646
  if (!basePath.trim()) {
10647
10647
  throw Error('basePath can not be empty');
@@ -10713,7 +10713,7 @@ class APIError extends Error {
10713
10713
 
10714
10714
  /* eslint-disable implicit-arrow-linebreak */
10715
10715
  const defaultHeaders = {
10716
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.45.0',
10716
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.45.2',
10717
10717
  };
10718
10718
  /**
10719
10719
  * createAPIConfiguration to create a custom Configuration
@@ -11152,7 +11152,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11152
11152
  chainID,
11153
11153
  coreContractAddress,
11154
11154
  registrationContractAddress,
11155
- sdkVersion: 'ts-immutable-sdk-0.45.0',
11155
+ sdkVersion: 'ts-immutable-sdk-0.45.2',
11156
11156
  });
11157
11157
  /**
11158
11158
  * Sets `sdkVersion` at the time of build
@@ -40903,13 +40903,13 @@ const ERC721ABI = [
40903
40903
  },
40904
40904
  ];
40905
40905
  // Gas overrides -- Anti-spam mechanism for when the baseFee drops low
40906
- // https://github.com/immutable/imx-docs/blob/main/docs/main/zkEVM/overview/gas-configuration.md
40907
- const GAS_OVERRIDES = {
40908
- maxFeePerGas: ethers.BigNumber.from(102e9),
40909
- maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
40906
+ // https://docs.immutable.com/docs/zkEVM/architecture/gas-config
40907
+ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
40908
+ maxFeePerGas: ethers.BigNumber.from(15e9),
40909
+ maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
40910
40910
  };
40911
40911
 
40912
- const SDK_VERSION_MARKER = '0.45.0';
40912
+ const SDK_VERSION_MARKER = '0.45.2';
40913
40913
  // This SDK version is replaced by the `yarn build` command ran on the root level
40914
40914
  const globalPackageVersion = () => SDK_VERSION_MARKER;
40915
40915
 
@@ -41057,6 +41057,9 @@ class CheckoutConfiguration {
41057
41057
  }
41058
41058
 
41059
41059
  const isMatchingAddress = (addressA = '', addressB = '') => (addressA.toLowerCase() === addressB.toLowerCase());
41060
+ const isZkEvmChainId = (chainId) => chainId === ChainId.IMTBL_ZKEVM_DEVNET
41061
+ || chainId === ChainId.IMTBL_ZKEVM_TESTNET
41062
+ || chainId === ChainId.IMTBL_ZKEVM_MAINNET;
41060
41063
 
41061
41064
  const getTokenAllowList = async (config, { type = TokenFilterTypes.ALL, chainId, exclude, }) => {
41062
41065
  let tokens = [];
@@ -41593,16 +41596,19 @@ async function getWalletAllowList(params) {
41593
41596
  };
41594
41597
  }
41595
41598
 
41596
- const setTransactionGasLimits = (transaction) => {
41599
+ const setTransactionGasLimits = async (web3Provider, transaction) => {
41597
41600
  const rawTx = transaction;
41598
- rawTx.maxFeePerGas = GAS_OVERRIDES.maxFeePerGas;
41599
- rawTx.maxPriorityFeePerGas = GAS_OVERRIDES.maxPriorityFeePerGas;
41601
+ const { chainId } = await web3Provider.getNetwork();
41602
+ if (!isZkEvmChainId(chainId))
41603
+ return rawTx;
41604
+ rawTx.maxFeePerGas = IMMUTABLE_ZKVEM_GAS_OVERRIDES.maxFeePerGas;
41605
+ rawTx.maxPriorityFeePerGas = IMMUTABLE_ZKVEM_GAS_OVERRIDES.maxPriorityFeePerGas;
41600
41606
  return rawTx;
41601
41607
  };
41602
41608
  const sendTransaction = async (web3Provider, transaction) => {
41603
41609
  try {
41604
41610
  const signer = web3Provider.getSigner();
41605
- const rawTx = setTransactionGasLimits(transaction);
41611
+ const rawTx = await setTransactionGasLimits(web3Provider, transaction);
41606
41612
  const transactionResponse = await signer.sendTransaction(rawTx);
41607
41613
  return {
41608
41614
  transactionResponse,
package/dist/index.d.ts CHANGED
@@ -12071,7 +12071,7 @@ interface Collection$1 {
12071
12071
  * @type {string}
12072
12072
  * @memberof Collection
12073
12073
  */
12074
- 'last_metadata_synced_at': string | null;
12074
+ 'metadata_synced_at': string | null;
12075
12075
  }
12076
12076
 
12077
12077
  /**
package/dist/index.js CHANGED
@@ -10619,7 +10619,7 @@ class MultiRollupApiClients {
10619
10619
  }
10620
10620
 
10621
10621
  // eslint-disable-next-line @typescript-eslint/naming-convention
10622
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.45.0' };
10622
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.45.2' };
10623
10623
  const createConfig = ({ basePath, headers, }) => {
10624
10624
  if (!basePath.trim()) {
10625
10625
  throw Error('basePath can not be empty');
@@ -10691,7 +10691,7 @@ class APIError extends Error {
10691
10691
 
10692
10692
  /* eslint-disable implicit-arrow-linebreak */
10693
10693
  const defaultHeaders = {
10694
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.45.0',
10694
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.45.2',
10695
10695
  };
10696
10696
  /**
10697
10697
  * createAPIConfiguration to create a custom Configuration
@@ -11130,7 +11130,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11130
11130
  chainID,
11131
11131
  coreContractAddress,
11132
11132
  registrationContractAddress,
11133
- sdkVersion: 'ts-immutable-sdk-0.45.0',
11133
+ sdkVersion: 'ts-immutable-sdk-0.45.2',
11134
11134
  });
11135
11135
  /**
11136
11136
  * Sets `sdkVersion` at the time of build
@@ -40881,13 +40881,13 @@ const ERC721ABI = [
40881
40881
  },
40882
40882
  ];
40883
40883
  // Gas overrides -- Anti-spam mechanism for when the baseFee drops low
40884
- // https://github.com/immutable/imx-docs/blob/main/docs/main/zkEVM/overview/gas-configuration.md
40885
- const GAS_OVERRIDES = {
40886
- maxFeePerGas: BigNumber$1.from(102e9),
40887
- maxPriorityFeePerGas: BigNumber$1.from(101e9),
40884
+ // https://docs.immutable.com/docs/zkEVM/architecture/gas-config
40885
+ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
40886
+ maxFeePerGas: BigNumber$1.from(15e9),
40887
+ maxPriorityFeePerGas: BigNumber$1.from(10e9),
40888
40888
  };
40889
40889
 
40890
- const SDK_VERSION_MARKER = '0.45.0';
40890
+ const SDK_VERSION_MARKER = '0.45.2';
40891
40891
  // This SDK version is replaced by the `yarn build` command ran on the root level
40892
40892
  const globalPackageVersion = () => SDK_VERSION_MARKER;
40893
40893
 
@@ -41035,6 +41035,9 @@ class CheckoutConfiguration {
41035
41035
  }
41036
41036
 
41037
41037
  const isMatchingAddress = (addressA = '', addressB = '') => (addressA.toLowerCase() === addressB.toLowerCase());
41038
+ const isZkEvmChainId = (chainId) => chainId === ChainId.IMTBL_ZKEVM_DEVNET
41039
+ || chainId === ChainId.IMTBL_ZKEVM_TESTNET
41040
+ || chainId === ChainId.IMTBL_ZKEVM_MAINNET;
41038
41041
 
41039
41042
  const getTokenAllowList = async (config, { type = TokenFilterTypes.ALL, chainId, exclude, }) => {
41040
41043
  let tokens = [];
@@ -41571,16 +41574,19 @@ async function getWalletAllowList(params) {
41571
41574
  };
41572
41575
  }
41573
41576
 
41574
- const setTransactionGasLimits = (transaction) => {
41577
+ const setTransactionGasLimits = async (web3Provider, transaction) => {
41575
41578
  const rawTx = transaction;
41576
- rawTx.maxFeePerGas = GAS_OVERRIDES.maxFeePerGas;
41577
- rawTx.maxPriorityFeePerGas = GAS_OVERRIDES.maxPriorityFeePerGas;
41579
+ const { chainId } = await web3Provider.getNetwork();
41580
+ if (!isZkEvmChainId(chainId))
41581
+ return rawTx;
41582
+ rawTx.maxFeePerGas = IMMUTABLE_ZKVEM_GAS_OVERRIDES.maxFeePerGas;
41583
+ rawTx.maxPriorityFeePerGas = IMMUTABLE_ZKVEM_GAS_OVERRIDES.maxPriorityFeePerGas;
41578
41584
  return rawTx;
41579
41585
  };
41580
41586
  const sendTransaction = async (web3Provider, transaction) => {
41581
41587
  try {
41582
41588
  const signer = web3Provider.getSigner();
41583
- const rawTx = setTransactionGasLimits(transaction);
41589
+ const rawTx = await setTransactionGasLimits(web3Provider, transaction);
41584
41590
  const transactionResponse = await signer.sendTransaction(rawTx);
41585
41591
  return {
41586
41592
  transactionResponse,
package/dist/passport.js CHANGED
@@ -8724,7 +8724,7 @@ class MultiRollupApiClients {
8724
8724
  }
8725
8725
 
8726
8726
  // eslint-disable-next-line @typescript-eslint/naming-convention
8727
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.45.0' };
8727
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.45.2' };
8728
8728
  const createConfig = ({ basePath, headers, }) => {
8729
8729
  if (!basePath.trim()) {
8730
8730
  throw Error('basePath can not be empty');
@@ -8792,7 +8792,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
8792
8792
  chainID,
8793
8793
  coreContractAddress,
8794
8794
  registrationContractAddress,
8795
- sdkVersion: 'ts-immutable-sdk-0.45.0',
8795
+ sdkVersion: 'ts-immutable-sdk-0.45.2',
8796
8796
  });
8797
8797
  /**
8798
8798
  * Sets `sdkVersion` at the time of build
package/dist/x.js CHANGED
@@ -23,7 +23,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
23
23
  chainID,
24
24
  coreContractAddress,
25
25
  registrationContractAddress,
26
- sdkVersion: 'ts-immutable-sdk-0.45.0',
26
+ sdkVersion: 'ts-immutable-sdk-0.45.2',
27
27
  });
28
28
  /**
29
29
  * 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.45.0",
4
+ "version": "0.45.2",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",