@rhinestone/deposit-modal 0.12.2 → 0.14.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/README.md +73 -18
- package/bridge-transcript.json +653 -0
- package/dist/ClaimModal-IKTJU43Y.cjs +13 -0
- package/dist/ClaimModal-SEKNWRMA.mjs +13 -0
- package/dist/{DepositModalReown-VG66OTIU.cjs → DepositModalReown-46LPVFB6.cjs} +58 -35
- package/dist/{DepositModalReown-TEC3MEZ4.mjs → DepositModalReown-Q2JMLT47.mjs} +45 -22
- package/dist/{QRCode-WUC652SH.mjs → QRCode-5RGIZZHL.mjs} +1 -1
- package/dist/{QRCode-5DXFNKI2.cjs → QRCode-JKXG4RHN.cjs} +2 -2
- package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
- package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
- package/dist/{chunk-O7BCVQ6L.cjs → chunk-4KCSH4T3.cjs} +157 -199
- package/dist/chunk-6KG642KH.cjs +31 -0
- package/dist/{chunk-PWLEBV5V.cjs → chunk-7ICSHJFE.cjs} +296 -220
- package/dist/{chunk-J46WDSRD.mjs → chunk-7SR7ENVJ.mjs} +165 -89
- package/dist/{chunk-2TPSF77V.mjs → chunk-CFKC77SV.mjs} +455 -261
- package/dist/{chunk-75DVGSAX.cjs → chunk-DW2EQA2U.cjs} +6 -3
- package/dist/{chunk-FXXUIK4E.mjs → chunk-IN77XSWO.mjs} +899 -153
- package/dist/chunk-K4H6TGBE.mjs +31 -0
- package/dist/{chunk-SDSKIJC7.mjs → chunk-KTUVSKR4.mjs} +2410 -1177
- package/dist/{chunk-HL5NUKZW.cjs → chunk-LZFRL2AL.cjs} +3 -3
- package/dist/{chunk-UQIJU6HV.cjs → chunk-MTFJSE52.cjs} +499 -191
- package/dist/{chunk-FLVLYO64.mjs → chunk-PKML3XVS.mjs} +430 -122
- package/dist/{chunk-4ZXQPFNU.mjs → chunk-RN5VKWI6.mjs} +4 -1
- package/dist/{chunk-BRYNGLDM.cjs → chunk-V2OBGLJD.cjs} +961 -215
- package/dist/{chunk-3STTWRAN.mjs → chunk-VUATPOWJ.mjs} +147 -189
- package/dist/{chunk-JE4R5VA3.mjs → chunk-WUJIKCFU.mjs} +1 -1
- package/dist/chunk-X2IPAPXU.cjs +163 -0
- package/dist/{chunk-OIN4CXCP.cjs → chunk-YCQZJQO6.cjs} +2343 -1110
- package/dist/{chunk-TM7VGHAG.cjs → chunk-YWMWI7PZ.cjs} +462 -268
- package/dist/chunk-ZEO6ADM3.mjs +163 -0
- package/dist/claim.cjs +7 -6
- package/dist/claim.d.cts +11 -3
- package/dist/claim.d.ts +11 -3
- package/dist/claim.mjs +6 -5
- package/dist/{constants-FuzG3h4m.d.cts → constants-DBrWhJWE.d.cts} +12 -7
- package/dist/{constants-FuzG3h4m.d.ts → constants-DBrWhJWE.d.ts} +12 -7
- package/dist/constants.cjs +3 -9
- package/dist/constants.d.cts +2 -3
- package/dist/constants.d.ts +2 -3
- package/dist/constants.mjs +4 -10
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +7 -7
- package/dist/embed.cjs +1476 -0
- package/dist/embed.d.cts +183 -0
- package/dist/embed.d.ts +183 -0
- package/dist/embed.mjs +1476 -0
- package/dist/index.cjs +11 -16
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +14 -19
- package/dist/modal-ui-state-OD1RmKkK.d.cts +30 -0
- package/dist/modal-ui-state-OD1RmKkK.d.ts +30 -0
- package/dist/polymarket.cjs +17 -7
- package/dist/polymarket.mjs +13 -3
- package/dist/styles.css +124 -98
- package/dist/types-Bho4OA03.d.ts +982 -0
- package/dist/types-DP_3KwlD.d.cts +982 -0
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +11 -3
- package/dist/withdraw.d.ts +11 -3
- package/dist/withdraw.mjs +5 -5
- package/package.json +59 -6
- package/dist/chunk-IAGFDSNC.mjs +0 -11
- package/dist/chunk-L32UI7LA.cjs +0 -11
- package/dist/types-BO4iP6fG.d.cts +0 -612
- package/dist/types-oFblf65g.d.ts +0 -612
|
@@ -1,21 +1,23 @@
|
|
|
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 _chunkYCQZJQO6cjs = require('./chunk-YCQZJQO6.cjs');
|
|
4
|
+
require('./chunk-7ICSHJFE.cjs');
|
|
5
|
+
require('./chunk-LZFRL2AL.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var _chunkBRYNGLDMcjs = require('./chunk-BRYNGLDM.cjs');
|
|
13
|
-
require('./chunk-L32UI7LA.cjs');
|
|
14
|
-
require('./chunk-75DVGSAX.cjs');
|
|
15
12
|
|
|
16
13
|
|
|
14
|
+
var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
|
|
15
|
+
require('./chunk-6KG642KH.cjs');
|
|
16
|
+
require('./chunk-DW2EQA2U.cjs');
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunk4KCSH4T3cjs = require('./chunk-4KCSH4T3.cjs');
|
|
19
21
|
|
|
20
22
|
// src/DepositModalReown.tsx
|
|
21
23
|
var _react = require('react');
|
|
@@ -72,11 +74,11 @@ var APPKIT_NETWORK_BY_ID = {
|
|
|
72
74
|
[_networks.katana.id]: _networks.katana,
|
|
73
75
|
[_networks.hyperEvm.id]: _networks.hyperEvm
|
|
74
76
|
};
|
|
75
|
-
var EVM_NETWORKS =
|
|
76
|
-
const network = APPKIT_NETWORK_BY_ID[
|
|
77
|
+
var EVM_NETWORKS = _chunk4KCSH4T3cjs.SUPPORTED_CHAIN_IDS.map((chainId) => {
|
|
78
|
+
const network = APPKIT_NETWORK_BY_ID[chainId];
|
|
77
79
|
if (!network) {
|
|
78
80
|
throw new Error(
|
|
79
|
-
`[rhinestone] No AppKit network registered for supported chain ${
|
|
81
|
+
`[rhinestone] No AppKit network registered for supported chain ${chainId}. Add it to APPKIT_NETWORK_BY_ID in reown-networks.ts.`
|
|
80
82
|
);
|
|
81
83
|
}
|
|
82
84
|
return network;
|
|
@@ -85,34 +87,43 @@ function getAppKitNetwork(chainId) {
|
|
|
85
87
|
return APPKIT_NETWORK_BY_ID[chainId];
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
// src/core/reown-theme.ts
|
|
91
|
+
function mapTheme(theme) {
|
|
92
|
+
const themeMode = _chunkV2OBGLJDcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
|
|
93
|
+
const themeVariables = {
|
|
94
|
+
"--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
|
|
95
|
+
};
|
|
96
|
+
return { themeMode, themeVariables };
|
|
97
|
+
}
|
|
98
|
+
function setAppKitTheme(appKit, theme) {
|
|
99
|
+
const { themeMode, themeVariables } = mapTheme(theme);
|
|
100
|
+
try {
|
|
101
|
+
_optionalChain([appKit, 'optionalAccess', _3 => _3.setThemeMode, 'call', _4 => _4(themeMode)]);
|
|
102
|
+
_optionalChain([appKit, 'optionalAccess', _5 => _5.setThemeVariables, 'call', _6 => _6(themeVariables)]);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
88
107
|
// src/core/reown.tsx
|
|
89
108
|
var _jsxruntime = require('react/jsx-runtime');
|
|
90
109
|
function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
91
110
|
const transports = {};
|
|
92
111
|
for (const network of networks) {
|
|
93
112
|
const id = Number(network.id);
|
|
94
|
-
transports[id] = _viem.http.call(void 0,
|
|
113
|
+
transports[id] = _viem.http.call(void 0, _chunkV2OBGLJDcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
95
114
|
}
|
|
96
115
|
return transports;
|
|
97
116
|
}
|
|
98
117
|
function getEvmRpcFingerprint(rpcUrls, networks) {
|
|
99
118
|
return networks.map((network) => {
|
|
100
119
|
const id = Number(network.id);
|
|
101
|
-
return `${id}=${_nullishCoalesce(
|
|
120
|
+
return `${id}=${_nullishCoalesce(_chunkV2OBGLJDcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
102
121
|
}).join("|");
|
|
103
122
|
}
|
|
104
123
|
var cachedAdapter = null;
|
|
105
124
|
var cachedAdapterKey = null;
|
|
106
125
|
var wagmiConfiguredEvmIds = /* @__PURE__ */ new Set();
|
|
107
126
|
var runtimeNetworkById = /* @__PURE__ */ new Map();
|
|
108
|
-
function mapTheme(theme) {
|
|
109
|
-
const themeMode = _optionalChain([theme, 'optionalAccess', _ => _.mode]) === "light" ? "light" : "dark";
|
|
110
|
-
const themeVariables = {};
|
|
111
|
-
if (_optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])) {
|
|
112
|
-
themeVariables["--apkt-accent"] = theme.ctaColor;
|
|
113
|
-
}
|
|
114
|
-
return { themeMode, themeVariables };
|
|
115
|
-
}
|
|
116
127
|
function mergeNetworks(runtime) {
|
|
117
128
|
const byId = /* @__PURE__ */ new Map();
|
|
118
129
|
for (const network of EVM_NETWORKS) byId.set(Number(network.id), network);
|
|
@@ -156,7 +167,7 @@ function getOrCreateAdapter(projectId, enableSolana, theme, rpcUrls, runtimeChai
|
|
|
156
167
|
runtimeNetworkById.set(chain.id, chain);
|
|
157
168
|
try {
|
|
158
169
|
appKit.addNetwork("eip155", chain);
|
|
159
|
-
} catch (
|
|
170
|
+
} catch (e2) {
|
|
160
171
|
}
|
|
161
172
|
}
|
|
162
173
|
return cachedAdapter;
|
|
@@ -164,7 +175,7 @@ function getOrCreateAdapter(projectId, enableSolana, theme, rpcUrls, runtimeChai
|
|
|
164
175
|
function chainDisplayName(chainId) {
|
|
165
176
|
const runtime = runtimeNetworkById.get(chainId);
|
|
166
177
|
if (runtime) return runtime.name;
|
|
167
|
-
return
|
|
178
|
+
return _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId);
|
|
168
179
|
}
|
|
169
180
|
function resolveAppKitNetwork(chainId) {
|
|
170
181
|
return _nullishCoalesce(getAppKitNetwork(chainId), () => ( runtimeNetworkById.get(chainId)));
|
|
@@ -177,7 +188,7 @@ function ReownWalletProvider({
|
|
|
177
188
|
backendUrl,
|
|
178
189
|
children
|
|
179
190
|
}) {
|
|
180
|
-
const rpcUrls =
|
|
191
|
+
const rpcUrls = _chunkV2OBGLJDcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
181
192
|
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
182
193
|
const overrides = _react.useMemo.call(void 0, () => {
|
|
183
194
|
if (!rpcUrls) return void 0;
|
|
@@ -189,20 +200,27 @@ function ReownWalletProvider({
|
|
|
189
200
|
return out;
|
|
190
201
|
}, [rpcUrls]);
|
|
191
202
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
192
|
-
const primed =
|
|
203
|
+
const primed = _chunkV2OBGLJDcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
193
204
|
return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
|
|
194
205
|
});
|
|
195
206
|
_react.useEffect.call(void 0, () => {
|
|
196
207
|
let active = true;
|
|
197
|
-
const primed =
|
|
208
|
+
const primed = _chunkV2OBGLJDcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
198
209
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
199
|
-
|
|
210
|
+
_chunkV2OBGLJDcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
|
|
200
211
|
if (active) setState({ ready: true, chains });
|
|
201
212
|
});
|
|
202
213
|
return () => {
|
|
203
214
|
active = false;
|
|
204
215
|
};
|
|
205
216
|
}, [backendUrl, overrides]);
|
|
217
|
+
_react.useEffect.call(void 0, () => {
|
|
218
|
+
setAppKitTheme(_react3.modal, theme);
|
|
219
|
+
return _chunkV2OBGLJDcjs.followSystemAppearance.call(void 0,
|
|
220
|
+
_optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
|
|
221
|
+
() => setAppKitTheme(_react3.modal, theme)
|
|
222
|
+
);
|
|
223
|
+
}, [theme, state.ready]);
|
|
206
224
|
if (!state.ready) return null;
|
|
207
225
|
const runtimeChains = state.chains;
|
|
208
226
|
const adapter = getOrCreateAdapter(
|
|
@@ -215,7 +233,7 @@ function ReownWalletProvider({
|
|
|
215
233
|
const config = adapter.wagmiConfig;
|
|
216
234
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _wagmi.WagmiProvider, { config, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider, { client: queryClient, children }) });
|
|
217
235
|
}
|
|
218
|
-
function
|
|
236
|
+
function useReownWalletSession() {
|
|
219
237
|
const { open } = _react3.useAppKit.call(void 0, );
|
|
220
238
|
const { address, isConnected, caipAddress } = _react3.useAppKitAccount.call(void 0, );
|
|
221
239
|
const { initialized, loading } = _react3.useAppKitState.call(void 0, );
|
|
@@ -224,16 +242,20 @@ function useReownWallet() {
|
|
|
224
242
|
const publicClient = _wagmi.usePublicClient.call(void 0, );
|
|
225
243
|
const { switchNetwork } = _react3.useAppKitNetwork.call(void 0, );
|
|
226
244
|
const { switchChainAsync } = _wagmi.useSwitchChain.call(void 0, );
|
|
227
|
-
const isSolana = _nullishCoalesce(_optionalChain([caipAddress, 'optionalAccess',
|
|
228
|
-
const solanaAddress = isSolana ? _optionalChain([caipAddress, 'optionalAccess',
|
|
245
|
+
const isSolana = _nullishCoalesce(_optionalChain([caipAddress, 'optionalAccess', _8 => _8.startsWith, 'call', _9 => _9("solana:")]), () => ( false));
|
|
246
|
+
const solanaAddress = isSolana ? _optionalChain([caipAddress, 'optionalAccess', _10 => _10.split, 'call', _11 => _11(":"), 'access', _12 => _12.slice, 'call', _13 => _13(2), 'access', _14 => _14.join, 'call', _15 => _15(":")]) : void 0;
|
|
229
247
|
return {
|
|
230
248
|
walletClient: isSolana ? void 0 : _nullishCoalesce(walletClient, () => ( void 0)),
|
|
231
249
|
publicClient: isSolana ? void 0 : _nullishCoalesce(publicClient, () => ( void 0)),
|
|
232
250
|
address: isSolana ? void 0 : address,
|
|
233
251
|
caipAddress,
|
|
234
252
|
isConnected,
|
|
253
|
+
// wagmi resolves the client a beat after the account, so this is false in
|
|
254
|
+
// that window — which is the behaviour the picker already had, now stated
|
|
255
|
+
// here rather than inferred from the client's presence by the picker.
|
|
256
|
+
canSignEvm: !isSolana && Boolean(walletClient),
|
|
235
257
|
isReady: initialized && !loading,
|
|
236
|
-
icon: _optionalChain([walletInfo, 'optionalAccess',
|
|
258
|
+
icon: _optionalChain([walletInfo, 'optionalAccess', _16 => _16.icon]),
|
|
237
259
|
isSolana,
|
|
238
260
|
solanaAddress,
|
|
239
261
|
solanaProvider: void 0,
|
|
@@ -242,7 +264,7 @@ function useReownWallet() {
|
|
|
242
264
|
void open({ view: "Connect" });
|
|
243
265
|
},
|
|
244
266
|
disconnect: () => {
|
|
245
|
-
void _optionalChain([_react3.modal, 'optionalAccess',
|
|
267
|
+
void _optionalChain([_react3.modal, 'optionalAccess', _17 => _17.disconnect, 'call', _18 => _18()]);
|
|
246
268
|
},
|
|
247
269
|
switchChain: async (chainId) => {
|
|
248
270
|
if (!wagmiConfiguredEvmIds.has(chainId)) {
|
|
@@ -258,7 +280,7 @@ function useReownWallet() {
|
|
|
258
280
|
await switchChainAsync({ chainId });
|
|
259
281
|
}
|
|
260
282
|
} catch (err) {
|
|
261
|
-
if (
|
|
283
|
+
if (_chunkV2OBGLJDcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
262
284
|
throw new Error(
|
|
263
285
|
`Switch to ${chainDisplayName(chainId)} in your wallet to continue`
|
|
264
286
|
);
|
|
@@ -274,7 +296,7 @@ function useReownWallet() {
|
|
|
274
296
|
var _react5 = require('@reown/appkit-adapter-solana/react');
|
|
275
297
|
|
|
276
298
|
function DepositModalWithReown(props) {
|
|
277
|
-
const reown =
|
|
299
|
+
const reown = useReownWalletSession();
|
|
278
300
|
const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0, "solana");
|
|
279
301
|
const { connection: solanaConnection } = _react5.useAppKitConnection.call(void 0, );
|
|
280
302
|
const reownWithSolana = _react.useMemo.call(void 0,
|
|
@@ -292,10 +314,11 @@ function DepositModalWithReown(props) {
|
|
|
292
314
|
reown.disconnect();
|
|
293
315
|
}, [reown.disconnect]);
|
|
294
316
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
295
|
-
|
|
317
|
+
_chunkYCQZJQO6cjs.DepositModalInner,
|
|
296
318
|
{
|
|
297
319
|
...props,
|
|
298
|
-
|
|
320
|
+
walletSession: reownWithSolana,
|
|
321
|
+
walletIntegration: "modal_connected",
|
|
299
322
|
onConnect: handleConnect,
|
|
300
323
|
onDisconnect: handleDisconnect
|
|
301
324
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KTUVSKR4.mjs";
|
|
4
|
+
import "./chunk-7SR7ENVJ.mjs";
|
|
5
|
+
import "./chunk-WUJIKCFU.mjs";
|
|
6
6
|
import {
|
|
7
|
+
followSystemAppearance,
|
|
7
8
|
isUnsupportedChainSwitchError,
|
|
8
9
|
peekRuntimeChains,
|
|
9
10
|
primeRuntimeChains,
|
|
11
|
+
resolveThemeMode,
|
|
10
12
|
rpcUrlFor,
|
|
11
13
|
useStableRpcUrls
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-IN77XSWO.mjs";
|
|
15
|
+
import "./chunk-K4H6TGBE.mjs";
|
|
16
|
+
import "./chunk-RN5VKWI6.mjs";
|
|
15
17
|
import {
|
|
16
|
-
|
|
18
|
+
SUPPORTED_CHAIN_IDS,
|
|
17
19
|
getChainName
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VUATPOWJ.mjs";
|
|
19
21
|
|
|
20
22
|
// src/DepositModalReown.tsx
|
|
21
23
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
@@ -72,11 +74,11 @@ var APPKIT_NETWORK_BY_ID = {
|
|
|
72
74
|
[katana.id]: katana,
|
|
73
75
|
[hyperEvm.id]: hyperEvm
|
|
74
76
|
};
|
|
75
|
-
var EVM_NETWORKS =
|
|
76
|
-
const network = APPKIT_NETWORK_BY_ID[
|
|
77
|
+
var EVM_NETWORKS = SUPPORTED_CHAIN_IDS.map((chainId) => {
|
|
78
|
+
const network = APPKIT_NETWORK_BY_ID[chainId];
|
|
77
79
|
if (!network) {
|
|
78
80
|
throw new Error(
|
|
79
|
-
`[rhinestone] No AppKit network registered for supported chain ${
|
|
81
|
+
`[rhinestone] No AppKit network registered for supported chain ${chainId}. Add it to APPKIT_NETWORK_BY_ID in reown-networks.ts.`
|
|
80
82
|
);
|
|
81
83
|
}
|
|
82
84
|
return network;
|
|
@@ -85,6 +87,23 @@ function getAppKitNetwork(chainId) {
|
|
|
85
87
|
return APPKIT_NETWORK_BY_ID[chainId];
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
// src/core/reown-theme.ts
|
|
91
|
+
function mapTheme(theme) {
|
|
92
|
+
const themeMode = resolveThemeMode(theme?.mode) === "light" ? "light" : "dark";
|
|
93
|
+
const themeVariables = {
|
|
94
|
+
"--apkt-accent": theme?.ctaColor
|
|
95
|
+
};
|
|
96
|
+
return { themeMode, themeVariables };
|
|
97
|
+
}
|
|
98
|
+
function setAppKitTheme(appKit, theme) {
|
|
99
|
+
const { themeMode, themeVariables } = mapTheme(theme);
|
|
100
|
+
try {
|
|
101
|
+
appKit?.setThemeMode(themeMode);
|
|
102
|
+
appKit?.setThemeVariables(themeVariables);
|
|
103
|
+
} catch {
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
88
107
|
// src/core/reown.tsx
|
|
89
108
|
import { jsx } from "react/jsx-runtime";
|
|
90
109
|
function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
@@ -105,14 +124,6 @@ var cachedAdapter = null;
|
|
|
105
124
|
var cachedAdapterKey = null;
|
|
106
125
|
var wagmiConfiguredEvmIds = /* @__PURE__ */ new Set();
|
|
107
126
|
var runtimeNetworkById = /* @__PURE__ */ new Map();
|
|
108
|
-
function mapTheme(theme) {
|
|
109
|
-
const themeMode = theme?.mode === "light" ? "light" : "dark";
|
|
110
|
-
const themeVariables = {};
|
|
111
|
-
if (theme?.ctaColor) {
|
|
112
|
-
themeVariables["--apkt-accent"] = theme.ctaColor;
|
|
113
|
-
}
|
|
114
|
-
return { themeMode, themeVariables };
|
|
115
|
-
}
|
|
116
127
|
function mergeNetworks(runtime) {
|
|
117
128
|
const byId = /* @__PURE__ */ new Map();
|
|
118
129
|
for (const network of EVM_NETWORKS) byId.set(Number(network.id), network);
|
|
@@ -203,6 +214,13 @@ function ReownWalletProvider({
|
|
|
203
214
|
active = false;
|
|
204
215
|
};
|
|
205
216
|
}, [backendUrl, overrides]);
|
|
217
|
+
useEffect(() => {
|
|
218
|
+
setAppKitTheme(modal, theme);
|
|
219
|
+
return followSystemAppearance(
|
|
220
|
+
theme?.mode,
|
|
221
|
+
() => setAppKitTheme(modal, theme)
|
|
222
|
+
);
|
|
223
|
+
}, [theme, state.ready]);
|
|
206
224
|
if (!state.ready) return null;
|
|
207
225
|
const runtimeChains = state.chains;
|
|
208
226
|
const adapter = getOrCreateAdapter(
|
|
@@ -215,7 +233,7 @@ function ReownWalletProvider({
|
|
|
215
233
|
const config = adapter.wagmiConfig;
|
|
216
234
|
return /* @__PURE__ */ jsx(WagmiProvider, { config, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children }) });
|
|
217
235
|
}
|
|
218
|
-
function
|
|
236
|
+
function useReownWalletSession() {
|
|
219
237
|
const { open } = useAppKit();
|
|
220
238
|
const { address, isConnected, caipAddress } = useAppKitAccount();
|
|
221
239
|
const { initialized, loading } = useAppKitState();
|
|
@@ -232,6 +250,10 @@ function useReownWallet() {
|
|
|
232
250
|
address: isSolana ? void 0 : address,
|
|
233
251
|
caipAddress,
|
|
234
252
|
isConnected,
|
|
253
|
+
// wagmi resolves the client a beat after the account, so this is false in
|
|
254
|
+
// that window — which is the behaviour the picker already had, now stated
|
|
255
|
+
// here rather than inferred from the client's presence by the picker.
|
|
256
|
+
canSignEvm: !isSolana && Boolean(walletClient),
|
|
235
257
|
isReady: initialized && !loading,
|
|
236
258
|
icon: walletInfo?.icon,
|
|
237
259
|
isSolana,
|
|
@@ -274,7 +296,7 @@ import { useAppKitProvider } from "@reown/appkit/react";
|
|
|
274
296
|
import { useAppKitConnection } from "@reown/appkit-adapter-solana/react";
|
|
275
297
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
276
298
|
function DepositModalWithReown(props) {
|
|
277
|
-
const reown =
|
|
299
|
+
const reown = useReownWalletSession();
|
|
278
300
|
const { walletProvider: solanaWalletProvider } = useAppKitProvider("solana");
|
|
279
301
|
const { connection: solanaConnection } = useAppKitConnection();
|
|
280
302
|
const reownWithSolana = useMemo2(
|
|
@@ -295,7 +317,8 @@ function DepositModalWithReown(props) {
|
|
|
295
317
|
DepositModalInner,
|
|
296
318
|
{
|
|
297
319
|
...props,
|
|
298
|
-
|
|
320
|
+
walletSession: reownWithSolana,
|
|
321
|
+
walletIntegration: "modal_connected",
|
|
299
322
|
onConnect: handleConnect,
|
|
300
323
|
onDisconnect: handleDisconnect
|
|
301
324
|
}
|
|
@@ -22,7 +22,7 @@ function QRCode({ value, size = 200, iconSrc, className }) {
|
|
|
22
22
|
if (!node) return;
|
|
23
23
|
const sync = () => setColors(resolveSurfaceColor(node));
|
|
24
24
|
sync();
|
|
25
|
-
const themed = node.closest("[data-theme]");
|
|
25
|
+
const themed = node.closest(".rs-modal") ?? node.closest("[data-theme]");
|
|
26
26
|
if (!themed) return;
|
|
27
27
|
const observer = new MutationObserver(sync);
|
|
28
28
|
observer.observe(themed, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }// src/components/ui/QRCode.tsx
|
|
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; }// src/components/ui/QRCode.tsx
|
|
2
2
|
var _react = require('react');
|
|
3
3
|
var _reactqrcodelogo = require('react-qrcode-logo');
|
|
4
4
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -22,7 +22,7 @@ function QRCode({ value, size = 200, iconSrc, className }) {
|
|
|
22
22
|
if (!node) return;
|
|
23
23
|
const sync = () => setColors(resolveSurfaceColor(node));
|
|
24
24
|
sync();
|
|
25
|
-
const themed = node.closest("[data-theme]");
|
|
25
|
+
const themed = _nullishCoalesce(node.closest(".rs-modal"), () => ( node.closest("[data-theme]")));
|
|
26
26
|
if (!themed) return;
|
|
27
27
|
const observer = new MutationObserver(sync);
|
|
28
28
|
observer.observe(themed, {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WithdrawModal,
|
|
3
|
+
buildWithdrawAnalyticsSessionProperties
|
|
4
|
+
} from "./chunk-PKML3XVS.mjs";
|
|
5
|
+
import "./chunk-7SR7ENVJ.mjs";
|
|
6
|
+
import "./chunk-IN77XSWO.mjs";
|
|
7
|
+
import "./chunk-K4H6TGBE.mjs";
|
|
8
|
+
import "./chunk-VUATPOWJ.mjs";
|
|
9
|
+
export {
|
|
10
|
+
WithdrawModal,
|
|
11
|
+
buildWithdrawAnalyticsSessionProperties
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkMTFJSE52cjs = require('./chunk-MTFJSE52.cjs');
|
|
5
|
+
require('./chunk-7ICSHJFE.cjs');
|
|
6
|
+
require('./chunk-V2OBGLJD.cjs');
|
|
7
|
+
require('./chunk-6KG642KH.cjs');
|
|
8
|
+
require('./chunk-4KCSH4T3.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.WithdrawModal = _chunkMTFJSE52cjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkMTFJSE52cjs.buildWithdrawAnalyticsSessionProperties;
|