@rhinestone/deposit-modal 0.1.40 → 0.1.41

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.
Files changed (38) hide show
  1. package/dist/{DepositModalReown-ZZKRN6J3.cjs → DepositModalReown-GAQLILGK.cjs} +17 -8
  2. package/dist/{DepositModalReown-3HNOCOOO.mjs → DepositModalReown-WS6WNWJP.mjs} +15 -6
  3. package/dist/{WithdrawModalReown-XXCOZYVU.mjs → WithdrawModalReown-7CSCY55U.mjs} +4 -4
  4. package/dist/{WithdrawModalReown-2CWNDVJD.cjs → WithdrawModalReown-GCOVYZN2.cjs} +7 -7
  5. package/dist/{chunk-K7BHCDJQ.cjs → chunk-37CTMJMO.cjs} +181 -96
  6. package/dist/{chunk-F5S6RHUI.mjs → chunk-6PRJUXTM.mjs} +1488 -301
  7. package/dist/{chunk-CFLZYWX7.mjs → chunk-KWAFKVV6.mjs} +120 -35
  8. package/dist/{chunk-AHOFT42H.cjs → chunk-LT3QKJI2.cjs} +458 -115
  9. package/dist/{chunk-SJEIKMVO.mjs → chunk-MBOH6XW3.mjs} +26 -13
  10. package/dist/{chunk-FLXTBFMZ.cjs → chunk-NELAYNA3.cjs} +11 -0
  11. package/dist/{chunk-3O37UPSC.cjs → chunk-PTSYSG4U.cjs} +1552 -365
  12. package/dist/{chunk-V7I5T4SW.cjs → chunk-PWPW7GFB.cjs} +25 -12
  13. package/dist/{chunk-IC2M2DZ7.mjs → chunk-QIK6ONMQ.mjs} +392 -49
  14. package/dist/{chunk-I7RYTI4G.mjs → chunk-ZJQZEIHA.mjs} +11 -0
  15. package/dist/constants.cjs +2 -2
  16. package/dist/constants.d.cts +6 -6
  17. package/dist/constants.d.ts +6 -6
  18. package/dist/constants.mjs +1 -1
  19. package/dist/deposit.cjs +4 -4
  20. package/dist/deposit.d.cts +2 -2
  21. package/dist/deposit.d.ts +2 -2
  22. package/dist/deposit.mjs +3 -3
  23. package/dist/index.cjs +5 -5
  24. package/dist/index.d.cts +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.mjs +4 -4
  27. package/dist/reown.cjs +5 -5
  28. package/dist/reown.d.cts +1 -1
  29. package/dist/reown.d.ts +1 -1
  30. package/dist/reown.mjs +4 -4
  31. package/dist/styles.css +64 -0
  32. package/dist/{types-CIaQPR6F.d.cts → types-CybmMKTE.d.cts} +9 -7
  33. package/dist/{types-Bp2n2RQ3.d.ts → types-e8CHSm2u.d.ts} +9 -7
  34. package/dist/withdraw.cjs +4 -4
  35. package/dist/withdraw.d.cts +2 -2
  36. package/dist/withdraw.d.ts +2 -2
  37. package/dist/withdraw.mjs +3 -3
  38. package/package.json +18 -1
@@ -2,6 +2,7 @@
2
2
  var _react = require('react');
3
3
  var _reactquery = require('@tanstack/react-query');
4
4
  var _appkitadapterwagmi = require('@reown/appkit-adapter-wagmi');
5
+ var _appkitadaptersolana = require('@reown/appkit-adapter-solana');
5
6
  var _wagmi = require('wagmi');
6
7
  var _react3 = require('@reown/appkit/react');
7
8
 
@@ -11,10 +12,11 @@ var _react3 = require('@reown/appkit/react');
11
12
 
12
13
 
13
14
 
15
+
14
16
  var _networks = require('@reown/appkit/networks');
15
17
 
16
18
  var _jsxruntime = require('react/jsx-runtime');
17
- var NETWORKS = [
19
+ var EVM_NETWORKS = [
18
20
  _networks.mainnet,
19
21
  _networks.base,
20
22
  _networks.arbitrum,
@@ -22,6 +24,10 @@ var NETWORKS = [
22
24
  _networks.polygon,
23
25
  _networks.bsc
24
26
  ];
27
+ var ALL_NETWORKS = [
28
+ ...EVM_NETWORKS,
29
+ _networks.solana
30
+ ];
25
31
  var cachedAdapter = null;
26
32
  var cachedProjectId = null;
27
33
  function mapTheme(theme) {
@@ -35,14 +41,15 @@ function mapTheme(theme) {
35
41
  function getOrCreateAdapter(projectId, theme) {
36
42
  if (cachedAdapter && cachedProjectId === projectId) return cachedAdapter;
37
43
  cachedAdapter = new (0, _appkitadapterwagmi.WagmiAdapter)({
38
- networks: NETWORKS,
44
+ networks: EVM_NETWORKS,
39
45
  projectId
40
46
  });
41
47
  cachedProjectId = projectId;
48
+ const solanaAdapter = new (0, _appkitadaptersolana.SolanaAdapter)();
42
49
  const { themeMode, themeVariables } = mapTheme(theme);
43
50
  _react3.createAppKit.call(void 0, {
44
- adapters: [cachedAdapter],
45
- networks: NETWORKS,
51
+ adapters: [cachedAdapter, solanaAdapter],
52
+ networks: ALL_NETWORKS,
46
53
  projectId,
47
54
  themeMode,
48
55
  themeVariables,
@@ -66,26 +73,32 @@ function ReownWalletProvider({
66
73
  }
67
74
  function useReownWallet() {
68
75
  const { open } = _react3.useAppKit.call(void 0, );
69
- const { address, isConnected } = _react3.useAppKitAccount.call(void 0, );
76
+ const { address, isConnected, caipAddress } = _react3.useAppKitAccount.call(void 0, );
70
77
  const { walletInfo } = _react3.useWalletInfo.call(void 0, );
71
78
  const { data: walletClient } = _wagmi.useWalletClient.call(void 0, );
72
79
  const publicClient = _wagmi.usePublicClient.call(void 0, );
73
80
  const { switchChainAsync } = _wagmi.useSwitchChain.call(void 0, );
74
- const { disconnect: wagmiDisconnect } = _wagmi.useDisconnect.call(void 0, );
81
+ const isSolana = _nullishCoalesce(_optionalChain([caipAddress, 'optionalAccess', _3 => _3.startsWith, 'call', _4 => _4("solana:")]), () => ( false));
82
+ const solanaAddress = isSolana ? _optionalChain([caipAddress, 'optionalAccess', _5 => _5.split, 'call', _6 => _6(":"), 'access', _7 => _7.slice, 'call', _8 => _8(2), 'access', _9 => _9.join, 'call', _10 => _10(":")]) : void 0;
75
83
  return {
76
- walletClient: _nullishCoalesce(walletClient, () => ( void 0)),
77
- publicClient: _nullishCoalesce(publicClient, () => ( void 0)),
78
- address,
84
+ walletClient: isSolana ? void 0 : _nullishCoalesce(walletClient, () => ( void 0)),
85
+ publicClient: isSolana ? void 0 : _nullishCoalesce(publicClient, () => ( void 0)),
86
+ address: isSolana ? void 0 : address,
87
+ caipAddress,
79
88
  isConnected,
80
- icon: _optionalChain([walletInfo, 'optionalAccess', _3 => _3.icon]),
89
+ icon: _optionalChain([walletInfo, 'optionalAccess', _11 => _11.icon]),
90
+ isSolana,
91
+ solanaAddress,
92
+ solanaProvider: void 0,
93
+ // Populated by DepositModalReown via useAppKitProvider
81
94
  openConnect: () => {
82
95
  void open({ view: "Connect" });
83
96
  },
84
97
  disconnect: () => {
85
- wagmiDisconnect();
98
+ void _optionalChain([_react3.modal, 'optionalAccess', _12 => _12.disconnect, 'call', _13 => _13()]);
86
99
  },
87
100
  switchChain: async (chainId) => {
88
- if (_optionalChain([walletClient, 'optionalAccess', _4 => _4.switchChain])) {
101
+ if (_optionalChain([walletClient, 'optionalAccess', _14 => _14.switchChain])) {
89
102
  await walletClient.switchChain({ id: chainId });
90
103
  return;
91
104
  }