@rhinestone/deposit-modal 0.1.64 → 0.1.65
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-3KQE4YU6.cjs → DepositModalReown-6ZMLUWWD.cjs} +3 -3
- package/dist/{DepositModalReown-XOLZ62BQ.mjs → DepositModalReown-Y4M3RA73.mjs} +2 -2
- package/dist/{WithdrawModalReown-TD2NYW5M.mjs → WithdrawModalReown-HVBMAUPM.mjs} +2 -2
- package/dist/{WithdrawModalReown-YBEUOYSV.cjs → WithdrawModalReown-WJ5SHBV4.cjs} +3 -3
- package/dist/{chunk-5SR5N75I.cjs → chunk-4CZ7W3RS.cjs} +75 -73
- package/dist/{chunk-TDTBAZNO.mjs → chunk-GAHX5RAT.mjs} +2 -0
- package/dist/{chunk-XVCPUB6K.mjs → chunk-IYZGLNY6.mjs} +4 -2
- package/dist/{chunk-P4ULLROO.cjs → chunk-MGV75YLV.cjs} +38 -37
- package/dist/{chunk-N3BZTUSJ.cjs → chunk-OWV4KVBM.cjs} +88 -86
- package/dist/{chunk-MYI5WSWL.mjs → chunk-RKRF7ANK.mjs} +3 -2
- 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/reown.cjs +4 -4
- package/dist/reown.mjs +3 -3
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunk4CZ7W3RScjs = require('./chunk-4CZ7W3RS.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -127,7 +127,7 @@ function WithdrawFormStep({
|
|
|
127
127
|
setIsSwitching(true);
|
|
128
128
|
switchChain(asset.chainId).catch((err) => {
|
|
129
129
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
130
|
-
setError(
|
|
130
|
+
setError(_chunk4CZ7W3RScjs.formatUserError.call(void 0, raw));
|
|
131
131
|
}).finally(() => {
|
|
132
132
|
setIsSwitching(false);
|
|
133
133
|
});
|
|
@@ -147,7 +147,7 @@ function WithdrawFormStep({
|
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
try {
|
|
150
|
-
const bal =
|
|
150
|
+
const bal = _chunk4CZ7W3RScjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
151
151
|
address: asset.token,
|
|
152
152
|
abi: _viem.erc20Abi,
|
|
153
153
|
functionName: "balanceOf",
|
|
@@ -250,7 +250,7 @@ function WithdrawFormStep({
|
|
|
250
250
|
await onSubmit(recipient, amount);
|
|
251
251
|
} catch (err) {
|
|
252
252
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
253
|
-
setError(
|
|
253
|
+
setError(_chunk4CZ7W3RScjs.formatUserError.call(void 0, raw));
|
|
254
254
|
} finally {
|
|
255
255
|
setIsSubmitting(false);
|
|
256
256
|
}
|
|
@@ -258,11 +258,11 @@ function WithdrawFormStep({
|
|
|
258
258
|
if (isBalanceLoading) {
|
|
259
259
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
260
260
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
|
|
261
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
261
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4CZ7W3RScjs.Spinner, { className: "rs-spinner--lg" }),
|
|
262
262
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
263
263
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
264
264
|
] }),
|
|
265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4CZ7W3RScjs.PoweredBy, {})
|
|
266
266
|
] });
|
|
267
267
|
}
|
|
268
268
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
@@ -361,7 +361,7 @@ function WithdrawFormStep({
|
|
|
361
361
|
] })
|
|
362
362
|
] }),
|
|
363
363
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
364
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunk4CZ7W3RScjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
365
365
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
366
366
|
"Balance: ",
|
|
367
367
|
formattedBalance,
|
|
@@ -555,7 +555,7 @@ function WithdrawFormStep({
|
|
|
555
555
|
] })
|
|
556
556
|
] }),
|
|
557
557
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
558
|
-
|
|
558
|
+
_chunk4CZ7W3RScjs.Button,
|
|
559
559
|
{
|
|
560
560
|
onClick: handleWithdraw,
|
|
561
561
|
fullWidth: true,
|
|
@@ -564,7 +564,7 @@ function WithdrawFormStep({
|
|
|
564
564
|
children: isBusy ? "Preparing..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
565
565
|
}
|
|
566
566
|
) }),
|
|
567
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
567
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4CZ7W3RScjs.PoweredBy, {})
|
|
568
568
|
] });
|
|
569
569
|
}
|
|
570
570
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -891,22 +891,22 @@ function WithdrawFlow({
|
|
|
891
891
|
onError,
|
|
892
892
|
debug
|
|
893
893
|
}) {
|
|
894
|
-
const onStepChangeRef =
|
|
895
|
-
const onTotalBalanceChangeRef =
|
|
896
|
-
const onEventRef =
|
|
894
|
+
const onStepChangeRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onStepChange);
|
|
895
|
+
const onTotalBalanceChangeRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
896
|
+
const onEventRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onEvent);
|
|
897
897
|
const [step, setStep] = _react.useState.call(void 0, { type: "form" });
|
|
898
898
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
899
899
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, 0);
|
|
900
900
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
|
|
901
901
|
const logFlow = _react.useCallback.call(void 0,
|
|
902
902
|
(message, data) => {
|
|
903
|
-
|
|
903
|
+
_chunk4CZ7W3RScjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
904
904
|
},
|
|
905
905
|
[debug]
|
|
906
906
|
);
|
|
907
907
|
const logFlowError = _react.useCallback.call(void 0,
|
|
908
908
|
(message, error, data) => {
|
|
909
|
-
|
|
909
|
+
_chunk4CZ7W3RScjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
910
910
|
},
|
|
911
911
|
[debug]
|
|
912
912
|
);
|
|
@@ -965,14 +965,14 @@ function WithdrawFlow({
|
|
|
965
965
|
return {
|
|
966
966
|
ownerAddress: dappAddress,
|
|
967
967
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
968
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
968
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain))),
|
|
969
969
|
switchChain: dappSwitchChain
|
|
970
970
|
};
|
|
971
971
|
}
|
|
972
972
|
return {
|
|
973
973
|
ownerAddress: dappWalletClient.account.address,
|
|
974
974
|
walletClient: dappWalletClient,
|
|
975
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
975
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain))),
|
|
976
976
|
switchChain: dappSwitchChain
|
|
977
977
|
};
|
|
978
978
|
}
|
|
@@ -983,7 +983,7 @@ function WithdrawFlow({
|
|
|
983
983
|
return {
|
|
984
984
|
ownerAddress: dappWalletClient.account.address,
|
|
985
985
|
walletClient: dappWalletClient,
|
|
986
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
986
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain))),
|
|
987
987
|
switchChain: dappSwitchChain
|
|
988
988
|
};
|
|
989
989
|
}
|
|
@@ -1013,7 +1013,7 @@ function WithdrawFlow({
|
|
|
1013
1013
|
const symbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1014
1014
|
const decimals = _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1015
1015
|
return {
|
|
1016
|
-
id:
|
|
1016
|
+
id: _chunk4CZ7W3RScjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1017
1017
|
chainId: sourceChain,
|
|
1018
1018
|
token: sourceToken,
|
|
1019
1019
|
symbol,
|
|
@@ -1084,15 +1084,15 @@ function WithdrawFlow({
|
|
|
1084
1084
|
[logFlowError, onError]
|
|
1085
1085
|
);
|
|
1086
1086
|
const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
|
|
1087
|
-
const localOwner =
|
|
1087
|
+
const localOwner = _chunk4CZ7W3RScjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1088
1088
|
if (localOwner) {
|
|
1089
1089
|
return {
|
|
1090
|
-
account:
|
|
1090
|
+
account: _chunk4CZ7W3RScjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1091
1091
|
address: localOwner.address
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
|
-
const created =
|
|
1095
|
-
|
|
1094
|
+
const created = _chunk4CZ7W3RScjs.createSessionOwnerKey.call(void 0, );
|
|
1095
|
+
_chunk4CZ7W3RScjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1096
1096
|
return {
|
|
1097
1097
|
account: created.account,
|
|
1098
1098
|
address: created.address
|
|
@@ -1132,8 +1132,9 @@ function WithdrawFlow({
|
|
|
1132
1132
|
const setup = await service.setupAccount({
|
|
1133
1133
|
ownerAddress: ownerAddress2,
|
|
1134
1134
|
sessionOwnerAddress: sessionOwner.address,
|
|
1135
|
-
targetChain:
|
|
1135
|
+
targetChain: _chunk4CZ7W3RScjs.toEvmCaip2.call(void 0, targetChain),
|
|
1136
1136
|
targetToken,
|
|
1137
|
+
recipient,
|
|
1137
1138
|
signerAddress,
|
|
1138
1139
|
sessionChainIds,
|
|
1139
1140
|
forceRegister
|
|
@@ -1159,7 +1160,7 @@ function WithdrawFlow({
|
|
|
1159
1160
|
primaryType: typedData.primaryType,
|
|
1160
1161
|
message: typedData.message
|
|
1161
1162
|
});
|
|
1162
|
-
const sessionDetails =
|
|
1163
|
+
const sessionDetails = _chunk4CZ7W3RScjs.buildSessionDetails.call(void 0,
|
|
1163
1164
|
setup.sessionDetailsUnsigned,
|
|
1164
1165
|
signature
|
|
1165
1166
|
);
|
|
@@ -1173,7 +1174,7 @@ function WithdrawFlow({
|
|
|
1173
1174
|
eoaAddress: ownerAddress2,
|
|
1174
1175
|
sessionOwner: sessionOwner.address,
|
|
1175
1176
|
target: {
|
|
1176
|
-
chain:
|
|
1177
|
+
chain: _chunk4CZ7W3RScjs.toEvmCaip2.call(void 0, targetChain),
|
|
1177
1178
|
token: targetToken,
|
|
1178
1179
|
recipient
|
|
1179
1180
|
}
|
|
@@ -1182,7 +1183,7 @@ function WithdrawFlow({
|
|
|
1182
1183
|
}
|
|
1183
1184
|
handleConnected(ownerAddress2, smartAccount);
|
|
1184
1185
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1185
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _31 => _31.publicClient]), () => (
|
|
1186
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _31 => _31.publicClient]), () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain)));
|
|
1186
1187
|
let result;
|
|
1187
1188
|
if (onSignTransaction) {
|
|
1188
1189
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
@@ -1205,7 +1206,7 @@ function WithdrawFlow({
|
|
|
1205
1206
|
const { signature } = await onSignTransaction(request);
|
|
1206
1207
|
const relayResult = await service.relayWithdraw({
|
|
1207
1208
|
smartAccount,
|
|
1208
|
-
chainId:
|
|
1209
|
+
chainId: _chunk4CZ7W3RScjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1209
1210
|
safeAddress,
|
|
1210
1211
|
safeTransaction: request.typedData.message,
|
|
1211
1212
|
signature
|
|
@@ -1263,7 +1264,7 @@ function WithdrawFlow({
|
|
|
1263
1264
|
targetChain,
|
|
1264
1265
|
targetToken
|
|
1265
1266
|
});
|
|
1266
|
-
handleError(
|
|
1267
|
+
handleError(_chunk4CZ7W3RScjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1267
1268
|
throw err;
|
|
1268
1269
|
} finally {
|
|
1269
1270
|
setIsSubmitting(false);
|
|
@@ -1401,7 +1402,7 @@ function WithdrawFlow({
|
|
|
1401
1402
|
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _45 => _45.icon])]);
|
|
1402
1403
|
if (showConnectStep) {
|
|
1403
1404
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
-
|
|
1405
|
+
_chunk4CZ7W3RScjs.ConnectStep,
|
|
1405
1406
|
{
|
|
1406
1407
|
walletOptions,
|
|
1407
1408
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -1422,7 +1423,7 @@ function WithdrawFlow({
|
|
|
1422
1423
|
if (!signerContext) return null;
|
|
1423
1424
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1424
1425
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _46 => _46.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1425
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1426
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain)));
|
|
1426
1427
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1427
1428
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1428
1429
|
WithdrawFormStep,
|
|
@@ -1448,7 +1449,7 @@ function WithdrawFlow({
|
|
|
1448
1449
|
}
|
|
1449
1450
|
),
|
|
1450
1451
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1451
|
-
|
|
1452
|
+
_chunk4CZ7W3RScjs.ProcessingStep,
|
|
1452
1453
|
{
|
|
1453
1454
|
smartAccount: step.smartAccount,
|
|
1454
1455
|
txHash: step.txHash,
|
|
@@ -1474,7 +1475,7 @@ function WithdrawFlow({
|
|
|
1474
1475
|
// src/WithdrawModal.tsx
|
|
1475
1476
|
|
|
1476
1477
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1477
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1478
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-WJ5SHBV4.cjs"))).then((m) => ({
|
|
1478
1479
|
default: m.WithdrawModalReown
|
|
1479
1480
|
}))
|
|
1480
1481
|
);
|
|
@@ -1527,19 +1528,19 @@ function WithdrawModalInner({
|
|
|
1527
1528
|
debug
|
|
1528
1529
|
}) {
|
|
1529
1530
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1530
|
-
const onReadyRef =
|
|
1531
|
+
const onReadyRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onReady);
|
|
1531
1532
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
1532
1533
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
1533
1534
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1534
1535
|
const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
|
|
1535
1536
|
const sourceChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp);
|
|
1536
1537
|
const service = _react.useMemo.call(void 0,
|
|
1537
|
-
() =>
|
|
1538
|
+
() => _chunk4CZ7W3RScjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1538
1539
|
[backendUrl, debug]
|
|
1539
1540
|
);
|
|
1540
1541
|
_react.useEffect.call(void 0, () => {
|
|
1541
1542
|
if (isOpen && modalRef.current) {
|
|
1542
|
-
|
|
1543
|
+
_chunk4CZ7W3RScjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1543
1544
|
}
|
|
1544
1545
|
}, [isOpen, theme]);
|
|
1545
1546
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -1575,7 +1576,7 @@ function WithdrawModalInner({
|
|
|
1575
1576
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _56 => _56.title]), () => ( "Withdraw"));
|
|
1576
1577
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1577
1578
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1578
|
-
|
|
1579
|
+
_chunk4CZ7W3RScjs.Modal,
|
|
1579
1580
|
{
|
|
1580
1581
|
isOpen,
|
|
1581
1582
|
onClose,
|
|
@@ -1634,7 +1635,7 @@ function WithdrawModalInner({
|
|
|
1634
1635
|
] }),
|
|
1635
1636
|
balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1636
1637
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
|
|
1637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
1638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunk4CZ7W3RScjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
1638
1639
|
] })
|
|
1639
1640
|
] }),
|
|
1640
1641
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|