@rhinestone/deposit-modal 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-NGYZ4G7Q.cjs → DepositModalReown-4PFOMSC6.cjs} +4 -4
- package/dist/{DepositModalReown-PFKTSKDS.mjs → DepositModalReown-BVHWFWIG.mjs} +3 -3
- package/dist/{WithdrawModalReown-6AAWH35J.mjs → WithdrawModalReown-CJCNT7SA.mjs} +3 -3
- package/dist/{WithdrawModalReown-BA6ECON3.cjs → WithdrawModalReown-YREQR7DV.cjs} +4 -4
- package/dist/{chunk-7MQU2SR7.cjs → chunk-5QJNOPNF.cjs} +164 -171
- package/dist/{chunk-QWYZJL3L.cjs → chunk-7ZCUANBT.cjs} +40 -61
- package/dist/{chunk-XIS33BZ6.cjs → chunk-CPIQJR47.cjs} +82 -87
- package/dist/{chunk-A6QLADED.mjs → chunk-CSQRKM4Y.mjs} +123 -2
- package/dist/{chunk-CEIWN53N.cjs → chunk-DLYVHOME.cjs} +130 -9
- package/dist/{chunk-QCRZCGAE.mjs → chunk-K6YG3I6O.mjs} +21 -26
- package/dist/{chunk-YOFGP4FV.mjs → chunk-N6T4TKXI.mjs} +12 -33
- package/dist/{chunk-AJALMXW4.mjs → chunk-XTTTHW3W.mjs} +22 -29
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +11 -2
- package/dist/constants.d.ts +11 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.mjs +4 -4
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +56 -9
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkDLYVHOMEcjs = require('./chunk-DLYVHOME.cjs');
|
|
12
12
|
|
|
13
13
|
// src/components/ui/Modal.tsx
|
|
14
14
|
|
|
@@ -180,12 +180,16 @@ function normalizeSessionTypedData(raw) {
|
|
|
180
180
|
}
|
|
181
181
|
return data;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function normalizeSetupAccountResponse(raw) {
|
|
184
184
|
const data = raw;
|
|
185
185
|
return {
|
|
186
186
|
smartAccount: data.smartAccount,
|
|
187
|
+
isRegistered: data.isRegistered,
|
|
188
|
+
targetChain: data.targetChain,
|
|
189
|
+
targetToken: data.targetToken,
|
|
190
|
+
needsRegistration: data.needsRegistration,
|
|
187
191
|
accountParams: data.accountParams,
|
|
188
|
-
sessionDetailsUnsigned: {
|
|
192
|
+
sessionDetailsUnsigned: data.sessionDetailsUnsigned ? {
|
|
189
193
|
hashesAndChainIds: data.sessionDetailsUnsigned.hashesAndChainIds.map(
|
|
190
194
|
(h) => ({
|
|
191
195
|
chainId: toBigInt(h.chainId),
|
|
@@ -193,7 +197,7 @@ function normalizePrepareAccountResponse(raw) {
|
|
|
193
197
|
})
|
|
194
198
|
),
|
|
195
199
|
data: normalizeSessionTypedData(data.sessionDetailsUnsigned.data)
|
|
196
|
-
}
|
|
200
|
+
} : void 0
|
|
197
201
|
};
|
|
198
202
|
}
|
|
199
203
|
function buildSessionDetails(unsigned, signature) {
|
|
@@ -212,22 +216,8 @@ function createDepositService(baseUrl) {
|
|
|
212
216
|
return `${normalizedBaseUrl}${normalizedPath}`;
|
|
213
217
|
}
|
|
214
218
|
return {
|
|
215
|
-
async
|
|
216
|
-
const response = await fetch(apiUrl("/
|
|
217
|
-
method: "POST",
|
|
218
|
-
headers: { "Content-Type": "application/json" },
|
|
219
|
-
body: JSON.stringify({ ownerAddress, sessionOwnerAddress })
|
|
220
|
-
});
|
|
221
|
-
if (!response.ok) {
|
|
222
|
-
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
223
|
-
throw new Error(
|
|
224
|
-
error.error || `Compute address failed: ${response.status}`
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
return response.json();
|
|
228
|
-
},
|
|
229
|
-
async prepareAccount(params) {
|
|
230
|
-
const response = await fetch(apiUrl("/prepare-account"), {
|
|
219
|
+
async setupAccount(params) {
|
|
220
|
+
const response = await fetch(apiUrl("/setup-account"), {
|
|
231
221
|
method: "POST",
|
|
232
222
|
headers: { "Content-Type": "application/json" },
|
|
233
223
|
body: JSON.stringify(params)
|
|
@@ -235,10 +225,10 @@ function createDepositService(baseUrl) {
|
|
|
235
225
|
if (!response.ok) {
|
|
236
226
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
237
227
|
throw new Error(
|
|
238
|
-
error.error || `
|
|
228
|
+
error.error || `Setup account failed: ${response.status}`
|
|
239
229
|
);
|
|
240
230
|
}
|
|
241
|
-
return
|
|
231
|
+
return normalizeSetupAccountResponse(await response.json());
|
|
242
232
|
},
|
|
243
233
|
async registerAccount(params) {
|
|
244
234
|
const { eoaAddress, sessionOwner, ...account } = params;
|
|
@@ -262,17 +252,6 @@ function createDepositService(baseUrl) {
|
|
|
262
252
|
}
|
|
263
253
|
return response.json();
|
|
264
254
|
},
|
|
265
|
-
async checkAccount(address) {
|
|
266
|
-
const response = await fetch(apiUrl(`/check/${address}`), {
|
|
267
|
-
method: "GET",
|
|
268
|
-
headers: { "Content-Type": "application/json" }
|
|
269
|
-
});
|
|
270
|
-
if (!response.ok) {
|
|
271
|
-
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
272
|
-
throw new Error(error.error || `Check failed: ${response.status}`);
|
|
273
|
-
}
|
|
274
|
-
return response.json();
|
|
275
|
-
},
|
|
276
255
|
async fetchPortfolio(address) {
|
|
277
256
|
const response = await fetch(apiUrl(`/portfolio/${address}`), {
|
|
278
257
|
method: "GET",
|
|
@@ -382,24 +361,24 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
382
361
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _4 => _4.balance, 'optionalAccess', _5 => _5.unlocked]), () => ( "0"));
|
|
383
362
|
const normalizedName = tokenData.tokenName.trim();
|
|
384
363
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
385
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
386
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
364
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkDLYVHOMEcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
365
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkDLYVHOMEcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
387
366
|
if (!resolvedTokenAddress) {
|
|
388
367
|
continue;
|
|
389
368
|
}
|
|
390
|
-
if (!
|
|
369
|
+
if (!_chunkDLYVHOMEcjs.isSupportedTokenAddressForChain.call(void 0,
|
|
391
370
|
resolvedTokenAddress,
|
|
392
371
|
chainBalance.chainId
|
|
393
372
|
)) {
|
|
394
373
|
continue;
|
|
395
374
|
}
|
|
396
|
-
const symbol =
|
|
375
|
+
const symbol = _chunkDLYVHOMEcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
397
376
|
tokens.push({
|
|
398
377
|
chainId: chainBalance.chainId,
|
|
399
378
|
address: resolvedTokenAddress,
|
|
400
379
|
symbol,
|
|
401
380
|
name: symbol,
|
|
402
|
-
decimals:
|
|
381
|
+
decimals: _chunkDLYVHOMEcjs.getTokenDecimalsByAddress.call(void 0,
|
|
403
382
|
resolvedTokenAddress,
|
|
404
383
|
chainBalance.chainId
|
|
405
384
|
),
|
|
@@ -423,17 +402,17 @@ function normalizeDirectToken(token) {
|
|
|
423
402
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
424
403
|
token.token,
|
|
425
404
|
"address"
|
|
426
|
-
))), () => (
|
|
405
|
+
))), () => ( _chunkDLYVHOMEcjs.getTokenAddress.call(void 0, symbol, chainId)));
|
|
427
406
|
if (!address) return null;
|
|
428
407
|
const addressAsToken = address;
|
|
429
|
-
if (!
|
|
408
|
+
if (!_chunkDLYVHOMEcjs.isSupportedTokenAddressForChain.call(void 0, addressAsToken, chainId)) return null;
|
|
430
409
|
const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
|
|
431
410
|
return {
|
|
432
411
|
chainId,
|
|
433
412
|
address: addressAsToken,
|
|
434
|
-
symbol:
|
|
435
|
-
name:
|
|
436
|
-
decimals:
|
|
413
|
+
symbol: _chunkDLYVHOMEcjs.getTokenSymbol.call(void 0, addressAsToken, chainId),
|
|
414
|
+
name: _chunkDLYVHOMEcjs.getTokenSymbol.call(void 0, addressAsToken, chainId),
|
|
415
|
+
decimals: _chunkDLYVHOMEcjs.getTokenDecimalsByAddress.call(void 0, addressAsToken, chainId),
|
|
437
416
|
balance: balanceValue,
|
|
438
417
|
balanceUsd
|
|
439
418
|
};
|
|
@@ -1200,8 +1179,8 @@ function ProcessingStep({
|
|
|
1200
1179
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1201
1180
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1202
1181
|
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _70 => _70.data, 'optionalAccess', _71 => _71.destination, 'optionalAccess', _72 => _72.transactionHash]) || null;
|
|
1203
|
-
const sourceExplorerUrl =
|
|
1204
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1182
|
+
const sourceExplorerUrl = _chunkDLYVHOMEcjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1183
|
+
const destExplorerUrl = destinationTxHash ? _chunkDLYVHOMEcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1205
1184
|
const truncateHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-8)}`;
|
|
1206
1185
|
const formatElapsedTime = (seconds) => {
|
|
1207
1186
|
if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
|
|
@@ -1209,8 +1188,8 @@ function ProcessingStep({
|
|
|
1209
1188
|
const secs = seconds % 60;
|
|
1210
1189
|
return `${mins}m ${secs}s`;
|
|
1211
1190
|
};
|
|
1212
|
-
const targetSymbol =
|
|
1213
|
-
const sourceDecimals =
|
|
1191
|
+
const targetSymbol = _chunkDLYVHOMEcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1192
|
+
const sourceDecimals = _chunkDLYVHOMEcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1214
1193
|
const formattedReceivedAmount = (() => {
|
|
1215
1194
|
try {
|
|
1216
1195
|
const raw = _viem.formatUnits.call(void 0, BigInt(amount), sourceDecimals);
|
|
@@ -1281,15 +1260,15 @@ function ProcessingStep({
|
|
|
1281
1260
|
className: "rs-card-value",
|
|
1282
1261
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1283
1262
|
children: [
|
|
1284
|
-
|
|
1263
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1285
1264
|
"img",
|
|
1286
1265
|
{
|
|
1287
|
-
src:
|
|
1266
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChain),
|
|
1288
1267
|
alt: "",
|
|
1289
1268
|
style: { width: 14, height: 14, borderRadius: "50%" }
|
|
1290
1269
|
}
|
|
1291
1270
|
),
|
|
1292
|
-
|
|
1271
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, sourceChain)
|
|
1293
1272
|
]
|
|
1294
1273
|
}
|
|
1295
1274
|
)
|
|
@@ -1302,15 +1281,15 @@ function ProcessingStep({
|
|
|
1302
1281
|
className: "rs-card-value",
|
|
1303
1282
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1304
1283
|
children: [
|
|
1305
|
-
|
|
1284
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1306
1285
|
"img",
|
|
1307
1286
|
{
|
|
1308
|
-
src:
|
|
1287
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain),
|
|
1309
1288
|
alt: "",
|
|
1310
1289
|
style: { width: 14, height: 14, borderRadius: "50%" }
|
|
1311
1290
|
}
|
|
1312
1291
|
),
|
|
1313
|
-
|
|
1292
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, targetChain)
|
|
1314
1293
|
]
|
|
1315
1294
|
}
|
|
1316
1295
|
)
|
|
@@ -1432,7 +1411,7 @@ function ProcessingStep({
|
|
|
1432
1411
|
{
|
|
1433
1412
|
className: `rs-step-description ${isError ? "rs-text-error" : "rs-text-secondary"}`,
|
|
1434
1413
|
children: [
|
|
1435
|
-
state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess', _73 => _73.type]) === "deposit-received" ? "Transfer received. Preparing bridge..." : _optionalChain([lastEvent, 'optionalAccess', _74 => _74.type]) === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${
|
|
1414
|
+
state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess', _73 => _73.type]) === "deposit-received" ? "Transfer received. Preparing bridge..." : _optionalChain([lastEvent, 'optionalAccess', _74 => _74.type]) === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${_chunkDLYVHOMEcjs.getChainName.call(void 0, targetChain)}.`),
|
|
1436
1415
|
state.type === "failed" && state.message,
|
|
1437
1416
|
state.type === "error" && state.message
|
|
1438
1417
|
]
|
|
@@ -1488,15 +1467,15 @@ function ProcessingStep({
|
|
|
1488
1467
|
className: "rs-card-value",
|
|
1489
1468
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1490
1469
|
children: [
|
|
1491
|
-
|
|
1470
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1492
1471
|
"img",
|
|
1493
1472
|
{
|
|
1494
|
-
src:
|
|
1473
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChain),
|
|
1495
1474
|
alt: "",
|
|
1496
1475
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1497
1476
|
}
|
|
1498
1477
|
),
|
|
1499
|
-
|
|
1478
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, sourceChain)
|
|
1500
1479
|
]
|
|
1501
1480
|
}
|
|
1502
1481
|
)
|
|
@@ -1509,15 +1488,15 @@ function ProcessingStep({
|
|
|
1509
1488
|
className: "rs-card-value",
|
|
1510
1489
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1511
1490
|
children: [
|
|
1512
|
-
|
|
1491
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1513
1492
|
"img",
|
|
1514
1493
|
{
|
|
1515
|
-
src:
|
|
1494
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain),
|
|
1516
1495
|
alt: "",
|
|
1517
1496
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1518
1497
|
}
|
|
1519
1498
|
),
|
|
1520
|
-
|
|
1499
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, targetChain)
|
|
1521
1500
|
]
|
|
1522
1501
|
}
|
|
1523
1502
|
)
|
|
@@ -1570,7 +1549,7 @@ var clientCache = /* @__PURE__ */ new Map();
|
|
|
1570
1549
|
function getPublicClient(chainId) {
|
|
1571
1550
|
let client = clientCache.get(chainId);
|
|
1572
1551
|
if (!client) {
|
|
1573
|
-
const chain =
|
|
1552
|
+
const chain = _chunkDLYVHOMEcjs.CHAIN_BY_ID[chainId];
|
|
1574
1553
|
client = _viem.createPublicClient.call(void 0, {
|
|
1575
1554
|
chain,
|
|
1576
1555
|
transport: _viem.http.call(void 0, )
|