@rhinestone/deposit-modal 0.9.0 → 0.10.0
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-6KUAO5ZC.mjs → DepositModalReown-MTWT6Y66.mjs} +5 -5
- package/dist/{DepositModalReown-XC5RIU7Z.cjs → DepositModalReown-S3DSFXTX.cjs} +9 -9
- package/dist/{chunk-4WB2FHGC.mjs → chunk-5NJYW5FT.mjs} +3 -3
- package/dist/{chunk-OSI2CFGL.mjs → chunk-5OEWGJR4.mjs} +1 -1
- package/dist/{chunk-VOGZAZB2.mjs → chunk-7TV7GLJB.mjs} +62 -1
- package/dist/{chunk-NMIMRASD.cjs → chunk-A42XAHIB.cjs} +66 -66
- package/dist/{chunk-PAGMU4RQ.cjs → chunk-DEF767BA.cjs} +52 -52
- package/dist/{chunk-LGVJWVSS.mjs → chunk-KW32UBUQ.mjs} +2 -2
- package/dist/{chunk-E4G5BOZP.mjs → chunk-LR7MKHYV.mjs} +2 -2
- package/dist/{chunk-KKHLNFSA.mjs → chunk-MHIOMTMM.mjs} +281 -119
- package/dist/{chunk-NEXUCY4B.cjs → chunk-NF4NBRUP.cjs} +1 -1
- package/dist/{chunk-VN4BLZYC.cjs → chunk-PUJHXHRA.cjs} +108 -47
- package/dist/{chunk-DIX7M3SP.cjs → chunk-UMCDZJMG.cjs} +57 -57
- package/dist/{chunk-WYXBY2MQ.mjs → chunk-VDGT6NZQ.mjs} +1 -1
- package/dist/{chunk-T7LGQFP3.cjs → chunk-VTVOHNXM.cjs} +3 -3
- package/dist/{chunk-22RV33LK.cjs → chunk-W4YAOJPG.cjs} +621 -459
- package/dist/claim.cjs +5 -5
- package/dist/claim.mjs +4 -4
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +7 -7
- package/dist/styles.css +14 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-MHIOMTMM.mjs";
|
|
4
|
+
import "./chunk-VDGT6NZQ.mjs";
|
|
5
|
+
import "./chunk-KW32UBUQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isUnsupportedChainSwitchError,
|
|
8
8
|
rpcUrlFor
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-7TV7GLJB.mjs";
|
|
10
|
+
import "./chunk-5OEWGJR4.mjs";
|
|
11
11
|
import "./chunk-ILT2PITN.mjs";
|
|
12
12
|
import {
|
|
13
13
|
SUPPORTED_CHAINS,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkW4YAOJPGcjs = require('./chunk-W4YAOJPG.cjs');
|
|
4
|
+
require('./chunk-A42XAHIB.cjs');
|
|
5
|
+
require('./chunk-VTVOHNXM.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkPUJHXHRAcjs = require('./chunk-PUJHXHRA.cjs');
|
|
10
|
+
require('./chunk-NF4NBRUP.cjs');
|
|
11
11
|
require('./chunk-YEBXUUH3.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -88,14 +88,14 @@ function buildTransports(rpcUrls) {
|
|
|
88
88
|
const transports = {};
|
|
89
89
|
for (const network of EVM_NETWORKS) {
|
|
90
90
|
const id = Number(network.id);
|
|
91
|
-
transports[id] = _viem.http.call(void 0,
|
|
91
|
+
transports[id] = _viem.http.call(void 0, _chunkPUJHXHRAcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
92
92
|
}
|
|
93
93
|
return transports;
|
|
94
94
|
}
|
|
95
95
|
function getEvmRpcFingerprint(rpcUrls) {
|
|
96
96
|
return EVM_NETWORKS.map((network) => {
|
|
97
97
|
const id = Number(network.id);
|
|
98
|
-
return `${id}=${_nullishCoalesce(
|
|
98
|
+
return `${id}=${_nullishCoalesce(_chunkPUJHXHRAcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
99
99
|
}).join("|");
|
|
100
100
|
}
|
|
101
101
|
var cachedAdapter = null;
|
|
@@ -189,7 +189,7 @@ function useReownWallet() {
|
|
|
189
189
|
await switchChainAsync({ chainId });
|
|
190
190
|
}
|
|
191
191
|
} catch (err) {
|
|
192
|
-
if (
|
|
192
|
+
if (_chunkPUJHXHRAcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
193
193
|
throw new Error(
|
|
194
194
|
`Switch to ${_chunkH577RJN5cjs.getChainName.call(void 0, chainId)} in your wallet to continue`
|
|
195
195
|
);
|
|
@@ -223,7 +223,7 @@ function DepositModalWithReown(props) {
|
|
|
223
223
|
reown.disconnect();
|
|
224
224
|
}, [reown.disconnect]);
|
|
225
225
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
226
|
-
|
|
226
|
+
_chunkW4YAOJPGcjs.DepositModalInner,
|
|
227
227
|
{
|
|
228
228
|
...props,
|
|
229
229
|
reownWallet: reownWithSolana,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ListRow
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KW32UBUQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
AlertTriangleIcon,
|
|
6
6
|
BodyHeader,
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
formatUserError,
|
|
27
27
|
useLatestRef,
|
|
28
28
|
useStableRpcUrls
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-7TV7GLJB.mjs";
|
|
30
30
|
import {
|
|
31
31
|
SERVICE_HEADERS
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5OEWGJR4.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getChainIcon,
|
|
35
35
|
getChainName,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SERVICE_HEADERS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5OEWGJR4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
HYPERCORE_CHAIN_ID,
|
|
6
6
|
HYPERCORE_MAINNET_CAIP2,
|
|
@@ -1184,6 +1184,67 @@ function createDepositService(baseUrl, options) {
|
|
|
1184
1184
|
});
|
|
1185
1185
|
return { lastEvent };
|
|
1186
1186
|
},
|
|
1187
|
+
async getPositions(address) {
|
|
1188
|
+
const url = apiUrl(`/positions/${address}`);
|
|
1189
|
+
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1190
|
+
const response = await fetch(url, { headers: SERVICE_HEADERS });
|
|
1191
|
+
if (!response.ok) {
|
|
1192
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1193
|
+
debugError(debug, scope, "getPositions:failed", error, {
|
|
1194
|
+
status: response.status,
|
|
1195
|
+
address
|
|
1196
|
+
});
|
|
1197
|
+
throw new Error(
|
|
1198
|
+
error.error || `Position lookup failed: ${response.status}`
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
const result = await response.json();
|
|
1202
|
+
debugLog(debug, scope, "getPositions:success", {
|
|
1203
|
+
address,
|
|
1204
|
+
count: result.positions?.length ?? 0,
|
|
1205
|
+
totalUsd: result.totalUsd,
|
|
1206
|
+
failures: result.failures?.map((f) => f.venue)
|
|
1207
|
+
});
|
|
1208
|
+
return result;
|
|
1209
|
+
},
|
|
1210
|
+
async prepareUnwind(params) {
|
|
1211
|
+
const { address, account, market, chainId, asset, amount } = params;
|
|
1212
|
+
const url = apiUrl(`/positions/${address}/unwind`);
|
|
1213
|
+
debugLog(debug, scope, "prepareUnwind:request", {
|
|
1214
|
+
url,
|
|
1215
|
+
address,
|
|
1216
|
+
account,
|
|
1217
|
+
market,
|
|
1218
|
+
chainId,
|
|
1219
|
+
asset,
|
|
1220
|
+
amount
|
|
1221
|
+
});
|
|
1222
|
+
const response = await fetch(url, {
|
|
1223
|
+
method: "POST",
|
|
1224
|
+
headers: SERVICE_HEADERS,
|
|
1225
|
+
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1226
|
+
});
|
|
1227
|
+
if (!response.ok) {
|
|
1228
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1229
|
+
debugError(debug, scope, "prepareUnwind:failed", error, {
|
|
1230
|
+
status: response.status,
|
|
1231
|
+
address,
|
|
1232
|
+
market,
|
|
1233
|
+
asset
|
|
1234
|
+
});
|
|
1235
|
+
throw new Error(
|
|
1236
|
+
error.error || `Unwind preparation failed: ${response.status}`
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
const result = await response.json();
|
|
1240
|
+
debugLog(debug, scope, "prepareUnwind:success", {
|
|
1241
|
+
address,
|
|
1242
|
+
amount: result.amount,
|
|
1243
|
+
isFullExit: result.isFullExit,
|
|
1244
|
+
recipient: result.recipient
|
|
1245
|
+
});
|
|
1246
|
+
return result;
|
|
1247
|
+
},
|
|
1187
1248
|
async submitPolymarketWithdraw(params) {
|
|
1188
1249
|
const { depositWallet, owner, nonce, deadline, calls, signature } = params;
|
|
1189
1250
|
const url = apiUrl(`/polymarket/withdraw`);
|