@rhinestone/deposit-modal 0.3.0-alpha.3 → 0.3.0-alpha.5
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/{DepositModalReown-6QBOLFNL.mjs → DepositModalReown-3VZ5AKV2.mjs} +2 -2
- package/dist/{DepositModalReown-DVRWDPYV.cjs → DepositModalReown-PPX34UAK.cjs} +3 -3
- package/dist/{WithdrawModalReown-KGFCNAJP.cjs → WithdrawModalReown-4B6IMTBB.cjs} +3 -3
- package/dist/{WithdrawModalReown-UO7XCJ7K.mjs → WithdrawModalReown-BB3MZAIO.mjs} +2 -2
- package/dist/{chunk-UEYFJM5Y.cjs → chunk-BB6UVRAV.cjs} +74 -74
- package/dist/{chunk-TFXIQ7YH.mjs → chunk-CTYKQ4B4.mjs} +295 -171
- package/dist/{chunk-V6NJIPSS.cjs → chunk-DX2D2TRZ.cjs} +239 -115
- package/dist/{chunk-GE3TMZEL.mjs → chunk-QI6Q7V6O.mjs} +19 -19
- package/dist/{chunk-IATY2C5R.cjs → chunk-TTD2FEA2.cjs} +374 -313
- package/dist/{chunk-QLTTDVFU.mjs → chunk-ZUWAIMMH.mjs} +163 -102
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/styles.css +396 -177
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AlertTriangleIcon,
|
|
3
|
-
|
|
3
|
+
ArrowUpRightIcon,
|
|
4
4
|
BodyHeader,
|
|
5
5
|
Button,
|
|
6
6
|
CheckIcon,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
tokenFormatter,
|
|
49
49
|
txRefsMatch,
|
|
50
50
|
useLatestRef
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-CTYKQ4B4.mjs";
|
|
52
52
|
import {
|
|
53
53
|
DEFAULT_BACKEND_URL,
|
|
54
54
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -586,7 +586,7 @@ function AmountStep({
|
|
|
586
586
|
liquidityWarning
|
|
587
587
|
);
|
|
588
588
|
};
|
|
589
|
-
const continueLabel =
|
|
589
|
+
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
590
590
|
const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
591
591
|
const sourceChainName = getChainName(asset.chainId);
|
|
592
592
|
const targetChainName = getChainName(targetChain);
|
|
@@ -679,6 +679,8 @@ function AmountStep({
|
|
|
679
679
|
{
|
|
680
680
|
onClick: handleContinue,
|
|
681
681
|
fullWidth: true,
|
|
682
|
+
loading: isCheckingLiquidity,
|
|
683
|
+
loadingText: "Checking liquidity\u2026",
|
|
682
684
|
disabled: continueDisabled,
|
|
683
685
|
children: continueLabel
|
|
684
686
|
}
|
|
@@ -834,50 +836,50 @@ function ConfirmStep({
|
|
|
834
836
|
return /* @__PURE__ */ jsxs3("div", { className: "rs-screen", children: [
|
|
835
837
|
/* @__PURE__ */ jsxs3("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
836
838
|
/* @__PURE__ */ jsx3(BodyHeader, { icon: /* @__PURE__ */ jsx3(WalletIcon, {}), title: "Review deposit" }),
|
|
837
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
838
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
839
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-details", children: [
|
|
840
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-detail-row", children: [
|
|
839
841
|
/* @__PURE__ */ jsx3("span", { children: "Source chain" }),
|
|
840
|
-
/* @__PURE__ */ jsxs3("span", { className: "rs-
|
|
842
|
+
/* @__PURE__ */ jsxs3("span", { className: "rs-review-detail-value", children: [
|
|
841
843
|
/* @__PURE__ */ jsx3("span", { children: sourceChainName }),
|
|
842
|
-
sourceChainIcon && /* @__PURE__ */ jsx3("span", { className: "rs-
|
|
844
|
+
sourceChainIcon && /* @__PURE__ */ jsx3("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx3("img", { src: sourceChainIcon, alt: "" }) })
|
|
843
845
|
] })
|
|
844
846
|
] }),
|
|
845
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
847
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-detail-row", children: [
|
|
846
848
|
/* @__PURE__ */ jsx3("span", { children: "Destination chain" }),
|
|
847
|
-
/* @__PURE__ */ jsxs3("span", { className: "rs-
|
|
849
|
+
/* @__PURE__ */ jsxs3("span", { className: "rs-review-detail-value", children: [
|
|
848
850
|
/* @__PURE__ */ jsx3("span", { children: targetChainName }),
|
|
849
|
-
targetChainIcon && /* @__PURE__ */ jsx3("span", { className: "rs-
|
|
851
|
+
targetChainIcon && /* @__PURE__ */ jsx3("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx3("img", { src: targetChainIcon, alt: "" }) })
|
|
850
852
|
] })
|
|
851
853
|
] }),
|
|
852
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
854
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-detail-row", children: [
|
|
853
855
|
/* @__PURE__ */ jsx3("span", { children: "Estimated time" }),
|
|
854
|
-
/* @__PURE__ */ jsx3("span", { className: "rs-
|
|
856
|
+
/* @__PURE__ */ jsx3("span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
855
857
|
] }),
|
|
856
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
858
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-detail-row", children: [
|
|
857
859
|
/* @__PURE__ */ jsx3("span", { children: "You send" }),
|
|
858
|
-
/* @__PURE__ */ jsxs3("span", { className: "rs-
|
|
860
|
+
/* @__PURE__ */ jsxs3("span", { className: "rs-review-detail-value", children: [
|
|
859
861
|
/* @__PURE__ */ jsxs3("span", { children: [
|
|
860
862
|
formattedSendAmount,
|
|
861
863
|
" ",
|
|
862
864
|
asset.symbol
|
|
863
865
|
] }),
|
|
864
|
-
sourceTokenIcon && /* @__PURE__ */ jsx3("span", { className: "rs-
|
|
866
|
+
sourceTokenIcon && /* @__PURE__ */ jsx3("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx3("img", { src: sourceTokenIcon, alt: "" }) })
|
|
865
867
|
] })
|
|
866
868
|
] }),
|
|
867
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
869
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-detail-row", children: [
|
|
868
870
|
/* @__PURE__ */ jsx3("span", { children: "Receive" }),
|
|
869
|
-
/* @__PURE__ */ jsxs3("span", { className: "rs-
|
|
871
|
+
/* @__PURE__ */ jsxs3("span", { className: "rs-review-detail-value", children: [
|
|
870
872
|
/* @__PURE__ */ jsxs3("span", { children: [
|
|
871
873
|
receiveAmount,
|
|
872
874
|
" ",
|
|
873
875
|
targetSymbol
|
|
874
876
|
] }),
|
|
875
|
-
targetTokenIcon && /* @__PURE__ */ jsx3("span", { className: "rs-
|
|
877
|
+
targetTokenIcon && /* @__PURE__ */ jsx3("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx3("img", { src: targetTokenIcon, alt: "" }) })
|
|
876
878
|
] })
|
|
877
879
|
] }),
|
|
878
|
-
/* @__PURE__ */ jsxs3("div", { className: "rs-
|
|
880
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-review-detail-row", children: [
|
|
879
881
|
/* @__PURE__ */ jsx3("span", { children: "Fees" }),
|
|
880
|
-
/* @__PURE__ */ jsxs3("span", { className: "rs-
|
|
882
|
+
/* @__PURE__ */ jsxs3("span", { className: "rs-review-detail-value", children: [
|
|
881
883
|
/* @__PURE__ */ jsx3(
|
|
882
884
|
"span",
|
|
883
885
|
{
|
|
@@ -885,7 +887,7 @@ function ConfirmStep({
|
|
|
885
887
|
children: "$0.05"
|
|
886
888
|
}
|
|
887
889
|
),
|
|
888
|
-
/* @__PURE__ */ jsx3(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx3("span", { className: "rs-
|
|
890
|
+
/* @__PURE__ */ jsx3(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx3("span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ jsx3(InfoIcon, {}) }) })
|
|
889
891
|
] })
|
|
890
892
|
] })
|
|
891
893
|
] }),
|
|
@@ -1141,28 +1143,44 @@ function DepositNotification({
|
|
|
1141
1143
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1142
1144
|
const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
|
|
1143
1145
|
const statusIcon = status === "complete" ? /* @__PURE__ */ jsx4("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ jsx4(CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ jsx4("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ jsx4(CloseIcon, {}) }) : /* @__PURE__ */ jsx4("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ jsx4(Spinner, {}) });
|
|
1146
|
+
const showClose = status !== "processing";
|
|
1144
1147
|
return /* @__PURE__ */ jsxs4(
|
|
1145
1148
|
"div",
|
|
1146
1149
|
{
|
|
1147
|
-
className: `rs-deposit-notification rs-deposit-notification--${status}`,
|
|
1150
|
+
className: `rs-deposit-notification rs-deposit-notification--${status} ${expanded ? "rs-deposit-notification--expanded" : ""}`,
|
|
1148
1151
|
children: [
|
|
1149
1152
|
/* @__PURE__ */ jsxs4("div", { className: "rs-deposit-notification-header", children: [
|
|
1150
1153
|
/* @__PURE__ */ jsx4("div", { className: "rs-deposit-notification-icon", children: statusIcon }),
|
|
1151
1154
|
/* @__PURE__ */ jsxs4("div", { className: "rs-deposit-notification-content", children: [
|
|
1152
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ jsxs4("div", { className: "rs-deposit-notification-title-row", children: [
|
|
1156
|
+
/* @__PURE__ */ jsx4("span", { className: "rs-deposit-notification-title", children: title }),
|
|
1157
|
+
showClose && /* @__PURE__ */ jsx4(
|
|
1158
|
+
"button",
|
|
1159
|
+
{
|
|
1160
|
+
type: "button",
|
|
1161
|
+
className: "rs-deposit-notification-close",
|
|
1162
|
+
onClick: () => onDismiss(deposit.id),
|
|
1163
|
+
"aria-label": "Dismiss",
|
|
1164
|
+
children: /* @__PURE__ */ jsx4(CloseIcon, {})
|
|
1165
|
+
}
|
|
1166
|
+
)
|
|
1167
|
+
] }),
|
|
1153
1168
|
/* @__PURE__ */ jsx4("div", { className: "rs-deposit-notification-subtitle", children: subtitle })
|
|
1154
|
-
] })
|
|
1155
|
-
/* @__PURE__ */ jsx4(
|
|
1156
|
-
"button",
|
|
1157
|
-
{
|
|
1158
|
-
type: "button",
|
|
1159
|
-
className: "rs-deposit-notification-close",
|
|
1160
|
-
onClick: () => onDismiss(deposit.id),
|
|
1161
|
-
"aria-label": "Dismiss",
|
|
1162
|
-
children: /* @__PURE__ */ jsx4(CloseIcon, {})
|
|
1163
|
-
}
|
|
1164
|
-
)
|
|
1169
|
+
] })
|
|
1165
1170
|
] }),
|
|
1171
|
+
/* @__PURE__ */ jsxs4(
|
|
1172
|
+
"button",
|
|
1173
|
+
{
|
|
1174
|
+
type: "button",
|
|
1175
|
+
className: "rs-deposit-notification-toggle",
|
|
1176
|
+
onClick: () => setExpanded(!expanded),
|
|
1177
|
+
"aria-expanded": expanded,
|
|
1178
|
+
children: [
|
|
1179
|
+
/* @__PURE__ */ jsx4("span", { children: expanded ? "See less details" : "See more details" }),
|
|
1180
|
+
/* @__PURE__ */ jsx4(ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1181
|
+
]
|
|
1182
|
+
}
|
|
1183
|
+
),
|
|
1166
1184
|
expanded && /* @__PURE__ */ jsxs4("div", { className: "rs-deposit-notification-details", children: [
|
|
1167
1185
|
/* @__PURE__ */ jsxs4("div", { className: "rs-deposit-notification-row", children: [
|
|
1168
1186
|
/* @__PURE__ */ jsx4("span", { className: "rs-deposit-notification-label", children: "Deposit tx" }),
|
|
@@ -1204,16 +1222,7 @@ function DepositNotification({
|
|
|
1204
1222
|
/* @__PURE__ */ jsx4("span", { className: "rs-deposit-notification-label", children: "Order filled" }),
|
|
1205
1223
|
/* @__PURE__ */ jsx4("span", { className: "rs-deposit-notification-value", children: formatTimestamp(completedAt) })
|
|
1206
1224
|
] })
|
|
1207
|
-
] })
|
|
1208
|
-
/* @__PURE__ */ jsx4(
|
|
1209
|
-
"button",
|
|
1210
|
-
{
|
|
1211
|
-
type: "button",
|
|
1212
|
-
className: "rs-deposit-notification-toggle",
|
|
1213
|
-
onClick: () => setExpanded(!expanded),
|
|
1214
|
-
children: expanded ? "See less" : "See more"
|
|
1215
|
-
}
|
|
1216
|
-
)
|
|
1225
|
+
] })
|
|
1217
1226
|
]
|
|
1218
1227
|
}
|
|
1219
1228
|
);
|
|
@@ -1429,7 +1438,6 @@ function DepositAddressStep({
|
|
|
1429
1438
|
onDepositComplete,
|
|
1430
1439
|
onDepositFailed,
|
|
1431
1440
|
onCopyAddress,
|
|
1432
|
-
onRequestWalletPicker,
|
|
1433
1441
|
onError
|
|
1434
1442
|
}) {
|
|
1435
1443
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
@@ -1723,7 +1731,7 @@ function DepositAddressStep({
|
|
|
1723
1731
|
const qrIconSrc = getChainIcon(sourceChainId);
|
|
1724
1732
|
return /* @__PURE__ */ jsxs5("div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1725
1733
|
/* @__PURE__ */ jsxs5("div", { className: "rs-screen-body", children: [
|
|
1726
|
-
/* @__PURE__ */ jsx5(BodyHeader, { icon: /* @__PURE__ */ jsx5(
|
|
1734
|
+
/* @__PURE__ */ jsx5(BodyHeader, { icon: /* @__PURE__ */ jsx5(HandCoinsIcon, {}), title: "Transfer crypto" }),
|
|
1727
1735
|
/* @__PURE__ */ jsxs5("div", { className: "rs-deposit-address-selectors", children: [
|
|
1728
1736
|
/* @__PURE__ */ jsxs5("div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1729
1737
|
/* @__PURE__ */ jsx5("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1731,7 +1739,8 @@ function DepositAddressStep({
|
|
|
1731
1739
|
"button",
|
|
1732
1740
|
{
|
|
1733
1741
|
type: "button",
|
|
1734
|
-
className: "rs-deposit-address-dropdown-trigger"
|
|
1742
|
+
className: `rs-deposit-address-dropdown-trigger ${chainDropdownOpen ? "rs-deposit-address-dropdown-trigger--open" : ""}`,
|
|
1743
|
+
"aria-expanded": chainDropdownOpen,
|
|
1735
1744
|
onClick: () => {
|
|
1736
1745
|
setChainDropdownOpen(!chainDropdownOpen);
|
|
1737
1746
|
setTokenDropdownOpen(false);
|
|
@@ -1779,7 +1788,7 @@ function DepositAddressStep({
|
|
|
1779
1788
|
/* @__PURE__ */ jsx5("span", { children: "Supported token" }),
|
|
1780
1789
|
/* @__PURE__ */ jsxs5("span", { className: "rs-deposit-address-min", children: [
|
|
1781
1790
|
"Min.$",
|
|
1782
|
-
uiConfig?.minDepositUsd ?? 0.1,
|
|
1791
|
+
(uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
|
|
1783
1792
|
/* @__PURE__ */ jsx5(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsx5(
|
|
1784
1793
|
InfoIcon,
|
|
1785
1794
|
{
|
|
@@ -1793,7 +1802,8 @@ function DepositAddressStep({
|
|
|
1793
1802
|
"button",
|
|
1794
1803
|
{
|
|
1795
1804
|
type: "button",
|
|
1796
|
-
className: "rs-deposit-address-dropdown-trigger"
|
|
1805
|
+
className: `rs-deposit-address-dropdown-trigger ${tokenDropdownOpen ? "rs-deposit-address-dropdown-trigger--open" : ""}`,
|
|
1806
|
+
"aria-expanded": tokenDropdownOpen,
|
|
1797
1807
|
onClick: () => {
|
|
1798
1808
|
setTokenDropdownOpen(!tokenDropdownOpen);
|
|
1799
1809
|
setChainDropdownOpen(false);
|
|
@@ -1850,8 +1860,8 @@ function DepositAddressStep({
|
|
|
1850
1860
|
"div",
|
|
1851
1861
|
{
|
|
1852
1862
|
style: {
|
|
1853
|
-
width:
|
|
1854
|
-
height:
|
|
1863
|
+
width: 200,
|
|
1864
|
+
height: 200,
|
|
1855
1865
|
display: "flex",
|
|
1856
1866
|
alignItems: "center",
|
|
1857
1867
|
justifyContent: "center"
|
|
@@ -1859,7 +1869,7 @@ function DepositAddressStep({
|
|
|
1859
1869
|
children: /* @__PURE__ */ jsx5(Spinner, {})
|
|
1860
1870
|
}
|
|
1861
1871
|
),
|
|
1862
|
-
children: /* @__PURE__ */ jsx5(QRCode, { value: displayAddress, size:
|
|
1872
|
+
children: /* @__PURE__ */ jsx5(QRCode, { value: displayAddress, size: 200, iconSrc: qrIconSrc })
|
|
1863
1873
|
}
|
|
1864
1874
|
) }),
|
|
1865
1875
|
/* @__PURE__ */ jsx5("div", { className: "rs-deposit-address-value", children: displayAddress })
|
|
@@ -1952,16 +1962,7 @@ function DepositAddressStep({
|
|
|
1952
1962
|
]
|
|
1953
1963
|
}
|
|
1954
1964
|
),
|
|
1955
|
-
pollingError && /* @__PURE__ */ jsx5("div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1956
|
-
onRequestWalletPicker && /* @__PURE__ */ jsx5(
|
|
1957
|
-
"button",
|
|
1958
|
-
{
|
|
1959
|
-
type: "button",
|
|
1960
|
-
className: "rs-connect-wallet-manage",
|
|
1961
|
-
onClick: onRequestWalletPicker,
|
|
1962
|
-
children: "Use a wallet to deposit instead"
|
|
1963
|
-
}
|
|
1964
|
-
)
|
|
1965
|
+
pollingError && /* @__PURE__ */ jsx5("div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1965
1966
|
] }),
|
|
1966
1967
|
notifications.length > 0 && /* @__PURE__ */ jsx5("div", { className: "rs-deposit-notifications", children: notifications.map((deposit) => /* @__PURE__ */ jsx5(
|
|
1967
1968
|
DepositNotification,
|
|
@@ -3717,6 +3718,16 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
3717
3718
|
function computeIsCacheable(input) {
|
|
3718
3719
|
return !input.forceRegister && !(input.postBridgeActions?.length ?? 0);
|
|
3719
3720
|
}
|
|
3721
|
+
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
3722
|
+
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
3723
|
+
function readDedupedAccountSetupResult(requestKey) {
|
|
3724
|
+
const now = Date.now();
|
|
3725
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3726
|
+
if (existing?.settled && existing.expiresAt > now && existing.result) {
|
|
3727
|
+
return existing.result;
|
|
3728
|
+
}
|
|
3729
|
+
return null;
|
|
3730
|
+
}
|
|
3720
3731
|
async function runAccountSetup(input, deps) {
|
|
3721
3732
|
const { service, debug } = deps;
|
|
3722
3733
|
const enableSolana = input.enableSolana ?? true;
|
|
@@ -3814,6 +3825,42 @@ async function runAccountSetup(input, deps) {
|
|
|
3814
3825
|
throw mapError(error);
|
|
3815
3826
|
}
|
|
3816
3827
|
}
|
|
3828
|
+
function runAccountSetupDeduped(input, deps, requestKey) {
|
|
3829
|
+
const now = Date.now();
|
|
3830
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3831
|
+
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
3832
|
+
debugLog(deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
3833
|
+
owner: input.ownerAddress,
|
|
3834
|
+
forceRegister: input.forceRegister ?? false
|
|
3835
|
+
});
|
|
3836
|
+
return existing.promise;
|
|
3837
|
+
}
|
|
3838
|
+
const entry = {
|
|
3839
|
+
promise: runAccountSetup(input, deps),
|
|
3840
|
+
settled: false,
|
|
3841
|
+
expiresAt: Number.POSITIVE_INFINITY,
|
|
3842
|
+
result: null
|
|
3843
|
+
};
|
|
3844
|
+
setupRequestDedupe.set(requestKey, entry);
|
|
3845
|
+
entry.promise.then((result) => {
|
|
3846
|
+
entry.settled = true;
|
|
3847
|
+
entry.result = result;
|
|
3848
|
+
entry.expiresAt = Date.now() + SETUP_REQUEST_DEDUPE_TTL_MS;
|
|
3849
|
+
const cleanupTimer = setTimeout(() => {
|
|
3850
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3851
|
+
setupRequestDedupe.delete(requestKey);
|
|
3852
|
+
}
|
|
3853
|
+
}, SETUP_REQUEST_DEDUPE_TTL_MS);
|
|
3854
|
+
if (typeof cleanupTimer === "object" && cleanupTimer && "unref" in cleanupTimer && typeof cleanupTimer.unref === "function") {
|
|
3855
|
+
cleanupTimer.unref();
|
|
3856
|
+
}
|
|
3857
|
+
}).catch(() => {
|
|
3858
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3859
|
+
setupRequestDedupe.delete(requestKey);
|
|
3860
|
+
}
|
|
3861
|
+
});
|
|
3862
|
+
return entry.promise;
|
|
3863
|
+
}
|
|
3817
3864
|
function mapError(error) {
|
|
3818
3865
|
if (error instanceof TypeError) {
|
|
3819
3866
|
return new SetupError(
|
|
@@ -3866,15 +3913,6 @@ function AccountPreparingSkeleton({
|
|
|
3866
3913
|
) })
|
|
3867
3914
|
] });
|
|
3868
3915
|
}
|
|
3869
|
-
function SetupUpdatingBanner({
|
|
3870
|
-
status,
|
|
3871
|
-
message
|
|
3872
|
-
}) {
|
|
3873
|
-
if (status === "error") {
|
|
3874
|
-
return /* @__PURE__ */ jsx10("div", { className: "rs-deposit-address-error", role: "alert", children: message ?? "Couldn't update deposit details \u2014 please retry." });
|
|
3875
|
-
}
|
|
3876
|
-
return /* @__PURE__ */ jsx10("div", { className: "rs-loading-state", style: { padding: "8px 16px" }, children: /* @__PURE__ */ jsx10("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx10("div", { className: "rs-loading-subtitle", children: "Updating deposit details\u2026" }) }) });
|
|
3877
|
-
}
|
|
3878
3916
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
3879
3917
|
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
3880
3918
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
@@ -4046,6 +4084,9 @@ function DepositFlow({
|
|
|
4046
4084
|
const hasNavigatedBack = flowSlice.hasNavigatedBack;
|
|
4047
4085
|
const selectedWalletId = useDepositStore(selectedWalletIdSelector);
|
|
4048
4086
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState9(0);
|
|
4087
|
+
const [targetBalanceUsd, setTargetBalanceUsd] = useState9(
|
|
4088
|
+
void 0
|
|
4089
|
+
);
|
|
4049
4090
|
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] = useState9(() => !hasInitialWalletHydrationPending);
|
|
4050
4091
|
const portfolioAssetsRef = useRef5([]);
|
|
4051
4092
|
const stableWalletSignerRef = useRef5(null);
|
|
@@ -4326,6 +4367,26 @@ function DepositFlow({
|
|
|
4326
4367
|
() => readSetupForOwner(setupSlice, activeOwner),
|
|
4327
4368
|
[setupSlice, activeOwner]
|
|
4328
4369
|
);
|
|
4370
|
+
const activeSmartAccount = activeEntry.smartAccount;
|
|
4371
|
+
useEffect8(() => {
|
|
4372
|
+
if (!activeSmartAccount) {
|
|
4373
|
+
setTargetBalanceUsd(void 0);
|
|
4374
|
+
return;
|
|
4375
|
+
}
|
|
4376
|
+
let active = true;
|
|
4377
|
+
service.fetchPortfolio(activeSmartAccount).then((portfolio) => {
|
|
4378
|
+
if (!active) return;
|
|
4379
|
+
const target = portfolio.tokens.find(
|
|
4380
|
+
(t) => t.chainId === targetChain && typeof t.address === "string" && t.address.toLowerCase() === targetToken.toLowerCase()
|
|
4381
|
+
);
|
|
4382
|
+
setTargetBalanceUsd(target?.balanceUsd ?? 0);
|
|
4383
|
+
}).catch(() => {
|
|
4384
|
+
if (active) setTargetBalanceUsd(0);
|
|
4385
|
+
});
|
|
4386
|
+
return () => {
|
|
4387
|
+
active = false;
|
|
4388
|
+
};
|
|
4389
|
+
}, [activeSmartAccount, targetChain, targetToken, service]);
|
|
4329
4390
|
const lastActiveSetupLifecycleKeyRef = useRef5(null);
|
|
4330
4391
|
useEffect8(() => {
|
|
4331
4392
|
if (!flowMode || !isConnectSelectionConfirmed) {
|
|
@@ -4704,6 +4765,28 @@ function DepositFlow({
|
|
|
4704
4765
|
if (current.requestKey === requestKey) {
|
|
4705
4766
|
return;
|
|
4706
4767
|
}
|
|
4768
|
+
const dedupedResult = readDedupedAccountSetupResult(requestKey);
|
|
4769
|
+
if (dedupedResult) {
|
|
4770
|
+
storeApi.dispatch({
|
|
4771
|
+
type: "setup/started",
|
|
4772
|
+
owner,
|
|
4773
|
+
requestKey,
|
|
4774
|
+
cacheKey,
|
|
4775
|
+
cacheable
|
|
4776
|
+
});
|
|
4777
|
+
storeApi.dispatch({
|
|
4778
|
+
type: "setup/ready",
|
|
4779
|
+
owner,
|
|
4780
|
+
requestKey,
|
|
4781
|
+
result: {
|
|
4782
|
+
smartAccount: dedupedResult.smartAccount,
|
|
4783
|
+
sessionOwnerAddress: dedupedResult.sessionOwnerAddress,
|
|
4784
|
+
solanaDepositAddress: dedupedResult.solanaDepositAddress,
|
|
4785
|
+
cacheKey: dedupedResult.cacheKey
|
|
4786
|
+
}
|
|
4787
|
+
});
|
|
4788
|
+
return;
|
|
4789
|
+
}
|
|
4707
4790
|
storeApi.dispatch({
|
|
4708
4791
|
type: "setup/started",
|
|
4709
4792
|
owner,
|
|
@@ -4712,7 +4795,11 @@ function DepositFlow({
|
|
|
4712
4795
|
cacheable
|
|
4713
4796
|
});
|
|
4714
4797
|
try {
|
|
4715
|
-
const result = await
|
|
4798
|
+
const result = await runAccountSetupDeduped(
|
|
4799
|
+
input,
|
|
4800
|
+
{ service, debug },
|
|
4801
|
+
requestKey
|
|
4802
|
+
);
|
|
4716
4803
|
storeApi.dispatch({
|
|
4717
4804
|
type: "setup/ready",
|
|
4718
4805
|
owner,
|
|
@@ -5039,16 +5126,7 @@ function DepositFlow({
|
|
|
5039
5126
|
}
|
|
5040
5127
|
if (isDepositAddressMode) {
|
|
5041
5128
|
if (!dappAddress) return null;
|
|
5042
|
-
const isWalletPickerReachable = walletOptions.length > 0 || Boolean(reownWallet) || Boolean(onConnect);
|
|
5043
|
-
const showBanner = effectiveStep.type !== "setup" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5044
5129
|
return /* @__PURE__ */ jsxs10("div", { className: "rs-modal-body", children: [
|
|
5045
|
-
showBanner && /* @__PURE__ */ jsx10(
|
|
5046
|
-
SetupUpdatingBanner,
|
|
5047
|
-
{
|
|
5048
|
-
status: activeEntry.status,
|
|
5049
|
-
message: activeEntry.message ?? void 0
|
|
5050
|
-
}
|
|
5051
|
-
),
|
|
5052
5130
|
effectiveStep.type === "setup" && /* @__PURE__ */ jsx10(
|
|
5053
5131
|
AccountPreparingSkeleton,
|
|
5054
5132
|
{
|
|
@@ -5082,9 +5160,6 @@ function DepositFlow({
|
|
|
5082
5160
|
cta_name: "copy"
|
|
5083
5161
|
});
|
|
5084
5162
|
},
|
|
5085
|
-
onRequestWalletPicker: isWalletPickerReachable ? () => storeApi.dispatch({
|
|
5086
|
-
type: "connect/wallet-picker-requested"
|
|
5087
|
-
}) : void 0,
|
|
5088
5163
|
onError: handleError,
|
|
5089
5164
|
debug
|
|
5090
5165
|
}
|
|
@@ -5095,15 +5170,7 @@ function DepositFlow({
|
|
|
5095
5170
|
if (!dappAddress) return null;
|
|
5096
5171
|
const solanaAddr = reownWallet?.solanaAddress;
|
|
5097
5172
|
const solanaProvider = reownWallet?.solanaProvider;
|
|
5098
|
-
const solanaShowBanner = effectiveStep.type !== "setup" && effectiveStep.type !== "processing" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5099
5173
|
return /* @__PURE__ */ jsxs10("div", { className: "rs-modal-body", children: [
|
|
5100
|
-
solanaShowBanner && /* @__PURE__ */ jsx10(
|
|
5101
|
-
SetupUpdatingBanner,
|
|
5102
|
-
{
|
|
5103
|
-
status: activeEntry.status,
|
|
5104
|
-
message: activeEntry.message ?? void 0
|
|
5105
|
-
}
|
|
5106
|
-
),
|
|
5107
5174
|
effectiveStep.type === "setup" && /* @__PURE__ */ jsx10(
|
|
5108
5175
|
AccountPreparingSkeleton,
|
|
5109
5176
|
{
|
|
@@ -5134,6 +5201,7 @@ function DepositFlow({
|
|
|
5134
5201
|
targetTokenIcon: getTokenIcon(
|
|
5135
5202
|
getTokenSymbol(targetToken, targetChain)
|
|
5136
5203
|
),
|
|
5204
|
+
targetBalanceUsd,
|
|
5137
5205
|
onContinue: handleSolanaAmountContinue,
|
|
5138
5206
|
debug
|
|
5139
5207
|
}
|
|
@@ -5229,15 +5297,7 @@ function DepositFlow({
|
|
|
5229
5297
|
}
|
|
5230
5298
|
return getPublicClient(chainId);
|
|
5231
5299
|
};
|
|
5232
|
-
const walletShowBanner = effectiveStep.type !== "setup" && effectiveStep.type !== "processing" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5233
5300
|
return /* @__PURE__ */ jsxs10("div", { className: "rs-modal-body", children: [
|
|
5234
|
-
walletShowBanner && /* @__PURE__ */ jsx10(
|
|
5235
|
-
SetupUpdatingBanner,
|
|
5236
|
-
{
|
|
5237
|
-
status: activeEntry.status,
|
|
5238
|
-
message: activeEntry.message ?? void 0
|
|
5239
|
-
}
|
|
5240
|
-
),
|
|
5241
5301
|
effectiveStep.type === "setup" && /* @__PURE__ */ jsx10(
|
|
5242
5302
|
AccountPreparingSkeleton,
|
|
5243
5303
|
{
|
|
@@ -5288,6 +5348,7 @@ function DepositFlow({
|
|
|
5288
5348
|
targetChain,
|
|
5289
5349
|
targetToken,
|
|
5290
5350
|
uiConfig,
|
|
5351
|
+
targetBalanceUsd,
|
|
5291
5352
|
service,
|
|
5292
5353
|
onContinue: handleAmountContinue,
|
|
5293
5354
|
onCtaClick: (ctaName) => {
|
|
@@ -5636,7 +5697,7 @@ function HistoryCard({ deposit }) {
|
|
|
5636
5697
|
onClick: (e) => e.stopPropagation(),
|
|
5637
5698
|
children: [
|
|
5638
5699
|
/* @__PURE__ */ jsx11("span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
5639
|
-
/* @__PURE__ */ jsx11(
|
|
5700
|
+
/* @__PURE__ */ jsx11(ArrowUpRightIcon, {})
|
|
5640
5701
|
]
|
|
5641
5702
|
}
|
|
5642
5703
|
)
|
|
@@ -5651,7 +5712,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
5651
5712
|
// src/DepositModal.tsx
|
|
5652
5713
|
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5653
5714
|
var ReownDepositInner = lazy2(
|
|
5654
|
-
() => import("./DepositModalReown-
|
|
5715
|
+
() => import("./DepositModalReown-3VZ5AKV2.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
5655
5716
|
);
|
|
5656
5717
|
function sortByCreatedAtDesc(items) {
|
|
5657
5718
|
return [...items].sort((a, b) => {
|
package/dist/deposit.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkTTD2FEA2cjs = require('./chunk-TTD2FEA2.cjs');
|
|
4
|
+
require('./chunk-DX2D2TRZ.cjs');
|
|
5
5
|
require('./chunk-IVTXEYB2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunkTTD2FEA2cjs.DepositModal;
|
package/dist/deposit.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTTD2FEA2cjs = require('./chunk-TTD2FEA2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkBB6UVRAVcjs = require('./chunk-BB6UVRAV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkYQFH2WSWcjs = require('./chunk-YQFH2WSW.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-DX2D2TRZ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -70,4 +70,4 @@ var _chunkIVTXEYB2cjs = require('./chunk-IVTXEYB2.cjs');
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
exports.CHAIN_BY_ID = _chunkIVTXEYB2cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal =
|
|
73
|
+
exports.CHAIN_BY_ID = _chunkIVTXEYB2cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkTTD2FEA2cjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkIVTXEYB2cjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkIVTXEYB2cjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkBB6UVRAVcjs.WithdrawModal; exports.chainRegistry = _chunkIVTXEYB2cjs.chainRegistry; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet; exports.findChainIdForToken = _chunkIVTXEYB2cjs.findChainIdForToken; exports.getChainBadge = _chunkIVTXEYB2cjs.getChainBadge; exports.getChainIcon = _chunkIVTXEYB2cjs.getChainIcon; exports.getChainId = _chunkIVTXEYB2cjs.getChainId; exports.getChainName = _chunkIVTXEYB2cjs.getChainName; exports.getChainObject = _chunkIVTXEYB2cjs.getChainObject; exports.getExplorerName = _chunkIVTXEYB2cjs.getExplorerName; exports.getExplorerTxUrl = _chunkIVTXEYB2cjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkIVTXEYB2cjs.getExplorerUrl; exports.getSupportedChainIds = _chunkIVTXEYB2cjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkIVTXEYB2cjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkIVTXEYB2cjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkIVTXEYB2cjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkIVTXEYB2cjs.getTokenAddress; exports.getTokenDecimals = _chunkIVTXEYB2cjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon; exports.getTokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol; exports.getUsdcAddress = _chunkIVTXEYB2cjs.getUsdcAddress; exports.getUsdcDecimals = _chunkIVTXEYB2cjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkIVTXEYB2cjs.isSupportedTokenAddressForChain;
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZUWAIMMH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
WithdrawModal
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QI6Q7V6O.mjs";
|
|
7
7
|
import {
|
|
8
8
|
disconnectWallet
|
|
9
9
|
} from "./chunk-5YXAQB6A.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-CTYKQ4B4.mjs";
|
|
11
11
|
import {
|
|
12
12
|
CHAIN_BY_ID,
|
|
13
13
|
DEFAULT_BACKEND_URL,
|