@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.
@@ -621,15 +621,6 @@ type ExchangeOverrides = {
621
621
  wrappedNativeToken: ERC20;
622
622
  };
623
623
 
624
- /**
625
- * @typedef {string} Address - Represents an Ethereum address.
626
- */
627
- type Address = string;
628
- /**
629
- * @typedef {Address | 'NATIVE'} FungibleToken - Represents a fungible token, either an ERC20 token address or the native token.
630
- */
631
- type FungibleToken = Address | 'NATIVE';
632
-
633
624
  // TypeScript Version: 3.0
634
625
 
635
626
  type AxiosRequestHeaders = Record<string, string | number | boolean>;
@@ -11509,12 +11500,10 @@ type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
11509
11500
  * An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
11510
11501
  * @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
11511
11502
  * @param {boolean} isSpendingCapApprovalRequired - Whether or not spending cap approval is required.
11512
- * @param {FungibleToken | undefined} tokenAddress - The address of the fungible token to use in the transaction.
11513
11503
  */
11514
11504
  interface GasEstimateBridgeToL2Params {
11515
11505
  gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
11516
11506
  isSpendingCapApprovalRequired: boolean;
11517
- tokenAddress?: FungibleToken;
11518
11507
  }
11519
11508
  /**
11520
11509
  * An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.
@@ -20787,7 +20787,7 @@ class APIError extends Error {
20787
20787
 
20788
20788
  /* eslint-disable implicit-arrow-linebreak */
20789
20789
  const defaultHeaders = {
20790
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.28.4-alpha.1',
20790
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.28.4-alpha.2',
20791
20791
  };
20792
20792
  /**
20793
20793
  * createAPIConfiguration to create a custom Configuration
@@ -22210,6 +22210,7 @@ async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAdd
22210
22210
  }
22211
22211
  // Blockscout client singleton per chain id
22212
22212
  const $1564e43dde50bb61$var$blockscoutClientMap = new Map();
22213
+ const $1564e43dde50bb61$export$be5483d07cfa803d = ()=>$1564e43dde50bb61$var$blockscoutClientMap.clear();
22213
22214
  const $1564e43dde50bb61$export$8c978679845804d4 = async (walletAddress, chainId, filterTokens)=>{
22214
22215
  // Shuffle the mapping of the tokens configuration so it is a hashmap
22215
22216
  // for faster access to tokens config objects.
@@ -22311,6 +22312,8 @@ const $1564e43dde50bb61$export$a3238cee431627c6 = async (config, web3Provider, w
22311
22312
  };
22312
22313
  };
22313
22314
  const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
22315
+ // eslint-disable-next-line no-param-reassign
22316
+ chainId ||= await web3Provider.getSigner().getChainId();
22314
22317
  const { tokens: tokens } = await ($efe60cea83bfc4e8$export$473cec51305fdae8)(config, {
22315
22318
  type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
22316
22319
  chainId: chainId
@@ -22332,7 +22335,7 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, w
22332
22335
  // Please remove this hack once https://immutable.atlassian.net/browse/WT-1710
22333
22336
  // is done.
22334
22337
  const isL1Chain = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config) === chainId;
22335
- return ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
22338
+ return await ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
22336
22339
  }
22337
22340
  // This fallback to use ERC20s calls which is a best effort solution
22338
22341
  // Fails in fetching data from the RCP calls might result in some
@@ -22605,39 +22608,39 @@ function $06a6c5c23f7f2479$export$fbbc17f6e6e58544(address, contractInterface, s
22605
22608
 
22606
22609
  const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000001";
22607
22610
  const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
22608
- async function $2e7bf45a7c9a9570$var$getTokenInfoByAddress(config, tokenAddress, chainId, provider) {
22609
- if (tokenAddress === "NATIVE") return config.networkMap.get(chainId)?.nativeCurrency;
22610
- const contract = new (Contract$1)(tokenAddress, JSON.stringify(($d85ad1457a3f1a83$export$db5daa1b5156ccfe)), provider);
22611
- const name = await contract.name();
22612
- const symbol = await contract.symbol();
22613
- const decimals = await contract.decimals();
22614
- return {
22615
- name: name,
22616
- symbol: symbol,
22617
- decimals: decimals,
22618
- address: tokenAddress
22619
- };
22620
- }
22621
- async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired, tokenAddress) {
22611
+ async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired) {
22622
22612
  const fromChainId = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config);
22623
22613
  const toChainId = ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config);
22624
22614
  const gasEstimateTokensConfig = await config.remote.getConfig("gasEstimateTokens");
22625
- const { gasTokenAddress: gasTokenAddress, fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId].bridgeToL2Addresses;
22615
+ const { fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId].bridgeToL2Addresses;
22626
22616
  const provider = readOnlyProviders.get(fromChainId);
22627
22617
  if (!provider) throw new Error(`Missing JsonRpcProvider for chain id: ${fromChainId}`);
22628
22618
  try {
22629
- const gasFee = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, isSpendingCapApprovalRequired);
22630
- gasFee.token = await $2e7bf45a7c9a9570$var$getTokenInfoByAddress(config, tokenAddress ?? (gasTokenAddress || "NATIVE"), fromChainId, provider);
22631
- const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config);
22632
- const { bridgeFee: bridgeFee, bridgeable: bridgeable } = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress);
22619
+ let gasFees = {};
22620
+ const getGasFees = async ()=>{
22621
+ gasFees = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, isSpendingCapApprovalRequired);
22622
+ gasFees.token = config.networkMap.get(fromChainId)?.nativeCurrency;
22623
+ };
22624
+ let bridgeFees = {
22625
+ bridgeFee: {},
22626
+ bridgeable: false
22627
+ };
22628
+ const getBridgeFees = async ()=>{
22629
+ const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config);
22630
+ bridgeFees = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress);
22631
+ };
22632
+ await Promise.all([
22633
+ getGasFees(),
22634
+ getBridgeFees()
22635
+ ]);
22633
22636
  return {
22634
22637
  gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
22635
- gasFee: gasFee,
22638
+ gasFee: gasFees,
22636
22639
  bridgeFee: {
22637
- estimatedAmount: bridgeFee?.estimatedAmount,
22638
- token: bridgeFee?.token
22640
+ estimatedAmount: bridgeFees.bridgeFee?.estimatedAmount,
22641
+ token: bridgeFees.bridgeFee?.token
22639
22642
  },
22640
- bridgeable: bridgeable
22643
+ bridgeable: bridgeFees.bridgeable
22641
22644
  };
22642
22645
  } catch {
22643
22646
  // In the case of an error, just return an empty gas & bridge fee estimate
@@ -22686,7 +22689,7 @@ async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
22686
22689
  async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, config) {
22687
22690
  switch(params.gasEstimateType){
22688
22691
  case ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2:
22689
- return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired, params.tokenAddress);
22692
+ return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired);
22690
22693
  case ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP:
22691
22694
  return await $2e7bf45a7c9a9570$var$swapGasEstimator(config);
22692
22695
  default:
@@ -22703,6 +22706,7 @@ async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProvide
22703
22706
 
22704
22707
 
22705
22708
 
22709
+
22706
22710
  const $ddc6bcd0896481e5$export$2fbfa41a4de56a89 = (erc20allowances, erc721allowances)=>{
22707
22711
  const aggregatedAllowances = [];
22708
22712
  if (!erc20allowances.sufficient) {
@@ -23009,7 +23013,7 @@ const $35c3fc7013888ba5$export$be546c525d418988 = async (provider, ownerAddress,
23009
23013
 
23010
23014
 
23011
23015
 
23012
- /* eslint-disable arrow-body-style */
23016
+
23013
23017
 
23014
23018
 
23015
23019
 
@@ -23202,17 +23206,14 @@ const $73d2282a108cc7e2$export$6ab9757fda54db7e = (itemRequirement, balances)=>{
23202
23206
  /**
23203
23207
  * Gets the balances for all NATIVE and ERC20 balance requirements.
23204
23208
  */ const $beb896e098e41faf$var$getTokenBalances = async (config, provider, ownerAddress, itemRequirements)=>{
23205
- let tokenBalances = [];
23206
23209
  try {
23207
- const tokenList = (0, $73d2282a108cc7e2$export$ed7929b58bab85da)(itemRequirements);
23208
- const { balances: balances } = await (0, $1564e43dde50bb61$export$a3238cee431627c6)(config, provider, ownerAddress, tokenList);
23209
- tokenBalances = [
23210
- ...balances.map((balance)=>balance)
23211
- ];
23210
+ const tokenMap = new Map();
23211
+ (0, $73d2282a108cc7e2$export$ed7929b58bab85da)(itemRequirements).forEach((item)=>tokenMap.set((item.address || "").toLocaleLowerCase(), item));
23212
+ const { balances: balances } = await (0, $1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, ownerAddress);
23213
+ return balances.filter((balance)=>tokenMap.get((balance.token.address || "").toLocaleLowerCase()));
23212
23214
  } catch (error) {
23213
23215
  throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Failed to get balances", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR);
23214
23216
  }
23215
- return tokenBalances;
23216
23217
  };
23217
23218
  /**
23218
23219
  * Gets the balances for all ERC721 balance requirements.
@@ -23250,42 +23251,46 @@ const $73d2282a108cc7e2$export$6ab9757fda54db7e = (itemRequirement, balances)=>{
23250
23251
  };
23251
23252
  const $beb896e098e41faf$export$ddfc885f43c3cb6e = async (config, provider, ownerAddress, itemRequirements)=>{
23252
23253
  const aggregatedItems = ($aa6caea9a60d18c7$export$f96d1c819a615a64)(itemRequirements);
23253
- if (aggregatedItems.filter((itemRequirement)=>{
23254
- return itemRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721 && itemRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 && itemRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE;
23255
- }).length > 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unsupported item requirement balance check", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNSUPPORTED_BALANCE_REQUIREMENT_ERROR);
23254
+ const requiredToken = [];
23255
+ const requiredERC721 = [];
23256
+ aggregatedItems.forEach((item)=>{
23257
+ switch(item.type){
23258
+ case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
23259
+ case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE:
23260
+ requiredToken.push(item);
23261
+ break;
23262
+ case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721:
23263
+ requiredERC721.push(item);
23264
+ break;
23265
+ }
23266
+ });
23267
+ if (requiredERC721.length === 0 && requiredToken.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unsupported item requirement balance check", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNSUPPORTED_BALANCE_REQUIREMENT_ERROR);
23256
23268
  // Get all ERC20 and NATIVE balances
23257
- const currentBalances = [];
23258
- const tokenItemRequirements = aggregatedItems.filter((itemRequirement)=>itemRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 || itemRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE);
23259
- if (tokenItemRequirements.length > 0) currentBalances.push($beb896e098e41faf$var$getTokenBalances(config, provider, ownerAddress, aggregatedItems));
23269
+ const balancePromises = [];
23270
+ if (requiredToken.length > 0) balancePromises.push($beb896e098e41faf$var$getTokenBalances(config, provider, ownerAddress, aggregatedItems));
23260
23271
  // Get all ERC721 balances
23261
- const erc721ItemRequirements = aggregatedItems.filter((itemRequirement)=>itemRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721);
23262
- if (erc721ItemRequirements.length > 0) currentBalances.push($beb896e098e41faf$var$getERC721Balances(provider, ownerAddress, aggregatedItems));
23272
+ if (requiredERC721.length > 0) balancePromises.push($beb896e098e41faf$var$getERC721Balances(provider, ownerAddress, aggregatedItems));
23263
23273
  // Wait for all balances and calculate the requirements
23264
- const balanceRequirements = await Promise.all(currentBalances).then((balances)=>{
23265
- const requirements = [];
23266
- if (balances.length > 1 || tokenItemRequirements.length > 0) {
23267
- const tokenBalances = balances[0];
23268
- tokenItemRequirements.forEach((tokenItemRequirement)=>{
23269
- requirements.push(($73d2282a108cc7e2$export$6ab9757fda54db7e)(tokenItemRequirement, tokenBalances));
23270
- });
23271
- if (erc721ItemRequirements.length > 0) {
23272
- const erc721Balances = balances[1];
23273
- erc721ItemRequirements.forEach((erc721ItemRequirement)=>{
23274
- requirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(erc721ItemRequirement, erc721Balances));
23275
- });
23276
- }
23277
- } else if (erc721ItemRequirements.length > 0) {
23278
- // Only erc721
23279
- const erc721Balances = balances[0];
23280
- erc721ItemRequirements.forEach((erc721ItemRequirement)=>{
23281
- requirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(erc721ItemRequirement, erc721Balances));
23282
- });
23283
- }
23284
- return requirements;
23285
- });
23286
- const sufficient = balanceRequirements.reduce((acc, balanceRequirement)=>{
23287
- return acc && balanceRequirement.sufficient;
23288
- }, true);
23274
+ const promisesResponses = await Promise.all(balancePromises);
23275
+ const balanceRequirements = [];
23276
+ // Get all ERC20 and NATIVE balances
23277
+ if (requiredToken.length > 0 && promisesResponses.length > 0) {
23278
+ const result = promisesResponses.shift();
23279
+ if (result) requiredToken.forEach((item)=>{
23280
+ balanceRequirements.push(($73d2282a108cc7e2$export$6ab9757fda54db7e)(item, result));
23281
+ });
23282
+ }
23283
+ // Get all ERC721 balances
23284
+ if (requiredERC721.length > 0 && promisesResponses.length > 0) {
23285
+ const result = promisesResponses.shift();
23286
+ if (result) requiredERC721.forEach((item)=>{
23287
+ balanceRequirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(item, result));
23288
+ });
23289
+ }
23290
+ // Find if there are any requirements that aren't sufficient.
23291
+ // If there is not item with sufficient === false then the requirements
23292
+ // are satisfied.
23293
+ const sufficient = balanceRequirements.find((req)=>req.sufficient === false) === undefined;
23289
23294
  return {
23290
23295
  sufficient: sufficient,
23291
23296
  balanceRequirements: balanceRequirements
@@ -23869,7 +23874,9 @@ const $15fe1c77041bd4f4$export$9e73e22953cebcfc = async (config, readOnlyProvide
23869
23874
 
23870
23875
  const $887d24b47765b1c0$export$c37d8687c27b9660 = "0x0000000000000000000000000000000000000001";
23871
23876
  const $887d24b47765b1c0$export$1430626eec86fce9 = (chainId)=>{
23877
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_MAINNET) return "imtbl-zkevm-mainnet";
23872
23878
  if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET) return "imtbl-zkevm-testnet";
23879
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET) return "imtbl-zkevm-devent";
23873
23880
  return "";
23874
23881
  };
23875
23882
  const $887d24b47765b1c0$export$53e663abd9b77fc1 = async (chainId, config)=>{
@@ -24690,7 +24697,6 @@ const $a7367d01c6e76b1c$export$d62081fac18000c2 = (orderHash, orderComponents, a
24690
24697
 
24691
24698
 
24692
24699
 
24693
-
24694
24700
  const $9051cee080948594$export$9ac1563efd38130 = 1; // 100%
24695
24701
  const $9051cee080948594$export$768e717351d4b176 = 6; // will allow 0.000001 (0.0001%) as the minimum value
24696
24702
  const $9051cee080948594$var$calculateFeesPercent = (orderFee, amountBn)=>{
@@ -24731,6 +24737,7 @@ const $9051cee080948594$export$1e69c9cfc42e28d8 = (orderFees, weiAmount, decimal
24731
24737
 
24732
24738
 
24733
24739
 
24740
+
24734
24741
  const $64863c39386de592$export$4249179755829904 = (type, contractAddress, amount, spenderAddress)=>{
24735
24742
  switch(type){
24736
24743
  case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
@@ -24762,16 +24769,24 @@ const $64863c39386de592$export$8f2ff92ab8657f0b = (gasLimit, fulfillmentTransact
24762
24769
  };
24763
24770
  };
24764
24771
  const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, orders)=>{
24765
- let orderbook;
24772
+ 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);
24766
24773
  let order;
24767
24774
  let spenderAddress = "";
24775
+ let decimals = 18;
24768
24776
  const gasLimit = (constants).estimatedFulfillmentGasGwei;
24769
- 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);
24777
+ const orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
24778
+ const blockchainClient = $67fc622a2b913d5f$export$436dd76f23f463ff(config);
24779
+ const fulfillerAddress = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
24780
+ // Prefetch balances and store them in memory
24781
+ ($1564e43dde50bb61$export$be5483d07cfa803d)();
24782
+ ($1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, fulfillerAddress, ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config));
24783
+ ($1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, fulfillerAddress, ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config));
24770
24784
  const { id: id, takerFees: takerFees } = orders[0];
24785
+ let orderChainName;
24771
24786
  try {
24772
- orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
24773
24787
  order = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to fetch the listing from the orderbook", orderbook.getListing(id));
24774
- const { seaportContractAddress: seaportContractAddress } = orderbook.config();
24788
+ const { seaportContractAddress: seaportContractAddress, chainName: chainName } = orderbook.config();
24789
+ orderChainName = chainName;
24775
24790
  spenderAddress = seaportContractAddress;
24776
24791
  } catch (err) {
24777
24792
  throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("An error occurred while getting the order listing", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ORDER_LISTING_ERROR, {
@@ -24784,10 +24799,12 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
24784
24799
  message: "No buy side tokens found on order"
24785
24800
  });
24786
24801
  const buyToken = order.result.buy[0];
24787
- let decimals = 18;
24788
- if (order.result.buy[0].type === "ERC20") {
24789
- const tokenContract = $06a6c5c23f7f2479$export$fbbc17f6e6e58544(order.result.buy[0].contractAddress, ($d85ad1457a3f1a83$export$db5daa1b5156ccfe), provider);
24790
- decimals = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", tokenContract.decimals());
24802
+ if (buyToken.type === "ERC20") {
24803
+ const token = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", blockchainClient.getToken({
24804
+ contractAddress: buyToken.contractAddress,
24805
+ chainName: orderChainName
24806
+ }));
24807
+ if (token.result.decimals) decimals = token.result.decimals;
24791
24808
  }
24792
24809
  let fees = [];
24793
24810
  if (takerFees && takerFees.length > 0) fees = ($9051cee080948594$export$1e69c9cfc42e28d8)(takerFees, buyToken.amount, decimals);
@@ -24796,7 +24813,6 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
24796
24813
  let orderActions = [];
24797
24814
  const fulfillOrderStartTime = performance.now();
24798
24815
  try {
24799
- const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
24800
24816
  const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
24801
24817
  orderActions = actions;
24802
24818
  unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
@@ -25,7 +25,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
25
25
  })($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
26
26
 
27
27
 
28
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.28.4-alpha.1";
28
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.28.4-alpha.2";
29
29
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
30
30
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
31
31
 
@@ -17,7 +17,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
17
17
  chainID,
18
18
  coreContractAddress,
19
19
  registrationContractAddress,
20
- sdkVersion: 'ts-immutable-sdk-0.28.4-alpha.1',
20
+ sdkVersion: 'ts-immutable-sdk-0.28.4-alpha.2',
21
21
  });
22
22
  /**
23
23
  * Sets `sdkVersion` at the time of build