@rhinestone/deposit-modal 0.1.25 → 0.1.26
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-4A5HJK74.mjs → DepositModalReown-4WZF2HMJ.mjs} +2 -2
- package/dist/{DepositModalReown-QQ6WI265.cjs → DepositModalReown-NKDYLTKD.cjs} +3 -3
- package/dist/{WithdrawModalReown-HBORIX2O.mjs → WithdrawModalReown-244RQ5FZ.mjs} +2 -2
- package/dist/{WithdrawModalReown-L77OC26X.cjs → WithdrawModalReown-GL4TM22D.cjs} +3 -3
- package/dist/{chunk-GAFLOODV.mjs → chunk-3FK5FAUL.mjs} +53 -0
- package/dist/{chunk-CZWAKYDR.cjs → chunk-4Q6QCALP.cjs} +78 -25
- package/dist/{chunk-4QDHXCPG.cjs → chunk-4WULBRUA.cjs} +32 -32
- package/dist/{chunk-VBNFP3JF.cjs → chunk-7QCFFKB5.cjs} +65 -63
- package/dist/{chunk-B3HMNWR4.mjs → chunk-DJAUNNEW.mjs} +2 -2
- package/dist/{chunk-JAR372KJ.mjs → chunk-W42B54IA.mjs} +23 -21
- 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 +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W42B54IA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-LBEP3A2Z.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3FK5FAUL.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 _chunk7QCFFKB5cjs = require('./chunk-7QCFFKB5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk6VJ2ZTNQcjs = require('./chunk-6VJ2ZTNQ.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-4Q6QCALP.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
|
+
_chunk7QCFFKB5cjs.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-DJAUNNEW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-LBEP3A2Z.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3FK5FAUL.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 _chunk4WULBRUAcjs = require('./chunk-4WULBRUA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk6VJ2ZTNQcjs = require('./chunk-6VJ2ZTNQ.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-4Q6QCALP.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
|
+
_chunk4WULBRUAcjs.WithdrawModalInner,
|
|
21
21
|
{
|
|
22
22
|
...props,
|
|
23
23
|
reownWallet: reown,
|
|
@@ -153,6 +153,20 @@ function createDepositService(baseUrl) {
|
|
|
153
153
|
return `${normalizedBaseUrl}${normalizedPath}`;
|
|
154
154
|
}
|
|
155
155
|
return {
|
|
156
|
+
async prepareAccount(params) {
|
|
157
|
+
const response = await fetch(apiUrl("/prepare-account"), {
|
|
158
|
+
method: "POST",
|
|
159
|
+
headers: { "Content-Type": "application/json" },
|
|
160
|
+
body: JSON.stringify(params)
|
|
161
|
+
});
|
|
162
|
+
if (!response.ok) {
|
|
163
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
164
|
+
throw new Error(
|
|
165
|
+
error.error || `Prepare account failed: ${response.status}`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return response.json();
|
|
169
|
+
},
|
|
156
170
|
async registerAccount(params) {
|
|
157
171
|
const { eoaAddress, sessionOwner, ...account } = params;
|
|
158
172
|
const response = await fetch(apiUrl("/register"), {
|
|
@@ -961,6 +975,44 @@ async function getSessionDetails(rhinestoneAccount, targetChain, signerAddress,
|
|
|
961
975
|
signature: enableSignature
|
|
962
976
|
};
|
|
963
977
|
}
|
|
978
|
+
function deserializeSessionData(raw) {
|
|
979
|
+
const data = structuredClone(raw);
|
|
980
|
+
const message = data.message;
|
|
981
|
+
if (!message?.sessionsAndChainIds) return data;
|
|
982
|
+
for (const entry of message.sessionsAndChainIds) {
|
|
983
|
+
const chainSession = entry;
|
|
984
|
+
chainSession.chainId = BigInt(chainSession.chainId);
|
|
985
|
+
const session = chainSession.session;
|
|
986
|
+
if (session) {
|
|
987
|
+
session.nonce = BigInt(session.nonce);
|
|
988
|
+
session.expires = BigInt(session.expires);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return data;
|
|
992
|
+
}
|
|
993
|
+
async function signSessionDetails(rhinestoneAccount, sessionDetailsUnsigned, signer) {
|
|
994
|
+
const data = deserializeSessionData(sessionDetailsUnsigned.data);
|
|
995
|
+
const hashesAndChainIds = sessionDetailsUnsigned.hashesAndChainIds.map(
|
|
996
|
+
(h) => ({
|
|
997
|
+
chainId: BigInt(h.chainId),
|
|
998
|
+
sessionDigest: h.sessionDigest
|
|
999
|
+
})
|
|
1000
|
+
);
|
|
1001
|
+
const sessionDetails = {
|
|
1002
|
+
nonces: [],
|
|
1003
|
+
hashesAndChainIds,
|
|
1004
|
+
data
|
|
1005
|
+
};
|
|
1006
|
+
const signature = await signEnableSessionWithOwner(
|
|
1007
|
+
rhinestoneAccount,
|
|
1008
|
+
sessionDetails,
|
|
1009
|
+
signer
|
|
1010
|
+
);
|
|
1011
|
+
return {
|
|
1012
|
+
hashesAndChainIds,
|
|
1013
|
+
signature
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
964
1016
|
|
|
965
1017
|
// src/core/session-owner.ts
|
|
966
1018
|
import { isAddress } from "viem";
|
|
@@ -1662,6 +1714,7 @@ export {
|
|
|
1662
1714
|
getAccountAddress,
|
|
1663
1715
|
getAccountInitData,
|
|
1664
1716
|
getSessionDetails,
|
|
1717
|
+
signSessionDetails,
|
|
1665
1718
|
loadSessionOwnerFromStorage,
|
|
1666
1719
|
saveSessionOwnerToStorage,
|
|
1667
1720
|
createSessionOwnerKey,
|
|
@@ -153,6 +153,20 @@ function createDepositService(baseUrl) {
|
|
|
153
153
|
return `${normalizedBaseUrl}${normalizedPath}`;
|
|
154
154
|
}
|
|
155
155
|
return {
|
|
156
|
+
async prepareAccount(params) {
|
|
157
|
+
const response = await fetch(apiUrl("/prepare-account"), {
|
|
158
|
+
method: "POST",
|
|
159
|
+
headers: { "Content-Type": "application/json" },
|
|
160
|
+
body: JSON.stringify(params)
|
|
161
|
+
});
|
|
162
|
+
if (!response.ok) {
|
|
163
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
164
|
+
throw new Error(
|
|
165
|
+
error.error || `Prepare account failed: ${response.status}`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return response.json();
|
|
169
|
+
},
|
|
156
170
|
async registerAccount(params) {
|
|
157
171
|
const { eoaAddress, sessionOwner, ...account } = params;
|
|
158
172
|
const response = await fetch(apiUrl("/register"), {
|
|
@@ -961,6 +975,44 @@ async function getSessionDetails(rhinestoneAccount, targetChain, signerAddress,
|
|
|
961
975
|
signature: enableSignature
|
|
962
976
|
};
|
|
963
977
|
}
|
|
978
|
+
function deserializeSessionData(raw) {
|
|
979
|
+
const data = structuredClone(raw);
|
|
980
|
+
const message = data.message;
|
|
981
|
+
if (!_optionalChain([message, 'optionalAccess', _44 => _44.sessionsAndChainIds])) return data;
|
|
982
|
+
for (const entry of message.sessionsAndChainIds) {
|
|
983
|
+
const chainSession = entry;
|
|
984
|
+
chainSession.chainId = BigInt(chainSession.chainId);
|
|
985
|
+
const session = chainSession.session;
|
|
986
|
+
if (session) {
|
|
987
|
+
session.nonce = BigInt(session.nonce);
|
|
988
|
+
session.expires = BigInt(session.expires);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return data;
|
|
992
|
+
}
|
|
993
|
+
async function signSessionDetails(rhinestoneAccount, sessionDetailsUnsigned, signer) {
|
|
994
|
+
const data = deserializeSessionData(sessionDetailsUnsigned.data);
|
|
995
|
+
const hashesAndChainIds = sessionDetailsUnsigned.hashesAndChainIds.map(
|
|
996
|
+
(h) => ({
|
|
997
|
+
chainId: BigInt(h.chainId),
|
|
998
|
+
sessionDigest: h.sessionDigest
|
|
999
|
+
})
|
|
1000
|
+
);
|
|
1001
|
+
const sessionDetails = {
|
|
1002
|
+
nonces: [],
|
|
1003
|
+
hashesAndChainIds,
|
|
1004
|
+
data
|
|
1005
|
+
};
|
|
1006
|
+
const signature = await signEnableSessionWithOwner(
|
|
1007
|
+
rhinestoneAccount,
|
|
1008
|
+
sessionDetails,
|
|
1009
|
+
signer
|
|
1010
|
+
);
|
|
1011
|
+
return {
|
|
1012
|
+
hashesAndChainIds,
|
|
1013
|
+
signature
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
964
1016
|
|
|
965
1017
|
// src/core/session-owner.ts
|
|
966
1018
|
|
|
@@ -1060,22 +1112,22 @@ function asString(value) {
|
|
|
1060
1112
|
return typeof value === "string" ? value : void 0;
|
|
1061
1113
|
}
|
|
1062
1114
|
function getEventTxHash(event) {
|
|
1063
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1115
|
+
if (!_optionalChain([event, 'optionalAccess', _45 => _45.type])) return void 0;
|
|
1064
1116
|
if (event.type === "deposit-received") {
|
|
1065
|
-
return asString(_optionalChain([event, 'access',
|
|
1117
|
+
return asString(_optionalChain([event, 'access', _46 => _46.data, 'optionalAccess', _47 => _47.transactionHash]));
|
|
1066
1118
|
}
|
|
1067
1119
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
1068
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1069
|
-
return asString(_optionalChain([deposit, 'optionalAccess',
|
|
1120
|
+
const deposit = isRecord(_optionalChain([event, 'access', _48 => _48.data, 'optionalAccess', _49 => _49.deposit])) ? event.data.deposit : void 0;
|
|
1121
|
+
return asString(_optionalChain([deposit, 'optionalAccess', _50 => _50.transactionHash]));
|
|
1070
1122
|
}
|
|
1071
1123
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
1072
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1073
|
-
return asString(_optionalChain([deposit, 'optionalAccess',
|
|
1124
|
+
const deposit = isRecord(_optionalChain([event, 'access', _51 => _51.data, 'optionalAccess', _52 => _52.deposit])) ? event.data.deposit : void 0;
|
|
1125
|
+
return asString(_optionalChain([deposit, 'optionalAccess', _53 => _53.transactionHash]));
|
|
1074
1126
|
}
|
|
1075
1127
|
return void 0;
|
|
1076
1128
|
}
|
|
1077
1129
|
function isDepositEvent(event) {
|
|
1078
|
-
return _optionalChain([event, 'optionalAccess',
|
|
1130
|
+
return _optionalChain([event, 'optionalAccess', _54 => _54.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _55 => _55.type]) === "bridge-started";
|
|
1079
1131
|
}
|
|
1080
1132
|
|
|
1081
1133
|
// src/components/steps/ProcessingStep.tsx
|
|
@@ -1090,7 +1142,7 @@ function isEventForTx(event, txHash) {
|
|
|
1090
1142
|
return eventTxHash.toLowerCase() === txHash.toLowerCase();
|
|
1091
1143
|
}
|
|
1092
1144
|
function formatBridgeFailedMessage(event) {
|
|
1093
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1145
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _56 => _56.data]), () => ( {}));
|
|
1094
1146
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
1095
1147
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1096
1148
|
if (backendMessage.length > 0) {
|
|
@@ -1131,7 +1183,7 @@ function ProcessingStep({
|
|
|
1131
1183
|
const intervalRef = _react.useRef.call(void 0, null);
|
|
1132
1184
|
_react.useEffect.call(void 0, () => {
|
|
1133
1185
|
if (directTransfer) {
|
|
1134
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1186
|
+
_optionalChain([onDepositComplete, 'optionalCall', _57 => _57(txHash)]);
|
|
1135
1187
|
return;
|
|
1136
1188
|
}
|
|
1137
1189
|
}, [directTransfer, txHash, onDepositComplete]);
|
|
@@ -1174,40 +1226,40 @@ function ProcessingStep({
|
|
|
1174
1226
|
console.log("[deposit-modal] status poll", {
|
|
1175
1227
|
type: lastEvent2.type,
|
|
1176
1228
|
matchesTx: eventMatchesTx,
|
|
1177
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
1229
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _58 => _58.intentId]),
|
|
1178
1230
|
data: eventData
|
|
1179
1231
|
});
|
|
1180
1232
|
}
|
|
1181
1233
|
if (!isMounted) return;
|
|
1182
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1234
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _59 => _59.type]) === "bridge-complete") {
|
|
1183
1235
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1184
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
1185
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1236
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _60 => _60.data, 'optionalAccess', _61 => _61.destination, 'optionalAccess', _62 => _62.transactionHash]);
|
|
1237
|
+
_optionalChain([onDepositComplete, 'optionalCall', _63 => _63(txHash, destinationTxHash2)]);
|
|
1186
1238
|
return;
|
|
1187
1239
|
}
|
|
1188
|
-
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1240
|
+
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _64 => _64.type]) === "bridge-started") {
|
|
1189
1241
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1190
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1242
|
+
_optionalChain([onDepositComplete, 'optionalCall', _65 => _65(txHash)]);
|
|
1191
1243
|
return;
|
|
1192
1244
|
}
|
|
1193
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1245
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _66 => _66.type]) === "bridge-failed") {
|
|
1194
1246
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1195
1247
|
setState({
|
|
1196
1248
|
type: "failed",
|
|
1197
1249
|
message: formatted.message,
|
|
1198
1250
|
lastEvent: eventForCurrentTx
|
|
1199
1251
|
});
|
|
1200
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1252
|
+
_optionalChain([onDepositFailed, 'optionalCall', _67 => _67(txHash, formatted.message)]);
|
|
1201
1253
|
return;
|
|
1202
1254
|
}
|
|
1203
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1204
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
1255
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _68 => _68.type]) === "error") {
|
|
1256
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _69 => _69.data, 'optionalAccess', _70 => _70.message]), () => ( "Unknown error"));
|
|
1205
1257
|
setState({
|
|
1206
1258
|
type: "failed",
|
|
1207
1259
|
message: errorMessage,
|
|
1208
1260
|
lastEvent: eventForCurrentTx
|
|
1209
1261
|
});
|
|
1210
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1262
|
+
_optionalChain([onDepositFailed, 'optionalCall', _71 => _71(txHash, errorMessage)]);
|
|
1211
1263
|
return;
|
|
1212
1264
|
}
|
|
1213
1265
|
setState({ type: "processing", lastEvent: eventForCurrentTx });
|
|
@@ -1255,7 +1307,7 @@ function ProcessingStep({
|
|
|
1255
1307
|
processTimeoutRef.current = setTimeout(() => {
|
|
1256
1308
|
const message = "We couldn't confirm your transfer. Please contact support if funds do not arrive.";
|
|
1257
1309
|
setState({ type: "error", message });
|
|
1258
|
-
_optionalChain([onError, 'optionalCall',
|
|
1310
|
+
_optionalChain([onError, 'optionalCall', _72 => _72(message, "PROCESS_TIMEOUT")]);
|
|
1259
1311
|
}, PROCESS_TIMEOUT_MS);
|
|
1260
1312
|
return () => {
|
|
1261
1313
|
if (processTimeoutRef.current) {
|
|
@@ -1268,10 +1320,10 @@ function ProcessingStep({
|
|
|
1268
1320
|
const isComplete = state.type === "complete";
|
|
1269
1321
|
const isProcessing = state.type === "processing";
|
|
1270
1322
|
const lastEvent = state.type === "processing" || state.type === "complete" || state.type === "failed" ? state.lastEvent : void 0;
|
|
1271
|
-
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess',
|
|
1323
|
+
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _73 => _73.type]) === "bridge-started";
|
|
1272
1324
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1273
1325
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1274
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
1326
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _74 => _74.data, 'optionalAccess', _75 => _75.destination, 'optionalAccess', _76 => _76.transactionHash]) || null;
|
|
1275
1327
|
const sourceExplorerUrl = _chunkCEIWN53Ncjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1276
1328
|
const destExplorerUrl = destinationTxHash ? _chunkCEIWN53Ncjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1277
1329
|
const truncateHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-8)}`;
|
|
@@ -1504,7 +1556,7 @@ function ProcessingStep({
|
|
|
1504
1556
|
{
|
|
1505
1557
|
className: `rs-step-description ${isError ? "rs-text-error" : "rs-text-secondary"}`,
|
|
1506
1558
|
children: [
|
|
1507
|
-
state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess',
|
|
1559
|
+
state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess', _77 => _77.type]) === "deposit-received" ? "Transfer received. Preparing bridge..." : _optionalChain([lastEvent, 'optionalAccess', _78 => _78.type]) === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${_chunkCEIWN53Ncjs.getChainName.call(void 0, targetChain)}.`),
|
|
1508
1560
|
state.type === "failed" && state.message,
|
|
1509
1561
|
state.type === "error" && state.message
|
|
1510
1562
|
]
|
|
@@ -1679,4 +1731,5 @@ function getPublicClient(chainId) {
|
|
|
1679
1731
|
|
|
1680
1732
|
|
|
1681
1733
|
|
|
1682
|
-
|
|
1734
|
+
|
|
1735
|
+
exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.ConnectStep = ConnectStep; exports.createViewOnlyAccount = createViewOnlyAccount; exports.createSmartAccount = createSmartAccount; exports.getAccountAddress = getAccountAddress; exports.getAccountInitData = getAccountInitData; exports.getSessionDetails = getSessionDetails; exports.signSessionDetails = signSessionDetails; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.PoweredBy = PoweredBy; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.getEventTxHash = getEventTxHash; exports.isDepositEvent = isDepositEvent; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunk4Q6QCALPcjs = require('./chunk-4Q6QCALP.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(_chunk4Q6QCALPcjs.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 = _chunk4Q6QCALPcjs.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(_chunk4Q6QCALPcjs.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(_chunk4Q6QCALPcjs.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 ? _chunk4Q6QCALPcjs.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
|
+
_chunk4Q6QCALPcjs.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
|
+
_chunk4Q6QCALPcjs.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, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
558
558
|
] });
|
|
559
559
|
}
|
|
560
560
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -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, () => ( _chunk4Q6QCALPcjs.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, () => ( _chunk4Q6QCALPcjs.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, () => ( _chunk4Q6QCALPcjs.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: _chunk4Q6QCALPcjs.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 = _chunk4Q6QCALPcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1012
1012
|
if (localOwner) {
|
|
1013
1013
|
return {
|
|
1014
|
-
account:
|
|
1014
|
+
account: _chunk4Q6QCALPcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1015
1015
|
address: localOwner.address
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
|
-
const created =
|
|
1019
|
-
|
|
1018
|
+
const created = _chunk4Q6QCALPcjs.createSessionOwnerKey.call(void 0, );
|
|
1019
|
+
_chunk4Q6QCALPcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1020
1020
|
return {
|
|
1021
1021
|
account: created.account,
|
|
1022
1022
|
address: created.address
|
|
@@ -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) : _chunk4Q6QCALPcjs.createViewOnlyAccount.call(void 0, ownerAddress2);
|
|
1040
1040
|
const sessionOwner = await resolveSessionOwner(ownerAddress2);
|
|
1041
|
-
const account = await
|
|
1041
|
+
const account = await _chunk4Q6QCALPcjs.createSmartAccount.call(void 0,
|
|
1042
1042
|
signerAccount,
|
|
1043
1043
|
sessionOwner.account,
|
|
1044
1044
|
rhinestoneApiKey
|
|
1045
1045
|
);
|
|
1046
|
-
const smartAccount =
|
|
1046
|
+
const smartAccount = _chunk4Q6QCALPcjs.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 = _chunk4Q6QCALPcjs.getAccountInitData.call(void 0, account);
|
|
1051
|
+
const sessionDetails = await _chunk4Q6QCALPcjs.getSessionDetails.call(void 0,
|
|
1052
1052
|
account,
|
|
1053
1053
|
targetChainObj,
|
|
1054
1054
|
signerAddress,
|
|
@@ -1074,7 +1074,7 @@ 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]), () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1078
1078
|
let result;
|
|
1079
1079
|
if (onSignTransaction) {
|
|
1080
1080
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
@@ -1142,7 +1142,7 @@ function WithdrawFlow({
|
|
|
1142
1142
|
});
|
|
1143
1143
|
} catch (err) {
|
|
1144
1144
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
1145
|
-
handleError(
|
|
1145
|
+
handleError(_chunk4Q6QCALPcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1146
1146
|
throw err;
|
|
1147
1147
|
} finally {
|
|
1148
1148
|
setIsSubmitting(false);
|
|
@@ -1236,7 +1236,7 @@ function WithdrawFlow({
|
|
|
1236
1236
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1237
1237
|
if (showConnectStep) {
|
|
1238
1238
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1239
|
-
|
|
1239
|
+
_chunk4Q6QCALPcjs.ConnectStep,
|
|
1240
1240
|
{
|
|
1241
1241
|
walletOptions,
|
|
1242
1242
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1256,7 +1256,7 @@ function WithdrawFlow({
|
|
|
1256
1256
|
if (!signerContext) return null;
|
|
1257
1257
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1258
1258
|
const ownerAddress = signerContext.ownerAddress;
|
|
1259
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1259
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1260
1260
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1261
1261
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1262
1262
|
WithdrawFormStep,
|
|
@@ -1281,7 +1281,7 @@ function WithdrawFlow({
|
|
|
1281
1281
|
}
|
|
1282
1282
|
),
|
|
1283
1283
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1284
|
-
|
|
1284
|
+
_chunk4Q6QCALPcjs.ProcessingStep,
|
|
1285
1285
|
{
|
|
1286
1286
|
smartAccount: step.smartAccount,
|
|
1287
1287
|
txHash: step.txHash,
|
|
@@ -1307,7 +1307,7 @@ function WithdrawFlow({
|
|
|
1307
1307
|
// src/WithdrawModal.tsx
|
|
1308
1308
|
|
|
1309
1309
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1310
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1310
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-GL4TM22D.cjs"))).then((m) => ({
|
|
1311
1311
|
default: m.WithdrawModalReown
|
|
1312
1312
|
}))
|
|
1313
1313
|
);
|
|
@@ -1362,10 +1362,10 @@ function WithdrawModalInner({
|
|
|
1362
1362
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1363
1363
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
1364
1364
|
const sourceChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp);
|
|
1365
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
1365
|
+
const service = _react.useMemo.call(void 0, () => _chunk4Q6QCALPcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
1366
1366
|
_react.useEffect.call(void 0, () => {
|
|
1367
1367
|
if (isOpen && modalRef.current) {
|
|
1368
|
-
|
|
1368
|
+
_chunk4Q6QCALPcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1369
1369
|
}
|
|
1370
1370
|
}, [isOpen, theme]);
|
|
1371
1371
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -1401,7 +1401,7 @@ function WithdrawModalInner({
|
|
|
1401
1401
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _40 => _40.title]), () => ( "Withdraw"));
|
|
1402
1402
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1403
1403
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
-
|
|
1404
|
+
_chunk4Q6QCALPcjs.Modal,
|
|
1405
1405
|
{
|
|
1406
1406
|
isOpen,
|
|
1407
1407
|
onClose,
|
|
@@ -1459,7 +1459,7 @@ function WithdrawModalInner({
|
|
|
1459
1459
|
] }),
|
|
1460
1460
|
balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1461
1461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balanceTitle }),
|
|
1462
|
-
/* @__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: _chunk4Q6QCALPcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
1463
1463
|
] })
|
|
1464
1464
|
] }),
|
|
1465
1465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -23,9 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _chunkCZWAKYDRcjs = require('./chunk-CZWAKYDR.cjs');
|
|
26
|
+
var _chunk4Q6QCALPcjs = require('./chunk-4Q6QCALP.cjs');
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
|
|
@@ -62,15 +60,15 @@ var _react = require('react');
|
|
|
62
60
|
var _sdk = require('@rhinestone/sdk');
|
|
63
61
|
var _jsxruntime = require('react/jsx-runtime');
|
|
64
62
|
async function resolveSessionOwner(eoaAddress) {
|
|
65
|
-
const localOwner =
|
|
63
|
+
const localOwner = _chunk4Q6QCALPcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
66
64
|
if (localOwner) {
|
|
67
65
|
return {
|
|
68
|
-
account:
|
|
66
|
+
account: _chunk4Q6QCALPcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
69
67
|
address: localOwner.address
|
|
70
68
|
};
|
|
71
69
|
}
|
|
72
|
-
const created =
|
|
73
|
-
|
|
70
|
+
const created = _chunk4Q6QCALPcjs.createSessionOwnerKey.call(void 0, );
|
|
71
|
+
_chunk4Q6QCALPcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
74
72
|
return {
|
|
75
73
|
account: created.account,
|
|
76
74
|
address: created.address
|
|
@@ -103,14 +101,16 @@ function SetupStep({
|
|
|
103
101
|
}
|
|
104
102
|
try {
|
|
105
103
|
setState({ type: "creating-account" });
|
|
106
|
-
const signerAccount = walletClient ? _sdk.walletClientToAccount.call(void 0, walletClient) : _chunkCZWAKYDRcjs.createViewOnlyAccount.call(void 0, address);
|
|
107
104
|
const sessionOwner = await resolveSessionOwner(address);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
sessionOwner.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
const prepared = await service.prepareAccount({
|
|
106
|
+
ownerAddress: address,
|
|
107
|
+
sessionOwnerAddress: sessionOwner.address,
|
|
108
|
+
targetChain,
|
|
109
|
+
targetToken,
|
|
110
|
+
signerAddress,
|
|
111
|
+
sessionChainIds
|
|
112
|
+
});
|
|
113
|
+
const smartAccount = prepared.smartAccount;
|
|
114
114
|
setState({ type: "checking" });
|
|
115
115
|
const checkResult = await service.checkAccount(smartAccount);
|
|
116
116
|
if (checkResult.isRegistered && !forceRegister) {
|
|
@@ -123,21 +123,23 @@ function SetupStep({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
setState({ type: "signing-session" });
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
targetChainObj,
|
|
130
|
-
signerAddress,
|
|
126
|
+
const signerAccount = walletClient ? _sdk.walletClientToAccount.call(void 0, walletClient) : _chunk4Q6QCALPcjs.createViewOnlyAccount.call(void 0, address);
|
|
127
|
+
const account = await _chunk4Q6QCALPcjs.createSmartAccount.call(void 0,
|
|
128
|
+
signerAccount,
|
|
131
129
|
sessionOwner.account,
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
rhinestoneApiKey
|
|
131
|
+
);
|
|
132
|
+
const sessionDetails = await _chunk4Q6QCALPcjs.signSessionDetails.call(void 0,
|
|
133
|
+
account,
|
|
134
|
+
prepared.sessionDetailsUnsigned,
|
|
135
|
+
sessionOwner.account
|
|
134
136
|
);
|
|
135
137
|
setState({ type: "registering" });
|
|
136
138
|
await service.registerAccount({
|
|
137
139
|
address: smartAccount,
|
|
138
140
|
accountParams: {
|
|
139
|
-
factory:
|
|
140
|
-
factoryData:
|
|
141
|
+
factory: prepared.accountParams.factory,
|
|
142
|
+
factoryData: prepared.accountParams.factoryData,
|
|
141
143
|
sessionDetails
|
|
142
144
|
},
|
|
143
145
|
eoaAddress: address,
|
|
@@ -206,7 +208,7 @@ function SetupStep({
|
|
|
206
208
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
207
209
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
208
210
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
211
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
210
212
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
211
213
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
212
214
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -243,7 +245,7 @@ function SetupStep({
|
|
|
243
245
|
] })
|
|
244
246
|
] })
|
|
245
247
|
] }),
|
|
246
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
248
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
247
249
|
] });
|
|
248
250
|
}
|
|
249
251
|
|
|
@@ -266,7 +268,7 @@ function AssetSelectStep({
|
|
|
266
268
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
267
269
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
268
270
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
269
|
-
return
|
|
271
|
+
return _chunk4Q6QCALPcjs.getAssetId.call(void 0, {
|
|
270
272
|
chainId: defaultSourceChain,
|
|
271
273
|
token: defaultSourceToken
|
|
272
274
|
});
|
|
@@ -283,7 +285,7 @@ function AssetSelectStep({
|
|
|
283
285
|
try {
|
|
284
286
|
const portfolio = await service.fetchPortfolio(address);
|
|
285
287
|
if (!active) return;
|
|
286
|
-
const portfolioAssets =
|
|
288
|
+
const portfolioAssets = _chunk4Q6QCALPcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
287
289
|
setAssets(portfolioAssets);
|
|
288
290
|
const hasNative = portfolioAssets.some(
|
|
289
291
|
(asset) => asset.token.toLowerCase() === _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -351,7 +353,7 @@ function AssetSelectStep({
|
|
|
351
353
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
352
354
|
const numeric = Number(raw);
|
|
353
355
|
if (!Number.isFinite(numeric)) return raw;
|
|
354
|
-
return
|
|
356
|
+
return _chunk4Q6QCALPcjs.tokenFormatter.format(numeric);
|
|
355
357
|
} catch (e3) {
|
|
356
358
|
return asset.balance;
|
|
357
359
|
}
|
|
@@ -365,7 +367,7 @@ function AssetSelectStep({
|
|
|
365
367
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
366
368
|
children: [
|
|
367
369
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
368
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
369
371
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
370
372
|
] }),
|
|
371
373
|
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 +457,7 @@ function AssetSelectStep({
|
|
|
455
457
|
] })
|
|
456
458
|
] })
|
|
457
459
|
] }),
|
|
458
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ?
|
|
460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ? _chunk4Q6QCALPcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
459
461
|
]
|
|
460
462
|
},
|
|
461
463
|
asset.id
|
|
@@ -465,7 +467,7 @@ function AssetSelectStep({
|
|
|
465
467
|
}
|
|
466
468
|
),
|
|
467
469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
468
|
-
|
|
470
|
+
_chunk4Q6QCALPcjs.Button,
|
|
469
471
|
{
|
|
470
472
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
471
473
|
disabled: !selectedAsset,
|
|
@@ -473,7 +475,7 @@ function AssetSelectStep({
|
|
|
473
475
|
children: "Continue"
|
|
474
476
|
}
|
|
475
477
|
) }),
|
|
476
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
478
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
477
479
|
] });
|
|
478
480
|
}
|
|
479
481
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -481,7 +483,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
481
483
|
const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
|
|
482
484
|
if (!connectedChainId) return [];
|
|
483
485
|
if (!_chunkCEIWN53Ncjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
484
|
-
const id =
|
|
486
|
+
const id = _chunk4Q6QCALPcjs.getAssetId.call(void 0, {
|
|
485
487
|
chainId: connectedChainId,
|
|
486
488
|
token: _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
487
489
|
});
|
|
@@ -561,7 +563,7 @@ function AmountStep({
|
|
|
561
563
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
562
564
|
if (!balanceTarget || !publicClient) return;
|
|
563
565
|
try {
|
|
564
|
-
const bal =
|
|
566
|
+
const bal = _chunk4Q6QCALPcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
565
567
|
address: asset.token,
|
|
566
568
|
abi: _viem.erc20Abi,
|
|
567
569
|
functionName: "balanceOf",
|
|
@@ -622,7 +624,7 @@ function AmountStep({
|
|
|
622
624
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
623
625
|
const numeric = Number(raw);
|
|
624
626
|
if (!Number.isFinite(numeric)) return raw;
|
|
625
|
-
return
|
|
627
|
+
return _chunk4Q6QCALPcjs.tokenFormatter.format(numeric);
|
|
626
628
|
} catch (e8) {
|
|
627
629
|
return "...";
|
|
628
630
|
}
|
|
@@ -636,7 +638,7 @@ function AmountStep({
|
|
|
636
638
|
}, [amountUsd, tokenPriceUsd]);
|
|
637
639
|
const formattedTokenAmount = _react.useMemo.call(void 0, () => {
|
|
638
640
|
if (tokenAmount === null) return "0.00";
|
|
639
|
-
return
|
|
641
|
+
return _chunk4Q6QCALPcjs.tokenFormatter.format(tokenAmount);
|
|
640
642
|
}, [tokenAmount]);
|
|
641
643
|
const targetSymbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
642
644
|
const handlePresetClick = (percentage) => {
|
|
@@ -653,13 +655,13 @@ function AmountStep({
|
|
|
653
655
|
}
|
|
654
656
|
if (_optionalChain([uiConfig, 'optionalAccess', _13 => _13.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
655
657
|
setError(
|
|
656
|
-
`Maximum deposit is ${
|
|
658
|
+
`Maximum deposit is ${_chunk4Q6QCALPcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
657
659
|
);
|
|
658
660
|
return;
|
|
659
661
|
}
|
|
660
662
|
if (_optionalChain([uiConfig, 'optionalAccess', _14 => _14.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
661
663
|
setError(
|
|
662
|
-
`Minimum deposit is ${
|
|
664
|
+
`Minimum deposit is ${_chunk4Q6QCALPcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
663
665
|
);
|
|
664
666
|
return;
|
|
665
667
|
}
|
|
@@ -729,7 +731,7 @@ function AmountStep({
|
|
|
729
731
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
730
732
|
" ",
|
|
731
733
|
"(",
|
|
732
|
-
|
|
734
|
+
_chunk4Q6QCALPcjs.currencyFormatter.format(balanceUsd),
|
|
733
735
|
")"
|
|
734
736
|
] })
|
|
735
737
|
] }) })
|
|
@@ -872,7 +874,7 @@ function AmountStep({
|
|
|
872
874
|
" to continue."
|
|
873
875
|
] }),
|
|
874
876
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
875
|
-
|
|
877
|
+
_chunk4Q6QCALPcjs.Button,
|
|
876
878
|
{
|
|
877
879
|
variant: "outline",
|
|
878
880
|
size: "small",
|
|
@@ -905,7 +907,7 @@ function AmountStep({
|
|
|
905
907
|
] })
|
|
906
908
|
] }),
|
|
907
909
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
908
|
-
|
|
910
|
+
_chunk4Q6QCALPcjs.Button,
|
|
909
911
|
{
|
|
910
912
|
onClick: handleContinue,
|
|
911
913
|
fullWidth: true,
|
|
@@ -913,7 +915,7 @@ function AmountStep({
|
|
|
913
915
|
children: "Continue"
|
|
914
916
|
}
|
|
915
917
|
) }),
|
|
916
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
918
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
917
919
|
] });
|
|
918
920
|
}
|
|
919
921
|
|
|
@@ -1023,7 +1025,7 @@ function ConfirmStep({
|
|
|
1023
1025
|
throw new Error("Wallet not properly connected");
|
|
1024
1026
|
}
|
|
1025
1027
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1026
|
-
const hash =
|
|
1028
|
+
const hash = _chunk4Q6QCALPcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1027
1029
|
account,
|
|
1028
1030
|
chain,
|
|
1029
1031
|
to: transferTo,
|
|
@@ -1040,7 +1042,7 @@ function ConfirmStep({
|
|
|
1040
1042
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1041
1043
|
} catch (err) {
|
|
1042
1044
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1043
|
-
const message =
|
|
1045
|
+
const message = _chunk4Q6QCALPcjs.formatUserError.call(void 0, raw);
|
|
1044
1046
|
setError(message);
|
|
1045
1047
|
_optionalChain([onError, 'optionalCall', _18 => _18(message, "TRANSFER_ERROR")]);
|
|
1046
1048
|
} finally {
|
|
@@ -1054,7 +1056,7 @@ function ConfirmStep({
|
|
|
1054
1056
|
await switchChain(asset.chainId);
|
|
1055
1057
|
} catch (err) {
|
|
1056
1058
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1057
|
-
setError(
|
|
1059
|
+
setError(_chunk4Q6QCALPcjs.formatUserError.call(void 0, raw));
|
|
1058
1060
|
} finally {
|
|
1059
1061
|
setIsSwitching(false);
|
|
1060
1062
|
}
|
|
@@ -1159,7 +1161,7 @@ function ConfirmStep({
|
|
|
1159
1161
|
] }),
|
|
1160
1162
|
receiveAmountUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
1161
1163
|
/* @__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:
|
|
1164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: _chunk4Q6QCALPcjs.currencyFormatter.format(receiveAmountUsd) })
|
|
1163
1165
|
] })
|
|
1164
1166
|
] }),
|
|
1165
1167
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
|
|
@@ -1169,7 +1171,7 @@ function ConfirmStep({
|
|
|
1169
1171
|
" to sign."
|
|
1170
1172
|
] }),
|
|
1171
1173
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1172
|
-
|
|
1174
|
+
_chunk4Q6QCALPcjs.Button,
|
|
1173
1175
|
{
|
|
1174
1176
|
variant: "outline",
|
|
1175
1177
|
size: "small",
|
|
@@ -1202,7 +1204,7 @@ function ConfirmStep({
|
|
|
1202
1204
|
] })
|
|
1203
1205
|
] }),
|
|
1204
1206
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1205
|
-
|
|
1207
|
+
_chunk4Q6QCALPcjs.Button,
|
|
1206
1208
|
{
|
|
1207
1209
|
onClick: handleConfirm,
|
|
1208
1210
|
loading: isSubmitting,
|
|
@@ -1211,7 +1213,7 @@ function ConfirmStep({
|
|
|
1211
1213
|
children: "Confirm Order"
|
|
1212
1214
|
}
|
|
1213
1215
|
) }),
|
|
1214
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1216
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
1215
1217
|
] });
|
|
1216
1218
|
}
|
|
1217
1219
|
|
|
@@ -1416,7 +1418,7 @@ function DepositAddressStep({
|
|
|
1416
1418
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1417
1419
|
if (cancelled || depositHandledRef.current) return;
|
|
1418
1420
|
const event = status.lastEvent;
|
|
1419
|
-
const eventTxHash =
|
|
1421
|
+
const eventTxHash = _chunk4Q6QCALPcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunk4Q6QCALPcjs.getEventTxHash.call(void 0, event), 'optionalAccess', _22 => _22.toLowerCase, 'call', _23 => _23()]), () => ( null)) : null;
|
|
1420
1422
|
if (baselineTxHash === void 0) {
|
|
1421
1423
|
baselineTxHash = eventTxHash;
|
|
1422
1424
|
} else if (eventTxHash && eventTxHash !== baselineTxHash) {
|
|
@@ -1629,7 +1631,7 @@ function DepositAddressStep({
|
|
|
1629
1631
|
] }),
|
|
1630
1632
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1631
1633
|
] }) }),
|
|
1632
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1634
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
1633
1635
|
] });
|
|
1634
1636
|
}
|
|
1635
1637
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1716,7 +1718,7 @@ function DepositFlow({
|
|
|
1716
1718
|
return {
|
|
1717
1719
|
ownerAddress: dappAddress,
|
|
1718
1720
|
walletClient: void 0,
|
|
1719
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1721
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, targetChain))),
|
|
1720
1722
|
switchChain: void 0
|
|
1721
1723
|
};
|
|
1722
1724
|
}
|
|
@@ -1725,7 +1727,7 @@ function DepositFlow({
|
|
|
1725
1727
|
return {
|
|
1726
1728
|
ownerAddress: dappWalletClient.account.address,
|
|
1727
1729
|
walletClient: dappWalletClient,
|
|
1728
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1730
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1729
1731
|
switchChain: dappSwitchChain
|
|
1730
1732
|
};
|
|
1731
1733
|
}
|
|
@@ -1735,7 +1737,7 @@ function DepositFlow({
|
|
|
1735
1737
|
return {
|
|
1736
1738
|
ownerAddress: dappWalletClient.account.address,
|
|
1737
1739
|
walletClient: dappWalletClient,
|
|
1738
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1740
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1739
1741
|
switchChain: dappSwitchChain
|
|
1740
1742
|
};
|
|
1741
1743
|
}
|
|
@@ -1943,7 +1945,7 @@ function DepositFlow({
|
|
|
1943
1945
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1944
1946
|
if (showConnectStep) {
|
|
1945
1947
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1946
|
-
|
|
1948
|
+
_chunk4Q6QCALPcjs.ConnectStep,
|
|
1947
1949
|
{
|
|
1948
1950
|
walletOptions,
|
|
1949
1951
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1996,7 +1998,7 @@ function DepositFlow({
|
|
|
1996
1998
|
}
|
|
1997
1999
|
),
|
|
1998
2000
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1999
|
-
|
|
2001
|
+
_chunk4Q6QCALPcjs.ProcessingStep,
|
|
2000
2002
|
{
|
|
2001
2003
|
smartAccount: step.smartAccount,
|
|
2002
2004
|
txHash: step.txHash,
|
|
@@ -2027,7 +2029,7 @@ function DepositFlow({
|
|
|
2027
2029
|
if (_optionalChain([signerContext, 'access', _58 => _58.publicClient, 'access', _59 => _59.chain, 'optionalAccess', _60 => _60.id]) === chainId) {
|
|
2028
2030
|
return signerContext.publicClient;
|
|
2029
2031
|
}
|
|
2030
|
-
return
|
|
2032
|
+
return _chunk4Q6QCALPcjs.getPublicClient.call(void 0, chainId);
|
|
2031
2033
|
};
|
|
2032
2034
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
2033
2035
|
step.type === "setup" && targetChainObj && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2095,7 +2097,7 @@ function DepositFlow({
|
|
|
2095
2097
|
}
|
|
2096
2098
|
),
|
|
2097
2099
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2098
|
-
|
|
2100
|
+
_chunk4Q6QCALPcjs.ProcessingStep,
|
|
2099
2101
|
{
|
|
2100
2102
|
smartAccount: step.smartAccount,
|
|
2101
2103
|
txHash: step.txHash,
|
|
@@ -2120,7 +2122,7 @@ function DepositFlow({
|
|
|
2120
2122
|
// src/DepositModal.tsx
|
|
2121
2123
|
|
|
2122
2124
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2123
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
2125
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-NKDYLTKD.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2124
2126
|
);
|
|
2125
2127
|
function DepositModal(props) {
|
|
2126
2128
|
const needsReown = !!props.reownAppId;
|
|
@@ -2171,10 +2173,10 @@ function DepositModalInner({
|
|
|
2171
2173
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2172
2174
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
2173
2175
|
const sourceChain = sourceChainProp ? _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2174
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2176
|
+
const service = _react.useMemo.call(void 0, () => _chunk4Q6QCALPcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2175
2177
|
_react.useEffect.call(void 0, () => {
|
|
2176
2178
|
if (isOpen && modalRef.current) {
|
|
2177
|
-
|
|
2179
|
+
_chunk4Q6QCALPcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
2178
2180
|
}
|
|
2179
2181
|
}, [isOpen, theme]);
|
|
2180
2182
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -2210,7 +2212,7 @@ function DepositModalInner({
|
|
|
2210
2212
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _69 => _69.title]), () => ( "Deposit"));
|
|
2211
2213
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
2212
2214
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2213
|
-
|
|
2215
|
+
_chunk4Q6QCALPcjs.Modal,
|
|
2214
2216
|
{
|
|
2215
2217
|
isOpen,
|
|
2216
2218
|
onClose,
|
|
@@ -2271,7 +2273,7 @@ function DepositModalInner({
|
|
|
2271
2273
|
balanceTitle,
|
|
2272
2274
|
":"
|
|
2273
2275
|
] }),
|
|
2274
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
2276
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _chunk4Q6QCALPcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
2275
2277
|
] })
|
|
2276
2278
|
] }),
|
|
2277
2279
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isNativeAsset,
|
|
21
21
|
loadSessionOwnerFromStorage,
|
|
22
22
|
saveSessionOwnerToStorage
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3FK5FAUL.mjs";
|
|
24
24
|
import {
|
|
25
25
|
CHAIN_BY_ID,
|
|
26
26
|
DEFAULT_BACKEND_URL,
|
|
@@ -1307,7 +1307,7 @@ function WithdrawFlow({
|
|
|
1307
1307
|
// src/WithdrawModal.tsx
|
|
1308
1308
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1309
1309
|
var ReownWithdrawInner = lazy(
|
|
1310
|
-
() => import("./WithdrawModalReown-
|
|
1310
|
+
() => import("./WithdrawModalReown-244RQ5FZ.mjs").then((m) => ({
|
|
1311
1311
|
default: m.WithdrawModalReown
|
|
1312
1312
|
}))
|
|
1313
1313
|
);
|
|
@@ -13,19 +13,17 @@ import {
|
|
|
13
13
|
createViewOnlyAccount,
|
|
14
14
|
currencyFormatter,
|
|
15
15
|
formatUserError,
|
|
16
|
-
getAccountAddress,
|
|
17
|
-
getAccountInitData,
|
|
18
16
|
getAssetId,
|
|
19
17
|
getEventTxHash,
|
|
20
18
|
getPublicClient,
|
|
21
|
-
getSessionDetails,
|
|
22
19
|
isDepositEvent,
|
|
23
20
|
isNativeAsset,
|
|
24
21
|
loadSessionOwnerFromStorage,
|
|
25
22
|
portfolioToAssets,
|
|
26
23
|
saveSessionOwnerToStorage,
|
|
24
|
+
signSessionDetails,
|
|
27
25
|
tokenFormatter
|
|
28
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3FK5FAUL.mjs";
|
|
29
27
|
import {
|
|
30
28
|
CHAIN_BY_ID,
|
|
31
29
|
DEFAULT_BACKEND_URL,
|
|
@@ -103,14 +101,16 @@ function SetupStep({
|
|
|
103
101
|
}
|
|
104
102
|
try {
|
|
105
103
|
setState({ type: "creating-account" });
|
|
106
|
-
const signerAccount = walletClient ? walletClientToAccount(walletClient) : createViewOnlyAccount(address);
|
|
107
104
|
const sessionOwner = await resolveSessionOwner(address);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
sessionOwner.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
const prepared = await service.prepareAccount({
|
|
106
|
+
ownerAddress: address,
|
|
107
|
+
sessionOwnerAddress: sessionOwner.address,
|
|
108
|
+
targetChain,
|
|
109
|
+
targetToken,
|
|
110
|
+
signerAddress,
|
|
111
|
+
sessionChainIds
|
|
112
|
+
});
|
|
113
|
+
const smartAccount = prepared.smartAccount;
|
|
114
114
|
setState({ type: "checking" });
|
|
115
115
|
const checkResult = await service.checkAccount(smartAccount);
|
|
116
116
|
if (checkResult.isRegistered && !forceRegister) {
|
|
@@ -123,21 +123,23 @@ function SetupStep({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
setState({ type: "signing-session" });
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
targetChainObj,
|
|
130
|
-
signerAddress,
|
|
126
|
+
const signerAccount = walletClient ? walletClientToAccount(walletClient) : createViewOnlyAccount(address);
|
|
127
|
+
const account = await createSmartAccount(
|
|
128
|
+
signerAccount,
|
|
131
129
|
sessionOwner.account,
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
rhinestoneApiKey
|
|
131
|
+
);
|
|
132
|
+
const sessionDetails = await signSessionDetails(
|
|
133
|
+
account,
|
|
134
|
+
prepared.sessionDetailsUnsigned,
|
|
135
|
+
sessionOwner.account
|
|
134
136
|
);
|
|
135
137
|
setState({ type: "registering" });
|
|
136
138
|
await service.registerAccount({
|
|
137
139
|
address: smartAccount,
|
|
138
140
|
accountParams: {
|
|
139
|
-
factory:
|
|
140
|
-
factoryData:
|
|
141
|
+
factory: prepared.accountParams.factory,
|
|
142
|
+
factoryData: prepared.accountParams.factoryData,
|
|
141
143
|
sessionDetails
|
|
142
144
|
},
|
|
143
145
|
eoaAddress: address,
|
|
@@ -2120,7 +2122,7 @@ function DepositFlow({
|
|
|
2120
2122
|
// src/DepositModal.tsx
|
|
2121
2123
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2122
2124
|
var ReownDepositInner = lazy(
|
|
2123
|
-
() => import("./DepositModalReown-
|
|
2125
|
+
() => import("./DepositModalReown-4WZF2HMJ.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
2124
2126
|
);
|
|
2125
2127
|
function DepositModal(props) {
|
|
2126
2128
|
const needsReown = !!props.reownAppId;
|
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 _chunk7QCFFKB5cjs = require('./chunk-7QCFFKB5.cjs');
|
|
4
|
+
require('./chunk-4Q6QCALP.cjs');
|
|
5
5
|
require('./chunk-CEIWN53N.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunk7QCFFKB5cjs.DepositModal;
|
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 _chunk7QCFFKB5cjs = require('./chunk-7QCFFKB5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunk4WULBRUAcjs = require('./chunk-4WULBRUA.cjs');
|
|
7
|
+
require('./chunk-4Q6QCALP.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 = _chunk7QCFFKB5cjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkCEIWN53Ncjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkCEIWN53Ncjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunk4WULBRUAcjs.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.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W42B54IA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
WithdrawModal
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-DJAUNNEW.mjs";
|
|
7
|
+
import "./chunk-3FK5FAUL.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CHAIN_BY_ID,
|
|
10
10
|
DEFAULT_BACKEND_URL,
|
package/dist/reown.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7QCFFKB5cjs = require('./chunk-7QCFFKB5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunk4WULBRUAcjs = require('./chunk-4WULBRUA.cjs');
|
|
7
|
+
require('./chunk-4Q6QCALP.cjs');
|
|
8
8
|
require('./chunk-CEIWN53N.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.DepositModal =
|
|
12
|
+
exports.DepositModal = _chunk7QCFFKB5cjs.DepositModal; exports.WithdrawModal = _chunk4WULBRUAcjs.WithdrawModal;
|
package/dist/reown.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W42B54IA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
WithdrawModal
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-DJAUNNEW.mjs";
|
|
7
|
+
import "./chunk-3FK5FAUL.mjs";
|
|
8
8
|
import "./chunk-A6QLADED.mjs";
|
|
9
9
|
export {
|
|
10
10
|
DepositModal,
|
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 _chunk4WULBRUAcjs = require('./chunk-4WULBRUA.cjs');
|
|
4
|
+
require('./chunk-4Q6QCALP.cjs');
|
|
5
5
|
require('./chunk-CEIWN53N.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.WithdrawModal =
|
|
8
|
+
exports.WithdrawModal = _chunk4WULBRUAcjs.WithdrawModal;
|
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.26",
|
|
4
4
|
"description": "React modal component for Rhinestone cross-chain deposits",
|
|
5
5
|
"author": "Rhinestone <dev@rhinestone.wtf>",
|
|
6
6
|
"bugs": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"viem": ">=2"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@rhinestone/sdk": "^1.2.
|
|
68
|
+
"@rhinestone/sdk": "^1.2.14",
|
|
69
69
|
"@rhinestone/shared-configs": "^1.4.93",
|
|
70
70
|
"@reown/appkit": "^1.8.17",
|
|
71
71
|
"@reown/appkit-adapter-wagmi": "^1.8.17",
|