solariskit 1.0.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/LICENSE +9 -0
- package/dist/Wallet-B3fOxQx_.d.ts +71 -0
- package/dist/WalletButton-DiROWLU6.js +6023 -0
- package/dist/WalletButton-DkkREZEg.d.ts +326 -0
- package/dist/assets-CTAKUsg7.js +6 -0
- package/dist/base-BLNzR5ZY.js +6 -0
- package/dist/components/index.d.ts +151 -0
- package/dist/components/index.js +187 -0
- package/dist/index.css +2174 -0
- package/dist/index.d.ts +355 -0
- package/dist/index.js +340 -0
- package/dist/injectedWallet-Dg7isXIs.js +6 -0
- package/dist/login-jACia2OZ.js +6 -0
- package/dist/metaMaskWallet-r9D3peIN.js +6 -0
- package/dist/safeWallet-B3H2_qec.js +6 -0
- package/dist/sign-CzTxopYk.js +6 -0
- package/dist/walletConnectWallet-CMhOxkhx.js +6 -0
- package/dist/walletConnectors-CvfKowGR.js +209 -0
- package/dist/wallets/walletConnectors/index.d.ts +33 -0
- package/dist/wallets/walletConnectors/index.js +4 -0
- package/package.json +99 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
|
|
2
|
+
import { c as RainbowKitAuthenticationProvider, d as RainbowKitProviderProps, f as Theme, g as ThemeVars, h as DisclaimerComponent, i as ConnectButton, l as createAuthenticationAdapter, o as AuthenticationConfig, p as AvatarComponent, r as WalletButtonRendererProps, s as AuthenticationStatus, t as WalletButton, u as RainbowKitProvider } from "./WalletButton-DkkREZEg.js";
|
|
3
|
+
import { a as WalletDetailsParams, i as Wallet, r as RainbowKitWalletConnectParameters, s as WalletList, t as CreateConnector } from "./Wallet-B3fOxQx_.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import * as _$wagmi from "wagmi";
|
|
6
|
+
import { CreateConfigParameters, CreateConnectorFn } from "wagmi";
|
|
7
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
+
import { Transport } from "viem";
|
|
9
|
+
import { Chain } from "wagmi/chains";
|
|
10
|
+
|
|
11
|
+
//#region src/components/RainbowKitProvider/RainbowKitChainContext.d.ts
|
|
12
|
+
interface RainbowKitChain extends Chain {
|
|
13
|
+
iconUrl?: string | (() => Promise<string>) | null;
|
|
14
|
+
iconBackground?: string;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/config/getDefaultConfig.d.ts
|
|
18
|
+
type _chains = readonly [RainbowKitChain, ...RainbowKitChain[]];
|
|
19
|
+
type _transports = Record<_chains[number]["id"], Transport>;
|
|
20
|
+
interface GetDefaultConfigParameters<chains extends _chains, transports extends _transports> extends Omit<CreateConfigParameters<chains, transports>, "client" | "connectors"> {
|
|
21
|
+
appName: string;
|
|
22
|
+
appDescription?: string;
|
|
23
|
+
appUrl?: string;
|
|
24
|
+
appIcon?: string;
|
|
25
|
+
wallets?: WalletList;
|
|
26
|
+
projectId: string;
|
|
27
|
+
walletConnectParameters?: RainbowKitWalletConnectParameters;
|
|
28
|
+
}
|
|
29
|
+
declare const getDefaultConfig: <chains extends _chains, transports extends _transports>({
|
|
30
|
+
appName,
|
|
31
|
+
appDescription,
|
|
32
|
+
appUrl,
|
|
33
|
+
appIcon,
|
|
34
|
+
wallets,
|
|
35
|
+
projectId,
|
|
36
|
+
walletConnectParameters,
|
|
37
|
+
...wagmiParameters
|
|
38
|
+
}: GetDefaultConfigParameters<chains, transports>) => _$wagmi.Config<chains, transports, _$wagmi.CreateConnectorFn[]>;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/wallets/connectorsForWallets.d.ts
|
|
41
|
+
interface ConnectorsForWalletsParameters {
|
|
42
|
+
projectId: string;
|
|
43
|
+
appName: string;
|
|
44
|
+
appDescription?: string;
|
|
45
|
+
appUrl?: string;
|
|
46
|
+
appIcon?: string;
|
|
47
|
+
walletConnectParameters?: RainbowKitWalletConnectParameters;
|
|
48
|
+
}
|
|
49
|
+
declare const connectorsForWallets: (walletList: WalletList, {
|
|
50
|
+
projectId,
|
|
51
|
+
walletConnectParameters,
|
|
52
|
+
appName,
|
|
53
|
+
appDescription,
|
|
54
|
+
appUrl,
|
|
55
|
+
appIcon
|
|
56
|
+
}: ConnectorsForWalletsParameters) => CreateConnectorFn[];
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/wallets/getDefaultWallets.d.ts
|
|
59
|
+
declare function getDefaultWallets(parameters: ConnectorsForWalletsParameters): {
|
|
60
|
+
connectors: CreateConnectorFn[];
|
|
61
|
+
wallets: WalletList;
|
|
62
|
+
};
|
|
63
|
+
declare function getDefaultWallets(): {
|
|
64
|
+
wallets: WalletList;
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/wallets/getWalletConnectConnector.d.ts
|
|
68
|
+
interface GetWalletConnectConnectorParams {
|
|
69
|
+
projectId: string;
|
|
70
|
+
walletConnectParameters?: RainbowKitWalletConnectParameters;
|
|
71
|
+
}
|
|
72
|
+
declare function getWalletConnectConnector({
|
|
73
|
+
projectId,
|
|
74
|
+
walletConnectParameters
|
|
75
|
+
}: GetWalletConnectConnectorParams): CreateConnector;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/RainbowKitProvider/ModalContext.d.ts
|
|
78
|
+
declare function useAccountModal(): {
|
|
79
|
+
accountModalOpen: boolean;
|
|
80
|
+
openAccountModal: (() => void) | undefined;
|
|
81
|
+
};
|
|
82
|
+
declare function useChainModal(): {
|
|
83
|
+
chainModalOpen: boolean;
|
|
84
|
+
openChainModal: (() => void) | undefined;
|
|
85
|
+
};
|
|
86
|
+
declare function useConnectModal(): {
|
|
87
|
+
connectModalOpen: boolean;
|
|
88
|
+
openConnectModal: (() => void) | undefined;
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/transactions/transactionStore.d.ts
|
|
92
|
+
type TransactionStatus = "pending" | "confirmed" | "failed";
|
|
93
|
+
interface Transaction {
|
|
94
|
+
hash: string;
|
|
95
|
+
description: string;
|
|
96
|
+
status: TransactionStatus;
|
|
97
|
+
confirmations?: number;
|
|
98
|
+
}
|
|
99
|
+
type NewTransaction = Omit<Transaction, "status">;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/transactions/useAddRecentTransaction.d.ts
|
|
102
|
+
declare function useAddRecentTransaction(): (transaction: NewTransaction) => void;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/themes/baseTheme.d.ts
|
|
105
|
+
declare const fontStacks: {
|
|
106
|
+
readonly rounded: "SFRounded, ui-rounded, \"SF Pro Rounded\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
107
|
+
readonly system: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
108
|
+
};
|
|
109
|
+
type FontStack = keyof typeof fontStacks;
|
|
110
|
+
type RadiusScale = "large" | "medium" | "small" | "none";
|
|
111
|
+
type Blurs = "large" | "small" | "none";
|
|
112
|
+
interface BaseThemeOptions {
|
|
113
|
+
borderRadius?: RadiusScale;
|
|
114
|
+
fontStack?: FontStack;
|
|
115
|
+
overlayBlur?: Blurs;
|
|
116
|
+
}
|
|
117
|
+
interface AccentColor {
|
|
118
|
+
accentColor: string;
|
|
119
|
+
accentColorForeground: string;
|
|
120
|
+
}
|
|
121
|
+
type AccentColorPreset = "blue" | "green" | "red" | "purple" | "pink" | "orange";
|
|
122
|
+
interface ThemeOptions extends BaseThemeOptions {
|
|
123
|
+
accentColor?: string;
|
|
124
|
+
accentColorForeground?: string;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/themes/lightTheme.d.ts
|
|
128
|
+
declare const lightTheme: {
|
|
129
|
+
({
|
|
130
|
+
accentColor,
|
|
131
|
+
accentColorForeground,
|
|
132
|
+
...baseThemeOptions
|
|
133
|
+
}?: ThemeOptions): {
|
|
134
|
+
colors: {
|
|
135
|
+
accentColor: string;
|
|
136
|
+
accentColorForeground: string;
|
|
137
|
+
actionButtonBorder: string;
|
|
138
|
+
actionButtonBorderMobile: string;
|
|
139
|
+
actionButtonSecondaryBackground: string;
|
|
140
|
+
closeButton: string;
|
|
141
|
+
closeButtonBackground: string;
|
|
142
|
+
connectButtonBackground: string;
|
|
143
|
+
connectButtonBackgroundError: string;
|
|
144
|
+
connectButtonInnerBackground: string;
|
|
145
|
+
connectButtonText: string;
|
|
146
|
+
connectButtonTextError: string;
|
|
147
|
+
connectionIndicator: string;
|
|
148
|
+
downloadBottomCardBackground: string;
|
|
149
|
+
downloadTopCardBackground: string;
|
|
150
|
+
error: string;
|
|
151
|
+
generalBorder: string;
|
|
152
|
+
generalBorderDim: string;
|
|
153
|
+
menuItemBackground: string;
|
|
154
|
+
modalBackdrop: string;
|
|
155
|
+
modalBackground: string;
|
|
156
|
+
modalBorder: string;
|
|
157
|
+
modalText: string;
|
|
158
|
+
modalTextDim: string;
|
|
159
|
+
modalTextSecondary: string;
|
|
160
|
+
profileAction: string;
|
|
161
|
+
profileActionHover: string;
|
|
162
|
+
profileForeground: string;
|
|
163
|
+
selectedOptionBorder: string;
|
|
164
|
+
standby: string;
|
|
165
|
+
};
|
|
166
|
+
shadows: {
|
|
167
|
+
connectButton: string;
|
|
168
|
+
dialog: string;
|
|
169
|
+
profileDetailsAction: string;
|
|
170
|
+
selectedOption: string;
|
|
171
|
+
selectedWallet: string;
|
|
172
|
+
walletLogo: string;
|
|
173
|
+
};
|
|
174
|
+
radii: {
|
|
175
|
+
actionButton: string;
|
|
176
|
+
connectButton: string;
|
|
177
|
+
menuButton: string;
|
|
178
|
+
modal: string;
|
|
179
|
+
modalMobile: string;
|
|
180
|
+
};
|
|
181
|
+
fonts: {
|
|
182
|
+
body: string;
|
|
183
|
+
};
|
|
184
|
+
blurs: {
|
|
185
|
+
modalOverlay: string;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
accentColors: Record<AccentColorPreset, AccentColor>;
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/themes/darkTheme.d.ts
|
|
192
|
+
declare const darkTheme: {
|
|
193
|
+
({
|
|
194
|
+
accentColor,
|
|
195
|
+
accentColorForeground,
|
|
196
|
+
...baseThemeOptions
|
|
197
|
+
}?: ThemeOptions): {
|
|
198
|
+
colors: {
|
|
199
|
+
accentColor: string;
|
|
200
|
+
accentColorForeground: string;
|
|
201
|
+
actionButtonBorder: string;
|
|
202
|
+
actionButtonBorderMobile: string;
|
|
203
|
+
actionButtonSecondaryBackground: string;
|
|
204
|
+
closeButton: string;
|
|
205
|
+
closeButtonBackground: string;
|
|
206
|
+
connectButtonBackground: string;
|
|
207
|
+
connectButtonBackgroundError: string;
|
|
208
|
+
connectButtonInnerBackground: string;
|
|
209
|
+
connectButtonText: string;
|
|
210
|
+
connectButtonTextError: string;
|
|
211
|
+
connectionIndicator: string;
|
|
212
|
+
downloadBottomCardBackground: string;
|
|
213
|
+
downloadTopCardBackground: string;
|
|
214
|
+
error: string;
|
|
215
|
+
generalBorder: string;
|
|
216
|
+
generalBorderDim: string;
|
|
217
|
+
menuItemBackground: string;
|
|
218
|
+
modalBackdrop: string;
|
|
219
|
+
modalBackground: string;
|
|
220
|
+
modalBorder: string;
|
|
221
|
+
modalText: string;
|
|
222
|
+
modalTextDim: string;
|
|
223
|
+
modalTextSecondary: string;
|
|
224
|
+
profileAction: string;
|
|
225
|
+
profileActionHover: string;
|
|
226
|
+
profileForeground: string;
|
|
227
|
+
selectedOptionBorder: string;
|
|
228
|
+
standby: string;
|
|
229
|
+
};
|
|
230
|
+
shadows: {
|
|
231
|
+
connectButton: string;
|
|
232
|
+
dialog: string;
|
|
233
|
+
profileDetailsAction: string;
|
|
234
|
+
selectedOption: string;
|
|
235
|
+
selectedWallet: string;
|
|
236
|
+
walletLogo: string;
|
|
237
|
+
};
|
|
238
|
+
radii: {
|
|
239
|
+
actionButton: string;
|
|
240
|
+
connectButton: string;
|
|
241
|
+
menuButton: string;
|
|
242
|
+
modal: string;
|
|
243
|
+
modalMobile: string;
|
|
244
|
+
};
|
|
245
|
+
fonts: {
|
|
246
|
+
body: string;
|
|
247
|
+
};
|
|
248
|
+
blurs: {
|
|
249
|
+
modalOverlay: string;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
accentColors: Record<AccentColorPreset, AccentColor>;
|
|
253
|
+
};
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/themes/midnightTheme.d.ts
|
|
256
|
+
declare const midnightTheme: {
|
|
257
|
+
({
|
|
258
|
+
accentColor,
|
|
259
|
+
accentColorForeground,
|
|
260
|
+
...baseThemeOptions
|
|
261
|
+
}?: ThemeOptions): {
|
|
262
|
+
colors: {
|
|
263
|
+
accentColor: string;
|
|
264
|
+
accentColorForeground: string;
|
|
265
|
+
actionButtonBorder: string;
|
|
266
|
+
actionButtonBorderMobile: string;
|
|
267
|
+
actionButtonSecondaryBackground: string;
|
|
268
|
+
closeButton: string;
|
|
269
|
+
closeButtonBackground: string;
|
|
270
|
+
connectButtonBackground: string;
|
|
271
|
+
connectButtonBackgroundError: string;
|
|
272
|
+
connectButtonInnerBackground: string;
|
|
273
|
+
connectButtonText: string;
|
|
274
|
+
connectButtonTextError: string;
|
|
275
|
+
connectionIndicator: string;
|
|
276
|
+
downloadBottomCardBackground: string;
|
|
277
|
+
downloadTopCardBackground: string;
|
|
278
|
+
error: string;
|
|
279
|
+
generalBorder: string;
|
|
280
|
+
generalBorderDim: string;
|
|
281
|
+
menuItemBackground: string;
|
|
282
|
+
modalBackdrop: string;
|
|
283
|
+
modalBackground: string;
|
|
284
|
+
modalBorder: string;
|
|
285
|
+
modalText: string;
|
|
286
|
+
modalTextDim: string;
|
|
287
|
+
modalTextSecondary: string;
|
|
288
|
+
profileAction: string;
|
|
289
|
+
profileActionHover: string;
|
|
290
|
+
profileForeground: string;
|
|
291
|
+
selectedOptionBorder: string;
|
|
292
|
+
standby: string;
|
|
293
|
+
};
|
|
294
|
+
shadows: {
|
|
295
|
+
connectButton: string;
|
|
296
|
+
dialog: string;
|
|
297
|
+
profileDetailsAction: string;
|
|
298
|
+
selectedOption: string;
|
|
299
|
+
selectedWallet: string;
|
|
300
|
+
walletLogo: string;
|
|
301
|
+
};
|
|
302
|
+
radii: {
|
|
303
|
+
actionButton: string;
|
|
304
|
+
connectButton: string;
|
|
305
|
+
menuButton: string;
|
|
306
|
+
modal: string;
|
|
307
|
+
modalMobile: string;
|
|
308
|
+
};
|
|
309
|
+
fonts: {
|
|
310
|
+
body: string;
|
|
311
|
+
};
|
|
312
|
+
blurs: {
|
|
313
|
+
modalOverlay: string;
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
accentColors: Record<AccentColorPreset, AccentColor>;
|
|
317
|
+
};
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/css/cssStringFromTheme.d.ts
|
|
320
|
+
declare function cssStringFromTheme(theme: ThemeVars | (() => ThemeVars), options?: {
|
|
321
|
+
extends?: ThemeVars | (() => ThemeVars);
|
|
322
|
+
}): string;
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/css/cssObjectFromTheme.d.ts
|
|
325
|
+
declare function cssObjectFromTheme(theme: ThemeVars | (() => ThemeVars), {
|
|
326
|
+
extends: baseTheme
|
|
327
|
+
}?: {
|
|
328
|
+
extends?: ThemeVars | (() => ThemeVars);
|
|
329
|
+
}): {
|
|
330
|
+
[cssVarName: string]: string;
|
|
331
|
+
};
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/components/ConnectOptions/DesktopOptions.d.ts
|
|
334
|
+
declare function DesktopOptions({
|
|
335
|
+
onClose
|
|
336
|
+
}: {
|
|
337
|
+
onClose: () => void;
|
|
338
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region src/components/ConnectOptions/MobileOptions.d.ts
|
|
341
|
+
declare function MobileOptions({
|
|
342
|
+
onClose
|
|
343
|
+
}: {
|
|
344
|
+
onClose: () => void;
|
|
345
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/__private__/index.d.ts
|
|
348
|
+
declare const __private__: {
|
|
349
|
+
DesktopOptions: typeof DesktopOptions;
|
|
350
|
+
dialogContent: string;
|
|
351
|
+
dialogContentMobile: string;
|
|
352
|
+
MobileOptions: typeof MobileOptions;
|
|
353
|
+
};
|
|
354
|
+
//#endregion
|
|
355
|
+
export { type AuthenticationConfig, type AuthenticationStatus, type AvatarComponent, type RainbowKitChain as Chain, ConnectButton, type DisclaimerComponent, RainbowKitAuthenticationProvider, RainbowKitProvider, type RainbowKitProviderProps, type RainbowKitWalletConnectParameters, type Theme, type Wallet, WalletButton, type WalletButtonRendererProps, type WalletDetailsParams, type WalletList, __private__, connectorsForWallets, createAuthenticationAdapter, cssObjectFromTheme, cssStringFromTheme, darkTheme, getDefaultConfig, getDefaultWallets, getWalletConnectConnector, lightTheme, midnightTheme, useAccountModal, useAddRecentTransaction, useChainModal, useConnectModal };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { S as createAuthenticationAdapter, _ as useTransactionStore, a as useConnectModal, d as dialogContentMobile, f as RainbowKitProvider, g as cssObjectFromTheme, h as cssStringFromTheme, i as useChainModal, m as baseTheme, n as ConnectButton, o as MobileOptions, p as lightTheme, r as useAccountModal, s as DesktopOptions, t as WalletButton, u as dialogContent, v as useChainId, x as RainbowKitAuthenticationProvider } from "./WalletButton-DiROWLU6.js";
|
|
3
|
+
import { a as injectedWallet, i as getWalletConnectConnector, n as safeWallet, o as base, r as metaMaskWallet, t as walletConnectWallet } from "./walletConnectors-CvfKowGR.js";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { createConfig, http, useConnection } from "wagmi";
|
|
6
|
+
|
|
7
|
+
//#region src/wallets/computeWalletConnectMetaData.ts
|
|
8
|
+
const computeWalletConnectMetaData = ({ appName, appDescription, appUrl, appIcon }) => {
|
|
9
|
+
return {
|
|
10
|
+
name: appName,
|
|
11
|
+
description: appDescription ?? appName,
|
|
12
|
+
url: appUrl ?? (typeof window !== "undefined" ? window.location.origin : ""),
|
|
13
|
+
icons: appIcon ? [appIcon] : []
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/utils/colors.ts
|
|
19
|
+
const isHexString = (color) => {
|
|
20
|
+
return /^#([0-9a-f]{3}){1,2}$/i.test(color);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/utils/omitUndefinedValues.ts
|
|
25
|
+
function omitUndefinedValues(obj) {
|
|
26
|
+
return Object.fromEntries(Object.entries(obj).filter(([_key, value]) => value !== void 0));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/utils/uniqueBy.ts
|
|
31
|
+
function uniqueBy(items, key) {
|
|
32
|
+
const filtered = [];
|
|
33
|
+
for (const item of items) if (!filtered.some((x) => x[key] === item[key])) filtered.push(item);
|
|
34
|
+
return filtered;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/wallets/connectorsForWallets.ts
|
|
39
|
+
const connectorsForWallets = (walletList, { projectId, walletConnectParameters, appName, appDescription, appUrl, appIcon }) => {
|
|
40
|
+
if (!walletList.length) throw new Error("No wallet list was provided");
|
|
41
|
+
for (const { wallets, groupName } of walletList) if (!wallets.length) throw new Error(`No wallets provided for group: ${groupName}`);
|
|
42
|
+
let index = -1;
|
|
43
|
+
const connectors = [];
|
|
44
|
+
const visibleWallets = [];
|
|
45
|
+
const potentiallyHiddenWallets = [];
|
|
46
|
+
const walletConnectMetaData = computeWalletConnectMetaData({
|
|
47
|
+
appName,
|
|
48
|
+
appDescription,
|
|
49
|
+
appUrl,
|
|
50
|
+
appIcon
|
|
51
|
+
});
|
|
52
|
+
for (const [groupIndex, { groupName, wallets }] of walletList.entries()) for (const createWallet of wallets) {
|
|
53
|
+
index++;
|
|
54
|
+
const wallet = createWallet({
|
|
55
|
+
projectId,
|
|
56
|
+
appName,
|
|
57
|
+
appIcon,
|
|
58
|
+
options: {
|
|
59
|
+
metadata: walletConnectMetaData,
|
|
60
|
+
...walletConnectParameters
|
|
61
|
+
},
|
|
62
|
+
walletConnectParameters: {
|
|
63
|
+
metadata: walletConnectMetaData,
|
|
64
|
+
...walletConnectParameters
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
if (wallet?.iconAccent && !isHexString(wallet?.iconAccent)) throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${wallet.name}`);
|
|
68
|
+
const walletListItem = {
|
|
69
|
+
...wallet,
|
|
70
|
+
groupIndex: groupIndex + 1,
|
|
71
|
+
groupName,
|
|
72
|
+
index
|
|
73
|
+
};
|
|
74
|
+
if (typeof wallet.hidden === "function") potentiallyHiddenWallets.push(walletListItem);
|
|
75
|
+
else visibleWallets.push(walletListItem);
|
|
76
|
+
}
|
|
77
|
+
const walletListItems = uniqueBy([...visibleWallets, ...potentiallyHiddenWallets], "id");
|
|
78
|
+
for (const { createConnector, groupIndex, groupName, hidden, ...walletMeta } of walletListItems) {
|
|
79
|
+
if (typeof hidden === "function") {
|
|
80
|
+
if (hidden()) continue;
|
|
81
|
+
}
|
|
82
|
+
const walletMetaData = (additionalRkParams) => {
|
|
83
|
+
return { rkDetails: omitUndefinedValues({
|
|
84
|
+
...walletMeta,
|
|
85
|
+
groupIndex,
|
|
86
|
+
groupName,
|
|
87
|
+
isRainbowKitConnector: true,
|
|
88
|
+
...additionalRkParams ? additionalRkParams : {}
|
|
89
|
+
}) };
|
|
90
|
+
};
|
|
91
|
+
if (walletMeta.id === "walletConnect") connectors.push(createConnector(walletMetaData({
|
|
92
|
+
isWalletConnectModalConnector: true,
|
|
93
|
+
showQrModal: true
|
|
94
|
+
})));
|
|
95
|
+
const connector = createConnector(walletMetaData());
|
|
96
|
+
connectors.push(connector);
|
|
97
|
+
}
|
|
98
|
+
return connectors;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/config/getDefaultConfig.ts
|
|
103
|
+
const createDefaultTransports = (chains) => {
|
|
104
|
+
return chains.reduce((acc, chain) => {
|
|
105
|
+
const key = chain.id;
|
|
106
|
+
acc[key] = http();
|
|
107
|
+
return acc;
|
|
108
|
+
}, {});
|
|
109
|
+
};
|
|
110
|
+
const getDefaultConfig = ({ appName, appDescription, appUrl, appIcon, wallets, projectId, walletConnectParameters, ...wagmiParameters }) => {
|
|
111
|
+
const { transports, chains, ...restWagmiParameters } = wagmiParameters;
|
|
112
|
+
const metadata = computeWalletConnectMetaData({
|
|
113
|
+
appName,
|
|
114
|
+
appDescription,
|
|
115
|
+
appUrl,
|
|
116
|
+
appIcon
|
|
117
|
+
});
|
|
118
|
+
return createConfig({
|
|
119
|
+
connectors: connectorsForWallets(wallets || [{
|
|
120
|
+
groupName: "Popular",
|
|
121
|
+
wallets: [
|
|
122
|
+
safeWallet,
|
|
123
|
+
injectedWallet,
|
|
124
|
+
base,
|
|
125
|
+
metaMaskWallet,
|
|
126
|
+
walletConnectWallet
|
|
127
|
+
]
|
|
128
|
+
}], {
|
|
129
|
+
projectId,
|
|
130
|
+
appName,
|
|
131
|
+
appDescription,
|
|
132
|
+
appUrl,
|
|
133
|
+
appIcon,
|
|
134
|
+
walletConnectParameters: {
|
|
135
|
+
metadata,
|
|
136
|
+
...walletConnectParameters
|
|
137
|
+
}
|
|
138
|
+
}),
|
|
139
|
+
chains,
|
|
140
|
+
transports: transports || createDefaultTransports(chains),
|
|
141
|
+
...restWagmiParameters
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/wallets/getDefaultWallets.ts
|
|
147
|
+
function getDefaultWallets(parameters) {
|
|
148
|
+
const wallets = [{
|
|
149
|
+
groupName: "Popular",
|
|
150
|
+
wallets: [
|
|
151
|
+
safeWallet,
|
|
152
|
+
injectedWallet,
|
|
153
|
+
base,
|
|
154
|
+
metaMaskWallet,
|
|
155
|
+
walletConnectWallet
|
|
156
|
+
]
|
|
157
|
+
}];
|
|
158
|
+
if (parameters) return {
|
|
159
|
+
connectors: connectorsForWallets(wallets, parameters),
|
|
160
|
+
wallets
|
|
161
|
+
};
|
|
162
|
+
return { wallets };
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/transactions/useAddRecentTransaction.ts
|
|
167
|
+
function useAddRecentTransaction() {
|
|
168
|
+
const store = useTransactionStore();
|
|
169
|
+
const { address } = useConnection();
|
|
170
|
+
const chainId = useChainId();
|
|
171
|
+
return useCallback((transaction) => {
|
|
172
|
+
if (!address || !chainId) throw new Error("No address or chain ID found");
|
|
173
|
+
store.addTransaction(address, chainId, transaction);
|
|
174
|
+
}, [
|
|
175
|
+
store,
|
|
176
|
+
address,
|
|
177
|
+
chainId
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/themes/darkTheme.ts
|
|
183
|
+
const darkGrey = "#1A1B1F";
|
|
184
|
+
const accentColors$1 = {
|
|
185
|
+
blue: {
|
|
186
|
+
accentColor: "#3898FF",
|
|
187
|
+
accentColorForeground: "#FFF"
|
|
188
|
+
},
|
|
189
|
+
green: {
|
|
190
|
+
accentColor: "#4BD166",
|
|
191
|
+
accentColorForeground: darkGrey
|
|
192
|
+
},
|
|
193
|
+
orange: {
|
|
194
|
+
accentColor: "#FF983D",
|
|
195
|
+
accentColorForeground: darkGrey
|
|
196
|
+
},
|
|
197
|
+
pink: {
|
|
198
|
+
accentColor: "#FF7AB8",
|
|
199
|
+
accentColorForeground: darkGrey
|
|
200
|
+
},
|
|
201
|
+
purple: {
|
|
202
|
+
accentColor: "#7A70FF",
|
|
203
|
+
accentColorForeground: "#FFF"
|
|
204
|
+
},
|
|
205
|
+
red: {
|
|
206
|
+
accentColor: "#FF6257",
|
|
207
|
+
accentColorForeground: "#FFF"
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const defaultAccentColor$1 = accentColors$1.blue;
|
|
211
|
+
const darkTheme = ({ accentColor = defaultAccentColor$1.accentColor, accentColorForeground = defaultAccentColor$1.accentColorForeground, ...baseThemeOptions } = {}) => ({
|
|
212
|
+
...baseTheme(baseThemeOptions),
|
|
213
|
+
colors: {
|
|
214
|
+
accentColor,
|
|
215
|
+
accentColorForeground,
|
|
216
|
+
actionButtonBorder: "rgba(255, 255, 255, 0.04)",
|
|
217
|
+
actionButtonBorderMobile: "rgba(255, 255, 255, 0.08)",
|
|
218
|
+
actionButtonSecondaryBackground: "rgba(255, 255, 255, 0.08)",
|
|
219
|
+
closeButton: "rgba(224, 232, 255, 0.6)",
|
|
220
|
+
closeButtonBackground: "rgba(255, 255, 255, 0.08)",
|
|
221
|
+
connectButtonBackground: darkGrey,
|
|
222
|
+
connectButtonBackgroundError: "#FF494A",
|
|
223
|
+
connectButtonInnerBackground: "linear-gradient(0deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.15))",
|
|
224
|
+
connectButtonText: "#FFF",
|
|
225
|
+
connectButtonTextError: "#FFF",
|
|
226
|
+
connectionIndicator: "#30E000",
|
|
227
|
+
downloadBottomCardBackground: "linear-gradient(126deg, rgba(0, 0, 0, 0) 9.49%, rgba(120, 120, 120, 0.2) 71.04%), #1A1B1F",
|
|
228
|
+
downloadTopCardBackground: "linear-gradient(126deg, rgba(120, 120, 120, 0.2) 9.49%, rgba(0, 0, 0, 0) 71.04%), #1A1B1F",
|
|
229
|
+
error: "#FF494A",
|
|
230
|
+
generalBorder: "rgba(255, 255, 255, 0.08)",
|
|
231
|
+
generalBorderDim: "rgba(255, 255, 255, 0.04)",
|
|
232
|
+
menuItemBackground: "rgba(224, 232, 255, 0.1)",
|
|
233
|
+
modalBackdrop: "rgba(0, 0, 0, 0.5)",
|
|
234
|
+
modalBackground: "#1A1B1F",
|
|
235
|
+
modalBorder: "rgba(255, 255, 255, 0.08)",
|
|
236
|
+
modalText: "#FFF",
|
|
237
|
+
modalTextDim: "rgba(224, 232, 255, 0.3)",
|
|
238
|
+
modalTextSecondary: "rgba(255, 255, 255, 0.6)",
|
|
239
|
+
profileAction: "rgba(224, 232, 255, 0.1)",
|
|
240
|
+
profileActionHover: "rgba(224, 232, 255, 0.2)",
|
|
241
|
+
profileForeground: "rgba(224, 232, 255, 0.05)",
|
|
242
|
+
selectedOptionBorder: "rgba(224, 232, 255, 0.1)",
|
|
243
|
+
standby: "#FFD641"
|
|
244
|
+
},
|
|
245
|
+
shadows: {
|
|
246
|
+
connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
247
|
+
dialog: "0px 8px 32px rgba(0, 0, 0, 0.32)",
|
|
248
|
+
profileDetailsAction: "0px 2px 6px rgba(37, 41, 46, 0.04)",
|
|
249
|
+
selectedOption: "0px 2px 6px rgba(0, 0, 0, 0.24)",
|
|
250
|
+
selectedWallet: "0px 2px 6px rgba(0, 0, 0, 0.24)",
|
|
251
|
+
walletLogo: "0px 2px 16px rgba(0, 0, 0, 0.16)"
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
darkTheme.accentColors = accentColors$1;
|
|
255
|
+
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/themes/midnightTheme.ts
|
|
258
|
+
const accentColors = {
|
|
259
|
+
blue: {
|
|
260
|
+
accentColor: "#3898FF",
|
|
261
|
+
accentColorForeground: "#FFF"
|
|
262
|
+
},
|
|
263
|
+
green: {
|
|
264
|
+
accentColor: "#4BD166",
|
|
265
|
+
accentColorForeground: "#000"
|
|
266
|
+
},
|
|
267
|
+
orange: {
|
|
268
|
+
accentColor: "#FF983D",
|
|
269
|
+
accentColorForeground: "#000"
|
|
270
|
+
},
|
|
271
|
+
pink: {
|
|
272
|
+
accentColor: "#FF7AB8",
|
|
273
|
+
accentColorForeground: "#000"
|
|
274
|
+
},
|
|
275
|
+
purple: {
|
|
276
|
+
accentColor: "#7A70FF",
|
|
277
|
+
accentColorForeground: "#FFF"
|
|
278
|
+
},
|
|
279
|
+
red: {
|
|
280
|
+
accentColor: "#FF6257",
|
|
281
|
+
accentColorForeground: "#FFF"
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
const defaultAccentColor = accentColors.blue;
|
|
285
|
+
const midnightTheme = ({ accentColor = defaultAccentColor.accentColor, accentColorForeground = defaultAccentColor.accentColorForeground, ...baseThemeOptions } = {}) => ({
|
|
286
|
+
...baseTheme(baseThemeOptions),
|
|
287
|
+
colors: {
|
|
288
|
+
accentColor,
|
|
289
|
+
accentColorForeground,
|
|
290
|
+
actionButtonBorder: "rgba(255, 255, 255, 0.04)",
|
|
291
|
+
actionButtonBorderMobile: "rgba(255, 255, 255, 0.1)",
|
|
292
|
+
actionButtonSecondaryBackground: "rgba(255, 255, 255, 0.08)",
|
|
293
|
+
closeButton: "rgba(255, 255, 255, 0.7)",
|
|
294
|
+
closeButtonBackground: "rgba(255, 255, 255, 0.08)",
|
|
295
|
+
connectButtonBackground: "#000",
|
|
296
|
+
connectButtonBackgroundError: "#FF494A",
|
|
297
|
+
connectButtonInnerBackground: "linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12))",
|
|
298
|
+
connectButtonText: "#FFF",
|
|
299
|
+
connectButtonTextError: "#FFF",
|
|
300
|
+
connectionIndicator: "#30E000",
|
|
301
|
+
downloadBottomCardBackground: "linear-gradient(126deg, rgba(0, 0, 0, 0) 9.49%, rgba(120, 120, 120, 0.1) 71.04%), #050505",
|
|
302
|
+
downloadTopCardBackground: "linear-gradient(126deg, rgba(120, 120, 120, 0.1) 9.49%, rgba(0, 0, 0, 0) 71.04%), #050505",
|
|
303
|
+
error: "#FF494A",
|
|
304
|
+
generalBorder: "rgba(255, 255, 255, 0.08)",
|
|
305
|
+
generalBorderDim: "rgba(255, 255, 255, 0.04)",
|
|
306
|
+
menuItemBackground: "rgba(255, 255, 255, 0.08)",
|
|
307
|
+
modalBackdrop: "rgba(0, 0, 0, 0.7)",
|
|
308
|
+
modalBackground: "#000",
|
|
309
|
+
modalBorder: "rgba(255, 255, 255, 0.08)",
|
|
310
|
+
modalText: "#FFF",
|
|
311
|
+
modalTextDim: "rgba(255, 255, 255, 0.2)",
|
|
312
|
+
modalTextSecondary: "rgba(255, 255, 255, 0.6)",
|
|
313
|
+
profileAction: "rgba(255, 255, 255, 0.1)",
|
|
314
|
+
profileActionHover: "rgba(255, 255, 255, 0.2)",
|
|
315
|
+
profileForeground: "rgba(255, 255, 255, 0.06)",
|
|
316
|
+
selectedOptionBorder: "rgba(224, 232, 255, 0.1)",
|
|
317
|
+
standby: "#FFD641"
|
|
318
|
+
},
|
|
319
|
+
shadows: {
|
|
320
|
+
connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
321
|
+
dialog: "0px 8px 32px rgba(0, 0, 0, 0.32)",
|
|
322
|
+
profileDetailsAction: "0px 2px 6px rgba(37, 41, 46, 0.04)",
|
|
323
|
+
selectedOption: "0px 2px 6px rgba(0, 0, 0, 0.24)",
|
|
324
|
+
selectedWallet: "0px 2px 6px rgba(0, 0, 0, 0.24)",
|
|
325
|
+
walletLogo: "0px 2px 16px rgba(0, 0, 0, 0.16)"
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
midnightTheme.accentColors = accentColors;
|
|
329
|
+
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/__private__/index.ts
|
|
332
|
+
const __private__ = {
|
|
333
|
+
DesktopOptions,
|
|
334
|
+
dialogContent,
|
|
335
|
+
dialogContentMobile,
|
|
336
|
+
MobileOptions
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
//#endregion
|
|
340
|
+
export { ConnectButton, RainbowKitAuthenticationProvider, RainbowKitProvider, WalletButton, __private__, connectorsForWallets, createAuthenticationAdapter, cssObjectFromTheme, cssStringFromTheme, darkTheme, getDefaultConfig, getDefaultWallets, getWalletConnectConnector, lightTheme, midnightTheme, useAccountModal, useAddRecentTransaction, useChainModal, useConnectModal };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/wallets/walletConnectors/injectedWallet/injectedWallet.svg
|
|
3
|
+
var injectedWallet_default = "data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"28\" height=\"28\" fill=\"none\"><path fill=\"%23fff\" d=\"M0 0h28v28H0z\"/><rect width=\"20\" height=\"16\" x=\"4\" y=\"6\" fill=\"url(%23a)\" rx=\"3.5\"/><path fill=\"%230E76FD\" d=\"M16 14a3 3 0 0 1 3-3h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C25 11.76 25 12.04 25 12.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C24.24 17 23.96 17 23.4 17H19a3 3 0 0 1-3-3Z\"/><circle cx=\"19\" cy=\"14\" r=\"1.25\" fill=\"%23A3D7FF\"/><defs><linearGradient id=\"a\" x1=\"14\" x2=\"14\" y1=\"6\" y2=\"22\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"%23174299\"/><stop offset=\"1\" stop-color=\"%23001E59\"/></linearGradient></defs></svg>";
|
|
4
|
+
|
|
5
|
+
//#endregion
|
|
6
|
+
export { injectedWallet_default as default };
|