@xyo-network/react-connected-accounts 6.1.3 → 6.2.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.
@@ -1,142 +1,4 @@
1
- import { EIP6963Connector, DiscoveredWallets, EthWallet, EthWalletConnectorBase } from '@xylabs/react-crypto';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { FlexBoxProps } from '@xylabs/react-flexbox';
4
- import { FormControlProps, DialogProps, TableCellProps, TableProps, TableRowProps } from '@mui/material';
5
- import React, { ComponentType, Dispatch, SetStateAction } from 'react';
6
- import { TableHeadCell } from '@xyo-network/react-table';
7
-
8
- /**
9
- * State for storing wallets and their enabled/disabled status by name
10
- */
11
- interface EnabledEthWalletsState {
12
- [rdns: string]: {
13
- enabled: boolean;
14
- wallet: EIP6963Connector;
15
- };
16
- }
17
- /**
18
- * State for storing only enabled/disabled status of a wallet by name
19
- */
20
- interface EnabledWalletsSavedState {
21
- [rdns: string]: boolean;
22
- }
23
- type WalletListener = () => void;
24
- declare class EnabledEthWalletConnections {
25
- persistPreferences: boolean;
26
- private enabledWallets;
27
- private ethWalletsState;
28
- private listeners;
29
- private localStorageKey;
30
- constructor(localStorageKey?: string);
31
- get wallets(): EnabledEthWalletsState;
32
- disableWallet(rdns: string): void;
33
- enableWallet(rdns: string): void;
34
- /**
35
- * Given a new set of wallets, set their enabled state based off previous preferences
36
- */
37
- resetWallets(wallets: DiscoveredWallets): void;
38
- subscribe(listener: WalletListener): () => void;
39
- toggleEnabledWallet(rdns: string, enabled: boolean): void;
40
- private emitChange;
41
- private isPersistance;
42
- private persistSettings;
43
- private reviveSettings;
44
- }
45
-
46
- interface ConnectedAccountsFlexboxProps extends FlexBoxProps {
47
- ignoreConnectDialog?: boolean;
48
- onIgnoreConnectDialog?: (checked: boolean) => void;
49
- }
50
- declare const ConnectedAccountsFlexbox: {
51
- ({ ref, ignoreConnectDialog, onIgnoreConnectDialog, ...props }: ConnectedAccountsFlexboxProps): react_jsx_runtime.JSX.Element;
52
- displayName: string;
53
- };
54
-
55
- interface CheckboxFormControlProps extends FormControlProps {
56
- onCheckChanged?: (checked: boolean) => void;
57
- }
58
- declare const CheckboxFormControl: React.FC<CheckboxFormControlProps>;
59
-
60
- interface ActiveProvider {
61
- connectWallet?: EthWallet['connectWallet'];
62
- icon?: string;
63
- providerName?: string;
64
- }
65
-
66
- declare const WalletsTableHeadCells: TableHeadCell[];
67
-
68
- interface ConnectWalletDialogProps extends DialogProps {
69
- activeProvider?: ActiveProvider;
70
- onIgnoreConnectDialog?: (checked: boolean) => void;
71
- }
72
- declare const ConnectWalletDialog: React.FC<ConnectWalletDialogProps>;
73
-
74
- interface RevokeWalletConnectionDialogProps extends DialogProps {
75
- activeProvider?: ActiveProvider;
76
- }
77
- declare const RevokeWalletConnectionDialog: React.FC<RevokeWalletConnectionDialogProps>;
78
-
79
- interface ConnectedWalletTableCellProps {
80
- additionalAccounts?: string[];
81
- chainName?: string;
82
- connected?: boolean;
83
- currentAccount?: string[];
84
- icon?: string;
85
- onConnect?: () => Promise<void>;
86
- onRevoke?: () => void;
87
- tableCellProps?: TableCellProps;
88
- totalAccounts: number;
89
- walletName?: string;
90
- walletRdns?: string;
91
- }
92
-
93
- declare const ConnectedWalletsAccountsTableCell: React.FC<ConnectedWalletTableCellProps>;
94
-
95
- declare const ConnectedWalletsActionsTableCell: React.FC<ConnectedWalletTableCellProps>;
96
-
97
- declare const ConnectedWalletTableCells: ComponentType<ConnectedWalletTableCellProps>[];
98
-
99
- declare const ConnectedWalletsChainNameTableCell: React.FC<ConnectedWalletTableCellProps>;
100
-
101
- declare const ConnectedWalletState: React.FC<ConnectedWalletTableCellProps>;
102
-
103
- declare const ConnectedWalletsWalletTableCell: React.FC<ConnectedWalletTableCellProps>;
104
-
105
- interface ConnectedWalletsTableProps extends TableProps {
106
- ignoreConnectDialog?: boolean;
107
- onIgnoreConnectDialog?: (checked: boolean) => void;
108
- wallets?: EIP6963Connector[];
109
- }
110
- declare const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps>;
111
-
112
- interface WalletConnectionsTableRowProps extends TableRowProps {
113
- ignoreConnectDialog?: boolean;
114
- onConnectClick?: (activeProvider: ActiveProvider) => void;
115
- onRevoke?: (activeProvider: ActiveProvider) => void;
116
- wallet: EthWalletConnectorBase;
117
- }
118
- declare const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRowProps>;
119
-
120
- declare const useActiveProviderDialogState: (setActiveProvider: Dispatch<SetStateAction<ActiveProvider | undefined>>) => [boolean, (activeProvider: ActiveProvider) => void, () => void];
121
-
122
- declare const useDetectedWallets: () => {
123
- sortedWallets: EIP6963Connector[];
124
- totalConnectedAccounts: number;
125
- };
126
-
127
- /**
128
- * Takes the discovered wallets and tracks their enabled state globally
129
- */
130
- declare const useEnabledWalletsInner: (enabledWalletsRdns?: EnabledWalletsSavedState) => EnabledEthWalletsState;
131
- /**
132
- * Expose an interface for enabling and disabling wallets
133
- */
134
- declare const useEnabledWallets: (enabledWalletsRdns?: EnabledWalletsSavedState) => {
135
- disableWallet: ((rdns: string) => void) | undefined;
136
- enableWallet: ((rdns: string) => void) | undefined;
137
- enabledWallets: EnabledEthWalletsState;
138
- wallets: EnabledEthWalletsState;
139
- };
140
-
141
- export { CheckboxFormControl, ConnectWalletDialog, ConnectedAccountsFlexbox, ConnectedWalletState, ConnectedWalletTableCells, ConnectedWalletsAccountsTableCell, ConnectedWalletsActionsTableCell, ConnectedWalletsChainNameTableCell, ConnectedWalletsTable, ConnectedWalletsWalletTableCell, EnabledEthWalletConnections, RevokeWalletConnectionDialog, WalletConnectionsTableRow, WalletsTableHeadCells, useActiveProviderDialogState, useDetectedWallets, useEnabledWallets, useEnabledWalletsInner };
142
- export type { ActiveProvider, CheckboxFormControlProps, ConnectWalletDialogProps, ConnectedAccountsFlexboxProps, ConnectedWalletsTableProps, EnabledEthWalletsState, EnabledWalletsSavedState, RevokeWalletConnectionDialogProps, WalletConnectionsTableRowProps, WalletListener };
1
+ export * from './classes/index.ts';
2
+ export * from './components/index.ts';
3
+ export * from './hooks/index.ts';
4
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-connected-accounts",
3
- "version": "6.1.3",
3
+ "version": "6.2.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -39,20 +39,20 @@
39
39
  "module": "dist/browser/index.mjs",
40
40
  "types": "dist/browser/index.d.ts",
41
41
  "dependencies": {
42
- "@xylabs/react-crypto": "^6.3.13",
43
- "@xylabs/react-flexbox": "^6.3.13",
44
- "@xyo-network/react-table": "^6.1.3"
42
+ "@xylabs/react-crypto": "^6.4.0",
43
+ "@xylabs/react-flexbox": "^6.4.0",
44
+ "@xyo-network/react-table": "^6.2.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@mui/icons-material": "^7.2.0",
48
48
  "@mui/material": "^7.2.0",
49
- "@storybook/react-vite": "^9.0.17",
49
+ "@storybook/react-vite": "^9.0.18",
50
50
  "@types/react": "^19.1.8",
51
- "@xylabs/ts-scripts-yarn3": "next",
52
- "@xylabs/tsconfig-react": "next",
53
- "react": "^19.1.0",
54
- "react-dom": "^19.1.0",
55
- "storybook": "^9.0.17",
51
+ "@xylabs/ts-scripts-yarn3": "^7.0.1",
52
+ "@xylabs/tsconfig-react": "^7.0.1",
53
+ "react": "^19.1.1",
54
+ "react-dom": "^19.1.1",
55
+ "storybook": "^9.0.18",
56
56
  "typescript": "^5.8.3"
57
57
  },
58
58
  "peerDependencies": {
@@ -1 +1 @@
1
- import type {} from '@mui/material/themeCssVarsAugmentation'
1
+ import '@mui/material/themeCssVarsAugmentation'