@imtbl/sdk 0.1.10-alpha.2 → 0.1.10-alpha.4

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.
@@ -1002,14 +1002,14 @@ interface GetWalletAllowListParams {
1002
1002
  * Interface representing information about a wallet used in {@link GetWalletAllowListResult}.
1003
1003
  * @property {WalletProviderName} walletProvider - The connection provider for the wallet.
1004
1004
  * @property {string} name - The name of the wallet.
1005
- * @property {string} description - A description of the wallet.
1006
- * @property {string} icon - The URL/data:image of an icon for the wallet.
1005
+ * @property {string | undefined} description - A description of the wallet.
1006
+ * @property {string | undefined} icon - The URL/data:image of an icon for the wallet.
1007
1007
  */
1008
1008
  interface WalletInfo {
1009
1009
  walletProvider: WalletProviderName;
1010
1010
  name: string;
1011
- description: string;
1012
- icon: string;
1011
+ description?: string;
1012
+ icon?: string;
1013
1013
  }
1014
1014
  /**
1015
1015
  * Interface representing the result of {@link Checkout.getWalletAllowList}.
@@ -1022,9 +1022,7 @@ interface GetWalletAllowListResult {
1022
1022
  * Enum representing the platform filters used in {@link GetWalletAllowListParams}.
1023
1023
  */
1024
1024
  declare enum WalletFilterTypes {
1025
- ALL = "all",
1026
- DESKTOP = "desktop",
1027
- MOBILE = "mobile"
1025
+ ALL = "all"
1028
1026
  }
1029
1027
  /**
1030
1028
  * Base URL for the checkout API based on the environment.
@@ -1,7 +1,6 @@
1
1
  import { ethers, ContractFactory, utils, Contract as Contract$1, BigNumber as BigNumber$2 } from 'ethers';
2
2
  import { Web3Provider, JsonRpcProvider } from '@ethersproject/providers';
3
3
  import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
4
- import { BigNumber as BigNumber$3, utils as utils$1 } from 'ethers/lib/ethers';
5
4
  import { Token, TradeType, CurrencyAmount, Percent } from '@uniswap/sdk-core';
6
5
  import assert from 'assert';
7
6
  import { BigNumber as BigNumber$1 } from '@ethersproject/bignumber';
@@ -12645,9 +12644,6 @@ class ExchangeConfiguration {
12645
12644
  }
12646
12645
  }
12647
12646
 
12648
- function $parcel$interopDefault(a) {
12649
- return a && a.__esModule ? a.default : a;
12650
- }
12651
12647
  /* eslint-disable class-methods-use-this */
12652
12648
 
12653
12649
  const $762782b6c862d954$export$db5daa1b5156ccfe = [
@@ -12787,8 +12783,6 @@ var $4f91c5f280efe242$export$35b06f0d33f57e26;
12787
12783
  var $4f91c5f280efe242$export$a75605c67ea83a5a;
12788
12784
  (function(WalletFilterTypes) {
12789
12785
  WalletFilterTypes["ALL"] = "all";
12790
- WalletFilterTypes["DESKTOP"] = "desktop";
12791
- WalletFilterTypes["MOBILE"] = "mobile";
12792
12786
  })($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
12793
12787
 
12794
12788
 
@@ -13301,23 +13295,17 @@ async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, v
13301
13295
 
13302
13296
 
13303
13297
 
13304
- var $6f3c55a615003cbf$exports = {};
13305
- $6f3c55a615003cbf$exports = JSON.parse('[{"walletProvider":"metamask","icon":"some-icon-url","name":"MetaMask","description":"complete web3 wallet solution","platform":["desktop"]},{"walletProvider":"passport","icon":"pp-icon","name":"Passport","description":"Web3 with your email!","platform":["mobile","desktop"]},{"walletProvider":"gamestop","icon":"gme-icon","name":"GameStop","description":"Never stopping the game!","platform":["mobile"]}]');
13306
-
13307
-
13308
- async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL, exclude: exclude }) {
13309
- // todo:For async API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
13310
- const filteredWalletsList = ((/*@__PURE__*/$parcel$interopDefault($6f3c55a615003cbf$exports))).filter((wallet)=>{
13311
- const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.walletProvider).includes(wallet.walletProvider);
13312
- const allowAllWallets = type === ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL;
13313
- const walletsAllowedForType = wallet.platform.includes(type);
13314
- return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
13315
- }).map((wallet)=>{
13316
- const { platform: platform, ...walletInfo } = wallet;
13317
- return walletInfo;
13298
+ async function $5cdde2ffe6360fec$export$a822caa90d7eef09(params) {
13299
+ const walletList = [];
13300
+ const excludedWalletProvider = params.exclude?.map((wp)=>wp.walletProvider) ?? [];
13301
+ let walletProviderNames = Object.values(($e768639828688ca3$export$2d7a51a18d87e21d));
13302
+ if (excludedWalletProvider.length !== 0) walletProviderNames = walletProviderNames.filter((wp)=>!excludedWalletProvider.includes(wp));
13303
+ for (const value of walletProviderNames)walletList.push({
13304
+ walletProvider: value,
13305
+ name: value
13318
13306
  });
13319
13307
  return {
13320
- wallets: filteredWalletsList
13308
+ wallets: walletList
13321
13309
  };
13322
13310
  }
13323
13311
 
@@ -13348,7 +13336,6 @@ const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transacti
13348
13336
 
13349
13337
 
13350
13338
 
13351
-
13352
13339
  const $570856c68db0bd36$var$GAS_LIMIT = 140000;
13353
13340
  const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
13354
13341
  const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (BigNumber$2).from(feeData.maxFeePerGas).add((BigNumber$2).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (BigNumber$2).from(feeData.gasPrice);
@@ -13577,13 +13564,13 @@ async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
13577
13564
  try {
13578
13565
  const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, config);
13579
13566
  // Create a fake transaction to get the gas from the quote
13580
- const { swap: swap } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, BigNumber$3).from((0, utils$1).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
13567
+ const { swap: swap } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, BigNumber$2).from((0, utils).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
13581
13568
  if (swap.gasFeeEstimate === null) return {
13582
13569
  gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
13583
13570
  gasFee: {}
13584
13571
  };
13585
13572
  let estimatedAmount;
13586
- if (swap.gasFeeEstimate.value) estimatedAmount = (0, BigNumber$3).from(swap.gasFeeEstimate.value);
13573
+ if (swap.gasFeeEstimate.value) estimatedAmount = (0, BigNumber$2).from(swap.gasFeeEstimate.value);
13587
13574
  return {
13588
13575
  gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
13589
13576
  gasFee: {