@rhinestone/deposit-modal 0.1.23 → 0.1.25
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-YTWIR7A4.mjs → DepositModalReown-4A5HJK74.mjs} +2 -2
- package/dist/{DepositModalReown-324WTBDE.cjs → DepositModalReown-QQ6WI265.cjs} +3 -3
- package/dist/{WithdrawModalReown-ICP3DH6Q.mjs → WithdrawModalReown-HBORIX2O.mjs} +2 -2
- package/dist/{WithdrawModalReown-ZNTE2G6W.cjs → WithdrawModalReown-L77OC26X.cjs} +3 -3
- package/dist/{chunk-V6HZJZOL.cjs → chunk-4QDHXCPG.cjs} +52 -41
- package/dist/{chunk-J7UK4L5T.mjs → chunk-B3HMNWR4.mjs} +22 -11
- package/dist/{chunk-BO745KAB.cjs → chunk-CZWAKYDR.cjs} +34 -0
- package/dist/{chunk-JBT2ZV3Q.mjs → chunk-GAFLOODV.mjs} +34 -0
- package/dist/{chunk-N2LJOFT2.mjs → chunk-JAR372KJ.mjs} +2 -2
- package/dist/{chunk-W7ZYJB2X.cjs → chunk-VBNFP3JF.cjs} +50 -50
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +12 -0
- package/dist/reown.d.cts +6 -0
- package/dist/reown.d.ts +6 -0
- package/dist/reown.mjs +12 -0
- package/dist/{types-D_xeOU8G.d.cts → types-BwaQ7jK5.d.cts} +2 -2
- package/dist/{types-DnGF9RJJ.d.ts → types-CgXyx46m.d.ts} +2 -2
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +6 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JAR372KJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-LBEP3A2Z.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-GAFLOODV.mjs";
|
|
9
9
|
import "./chunk-A6QLADED.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVBNFP3JFcjs = require('./chunk-VBNFP3JF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk6VJ2ZTNQcjs = require('./chunk-6VJ2ZTNQ.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
9
9
|
require('./chunk-CEIWN53N.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
@@ -17,7 +17,7 @@ function DepositModalWithReown(props) {
|
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
19
19
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
20
|
-
|
|
20
|
+
_chunkVBNFP3JFcjs.DepositModalInner,
|
|
21
21
|
{
|
|
22
22
|
...props,
|
|
23
23
|
reownWallet: reown,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B3HMNWR4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-LBEP3A2Z.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-GAFLOODV.mjs";
|
|
9
9
|
import "./chunk-A6QLADED.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4QDHXCPGcjs = require('./chunk-4QDHXCPG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk6VJ2ZTNQcjs = require('./chunk-6VJ2ZTNQ.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
9
9
|
require('./chunk-CEIWN53N.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
@@ -17,7 +17,7 @@ function WithdrawModalWithReown(props) {
|
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
19
19
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
20
|
-
|
|
20
|
+
_chunk4QDHXCPGcjs.WithdrawModalInner,
|
|
21
21
|
{
|
|
22
22
|
...props,
|
|
23
23
|
reownWallet: reown,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkCZWAKYDRcjs = require('./chunk-CZWAKYDR.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -115,7 +115,7 @@ function WithdrawFormStep({
|
|
|
115
115
|
setIsSwitching(true);
|
|
116
116
|
switchChain(asset.chainId).catch((err) => {
|
|
117
117
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
118
|
-
setError(
|
|
118
|
+
setError(_chunkCZWAKYDRcjs.formatUserError.call(void 0, raw));
|
|
119
119
|
}).finally(() => {
|
|
120
120
|
setIsSwitching(false);
|
|
121
121
|
});
|
|
@@ -132,7 +132,7 @@ function WithdrawFormStep({
|
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
try {
|
|
135
|
-
const bal =
|
|
135
|
+
const bal = _chunkCZWAKYDRcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
136
136
|
address: asset.token,
|
|
137
137
|
abi: _viem.erc20Abi,
|
|
138
138
|
functionName: "balanceOf",
|
|
@@ -234,7 +234,7 @@ function WithdrawFormStep({
|
|
|
234
234
|
await onSubmit(recipient, amount);
|
|
235
235
|
} catch (err) {
|
|
236
236
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
237
|
-
setError(
|
|
237
|
+
setError(_chunkCZWAKYDRcjs.formatUserError.call(void 0, raw));
|
|
238
238
|
} finally {
|
|
239
239
|
setIsSubmitting(false);
|
|
240
240
|
}
|
|
@@ -246,7 +246,7 @@ function WithdrawFormStep({
|
|
|
246
246
|
await switchChain(asset.chainId);
|
|
247
247
|
} catch (err) {
|
|
248
248
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
249
|
-
setError(
|
|
249
|
+
setError(_chunkCZWAKYDRcjs.formatUserError.call(void 0, raw));
|
|
250
250
|
} finally {
|
|
251
251
|
setIsSwitching(false);
|
|
252
252
|
}
|
|
@@ -336,7 +336,7 @@ function WithdrawFormStep({
|
|
|
336
336
|
] })
|
|
337
337
|
] }),
|
|
338
338
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkCZWAKYDRcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
340
340
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
341
341
|
formattedBalance,
|
|
342
342
|
" ",
|
|
@@ -513,7 +513,7 @@ function WithdrawFormStep({
|
|
|
513
513
|
" to continue."
|
|
514
514
|
] }),
|
|
515
515
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
516
|
+
_chunkCZWAKYDRcjs.Button,
|
|
517
517
|
{
|
|
518
518
|
variant: "outline",
|
|
519
519
|
size: "small",
|
|
@@ -545,7 +545,7 @@ function WithdrawFormStep({
|
|
|
545
545
|
] })
|
|
546
546
|
] }),
|
|
547
547
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
548
|
-
|
|
548
|
+
_chunkCZWAKYDRcjs.Button,
|
|
549
549
|
{
|
|
550
550
|
onClick: handleWithdraw,
|
|
551
551
|
fullWidth: true,
|
|
@@ -554,7 +554,7 @@ function WithdrawFormStep({
|
|
|
554
554
|
children: isBusy ? "Preparing..." : "Withdraw"
|
|
555
555
|
}
|
|
556
556
|
) }),
|
|
557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.PoweredBy, {})
|
|
558
558
|
] });
|
|
559
559
|
}
|
|
560
560
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -869,7 +869,7 @@ function WithdrawFlow({
|
|
|
869
869
|
waitForFinalTx = true,
|
|
870
870
|
reownWallet,
|
|
871
871
|
onConnect,
|
|
872
|
-
|
|
872
|
+
onSignTransaction,
|
|
873
873
|
onRequestConnect,
|
|
874
874
|
connectButtonLabel,
|
|
875
875
|
onStepChange,
|
|
@@ -893,7 +893,7 @@ function WithdrawFlow({
|
|
|
893
893
|
setTargetToken(targetTokenProp);
|
|
894
894
|
}, [targetChainProp, targetTokenProp]);
|
|
895
895
|
const targetChainObj = _react.useMemo.call(void 0, () => _chunkCEIWN53Ncjs.CHAIN_BY_ID[targetChain], [targetChain]);
|
|
896
|
-
const hasCustomSigner = Boolean(dappAddress &&
|
|
896
|
+
const hasCustomSigner = Boolean(dappAddress && onSignTransaction);
|
|
897
897
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
898
898
|
if (!_optionalChain([dappWalletClient, 'optionalAccess', _6 => _6.switchChain])) return void 0;
|
|
899
899
|
return async (chainId) => {
|
|
@@ -933,14 +933,14 @@ function WithdrawFlow({
|
|
|
933
933
|
return {
|
|
934
934
|
ownerAddress: dappAddress,
|
|
935
935
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
936
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
936
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, sourceChain))),
|
|
937
937
|
switchChain: dappSwitchChain
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
940
|
return {
|
|
941
941
|
ownerAddress: dappWalletClient.account.address,
|
|
942
942
|
walletClient: dappWalletClient,
|
|
943
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
943
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, sourceChain))),
|
|
944
944
|
switchChain: dappSwitchChain
|
|
945
945
|
};
|
|
946
946
|
}
|
|
@@ -949,7 +949,7 @@ function WithdrawFlow({
|
|
|
949
949
|
return {
|
|
950
950
|
ownerAddress: dappWalletClient.account.address,
|
|
951
951
|
walletClient: dappWalletClient,
|
|
952
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
952
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, sourceChain))),
|
|
953
953
|
switchChain: dappSwitchChain
|
|
954
954
|
};
|
|
955
955
|
}
|
|
@@ -978,7 +978,7 @@ function WithdrawFlow({
|
|
|
978
978
|
const symbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
979
979
|
const decimals = _chunkCEIWN53Ncjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
980
980
|
return {
|
|
981
|
-
id:
|
|
981
|
+
id: _chunkCZWAKYDRcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
982
982
|
chainId: sourceChain,
|
|
983
983
|
token: sourceToken,
|
|
984
984
|
symbol,
|
|
@@ -1008,15 +1008,15 @@ function WithdrawFlow({
|
|
|
1008
1008
|
[onError]
|
|
1009
1009
|
);
|
|
1010
1010
|
const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
|
|
1011
|
-
const localOwner =
|
|
1011
|
+
const localOwner = _chunkCZWAKYDRcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1012
1012
|
if (localOwner) {
|
|
1013
1013
|
return {
|
|
1014
|
-
account:
|
|
1014
|
+
account: _chunkCZWAKYDRcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1015
1015
|
address: localOwner.address
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
|
-
const created =
|
|
1019
|
-
|
|
1018
|
+
const created = _chunkCZWAKYDRcjs.createSessionOwnerKey.call(void 0, );
|
|
1019
|
+
_chunkCZWAKYDRcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1020
1020
|
return {
|
|
1021
1021
|
account: created.account,
|
|
1022
1022
|
address: created.address
|
|
@@ -1028,7 +1028,7 @@ function WithdrawFlow({
|
|
|
1028
1028
|
if (!ownerAddress2) {
|
|
1029
1029
|
throw new Error("Wallet not connected");
|
|
1030
1030
|
}
|
|
1031
|
-
if (!
|
|
1031
|
+
if (!onSignTransaction && !_optionalChain([signerContext, 'optionalAccess', _23 => _23.walletClient])) {
|
|
1032
1032
|
throw new Error("Wallet not connected");
|
|
1033
1033
|
}
|
|
1034
1034
|
if (!targetChainObj) {
|
|
@@ -1036,19 +1036,19 @@ function WithdrawFlow({
|
|
|
1036
1036
|
}
|
|
1037
1037
|
setIsSubmitting(true);
|
|
1038
1038
|
try {
|
|
1039
|
-
const signerAccount = _optionalChain([signerContext, 'optionalAccess', _24 => _24.walletClient]) ? _sdk.walletClientToAccount.call(void 0, signerContext.walletClient) :
|
|
1039
|
+
const signerAccount = _optionalChain([signerContext, 'optionalAccess', _24 => _24.walletClient]) ? _sdk.walletClientToAccount.call(void 0, signerContext.walletClient) : _chunkCZWAKYDRcjs.createViewOnlyAccount.call(void 0, ownerAddress2);
|
|
1040
1040
|
const sessionOwner = await resolveSessionOwner(ownerAddress2);
|
|
1041
|
-
const account = await
|
|
1041
|
+
const account = await _chunkCZWAKYDRcjs.createSmartAccount.call(void 0,
|
|
1042
1042
|
signerAccount,
|
|
1043
1043
|
sessionOwner.account,
|
|
1044
1044
|
rhinestoneApiKey
|
|
1045
1045
|
);
|
|
1046
|
-
const smartAccount =
|
|
1046
|
+
const smartAccount = _chunkCZWAKYDRcjs.getAccountAddress.call(void 0, account);
|
|
1047
1047
|
const checkResult = await service.checkAccount(smartAccount);
|
|
1048
1048
|
const targetMatches = checkResult.targetChain === targetChain && _optionalChain([checkResult, 'access', _25 => _25.targetToken, 'optionalAccess', _26 => _26.toLowerCase, 'call', _27 => _27()]) === targetToken.toLowerCase();
|
|
1049
1049
|
if (!checkResult.isRegistered || forceRegister || !targetMatches) {
|
|
1050
|
-
const initData =
|
|
1051
|
-
const sessionDetails = await
|
|
1050
|
+
const initData = _chunkCZWAKYDRcjs.getAccountInitData.call(void 0, account);
|
|
1051
|
+
const sessionDetails = await _chunkCZWAKYDRcjs.getSessionDetails.call(void 0,
|
|
1052
1052
|
account,
|
|
1053
1053
|
targetChainObj,
|
|
1054
1054
|
signerAddress,
|
|
@@ -1074,9 +1074,9 @@ function WithdrawFlow({
|
|
|
1074
1074
|
}
|
|
1075
1075
|
handleConnected(ownerAddress2, smartAccount);
|
|
1076
1076
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1077
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _28 => _28.publicClient]), () => (
|
|
1077
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _28 => _28.publicClient]), () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1078
1078
|
let result;
|
|
1079
|
-
if (
|
|
1079
|
+
if (onSignTransaction) {
|
|
1080
1080
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
1081
1081
|
to: sourceToken,
|
|
1082
1082
|
value: 0n,
|
|
@@ -1094,7 +1094,18 @@ function WithdrawFlow({
|
|
|
1094
1094
|
data: transferData.data,
|
|
1095
1095
|
chainId: sourceChain
|
|
1096
1096
|
});
|
|
1097
|
-
|
|
1097
|
+
const { signature } = await onSignTransaction(request);
|
|
1098
|
+
const relayResult = await service.relayWithdraw({
|
|
1099
|
+
smartAccount,
|
|
1100
|
+
chainId: sourceChain,
|
|
1101
|
+
safeAddress,
|
|
1102
|
+
safeTransaction: request.typedData.message,
|
|
1103
|
+
signature
|
|
1104
|
+
});
|
|
1105
|
+
if (!relayResult.txHash) {
|
|
1106
|
+
throw new Error("Relay succeeded but no txHash returned");
|
|
1107
|
+
}
|
|
1108
|
+
result = { txHash: relayResult.txHash };
|
|
1098
1109
|
} else if (isSourceNative) {
|
|
1099
1110
|
result = await executeSafeEthTransfer({
|
|
1100
1111
|
walletClient: signerContext.walletClient,
|
|
@@ -1131,7 +1142,7 @@ function WithdrawFlow({
|
|
|
1131
1142
|
});
|
|
1132
1143
|
} catch (err) {
|
|
1133
1144
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
1134
|
-
handleError(
|
|
1145
|
+
handleError(_chunkCZWAKYDRcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1135
1146
|
throw err;
|
|
1136
1147
|
} finally {
|
|
1137
1148
|
setIsSubmitting(false);
|
|
@@ -1154,7 +1165,7 @@ function WithdrawFlow({
|
|
|
1154
1165
|
sourceToken,
|
|
1155
1166
|
sourceChain,
|
|
1156
1167
|
onWithdrawSubmitted,
|
|
1157
|
-
|
|
1168
|
+
onSignTransaction,
|
|
1158
1169
|
isSourceNative,
|
|
1159
1170
|
handleError
|
|
1160
1171
|
]
|
|
@@ -1225,7 +1236,7 @@ function WithdrawFlow({
|
|
|
1225
1236
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1226
1237
|
if (showConnectStep) {
|
|
1227
1238
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1228
|
-
|
|
1239
|
+
_chunkCZWAKYDRcjs.ConnectStep,
|
|
1229
1240
|
{
|
|
1230
1241
|
walletOptions,
|
|
1231
1242
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1243,9 +1254,9 @@ function WithdrawFlow({
|
|
|
1243
1254
|
) });
|
|
1244
1255
|
}
|
|
1245
1256
|
if (!signerContext) return null;
|
|
1246
|
-
if (!
|
|
1257
|
+
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1247
1258
|
const ownerAddress = signerContext.ownerAddress;
|
|
1248
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1259
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1249
1260
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1250
1261
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1251
1262
|
WithdrawFormStep,
|
|
@@ -1270,7 +1281,7 @@ function WithdrawFlow({
|
|
|
1270
1281
|
}
|
|
1271
1282
|
),
|
|
1272
1283
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1273
|
-
|
|
1284
|
+
_chunkCZWAKYDRcjs.ProcessingStep,
|
|
1274
1285
|
{
|
|
1275
1286
|
smartAccount: step.smartAccount,
|
|
1276
1287
|
txHash: step.txHash,
|
|
@@ -1296,7 +1307,7 @@ function WithdrawFlow({
|
|
|
1296
1307
|
// src/WithdrawModal.tsx
|
|
1297
1308
|
|
|
1298
1309
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1299
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1310
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-L77OC26X.cjs"))).then((m) => ({
|
|
1300
1311
|
default: m.WithdrawModalReown
|
|
1301
1312
|
}))
|
|
1302
1313
|
);
|
|
@@ -1330,7 +1341,7 @@ function WithdrawModalInner({
|
|
|
1330
1341
|
waitForFinalTx = true,
|
|
1331
1342
|
reownWallet,
|
|
1332
1343
|
onConnect,
|
|
1333
|
-
|
|
1344
|
+
onSignTransaction,
|
|
1334
1345
|
onRequestConnect,
|
|
1335
1346
|
connectButtonLabel,
|
|
1336
1347
|
theme,
|
|
@@ -1351,10 +1362,10 @@ function WithdrawModalInner({
|
|
|
1351
1362
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1352
1363
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
1353
1364
|
const sourceChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp);
|
|
1354
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
1365
|
+
const service = _react.useMemo.call(void 0, () => _chunkCZWAKYDRcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
1355
1366
|
_react.useEffect.call(void 0, () => {
|
|
1356
1367
|
if (isOpen && modalRef.current) {
|
|
1357
|
-
|
|
1368
|
+
_chunkCZWAKYDRcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1358
1369
|
}
|
|
1359
1370
|
}, [isOpen, theme]);
|
|
1360
1371
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -1390,7 +1401,7 @@ function WithdrawModalInner({
|
|
|
1390
1401
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _40 => _40.title]), () => ( "Withdraw"));
|
|
1391
1402
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1392
1403
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
|
|
1404
|
+
_chunkCZWAKYDRcjs.Modal,
|
|
1394
1405
|
{
|
|
1395
1406
|
isOpen,
|
|
1396
1407
|
onClose,
|
|
@@ -1448,7 +1459,7 @@ function WithdrawModalInner({
|
|
|
1448
1459
|
] }),
|
|
1449
1460
|
balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1450
1461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balanceTitle }),
|
|
1451
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
1462
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _chunkCZWAKYDRcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
1452
1463
|
] })
|
|
1453
1464
|
] }),
|
|
1454
1465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1499,7 +1510,7 @@ function WithdrawModalInner({
|
|
|
1499
1510
|
waitForFinalTx,
|
|
1500
1511
|
reownWallet,
|
|
1501
1512
|
onConnect,
|
|
1502
|
-
|
|
1513
|
+
onSignTransaction,
|
|
1503
1514
|
onRequestConnect,
|
|
1504
1515
|
connectButtonLabel,
|
|
1505
1516
|
onStepChange: handleStepChange,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isNativeAsset,
|
|
21
21
|
loadSessionOwnerFromStorage,
|
|
22
22
|
saveSessionOwnerToStorage
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GAFLOODV.mjs";
|
|
24
24
|
import {
|
|
25
25
|
CHAIN_BY_ID,
|
|
26
26
|
DEFAULT_BACKEND_URL,
|
|
@@ -869,7 +869,7 @@ function WithdrawFlow({
|
|
|
869
869
|
waitForFinalTx = true,
|
|
870
870
|
reownWallet,
|
|
871
871
|
onConnect,
|
|
872
|
-
|
|
872
|
+
onSignTransaction,
|
|
873
873
|
onRequestConnect,
|
|
874
874
|
connectButtonLabel,
|
|
875
875
|
onStepChange,
|
|
@@ -893,7 +893,7 @@ function WithdrawFlow({
|
|
|
893
893
|
setTargetToken(targetTokenProp);
|
|
894
894
|
}, [targetChainProp, targetTokenProp]);
|
|
895
895
|
const targetChainObj = useMemo2(() => CHAIN_BY_ID[targetChain], [targetChain]);
|
|
896
|
-
const hasCustomSigner = Boolean(dappAddress &&
|
|
896
|
+
const hasCustomSigner = Boolean(dappAddress && onSignTransaction);
|
|
897
897
|
const dappSwitchChain = useMemo2(() => {
|
|
898
898
|
if (!dappWalletClient?.switchChain) return void 0;
|
|
899
899
|
return async (chainId) => {
|
|
@@ -1028,7 +1028,7 @@ function WithdrawFlow({
|
|
|
1028
1028
|
if (!ownerAddress2) {
|
|
1029
1029
|
throw new Error("Wallet not connected");
|
|
1030
1030
|
}
|
|
1031
|
-
if (!
|
|
1031
|
+
if (!onSignTransaction && !signerContext?.walletClient) {
|
|
1032
1032
|
throw new Error("Wallet not connected");
|
|
1033
1033
|
}
|
|
1034
1034
|
if (!targetChainObj) {
|
|
@@ -1076,7 +1076,7 @@ function WithdrawFlow({
|
|
|
1076
1076
|
const amountUnits = parseUnits2(amountValue, asset.decimals);
|
|
1077
1077
|
const pc = signerContext?.publicClient ?? getPublicClient(sourceChain);
|
|
1078
1078
|
let result;
|
|
1079
|
-
if (
|
|
1079
|
+
if (onSignTransaction) {
|
|
1080
1080
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
1081
1081
|
to: sourceToken,
|
|
1082
1082
|
value: 0n,
|
|
@@ -1094,7 +1094,18 @@ function WithdrawFlow({
|
|
|
1094
1094
|
data: transferData.data,
|
|
1095
1095
|
chainId: sourceChain
|
|
1096
1096
|
});
|
|
1097
|
-
|
|
1097
|
+
const { signature } = await onSignTransaction(request);
|
|
1098
|
+
const relayResult = await service.relayWithdraw({
|
|
1099
|
+
smartAccount,
|
|
1100
|
+
chainId: sourceChain,
|
|
1101
|
+
safeAddress,
|
|
1102
|
+
safeTransaction: request.typedData.message,
|
|
1103
|
+
signature
|
|
1104
|
+
});
|
|
1105
|
+
if (!relayResult.txHash) {
|
|
1106
|
+
throw new Error("Relay succeeded but no txHash returned");
|
|
1107
|
+
}
|
|
1108
|
+
result = { txHash: relayResult.txHash };
|
|
1098
1109
|
} else if (isSourceNative) {
|
|
1099
1110
|
result = await executeSafeEthTransfer({
|
|
1100
1111
|
walletClient: signerContext.walletClient,
|
|
@@ -1154,7 +1165,7 @@ function WithdrawFlow({
|
|
|
1154
1165
|
sourceToken,
|
|
1155
1166
|
sourceChain,
|
|
1156
1167
|
onWithdrawSubmitted,
|
|
1157
|
-
|
|
1168
|
+
onSignTransaction,
|
|
1158
1169
|
isSourceNative,
|
|
1159
1170
|
handleError
|
|
1160
1171
|
]
|
|
@@ -1243,7 +1254,7 @@ function WithdrawFlow({
|
|
|
1243
1254
|
) });
|
|
1244
1255
|
}
|
|
1245
1256
|
if (!signerContext) return null;
|
|
1246
|
-
if (!
|
|
1257
|
+
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1247
1258
|
const ownerAddress = signerContext.ownerAddress;
|
|
1248
1259
|
const formPublicClient = signerContext.publicClient ?? getPublicClient(sourceChain);
|
|
1249
1260
|
return /* @__PURE__ */ jsxs2("div", { className: "rs-modal-body", children: [
|
|
@@ -1296,7 +1307,7 @@ function WithdrawFlow({
|
|
|
1296
1307
|
// src/WithdrawModal.tsx
|
|
1297
1308
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1298
1309
|
var ReownWithdrawInner = lazy(
|
|
1299
|
-
() => import("./WithdrawModalReown-
|
|
1310
|
+
() => import("./WithdrawModalReown-HBORIX2O.mjs").then((m) => ({
|
|
1300
1311
|
default: m.WithdrawModalReown
|
|
1301
1312
|
}))
|
|
1302
1313
|
);
|
|
@@ -1330,7 +1341,7 @@ function WithdrawModalInner({
|
|
|
1330
1341
|
waitForFinalTx = true,
|
|
1331
1342
|
reownWallet,
|
|
1332
1343
|
onConnect,
|
|
1333
|
-
|
|
1344
|
+
onSignTransaction,
|
|
1334
1345
|
onRequestConnect,
|
|
1335
1346
|
connectButtonLabel,
|
|
1336
1347
|
theme,
|
|
@@ -1499,7 +1510,7 @@ function WithdrawModalInner({
|
|
|
1499
1510
|
waitForFinalTx,
|
|
1500
1511
|
reownWallet,
|
|
1501
1512
|
onConnect,
|
|
1502
|
-
|
|
1513
|
+
onSignTransaction,
|
|
1503
1514
|
onRequestConnect,
|
|
1504
1515
|
connectButtonLabel,
|
|
1505
1516
|
onStepChange: handleStepChange,
|
|
@@ -233,6 +233,40 @@ function createDepositService(baseUrl) {
|
|
|
233
233
|
return { lastEvent: void 0 };
|
|
234
234
|
}
|
|
235
235
|
return response.json();
|
|
236
|
+
},
|
|
237
|
+
async relayWithdraw(params) {
|
|
238
|
+
const { smartAccount, chainId, safeAddress, safeTransaction, signature } = params;
|
|
239
|
+
const response = await fetch(apiUrl(`/relay-withdraw`), {
|
|
240
|
+
method: "POST",
|
|
241
|
+
headers: { "Content-Type": "application/json" },
|
|
242
|
+
body: JSON.stringify(
|
|
243
|
+
{
|
|
244
|
+
chainId,
|
|
245
|
+
safeAddress,
|
|
246
|
+
safeTransaction: {
|
|
247
|
+
to: safeTransaction.to,
|
|
248
|
+
value: safeTransaction.value.toString(),
|
|
249
|
+
data: safeTransaction.data,
|
|
250
|
+
operation: safeTransaction.operation,
|
|
251
|
+
safeTxGas: safeTransaction.safeTxGas.toString(),
|
|
252
|
+
baseGas: safeTransaction.baseGas.toString(),
|
|
253
|
+
gasPrice: safeTransaction.gasPrice.toString(),
|
|
254
|
+
gasToken: safeTransaction.gasToken,
|
|
255
|
+
refundReceiver: safeTransaction.refundReceiver,
|
|
256
|
+
nonce: safeTransaction.nonce.toString()
|
|
257
|
+
},
|
|
258
|
+
signature
|
|
259
|
+
},
|
|
260
|
+
jsonReplacer
|
|
261
|
+
)
|
|
262
|
+
});
|
|
263
|
+
if (!response.ok) {
|
|
264
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
265
|
+
throw new Error(
|
|
266
|
+
error.error || `Relay withdraw failed: ${response.status}`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
return response.json();
|
|
236
270
|
}
|
|
237
271
|
};
|
|
238
272
|
}
|
|
@@ -233,6 +233,40 @@ function createDepositService(baseUrl) {
|
|
|
233
233
|
return { lastEvent: void 0 };
|
|
234
234
|
}
|
|
235
235
|
return response.json();
|
|
236
|
+
},
|
|
237
|
+
async relayWithdraw(params) {
|
|
238
|
+
const { smartAccount, chainId, safeAddress, safeTransaction, signature } = params;
|
|
239
|
+
const response = await fetch(apiUrl(`/relay-withdraw`), {
|
|
240
|
+
method: "POST",
|
|
241
|
+
headers: { "Content-Type": "application/json" },
|
|
242
|
+
body: JSON.stringify(
|
|
243
|
+
{
|
|
244
|
+
chainId,
|
|
245
|
+
safeAddress,
|
|
246
|
+
safeTransaction: {
|
|
247
|
+
to: safeTransaction.to,
|
|
248
|
+
value: safeTransaction.value.toString(),
|
|
249
|
+
data: safeTransaction.data,
|
|
250
|
+
operation: safeTransaction.operation,
|
|
251
|
+
safeTxGas: safeTransaction.safeTxGas.toString(),
|
|
252
|
+
baseGas: safeTransaction.baseGas.toString(),
|
|
253
|
+
gasPrice: safeTransaction.gasPrice.toString(),
|
|
254
|
+
gasToken: safeTransaction.gasToken,
|
|
255
|
+
refundReceiver: safeTransaction.refundReceiver,
|
|
256
|
+
nonce: safeTransaction.nonce.toString()
|
|
257
|
+
},
|
|
258
|
+
signature
|
|
259
|
+
},
|
|
260
|
+
jsonReplacer
|
|
261
|
+
)
|
|
262
|
+
});
|
|
263
|
+
if (!response.ok) {
|
|
264
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
265
|
+
throw new Error(
|
|
266
|
+
error.error || `Relay withdraw failed: ${response.status}`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
return response.json();
|
|
236
270
|
}
|
|
237
271
|
};
|
|
238
272
|
}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
portfolioToAssets,
|
|
26
26
|
saveSessionOwnerToStorage,
|
|
27
27
|
tokenFormatter
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GAFLOODV.mjs";
|
|
29
29
|
import {
|
|
30
30
|
CHAIN_BY_ID,
|
|
31
31
|
DEFAULT_BACKEND_URL,
|
|
@@ -2120,7 +2120,7 @@ function DepositFlow({
|
|
|
2120
2120
|
// src/DepositModal.tsx
|
|
2121
2121
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2122
2122
|
var ReownDepositInner = lazy(
|
|
2123
|
-
() => import("./DepositModalReown-
|
|
2123
|
+
() => import("./DepositModalReown-4A5HJK74.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
2124
2124
|
);
|
|
2125
2125
|
function DepositModal(props) {
|
|
2126
2126
|
const needsReown = !!props.reownAppId;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkCZWAKYDRcjs = require('./chunk-CZWAKYDR.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -62,15 +62,15 @@ var _react = require('react');
|
|
|
62
62
|
var _sdk = require('@rhinestone/sdk');
|
|
63
63
|
var _jsxruntime = require('react/jsx-runtime');
|
|
64
64
|
async function resolveSessionOwner(eoaAddress) {
|
|
65
|
-
const localOwner =
|
|
65
|
+
const localOwner = _chunkCZWAKYDRcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
66
66
|
if (localOwner) {
|
|
67
67
|
return {
|
|
68
|
-
account:
|
|
68
|
+
account: _chunkCZWAKYDRcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
69
69
|
address: localOwner.address
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const created =
|
|
73
|
-
|
|
72
|
+
const created = _chunkCZWAKYDRcjs.createSessionOwnerKey.call(void 0, );
|
|
73
|
+
_chunkCZWAKYDRcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
74
74
|
return {
|
|
75
75
|
account: created.account,
|
|
76
76
|
address: created.address
|
|
@@ -103,14 +103,14 @@ function SetupStep({
|
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
105
|
setState({ type: "creating-account" });
|
|
106
|
-
const signerAccount = walletClient ? _sdk.walletClientToAccount.call(void 0, walletClient) :
|
|
106
|
+
const signerAccount = walletClient ? _sdk.walletClientToAccount.call(void 0, walletClient) : _chunkCZWAKYDRcjs.createViewOnlyAccount.call(void 0, address);
|
|
107
107
|
const sessionOwner = await resolveSessionOwner(address);
|
|
108
|
-
const account = await
|
|
108
|
+
const account = await _chunkCZWAKYDRcjs.createSmartAccount.call(void 0,
|
|
109
109
|
signerAccount,
|
|
110
110
|
sessionOwner.account,
|
|
111
111
|
rhinestoneApiKey
|
|
112
112
|
);
|
|
113
|
-
const smartAccount =
|
|
113
|
+
const smartAccount = _chunkCZWAKYDRcjs.getAccountAddress.call(void 0, account);
|
|
114
114
|
setState({ type: "checking" });
|
|
115
115
|
const checkResult = await service.checkAccount(smartAccount);
|
|
116
116
|
if (checkResult.isRegistered && !forceRegister) {
|
|
@@ -123,8 +123,8 @@ function SetupStep({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
setState({ type: "signing-session" });
|
|
126
|
-
const initData =
|
|
127
|
-
const sessionDetails = await
|
|
126
|
+
const initData = _chunkCZWAKYDRcjs.getAccountInitData.call(void 0, account);
|
|
127
|
+
const sessionDetails = await _chunkCZWAKYDRcjs.getSessionDetails.call(void 0,
|
|
128
128
|
account,
|
|
129
129
|
targetChainObj,
|
|
130
130
|
signerAddress,
|
|
@@ -206,7 +206,7 @@ function SetupStep({
|
|
|
206
206
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
207
207
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
208
208
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
210
210
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
211
211
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
212
212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -243,7 +243,7 @@ function SetupStep({
|
|
|
243
243
|
] })
|
|
244
244
|
] })
|
|
245
245
|
] }),
|
|
246
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
246
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
247
247
|
] });
|
|
248
248
|
}
|
|
249
249
|
|
|
@@ -266,7 +266,7 @@ function AssetSelectStep({
|
|
|
266
266
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
267
267
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
268
268
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
269
|
-
return
|
|
269
|
+
return _chunkCZWAKYDRcjs.getAssetId.call(void 0, {
|
|
270
270
|
chainId: defaultSourceChain,
|
|
271
271
|
token: defaultSourceToken
|
|
272
272
|
});
|
|
@@ -283,7 +283,7 @@ function AssetSelectStep({
|
|
|
283
283
|
try {
|
|
284
284
|
const portfolio = await service.fetchPortfolio(address);
|
|
285
285
|
if (!active) return;
|
|
286
|
-
const portfolioAssets =
|
|
286
|
+
const portfolioAssets = _chunkCZWAKYDRcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
287
287
|
setAssets(portfolioAssets);
|
|
288
288
|
const hasNative = portfolioAssets.some(
|
|
289
289
|
(asset) => asset.token.toLowerCase() === _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -351,7 +351,7 @@ function AssetSelectStep({
|
|
|
351
351
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
352
352
|
const numeric = Number(raw);
|
|
353
353
|
if (!Number.isFinite(numeric)) return raw;
|
|
354
|
-
return
|
|
354
|
+
return _chunkCZWAKYDRcjs.tokenFormatter.format(numeric);
|
|
355
355
|
} catch (e3) {
|
|
356
356
|
return asset.balance;
|
|
357
357
|
}
|
|
@@ -365,7 +365,7 @@ function AssetSelectStep({
|
|
|
365
365
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
366
366
|
children: [
|
|
367
367
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
368
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
368
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
369
369
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
370
370
|
] }),
|
|
371
371
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error }) }),
|
|
@@ -455,7 +455,7 @@ function AssetSelectStep({
|
|
|
455
455
|
] })
|
|
456
456
|
] })
|
|
457
457
|
] }),
|
|
458
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ?
|
|
458
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ? _chunkCZWAKYDRcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
459
459
|
]
|
|
460
460
|
},
|
|
461
461
|
asset.id
|
|
@@ -465,7 +465,7 @@ function AssetSelectStep({
|
|
|
465
465
|
}
|
|
466
466
|
),
|
|
467
467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
468
|
-
|
|
468
|
+
_chunkCZWAKYDRcjs.Button,
|
|
469
469
|
{
|
|
470
470
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
471
471
|
disabled: !selectedAsset,
|
|
@@ -473,7 +473,7 @@ function AssetSelectStep({
|
|
|
473
473
|
children: "Continue"
|
|
474
474
|
}
|
|
475
475
|
) }),
|
|
476
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
476
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.PoweredBy, {})
|
|
477
477
|
] });
|
|
478
478
|
}
|
|
479
479
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -481,7 +481,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
481
481
|
const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
|
|
482
482
|
if (!connectedChainId) return [];
|
|
483
483
|
if (!_chunkCEIWN53Ncjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
484
|
-
const id =
|
|
484
|
+
const id = _chunkCZWAKYDRcjs.getAssetId.call(void 0, {
|
|
485
485
|
chainId: connectedChainId,
|
|
486
486
|
token: _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
487
487
|
});
|
|
@@ -561,7 +561,7 @@ function AmountStep({
|
|
|
561
561
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
562
562
|
if (!balanceTarget || !publicClient) return;
|
|
563
563
|
try {
|
|
564
|
-
const bal =
|
|
564
|
+
const bal = _chunkCZWAKYDRcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
565
565
|
address: asset.token,
|
|
566
566
|
abi: _viem.erc20Abi,
|
|
567
567
|
functionName: "balanceOf",
|
|
@@ -622,7 +622,7 @@ function AmountStep({
|
|
|
622
622
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
623
623
|
const numeric = Number(raw);
|
|
624
624
|
if (!Number.isFinite(numeric)) return raw;
|
|
625
|
-
return
|
|
625
|
+
return _chunkCZWAKYDRcjs.tokenFormatter.format(numeric);
|
|
626
626
|
} catch (e8) {
|
|
627
627
|
return "...";
|
|
628
628
|
}
|
|
@@ -636,7 +636,7 @@ function AmountStep({
|
|
|
636
636
|
}, [amountUsd, tokenPriceUsd]);
|
|
637
637
|
const formattedTokenAmount = _react.useMemo.call(void 0, () => {
|
|
638
638
|
if (tokenAmount === null) return "0.00";
|
|
639
|
-
return
|
|
639
|
+
return _chunkCZWAKYDRcjs.tokenFormatter.format(tokenAmount);
|
|
640
640
|
}, [tokenAmount]);
|
|
641
641
|
const targetSymbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
642
642
|
const handlePresetClick = (percentage) => {
|
|
@@ -653,13 +653,13 @@ function AmountStep({
|
|
|
653
653
|
}
|
|
654
654
|
if (_optionalChain([uiConfig, 'optionalAccess', _13 => _13.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
655
655
|
setError(
|
|
656
|
-
`Maximum deposit is ${
|
|
656
|
+
`Maximum deposit is ${_chunkCZWAKYDRcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
657
657
|
);
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
if (_optionalChain([uiConfig, 'optionalAccess', _14 => _14.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
661
661
|
setError(
|
|
662
|
-
`Minimum deposit is ${
|
|
662
|
+
`Minimum deposit is ${_chunkCZWAKYDRcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
663
663
|
);
|
|
664
664
|
return;
|
|
665
665
|
}
|
|
@@ -729,7 +729,7 @@ function AmountStep({
|
|
|
729
729
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
730
730
|
" ",
|
|
731
731
|
"(",
|
|
732
|
-
|
|
732
|
+
_chunkCZWAKYDRcjs.currencyFormatter.format(balanceUsd),
|
|
733
733
|
")"
|
|
734
734
|
] })
|
|
735
735
|
] }) })
|
|
@@ -872,7 +872,7 @@ function AmountStep({
|
|
|
872
872
|
" to continue."
|
|
873
873
|
] }),
|
|
874
874
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
875
|
-
|
|
875
|
+
_chunkCZWAKYDRcjs.Button,
|
|
876
876
|
{
|
|
877
877
|
variant: "outline",
|
|
878
878
|
size: "small",
|
|
@@ -905,7 +905,7 @@ function AmountStep({
|
|
|
905
905
|
] })
|
|
906
906
|
] }),
|
|
907
907
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
908
|
-
|
|
908
|
+
_chunkCZWAKYDRcjs.Button,
|
|
909
909
|
{
|
|
910
910
|
onClick: handleContinue,
|
|
911
911
|
fullWidth: true,
|
|
@@ -913,7 +913,7 @@ function AmountStep({
|
|
|
913
913
|
children: "Continue"
|
|
914
914
|
}
|
|
915
915
|
) }),
|
|
916
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.PoweredBy, {})
|
|
917
917
|
] });
|
|
918
918
|
}
|
|
919
919
|
|
|
@@ -1023,7 +1023,7 @@ function ConfirmStep({
|
|
|
1023
1023
|
throw new Error("Wallet not properly connected");
|
|
1024
1024
|
}
|
|
1025
1025
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1026
|
-
const hash =
|
|
1026
|
+
const hash = _chunkCZWAKYDRcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1027
1027
|
account,
|
|
1028
1028
|
chain,
|
|
1029
1029
|
to: transferTo,
|
|
@@ -1040,7 +1040,7 @@ function ConfirmStep({
|
|
|
1040
1040
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1041
1041
|
} catch (err) {
|
|
1042
1042
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1043
|
-
const message =
|
|
1043
|
+
const message = _chunkCZWAKYDRcjs.formatUserError.call(void 0, raw);
|
|
1044
1044
|
setError(message);
|
|
1045
1045
|
_optionalChain([onError, 'optionalCall', _18 => _18(message, "TRANSFER_ERROR")]);
|
|
1046
1046
|
} finally {
|
|
@@ -1054,7 +1054,7 @@ function ConfirmStep({
|
|
|
1054
1054
|
await switchChain(asset.chainId);
|
|
1055
1055
|
} catch (err) {
|
|
1056
1056
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1057
|
-
setError(
|
|
1057
|
+
setError(_chunkCZWAKYDRcjs.formatUserError.call(void 0, raw));
|
|
1058
1058
|
} finally {
|
|
1059
1059
|
setIsSwitching(false);
|
|
1060
1060
|
}
|
|
@@ -1159,7 +1159,7 @@ function ConfirmStep({
|
|
|
1159
1159
|
] }),
|
|
1160
1160
|
receiveAmountUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
1161
1161
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Value" }),
|
|
1162
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children:
|
|
1162
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: _chunkCZWAKYDRcjs.currencyFormatter.format(receiveAmountUsd) })
|
|
1163
1163
|
] })
|
|
1164
1164
|
] }),
|
|
1165
1165
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
|
|
@@ -1169,7 +1169,7 @@ function ConfirmStep({
|
|
|
1169
1169
|
" to sign."
|
|
1170
1170
|
] }),
|
|
1171
1171
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1172
|
-
|
|
1172
|
+
_chunkCZWAKYDRcjs.Button,
|
|
1173
1173
|
{
|
|
1174
1174
|
variant: "outline",
|
|
1175
1175
|
size: "small",
|
|
@@ -1202,7 +1202,7 @@ function ConfirmStep({
|
|
|
1202
1202
|
] })
|
|
1203
1203
|
] }),
|
|
1204
1204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1205
|
-
|
|
1205
|
+
_chunkCZWAKYDRcjs.Button,
|
|
1206
1206
|
{
|
|
1207
1207
|
onClick: handleConfirm,
|
|
1208
1208
|
loading: isSubmitting,
|
|
@@ -1211,7 +1211,7 @@ function ConfirmStep({
|
|
|
1211
1211
|
children: "Confirm Order"
|
|
1212
1212
|
}
|
|
1213
1213
|
) }),
|
|
1214
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1214
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.PoweredBy, {})
|
|
1215
1215
|
] });
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
@@ -1416,7 +1416,7 @@ function DepositAddressStep({
|
|
|
1416
1416
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1417
1417
|
if (cancelled || depositHandledRef.current) return;
|
|
1418
1418
|
const event = status.lastEvent;
|
|
1419
|
-
const eventTxHash =
|
|
1419
|
+
const eventTxHash = _chunkCZWAKYDRcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunkCZWAKYDRcjs.getEventTxHash.call(void 0, event), 'optionalAccess', _22 => _22.toLowerCase, 'call', _23 => _23()]), () => ( null)) : null;
|
|
1420
1420
|
if (baselineTxHash === void 0) {
|
|
1421
1421
|
baselineTxHash = eventTxHash;
|
|
1422
1422
|
} else if (eventTxHash && eventTxHash !== baselineTxHash) {
|
|
@@ -1629,7 +1629,7 @@ function DepositAddressStep({
|
|
|
1629
1629
|
] }),
|
|
1630
1630
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1631
1631
|
] }) }),
|
|
1632
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1632
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCZWAKYDRcjs.PoweredBy, {})
|
|
1633
1633
|
] });
|
|
1634
1634
|
}
|
|
1635
1635
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1716,7 +1716,7 @@ function DepositFlow({
|
|
|
1716
1716
|
return {
|
|
1717
1717
|
ownerAddress: dappAddress,
|
|
1718
1718
|
walletClient: void 0,
|
|
1719
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1719
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, targetChain))),
|
|
1720
1720
|
switchChain: void 0
|
|
1721
1721
|
};
|
|
1722
1722
|
}
|
|
@@ -1725,7 +1725,7 @@ function DepositFlow({
|
|
|
1725
1725
|
return {
|
|
1726
1726
|
ownerAddress: dappWalletClient.account.address,
|
|
1727
1727
|
walletClient: dappWalletClient,
|
|
1728
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1728
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1729
1729
|
switchChain: dappSwitchChain
|
|
1730
1730
|
};
|
|
1731
1731
|
}
|
|
@@ -1735,7 +1735,7 @@ function DepositFlow({
|
|
|
1735
1735
|
return {
|
|
1736
1736
|
ownerAddress: dappWalletClient.account.address,
|
|
1737
1737
|
walletClient: dappWalletClient,
|
|
1738
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1738
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkCZWAKYDRcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1739
1739
|
switchChain: dappSwitchChain
|
|
1740
1740
|
};
|
|
1741
1741
|
}
|
|
@@ -1943,7 +1943,7 @@ function DepositFlow({
|
|
|
1943
1943
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1944
1944
|
if (showConnectStep) {
|
|
1945
1945
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1946
|
-
|
|
1946
|
+
_chunkCZWAKYDRcjs.ConnectStep,
|
|
1947
1947
|
{
|
|
1948
1948
|
walletOptions,
|
|
1949
1949
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1996,7 +1996,7 @@ function DepositFlow({
|
|
|
1996
1996
|
}
|
|
1997
1997
|
),
|
|
1998
1998
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1999
|
-
|
|
1999
|
+
_chunkCZWAKYDRcjs.ProcessingStep,
|
|
2000
2000
|
{
|
|
2001
2001
|
smartAccount: step.smartAccount,
|
|
2002
2002
|
txHash: step.txHash,
|
|
@@ -2027,7 +2027,7 @@ function DepositFlow({
|
|
|
2027
2027
|
if (_optionalChain([signerContext, 'access', _58 => _58.publicClient, 'access', _59 => _59.chain, 'optionalAccess', _60 => _60.id]) === chainId) {
|
|
2028
2028
|
return signerContext.publicClient;
|
|
2029
2029
|
}
|
|
2030
|
-
return
|
|
2030
|
+
return _chunkCZWAKYDRcjs.getPublicClient.call(void 0, chainId);
|
|
2031
2031
|
};
|
|
2032
2032
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
2033
2033
|
step.type === "setup" && targetChainObj && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2095,7 +2095,7 @@ function DepositFlow({
|
|
|
2095
2095
|
}
|
|
2096
2096
|
),
|
|
2097
2097
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2098
|
-
|
|
2098
|
+
_chunkCZWAKYDRcjs.ProcessingStep,
|
|
2099
2099
|
{
|
|
2100
2100
|
smartAccount: step.smartAccount,
|
|
2101
2101
|
txHash: step.txHash,
|
|
@@ -2120,7 +2120,7 @@ function DepositFlow({
|
|
|
2120
2120
|
// src/DepositModal.tsx
|
|
2121
2121
|
|
|
2122
2122
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2123
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
2123
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-QQ6WI265.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2124
2124
|
);
|
|
2125
2125
|
function DepositModal(props) {
|
|
2126
2126
|
const needsReown = !!props.reownAppId;
|
|
@@ -2171,10 +2171,10 @@ function DepositModalInner({
|
|
|
2171
2171
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2172
2172
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
2173
2173
|
const sourceChain = sourceChainProp ? _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2174
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2174
|
+
const service = _react.useMemo.call(void 0, () => _chunkCZWAKYDRcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2175
2175
|
_react.useEffect.call(void 0, () => {
|
|
2176
2176
|
if (isOpen && modalRef.current) {
|
|
2177
|
-
|
|
2177
|
+
_chunkCZWAKYDRcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
2178
2178
|
}
|
|
2179
2179
|
}, [isOpen, theme]);
|
|
2180
2180
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -2210,7 +2210,7 @@ function DepositModalInner({
|
|
|
2210
2210
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _69 => _69.title]), () => ( "Deposit"));
|
|
2211
2211
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
2212
2212
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2213
|
-
|
|
2213
|
+
_chunkCZWAKYDRcjs.Modal,
|
|
2214
2214
|
{
|
|
2215
2215
|
isOpen,
|
|
2216
2216
|
onClose,
|
|
@@ -2271,7 +2271,7 @@ function DepositModalInner({
|
|
|
2271
2271
|
balanceTitle,
|
|
2272
2272
|
":"
|
|
2273
2273
|
] }),
|
|
2274
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
2274
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _chunkCZWAKYDRcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
2275
2275
|
] })
|
|
2276
2276
|
] }),
|
|
2277
2277
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
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 _chunkVBNFP3JFcjs = require('./chunk-VBNFP3JF.cjs');
|
|
4
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
5
5
|
require('./chunk-CEIWN53N.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunkVBNFP3JFcjs.DepositModal;
|
package/dist/deposit.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { c as DepositModalProps } from './types-
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData } from './types-
|
|
2
|
+
import { c as DepositModalProps } from './types-BwaQ7jK5.cjs';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData } from './types-BwaQ7jK5.cjs';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import './safe.cjs';
|
|
6
6
|
|
package/dist/deposit.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { c as DepositModalProps } from './types-
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData } from './types-
|
|
2
|
+
import { c as DepositModalProps } from './types-CgXyx46m.js';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData } from './types-CgXyx46m.js';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import './safe.js';
|
|
6
6
|
|
package/dist/deposit.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVBNFP3JFcjs = require('./chunk-VBNFP3JF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunk4QDHXCPGcjs = require('./chunk-4QDHXCPG.cjs');
|
|
7
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -64,4 +64,4 @@ var _chunkCEIWN53Ncjs = require('./chunk-CEIWN53N.cjs');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
exports.CHAIN_BY_ID = _chunkCEIWN53Ncjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkCEIWN53Ncjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkCEIWN53Ncjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal =
|
|
67
|
+
exports.CHAIN_BY_ID = _chunkCEIWN53Ncjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkCEIWN53Ncjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkCEIWN53Ncjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkVBNFP3JFcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkCEIWN53Ncjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkCEIWN53Ncjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunk4QDHXCPGcjs.WithdrawModal; exports.chainRegistry = _chunkCEIWN53Ncjs.chainRegistry; exports.findChainIdForToken = _chunkCEIWN53Ncjs.findChainIdForToken; exports.getChainBadge = _chunkCEIWN53Ncjs.getChainBadge; exports.getChainIcon = _chunkCEIWN53Ncjs.getChainIcon; exports.getChainId = _chunkCEIWN53Ncjs.getChainId; exports.getChainName = _chunkCEIWN53Ncjs.getChainName; exports.getChainObject = _chunkCEIWN53Ncjs.getChainObject; exports.getExplorerName = _chunkCEIWN53Ncjs.getExplorerName; exports.getExplorerTxUrl = _chunkCEIWN53Ncjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkCEIWN53Ncjs.getExplorerUrl; exports.getSupportedChainIds = _chunkCEIWN53Ncjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkCEIWN53Ncjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkCEIWN53Ncjs.getSupportedTokenSymbolsForChain; exports.getTokenAddress = _chunkCEIWN53Ncjs.getTokenAddress; exports.getTokenDecimals = _chunkCEIWN53Ncjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkCEIWN53Ncjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkCEIWN53Ncjs.getTokenIcon; exports.getTokenSymbol = _chunkCEIWN53Ncjs.getTokenSymbol; exports.getUsdcAddress = _chunkCEIWN53Ncjs.getUsdcAddress; exports.getUsdcDecimals = _chunkCEIWN53Ncjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkCEIWN53Ncjs.isSupportedTokenAddressForChain;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DepositModal } from './deposit.cjs';
|
|
2
2
|
export { WithdrawModal } from './withdraw.cjs';
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-BwaQ7jK5.cjs';
|
|
4
4
|
export { CHAIN_BY_ID, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain } from './constants.cjs';
|
|
5
5
|
export { SafeTransactionRequest } from './safe.cjs';
|
|
6
6
|
export { chainRegistry } from '@rhinestone/shared-configs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DepositModal } from './deposit.js';
|
|
2
2
|
export { WithdrawModal } from './withdraw.js';
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-CgXyx46m.js';
|
|
4
4
|
export { CHAIN_BY_ID, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain } from './constants.js';
|
|
5
5
|
export { SafeTransactionRequest } from './safe.js';
|
|
6
6
|
export { chainRegistry } from '@rhinestone/shared-configs';
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JAR372KJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
WithdrawModal
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-B3HMNWR4.mjs";
|
|
7
|
+
import "./chunk-GAFLOODV.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CHAIN_BY_ID,
|
|
10
10
|
DEFAULT_BACKEND_URL,
|
package/dist/reown.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkVBNFP3JFcjs = require('./chunk-VBNFP3JF.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk4QDHXCPGcjs = require('./chunk-4QDHXCPG.cjs');
|
|
7
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
8
|
+
require('./chunk-CEIWN53N.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.DepositModal = _chunkVBNFP3JFcjs.DepositModal; exports.WithdrawModal = _chunk4QDHXCPGcjs.WithdrawModal;
|
package/dist/reown.d.cts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DepositModal } from './deposit.cjs';
|
|
2
|
+
export { WithdrawModal } from './withdraw.cjs';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-BwaQ7jK5.cjs';
|
|
4
|
+
export { SafeTransactionRequest } from './safe.cjs';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'viem';
|
package/dist/reown.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DepositModal } from './deposit.js';
|
|
2
|
+
export { WithdrawModal } from './withdraw.js';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-CgXyx46m.js';
|
|
4
|
+
export { SafeTransactionRequest } from './safe.js';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'viem';
|
package/dist/reown.mjs
ADDED
|
@@ -113,8 +113,8 @@ interface WithdrawModalProps {
|
|
|
113
113
|
forceRegister?: boolean;
|
|
114
114
|
waitForFinalTx?: boolean;
|
|
115
115
|
reownAppId?: string;
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
|
|
117
|
+
signature: Hex;
|
|
118
118
|
}>;
|
|
119
119
|
onRequestConnect?: () => void;
|
|
120
120
|
connectButtonLabel?: string;
|
|
@@ -113,8 +113,8 @@ interface WithdrawModalProps {
|
|
|
113
113
|
forceRegister?: boolean;
|
|
114
114
|
waitForFinalTx?: boolean;
|
|
115
115
|
reownAppId?: string;
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
|
|
117
|
+
signature: Hex;
|
|
118
118
|
}>;
|
|
119
119
|
onRequestConnect?: () => void;
|
|
120
120
|
connectButtonLabel?: string;
|
package/dist/withdraw.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 _chunk4QDHXCPGcjs = require('./chunk-4QDHXCPG.cjs');
|
|
4
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
5
5
|
require('./chunk-CEIWN53N.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.WithdrawModal =
|
|
8
|
+
exports.WithdrawModal = _chunk4QDHXCPGcjs.WithdrawModal;
|
package/dist/withdraw.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { h as WithdrawModalProps } from './types-
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, i as WithdrawSubmittedEventData } from './types-
|
|
2
|
+
import { h as WithdrawModalProps } from './types-BwaQ7jK5.cjs';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, i as WithdrawSubmittedEventData } from './types-BwaQ7jK5.cjs';
|
|
4
4
|
export { SafeTransactionRequest } from './safe.cjs';
|
|
5
5
|
import 'viem';
|
|
6
6
|
|
package/dist/withdraw.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { h as WithdrawModalProps } from './types-
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, i as WithdrawSubmittedEventData } from './types-
|
|
2
|
+
import { h as WithdrawModalProps } from './types-CgXyx46m.js';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, i as WithdrawSubmittedEventData } from './types-CgXyx46m.js';
|
|
4
4
|
export { SafeTransactionRequest } from './safe.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
|
package/dist/withdraw.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhinestone/deposit-modal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "React modal component for Rhinestone cross-chain deposits",
|
|
5
5
|
"author": "Rhinestone <dev@rhinestone.wtf>",
|
|
6
6
|
"bugs": {
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"import": "./dist/withdraw.mjs",
|
|
27
27
|
"require": "./dist/withdraw.cjs"
|
|
28
28
|
},
|
|
29
|
+
"./reown": {
|
|
30
|
+
"types": "./dist/reown.d.ts",
|
|
31
|
+
"import": "./dist/reown.mjs",
|
|
32
|
+
"require": "./dist/reown.cjs"
|
|
33
|
+
},
|
|
29
34
|
"./safe": {
|
|
30
35
|
"types": "./dist/safe.d.ts",
|
|
31
36
|
"import": "./dist/safe.mjs",
|