@imtbl/sdk 0.28.4-alpha.1 → 0.28.4-alpha.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
@@ -3651,7 +3651,7 @@ class MultiRollupApiClients {
3651
3651
  }
3652
3652
 
3653
3653
  // eslint-disable-next-line @typescript-eslint/naming-convention
3654
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.28.4-alpha.1' };
3654
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.28.4-alpha.2' };
3655
3655
  const createConfig = ({ basePath, headers, }) => {
3656
3656
  if (!basePath.trim()) {
3657
3657
  throw Error('basePath can not be empty');
@@ -3711,7 +3711,7 @@ class APIError extends Error {
3711
3711
 
3712
3712
  /* eslint-disable implicit-arrow-linebreak */
3713
3713
  const defaultHeaders = {
3714
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.28.4-alpha.1',
3714
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.28.4-alpha.2',
3715
3715
  };
3716
3716
  /**
3717
3717
  * createAPIConfiguration to create a custom Configuration
@@ -4122,7 +4122,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4122
4122
  chainID,
4123
4123
  coreContractAddress,
4124
4124
  registrationContractAddress,
4125
- sdkVersion: 'ts-immutable-sdk-0.28.4-alpha.1',
4125
+ sdkVersion: 'ts-immutable-sdk-0.28.4-alpha.2',
4126
4126
  });
4127
4127
  /**
4128
4128
  * Sets `sdkVersion` at the time of build
@@ -30399,6 +30399,7 @@ async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAdd
30399
30399
  }
30400
30400
  // Blockscout client singleton per chain id
30401
30401
  const $1564e43dde50bb61$var$blockscoutClientMap = new Map();
30402
+ const $1564e43dde50bb61$export$be5483d07cfa803d = ()=>$1564e43dde50bb61$var$blockscoutClientMap.clear();
30402
30403
  const $1564e43dde50bb61$export$8c978679845804d4 = async (walletAddress, chainId, filterTokens)=>{
30403
30404
  // Shuffle the mapping of the tokens configuration so it is a hashmap
30404
30405
  // for faster access to tokens config objects.
@@ -30500,6 +30501,8 @@ const $1564e43dde50bb61$export$a3238cee431627c6 = async (config, web3Provider, w
30500
30501
  };
30501
30502
  };
30502
30503
  const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
30504
+ // eslint-disable-next-line no-param-reassign
30505
+ chainId ||= await web3Provider.getSigner().getChainId();
30503
30506
  const { tokens: tokens } = await ($efe60cea83bfc4e8$export$473cec51305fdae8)(config, {
30504
30507
  type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
30505
30508
  chainId: chainId
@@ -30521,7 +30524,7 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, w
30521
30524
  // Please remove this hack once https://immutable.atlassian.net/browse/WT-1710
30522
30525
  // is done.
30523
30526
  const isL1Chain = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config) === chainId;
30524
- return ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
30527
+ return await ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
30525
30528
  }
30526
30529
  // This fallback to use ERC20s calls which is a best effort solution
30527
30530
  // Fails in fetching data from the RCP calls might result in some
@@ -30794,39 +30797,39 @@ function $06a6c5c23f7f2479$export$fbbc17f6e6e58544(address, contractInterface, s
30794
30797
 
30795
30798
  const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000001";
30796
30799
  const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
30797
- async function $2e7bf45a7c9a9570$var$getTokenInfoByAddress(config, tokenAddress, chainId, provider) {
30798
- if (tokenAddress === "NATIVE") return config.networkMap.get(chainId)?.nativeCurrency;
30799
- const contract = new (ethers.Contract)(tokenAddress, JSON.stringify(($d85ad1457a3f1a83$export$db5daa1b5156ccfe)), provider);
30800
- const name = await contract.name();
30801
- const symbol = await contract.symbol();
30802
- const decimals = await contract.decimals();
30803
- return {
30804
- name: name,
30805
- symbol: symbol,
30806
- decimals: decimals,
30807
- address: tokenAddress
30808
- };
30809
- }
30810
- async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired, tokenAddress) {
30800
+ async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired) {
30811
30801
  const fromChainId = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config);
30812
30802
  const toChainId = ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config);
30813
30803
  const gasEstimateTokensConfig = await config.remote.getConfig("gasEstimateTokens");
30814
- const { gasTokenAddress: gasTokenAddress, fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId].bridgeToL2Addresses;
30804
+ const { fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId].bridgeToL2Addresses;
30815
30805
  const provider = readOnlyProviders.get(fromChainId);
30816
30806
  if (!provider) throw new Error(`Missing JsonRpcProvider for chain id: ${fromChainId}`);
30817
30807
  try {
30818
- const gasFee = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, isSpendingCapApprovalRequired);
30819
- gasFee.token = await $2e7bf45a7c9a9570$var$getTokenInfoByAddress(config, tokenAddress ?? (gasTokenAddress || "NATIVE"), fromChainId, provider);
30820
- const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config);
30821
- const { bridgeFee: bridgeFee, bridgeable: bridgeable } = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress);
30808
+ let gasFees = {};
30809
+ const getGasFees = async ()=>{
30810
+ gasFees = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, isSpendingCapApprovalRequired);
30811
+ gasFees.token = config.networkMap.get(fromChainId)?.nativeCurrency;
30812
+ };
30813
+ let bridgeFees = {
30814
+ bridgeFee: {},
30815
+ bridgeable: false
30816
+ };
30817
+ const getBridgeFees = async ()=>{
30818
+ const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config);
30819
+ bridgeFees = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress);
30820
+ };
30821
+ await Promise.all([
30822
+ getGasFees(),
30823
+ getBridgeFees()
30824
+ ]);
30822
30825
  return {
30823
30826
  gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
30824
- gasFee: gasFee,
30827
+ gasFee: gasFees,
30825
30828
  bridgeFee: {
30826
- estimatedAmount: bridgeFee?.estimatedAmount,
30827
- token: bridgeFee?.token
30829
+ estimatedAmount: bridgeFees.bridgeFee?.estimatedAmount,
30830
+ token: bridgeFees.bridgeFee?.token
30828
30831
  },
30829
- bridgeable: bridgeable
30832
+ bridgeable: bridgeFees.bridgeable
30830
30833
  };
30831
30834
  } catch {
30832
30835
  // In the case of an error, just return an empty gas & bridge fee estimate
@@ -30875,7 +30878,7 @@ async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
30875
30878
  async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, config) {
30876
30879
  switch(params.gasEstimateType){
30877
30880
  case ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2:
30878
- return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired, params.tokenAddress);
30881
+ return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired);
30879
30882
  case ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP:
30880
30883
  return await $2e7bf45a7c9a9570$var$swapGasEstimator(config);
30881
30884
  default:
@@ -30892,6 +30895,7 @@ async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProvide
30892
30895
 
30893
30896
 
30894
30897
 
30898
+
30895
30899
  const $ddc6bcd0896481e5$export$2fbfa41a4de56a89 = (erc20allowances, erc721allowances)=>{
30896
30900
  const aggregatedAllowances = [];
30897
30901
  if (!erc20allowances.sufficient) {
@@ -31198,7 +31202,7 @@ const $35c3fc7013888ba5$export$be546c525d418988 = async (provider, ownerAddress,
31198
31202
 
31199
31203
 
31200
31204
 
31201
- /* eslint-disable arrow-body-style */
31205
+
31202
31206
 
31203
31207
 
31204
31208
 
@@ -31391,17 +31395,14 @@ const $73d2282a108cc7e2$export$6ab9757fda54db7e = (itemRequirement, balances)=>{
31391
31395
  /**
31392
31396
  * Gets the balances for all NATIVE and ERC20 balance requirements.
31393
31397
  */ const $beb896e098e41faf$var$getTokenBalances = async (config, provider, ownerAddress, itemRequirements)=>{
31394
- let tokenBalances = [];
31395
31398
  try {
31396
- const tokenList = (0, $73d2282a108cc7e2$export$ed7929b58bab85da)(itemRequirements);
31397
- const { balances: balances } = await (0, $1564e43dde50bb61$export$a3238cee431627c6)(config, provider, ownerAddress, tokenList);
31398
- tokenBalances = [
31399
- ...balances.map((balance)=>balance)
31400
- ];
31399
+ const tokenMap = new Map();
31400
+ (0, $73d2282a108cc7e2$export$ed7929b58bab85da)(itemRequirements).forEach((item)=>tokenMap.set((item.address || "").toLocaleLowerCase(), item));
31401
+ const { balances: balances } = await (0, $1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, ownerAddress);
31402
+ return balances.filter((balance)=>tokenMap.get((balance.token.address || "").toLocaleLowerCase()));
31401
31403
  } catch (error) {
31402
31404
  throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Failed to get balances", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR);
31403
31405
  }
31404
- return tokenBalances;
31405
31406
  };
31406
31407
  /**
31407
31408
  * Gets the balances for all ERC721 balance requirements.
@@ -31439,42 +31440,46 @@ const $73d2282a108cc7e2$export$6ab9757fda54db7e = (itemRequirement, balances)=>{
31439
31440
  };
31440
31441
  const $beb896e098e41faf$export$ddfc885f43c3cb6e = async (config, provider, ownerAddress, itemRequirements)=>{
31441
31442
  const aggregatedItems = ($aa6caea9a60d18c7$export$f96d1c819a615a64)(itemRequirements);
31442
- if (aggregatedItems.filter((itemRequirement)=>{
31443
- return itemRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721 && itemRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 && itemRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE;
31444
- }).length > 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unsupported item requirement balance check", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNSUPPORTED_BALANCE_REQUIREMENT_ERROR);
31443
+ const requiredToken = [];
31444
+ const requiredERC721 = [];
31445
+ aggregatedItems.forEach((item)=>{
31446
+ switch(item.type){
31447
+ case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
31448
+ case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE:
31449
+ requiredToken.push(item);
31450
+ break;
31451
+ case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721:
31452
+ requiredERC721.push(item);
31453
+ break;
31454
+ }
31455
+ });
31456
+ if (requiredERC721.length === 0 && requiredToken.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unsupported item requirement balance check", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNSUPPORTED_BALANCE_REQUIREMENT_ERROR);
31445
31457
  // Get all ERC20 and NATIVE balances
31446
- const currentBalances = [];
31447
- const tokenItemRequirements = aggregatedItems.filter((itemRequirement)=>itemRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 || itemRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE);
31448
- if (tokenItemRequirements.length > 0) currentBalances.push($beb896e098e41faf$var$getTokenBalances(config, provider, ownerAddress, aggregatedItems));
31458
+ const balancePromises = [];
31459
+ if (requiredToken.length > 0) balancePromises.push($beb896e098e41faf$var$getTokenBalances(config, provider, ownerAddress, aggregatedItems));
31449
31460
  // Get all ERC721 balances
31450
- const erc721ItemRequirements = aggregatedItems.filter((itemRequirement)=>itemRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721);
31451
- if (erc721ItemRequirements.length > 0) currentBalances.push($beb896e098e41faf$var$getERC721Balances(provider, ownerAddress, aggregatedItems));
31461
+ if (requiredERC721.length > 0) balancePromises.push($beb896e098e41faf$var$getERC721Balances(provider, ownerAddress, aggregatedItems));
31452
31462
  // Wait for all balances and calculate the requirements
31453
- const balanceRequirements = await Promise.all(currentBalances).then((balances)=>{
31454
- const requirements = [];
31455
- if (balances.length > 1 || tokenItemRequirements.length > 0) {
31456
- const tokenBalances = balances[0];
31457
- tokenItemRequirements.forEach((tokenItemRequirement)=>{
31458
- requirements.push(($73d2282a108cc7e2$export$6ab9757fda54db7e)(tokenItemRequirement, tokenBalances));
31459
- });
31460
- if (erc721ItemRequirements.length > 0) {
31461
- const erc721Balances = balances[1];
31462
- erc721ItemRequirements.forEach((erc721ItemRequirement)=>{
31463
- requirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(erc721ItemRequirement, erc721Balances));
31464
- });
31465
- }
31466
- } else if (erc721ItemRequirements.length > 0) {
31467
- // Only erc721
31468
- const erc721Balances = balances[0];
31469
- erc721ItemRequirements.forEach((erc721ItemRequirement)=>{
31470
- requirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(erc721ItemRequirement, erc721Balances));
31471
- });
31472
- }
31473
- return requirements;
31474
- });
31475
- const sufficient = balanceRequirements.reduce((acc, balanceRequirement)=>{
31476
- return acc && balanceRequirement.sufficient;
31477
- }, true);
31463
+ const promisesResponses = await Promise.all(balancePromises);
31464
+ const balanceRequirements = [];
31465
+ // Get all ERC20 and NATIVE balances
31466
+ if (requiredToken.length > 0 && promisesResponses.length > 0) {
31467
+ const result = promisesResponses.shift();
31468
+ if (result) requiredToken.forEach((item)=>{
31469
+ balanceRequirements.push(($73d2282a108cc7e2$export$6ab9757fda54db7e)(item, result));
31470
+ });
31471
+ }
31472
+ // Get all ERC721 balances
31473
+ if (requiredERC721.length > 0 && promisesResponses.length > 0) {
31474
+ const result = promisesResponses.shift();
31475
+ if (result) requiredERC721.forEach((item)=>{
31476
+ balanceRequirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(item, result));
31477
+ });
31478
+ }
31479
+ // Find if there are any requirements that aren't sufficient.
31480
+ // If there is not item with sufficient === false then the requirements
31481
+ // are satisfied.
31482
+ const sufficient = balanceRequirements.find((req)=>req.sufficient === false) === undefined;
31478
31483
  return {
31479
31484
  sufficient: sufficient,
31480
31485
  balanceRequirements: balanceRequirements
@@ -32058,7 +32063,9 @@ const $15fe1c77041bd4f4$export$9e73e22953cebcfc = async (config, readOnlyProvide
32058
32063
 
32059
32064
  const $887d24b47765b1c0$export$c37d8687c27b9660 = "0x0000000000000000000000000000000000000001";
32060
32065
  const $887d24b47765b1c0$export$1430626eec86fce9 = (chainId)=>{
32066
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_MAINNET) return "imtbl-zkevm-mainnet";
32061
32067
  if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET) return "imtbl-zkevm-testnet";
32068
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET) return "imtbl-zkevm-devent";
32062
32069
  return "";
32063
32070
  };
32064
32071
  const $887d24b47765b1c0$export$53e663abd9b77fc1 = async (chainId, config)=>{
@@ -32879,7 +32886,6 @@ const $a7367d01c6e76b1c$export$d62081fac18000c2 = (orderHash, orderComponents, a
32879
32886
 
32880
32887
 
32881
32888
 
32882
-
32883
32889
  const $9051cee080948594$export$9ac1563efd38130 = 1; // 100%
32884
32890
  const $9051cee080948594$export$768e717351d4b176 = 6; // will allow 0.000001 (0.0001%) as the minimum value
32885
32891
  const $9051cee080948594$var$calculateFeesPercent = (orderFee, amountBn)=>{
@@ -32920,6 +32926,7 @@ const $9051cee080948594$export$1e69c9cfc42e28d8 = (orderFees, weiAmount, decimal
32920
32926
 
32921
32927
 
32922
32928
 
32929
+
32923
32930
  const $64863c39386de592$export$4249179755829904 = (type, contractAddress, amount, spenderAddress)=>{
32924
32931
  switch(type){
32925
32932
  case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
@@ -32951,16 +32958,24 @@ const $64863c39386de592$export$8f2ff92ab8657f0b = (gasLimit, fulfillmentTransact
32951
32958
  };
32952
32959
  };
32953
32960
  const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, orders)=>{
32954
- let orderbook;
32961
+ if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were provided to the orders array. Please provide at least one order.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR);
32955
32962
  let order;
32956
32963
  let spenderAddress = "";
32964
+ let decimals = 18;
32957
32965
  const gasLimit = (constants).estimatedFulfillmentGasGwei;
32958
- if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were provided to the orders array. Please provide at least one order.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR);
32966
+ const orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
32967
+ const blockchainClient = $67fc622a2b913d5f$export$436dd76f23f463ff(config);
32968
+ const fulfillerAddress = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
32969
+ // Prefetch balances and store them in memory
32970
+ ($1564e43dde50bb61$export$be5483d07cfa803d)();
32971
+ ($1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, fulfillerAddress, ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config));
32972
+ ($1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, fulfillerAddress, ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config));
32959
32973
  const { id: id, takerFees: takerFees } = orders[0];
32974
+ let orderChainName;
32960
32975
  try {
32961
- orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
32962
32976
  order = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to fetch the listing from the orderbook", orderbook.getListing(id));
32963
- const { seaportContractAddress: seaportContractAddress } = orderbook.config();
32977
+ const { seaportContractAddress: seaportContractAddress, chainName: chainName } = orderbook.config();
32978
+ orderChainName = chainName;
32964
32979
  spenderAddress = seaportContractAddress;
32965
32980
  } catch (err) {
32966
32981
  throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("An error occurred while getting the order listing", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ORDER_LISTING_ERROR, {
@@ -32973,10 +32988,12 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32973
32988
  message: "No buy side tokens found on order"
32974
32989
  });
32975
32990
  const buyToken = order.result.buy[0];
32976
- let decimals = 18;
32977
- if (order.result.buy[0].type === "ERC20") {
32978
- const tokenContract = $06a6c5c23f7f2479$export$fbbc17f6e6e58544(order.result.buy[0].contractAddress, ($d85ad1457a3f1a83$export$db5daa1b5156ccfe), provider);
32979
- decimals = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", tokenContract.decimals());
32991
+ if (buyToken.type === "ERC20") {
32992
+ const token = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", blockchainClient.getToken({
32993
+ contractAddress: buyToken.contractAddress,
32994
+ chainName: orderChainName
32995
+ }));
32996
+ if (token.result.decimals) decimals = token.result.decimals;
32980
32997
  }
32981
32998
  let fees = [];
32982
32999
  if (takerFees && takerFees.length > 0) fees = ($9051cee080948594$export$1e69c9cfc42e28d8)(takerFees, buyToken.amount, decimals);
@@ -32985,7 +33002,6 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
32985
33002
  let orderActions = [];
32986
33003
  const fulfillOrderStartTime = performance.now();
32987
33004
  try {
32988
- const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
32989
33005
  const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
32990
33006
  orderActions = actions;
32991
33007
  unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
@@ -33585,7 +33601,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
33585
33601
  })($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
33586
33602
 
33587
33603
 
33588
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.28.4-alpha.1";
33604
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.28.4-alpha.2";
33589
33605
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
33590
33606
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
33591
33607
 
package/dist/index.d.ts CHANGED
@@ -15926,15 +15926,6 @@ type ExchangeOverrides = {
15926
15926
  wrappedNativeToken: ERC20;
15927
15927
  };
15928
15928
 
15929
- /**
15930
- * @typedef {string} Address - Represents an Ethereum address.
15931
- */
15932
- type Address = string;
15933
- /**
15934
- * @typedef {Address | 'NATIVE'} FungibleToken - Represents a fungible token, either an ERC20 token address or the native token.
15935
- */
15936
- type FungibleToken = Address | 'NATIVE';
15937
-
15938
15929
  /**
15939
15930
  * Enum representing different chain IDs.
15940
15931
  * @enum {number}
@@ -16763,12 +16754,10 @@ type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
16763
16754
  * An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
16764
16755
  * @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
16765
16756
  * @param {boolean} isSpendingCapApprovalRequired - Whether or not spending cap approval is required.
16766
- * @param {FungibleToken | undefined} tokenAddress - The address of the fungible token to use in the transaction.
16767
16757
  */
16768
16758
  interface GasEstimateBridgeToL2Params {
16769
16759
  gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
16770
16760
  isSpendingCapApprovalRequired: boolean;
16771
- tokenAddress?: FungibleToken;
16772
16761
  }
16773
16762
  /**
16774
16763
  * An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.