@kimafinance/kima-transaction-widget 1.2.56-beta.1 → 1.2.58-beta.1

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.js CHANGED
@@ -3276,7 +3276,7 @@ var StepBox = function StepBox(_ref) {
3276
3276
  }) : step >= index ? index === errorStep ? React__default.createElement(Warning, null) : React__default.createElement(Check, null) : null, React__default.createElement("p", null, item.title)), index === 0 && data !== null && data !== void 0 && data.kimaTxHash ? React__default.createElement("div", {
3277
3277
  className: 'info-item'
3278
3278
  }, React__default.createElement("p", null, "Kima TX ID:", ' ', React__default.createElement(ExternalLink, {
3279
- to: "https://" + explorerUrl + "/transactions/" + (data === null || data === void 0 ? void 0 : data.kimaTxHash)
3279
+ to: explorerUrl + "/transactions/" + (data === null || data === void 0 ? void 0 : data.kimaTxHash)
3280
3280
  }, getShortenedAddress((data === null || data === void 0 ? void 0 : data.kimaTxHash) || '')), React__default.createElement(CopyButton, {
3281
3281
  text: data === null || data === void 0 ? void 0 : data.kimaTxHash
3282
3282
  }))) : null, index === 1 && data !== null && data !== void 0 && data.tssPullHash ? React__default.createElement("div", {
@@ -3799,9 +3799,11 @@ function useServiceFee(isConfirming, feeURL) {
3799
3799
  var sourceFee = 0;
3800
3800
  var targetFee = 0;
3801
3801
  return Promise.resolve(fetchWrapper.get(feeURL + "/fee/" + sourceChain)).then(function (sourceChainResult) {
3802
- sourceFee = sourceChainResult.fee.split('-')[0];
3802
+ var _sourceChainResult$fe;
3803
+ sourceFee = sourceChainResult === null || sourceChainResult === void 0 ? void 0 : (_sourceChainResult$fe = sourceChainResult.fee) === null || _sourceChainResult$fe === void 0 ? void 0 : _sourceChainResult$fe.split('-')[0];
3803
3804
  return Promise.resolve(fetchWrapper.get(feeURL + "/fee/" + targetChain)).then(function (targetChainResult) {
3804
- targetFee = targetChainResult.fee.split('-')[0];
3805
+ var _targetChainResult$fe;
3806
+ targetFee = targetChainResult === null || targetChainResult === void 0 ? void 0 : (_targetChainResult$fe = targetChainResult.fee) === null || _targetChainResult$fe === void 0 ? void 0 : _targetChainResult$fe.split('-')[0];
3805
3807
  var fee = +sourceFee + +targetFee;
3806
3808
  dispatch(setServiceFee(fee));
3807
3809
  });
@@ -7921,12 +7923,13 @@ function useCurrencyOptions() {
7921
7923
  var _useState = React.useState('USDK'),
7922
7924
  options = _useState[0],
7923
7925
  setOptions = _useState[1];
7926
+ var mode = reactRedux.useSelector(selectMode);
7924
7927
  var transactionOption = reactRedux.useSelector(selectTransactionOption);
7925
7928
  var nodeProviderQuery = reactRedux.useSelector(selectNodeProviderQuery);
7926
7929
  var originNetwork = reactRedux.useSelector(selectSourceChain);
7927
7930
  var targetNetwork = reactRedux.useSelector(selectTargetChain);
7928
7931
  React.useEffect(function () {
7929
- if (!nodeProviderQuery || !originNetwork || !targetNetwork || !transactionOption) return;
7932
+ if (!nodeProviderQuery || !originNetwork || !targetNetwork || !transactionOption && mode === exports.ModeOptions.payment) return;
7930
7933
  (function () {
7931
7934
  try {
7932
7935
  return _catch(function () {
@@ -7941,8 +7944,7 @@ function useCurrencyOptions() {
7941
7944
  if (originNetwork === exports.SupportNetworks.BTC || targetNetwork === exports.SupportNetworks.BTC) {
7942
7945
  tokenList = ['WBTC'];
7943
7946
  }
7944
- console.log(tokenList, transactionOption);
7945
- if (transactionOption.currency && tokenList.findIndex(function (item) {
7947
+ if (transactionOption !== null && transactionOption !== void 0 && transactionOption.currency && tokenList.findIndex(function (item) {
7946
7948
  return item === transactionOption.currency;
7947
7949
  }) >= 0) {
7948
7950
  dispatch(setSelectedToken(transactionOption.currency));
@@ -7961,7 +7963,7 @@ function useCurrencyOptions() {
7961
7963
  Promise.reject(e);
7962
7964
  }
7963
7965
  })();
7964
- }, [nodeProviderQuery, originNetwork, targetNetwork, transactionOption]);
7966
+ }, [nodeProviderQuery, originNetwork, targetNetwork, transactionOption, mode]);
7965
7967
  return React.useMemo(function () {
7966
7968
  return {
7967
7969
  options: options