@swype-org/react-sdk 0.2.24 → 0.2.29

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
@@ -85,7 +85,7 @@ var wagmiConfig = wagmi.createConfig({
85
85
  [chains.mainnet.id]: wagmi.http(),
86
86
  [chains.arbitrum.id]: wagmi.http(),
87
87
  [chains.base.id]: wagmi.http(),
88
- [chains.polygon.id]: wagmi.http(),
88
+ [chains.polygon.id]: wagmi.http("https://polygon-bor-rpc.publicnode.com"),
89
89
  [chains.bsc.id]: wagmi.http(),
90
90
  [chains.baseSepolia.id]: wagmi.http()
91
91
  }
@@ -4910,30 +4910,6 @@ var waitHintStyle = (color) => ({
4910
4910
  color,
4911
4911
  margin: 0
4912
4912
  });
4913
-
4914
- // src/feeFormat.ts
4915
- function isPreciseMoneyNonPositive(fee) {
4916
- const raw = fee.value.trim();
4917
- if (!/^-?\d+(\.\d*)?$/.test(raw)) return false;
4918
- const n = Number(raw);
4919
- return Number.isFinite(n) && n <= 0;
4920
- }
4921
- function formatNonPositiveFeeDisplay(fee) {
4922
- return "< $0.01";
4923
- }
4924
- function formatPreciseMoneyForDisplay(fee) {
4925
- const raw = fee.value.trim();
4926
- if (fee.currency === "USD") {
4927
- if (!/^\d+(\.\d*)?$/.test(raw)) {
4928
- return `$${raw}`;
4929
- }
4930
- const [whole, frac = ""] = raw.split(".");
4931
- const dec = `${frac}00`.slice(0, 2);
4932
- const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
4933
- return `$${intFmt}.${dec}`;
4934
- }
4935
- return `${raw} ${fee.currency}`;
4936
- }
4937
4913
  function formatUsdTwoDecimals(value) {
4938
4914
  const n = Number(value);
4939
4915
  return (Number.isFinite(n) ? n : 0).toLocaleString("en-US", {
@@ -5105,10 +5081,9 @@ function DepositScreen({
5105
5081
  return /* @__PURE__ */ jsxRuntime.jsx(WarningBanner, { title: "Fee estimate unavailable", children: quoteError });
5106
5082
  }
5107
5083
  if (quoteFee) {
5108
- const feeText = isPreciseMoneyNonPositive(quoteFee) ? formatNonPositiveFeeDisplay() : formatPreciseMoneyForDisplay(quoteFee);
5109
5084
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: feeRowContainerStyle, "aria-live": "polite", children: [
5110
5085
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowLabelStyle(tokens.textMuted), children: "Fee estimate: " }),
5111
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowAmountStyle(tokens.textSecondary), children: feeText })
5086
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowAmountStyle(tokens.textSecondary), children: "Free" })
5112
5087
  ] });
5113
5088
  }
5114
5089
  return null;
@@ -6674,6 +6649,30 @@ var selectCircleSelectedStyle = (color) => ({
6674
6649
  justifyContent: "center",
6675
6650
  flexShrink: 0
6676
6651
  });
6652
+
6653
+ // src/feeFormat.ts
6654
+ function isPreciseMoneyNonPositive(fee) {
6655
+ const raw = fee.value.trim();
6656
+ if (!/^-?\d+(\.\d*)?$/.test(raw)) return false;
6657
+ const n = Number(raw);
6658
+ return Number.isFinite(n) && n <= 0;
6659
+ }
6660
+ function formatNonPositiveFeeDisplay(fee) {
6661
+ return "Free";
6662
+ }
6663
+ function formatPreciseMoneyForDisplay(fee) {
6664
+ const raw = fee.value.trim();
6665
+ if (fee.currency === "USD") {
6666
+ if (!/^\d+(\.\d*)?$/.test(raw)) {
6667
+ return `$${raw}`;
6668
+ }
6669
+ const [whole, frac = ""] = raw.split(".");
6670
+ const dec = `${frac}00`.slice(0, 2);
6671
+ const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
6672
+ return `$${intFmt}.${dec}`;
6673
+ }
6674
+ return `${raw} ${fee.currency}`;
6675
+ }
6677
6676
  function entryKey(entry) {
6678
6677
  return `${entry.sourceChainId}-${entry.tokenAddress.toLowerCase()}`;
6679
6678
  }
@@ -9440,13 +9439,14 @@ function useGuestTransferHandlers(deps) {
9440
9439
  from: sender,
9441
9440
  to: bridgeStep.to,
9442
9441
  data: bridgeStep.data,
9443
- value: bridgeStep.value
9442
+ value: `0x${BigInt(bridgeStep.value || "0").toString(16)}`
9444
9443
  }]
9445
9444
  });
9446
9445
  console.info(`[blink-sdk] type=guest Bridge step ${stepIdx + 1} tx sent: ${txHash}`);
9447
9446
  setBridgePhase("sending");
9448
9447
  await core.waitForTransactionReceipt(wagmiConfig2, {
9449
- hash: txHash
9448
+ hash: txHash,
9449
+ timeout: 6e4
9450
9450
  });
9451
9451
  lastTxHash = txHash;
9452
9452
  }