@rhinestone/deposit-modal 0.1.24 → 0.1.25
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 +1 -5
- package/dist/DepositModalReown-4A5HJK74.mjs +33 -0
- package/dist/DepositModalReown-QQ6WI265.cjs +33 -0
- package/dist/WithdrawModalReown-HBORIX2O.mjs +33 -0
- package/dist/WithdrawModalReown-L77OC26X.cjs +33 -0
- package/dist/{chunk-O3I5KVXA.cjs → chunk-4QDHXCPG.cjs} +97 -81
- package/dist/chunk-6VJ2ZTNQ.cjs +90 -0
- package/dist/{chunk-35DWLO33.mjs → chunk-B3HMNWR4.mjs} +61 -45
- package/dist/{chunk-ANQQMGNN.cjs → chunk-CZWAKYDR.cjs} +230 -115
- package/dist/{chunk-P7SQQAAF.mjs → chunk-GAFLOODV.mjs} +203 -88
- package/dist/{chunk-ZMVCDFXM.mjs → chunk-JAR372KJ.mjs} +48 -40
- package/dist/chunk-LBEP3A2Z.mjs +90 -0
- package/dist/{chunk-A2PDOYYE.cjs → chunk-VBNFP3JF.cjs} +89 -81
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +6 -191
- package/dist/reown.d.cts +4 -12
- package/dist/reown.d.ts +4 -12
- package/dist/reown.mjs +8 -193
- package/dist/{types-CUww05xT.d.cts → types-BwaQ7jK5.d.cts} +3 -16
- package/dist/{types-Z6GjVWFR.d.ts → types-CgXyx46m.d.ts} +3 -16
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +16 -33
package/dist/reown.cjs
CHANGED
|
@@ -1,197 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVBNFP3JFcjs = require('./chunk-VBNFP3JF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunk4QDHXCPGcjs = require('./chunk-4QDHXCPG.cjs');
|
|
7
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
8
|
+
require('./chunk-CEIWN53N.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _chunkCEIWN53Ncjs = require('./chunk-CEIWN53N.cjs');
|
|
37
|
-
|
|
38
|
-
// src/DepositModalReown.tsx
|
|
39
|
-
var _react = require('react');
|
|
40
|
-
|
|
41
|
-
// src/core/reown.tsx
|
|
42
|
-
|
|
43
|
-
var _reactquery = require('@tanstack/react-query');
|
|
44
|
-
var _appkitadapterwagmi = require('@reown/appkit-adapter-wagmi');
|
|
45
|
-
var _wagmi = require('wagmi');
|
|
46
|
-
var _react3 = require('@reown/appkit/react');
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _networks = require('@reown/appkit/networks');
|
|
55
|
-
|
|
56
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
57
|
-
var NETWORKS = [
|
|
58
|
-
_networks.mainnet,
|
|
59
|
-
_networks.base,
|
|
60
|
-
_networks.arbitrum,
|
|
61
|
-
_networks.optimism,
|
|
62
|
-
_networks.polygon,
|
|
63
|
-
_networks.bsc
|
|
64
|
-
];
|
|
65
|
-
var cachedAdapter = null;
|
|
66
|
-
var cachedProjectId = null;
|
|
67
|
-
function mapTheme(theme) {
|
|
68
|
-
const themeMode = _optionalChain([theme, 'optionalAccess', _ => _.mode]) === "light" ? "light" : "dark";
|
|
69
|
-
const themeVariables = {};
|
|
70
|
-
if (_optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])) {
|
|
71
|
-
themeVariables["--apkt-accent"] = theme.ctaColor;
|
|
72
|
-
}
|
|
73
|
-
return { themeMode, themeVariables };
|
|
74
|
-
}
|
|
75
|
-
function getOrCreateAdapter(projectId, theme) {
|
|
76
|
-
if (cachedAdapter && cachedProjectId === projectId) return cachedAdapter;
|
|
77
|
-
cachedAdapter = new (0, _appkitadapterwagmi.WagmiAdapter)({
|
|
78
|
-
networks: NETWORKS,
|
|
79
|
-
projectId
|
|
80
|
-
});
|
|
81
|
-
cachedProjectId = projectId;
|
|
82
|
-
const { themeMode, themeVariables } = mapTheme(theme);
|
|
83
|
-
_react3.createAppKit.call(void 0, {
|
|
84
|
-
adapters: [cachedAdapter],
|
|
85
|
-
networks: NETWORKS,
|
|
86
|
-
projectId,
|
|
87
|
-
themeMode,
|
|
88
|
-
themeVariables,
|
|
89
|
-
features: {
|
|
90
|
-
connectMethodsOrder: ["wallet"],
|
|
91
|
-
email: false,
|
|
92
|
-
socials: false
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
return cachedAdapter;
|
|
96
|
-
}
|
|
97
|
-
function ReownWalletProvider({
|
|
98
|
-
projectId,
|
|
99
|
-
theme,
|
|
100
|
-
children
|
|
101
|
-
}) {
|
|
102
|
-
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
103
|
-
const adapter = getOrCreateAdapter(projectId, theme);
|
|
104
|
-
const config = adapter.wagmiConfig;
|
|
105
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _wagmi.WagmiProvider, { config, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider, { client: queryClient, children }) });
|
|
106
|
-
}
|
|
107
|
-
function useReownWallet() {
|
|
108
|
-
const { open } = _react3.useAppKit.call(void 0, );
|
|
109
|
-
const { address, isConnected } = _react3.useAppKitAccount.call(void 0, );
|
|
110
|
-
const { data: walletClient } = _wagmi.useWalletClient.call(void 0, );
|
|
111
|
-
const publicClient = _wagmi.usePublicClient.call(void 0, );
|
|
112
|
-
const { switchChainAsync } = _wagmi.useSwitchChain.call(void 0, );
|
|
113
|
-
return {
|
|
114
|
-
walletClient: _nullishCoalesce(walletClient, () => ( void 0)),
|
|
115
|
-
publicClient: _nullishCoalesce(publicClient, () => ( void 0)),
|
|
116
|
-
address,
|
|
117
|
-
isConnected,
|
|
118
|
-
openConnect: () => {
|
|
119
|
-
void open({ view: isConnected ? "Account" : "Connect" });
|
|
120
|
-
},
|
|
121
|
-
switchChain: async (chainId) => {
|
|
122
|
-
await switchChainAsync({ chainId });
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/DepositModalReown.tsx
|
|
128
|
-
|
|
129
|
-
function DepositModalWithReown(props) {
|
|
130
|
-
const reown = useReownWallet();
|
|
131
|
-
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
132
|
-
reown.openConnect();
|
|
133
|
-
}, [reown.openConnect]);
|
|
134
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
135
|
-
_chunkA2PDOYYEcjs.DepositModalInner,
|
|
136
|
-
{
|
|
137
|
-
...props,
|
|
138
|
-
reownWallet: reown,
|
|
139
|
-
onConnect: handleConnect
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
function DepositModalReown(props) {
|
|
144
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositModalWithReown, { ...props }) });
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// src/WithdrawModalReown.tsx
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
function WithdrawModalWithReown(props) {
|
|
151
|
-
const reown = useReownWallet();
|
|
152
|
-
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
153
|
-
reown.openConnect();
|
|
154
|
-
}, [reown.openConnect]);
|
|
155
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
|
-
_chunkO3I5KVXAcjs.WithdrawModalInner,
|
|
157
|
-
{
|
|
158
|
-
...props,
|
|
159
|
-
reownWallet: reown,
|
|
160
|
-
onConnect: handleConnect
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
function WithdrawModalReown(props) {
|
|
165
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
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 = DepositModalReown; exports.NATIVE_TOKEN_ADDRESS = _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkCEIWN53Ncjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkCEIWN53Ncjs.SUPPORTED_CHAINS; exports.WithdrawModal = WithdrawModalReown; 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;
|
|
12
|
+
exports.DepositModal = _chunkVBNFP3JFcjs.DepositModal; exports.WithdrawModal = _chunk4QDHXCPGcjs.WithdrawModal;
|
package/dist/reown.d.cts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData,
|
|
4
|
-
export { CHAIN_BY_ID, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain } from './constants.cjs';
|
|
1
|
+
export { DepositModal } from './deposit.cjs';
|
|
2
|
+
export { WithdrawModal } from './withdraw.cjs';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-BwaQ7jK5.cjs';
|
|
5
4
|
export { SafeTransactionRequest } from './safe.cjs';
|
|
6
|
-
|
|
5
|
+
import 'react/jsx-runtime';
|
|
7
6
|
import 'viem';
|
|
8
|
-
import 'viem/chains';
|
|
9
|
-
|
|
10
|
-
declare function DepositModalReown(props: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
declare function WithdrawModalReown(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
export { DepositModalReown as DepositModal, DepositModalProps, WithdrawModalReown as WithdrawModal, WithdrawModalProps };
|
package/dist/reown.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData,
|
|
4
|
-
export { CHAIN_BY_ID, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain } from './constants.js';
|
|
1
|
+
export { DepositModal } from './deposit.js';
|
|
2
|
+
export { WithdrawModal } from './withdraw.js';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-CgXyx46m.js';
|
|
5
4
|
export { SafeTransactionRequest } from './safe.js';
|
|
6
|
-
|
|
5
|
+
import 'react/jsx-runtime';
|
|
7
6
|
import 'viem';
|
|
8
|
-
import 'viem/chains';
|
|
9
|
-
|
|
10
|
-
declare function DepositModalReown(props: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
declare function WithdrawModalReown(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
export { DepositModalReown as DepositModal, DepositModalProps, WithdrawModalReown as WithdrawModal, WithdrawModalProps };
|
package/dist/reown.mjs
CHANGED
|
@@ -1,197 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
DepositModal
|
|
3
|
+
} from "./chunk-JAR372KJ.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import
|
|
9
|
-
CHAIN_BY_ID,
|
|
10
|
-
DEFAULT_BACKEND_URL,
|
|
11
|
-
DEFAULT_SIGNER_ADDRESS,
|
|
12
|
-
NATIVE_TOKEN_ADDRESS,
|
|
13
|
-
SOURCE_CHAINS,
|
|
14
|
-
SUPPORTED_CHAINS,
|
|
15
|
-
chainRegistry,
|
|
16
|
-
findChainIdForToken,
|
|
17
|
-
getChainBadge,
|
|
18
|
-
getChainIcon,
|
|
19
|
-
getChainId,
|
|
20
|
-
getChainName,
|
|
21
|
-
getChainObject,
|
|
22
|
-
getExplorerName,
|
|
23
|
-
getExplorerTxUrl,
|
|
24
|
-
getExplorerUrl,
|
|
25
|
-
getSupportedChainIds,
|
|
26
|
-
getSupportedTargetTokens,
|
|
27
|
-
getSupportedTokenSymbolsForChain,
|
|
28
|
-
getTokenAddress,
|
|
29
|
-
getTokenDecimals,
|
|
30
|
-
getTokenDecimalsByAddress,
|
|
31
|
-
getTokenIcon,
|
|
32
|
-
getTokenSymbol,
|
|
33
|
-
getUsdcAddress,
|
|
34
|
-
getUsdcDecimals,
|
|
35
|
-
isSupportedTokenAddressForChain
|
|
36
|
-
} from "./chunk-A6QLADED.mjs";
|
|
37
|
-
|
|
38
|
-
// src/DepositModalReown.tsx
|
|
39
|
-
import { useCallback } from "react";
|
|
40
|
-
|
|
41
|
-
// src/core/reown.tsx
|
|
42
|
-
import { useState } from "react";
|
|
43
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
44
|
-
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
|
|
45
|
-
import { WagmiProvider } from "wagmi";
|
|
46
|
-
import { createAppKit, useAppKit, useAppKitAccount } from "@reown/appkit/react";
|
|
47
|
-
import {
|
|
48
|
-
mainnet,
|
|
49
|
-
base,
|
|
50
|
-
arbitrum,
|
|
51
|
-
optimism,
|
|
52
|
-
polygon,
|
|
53
|
-
bsc
|
|
54
|
-
} from "@reown/appkit/networks";
|
|
55
|
-
import { useWalletClient, usePublicClient, useSwitchChain } from "wagmi";
|
|
56
|
-
import { jsx } from "react/jsx-runtime";
|
|
57
|
-
var NETWORKS = [
|
|
58
|
-
mainnet,
|
|
59
|
-
base,
|
|
60
|
-
arbitrum,
|
|
61
|
-
optimism,
|
|
62
|
-
polygon,
|
|
63
|
-
bsc
|
|
64
|
-
];
|
|
65
|
-
var cachedAdapter = null;
|
|
66
|
-
var cachedProjectId = null;
|
|
67
|
-
function mapTheme(theme) {
|
|
68
|
-
const themeMode = theme?.mode === "light" ? "light" : "dark";
|
|
69
|
-
const themeVariables = {};
|
|
70
|
-
if (theme?.ctaColor) {
|
|
71
|
-
themeVariables["--apkt-accent"] = theme.ctaColor;
|
|
72
|
-
}
|
|
73
|
-
return { themeMode, themeVariables };
|
|
74
|
-
}
|
|
75
|
-
function getOrCreateAdapter(projectId, theme) {
|
|
76
|
-
if (cachedAdapter && cachedProjectId === projectId) return cachedAdapter;
|
|
77
|
-
cachedAdapter = new WagmiAdapter({
|
|
78
|
-
networks: NETWORKS,
|
|
79
|
-
projectId
|
|
80
|
-
});
|
|
81
|
-
cachedProjectId = projectId;
|
|
82
|
-
const { themeMode, themeVariables } = mapTheme(theme);
|
|
83
|
-
createAppKit({
|
|
84
|
-
adapters: [cachedAdapter],
|
|
85
|
-
networks: NETWORKS,
|
|
86
|
-
projectId,
|
|
87
|
-
themeMode,
|
|
88
|
-
themeVariables,
|
|
89
|
-
features: {
|
|
90
|
-
connectMethodsOrder: ["wallet"],
|
|
91
|
-
email: false,
|
|
92
|
-
socials: false
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
return cachedAdapter;
|
|
96
|
-
}
|
|
97
|
-
function ReownWalletProvider({
|
|
98
|
-
projectId,
|
|
99
|
-
theme,
|
|
100
|
-
children
|
|
101
|
-
}) {
|
|
102
|
-
const [queryClient] = useState(() => new QueryClient());
|
|
103
|
-
const adapter = getOrCreateAdapter(projectId, theme);
|
|
104
|
-
const config = adapter.wagmiConfig;
|
|
105
|
-
return /* @__PURE__ */ jsx(WagmiProvider, { config, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children }) });
|
|
106
|
-
}
|
|
107
|
-
function useReownWallet() {
|
|
108
|
-
const { open } = useAppKit();
|
|
109
|
-
const { address, isConnected } = useAppKitAccount();
|
|
110
|
-
const { data: walletClient } = useWalletClient();
|
|
111
|
-
const publicClient = usePublicClient();
|
|
112
|
-
const { switchChainAsync } = useSwitchChain();
|
|
113
|
-
return {
|
|
114
|
-
walletClient: walletClient ?? void 0,
|
|
115
|
-
publicClient: publicClient ?? void 0,
|
|
116
|
-
address,
|
|
117
|
-
isConnected,
|
|
118
|
-
openConnect: () => {
|
|
119
|
-
void open({ view: isConnected ? "Account" : "Connect" });
|
|
120
|
-
},
|
|
121
|
-
switchChain: async (chainId) => {
|
|
122
|
-
await switchChainAsync({ chainId });
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/DepositModalReown.tsx
|
|
128
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
129
|
-
function DepositModalWithReown(props) {
|
|
130
|
-
const reown = useReownWallet();
|
|
131
|
-
const handleConnect = useCallback(() => {
|
|
132
|
-
reown.openConnect();
|
|
133
|
-
}, [reown.openConnect]);
|
|
134
|
-
return /* @__PURE__ */ jsx2(
|
|
135
|
-
DepositModalInner,
|
|
136
|
-
{
|
|
137
|
-
...props,
|
|
138
|
-
reownWallet: reown,
|
|
139
|
-
onConnect: handleConnect
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
function DepositModalReown(props) {
|
|
144
|
-
return /* @__PURE__ */ jsx2(ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ jsx2(DepositModalWithReown, { ...props }) });
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// src/WithdrawModalReown.tsx
|
|
148
|
-
import { useCallback as useCallback2 } from "react";
|
|
149
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
150
|
-
function WithdrawModalWithReown(props) {
|
|
151
|
-
const reown = useReownWallet();
|
|
152
|
-
const handleConnect = useCallback2(() => {
|
|
153
|
-
reown.openConnect();
|
|
154
|
-
}, [reown.openConnect]);
|
|
155
|
-
return /* @__PURE__ */ jsx3(
|
|
156
|
-
WithdrawModalInner,
|
|
157
|
-
{
|
|
158
|
-
...props,
|
|
159
|
-
reownWallet: reown,
|
|
160
|
-
onConnect: handleConnect
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
function WithdrawModalReown(props) {
|
|
165
|
-
return /* @__PURE__ */ jsx3(ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ jsx3(WithdrawModalWithReown, { ...props }) });
|
|
166
|
-
}
|
|
5
|
+
WithdrawModal
|
|
6
|
+
} from "./chunk-B3HMNWR4.mjs";
|
|
7
|
+
import "./chunk-GAFLOODV.mjs";
|
|
8
|
+
import "./chunk-A6QLADED.mjs";
|
|
167
9
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
DEFAULT_SIGNER_ADDRESS,
|
|
171
|
-
DepositModalReown as DepositModal,
|
|
172
|
-
NATIVE_TOKEN_ADDRESS,
|
|
173
|
-
SOURCE_CHAINS,
|
|
174
|
-
SUPPORTED_CHAINS,
|
|
175
|
-
WithdrawModalReown as WithdrawModal,
|
|
176
|
-
chainRegistry,
|
|
177
|
-
findChainIdForToken,
|
|
178
|
-
getChainBadge,
|
|
179
|
-
getChainIcon,
|
|
180
|
-
getChainId,
|
|
181
|
-
getChainName,
|
|
182
|
-
getChainObject,
|
|
183
|
-
getExplorerName,
|
|
184
|
-
getExplorerTxUrl,
|
|
185
|
-
getExplorerUrl,
|
|
186
|
-
getSupportedChainIds,
|
|
187
|
-
getSupportedTargetTokens,
|
|
188
|
-
getSupportedTokenSymbolsForChain,
|
|
189
|
-
getTokenAddress,
|
|
190
|
-
getTokenDecimals,
|
|
191
|
-
getTokenDecimalsByAddress,
|
|
192
|
-
getTokenIcon,
|
|
193
|
-
getTokenSymbol,
|
|
194
|
-
getUsdcAddress,
|
|
195
|
-
getUsdcDecimals,
|
|
196
|
-
isSupportedTokenAddressForChain
|
|
10
|
+
DepositModal,
|
|
11
|
+
WithdrawModal
|
|
197
12
|
};
|
|
@@ -23,19 +23,6 @@ interface DepositModalBranding {
|
|
|
23
23
|
logoUrl?: string;
|
|
24
24
|
title?: string;
|
|
25
25
|
}
|
|
26
|
-
interface ReownWallet {
|
|
27
|
-
walletClient: WalletClient | undefined;
|
|
28
|
-
publicClient: PublicClient | undefined;
|
|
29
|
-
address: Address | undefined;
|
|
30
|
-
isConnected: boolean;
|
|
31
|
-
openConnect: () => void;
|
|
32
|
-
switchChain: (chainId: number) => Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
interface WalletOption {
|
|
35
|
-
address: Address;
|
|
36
|
-
label: string;
|
|
37
|
-
kind: "connected" | "external";
|
|
38
|
-
}
|
|
39
26
|
interface ConnectedEventData {
|
|
40
27
|
address: Address;
|
|
41
28
|
smartAccount: Address;
|
|
@@ -126,8 +113,8 @@ interface WithdrawModalProps {
|
|
|
126
113
|
forceRegister?: boolean;
|
|
127
114
|
waitForFinalTx?: boolean;
|
|
128
115
|
reownAppId?: string;
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
|
|
117
|
+
signature: Hex;
|
|
131
118
|
}>;
|
|
132
119
|
onRequestConnect?: () => void;
|
|
133
120
|
connectButtonLabel?: string;
|
|
@@ -154,4 +141,4 @@ interface AssetOption {
|
|
|
154
141
|
balanceUsd?: number;
|
|
155
142
|
}
|
|
156
143
|
|
|
157
|
-
export type { AssetOption as A, ConnectedEventData as C, DepositCompleteEventData as D, ErrorEventData as E,
|
|
144
|
+
export type { AssetOption as A, ConnectedEventData as C, DepositCompleteEventData as D, ErrorEventData as E, WithdrawCompleteEventData as W, DepositFailedEventData as a, DepositModalBranding as b, DepositModalProps as c, DepositModalTheme as d, DepositModalUIConfig as e, DepositSubmittedEventData as f, WithdrawFailedEventData as g, WithdrawModalProps as h, WithdrawSubmittedEventData as i };
|
|
@@ -23,19 +23,6 @@ interface DepositModalBranding {
|
|
|
23
23
|
logoUrl?: string;
|
|
24
24
|
title?: string;
|
|
25
25
|
}
|
|
26
|
-
interface ReownWallet {
|
|
27
|
-
walletClient: WalletClient | undefined;
|
|
28
|
-
publicClient: PublicClient | undefined;
|
|
29
|
-
address: Address | undefined;
|
|
30
|
-
isConnected: boolean;
|
|
31
|
-
openConnect: () => void;
|
|
32
|
-
switchChain: (chainId: number) => Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
interface WalletOption {
|
|
35
|
-
address: Address;
|
|
36
|
-
label: string;
|
|
37
|
-
kind: "connected" | "external";
|
|
38
|
-
}
|
|
39
26
|
interface ConnectedEventData {
|
|
40
27
|
address: Address;
|
|
41
28
|
smartAccount: Address;
|
|
@@ -126,8 +113,8 @@ interface WithdrawModalProps {
|
|
|
126
113
|
forceRegister?: boolean;
|
|
127
114
|
waitForFinalTx?: boolean;
|
|
128
115
|
reownAppId?: string;
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
|
|
117
|
+
signature: Hex;
|
|
131
118
|
}>;
|
|
132
119
|
onRequestConnect?: () => void;
|
|
133
120
|
connectButtonLabel?: string;
|
|
@@ -154,4 +141,4 @@ interface AssetOption {
|
|
|
154
141
|
balanceUsd?: number;
|
|
155
142
|
}
|
|
156
143
|
|
|
157
|
-
export type { AssetOption as A, ConnectedEventData as C, DepositCompleteEventData as D, ErrorEventData as E,
|
|
144
|
+
export type { AssetOption as A, ConnectedEventData as C, DepositCompleteEventData as D, ErrorEventData as E, WithdrawCompleteEventData as W, DepositFailedEventData as a, DepositModalBranding as b, DepositModalProps as c, DepositModalTheme as d, DepositModalUIConfig as e, DepositSubmittedEventData as f, WithdrawFailedEventData as g, WithdrawModalProps as h, WithdrawSubmittedEventData as i };
|
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 _chunk4QDHXCPGcjs = require('./chunk-4QDHXCPG.cjs');
|
|
4
|
+
require('./chunk-CZWAKYDR.cjs');
|
|
5
5
|
require('./chunk-CEIWN53N.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.WithdrawModal =
|
|
8
|
+
exports.WithdrawModal = _chunk4QDHXCPGcjs.WithdrawModal;
|
package/dist/withdraw.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData,
|
|
2
|
+
import { h as WithdrawModalProps } from './types-BwaQ7jK5.cjs';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, i as WithdrawSubmittedEventData } from './types-BwaQ7jK5.cjs';
|
|
4
4
|
export { SafeTransactionRequest } from './safe.cjs';
|
|
5
5
|
import 'viem';
|
|
6
6
|
|
package/dist/withdraw.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData,
|
|
2
|
+
import { h as WithdrawModalProps } from './types-CgXyx46m.js';
|
|
3
|
+
export { A as AssetOption, C as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, i as WithdrawSubmittedEventData } from './types-CgXyx46m.js';
|
|
4
4
|
export { SafeTransactionRequest } from './safe.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
|
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.25",
|
|
4
4
|
"description": "React modal component for Rhinestone cross-chain deposits",
|
|
5
5
|
"author": "Rhinestone <dev@rhinestone.wtf>",
|
|
6
6
|
"bugs": {
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"import": "./dist/withdraw.mjs",
|
|
27
27
|
"require": "./dist/withdraw.cjs"
|
|
28
28
|
},
|
|
29
|
+
"./reown": {
|
|
30
|
+
"types": "./dist/reown.d.ts",
|
|
31
|
+
"import": "./dist/reown.mjs",
|
|
32
|
+
"require": "./dist/reown.cjs"
|
|
33
|
+
},
|
|
29
34
|
"./safe": {
|
|
30
35
|
"types": "./dist/safe.d.ts",
|
|
31
36
|
"import": "./dist/safe.mjs",
|
|
@@ -36,11 +41,6 @@
|
|
|
36
41
|
"import": "./dist/constants.mjs",
|
|
37
42
|
"require": "./dist/constants.cjs"
|
|
38
43
|
},
|
|
39
|
-
"./reown": {
|
|
40
|
-
"types": "./dist/reown.d.ts",
|
|
41
|
-
"import": "./dist/reown.mjs",
|
|
42
|
-
"require": "./dist/reown.cjs"
|
|
43
|
-
},
|
|
44
44
|
"./styles.css": {
|
|
45
45
|
"types": "./dist/styles.d.ts",
|
|
46
46
|
"default": "./dist/styles.css"
|
|
@@ -60,36 +60,20 @@
|
|
|
60
60
|
"prepublishOnly": "bun run clean && bun run build && bun run typecheck"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@reown/appkit": "^1.8.17",
|
|
64
|
-
"@reown/appkit-adapter-wagmi": "^1.8.17",
|
|
65
|
-
"@tanstack/react-query": "^5.0.0",
|
|
66
63
|
"react": ">=18",
|
|
67
64
|
"react-dom": ">=18",
|
|
68
|
-
"viem": ">=2"
|
|
69
|
-
"wagmi": "^3.4.2"
|
|
70
|
-
},
|
|
71
|
-
"peerDependenciesMeta": {
|
|
72
|
-
"@reown/appkit": {
|
|
73
|
-
"optional": true
|
|
74
|
-
},
|
|
75
|
-
"@reown/appkit-adapter-wagmi": {
|
|
76
|
-
"optional": true
|
|
77
|
-
},
|
|
78
|
-
"@tanstack/react-query": {
|
|
79
|
-
"optional": true
|
|
80
|
-
},
|
|
81
|
-
"wagmi": {
|
|
82
|
-
"optional": true
|
|
83
|
-
}
|
|
65
|
+
"viem": ">=2"
|
|
84
66
|
},
|
|
85
67
|
"dependencies": {
|
|
68
|
+
"@rhinestone/sdk": "^1.2.11",
|
|
86
69
|
"@rhinestone/shared-configs": "^1.4.93",
|
|
87
|
-
"qrcode-generator": "^2.0.4"
|
|
88
|
-
},
|
|
89
|
-
"devDependencies": {
|
|
90
70
|
"@reown/appkit": "^1.8.17",
|
|
91
71
|
"@reown/appkit-adapter-wagmi": "^1.8.17",
|
|
92
|
-
"
|
|
72
|
+
"qrcode-generator": "^2.0.4",
|
|
73
|
+
"wagmi": "^3.4.2",
|
|
74
|
+
"@tanstack/react-query": "^5.0.0"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
93
77
|
"@types/react": "^19.0.0",
|
|
94
78
|
"@types/react-dom": "^19.0.0",
|
|
95
79
|
"bun-types": "^1.3.8",
|
|
@@ -97,8 +81,7 @@
|
|
|
97
81
|
"react-dom": "^19.0.0",
|
|
98
82
|
"tsup": "^8.0.0",
|
|
99
83
|
"typescript": "^5.5.0",
|
|
100
|
-
"viem": "^2.0.0"
|
|
101
|
-
"wagmi": "^3.4.2"
|
|
84
|
+
"viem": "^2.0.0"
|
|
102
85
|
},
|
|
103
86
|
"keywords": [
|
|
104
87
|
"rhinestone",
|
|
@@ -111,6 +94,6 @@
|
|
|
111
94
|
],
|
|
112
95
|
"repository": {
|
|
113
96
|
"type": "git",
|
|
114
|
-
"url": "
|
|
97
|
+
"url": "https://github.com/rhinestonewtf/deposit-modal"
|
|
115
98
|
}
|
|
116
|
-
}
|
|
99
|
+
}
|