@tuwaio/nova-connect 1.0.0-fix-test-alpha.7.eac112e → 1.0.0-fix-imports-alpha.1.c5966b4
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 +8 -64
- package/dist/ToastError-CSlbvXKT.d.cts +106 -0
- package/dist/ToastError-CSlbvXKT.d.ts +106 -0
- package/dist/chunk-6TJVIEAU.js +6 -0
- package/dist/chunk-6TJVIEAU.js.map +1 -0
- package/dist/chunk-A2677K5M.cjs +2 -0
- package/dist/chunk-A2677K5M.cjs.map +1 -0
- package/dist/chunk-LF6FTUUQ.js +2 -0
- package/dist/chunk-LF6FTUUQ.js.map +1 -0
- package/dist/chunk-MPEJHQKC.js +2 -0
- package/dist/chunk-MPEJHQKC.js.map +1 -0
- package/dist/{chunk-FNWARYJY.js → chunk-MQGDTFY7.js} +2 -2
- package/dist/{chunk-FNWARYJY.js.map → chunk-MQGDTFY7.js.map} +1 -1
- package/dist/{chunk-6S5OTERL.cjs → chunk-NMQZA377.cjs} +2 -2
- package/dist/{chunk-6S5OTERL.cjs.map → chunk-NMQZA377.cjs.map} +1 -1
- package/dist/chunk-OA6MB7CZ.cjs +2 -0
- package/dist/chunk-OA6MB7CZ.cjs.map +1 -0
- package/dist/chunk-QASDLFV3.cjs +6 -0
- package/dist/chunk-QASDLFV3.cjs.map +1 -0
- package/dist/chunk-QERPNHKX.cjs +2 -0
- package/dist/chunk-QERPNHKX.cjs.map +1 -0
- package/dist/chunk-TAV7EL23.js +2 -0
- package/dist/chunk-TAV7EL23.js.map +1 -0
- package/dist/components/index.cjs +2 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +6432 -0
- package/dist/components/index.d.ts +6432 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/getChainsListByWalletType-CDPECVNS.cjs +2 -0
- package/dist/{getChainsListByWalletType-ZU7OPWTP.cjs.map → getChainsListByWalletType-CDPECVNS.cjs.map} +1 -1
- package/dist/{getChainsListByWalletType-EO6A7Q5A.js → getChainsListByWalletType-VMQ4BO2B.js} +2 -2
- package/dist/{getChainsListByWalletType-EO6A7Q5A.js.map → getChainsListByWalletType-VMQ4BO2B.js.map} +1 -1
- package/dist/hooks/index.cjs +2 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +70 -0
- package/dist/hooks/index.d.ts +70 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/index.cjs +2 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +15 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.cjs +1 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -7009
- package/dist/index.d.ts +13 -7009
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/satellite/index.cjs +2 -0
- package/dist/satellite/index.cjs.map +1 -0
- package/dist/satellite/index.d.cts +1 -0
- package/dist/satellite/index.d.ts +1 -0
- package/dist/satellite/index.js +2 -0
- package/dist/satellite/index.js.map +1 -0
- package/dist/types-D4Vti05g.d.cts +98 -0
- package/dist/types-D4Vti05g.d.ts +98 -0
- package/dist/useWalletNativeBalance-6RVzdGvM.d.ts +312 -0
- package/dist/useWalletNativeBalance-D8Ehciju.d.cts +312 -0
- package/package.json +23 -3
- package/dist/getChainsListByWalletType-ZU7OPWTP.cjs +0 -2
package/README.md
CHANGED
|
@@ -57,7 +57,9 @@ yarn add @tuwaio/nova-connect @tuwaio/satellite-core @tuwaio/orbit-core @tuwaio/
|
|
|
57
57
|
```tsx
|
|
58
58
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
59
59
|
import { satelliteEVMAdapter } from '@tuwaio/satellite-evm';
|
|
60
|
-
import {
|
|
60
|
+
import { SatelliteConnectProvider, NovaConnectProvider } from '@tuwaio/nova-connect';
|
|
61
|
+
import { EVMWalletsWatcher } from '@tuwaio/nova-connect/evm';
|
|
62
|
+
import { SolanaWalletsWatcher } from '@tuwaio/nova-connect/solana';
|
|
61
63
|
import { initializeSolanaMobileConnectors, satelliteSolanaAdapter } from '@tuwaio/satellite-solana';
|
|
62
64
|
import { createDefaultTransports, initAllConnectors } from '@tuwaio/satellite-evm';
|
|
63
65
|
import { createConfig } from '@wagmi/core';
|
|
@@ -70,7 +72,7 @@ export const appConfig = {
|
|
|
70
72
|
};
|
|
71
73
|
|
|
72
74
|
export const solanaRPCUrls = {
|
|
73
|
-
mainnet: '
|
|
75
|
+
mainnet: 'https://api.mainnet-beta.solana.com',
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
export const appEVMChains = [mainnet, polygon, arbitrum] as readonly [Chain, ...Chain[]];
|
|
@@ -97,12 +99,14 @@ export function Providers({ children }: { children: ReactNode }) {
|
|
|
97
99
|
<WagmiProvider config={wagmiConfig}>
|
|
98
100
|
<QueryClientProvider client={queryClient}>
|
|
99
101
|
<SatelliteConnectProvider
|
|
100
|
-
adapters={[satelliteEVMAdapter({ wagmiConfig }), satelliteSolanaAdapter()]}
|
|
102
|
+
adapters={[satelliteEVMAdapter({ wagmiConfig }), satelliteSolanaAdapter({ rpcUrls: solanaRPCUrls })]}
|
|
101
103
|
appName={appConfig.appName}
|
|
102
104
|
>
|
|
103
105
|
<EVMWalletsWatcher />
|
|
104
106
|
<SolanaWalletsWatcher />
|
|
105
|
-
|
|
107
|
+
<NovaConnectProvider>
|
|
108
|
+
{children}
|
|
109
|
+
</NovaConnectProvider>
|
|
106
110
|
</SatelliteConnectProvider>
|
|
107
111
|
</QueryClientProvider>
|
|
108
112
|
</WagmiProvider>
|
|
@@ -132,66 +136,6 @@ function App() {
|
|
|
132
136
|
|
|
133
137
|
-----
|
|
134
138
|
|
|
135
|
-
## 🎨 Customization
|
|
136
|
-
|
|
137
|
-
Nova Connect provides three levels of customization:
|
|
138
|
-
|
|
139
|
-
### Advanced Customization
|
|
140
|
-
|
|
141
|
-
```tsx
|
|
142
|
-
<ConnectButton
|
|
143
|
-
appChains={appEVMChains}
|
|
144
|
-
solanaRPCUrls={solanaRPCUrls}
|
|
145
|
-
customization={{
|
|
146
|
-
connectButton: {
|
|
147
|
-
classNames: {
|
|
148
|
-
button: ({ buttonData }) => `btn ${buttonData.isConnected ? 'btn-connected' : 'btn-connect'}`,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
provider: {
|
|
152
|
-
errors: {
|
|
153
|
-
position: 'bottom-right',
|
|
154
|
-
autoClose: 5000,
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
}}
|
|
158
|
-
/>
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Full Provider Customization
|
|
162
|
-
|
|
163
|
-
```tsx
|
|
164
|
-
<NovaConnectButton
|
|
165
|
-
appChains={appEVMChains}
|
|
166
|
-
solanaRPCUrls={solanaRPCUrls}
|
|
167
|
-
customization={{
|
|
168
|
-
provider: {
|
|
169
|
-
// Custom components
|
|
170
|
-
components: {
|
|
171
|
-
ErrorsProvider: CustomErrorsProvider,
|
|
172
|
-
LabelsProvider: CustomLabelsProvider,
|
|
173
|
-
},
|
|
174
|
-
// Label customization
|
|
175
|
-
labels: {
|
|
176
|
-
merge: (defaultLabels, userLabels) => ({ ...defaultLabels, ...userLabels }),
|
|
177
|
-
transform: (mergedLabels, context) => ({
|
|
178
|
-
...mergedLabels,
|
|
179
|
-
connectWallet: context.isConnected ? 'Reconnect' : 'Connect Wallet',
|
|
180
|
-
}),
|
|
181
|
-
},
|
|
182
|
-
// Lifecycle hooks
|
|
183
|
-
initialization: {
|
|
184
|
-
onConnectionStateChange: (isConnected, wallet, context) => {
|
|
185
|
-
console.log('Connection state changed:', isConnected);
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
}}
|
|
190
|
-
/>
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
-----
|
|
194
|
-
|
|
195
139
|
## 🧩 Key Components
|
|
196
140
|
|
|
197
141
|
### 1. **ConnectButton**
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { OrbitAdapter } from '@tuwaio/orbit-core';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
declare const getNetworkIcon: (adapter: OrbitAdapter) => {
|
|
6
|
+
chainId: number;
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
9
|
+
chainId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
|
|
13
|
+
type CustomIconProps = {
|
|
14
|
+
isCopied: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
'aria-hidden'?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type CustomTitleProps = {
|
|
19
|
+
title: string;
|
|
20
|
+
titleId: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
type CustomDescriptionProps = {
|
|
24
|
+
rawError: string;
|
|
25
|
+
descriptionId: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
type CustomButtonContentProps = {
|
|
29
|
+
icon: ReactNode;
|
|
30
|
+
isCopied: boolean;
|
|
31
|
+
copyLabel: string;
|
|
32
|
+
copiedLabel: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Customization options for ToastError component
|
|
36
|
+
*/
|
|
37
|
+
type ToastErrorCustomization = {
|
|
38
|
+
/** Override container element props */
|
|
39
|
+
containerProps?: Partial<Omit<ComponentPropsWithoutRef<'div'>, 'style'>>;
|
|
40
|
+
/** Override button element props */
|
|
41
|
+
buttonProps?: Partial<Omit<ComponentPropsWithoutRef<'button'>, 'style'>>;
|
|
42
|
+
/** Custom components */
|
|
43
|
+
components?: {
|
|
44
|
+
/** Custom icon component */
|
|
45
|
+
Icon?: ComponentType<CustomIconProps>;
|
|
46
|
+
/** Custom title component */
|
|
47
|
+
Title?: ComponentType<CustomTitleProps>;
|
|
48
|
+
/** Custom description component */
|
|
49
|
+
Description?: ComponentType<CustomDescriptionProps>;
|
|
50
|
+
/** Custom button content component */
|
|
51
|
+
ButtonContent?: ComponentType<CustomButtonContentProps>;
|
|
52
|
+
};
|
|
53
|
+
/** Custom class name generators */
|
|
54
|
+
classNames?: {
|
|
55
|
+
/** Function to generate container classes */
|
|
56
|
+
container?: (params: {
|
|
57
|
+
hasTitle: boolean;
|
|
58
|
+
hasError: boolean;
|
|
59
|
+
}) => string;
|
|
60
|
+
/** Function to generate title classes */
|
|
61
|
+
title?: (params: {
|
|
62
|
+
title: string;
|
|
63
|
+
}) => string;
|
|
64
|
+
/** Function to generate description classes */
|
|
65
|
+
description?: (params: {
|
|
66
|
+
rawError: string;
|
|
67
|
+
}) => string;
|
|
68
|
+
/** Function to generate button classes */
|
|
69
|
+
button?: (params: {
|
|
70
|
+
isCopied: boolean;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
}) => string;
|
|
73
|
+
/** Function to generate icon classes */
|
|
74
|
+
icon?: (params: {
|
|
75
|
+
isCopied: boolean;
|
|
76
|
+
}) => string;
|
|
77
|
+
};
|
|
78
|
+
/** Custom event handlers */
|
|
79
|
+
handlers?: {
|
|
80
|
+
/** Custom click handler wrapper */
|
|
81
|
+
onClick?: (originalHandler: (event: React.MouseEvent<HTMLButtonElement>) => void, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
82
|
+
/** Custom keydown handler wrapper */
|
|
83
|
+
onKeyDown?: (originalHandler: (event: React.KeyboardEvent<HTMLButtonElement>) => void, event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
interface ToastErrorProps extends Omit<ComponentPropsWithoutRef<'div'>, 'role' | 'aria-live' | 'style'> {
|
|
87
|
+
/** Error title to display */
|
|
88
|
+
title: string;
|
|
89
|
+
/** Raw error message to display and copy */
|
|
90
|
+
rawError: string;
|
|
91
|
+
/** Custom CSS classes for the container */
|
|
92
|
+
className?: string;
|
|
93
|
+
/** Custom ARIA label for the error container */
|
|
94
|
+
'aria-label'?: string;
|
|
95
|
+
/** Callback fired when copy operation completes */
|
|
96
|
+
onCopyComplete?: (success: boolean) => void;
|
|
97
|
+
/** Customization options */
|
|
98
|
+
customization?: ToastErrorCustomization;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A highly customizable error toast component with copy functionality and extensive styling options.
|
|
102
|
+
* Provides comprehensive customization for appearance, behavior, and event handling while maintaining accessibility.
|
|
103
|
+
*/
|
|
104
|
+
declare const ToastError: React$1.ForwardRefExoticComponent<ToastErrorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
105
|
+
|
|
106
|
+
export { type ToastErrorCustomization as T, type ToastErrorProps as a, ToastError as b, getNetworkIcon as g };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { OrbitAdapter } from '@tuwaio/orbit-core';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
declare const getNetworkIcon: (adapter: OrbitAdapter) => {
|
|
6
|
+
chainId: number;
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
9
|
+
chainId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
|
|
13
|
+
type CustomIconProps = {
|
|
14
|
+
isCopied: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
'aria-hidden'?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type CustomTitleProps = {
|
|
19
|
+
title: string;
|
|
20
|
+
titleId: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
type CustomDescriptionProps = {
|
|
24
|
+
rawError: string;
|
|
25
|
+
descriptionId: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
type CustomButtonContentProps = {
|
|
29
|
+
icon: ReactNode;
|
|
30
|
+
isCopied: boolean;
|
|
31
|
+
copyLabel: string;
|
|
32
|
+
copiedLabel: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Customization options for ToastError component
|
|
36
|
+
*/
|
|
37
|
+
type ToastErrorCustomization = {
|
|
38
|
+
/** Override container element props */
|
|
39
|
+
containerProps?: Partial<Omit<ComponentPropsWithoutRef<'div'>, 'style'>>;
|
|
40
|
+
/** Override button element props */
|
|
41
|
+
buttonProps?: Partial<Omit<ComponentPropsWithoutRef<'button'>, 'style'>>;
|
|
42
|
+
/** Custom components */
|
|
43
|
+
components?: {
|
|
44
|
+
/** Custom icon component */
|
|
45
|
+
Icon?: ComponentType<CustomIconProps>;
|
|
46
|
+
/** Custom title component */
|
|
47
|
+
Title?: ComponentType<CustomTitleProps>;
|
|
48
|
+
/** Custom description component */
|
|
49
|
+
Description?: ComponentType<CustomDescriptionProps>;
|
|
50
|
+
/** Custom button content component */
|
|
51
|
+
ButtonContent?: ComponentType<CustomButtonContentProps>;
|
|
52
|
+
};
|
|
53
|
+
/** Custom class name generators */
|
|
54
|
+
classNames?: {
|
|
55
|
+
/** Function to generate container classes */
|
|
56
|
+
container?: (params: {
|
|
57
|
+
hasTitle: boolean;
|
|
58
|
+
hasError: boolean;
|
|
59
|
+
}) => string;
|
|
60
|
+
/** Function to generate title classes */
|
|
61
|
+
title?: (params: {
|
|
62
|
+
title: string;
|
|
63
|
+
}) => string;
|
|
64
|
+
/** Function to generate description classes */
|
|
65
|
+
description?: (params: {
|
|
66
|
+
rawError: string;
|
|
67
|
+
}) => string;
|
|
68
|
+
/** Function to generate button classes */
|
|
69
|
+
button?: (params: {
|
|
70
|
+
isCopied: boolean;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
}) => string;
|
|
73
|
+
/** Function to generate icon classes */
|
|
74
|
+
icon?: (params: {
|
|
75
|
+
isCopied: boolean;
|
|
76
|
+
}) => string;
|
|
77
|
+
};
|
|
78
|
+
/** Custom event handlers */
|
|
79
|
+
handlers?: {
|
|
80
|
+
/** Custom click handler wrapper */
|
|
81
|
+
onClick?: (originalHandler: (event: React.MouseEvent<HTMLButtonElement>) => void, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
82
|
+
/** Custom keydown handler wrapper */
|
|
83
|
+
onKeyDown?: (originalHandler: (event: React.KeyboardEvent<HTMLButtonElement>) => void, event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
interface ToastErrorProps extends Omit<ComponentPropsWithoutRef<'div'>, 'role' | 'aria-live' | 'style'> {
|
|
87
|
+
/** Error title to display */
|
|
88
|
+
title: string;
|
|
89
|
+
/** Raw error message to display and copy */
|
|
90
|
+
rawError: string;
|
|
91
|
+
/** Custom CSS classes for the container */
|
|
92
|
+
className?: string;
|
|
93
|
+
/** Custom ARIA label for the error container */
|
|
94
|
+
'aria-label'?: string;
|
|
95
|
+
/** Callback fired when copy operation completes */
|
|
96
|
+
onCopyComplete?: (success: boolean) => void;
|
|
97
|
+
/** Customization options */
|
|
98
|
+
customization?: ToastErrorCustomization;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A highly customizable error toast component with copy functionality and extensive styling options.
|
|
102
|
+
* Provides comprehensive customization for appearance, behavior, and event handling while maintaining accessibility.
|
|
103
|
+
*/
|
|
104
|
+
declare const ToastError: React$1.ForwardRefExoticComponent<ToastErrorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
105
|
+
|
|
106
|
+
export { type ToastErrorCustomization as T, type ToastErrorProps as a, ToastError as b, getNetworkIcon as g };
|