@kimafinance/kima-transaction-widget 1.0.1 → 1.0.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.
@@ -582,6 +582,7 @@ var TransactionStatus;
582
582
  TransactionStatus["AVAILABLE"] = "Available";
583
583
  TransactionStatus["CONFIRMED"] = "Confirmed";
584
584
  TransactionStatus["PAID"] = "Paid";
585
+ TransactionStatus["COMPLETED"] = "Completed";
585
586
  TransactionStatus["FAILED"] = "FailedToPay";
586
587
  TransactionStatus["UNAVAILABLE"] = "UnAvailable";
587
588
  TransactionStatus["KEYSIGNED"] = "KeySigned";
@@ -912,7 +913,7 @@ const Loading180Ring = ({
912
913
  };
913
914
 
914
915
  const stepInfo = [{
915
- title: 'Initializing'
916
+ title: 'Initialize'
916
917
  }, {
917
918
  title: 'Source Transfer'
918
919
  }, {
@@ -920,7 +921,7 @@ const stepInfo = [{
920
921
  }, {
921
922
  title: 'Target Transfer'
922
923
  }, {
923
- title: 'Finalizing'
924
+ title: 'Finalize'
924
925
  }];
925
926
  const Progressbar = ({
926
927
  step,
@@ -946,9 +947,9 @@ const Progressbar = ({
946
947
  }
947
948
  }, React.createElement("div", {
948
949
  className: 'step-info'
949
- }, step >= index && (index === errorStep ? React.createElement(Warning, null) : React.createElement(Check, null)), index === loadingStep ? React.createElement(Loading180Ring, {
950
+ }, index === loadingStep ? React.createElement(Loading180Ring, {
950
951
  fill: theme === ThemeOptions.dark ? 'white' : '#5aa0db'
951
- }) : null, React.createElement("span", null, item.title))))));
952
+ }) : step >= index ? index === errorStep ? React.createElement(Warning, null) : React.createElement(Check, null) : null, React.createElement("span", null, item.title))))));
952
953
  };
953
954
 
954
955
  const ExternalLink = ({
@@ -1308,6 +1309,7 @@ const Dropdown = ({
1308
1309
  };
1309
1310
 
1310
1311
  const version = "logger/5.7.0";
1312
+ //# sourceMappingURL=_version.js.map
1311
1313
 
1312
1314
  let _permanentCensorErrors = false;
1313
1315
  let _censorErrors = false;
@@ -1657,8 +1659,10 @@ class Logger {
1657
1659
  }
1658
1660
  Logger.errors = ErrorCode;
1659
1661
  Logger.levels = LogLevel;
1662
+ //# sourceMappingURL=index.js.map
1660
1663
 
1661
1664
  const version$1 = "bytes/5.7.0";
1665
+ //# sourceMappingURL=_version.js.map
1662
1666
 
1663
1667
  const logger = new Logger(version$1);
1664
1668
  ///////////////////////////////
@@ -1769,6 +1773,7 @@ function hexStripZeros(value) {
1769
1773
  }
1770
1774
  return "0x" + value.substring(offset);
1771
1775
  }
1776
+ //# sourceMappingURL=index.js.map
1772
1777
 
1773
1778
  const createWalletStatus = (isReady, statusMessage = '', forceNetworkSwitch, walletAddress) => ({
1774
1779
  isReady,
@@ -2031,15 +2036,15 @@ const CopyButton = ({
2031
2036
  };
2032
2037
 
2033
2038
  const stepInfo$1 = [{
2034
- title: 'Initializing'
2039
+ title: 'Initialize'
2035
2040
  }, {
2036
2041
  title: 'Source Transfer'
2037
2042
  }, {
2038
- title: 'KeySigning'
2043
+ title: 'Validation'
2039
2044
  }, {
2040
2045
  title: 'Target Transfer'
2041
2046
  }, {
2042
- title: 'Finalizing'
2047
+ title: 'Finalize'
2043
2048
  }];
2044
2049
  const StepBox = ({
2045
2050
  step,
@@ -2057,9 +2062,9 @@ const StepBox = ({
2057
2062
  className: 'step-item'
2058
2063
  }, React.createElement("div", {
2059
2064
  className: 'info-item'
2060
- }, step >= index && (index === errorStep ? React.createElement(Warning, null) : React.createElement(Check, null)), index === loadingStep ? React.createElement(Loading180Ring, {
2065
+ }, index === loadingStep ? React.createElement(Loading180Ring, {
2061
2066
  fill: theme === ThemeOptions.dark ? 'white' : '#5aa0db'
2062
- }) : null, React.createElement("p", null, item.title)), index === 0 ? React.createElement("div", {
2067
+ }) : step >= index ? index === errorStep ? React.createElement(Warning, null) : React.createElement(Check, null) : null, React.createElement("p", null, item.title)), index === 0 ? React.createElement("div", {
2063
2068
  className: 'info-item'
2064
2069
  }, React.createElement("p", null, "Kima TX ID:", ' ', React.createElement(ExternalLink, {
2065
2070
  to: 'https://explorer.kima.finance/transactions/718ABEE14755C1ACA617607F9353A55013EF855B0EA6E92EFD31A2F50A362524'
@@ -2240,11 +2245,11 @@ const TransactionWidget = ({
2240
2245
  });
2241
2246
  setErrorStep(-1);
2242
2247
  if (status === TransactionStatus.AVAILABLE) {
2243
- setStep(0);
2248
+ setStep(1);
2244
2249
  setPercent(0);
2245
2250
  setLoadingStep(1);
2246
2251
  } else if (status === TransactionStatus.CONFIRMED) {
2247
- setStep(1);
2252
+ setStep(2);
2248
2253
  setPercent(25);
2249
2254
  setLoadingStep(2);
2250
2255
  } else if (status.startsWith(TransactionStatus.UNAVAILABLE)) {
@@ -2253,10 +2258,19 @@ const TransactionWidget = ({
2253
2258
  setErrorStep(1);
2254
2259
  setLoadingStep(-1);
2255
2260
  } else if (status === TransactionStatus.KEYSIGNED) {
2256
- setStep(2);
2261
+ setStep(3);
2257
2262
  setPercent(50);
2258
2263
  setLoadingStep(3);
2259
2264
  } else if (status === TransactionStatus.PAID) {
2265
+ setStep(3);
2266
+ setPercent(75);
2267
+ setLoadingStep(3);
2268
+ } else if (status === TransactionStatus.FAILED) {
2269
+ setStep(3);
2270
+ setPercent(75);
2271
+ setErrorStep(3);
2272
+ setLoadingStep(-1);
2273
+ } else if (status === TransactionStatus.COMPLETED) {
2260
2274
  setStep(4);
2261
2275
  setPercent(100);
2262
2276
  clearInterval(timerId);
@@ -2266,11 +2280,6 @@ const TransactionWidget = ({
2266
2280
  txId
2267
2281
  });
2268
2282
  }, 3000);
2269
- } else if (status === TransactionStatus.FAILED) {
2270
- setStep(3);
2271
- setPercent(75);
2272
- setErrorStep(3);
2273
- setLoadingStep(-1);
2274
2283
  }
2275
2284
  }, 1000);
2276
2285
  return () => {